View Single Post
  #3  
Old 09-23-2010, 11:19 AM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The object.name field will hold the name of the lowest level transform. In the case of the .ive file that is a texture unless there is no texture. What you can do is get a handle to the child object using <node3D>.getChild and then check to see if that was picked:
Code:
import viz
import vizact

viz.go()
gallery = viz.addChild('gallery.ive')
painting = gallery.getChild('art04-FACES')


def showPicked():
	object = viz.pick()
	if object == painting:
		viz.logNotice('Dali painting picked')
	
vizact.onmousedown(viz.MOUSEBUTTON_LEFT,showPicked)
The following article shows what you can do when you get a handle to the GEODE sub-object in your script:

http://kb.worldviz.com/articles/1157
Reply With Quote