#1
|
|||
|
|||
get object on mouse click
Hi all,
I'm very new with Vizard. I'm trying to get object on mouse click. But I just get to root object viz.VizChild(1) not the subobject like c1,c2.... The viz.pick(info=True).name just return the name of material not object name. How could I access to subobject? |
#2
|
|||
|
|||
You can use the node.getChild command to get a handle to a sub-node. Example:
Code:
slider = viz.addChild('sodoku.ive') c2 = slider.getChild('c2') . . . obj = viz.pick() if obj == c2: print 'c2 picked' |
#3
|
|||
|
|||
I already tried it. It worked.
But it is so strange to compare with other game engine Anyway, thanks for your comments |
#4
|
|||
|
|||
This works fine, but introduces extra drawables in the scene. With large scenes this can hurt the framerate. Is there no other way to do this? Maybe it can be on the wish-list for the next update?
|
#5
|
|||
|
|||
Calling getChild should not introduce more drawables. Can you post an example where it does?
This is already a feature in the upcoming Vizard 5 release. You will be able to get access to the full node hierarchy of the intersection. |
#6
|
|||
|
|||
It's sound great
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mouse bug in V3 and V4 | Renato Lima | Vizard | 2 | 05-11-2011 07:38 PM |
grabbing the object under mouse | dwaik | Vizard | 2 | 03-02-2010 02:46 AM |
retrieve Object names | Geoffrey | Vizard | 11 | 12-11-2009 05:26 AM |
how to pick up the object, move and rotate using mouse | nasr | Vizard | 5 | 05-05-2009 04:11 AM |
moving and object by mouse but don't know how to stop the movement | nlfrnassimi | Vizard | 8 | 04-26-2009 08:23 AM |