PDA

View Full Version : mapping coordinates and undo


prettyPixel
02-09-2005, 11:17 PM
Hello,

i have a strange problem with the mapping coordinates: the undo
function don't work with UV's
Is this possible ?

I wrote a small script which illustrates the problem:
if you click on "create", the script create a box (editable poly) and apply a checkerboard on its surface
and if you click on "modify":
- the position of the box is modified
- the position of 1 vertex is modified
- the position of 1 vertexUVW is modified
and that's work...

but if you press UNDO (max menu), only the position of the box is restored and position of the vertex... But not the position of vertexUVW...
Has anyone encountered this problem ?
Thanx for help

prettyPixel

prettyPixel
02-11-2005, 12:29 PM
The code is:



rollout testRoll "test UV undo"
(
button create_osd "create"
button modify_osd "modify"
on create_osd pressed do
(
obj=box length:100.0 width:100.0 height:100.0 \
lengthsegs:2 widthsegs:2 heightsegs:2 \
pos:[0,0,0] mapcoords:true
convertToPoly obj
tm=checker()
tm.coords.U_Tile=true; tm.coords.U_Tiling=4
tm.coords.V_Tile=true; tm.coords.V_Tiling=4
mat=standardMaterial diffuseMap:tm selfIllumAmount:50.0
obj.name="box_testUVundo"
obj.material=mat
showTextureMap mat mat.diffuseMap true
max views redraw
)
on modify_osd pressed do
(
if IsValidNode(getNodeByName "box_testUVundo") then
(
obj=getNodeByName "box_testUVundo"
undo "box_undo" on
(
obj.pos.x+=10.0; obj.pos.y+=10.0; obj.pos.z+=10.0
polyOp.moveVert obj #{26} [-25,0,0]
vIdx=polyOp.getMapFace obj 1 5
coord=polyOp.getMapVert obj 1 vIdx[3]
coord.x+=0.25; coord.y+=0.25
polyOp.setMapVert obj 1 vIdx[3] coord
)
max views redraw
)
)
)
if testFloater != undefined do ( closerolloutfloater testFloater )
testFloater = newRolloutFloater "test" 128 128
addRollout testRoll testFloater rolledUp:false

prettyPixel
02-16-2005, 05:31 PM
any idea would be really appreciated :thumbsup:

CGTalk Moderation
02-16-2006, 06:00 PM
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.