This content has been marked as final. Show 2 replies
"extol" <email@example.com> wrote in message
> Hi. I have a W3D scene where I created a lot of plants. They are all
> of the same model, so I figured it shouldn't make the file much bigger.
> the file went from 4MB to 12MB. It took a long time to export from 3Ds
> Max and
> it seemed to export every model separately. Is there any way to export my
> and have it use instances of the same plant model instead of a new model
> each plant?
Check out clone and cloneDeep in the docs. Just import one plant model, and
clone it at startup.
Remember to resetWorld() on the member before you clone though, to make sure
the old clones have been removed from the previous time you run the game.
If you need to adjust individual properties like shader values you have to
use cloneDeep() which clones all the resources as well as the model data.
Otherwise just use clone() as it's more efficient.
Thanks for your reply. I see what you are saying. But I shouldn't set up my plant models in 3DS Max? Should I make an editor in Director and place my plant models in that? Then have it export the coordinates of each plant and use that in my actual game to know where to place the cloned models?
Also, I have heard that using clone() in repetition becomes EXTREMELY slow (because of a bug or something) and to use loadFile(). Anyone know anything about this?