putting a texture map on a model
hello;
I have a model, created in Lightwave; in Dir. I have applied meshdeform
modifier;
I have a jpg in the cast; the jpg is the texture map produced in LW as per a
UV map in LW;
now I want to get the jpg onto the model;
I have a book, Director 8.5 Shockwave Studio for 3D, that suggests that this
is possible, but it does not elaborate;
I suppose that I will need vertexlist and texturecoordinatelist and somehow
tell director to take the (Uth,Vth) pixel of the texture map jpg and place it
at the (Xth,Yth,Zth) position?
any thoughts, books, tutorials, phone call?
thanks
dsdsdsdsd
Chicago
Re: putting a texture map on a model
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...
member("3dmembername")
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
to change.
Then, this command will swap it out (substitute everything in quotes
with the real names from your file):
member("3dmembername").texture("texturename").imag e=member("yourjpgmember").image
Re: putting a texture map on a model
Mike, thanks for the response;
I will give it a shot;
thanks,
dsdsdsdsd
Re: putting a texture map on a model
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;
thanks
dsdsdsdsd
Re: putting a texture map on a model
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.
Re: putting a texture map on a model
Mike,
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").imag e=member("yourjpgmember").imag
e;
and it worked for you??
Re: putting a texture map on a model
Yes. In fact I did it today.
Re: putting a texture map on a model
hmm ... I must be missing something;
Re: putting a texture map on a model
Mike, what version of Director are you using?
I am using version 9;
Re: putting a texture map on a model
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?
Re: putting a texture map on a model
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;
confusing;
Re: putting a texture map on a model
Hi
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!!!
Re: putting a texture map on a model
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.
--trace(member("BlueMan").modelResource[2].textureCoordinateList)
...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]
Re: putting a texture map on a model
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.
on exitFrame me
--Resets the 3D cast members
member("BlueMan").resetWorld()
--Applies the meshDeform modifier to the cast member.
member("BlueMan").model("BlueMan").addModifier(#me shDeform)
--Outputs different messages, accessible now that meshDeform has been
applied.
trace(member("BlueMan").model("BlueMan").meshDefor m.face.count) -- Outputs
568
trace(member("BlueMan").model("BlueMan").meshDefor m.mesh.count) -- Outputs 1
trace(member("BlueMan").modelResource[1]) -- Outputs plane("DefaultModel")
trace(member("BlueMan").modelResource[2]) -- Outputs modelResource("BlueMan")
put member("BlueMan").modelResource("BlueMan").texture CoordinateList--Script
error: Property not found
end