Auto Align UVWMap

1 vote
Version: 
1.1
Date Updated: 
06/21/2022
Author Name: 
Obaida

3dsMax Script for applying UVW Map Modifier Depending on the Longest Edge of each Face .

  • Normal Execute will keep all the UVW Map Modifiers . 
  • AltExexute will Collapse the UVW/EditPoly Modifiers .

UPDATE 1.1 :

  • Lock Max UI for Better Performance , (Thanks to Barigazi) . 

  • Add Progress Bar .

Video URL: 

Comments

Comment viewing options

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

Thanks

Thanks for the fix .

barigazy's picture

...

Predefined "GetFaceDegree" fn makes error. BTW ... only viewport and command panel are frozen but not MXS EDITOR and Listener
In these situations, when max freeze, just run this line alone  windows.sendmessage (windows.getmaxhwnd()) 0x000B 1 1
Here is the corrected code. Also, I added test scene code at the beginning

AttachmentSize
autoalignuvw_optimized.ms 3.53 KB

barigazy

obaida's picture

Thanks barigazy for the

Thanks barigazy for the advice and the optimize , I appreciate that , you did a lot for this community , keep it up to :) .
btw , the script you share throwing error and max freeze .

barigazy's picture

...

Nice job man (+1). I played with your code a bit.
A faster solution will be with single Unwrap modifier, but your concept is OK for simple geometries.
Anyway ... avoid declaring local variables inside "for-loop" because they are always local inside brackets. I added "UNDO" fn and windows.sendmessage which decreases a bit of time.
I tested this on six “frame” object (like 2nd object on your video) and this is the result:

-> your code
time:17.464 memory:233392L
-> optimized code
time:15.248 memory:185452L

Of course it can be optimized more ;)
Keep up good work

AttachmentSize
autoalignuvw_optimized.ms 3.07 KB

barigazy

Comment viewing options

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