I'm trying to use the functions under the 'Arrange Elements' in UVW Unwrap in a script but can't seem to find them, are they even exposed to maxscript?
Forum topic · General Scripting
How to access the functions in the 'Arrange Elements' group in UVW Unwrap?
By JensSchmidt · 2016-12-11
Description
Comments (7)
miauu · 2016-12-13
I think that those buttons works the same way as Tools->Rescale Clusters and Tools->Pack UVs
For example, open the Maxscript Help file and search for Rescale Clusters
Wonderful, thank you so much :)
JensSchmidt · 2017-01-24
I have not been able to go back to this task until today and try your suggestion. Unfortunately I get this at the line where I have my function call:
-- Error occurred in anonymous codeblock; filename: D:\Jens\3dsmax scripts\Merge Export 2.ms; position: 1500; line: 79
-- MAXScript Listener Eval Exception:
-- Unknown system exception
-- MAXScript callstack:
-- thread data: threadID:26028
-- ------------------------------------------------------
-- [stack level: 0]
-- In top-level
74 uvMod = UVWunwrap()
75 uvMod.setMapChannel 2
76 addModifier obj uvMod
77
78 -- pack( method, spacing, normalize, rotate, fillHoles )
79 uvMod.pack 1 0.02 true false false
How do I go about resolving something like this?
EDIT:
I get it to run as long as I do not choose method 1 as first param. But when it runs it still doesn't perform the packing, wierd.
.
miauu · 2017-01-24
Create an object.
Add Unwrap UVW modifier.
Open the UV Editor and run this:
(
uvMod = $.modifiers[1]
uvMod.setMapChannel 2
-- addModifier $ uvMod
-- pack( method, spacing, normalize, rotate, fillHoles )
uvMod.pack 1 0.02 true false false
)
That works...
JensSchmidt · 2017-01-25
...wierd :/ does it matter whether the uvedit window is open or not!?!?
.
miauu · 2017-01-25
I don't know, but in all of my scripts that packs the UVs the UV Editor is open.
JensSchmidt · 2017-01-25
Thank you anyway :)
Fixed it, but now there is another problem
JensSchmidt · 2017-01-25
I got it working by adding a select obj before pack but now I ran into another wall:
When changing the map channel in the UVW Unwrap modifier manually you get a popup asking if you would like to Move the UVs from the current channel to the newly selected one or Abandon them. When setting the map channel via script it moves the UVs and there is no param to let me change that...stuck again