Maxcsript Bug?

Maxcsript Bug?

sk8erniall
Participant Participant
500 Views
1 Reply
Message 1 of 2

Maxcsript Bug?

sk8erniall
Participant
Participant

My script currently applies a unwrapUVW modifier to an object and then flattens the map by polygon angle.

 

modPanel.setCurrentObject currentObject
unwrapModifier = UVWunwrap ()
unwrapModifier.setApplyToWholeObject  true
addmodifier currentObject (unwrapModifier)
currentObject.modifiers[#unwrap_uvw].flattenMap 45.0 #() 0.001 true 0 true true

The modifier is added correctly, however the flatten map part of the script doesn't seem to work if I just run it from a newly opened session of max.

 

But if i either select all the faces and flatten the map  using the UV editor or apply the modifier and unwrap manually to any object, the script will run fine afterwards on any object.

 

It seems like it flatten map operation doesn't know what to do until I do it at least once manually.

 

Does anyone have any insight into why this might be happening? I've been struggling with it for days now.

0 Likes
501 Views
1 Reply
Reply (1)
Message 2 of 2

kenc
Advocate
Advocate

try

 

addModifier $ (Unwrap_uvw() ) ui:on 

unwrapMod = $.modifiers[1]
unwrapMod.setMapChannel .....................
unwrapMod.setApplyToWholeObject true
unwrapMod.name = ...........................
unwrapMod.flattenMap .........................

 

try applying the unwrap first then setApplyToWholeObject next

0 Likes