Unfortunately without any source code, that just tells me it can be done, and not how to do it.
Speaking of which, what happened with Kees? The Lumonix website seems to be down – was it hacked or something?
Okay, I have a rollout which creates planes and helper objects for visualization, as well as flipped-normal snapshot meshes, which are manipulated by the rollout. When new versions of these nodes are created, the old versions are first deleted. They are also deleted when the rollout is closed.
Once the rollout is closed, it does not make sense for these nodes to be retrievable via an undo, because they cannot be used as intended without the rollout. However, I still want to be able to undo and redo changes made to the scene which do not involve these specific rollout-controlled nodes.
ok.
you have to make a step forward in your tools development.
everything you described above is a manipulator. you need a scripted manipulator and i can help you (and all who is interested) to make it.
I’m always glad for an opportunity to level up! I would normally go right now and see how much I can learn about scripted manipulators on my own, but I have client stuff to work on instead. ><
Okay, I have some time now while I wait for a response back on my other project. I’ll probably have the weekend to develop my own stuff.
I took a look at radius manipulator example in the help file. It doesn’t seem particularly related to what I want to do, but at least I am getting a sense of the “vocabulary” of how these work I suppose.
So, a few quick questions before we start:
-
When we get this set up, will it be something that requires the “select and manipulate” toggle to be turned on?
-
What is the process for attaching a manipulator to a rollout?
-
What are the limits (if any) for what can or cannot be used as a manipulator? For example, can I make a copy of an existing object and use it as a manipulator, or is that not how it works?
Beyond that, I guess I’m as ready as I’m going to be to jump in.
So right off the bat I’m running into a bit of a snag.
It would seem that the answer to my third question in the above post is “yes”, since according to the documentation, when working with the addGizmoMesh function,
The mesh can be any arbitrary MAX mesh
However, in every example I have found of addGizmoMesh being used, the mesh in question is a sphere or other primitive generated within the plugin. I decided to simply try using the target mesh.
A gizmo version of the mesh seems to be created, but Max has the following complaints:
– Unknown property: “mesh” in Controller:Position_XYZ <<
– Unknown property: “mesh” in Controller:Euler_XYZ <<
– Unknown property: “mesh” in Controller:Bezier_Scale <<
I guess I don’t really understand what that means. There is no mesh property in any of the controllers of a sphere either, so what is it actually trying to look for and not finding??
plugin simpleManipulator testManip
name:"TestManip"
invisible:false
(
local g = [0, 1, 0]
local r = [1, 0, 0]
on canManipulate target return true
on updateGizmos do
(
this.clearGizmos()
this.addGizmoMesh target.mesh 0 g r
)
)
the offer is still good. but my free time is not.
first of all before using a scripted manipulator you have to know what it has to do – manipulate or just visualize something
if you need it for visualization only it can work without “manipulate” mode. if you want to manipulate – the “manipulate” mode has to be ON.
there are actually two types of manipulators:
#1 manipulates another object and stays hidden as a node
#2 manipulates itself and exists in the scene as a normal node (just a helper)
I’m looking for the second kind.
Also, I guess it would be possible to control the manipulate mode from within a script, yes?
here is an example of #2
plugin simpleManipulator LocalSpaceBBoxManip
name:"BBoxManip"
classID:#(0x00001967, 0x22eabc01)
silentErrors:on
invisible:on
category:"Manipulators"
(
local rcol = red as point4
local ecol = yellow as point4
local gcol = green as point4
parameters params
(
theNode type:#node
thisNode type:#maxobject
)
on canManipulate target do
(
iskindof target LocalSpaceBBoxManip and isvalidnode theNode
)
fn makeBBox = if isvalidnode theNode and thisNode != undefined do
(
itm = inverse thisNode.node.transform
bb = nodeLocalBoundingBox theNode
this.clearGizmos()
this.addGizmoMarker #bigBox (bb[1]*itm) 0 ecol rcol
this.addGizmoMarker #bigBox (bb[2]*itm) 0 gcol rcol
)
on updateGizmos do makeBBox()
)
delete objects
(
b = box name:#b name:"target" wirecolor:brown
m = LocalSpaceBBoxManip name:#m thenode:b pos:[20,0,0]
m.thisNode = NodeTransformMonitor node:m
)