How to access the functions in the 'Arrange Elements' group in UVW Unwrap?

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?

Comments

Comment viewing options

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

I think that those buttons

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

JensSchmidt's picture

Wonderful, thank you so much :)

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's picture

.

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
)
JensSchmidt's picture

That works...

...wierd :/ does it matter whether the uvedit window is open or not!?!?

JensSchmidt's picture

Fixed it, but now there is another problem

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

miauu's picture

.

I don't know, but in all of my scripts that packs the UVs the UV Editor is open.

JensSchmidt's picture

Thank you anyway :)

Thank you anyway :)

Comment viewing options

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