Jump to content
soomld

Crowd agent fbx load, merging clips to single agent

Recommended Posts

Hey All,

I just have a crowd workflow question. so I have bunch of fbx files with different animations and I have been loading them in with Houdini 15.5 agent node fbx load feature (https://vimeo.com/181696549). It is really fast and clean however, I have to use multiple agent nodes to load my fbxs' in and Houdini is recognizing it as multiple agents but it should a single agent with multiple clips. Is there a way to merge all of the fbx load to a single agent or is post export .bclips will be the only way?

Share this post


Link to post
Share on other sites

update: calling in fbx load as agent primitive sop then exporting as .bclips seems to work in merging the clips to a single agent!

  • Like 1

Share this post


Link to post
Share on other sites
On 30/09/2016 at 10:56 PM, soomld said:

update: calling in fbx load as agent primitive sop then exporting as .bclips seems to work in merging the clips to a single agent!

hi Daniel i just want to say thanks for this info and double check a couple of things as i would really like to do the same thing myself!

right now (pic below) i have one animation.  So like yourself i'd like to have my agent have half a dozen different ones including 'avoid or cower' for the giant ball that tumbles over them!

so to double check your workflow...


1)
you bring a .fbx in as an agent and then export that anim as a .bclip ?  you then do this for all your anim files one at a time i'm guessing so you end up with (eg) 6 .bclip files

2)

then you load a new agent in and point him to this group of .bclip anims?  How is that done in houdini?  Do i just point the agent to the .bclips or do i need to use other 'agent' nodes ?

3)

do you then need to bake down this agent?  reason i ask is I managed to get my setup working below with no bake agent :)  its live in scene and theres no exporting of digital asset.


any advice on this would be hugely appreciated - i've got a potentially HUGE shot i'm working on here for a personal project - this ball method is just the beginning so cracking this agent-with-clips would be absolute gold for me!!  I can pay you in Maoams!!!!  :D

ant




crowd_dudes02.JPG
 

Share this post


Link to post
Share on other sites

On the Crowds shelf, the order that you use the tools is approximately the order that the tools are arranged on the shelf from left to right. So the rough workflow is you import all your boned rigs and you bake them. Then you populate and finally simulate to produce a full crowd_sim network.

Inside the crowd_sim network the orange crowd_trigger nodes produce a 0 or 1 output for the blue crowd_transition nodes. If the trigger is 1, the blue transition node begins migrating/morphing bones from the current bclip to the next bclip defined in the transition node.

How is that done in houdini?

The name of the fuschia State node is the name of the .bclip file. That is why baking happens first.

Share this post


Link to post
Share on other sites

@Atom thanks for your reply.  The info on the trigger stuff is helpful :)

Unfortunately its still not really helping me out in the sense that i'm not sure how to tackle this 'agent' setup with regard to my own custom rig.

Like i say i follow through the shelf pretty much as you say there... but i can never seem to be able to bake agent out.  The OP said he merges the .bclips but i'm lost as to what he means.

Eg i create an agent sop, switch the input to fbx and then load my fbx in.

but that is just one agent with just one anim.

in order to get multiple anims i need multiple agents but again thats where i'm stuck - essentially i want to have one agent that has 3 or 4 fbx anims plugged in.  or .bclips if thats what is needed... but I've no idea how to do this :/

is it just a case of load an agent in, choose the fbx and then export that as a .bclip ?

Share this post


Link to post
Share on other sites

Here is a workflow that worked for me in the past.

Create a character with various animations or pull one down from Blendswap.

Using whatever host 3D package you find yourself in save a FBX with baked keyframes for all bone motions. Set the timeline length equal to the length of the characters animation before exporting. Say we need a run, idle, walk. Lets also say the animations all have different lengths. Idle = 60, walk = 30, run = 45 frames in length. I will have exported 3 FBX files with baked bone animation data and timeline lengths set to the required length for each animation action.

Fast forward to Houdini....

Make sure you have saved your HIP file before using Crowd shelf tools. The shelf tools created sub folders under the HIP path.

Import each FBX into Houdini making sure that the Animation checkbox on the importer is checked.

Select any FBX subnet and click the Bake Agent tool. Enter the agent name. "test". Then you enter clip name. "idle". Accept any other boxes that popup as well. Select the next FBX subnet and click the Bake Agent tool. Enter the same exact name for the agent. "test". Then enter the clip name. "run". Repeat for all actions in a single agent.

You will notice that an agent_bake ROP has been addded to your network. Dive inside and you will see that for each time you have clicked the Bake Agent button you now have a node named like the agent_clip. In our example test_idle, test_run. Select one of these Agent nodes and set the start and end time equal to the frame range for this agents action. In our case, we would set the start and end frame for test_idle to 1-60.

Another Scenario: Lets say your FBX source has all the animations in series of keyframes instead of broken out into individual files. Lets say frames 10-70 = idle and frames 90-120 = run and frames 130-175 = run.

In this case you would go through the process of creating a single agent as described above. Now when you dive into the agent_bake ROP you would need to copy and paste the single Agent rop you had, two more times, to make three copies each correctly named as the tool would have. For instance test_idle, test_run, test_walk. With each action having it's own node you could then set the start and end frames for that action all referenced from a single FBX import.

When all is said and done you return to the top level and click the Render flag on the agent_bake ROP and it will export a .bclip and other information for each Agent node found inside the ROP. Also if you examine your HIP folder location, you will discover that a new agents folder has been created and inside that folder is a folder named like your agent name. Under that folder you will find a .bclip for each action for that agent.

Edited by Atom
  • Like 1

Share this post


Link to post
Share on other sites

@Atom wowee that's exactly what I needed thank you! so I don't need to create an agent node and point that to an fbx I simply do an import fbx from the file drop down options and then bake agent that way?

 

Thanks for this awesome description. All my anims are separate scenes so it'll always be frm1 to frmN that shud make things easier :)

 

Gonna try this shortly hope it works because it would be ace to get numerous anims in and randomised em!

 

Thanks again!  I'll post a Clip of my results when I get sorted :)

Share this post


Link to post
Share on other sites

hmmm having a little issue here - my fbx seems to explode outwards when imported - it comes in via a subnet but its like the mesh is everywhere :(  are there any options i need to have turned off/on in the filmbox fbx import options?  anim is on

Edited by anthonymcgrath

Share this post


Link to post
Share on other sites

ooo actually i took my simple agent that i created which has a ragdoll setup then i took that node and dropped it into a subnet.  THAT seems to have gone out nicely via the bake agent button - i now have a .bclip in my folder :) 

btw this is my original agent setup..  so basically an agent sop... point to the fbx, then build my collision layer and adjust the collision shapes... then the agentconfigjoints to sort the rotation values for the ragdoll.  that seems to work quite nicely.  Dont know if its right or not yet tho lol
agent01.JPG

Share this post


Link to post
Share on other sites

@Atom
hmmm i havea little issue here now... i created three nodes with subnets inside and then my agent setup in each one.  So essentially one for idle, walk, panic

they seem to bake-agent ok... i get a warning about unmatching tracks tho eg 9 tracks on idle 18 on walk - does that mess things up?  It seems to just be a warning.
sure enough i get that agents/soldier folder in my project directory so thats cool

but when i fire out the agent-bake rop it gives me a heap of stuff about not exporting the geometry. my 'soldier_setup' node seems to be empty and also the circle at the base of the character (dunno how to lose that) seems to be 100 times bigger than normal

so i'm a bit lost here now.

I've attached the .hip and the 3 .fbx files i have made.  Would you be able to take a look please?  I'm sure i'm doing something wrong or overly complex here - just cant figure out what :(  I'm fairly certain i'm quite close tho ?!

like i say with one anim it works superb but it seems that unless i go through this bake agent i cant create masses of them i hope.. right now with my original setup of a 'live' non-baked agent it crashes if i try to create more than 200 soldiers!
 

test_bake_agent_scene.zip

Edited by anthonymcgrath

Share this post


Link to post
Share on other sites

I took a look at your ZIP file and I would deem those FBX files no good.

Can you re-export them from the original app with transforms applied?

What program generated them?

 

Edited by Atom
  • Like 1

Share this post


Link to post
Share on other sites
3 minutes ago, Atom said:

I took a look at your ZIP file and I would deem those FBX files no good.

Can you re-export them from the original app with transforms applied?

What program generated them?

 

hey thanks for taking a look!  they are exported from maya

I can export them but when you say 'transforms applied' how do you mean?  my understanding is that on .fbx export the animation is baked to the joint chain?

Share this post


Link to post
Share on other sites

The bone animation is probably baked correctly, but my guess is that the actual mesh that the bones are deforming is scaled and translated away from world axis. When exporting you want to make sure that at the object level the TRS are all neutral, i.e. 0,0,0 translate/rotate and 1,1,1 for scale.

On your Maya export try setting the scale to 0.1 or 0.01 if there is an export scale option.

The entire rig came into Houdini so large that viewport clipping prevented me from even viewing it. I tried the FBX on Blender as well and it comes in very large and the main body mesh is off center.

Edited by Atom
  • Like 1

Share this post


Link to post
Share on other sites

okay i've just took a look and double checked - theres no arbitrary scaling on the mesh - its translate/rotate is 0 all round and the scale is 1 1 1 so its not that i think.

however my maya scene is built to real world cm units - so my characters is just under 200cm in maya.  I'll see if i can export the fbx now in different size as from memory hou likes metres doesn't it ?

Share this post


Link to post
Share on other sites

I tried that one and it seems the same. Excessively large. Hmm..

Have you tried the Alembic file format as a transport mechanism?

Share this post


Link to post
Share on other sites

aaarrrrrgghhhh thats so annoying its like the 'scale' option in maya fbx doesn't work!  (it does say fbx v2014 though is houdini using that?)


nope not tried the alembic route actually - i wasn't sure if it can export joints with the skinned mesh ?

Share this post


Link to post
Share on other sites

well i'm properly stuffed here - i cant get the bloody thing to scale - the closest i got weirdly was going from cm to mm in maya - that gave me a .fbx scale of 10
when i brought that into houdini the character actually seemed smaller.. below you can see the pic of a joint inside.

so now i can only think that i need to be able to scale the rig down tiny in maya to export it  :/
pic.JPG

Share this post


Link to post
Share on other sites

what i dont understand is that if i drop a geo node down, dive in and add an agent sop and set that to fbx and point it at a file it seems to visualise fine overall ?  whats different from that vs the fbx import option from the file menu ?

Share this post


Link to post
Share on other sites

I have found out that you always have to scale down your Maya Geo in Houdini by .01 at least if you are modeling or animating in real scale in Maya then do whatever you gotta do in H at then I have a the invert of 0.01 in a Transform and it work just fine. Im dealing with that right now. I've been doing Water sim , cloth sim, pyro sim, and all the geo that I get from Maya I have to scale down by that amount. we are exporting back and forth using Alembic the loading stuff in Vray PRoxy. Not issues so far.

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×