Notifications
Clear all

[Closed] Help with simple script

U are a machine!

I get an error message on the PolyBQuadrify line
–Type error: Call needs function or class, got:undefined

what version of max do you use?

3dsmax Design 2012 x64 SP2

1 Reply
(@denist)
Joined: 11 months ago

Posts: 0

so in you case use PolyToolsModeling.Quadrify instead of PolyBQuadrify


 with redraw off  
 (
 	windows.sendmessage (windows.getmaxhwnd()) 0x000B 0 1
 	setCommandPanelTaskMode mode:#modify
 	disableRefMsgs()
 	nodes = for node in (selection as array) where iskindof node GeometryClass collect 
 	(
 		converttopoly node
 		node.weldThreshold = units.decodevalue "0.01mm"
 		polyop.weldVertsByThreshold node node.verts 
 		select node
 		modpanel.setcurrentobject node
 		PolyBQuadrify off off -- works for max 2010
  /* 	   PolyToolsModeling.Quadrify off off -- works for max 2012 */
 		modpanel.addmodtoselection (Smooth autosmooth:on threshold:30)
 		converttopoly node
 	)
 	enableRefMsgs()
 	windows.sendmessage (windows.getmaxhwnd()) 0x000B 1 1
 	select nodes
 	nodes
 )
 

i don’t have max 2011 to test. it will not work for versions < than 2010

What exactly does the following line do?

When I run it on max2012 it disables the ability to select my max window. Are you using this to stop the scene from flickering?

windows.sendmessage (windows.getmaxhwnd()) 0x000B 0 1

Also:

The maxscript docs read:
disableRefMsgs() and enableRefMsgs() Added new methods for disabling and enabling the Reference System.

Is it disabling /enabling the Reference System? Or just the messages? Seems like there would be bad side effects.

for max 2012 the has to look as:


  with redraw off  
   (
   	windows.sendmessage (windows.getmaxhwnd()) 0x000B 0 1
   	setCommandPanelTaskMode mode:#modify
   	disableRefMsgs()
   	nodes = for node in (selection as array) where iskindof node GeometryClass collect 
   	(
   		converttopoly node
   		node.weldThreshold = units.decodevalue "0.01mm"
   		polyop.weldVertsByThreshold node node.verts 
   		select node
   		modpanel.setcurrentobject node
     	        [color=Yellow]PolyToolsModeling.Quadrify off off [/color]
   		modpanel.addmodtoselection (Smooth autosmooth:on threshold:30)
   		converttopoly node
   	)
   	enableRefMsgs()
   	windows.sendmessage (windows.getmaxhwnd()) 0x000B 1 1
   	select nodes
   	nodes
   )
  

disable max window redraw:
windows.sendmessage (windows.getmaxhwnd()) 0x000B 0 1
enable max window redraw:
windows.sendmessage (windows.getmaxhwnd()) 0x000B 1 1

disableRefMsgs() and enableRefMsgs()
for these operations i don’t need reference messages and i can disable them. if i will see any bad side effect i will not use these methods.
did you see any?

Reading through the forum you are often doing things no one else seems to be doing (or very few anyway), – so figured you might have more to say about them…

Thanks for your huge contribution of knowledge, experimentation, and challenges.

D!
It works great!

Page 2 / 2