LC #42 Pipers Alley

View Full Version : unwrap uvw not setting values?

02-06-2009, 04:54 AM
I have an odd issue where my maxscript doesnt update the unwrapuvw modifier, but if i do the same code line by line in the listener it works :S

-- place unwrap mod ontop of stack
mObj = $
mMod = unwrap_uvw()
addmodifier mObj mMod
max modify mode
mMod.unwrap.setVC true

-- set face vert numbers
for f = 1 to mCopyMapFaces.count do
mFaceVerts = mCopyMapFaces[f]

for v = 1 to mFaceVerts.count do
mMod.unwrap.setFaceVertexIndex f v mFaceVerts[v] -- this doesnt work in maxscript, but in listener it does

-- move verts
for v = 1 to mCopyMapVerts.count do
mMod.unwrap.SetVertexPosition 0 v [0,0,0] -- this doesnt work in maxscript, but in listener it does

not sure what im missing....

02-06-2009, 07:17 AM
might be similar to this thread: - "addModifier $ (CameraMap CameraNode:$Camera01)" doesn't work

quick test here worked okay, though - can you dig up some values / code for your mCopyMapFaces and mCopyMapVerts?

02-06-2009, 08:52 AM
mCopyMapFaces if just an array of map Face numbers and their appropriate vertecies
mCopyMapVerts is just an array of verts uv positions ive just put [0,0,0] as a test.

Wonder if it has anything to do with being in a function. Ok ill see what i can figure out.

02-09-2009, 04:55 AM
ok i found the problem. When I change the channel from anything other than channel 1 this does not work :(

Does anyone know how to get the channel to change properly in the uvw modifier?

02-09-2009, 05:11 AM
You probably need to call a Reset on the new UVW channel. In recent versions of Max when you change the channel it doesn't automatically reset the data.


CGTalk Moderation
02-09-2009, 05:11 AM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.