Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Relax TOOL UVW unwrap access

Relax TOOL UVW unwrap access

Anonymous
Not applicable
1,630 Views
13 Replies
Message 1 of 14

Relax TOOL UVW unwrap access

Anonymous
Not applicable

I'm trying to create a sort of quick pelt script with predefined settings. I'm using 3d max 2012 design.

 

I first found a post here that you could 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 suggestions on how to get that to work?

 

0 Likes
1,631 Views
13 Replies
Replies (13)
Message 2 of 14

Anonymous
Not applicable

Hello!

I also suffered for a long time with this problem.

It’s not possible to directly assign a value to .setRelaxAmount ... I had to come up with a crutch ... And I came up with it ... See:

 

<UnwrapUVW> .setRelaxAmount 1.0 -- (this does not work)

<UnwrapUVW> .getRelaxAmount () -- returns undefined

 

But if you set the value .setRelaxAmount through an additional function, then it works:

=================================================== ==========================

function blablabla bla1 bla2 = (

...............................

<UnwrapUVW> .setRelaxAmount (setRelAm ())

...............................

)

 

function setRelAm = (

x = 1.0

return x

)

fknRelaxAmount = <UnwrapUVW> .getRelaxAmount ()

print fknRelaxAmount - will return 1.0
=================================================== ==========================

Good Luck! 🙂

Message 3 of 14

denisT.MaxDoctor
Advisor
Advisor

@Anonymous wrote:

 

function blablabla bla1 bla2 = (

...............................

<UnwrapUVW> .setRelaxAmount (setRelAm ())

...............................

)

 

function setRelAm = (

x = 1.0

return x

)

🙂


sorry, but it's too senseless to be a solution

Message 4 of 14

jibijib
Collaborator
Collaborator

You set the relax amount of the Relax function in a new function.

Declare relax - and set relax value as two seperate functions.

0 Likes
Message 5 of 14

Anonymous
Not applicable

But this work! Checked, if you do not believe. 🙂 At me is work and I use it.

0 Likes
Message 6 of 14

denisT.MaxDoctor
Advisor
Advisor

@Anonymous wrote:

But this work! Checked, if you do not believe. 🙂 At me is work and I use it.


what you do has nothing to do with whether the function works or not. The function just works on its own if used correctly

0 Likes
Message 7 of 14

Anonymous
Not applicable

Ok! But I am not a programmer and do not pretend that my code is perfect ... I found a problem on the forum that I encountered myself. I did not find any solutions on the forum. I came up with my own way. It worked ... I decided to share this with the rest. I myself understand that this is wrong, but I did not find another way ... Well, before going to the forum for advice, I re-read the API for those functions that I need ... I tried as it says, but it did not work, at that while other functions work as described in the documentation. And yet, how right? Thank.

0 Likes
Message 8 of 14

denisT.MaxDoctor
Advisor
Advisor

I’ve been fighting 3DS MAX for over 20 years. But I know for sure that neither prayers nor shamanistic spells help.
Just trust me ...

0 Likes
Message 9 of 14

Anonymous
Not applicable

OK! I always respect people with experience, with even greater respect to those who share this experience with others. Only the question remained unresolved. When the first person posted his problem back in the month of February - no one responded ... My nonsense and crutch immediately found a response ... Why?
Well, share your opinion and your vision of resolving the issue ... Thank you.

Message 10 of 14

Anonymous
Not applicable

Thanks for the replies. but unfortunately the code is not clear for me. 

 

You are setting the relax amount with a function, then call that relax amount with a second function and finally use that function with the usual script am I right? 

 

Ohhh look, its @denisT.MaxDoctor , the unfriendly CGtalk maxscript guru with a massive ego who loves to degrade and talk down to people who are merely asking for help or even people who try to give advice to others even though it might be incorrect. You need a lesson in manners. 

Message 11 of 14

Anonymous
Not applicable

Yes, you are right! Only this method I can setting setRelaxAmount() value. Directly as setRelaxAmount()=1.0 I can't setting value. Try my code. Maybe I'm wrong and uncorrect realize this method, but i can't doing it as writing in the documentation. Thanks.

0 Likes
Message 12 of 14

denisT.MaxDoctor
Advisor
Advisor

For those who ask for help, I always try to help with both an answer and advice. But there are questions to which to get an answer you just need to look and carefully read the documentation. Usually I do not answer such questions, but I give an opportunity to beginners to self prove.
But when these games go too far, sometimes I have to leave my comments in order to stop the "graphomaniac solutions".

 

Concerning :

$.UnwrapUVW.setRelaxAmount 1.0
$.UnwrapUVW.getRelaxAmount()

 

It was well known bug in versions before 2014, and was fixed later. Unfortunately for you, you still use MAX 2012.

Try to find my answer and solution on CGTalk forum which I gave 8 years ago about this mater.

Good luck. ... and remember - bad penny always comes back

0 Likes
Message 13 of 14

denisT.MaxDoctor
Advisor
Advisor

@denisT.MaxDoctor wrote:

 

Concerning :

$.UnwrapUVW.setRelaxAmount 1.0
$.UnwrapUVW.getRelaxAmount()

this is not a problem at all. the problem with unwrapuvw relax dialogs. and it's true, they don't work as expected in early versions. but i showed a workaround how to setup and run this built-in dialog. 

0 Likes
Message 14 of 14

denisT.MaxDoctor
Advisor
Advisor

@Anonymous wrote:

Ohhh look, its @denisT.MaxDoctor , 


yes... who had taken a time to answer your sometimes "kindergarten" questions on CGTalk. Where you are with a different name ( Papigiulio)

0 Likes