This content has been marked as final. Show 13 replies
You should know the name of the texture. I don't use Lightwave, but in
MAX and Maya, it is the name of the texture in the texture
explorer/hypershade. If you don't know it, find it. Put the member
into Director's Object Explorer...
Now you can drill down to see all the models and the shaders and
textures applied to them. Find the name of the texture you are wanting
Then, this command will swap it out (substitute everything in quotes
with the real names from your file):
Mike, thanks for the response;
I will give it a shot;
Mike, although this method does change out the texture( actually the image for the texture), the new image is not aligned according to the UV mapping rules;
so I need to use Lingo to 'tell' director how to apply/align the image when I make the swap;
You shouldn't need to if the model is mapped in the 3d software already
before it gets exported. I pretty often will setup some specific UV
mapping for a model in MAX, then swap out the image at runtime. The uvs
are baked into the model, and I don't know of a way to change them on
the fly. You will have to make your new image so that it lines up with
the old one.
have you actually done this before:
1 - make model(3dmax for you), create UV map for model, apply image/texture using the UV map in 3dsmax;
2 - export to w3d;
3 - in Director, member("3dmembername").texture("texturename").image=member("yourjpgmember").image;
and it worked for you??
Yes. In fact I did it today.
hmm ... I must be missing something;
Mike, what version of Director are you using?
I am using version 9;
I am using V10 (Dir MX 2004). I don't remember if I ever did the same
thing in D9, but I think it should work... what is happening exactly?
Any error messages?
no error messages; it is replacing the texture, but the wrapping is incorrect, ie it is not abiding by the UV map;
however, if I include in my w3d( created in Lightwave ):
1- a dummy model, regardless of its shape/geometry, with the baked texture jpg applied to it without any particular mapping
2 - my good model with some random 1x1 imageand
3 - then in Director assign the baked jpg to the good model's shader's texture, it works;
seems like the UV info is being brought in to director with the model, not the shader or texture, but that only textures/jpgs that are also brought in in the same w3d are working;
I’m a Lightwave-Director 2004 user and swapping the image texture on the shader works well for me. You can try add the meshDeform Modifier to the model and check & save as a text file the textureCoordinateList of the meshes before and after swapping the texture`s image in the model, if both list aren’t equal there’s some problem with the texture coordinates on memory and could be resolved copying the texCoords before swapping and pasted again after that. I remember some issue about changing images on textures from imported W3D files on Dir 9, it doesn’t happens on runtime created geometry or Director 2004.
Have a nice coding!!!
My new image map is also being applied incorrectly. I have applied the meshDeform modifier, but am having trouble accessing the textureCoordinateList as David recommends. I am using the below code.
...this returns Script error: Property not found. I assume this is not the correct syntax for this operation. What would you suggest?
[Director MX 2004 | Windows XP | .w3d was exported from LightWave 8.5]
Don't mean to give this a bump, but I haven't heard anything for almost a month.
I am still trying to access my texture coordinates (as David Najar suggested) to see if my mapping is being changed. Some of my code is below. Any help is greatly appreciated.