Can you rig a vehicle in Houdini?
5254 16 4- Digipiction
- Member
- 166 posts
- Joined: March 2014
- Offline
This may seem like a ridiculous question, but has anybody successfully rigged a simulated vehicle with built-in nodes? I was absolutely shocked at how difficult and glitchy it is.
I looked at a few Blender tutorials, and they all manage to rig up a vehicle with ease, limiting constraint axes and actually have them be respected by the sim. It correctly moves without glitching, no issue. When trying to replicate such setups in Houdini I failed miserably.
Having checked out online resources for Houdini vehicle rigging, I couldn't find a single convincing setup. They all either act strangely or are simplified to the point of only being able to drive in a straight line.
Even the Houdini HIVE talk "Vehicle Destruction & Dynamic Rigging with RBDs" suggests something completely ridiculous: to set constraint iterations to 8000 or something, which makes even the simplest vehicle setup so slow you want to pull your hair out.
I wasn't able to get cone twist constraints for wheels to be stable even at such high constraint iterations. Hard constraints work better, but v@condir and i@condof seem to get completely ignored a lot of the time, making it impossible to actually limit a wheel to rotate only on one axis or a suspension to only move up and down.
I've attached a shot that shows the kind of result I ended up with, having tried all kinds of combinations of different mass, density, error reduction thresholds, substeps etc. etc. The wheels are one glitchy mess, and I had to jump through hoops post-sim to get them to act somewhat naturally.
The proxy vehicle is the direct sim result, the high-res vehicle is after heavy post-processing in SOPs:
https://www.dropbox.com/s/9z8m4o5cke2mjqh/glitchyRBD.mp4?dl=0 [www.dropbox.com]
I looked at a few Blender tutorials, and they all manage to rig up a vehicle with ease, limiting constraint axes and actually have them be respected by the sim. It correctly moves without glitching, no issue. When trying to replicate such setups in Houdini I failed miserably.
Having checked out online resources for Houdini vehicle rigging, I couldn't find a single convincing setup. They all either act strangely or are simplified to the point of only being able to drive in a straight line.
Even the Houdini HIVE talk "Vehicle Destruction & Dynamic Rigging with RBDs" suggests something completely ridiculous: to set constraint iterations to 8000 or something, which makes even the simplest vehicle setup so slow you want to pull your hair out.
I wasn't able to get cone twist constraints for wheels to be stable even at such high constraint iterations. Hard constraints work better, but v@condir and i@condof seem to get completely ignored a lot of the time, making it impossible to actually limit a wheel to rotate only on one axis or a suspension to only move up and down.
I've attached a shot that shows the kind of result I ended up with, having tried all kinds of combinations of different mass, density, error reduction thresholds, substeps etc. etc. The wheels are one glitchy mess, and I had to jump through hoops post-sim to get them to act somewhat naturally.
The proxy vehicle is the direct sim result, the high-res vehicle is after heavy post-processing in SOPs:
https://www.dropbox.com/s/9z8m4o5cke2mjqh/glitchyRBD.mp4?dl=0 [www.dropbox.com]
Edited by Digipiction - March 13, 2023 13:18:59
- Jonathan de Blok
- Member
- 274 posts
- Joined: July 2013
- Offline
This guy managed to build a realtime setup that looks like it's working.. no idea how but it's possible
http://www.hossamfx.org/craft-houdini-vol-1 [www.hossamfx.org]
http://www.hossamfx.org/craft-houdini-vol-1 [www.hossamfx.org]
More code, less clicks.
- tamte
- Member
- 8833 posts
- Joined: July 2007
- Offline
you definitely don't need crazy constraint iteration number, just make sure your constraints don't fight each other
v@condir and i@condof work well as long as you have correct p@orient or v@r attribute on your constraints that represents the local reference frame
here is a super simple example, just wheels and motor, no suspension etc, but you can extend it as you wish (default simulation settings)
v@condir and i@condof work well as long as you have correct p@orient or v@r attribute on your constraints that represents the local reference frame
here is a super simple example, just wheels and motor, no suspension etc, but you can extend it as you wish (default simulation settings)
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- Digipiction
- Member
- 166 posts
- Joined: March 2014
- Offline
I've looked at your scene and couldn't find any relevant differences to my own scene, except for the orient attribute. And sure enough, that attribute appears to be massively important, even though you're just giving it the default value it seems.
How did you know that this is needed? It's not mentioned at all in the documentation for condir and condof.
Here's your scene slightly modified: I turned the collision shape into a regular ground plane, I added a POP force pushing the car body along X, and I deactivated the orient initialization. The result is what I'd been fighting with for days, i.e. the wheels doing weird things, ignoring their constraint directions. But if you re-enable the orient initialize, it works as expected.
So thanks of course, this is great to know! I have a feeling I'm now among roughly 12 people in the world who have this insight. Having to add 3 barely doccumented attributes via wrangles just to make directional constraints work is harsh even by Houdini's standards.
How did you know that this is needed? It's not mentioned at all in the documentation for condir and condof.
Here's your scene slightly modified: I turned the collision shape into a regular ground plane, I added a POP force pushing the car body along X, and I deactivated the orient initialization. The result is what I'd been fighting with for days, i.e. the wheels doing weird things, ignoring their constraint directions. But if you re-enable the orient initialize, it works as expected.
So thanks of course, this is great to know! I have a feeling I'm now among roughly 12 people in the world who have this insight. Having to add 3 barely doccumented attributes via wrangles just to make directional constraints work is harsh even by Houdini's standards.
- animatrix_
- Member
- 4729 posts
- Joined: Feb. 2012
- Offline
Digipiction
I've looked at your scene and couldn't find any relevant differences to my own scene, except for the orient attribute. And sure enough, that attribute appears to be massively important, even though you're just giving it the default value it seems.
How did you know that this is needed? It's not mentioned at all in the documentation for condir and condof.
Here's your scene slightly modified: I turned the collision shape into a regular ground plane, I added a POP force pushing the car body along X, and I deactivated the orient initialization. The result is what I'd been fighting with for days, i.e. the wheels doing weird things, ignoring their constraint directions. But if you re-enable the orient initialize, it works as expected.
So thanks of course, this is great to know! I have a feeling I'm now among roughly 12 people in the world who have this insight. Having to add 3 barely doccumented attributes via wrangles just to make directional constraints work is harsh even by Houdini's standards.
They are documented here:
https://www.sidefx.com/docs/houdini/nodes/dop/constraintnetwork.html [www.sidefx.com]
Senior FX TD @ Industrial Light & Magic
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
Get to the NEXT level in Houdini & VEX with Pragmatic VEX! [www.pragmatic-vfx.com]
youtube.com/@pragmaticvfx | patreon.com/animatrix | pragmaticvfx.gumroad.com
- Digipiction
- Member
- 166 posts
- Joined: March 2014
- Offline
animatrix_Yes, I was referring to that page, it's where I learned that condir and condof even exist. But there's no mention of the orient attribute being important for them to work.
They are documented here:
https://www.sidefx.com/docs/houdini/nodes/dop/constraintnetwork.html [www.sidefx.com]
Regardless, either I'm being very thick or this gets tricky as soon as you make the rig a bit more complex. I've added a simple suspension to Tomas' example scene, and the suspension doesn't respect its constraint direction.
Each of the four wheels is now attached to the small box closest to it, using the same constraint setup as in Tomas' original scene. Additionally, the four small boxes are attached to the big box via 8 soft constraints: 4 for position (limited to the Y axis) and 4 for rotation (no allowed rotation). But it doesn't work, the Y axis limitation is not respected. The problem persists when using hard constraints instead of soft constraints.
- tamte
- Member
- 8833 posts
- Joined: July 2007
- Offline
Digipictionthis is only important if you are rotating the rbds before solve after the constraints are set up, but its good to assume that's gonna be the case
And sure enough, that attribute appears to be massively important, even though you're just giving it the default value it seems.
that's why I made the example this way
while the value I gave it is default there is a transform applied later, so the value that actually goes into the solver always stays aligned to the transformed vehicle
DigipictionI've done a lot of constraint work inside of the solver, where the orient plays important role
How did you know that this is needed? It's not mentioned at all in the documentation for condir and condof.
however it's not exactly necessary to provide it, if you don't provide orient, it will just initialize world space orient at initial frame
in which case it will be important that your condir points in the right world direction and not just representing the local direction since without custom orient there is no local
so due to mentioned transform, it's important to make sure your condir is marked as vector so that it transforms also and points in the right world space direction at initial frame (fixed file included with no initial orient attrib but condir marked as vector)
Edited by tamte - March 14, 2023 14:32:28
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- tamte
- Member
- 8833 posts
- Joined: July 2007
- Offline
- Digipiction
- Member
- 166 posts
- Joined: March 2014
- Offline
- mestela
- Member
- 1803 posts
- Joined: May 2006
- Offline
I remembered someone odforce had a big thread about car rigging, just found it:
https://forums.odforce.net/topic/39684-how-create-a-constraint-network-for-simulating-car-suspensions/?do=findComment&comment=192004 [forums.odforce.net]
Julian has posted updates on a few other posts on odforce, as well updates towards the end of that thread I linked, worth a browse around.
https://forums.odforce.net/topic/39684-how-create-a-constraint-network-for-simulating-car-suspensions/?do=findComment&comment=192004 [forums.odforce.net]
Julian has posted updates on a few other posts on odforce, as well updates towards the end of that thread I linked, worth a browse around.
Edited by mestela - March 14, 2023 19:41:17
- Digipiction
- Member
- 166 posts
- Joined: March 2014
- Offline
- Digipiction
- Member
- 166 posts
- Joined: March 2014
- Offline
tamteTake a look at frame 16 in your scene. While the spring motion looks great now (requiring no less than 3 constraints per spring to limit it to one axis!), you can see that the wheels are now not respecting their rotation limitation to just one axis - they are also bending inward.
and here is the fixed suspension
In Blender or even Unity you have a series of checkboxes that you can untick in order to limit a constraint's freedom of movement or rotation, and from what I've seen that actually works.
To get spring motion along just the Y axis, in Houdini we now had to add:
- a position spring or hard constraint whose @condir is set to Y (condof 2)
- a position spring constraint with free movement
- a rotation spring or hard constraint with no movement
And having made these additions, now the wheels don't respect their rotation limitation anymore.
I think next time I need a vehicle rig I'll do it game-style, with raycasts against the ground and calculating the forces in a SOP solver myself. But this whole thing really makes me wonder whether the internal code is broken somewhow.
- tamte
- Member
- 8833 posts
- Joined: July 2007
- Offline
Digipictionyou can definitely tweak the settings to make it stiffer
Take a look at frame 16 in your scene. While the spring motion looks great now (requiring no less than 3 constraints per spring to limit it to one axis!), you can see that the wheels are now not respecting their rotation limitation to just one axis - they are also bending inward.
you can increase the constraint iterations a bit, maybe a 100 (I believe you can also do it per constraint)
but mostly Constraint Error Parameter on the constraints defines what percentage of the constraint has to be corrected each step, defaults to 0.2 so it's not gonna enforce it fully, it's not recommended to go above 0.8 for stability tough, but even 0.8 should already give you much stiffer result
Edited by tamte - March 15, 2023 12:17:35
Tomas Slancik
FX Supervisor
Method Studios, NY
FX Supervisor
Method Studios, NY
- w_maro
- Member
- 86 posts
- Joined: Sept. 2014
- Offline
there is also an interesting talk about
- Vehicle Destruction & Dynamic Rigging with RBDs | Keith Kamholz | Houdini HIVE Worldwide
Your text to link here... [www.youtube.com]
- a complete car-rig Setup
Your text to link here... [youtu.be]
- Vehicle Destruction & Dynamic Rigging with RBDs | Keith Kamholz | Houdini HIVE Worldwide
Your text to link here... [www.youtube.com]
- a complete car-rig Setup
Your text to link here... [youtu.be]
Edited by w_maro - March 19, 2023 13:04:28
- w_maro
- Member
- 86 posts
- Joined: Sept. 2014
- Offline
- so here is my car rig setup
based on tutorial by Ayman Abolila - see link in previous post
the rig setup works fine
Except for the steering
in the tutorial the control is done with a sopsolver
But when I try that, the wheels spin without applying any force
- So I think it has something to do with the Sopsolver
looks like the steering is being forced every frame and is causing the problems
Is this a valid setup to steer the wheels?
or are there better options?
any help is welcome
based on tutorial by Ayman Abolila - see link in previous post
the rig setup works fine
Except for the steering
in the tutorial the control is done with a sopsolver
But when I try that, the wheels spin without applying any force
- So I think it has something to do with the Sopsolver
looks like the steering is being forced every frame and is causing the problems
Is this a valid setup to steer the wheels?
or are there better options?
any help is welcome
Edited by w_maro - March 26, 2023 06:02:57
- TheDude123
- Member
- 84 posts
- Joined: Jan. 2019
- Online
w_maro
- so here is my car rig setup
based on tutorial by Ayman Abolila - see link in previous post
the rig setup works fine
Except for the steering
in the tutorial the control is done with a sopsolver
But when I try that, the wheels spin without applying any force
- So I think it has something to do with the Sopsolver
looks like the steering is being forced every frame and is causing the problems
Is this a valid setup to steer the wheels?
or are there better options?
any help is welcome
I'm having a similar issue with this set-up. Did you ever solve the steering problem?
- w_maro
- Member
- 86 posts
- Joined: Sept. 2014
- Offline
-
- Quick Links