Auto Align UVWMap

2 votes
Version: 
1.4
Date Updated: 
09/11/2022
Author Name: 
Obaida

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

UPDATE 1.4 :

  • Fix UV Modifier Alignment .

  • Set Coordinate system to Local (getting wrong result on other coordsystems) .

UPDATE 1.3 :

  • Improve the Function of Grouping Faces by Angle .

UPDATE 1.2 :

  • New UI .
  • Improved Function Speed .
  • Add CheckBox to Get UV Rotation from Selected Edges .
  • Add Max Angle Value to Detect Polys with Same UV Modifier .

UPDATE 1.1 :

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

  • Add Progress Bar .

  • Normal Execute will keep all the UVW Map Modifiers . 

  • AltExexute will Collapse the UVW/EditPoly Modifiers .

IMPORTANT NOTE : The script not made to deal with heavy objects , so please save your work before using it .

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

First of all, thanks for

First of all, thanks for using the script
Actually, I'm Glad I was able to pull the 5 bucks from you! :)
Second, about the Error/Request
The Script has 2 ways to be applied.
First by edge length, Second by Selecting Edges.
so, pick your favorite!
Thanks for the comment and Best Regards.

dangtiendung's picture

Fix for regular polygon & group

I realized when the object contains regular polygons, the script doesn't work properly because vx will coincide with vz, and vy = [0,0,0] (due to cross vx vz). Try with a box of size 200x200x200, you will understand what I mean.

I'm fixing this by ajust the vz if it coincide the vx:
if vx == vz then (t = vz.x; vz.x = vz.y; vz.y = vz.z; vz.z = t)

And I realized the script will also not work when selecting group, if Collapse UVW Modifiers is not enabled, because the select command. I think you should still leave obj = copy sel in both cases, if Collapse UVW Modifiers is turned off, then copy all modifiers from obj to sel in the end.

Your ideas are interesting anyway, I like it. Well worth the 5 bucks. :) 

I don't visit ScriptSpot often, so if you have any questions, please email me: [email protected].

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

bga

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

bga

Comment viewing options

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