Rendering an object relative to another in priority - Maya


#1

In Maya, is there a straightforward way to render an object so that it is always rendered whole even if another specific object is in front of it in a scene ?

All I can think of is rendering the first object alone with transparency and then overlaying it on the final render. But I could use a more straightforward way if there is one.

Thanks.