Rotate UVW's

Rotate UVW's

Anonymous
Not applicable
401 Views
2 Replies
Message 1 of 3

Rotate UVW's

Anonymous
Not applicable
I'm trying to rotate selected Faces by 45 degree increments using maxscript, but getting quirky results.
The usual workflow is add unwrap UVW, select face, enable angle snap, select rotate then rotate the selection in the editor.

I have shorcuts for the Flip Vertical and Flip Horizontal, these work without having to open the editor, is it possible to do the same with rotate ?

tia
0 Likes
402 Views
2 Replies
Replies (2)
Message 2 of 3

Anonymous
Not applicable
Here is code I just wrote very recently to add an Unwrap, select all the faces, and do a quick planar map, and I didn't have to have the Edit window open.

  
modPanel.addModToSelection (Unwrap_UVW ()) before:(obj.modifiers.count)
modPanel.setCurrentObject obj.modifiers node:obj
obj.unwrap_uvw.unwrap.setMapChannel 99
--obj.unwrap_uvw.unwrap.setMapChannel 99

subObjectLevel = 3

--Select All Faces
actionMan.executeAction 0 "40021"

--Planar map to reset face breaks if need be
obj.Unwrap_UVW.planarMap()

--Flatten Mapping
obj.Unwrap_UVW.flattenMap 45.0 #() 0.00 true 0 true true

subObjectLevel = 0

--Collapse the stack (Use Collapse to, to preserve the stack)
maxOps.CollapseNodeto obj ( obj.modifiers.count) true
0 Likes
Message 3 of 3

PiXeL_MoNKeY
Collaborator
Collaborator
obj.unwrap_uvw.unwrap2.rotateSelected float_angle point3_axis
obj.unwrap_uvw.unwrap2.rotateSelectedCenter float_angle

float_angle: is based on radians so you may want to call (degToRad 45.0) to convert the angles from degrees to radians.

point3_axis: is user defined center in uv space, if you don't want to use the selection center.

-Eric

EDIT: you may need to enable Constant Update to see the changes without opening the edit dialog. obj.unwrap_uvw.unwrap.setConstantUpdate true
0 Likes