create locomotion clips for walk cycles at origin?

   5896   15   5
User Avatar
Member
1802 posts
Joined: May 2006
Offline
Quite often walk and run cycles are locked at origin. It's possible to manually keyframe them moving forward, eyeball and correct for slipping feet, but was curious if an automatic solution exists?
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
2626 posts
Joined: June 2008
Offline
I just tried this, and here is the workflow that added a new agent clip to my clip list.

Create a copy of your existing character, dive inside and drop down an AgentDefinitionCache node. Overwrite the ClipName with a new name that does not already exist. You can uncheck the other options. Click the save to disk and you will get a .bclip file for the new animation with the keyframed animation baked in.

Inside your main character add a new clip, using the AgentClip node and set the source to File. Browse to the .bclip and it should be added as a new clip state that you can transition to.
Edited by Enivob - Feb. 24, 2020 12:57:51

Attachments:
Untitled-1.jpg (128.3 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
806 posts
Joined: Oct. 2016
Offline
If you wanted a tech-geek-solution, what you could do is check for points on ground at frame 0 and track their position throughout the animation cycle. With some luck, what you found there are the feet of the character - therefore, adding those positions' average distance between two frames to the object's world space (sign inverted) should give you “walk forward/backward/sideways” fully automatically.
Obviously this won't work with long cloths touching the ground - you could get better results using the maximum distance between frames to cover for that, but I am a fan of averaging, so I suggested that first :-)


Marc
---
Out of here. Being called a dick after having supported Houdini users for years is over my paygrade.
I will work for money, but NOT for "you have to provide people with free products" Indie-artists.
Good bye.
https://www.marc-albrecht.de [www.marc-albrecht.de]
User Avatar
Member
2626 posts
Joined: June 2008
Offline
While this adds the clip, it does not seem to pickup on the animated keyframed animation. Perhaps primtrinsic (agentlocaltransform) needs to be revised before exporting the .bclip..?

I tried an unpack-animate-repack-write bclip, but that didn't work either.

The animation step might have to animate the root bone of the rig for this to work…
Edited by Enivob - Feb. 24, 2020 13:41:59
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Staff
750 posts
Joined: Oct. 2012
Offline
I think the easiest would be:

- Import as an agent
- Move the agent forward (e.g. with an animated Transform SOP)
- Add an Agent Terrain Adaptation SOP and enable foot locking (terrain can be disabled).
- Use an Agent CHOP with Fetch Mode set to Pose to create a new clip from the agent given a time range.
- Optionally use the Extract Locomotion CHOP to extract the overall motion into the locomotion channel
- Export to a bclip or import back into SOPs via the Agent Clip SOP.
User Avatar
Member
2626 posts
Joined: June 2008
Offline
Trying that, but I'm no CHOPs wizard. I have placed a single Agent node inside the CHOP network and altered the Fetch mode as suggested.

I am using a Channel node to fetch the result from the CHOP, but Houdini does not like the results. I have scoped *.
Edited by Enivob - Feb. 24, 2020 15:29:33

Attachments:
Untitled-1.jpg (87.3 KB)

Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Staff
750 posts
Joined: Oct. 2012
Offline
On the Channel tab of the Agent CHOP there are the standard CHOP time range parameters - you can switch from Use Full Animation Range to Use Start/End if you have a custom time range.
Then you'll want to use the Agent Clip SOP if you want to import the CHOP clip back as a new agent clip.
User Avatar
Member
1802 posts
Joined: May 2006
Offline
cwhite
I think the easiest would be:

- Import as an agent
- Move the agent forward (e.g. with an animated Transform SOP)


That's the thing I'm specifically trying to avoid! Shouldn't there be a clever chops way of deriving the forward motion?
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Staff
750 posts
Joined: Oct. 2012
Offline
If you want to do it all in CHOPs, maybe use an Area CHOP to convert velocity to position after setting up a channel for the forward velocity that you want?
User Avatar
Member
1802 posts
Joined: May 2006
Offline
Hmm, almost there, but can't work out how to stop the locomotion clip resetting back to origin on each cycle, but its 1am and I have to sleep.
Edited by mestela - Feb. 25, 2020 09:05:52

Attachments:
locomotion.gif (403.2 KB)
crowd_derive_locomotion_v01.hipnc (309.5 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
1802 posts
Joined: May 2006
Offline
aha, silly kink in the locomotion channel, fixed. not perfect, but not bad.
Edited by mestela - Feb. 25, 2020 09:23:39

Attachments:
crowd_derive_locomotion_v03.hipnc (312.8 KB)
locomotion_v02.gif (524.9 KB)

http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
1755 posts
Joined: March 2014
Offline
thanks for sharing these tricks and workflows guys
User Avatar
Member
130 posts
Joined: June 2019
Offline
Hi!

Here's the slightly different setup based on the same idea. But it's more general so it can works with running cycles as well.

I utilized scope and area nodes. Scope gives you speed of the object. It's a bit more useful because you can combine speeds from different sources with any logic you want. In case of biped you just get max of both foots but you can average them for quadruped or something like that.

whole network works like that:
- get both foots speed on the ground. it's pretty much the same but you can use Foot Plant node for filtering. With setting “distance from terrain” it works exactly the same as your approach
- combine speeds with “maximum” op
- now you have ground speed with gaps which basically like “airborne periods”. filling them properly requires some really nasty physics but I just did it in a very hacky way. I just filtered channel with Envelope and add it in all gaps. Envelope gives you curve along all spikes in channel so it actually works fine. This is the trickiest part and it could require some tuning for specific clips
- after filling the gaps you have graph with agent speed. now you feed it to Area and you have your distance for clip (potentially it works on xz plane not in only one direction)

Attachments:
crowd_derive_locomotion_v04.hipnc (363.8 KB)

User Avatar
Member
1802 posts
Joined: May 2006
Offline
YES!

This is the kind of chops wizardry I was hoping for, thanks for sharing that!
http://www.tokeru.com/cgwiki [www.tokeru.com]
https://www.patreon.com/mattestela [www.patreon.com]
User Avatar
Member
385 posts
Joined: July 2018
Offline
How would you apply this workflow for a standard fbx file? i have an fbx with the rig and some fbx cycles as separate files. Do i need to convert them in an agent somehow?
Also do i have to import the whole rig? it would be much more convenient to work with the fbx character import SOP and tweak the animation stream
Edited by papsphilip - March 31, 2022 07:45:19
  • Quick Links