View Single Post
  #8  
Old 01-18-2011, 02:51 PM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
That's the problem with wanting to clear the entire scene, other modules might add their own hidden nodes to the scene which can cause problems when you delete them.

You can keep track of all the nodes you create and delete them individually, as Jeff already suggested.

The approach I would recommend is to create a root group node and add all your objects as children of it. Then you just need to delete the root node and all your objects will be cleared. Here is an example:
Code:
# Root node for all objects
root = viz.addGroup()

# Add object underneath root
court = viz.addTexQuad(parent=root)

.
.
.
# This will delete all the objects added to root
root.remove()
Reply With Quote