Notifications
Clear all

[Closed] Maxscript flakey?

Why does the following work in the max script listener , but not in my max script?!

$.modifiers.mapChannel = 3

also the same happens with the following variation

$.modifiers[#UVW_Mapping].mapChannel = 3

Is there a way to get odd stuff like this to be posted in the listener so it does work?
Ive had this isse before…

6 Replies

Both work just fine for me. What are you wrapping around the line?

Probably the object gets deselected at some point during your script, which is why people are telling you to store the selected object into a variable like obj

yeah okay ill update my script tonight and see if it works…

ok trying to planarmap, this code fails to work. the following line doesnt seem to get executed, the rest are fine…

myObj.modifiers[#unwrap_uvw].unwrap5.mappingAlignToView()


  		myObj = selection[1] --get selected object
 		myTempSelection = for i in myObj.selectedfaces collect i.index --convert selection to array
  		mySelection = myTempselection as bitarray --convert array to bitarray
  		
  		subobjectLevel = 0		
  		modPanel.addModToSelection (Unwrap_UVW ()) ui:on
  		subobjectLevel = 3
 		myObj.modifiers[#unwrap_uvw].unwrap.selectPolygons mySelection --select original selection
  		myObj.modifiers[#unwrap_uvw].unwrap5.mappingMode 1 --planar map mode
  		myObj.modifiers[#unwrap_uvw].unwrap5.mappingAlign 2 --z map
  		myObj.modifiers[#unwrap_uvw].unwrap5.mappingAlignToView()
  		myObj.modifiers[#unwrap_uvw].unwrap5.mappingMode 0
  		macros.run "Modifier Stack" "Convert_to_Poly"
  		subobjectLevel = 4
  		myObj.EditablePoly.SetSelection #Face mySelection --select original selection
  

sometimes if the editble pannel is not your current pannel, some modifier command won’t work.
try adding one of this at the begining of your script

 max modify mode

that still doesnt fix the issue, i fixed it at home by reinstalling max, but i cant do that here at work