Notifications
Clear all

[Closed] Relax TOOL UVW unwrap access

I’m trying to script a quick peltmap tool but I can’t find any information at all about it in the maxscript help section or online.

What I’m trying to do is select a mesh and then have it automatically pelt and relax with preset settings.

If someone can tell me where in the manual or online to find this info id really appreciate it.

5 Replies

I found a forumpost that you can set these values in the unwrapuvw.ini by adding/editing the following:

[Relax]
RelaxType=0
RelaxIterations=100
RelaxAmount=1.000000
RelaxStretch=0.000000
RelaxBoundary=0
RelaxCorner=0
RelaxBySpringStretch=0.000000
RelaxBySpringIteration=10

But this somehow doesn’t work for my max. (Maybe wrong version).

After some digging I finally found the maxscript coding

(
unwrap = $.unwrap_uvw
unwrap.mappingMode 5
unwrap.relax2dialog()
unwrap.relaxByFaceAngle 100 0 1 false
unwrap.setRelaxAmount 1
unwrap.relax2()

)
However two issues:

  1. relaxbyfaceangle doesn’t seem to work, i cant get it to select the ‘relax by face angle’ setting.

  2. The process naturally only works like a quick button click (relaxes 1 milisecond and then stops), I need it to relax for at least 4 to 5 seconds before it finishes.

Any ideas?

Have you checked mxs reference?

Yep, that’s how I got:

unwrap.relaxByFaceAngle 100 0 1 false

but it’s not working. That’s the only line that’s not working.

t = timeStamp()
do
(
	$.modifiers[1].relaxByFaceAngle 100 0 1 false
	windows.processPostedMessages() -- comment it out if you don't need viewport updates
	
) while (timeStamp() - t) < 5000

Thanks Serejah, you’re a great help. Unfortunately with your snippet my mesh becomes tiny and doesnt completely unfold… See image.

first standard pelt to see how the mesh turns out doing it the long tedious way.

result with 100 1 0 setting in the popup. Shape expands as suppose to.

same mesh with your script. Poof gone

zoom in and the shape is like this:

So it IS working to a certain extend but somehow its not grabbing the settings from
relaxByFaceAngle 100 0 1 false

what do you think?