Skip to content

Instantly share code, notes, and snippets.

@tapuo
Created May 8, 2012 19:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tapuo/2638741 to your computer and use it in GitHub Desktop.
Save tapuo/2638741 to your computer and use it in GitHub Desktop.
manipulator plugin for 3DSMAX
plugin simpleManipulator bonerotManip
name:"bonerot"
invisible:true
(
local oldM
on canManipulateNode t return classof t == Point and classof t.parent == BoneGeometry
on updateGizmos do (
this.clearGizmos()
this.addGizmoShape (manip.makeCircle [0,0,0] (node.size / 2) 28) 0 [0,1,0] [1,0,0]
)
on mouseMove m which do (
if (findString node.name "IK_") == 1 then (
local p = (node.parent).parent
ax = normalize (node.pos - p.pos)
--coordsys p rotate p (angleaxis ((m.y - oldM) / 2) ax)
rotate p (angleaxis ((m.y - oldM) / 2) ax)
) else (
local p = node.parent
coordsys p rotate p (angleaxis ((m.y - oldM) / 2) [1,0,0])
)
oldM = m.y
)
on MouseDown m which do oldM = m.y
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment