Thread: GEODE Names
View Single Post
  #3  
Old 11-07-2010, 03:49 PM
nige777 nige777 is offline
Member
 
Join Date: Nov 2007
Location: UK
Posts: 78
Talking Solved

Just in case someone else has a mental blockage over this (like me ) and just to close the thread,

I solved this by creating a dictionary that mapped the node id to the geode name, then its a simple matter of indexing to retrieve the GEODE name -

Code:
#Fill components list with model child nodes and then sort it
components = model.getNodeNames()
components.sort

#Traverse through scene graph children one by one and create dictionary map
for a in range(len(components)):
	if components[a] == "__VIZARD_NODE__": #finish loop at root node
		break
		
	elif components[a][-5:] == "GEODE":
		k = model.getChild(components[a])
		dict[k] = [components[a]]    #Create dictionary
		continue
The second condition statement checks the node name refers to geometry before creating a dictionary entry

Last edited by nige777; 11-07-2010 at 03:51 PM.
Reply With Quote