PDA

View Full Version : Trouble accessing modifer gizmos


floopyb
12-17-2007, 07:03 AM
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

Gravey
12-17-2007, 09:36 AM
i think your problem is this:theUvwmap.gizmo = myMatrix should be theUvwmap.gizmo.transform = myMatrixuvwmap's gizmo is not a transform but it does have a transform property that can be set like I have shown.
hope this helps

floopyb
12-17-2007, 11:53 PM
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?

RustyKnight
12-18-2007, 06:14 AM
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

MoonDoggie
12-18-2007, 07:49 AM
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

floopyb
12-19-2007, 01:42 AM
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.

Gravey
12-19-2007, 11:11 AM
Hey Gravey, if you didn't inheritantly know that the .transform property existed on the gizmo how could you go about finding that out?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...

CGTalk Moderation
12-19-2007, 11:12 AM
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.