[Closed] Moove mesh gizmo inside simpleManipulator
I have a simpleManipulator plugin that should display a mesh using this code:
plugin simpleManipulator HelperTest_DisplayMesh
name:"HelperTest"
classID:#(0x47db14fe, 0x4e9b5f90)
category:"Manipulators"
(
parameters pblock rollout:params
(
...
)
rollout params "HelperTest Parameters"
(
...
)
on canManipulate target return
(
off
)
on updateGizmos do(
this.clearGizmos()
this.addGizmoMesh (createInstance MyMesh()).mesh 0 (colorMan.getColor #manipulatorsSelected) (colorMan.getColor #manipulatorsActive)
)
tool create
(
on mousePoint click do
(
nodeTM.translation = gridPoint;#stop
)
)
)
MyMesh is some mesh that could be defined in another plugin. How can I set the position of MyMesh relative to the position of the simpleManipulator node?
Since nobody seems to be able to answer my question, gues it´s another imposible thing in max?
Sorry I was tallking about doing it in maxscript and not manually.
As an example I have, with the help by denisT, writen simpleManipulator plugin with a box, and I would like to have the position of the node the same as center of the box. This means need to move the box by [0, 0, -size/2]. Unfortunatelly no idea how to do that? Also for the box it seems like I found a solution in the maxscript documentation, but it´ll not worck for other meshes then box.
Posibly I misunderstood you, but your solution sounds really complicated. I was able to find an easier solution.
So here a simpler solution to move the gizmo by [x, y, z] and aply some rotation rot, which can be euleranglers or quat:
...
on updateGizmos do(
this.clearGizmos()
local m= (createInstance MyMesh()).mesh
move m [x, y, z]
rotate m rot
this.addGizmoMesh m 0 (colorMan.getColor #manipulatorsSelected) (colorMan.getColor #manipulatorsActive)
)
...