UVW Map - FIT

Hi everyone.

curious how to activate "Fit" in UVW Map

so far I have this script next line i want it to activate "Fit"
----------------------------
for obj in selection do addModifier obj (uvwMap maptype:0)
$.modifiers[#UVW_Map].axis = 1
-----------------------------

thank you in advance

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
miauu's picture

...

Read this:

https://www.scriptspot.com/bobo/mxs9/uvwgizmofit/

You can activate the FIT using UIAccessors if you want to go that way.

Mrjacks2o's picture

thank you for the reply i

thank you for the reply
i tried the script wasn't working for me for some reason
what is the code for fit using UIAccessors ?

thank you

miauu's picture

...

To use the UIAccessors you have to select each object one by one, the Modify Panel must be open, you have to find the FIT control and then to press it. The main drawback is that the Modify Panel must be open and the objects must be selected one by one, which will slow down the script.

You can search for "maxscript UIAccessors" and you will find a lot of examples how to use it.

Mrjacks2o's picture

thanks yea i

thanks yea i figured.
question

i found a different alternative maybe you can help with this.

-------------------------------------------------
modPanel.addModToSelection (Uvwmap ()) ui:on
$.modifiers[#UVW_Map].maptype = 0
$.modifiers[#UVW_Map].axis = 1
$.modifiers[#UVW_Map].length = 1.83054
$.modifiers[#UVW_Map].width = 14.1949
-------------------------------------------------

is there a way max can get find the Length and width of the object with a script instead of me doing it manually ?

thank you

miauu's picture

...

Yes. The Length and Width are the same values you see as Dimensions when you open the Objects Properties dialog(via right-click Quad Menu).
So, you can calculate Length and Width using maxscript.
Check this: https://www.scriptspot.com/3ds-max/scripts/object-properties-2-0

If it shows the same values for Length and Width you can strip the code that calculates the Dimensions of the selected object and use it in your script.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.