View Single Post
  #2  
Old 08-28-2016, 02:11 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
I ran both of the following scripts with the attached model and it worked. Only the alpha of one sub-part was changed. Does it only happen when you parent the object to your factory model?

Here is the object loaded on it's own:

Code:
import viz
viz.go()

object = viz.addChild('oil_pump.osgb')
object.hint(viz.COPY_SHARED_MATERIAL_HINT)
object.alpha(0, 'OilDrop1')
Here is the object parented to the ground model:

Code:
import viz
viz.go()

ground = viz.addChild('ground.osgb')
object = viz.addChild('oil_pump.osgb')
object.setParent(ground)
object.hint(viz.COPY_SHARED_MATERIAL_HINT)
object.alpha(0, 'OilDrop1')
Reply With Quote