[Closed] modPanel.addModToSelection in Max design 2014
Hi
I’m having a rather old script, which has stopped working after we upgraded to Max Design 2014.
My code is:
Matindex = FindIndex materialFromLib
if Matindex != 0 then
(
if (MaterialArr[Matindex])[2] != undefined then
(
mt = (MaterialArr[Matindex])[2]
modPanel.addModToSelection (Uvwmap mapType:mt) ui:on
max create mode
if (MaterialArr[Matindex])[3] != undefined then
(
mt3 = (MaterialArr[Matindex])[2]
format “modifier % dollar %
” $.modifiers[#UVW_Mapping] $
$.modifiers[#UVW_Mapping].length = (MaterialArr[Matindex])[3]
) – end if [3]
) – end if [2]
) – end if Matindex
I get this error : Unknown property: “length” in undefined
In version 2014 I get this from my format:
modifier undefined dollar $Editable_Mesh:_0-Pcc Edge @ [-769.107910,144.203857,0.000000]
But in version 2011 on the same file I get this:
modifier Uvwmap:UVW Mapping dollar $Editable_Mesh:_0-Pcc Edge @ [-769.107910,144.203857,0.000000]
So I would like to know if anything has changed in the “addModToSelection”?
Also if anyone have a suggestion to how to avoid the error, I would appreciate any hint that can help me…
Kind Regards
Anja
you have to use $.modifiers[#UVW_Map] instead of $.modifiers[#UVW_Mapping].
since max 2014(maybe 2013) max uses by default localized class name instead of name of a modifier. the localized name of Uvwmap modifier is “UVW Map”.
you can name your modifier the name you like and use the custom name:
addmodifier $ (Uvwmap name:"My UVW")
$.modifiers["My UVW"].length