PDA

View Full Version : DPKit: building an IK solver



axebeak
08-13-2008, 11:02 AM
After watching XSI7 video that shows custom IK solver using ICE (http://webrel2.softimage.com/open/video/xsi7/02_Rigging_IK.flv), I thought it might be interesting to see if it's possible to create a specialized IK solver in LW using DPKit/Item Motion Node...

In case anyone is interested in such things here is the test scene attached that implements a basic two-bone IK solver.
nodal_2bone_IK.lws - 9.5 scene;
nodal_2bone_IK__LW9_2.lws - 9.2 format;

Pic #1 - nodal setup for the "upper" bone, IK on Heading and Pitch channels;
Pic #2 - "lower" bone, only Pitch is controlled by IK;
Pic #3 - optional setup for the effector to keep it in reach;
NOTE: Item Motion Node in the effector obj ("eff" Null) is disabled in the attached scenes, that's because both LW9.3 and 9.5 (OB1440) keep reseting Bone param in the Bone Info node. To activate it select "eff", press "m" for Motion Options, go into the Item Motion Node and change Bone param for the Bone Info node to "eff_pos" as shown in the pic, then activate the Item Motion Node modifier.
Note sure why the reseting happens, whether this is LW or DPKit's problem (I think my version of DPKit is not the most recent).

To test move/animate the effector - things will probably break if you try to move anything else - this is not a complete setup, just a test, so some assumtions were made to simplify things, most notably both bones are assumed to have length == 1 and the root of the chain to be at <0, 0, 0>, this is just to omit some math from the setup.
The math is not 100% correct either, as I said it's just a test, to see if such a thing is possible at all.
It's certainly possible to add upvector constraint/twist effector to such setup, or to build a specialized chain in the same way (e.g. a leg w/ rev-foot) etc.

Of course, you need to install DPKit to open the scene: http://pagesperso-orange.fr/dpont/plugins/nodes/Additionnal_Nodes_2.html

Dodgy
08-13-2008, 03:00 PM
Impressive. I'd wondered how far you could push nodes in LW given how much people were pushing XSI's node structure, and how much data you can get from LW's nodes....

jameswillmott
08-13-2008, 07:08 PM
Impressive. I'd wondered how far you could push nodes in LW given how much people were pushing XSI's node structure, and how much data you can get from LW's nodes....

It seems that the node editor was designed more for surfacing than other uses, it's just a happy thing that it can be used elsewhere but it's limited in what information can be passed around through the network...

Dodgy
08-13-2008, 09:21 PM
Well a lot of the nodes I've seen seem to be based on SDK infos, which would mean the limitation is with the sdk. The fact NT released the node editor sdk (which Dennis and others have quickly built upon) was a big hint as to where this was going, since we now have a node editor for any T button and even in the processing tab. NT must be opening up the sdk and Node sdk further I would guess, and breaking down some of the old sdk walls.

axebeak
08-14-2008, 06:17 AM
While it's true that most of the SDK functionality can be exposed via nodes, I think it's also correct that the Node Editor, in its current state, is not very suitable for uses other than surfacing. Not because of data availability, but because it lacks features necessary to build complex networks (for motion, particles etc).
I made a little example scene to illustrate the point - see attachment (9.5 scene format).
The nodal setup on the Slave object converts Master's HPB into quaternion, then converts it back and feeds into the Slave's rotation channels.

Some notes:

The network is not even finished yet (need to properly adjust ArcTan operation), but it's already quite difficult to even navigate it.

Some debugging is necessary for things like this. Checking intermediate results is possible by plugging outputs to a random channel, but this surely can be improved (a Debug node + Cutoms obj combo seems like a possible solution).

There are two distinct parts (as color-coded in the attached image) - supposedly, after setting up those two convertion operations, some more nodes can be plugged in-between to do some quaternion math. Currently, reconnecting all the stuff between the parts is not a fun thing to do. This can be improved somewhat by adding simple grouping abilities to the editor, like color-coded collapsible "network boxes", but that's not enough really. Yet, sub-networks with in/out interfaces seems like too big a feature to expect in the nearest future...

All in all, I think that although many things are possible in principle, the editor itself is the limiting factor in practice.

adamredwoods
08-14-2008, 12:00 PM
To consolidate that node madness, I wonder if we can get an EXPRESSION NODE to actually input a string rather than using countless nodes to multiply, use sine, arctan, etc.

rakker16mm
08-14-2008, 01:40 PM
To consolidate that node madness, I wonder if we can get an EXPRESSION NODE to actually input a string rather than using countless nodes to multiply, use sine, arctan, etc.

How about a node that consolidates nodal flows into custom nodes which can then be saved into a node preset menu? That way we can work in smaller chunks and later add them together for mega-complex nodal flows.

I'll be embarrassed if there already is one and I am the only one who doesn't know about it. :jester:

Cageman
08-14-2008, 04:17 PM
Cool stuff!

As axebeak said, LW-nodal wasn't built for other things than surfacing. If I may speculate somewhat:

A side effect (or rather a bonus) was that Nodal was generic enough to be used with other parts of LightWave, such as Displacements and Volumetric lights, because the networks tend to not end up too complex (though, it does at times). That is why NT decided to implement Nodal at those places. When working with particles or, as in this case, animation, you'll need alot more features and whatnot in order to keep things tidy and easy, which Nodal, at its current state doesn't have; hence the reason for NT to not make Nodal for PFX, Dynamics and Animation (and also because the underlaying structure of LW doesn't allow for such things). Dennis stuff are great things, but they also suffer from delays in the viewport (Node Item Motion) which tells me that it isn't as integrated as it could be if the underlaying structure was built with nodes in mind. Something I hope NT will keep in mind when the huge rehaul of dynamics and animation takes place.

However, grouping/consolidation is a feature that I think could have been implemented, but haven't been yet. My best guess on the reason for that is simply the fact that a completely new Nodal interface is being worked on, or at least, plans are rolling out for it, so that it may be used with other parts of LW, such as Dynamics and Animation.

Cageman
08-14-2008, 04:20 PM
Note sure why the reseting happens, whether this is LW or DPKit's problem (I think my version of DPKit is not the most recent).


It should be fixed a couple of releases ago. I don't have that problem over here.

axebeak
08-15-2008, 03:44 AM
To consolidate that node madness, I wonder if we can get an EXPRESSION NODE to actually input a string rather than using countless nodes to multiply, use sine, arctan, etc.

Yes, expression node will be very helpful, in fact I was already thinking about writing a node like this!
However, the general problem still remains, a node like this will help with calcs, but it's certainly possbile for networks to grow too big/unmanageable for reasons other than maths.
This quat example is somewhat synthetic, mostly to produce a large working network with two independent parts, for illustration. In any case, quaternion nodes must be included in the standard set.


How about a node that consolidates nodal flows into custom nodes which can then be saved into a node preset menu?

Indeed, something like this is necessary. Basically, this is what I call "sub-networks" above.
But I think it is actually more difficult to implement than it sounds. It's double, sure, just lots of small things to get right.
For reference, this is how it's done in ICE:
see from approx. 09:30 where he creates what they call a "compaund":
http://webrel2.softimage.com/open/video/xsi7/ice_deform.flv
(hi-res mov: http://webrel2.softimage.com/open/video/xsi7/ice_deform_h264.mov)
Compared to Houdini, the whole compound and "self" thing is not all that pretty, but Houdini has a very different architecture and many things that work there are not really applicable to other apps, so ICE way of doing things is probably a more suitable model for LW.
I do hope that Cageman's guess is correct and LW10 will have updated nodal interface.


It should be fixed a couple of releases ago. I don't have that problem over here.

Indeed, no more reseting after updating DPKit to Jul30 version!
For some reason it was necessary to "refresh" Node Item Motion manually after update (disable, reset Item/Bone info, enable), but scene loads fine after that.
So, just in case, I'm attaching the updated scene.