2 Replies Latest reply on Feb 20, 2007 12:45 PM by ensamblador

    cloneTextureFromCastMember()

    ensamblador Level 1
      Hi to everyone.

      Is there a way to clone a texture from one 3d member to another like clonemodelfromcastmember (cmfcm) ?

      I've been using cmfcm but i think it's a little inefficient. Basically you need to clone the model and delete it from the destination cast member. Besides cmfcm copies shaders, childs, resources or whatever is used by the model in the origin castmember

      Another way is to import the textures as bitmaps an create the textures as #fromcastmember. For me is easier to encapsulate them in a w3d file.

      Thanks in advance.

        • 1. Re: cloneTextureFromCastMember()
          duckets Level 1
          Nope, there's no easy built-in way.

          There's a third method which is pretty complex - you could be to capture the texture image from the source cast member using an orthographic camera and a plane with your texture on, at 100% emissive, set the cam's orthoheight so that one pixel = one texel, turn off texture filtering, set the member's rect to the exact size of the plane and grab the member's image. You could then use that image object as the source for your new texture in the other scene.

          - Ben
          • 2. Re: cloneTextureFromCastMember()
            ensamblador Level 1
            Thanks for the tip. I thik is useful when you dont have access (you dont have the files) to bitmaps.
            I prefer to import all the pitures in a separate cast and create the textures via newTexture.

            Bottom line, I used the above method.