2 Replies Latest reply on Sep 5, 2006 1:13 PM by extol

    Cloned models

    extol
      Hi. I have a W3D scene where I created a lot of plants. They are all clones of the same model, so I figured it shouldn't make the file much bigger. Well, 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 W3D and have it use instances of the same plant model instead of a new model for each plant?
        • 1. Re: Cloned models
          Level 7

          "extol" <webforumsuser@macromedia.com> wrote in message
          news:edila6$cc6$1@forums.macromedia.com...
          > Hi. I have a W3D scene where I created a lot of plants. They are all
          > clones
          > of the same model, so I figured it shouldn't make the file much bigger.
          > Well,
          > 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
          > W3D
          > and have it use instances of the same plant model instead of a new model
          > for
          > each plant?

          Hi there,

          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.

          Cheers

          Richard


          • 2. Re: Cloned models
            extol Level 1
            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?