NodeEventCallback error Help on mouseup make polyface planer

i'm trying to get the "Makeplaner" fn to run when i release a vertex of a polymodel, after it has been moved.
Getting this error (Argument count error: Makeplaner wanted 0, got 2)
NodeEventCallback is very difficult for me to understand, so please help me out.
My first script ;-)

try (closeRolloutFloater MainFloater) catch()
 
fn Makeplaner =
(	
	$.EditablePoly.ConvertSelection #Vertex #Face
	subobjectLevel = 4
	$.EditablePoly.makePlanar #Face
)
rollout MakeP "PPLANER"
(
	checkbutton two "Check"
	on two changed state do 
		(
		if state ==true then
		(	
Polymodel = NodeEventCallback mouseUp:true delay:500 geometryChanged:Makeplaner
		)
		else
		(
		Polymodel = undefined
		gc light:true	
		)
		)
 
)
createDialog MakeP
<code>

Comments

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
jahman's picture

.

NodeEventCallback callback function requires two arguments
first is a current event
second is an array of nodes handles
check mxs reference examples

fn Makeplaner ev nodes =
(	
    for n in nodes where isKindOf (obj = getAnimByHandle n) Editable_Poly do (
	obj.EditablePoly.ConvertSelection #Vertex #Face
	subobjectLevel = 4
	obj.EditablePoly.makePlanar #Face
    )
)
Harvid's picture

Thank you, I would never have

Thank you, I would never have solved myself.
Must buy a book with examples in :-)

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.