Notifications
Clear all

[Closed] How do I prevent this undo-based Max crash?

So I’m trying to understand what you just posted. I get that it shows the local space min and max of an object, just wondering if there any more to it than that? I only ask because it seems to work without manipulate mode turned on (which you said could not be done), and if I DO turn on manipulate mode, I get the following listener error any time I select or deselect any scene nodes:

– Error occurred in canManipulate(); …position: 434; line: 19
– Frame:
– target: BBoxManip

error is something very easy to fix.
the example shows how a scripted manipulator can be use as a gizmo without manipulate mode.

it’s just an object which depends on some other object and itself. you can change topology, geometry, type of target object… animate its transform or deform… the manipulator receives all these notification and updates its gizmo.

All right, I’ll play around with it and let you know what my next question is.

Okay, so far I’m up to here. I’ve got a manipulator that creates an flipped-normal copy of the mesh, with a push value added based on the distance to a second node.

plugin simpleManipulator flipCopy
  	name:"flipCopy"
  	classID:#(0x51ed8962, 0x1d049901)
  	silentErrors:on
  	invisible:on
  	category:"manipulators"
  (
  	local rCol = red as point4
  	local gCol = green as point4
  	local bCol = blue as point4
  	local yCol = yellow as point4
  
  	parameters params
  	( 
  		theNode type: #node
  		theTarget type: #node
  		theManip type: #maxobject
  	)
  
  	on canManipulate target do (iskindof target flipCopy and isvalidnode theNode)
  
  	fn makeGizmos = if isvalidnode theNode and theManip != undefined do
  	(
  		this.clearGizmos()
  
  		local flipMesh = copy theNode
  		addModifier flipMesh (normalModifier flip:true)
  		addModifier flipMesh (push pushValue:-(distance theNode theTarget))
  
  		this.addGizmoMesh flipMesh.mesh 0 gCol rCol
  		theManip.node.isFrozen = true
  		theManip.node.backFaceCull = true
  		theManip.node.wireColor = gray
  		theManip.node.transform = theNode.transform
  
  		delete flipMesh
  	)
  
  	on updateGizmos do makeGizmos()
  )
  
  (
  	delete objects
  
  	s = sphere name:#s
  	b = box name:#b
  
  	m = flipCopy name:#m theNode:s theTarget:b
  	m.theManip = nodeTransformMonitor node:m
  )

What I can’t figure out is, how do I actually access the gizmo mesh? I need to check for ray intersections against it, but any time I try to work with it I get an error, e.g.

meshOp.getVert $ 1
– Runtime error: Mesh operation on non-mesh: flipCopy

meshOp.getVert $.mesh 1
– Runtime error: Cannot get mesh from this object: flipCopy

meshOp.getVert $.theManip.node 1
– Runtime error: Mesh operation on non-mesh: flipCopy

So I’ve been in the hospital for the last week, but now that I am back I really want to get this figured out. Any advice for accessing the gizmo mesh?

No advice on this?

no… sorry… not just right now. i’m super busy.

It’s ok, I have other projects to work on and I’m still convalescing. Whenever you get around to it!

Since Denis has things to do in his life besides being my personal lifeline, would anyone else like to give this a shot?

i don’t have a solution for undoing a created with undo node if it was deleted without undo.
i told that i have a true mechanism to not allow to delete some specified node. it’s not based on any hooking of UI. i use predeleted and postdeleted events to fool the system that a node already deleted.

now is about your issue.
i still don’t understand your pipeline. you create some special node and use it as a gizmo(manipulator) for editing other nodes (probably their transforms). after that you want to delete this special node and make the system forgets this node existence at any time.

true?

Page 4 / 5