Think of the entire chord that is being played. What mode? Think of the phrasing of the melody. How can you support the root/fifth basic tones and still add the color/flavor notes (3rd, 7th, etc) in passing.
Listen to Jaco's work on Joni Mitchell's mid 70s albums "MIngus" and "Hejira" and "Don Juan's reckless daughter". Very melodic yet fundamental-filling bass work, often right out there with nothing else but Joni's guitar and voice. He's almost like another harmony vocalist or horn player, sometimes while she's hammering away on a very low-tuned guitar, but he always stays in the scale and in the pocket.
Also check out Geddy's playing on Rush's first live album "All the World's a Stage". Especially when Alex goes off on a solo, listed to Ged's supportive harmonic grooves. Pre synth stuff for them, you can really hear the bones of the bass and his incredible TONE. Lead bass calls for lead tone, more mids!