View Single Post
  #2  
Old 06-10-2008, 10:00 AM
farshizzo farshizzo is offline
WorldViz Team Member
 
Join Date: Mar 2003
Posts: 2,849
The most optimal change would be to clone the existing model. However, changing the appearance of one object will affect all its clones. If you want to make unique appearance changes to each model, then the second best thing is to make a copy of the existing model. Here is sample code that will add 50 objects of the same file using the clone technique:
Code:
for x in range(50):
    model = viz.add('model.wrl',cache=viz.CACHE_CLONE)
Here is similar code that will add 50 objects of the same file using the copy technique:
Code:
for x in range(50):
    model = viz.add('model.wrl',cache=viz.CACHE_COPY)
Reply With Quote