WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 11-21-2013, 02:24 AM
chris2307 chris2307 is offline
Member
 
Join Date: Nov 2013
Posts: 36
Picking Sub Objects

Hi all,

I am having a bit of trouble identifying objects within a scene using the mouse. I have something working but it is not giving me the output I wanted or expected.

I have made a simple scene in 3DS Max which contains two balls (one named Red Ball and the other named Blue Ball). I exported the model to OSGB and loaded this up in a Vizard scene. I did not attach the separate polygons in 3DS Max but I did export the scene as one model.

In the Vizard inspector, I can see the model and select the different objects. The inspector kindly shows up "Floor" "Red Ball" and "Blue Ball" so I know this information is there.

However, when I use viz.pick(info=True) to return an object, I am able to identify the different objects when I hover my mouse over them but I don't get the names. Instead, I see "14 - Default", "15 - Default"and "09 - Default"

Here is my code:

Code:
def showPicked():
	object = viz.pick(info=True)
	if(object.valid):
		print object.name

vizact.ontimer(0.1, showPicked)
Can anyone help me understand what is going on?
Reply With Quote
  #2  
Old 11-21-2013, 05:12 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
Can you post a screenshot of the scene graph tree from Inspector?
Reply With Quote
  #3  
Old 11-22-2013, 04:16 AM
chris2307 chris2307 is offline
Member
 
Join Date: Nov 2013
Posts: 36
I am wanting to access the names "Blue Ball", "Red Ball" and "Floor".

Preferably using a method in a similar fashion as to viz.pick(). Although I did a search in the forum before posting this, I admittedly found a post I had missed which discussed the same problem. My bad!

The poster was told that he could get the name from node and compare this to the object returned from viz.pick() which I have been able to do but my issue with this is that eventually, I will want to be loading in large scenes so creating long if statements isn't the elegant (or possibly even the efficient) way I wanted to go about things.

P.s Thanks for the reply
Attached Thumbnails
Click image for larger version

Name:	Inspector.png
Views:	798
Size:	199.1 KB
ID:	622  
Reply With Quote
  #4  
Old 11-22-2013, 12:21 PM
Jeff Jeff is offline
WorldViz Team Member
 
Join Date: Aug 2008
Posts: 2,471
The geometry node names are assigned by the OSG exporter for Max using the material names. The viz.pick command is passing back the name of the lowest level node which is the geometry. If your objects have different materials you can rename the materials so those names show up when you pick the object.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Picking up Vizard Objects on mouse down with collisions pwsnow Vizard 2 09-17-2012 02:02 AM
Trouble picking text3d objects Salvar Vizard 4 12-01-2010 03:07 PM
Semi-circle array containing target and distractor objects ptjt255 Vizard 3 08-04-2009 03:09 AM
Picking on-the-fly objects Jerry Vizard 1 01-19-2007 12:29 PM
Could not find plugin to load objects... halley Vizard 1 05-30-2006 11:01 AM


All times are GMT -7. The time now is 11:01 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC