Unofficial plugin type: Interactive Manipulators

October 17th, 2005 by Andrea Interguglielmi - Viewed 18975 times -




This post is about writing interactive manipulators such as the transform tool or the newly introduced tweak tool, something XSI doesn’t support in its catalog of plugin types by default, but still possible to develop by going through a crazy round trip.

Guy

When it comes to real-time plug-ins, XSI allows writing custom operators able to react to inputs and produce outputs, but what if the input we need is the mouse?

We haven’t got any mouse operator or event in the SDK yet, in fact all this kind of tools in XSI are emended into the core, but fortunately for us, we still have some tricks by our side to fill this gap and write our own interactive tools.

In the example bellow I’ve done a test, a custom manipulator to “sketch” the pose of a character by tracing quick strokes.

Download the example movie.

The tool is in fact a fully functional and integrated manipulator, it is done by using some windows functions to “steal” the mouse from XSI. Under XSI’s SDK workgroup directory there’s a great example about this topic: UserNormalEditing by Alain Laferriere, thanks for sharing Alain!

Then, to interact with the objects in scene I’ve used a custom display pass plug-in. For any object of interest there is an OpenGL primitive with a reference to the object in scene, OpenGL picking algorithm does the rest of the job by returning what’s under the mouse pointer.

Every time an event is fired from the mouse a refresh-viewport command is executed, at this point from the custom display pass a check occurs to get the currently picked object.

I’m thinking as next step to add the possibility of scripting all this mess ;)

I love this new plugin type!

Andrea

17 Responses to “Unofficial plugin type: Interactive Manipulators”

  1. chrisg says:

    lordy-mama! that”s coooooooooool…. :)

  2. I think you”ll never cease to impress me! For animators who are used to working with poses this is a great interaction model!

  3. Nice work! ;) Not only is it cool, but also very useful!

  4. DAN says:

    What a great idea (and implementation!) Thanks for showing it.

  5. Thank you guys : )

    The tool hasn”t been tested by animators yet, but at a first glance they are not really happy about rotating the viewport every time to rotate in different directions…and I can”t see any work arround for this issue…

    Well, I hope to finish it soon, maybe Lionhead will allow me to release it here : )

    Ciao ciao!

    Andrea

  6. Arnar says:

    very interesting… for the viewport rotation, what about using the mouse buttons, lmb for say x-axis, mmb for y-axis etc…

    just a thought

  7. Igor says:

    I am kind of disapointed at Softimage for not exposing the needed events and opengl context and wrapping it up in a plugin type, after all its a V5 already. I thought of transfering some modeling tools i find interesting to XSI and I was aware i needed to go CDH route for display but wasnt sure about mouse events. This article cleared it all up, thanks!

  8. James says:

    http://www.projectmessiah.com/x4/vids/Armatures_A.wmv

    http://www.projectmessiah.com/x4/vids/Armatures_B.wmv

    http://www.projectmessiah.com/x4/vids/Armatures_In_Action.wmv

    messiah actually creates a whole UI that allows the rigger to wire mouse inputs to bitmap controllers, which can then be docked in the viewports or attached to the rig. There”s no need to code unless you are wiring custom scripts or expressions to the inputs. I haven”t seen anything as powerful or easy to setup as this yet. It makes a huge difference in rigging and animation and opens the door to cool new setup possibilities. Anything that takes a step in this direction in XSI gets a thumbs up from me!

    James

  9. This is really interesting, I”ll have a look, actually I really respect messiah, I had a look at it a couple of years ago and really love its design.

    4 Arnar: Yeah, is something I was evaluating, is not a bad idea, but you loose the sensation of sketching, ”cause the rotation no longer respect your stroke : \

  10. Arnar says:

    well… you do a stroke left to right, the rotation follows as espected. say you draw exactly the same stroke holding rmb down the rotation would then point to the back, mmb point at you to the front, so there would not be any picking of axis stuff going on. is this making any sense…. maby not!!

    would it be possible to control rotations of many objects with one stroke. and maby draw a curved stroke where the rotation of some objects would follow the curve. that would be extremely powerfull.

    .arnar

  11. Reinhard says:

    When looking at the messiah armatures videos, I had the idea that it would be very cool to have the possibility to have an XSI viewport act as a container for an HTML page.

    If that page had a transparent background, and there was some kind of interaction model (events, object model) between the viewport and the page, this would make stuff possible that would go far beyond the messiah armatures (Using AJAX, DHTML, php etc.).

    Reinhard

  12. HeartLess says:

    What if the rotation turns in a temporary step and returns to initial pose after setup manipulation?
    I mean, the viewport has an automatic “back to position” after every manipulation. Maybe with some key pressed, it rotates, and releasing the key, reverts to original viewport position for pose animation. Donīt know, maybe rotation should be a temporary stage for tweaking and posing.

  13. Jason Lysinger says:

    Is it possible to use this for making a universal transform tool?
    Like this one: http://www.jakaldesign.com/pics/translate_tool.jpg

  14. Milho says:

    Two words: AWE-SOME!
    How could this possibly work with IK? Drag and drop? Wheen do we get it :)

  15. Memag says:

    Are you still working on it??Or you dropped it?
    Is there a way to test,maybe?
    Thanks.

  16. Alan F. says:

    Hey Jeson,

    XSI *already* has a universal manipulator. Press “B” on your keyboard and try dragging on the corners, faces and edges of the imaginary bounding-box-like control that appears.

  17. Joe says:

    Hi there :) I am using Maya to animate and test jc sketchpose atm. Will you return to develope the tool for xsi(softimage)???