3 Replies Latest reply on Dec 19, 2007 6:45 AM by adam@blueapplestudio

    Trouble Applying meshDeform with JavaScript

    adam@blueapplestudio Level 1
      I am working on swapping images on the same model, and need to make sure that the UV coordinates don't change. I understand that I need to apply the meshDeform modifier to access the textureCoordinateList, but I don't think I am getting it right. Could anyone help with the correct syntax for applying the meshDeform modifier in JavaScript? Any help is appreciated.
        • 1. Re: Trouble Applying meshDeform with JavaScript
          _lw Level 1
          Can you explain a little bit more what is not working? To change a texture, you will under normal conditions not need the meshdeformmodifier. Just change the texture in the shader it should not change the texturecoordinatelist at all.

          But maybe i did not understand what you are trying to do exactly, can you explain it a little bit more?
          • 2. Re: Trouble Applying meshDeform with JavaScript
            Ex Malterra Level 1
            You've applied the modifier correctly. Your last line of code should be
            • 3. Re: Trouble Applying meshDeform with JavaScript
              adam@blueapplestudio Level 1
              Thank you both for your speedy responses.

              Hondo 3000
              I am already swapping the image map, but the image’s placement is wrong. When the new image is placed, the face portion of the image is mapped to the character’s butt, and vice versa. It was suggested in a previous thread that I look at the UV coordinates with textureCoordinateList before and after the image swap to see where the change is occurring.

              Ex Malterra
              Thanks for the code correction; that is very helpful. I have been encouraged by others to learn Director using JavaScript, as it is so close to ActionScript (which I am already familiar with,) and because JavaScript can have other applications outside of Director. However I am finding that code examples using JavaScript are few and far between.

              If anyone out there writes an exhaustive book on 3D in Director using JavaScript I’ll be the first to buy :)

              Take care.