Rotate UVWMap gizmo a selection of object
Hello everyone :)
How do I rotate the gizmo a modifier UVWMap in a selection of object?
Scenario:
I have 10 box and I apply to each a modifier UVWMap.
I want rotate the gizmo UVWmap to each object of 90° (or other
value) randomly pressing a button so as to have 10 objects with different rotation mapping.
My example dont work...
rollout t "Test" ( local mymod = (UVWMap()) button b "Create UVWMap" button b2 "Random" on b pressed do ( addmod = for i in selection do addModifier i (UVWMap()) ui:on ) on b2 pressed do ( giz = mymod.gizmo giz.rotation = (angleaxis -90 [0,0,1]) as quat ) ) createdialog t
If I select only one object the script works in half (the button dont refresh the value every time I press it) and if I select all object, i have this error message:
>> MAXScript Rollout Handler Exception: -- Unknown property: "gizmo" in Uvwmap:UVW Mapping <<
Can you help me? I can not find a solution....
Thanks
Comments
Yes Joker it's all right !!
Yes Joker it's all right !! :) Thanks!!!!!!!!
The only problem is:
How to If I want rotate the uvwmap a defined value (es. 90° or 45° ecc.)always random
for all object?
Anyway thanks again! :)
Hi Michele, if I see, you
Hi Michele,
if I see, you need to choose random value between concrete vals like 45 and 90. If so, put them to array and use random index to select an item from.
a = #(-90, -45, 45, 90)
r = a[random 1 4]
my recent MAXScripts RSS (archive here)
Hi Anubis, Thanks for you
Hi Anubis, Thanks for you reply :)
Yes, now it's all right! I never thought of using an array to construct a random
value...this advice I will be very useful, this is a great tip that I will always remember ;)
Thanks again Anubis
Here you go!
John Martini
Digital Artist
http://www.JokerMartini.com (new site)