Creating a procedural rig for digital asset

   3460   6   2
User Avatar
Member
46 posts
Joined: March 2016
Offline
I'm trying to procedurally generate a rig inside the Network, for a digital asset to be used inside of Unity or UE4. I haven't been able to find any tutorials or fruitful discussions on this subject.
What I have is a chandelier, connected by various chains. I need to rig bones onto these chains, so they can simulate physics inside of the game engine.
I don't need to create animations, just a rig.
Conventionally rigging inside of the viewport isn't an option, as the length and position of the chains can vary depending on the parameters of the digital asset.

I've figured out that I can at least lay down bones where I want using the Bone Link node. But I can neither figure out how to parent the bones together, nor how to weight them onto the underlying geometry.
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
Houdini has python functions to do all of this.
when you say ‘procedurally generate a rig’
do you mean a user driven process that ‘does stuff’ if given the right inputs?
or do you mean something more automatic - input random chandelier > outputs the rig?



somethings to look into…

make groups of the points at the ends of each chain (this can be made procedural based on the number of ‘arms’ in your chandelier)
for each of these groups (that have two points) - make a line (add sop)
resample the line
add some ‘sag’ the the line
copy a single link to each point of the line to make a chain
use that line to create bones (see bones from curve)

if you have a simple example of the chandelier you can provide we can have a look…
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
46 posts
Joined: March 2016
Offline
By “procedural”. I mean that it needs to be able to update itself as the parameters are adjusted. If, for example, a chain becomes longer, the rig needs to add and weight new bones to the extra chain links.

I've linked the HDA

I wonder if this approach will even work, though. Even if I can update the rig, now that I think about it, it probably wouldn't update the physics constraints in Unreal Engine…
I actually may need to fake physics through animations. Though the same rigging needs remain.
Edited by Grimwolf - Oct. 24, 2017 19:00:33

Attachments:
Gothic_chandelier.hdalc (40.8 KB)

User Avatar
Staff
3455 posts
Joined: July 2005
Offline
it will work - you just wont get ‘real time’ updates to the bones…
you'll be able to adjust the parameters and then hit a button that says “Update” (or whatever) - this will run a script that will that the new curve lengths and build the bone network.
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
46 posts
Joined: March 2016
Offline
The example you gave earlier is basically what I tried. Where I'm still lost though is in how to parent the bones together and weight them to the chain geometry.
User Avatar
Staff
3455 posts
Joined: July 2005
Offline
in python it would look like this…
try opening the Python Shell and type the following:

parent = hou.node(“/obj”)
bone1 = parent.createNode('bone', ‘bone1’)
bone2 = parent.createNode('bone', ‘bone2’)
bone2.setFirstInput(bone1)

in the viewport you'll see that by making bone1 the ‘first input’ of bone2, you're parenting - and bones are unique in that they know that if they're parented to another bone they should move to the tip.

because the chain links will not be deforming you can just parent an individual link to each bone…you should rotate every second bone to get the alternating links…

I'm not up on how this will export to a game engine but you could give it a try
Michael Goldfarb | www.odforce.net
Training Lead
SideFX
www.sidefx.com
User Avatar
Member
483 posts
Joined: Dec. 2006
Offline
Hi Grimwolf,

http://nathanmooth.com/2015/04/08/bones-from-multiple-curves-houdini/ [nathanmooth.com]

discussed here, too:
http://forums.odforce.net/topic/15766-bones-from-multiple-curves/ [forums.odforce.net]

Hope that's helpy and gives you a startingpoint.
English is not my native language, sorry in advance for any misunderstanding :-)
  • Quick Links