Message 1 of 4
Simple Manipulators

Not applicable
01-13-2011
06:49 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hi,
I've been having this wierd problem. I am making a new helper that creates a guide (a line)
from 2 click you make. I am using the line (thus the vector) as the x axis. As you would understand , I am using the line as a new transformation matrix. Applying the Matrix3 from the tool is easy:
The problem is that I really need to create this node by another UI or functions. So the Script won't get through the "tool" part. This will result in not applying the new Matrix3 I created.
Question:
Is there a way to access to the node or its transform from the updategizmos?
The help files says:
I've been trying everything from "this" "target" "node" "nodeTM" or using the node i created.transform and nothing worked... Here is my example code since i can't show my real actual code from my job:
I've been having this wierd problem. I am making a new helper that creates a guide (a line)
from 2 click you make. I am using the line (thus the vector) as the x axis. As you would understand , I am using the line as a new transformation matrix. Applying the Matrix3 from the tool is easy:
nodetm = newTM -- where nodeTM is a direct access to the newly created transform matrix.
The problem is that I really need to create this node by another UI or functions. So the Script won't get through the "tool" part. This will result in not applying the new Matrix3 I created.
Question:
Is there a way to access to the node or its transform from the updategizmos?
The help files says:
Methods:
<void><MixinInterface:gizmoShape>.startNewLine()
Starts a new line in the gizmo.
<void><MixinInterface:gizmoShape>addPoint <point3 by value>point
Adds a new point to the last line created.
<void><MixinInterface:gizmoShape>transform <matrix3 by value>point
Transforms the gizmo by the given matrix3 value
I've been trying everything from "this" "target" "node" "nodeTM" or using the node i created.transform and nothing worked... Here is my example code since i can't show my real actual code from my job:
plugin simplemanipulator HelperTest
name:"MyTest"
category:"Test"
classID:#(0x6d92d655, 0x4db1aac6)
(
parameters main
(
Startpos type:#point3 default:
Endpos type:#point3 default:
)
on updategizmos do
(
this.clearGizmos()
local MyGizmo = manip.makeGizmoShape()
local newmatrix = matrix3
local color1 =
--Part of code that I wish would work
MyGizmo.transform = newmatrix -- says Unknown property: "transform" in <MixinInterface:gizmoShape> <<
print this -- This will only point to my manipulator , not the helper / gizmo / node
print target -- undefined
print node -- undefined
print nodeTM -- undefined
-----------------------------------------
-- Draw Gizmo
MyGizmo.startNewLine()
MyGizmo.addPoint startpos
MyGizmo.addPoint endpos
this.addGizmoShape MyGizmo 0 color1 color1
)
tool create
(
on mousePoint click do
(
case click of
(
1:
(
startpos = worldpoint
)
3:
(
endpos = worldpoint
#stop
)
)
)
)
)