[Closed] Trouble accessing modifer gizmos
Hi, Im writing a script to add a UVWmap modifier to an object then modify the gizmo but I keep getting the following error:
>> MAXScript Rollout Handler Exception: -- Unknown property: "gizmo" in Uvwmap:UVW Mapping <<
this is the part that falls over:
theUvwmap = uvwmap()
addmodifier myGround theUvwmap
theUvwmap.mapChannel = i
theUvwmap.gizmo = myMatrix
It works fine if I do that kind of thing line by line in the listener.
Cheers,
Jordan
i think your problem is this:
theUvwmap.gizmo = myMatrix
should be
theUvwmap.gizmo.transform = myMatrix
uvwmap’s gizmo is not a transform but it does have a transform property that can be set like I have shown.
hope this helps
Ok, It seemed that I had to declare theUvwmap = UVWmap() as a global rather than in a loop in a ‘on button pressed’.
Anyone know why?
Lots of reasons, none of which I can tell you because I haven’t seen the code?!?
Shane
Hey Gravey, if you didn’t inheritantly know that the .transform property existed on the gizmo how could you go about finding that out?
Thanks for the info,
-Colin
i’m sure there’ll be some info in the reference somewhere but as a general rule of thumb: if you can move, scale and rotate something, it most likely has a .transform property.
This being said… i had a go at assigning a transform matrix to the gizmo without using the .transform property ie. $.modifiers[1].gizmo = matrix3 1 and it worked fine so my bad.
I also looked into floopyb’s problem and he’s right, this is quite a silly thing… It says in the maxscript reference that the .gizmo property will not be available until you add it to a node. Well i’m not sure how else you go about doing that via MXS other than using the addModifier function and that clearly involves adding it to a node…
ok, I figured it out (with a bit of help).
To access the gizmo you need to have the object selected and be in modifier mode or else max wont see that the uvwmap gizmo has been created.
Very silly!!
Its this type of thing that drives me mad with maxscript and wastes way too much of my time.