Rotate uvmap in 90 degree steps


#1

Hello community,
I need a little help and i hope someone can help me :), in my script i want to rotate the uvmap by 90 degree steps and i coundnt figure out how to do it.
At the moment the script are rotating the uvmap in 360 degree, but in smaller steps not just 90 degree steps, f.e. (0, 90, 180, 270 etc).
Has someone an idea?

thx Dragan

rollout UVmaprot "Rotate random uvmap"
(
 
	button uvrot "Random rotate uvmap"
 
	on uvrot pressed do 
	(
		for i = 1 to selection.count do
		(
			obj = selection[i]
			gizm =obj.modifiers[1].gizmo
			valrot = random -360 360
			gizm.rotation = (angleaxis valrot [0,0,1]) 
		)
	)
 
)
createdialog UVmaprot

#2
$.uvwmap.gizmo.transform = prerotateZ $.uvwmap.gizmo.transform 45 -- where the angle is in degrees 

#3

Thx that helped a lot