Jump to content

Loading sequentially named SOPs


Recommended Posts

Hello wizards.

Im trying to load data from a big file, essentially is a stop motion 3d file. When the FBX is imported it brings a bunch of Geo SOPs inside of a Subnet containing the animation splitted in multiple SOPs name sequentially. Each of those nodes has keyframes in their 'Display' - enabled and then disabled when the next frame appears.

-Please see attached "fig.1"

---- Hope that makes sense until here ----

So

What Im trying to do, is grab each of those squentially named SOPs , put each of them inside a different place using an 'Object Merge' per SOP and using a their each individual keyframes from their 'Display' parameter to drive a 'Switch' instead. But there is hundreds of this SOPs and Im trying to find a better solution for this so I dont need to do this manually each time, because is endless and there must be a way to automate this.

-So on "fig.2" (see attached) you will see an example of this

'Display' keyframes goes from 0 to 1 - So I was trying to make an expression inside the 'Object Merge' Import file that reads the 'Display' parameter of each SOP and if the value is 1 he stays in that frame, and if the value is less than 1 he jumps to the next frame/sequentially named SOP - but I couldnt articulate properly this expression

chs("../subnet1/SOP_%04d/display") < 1 ? chs("../subnet1/SOP_%04d")

But I guess that my expression doesnt really make sense and its broken, but thats kind of the idea, and thats why I need a bit of help

e.g.

Obejct Merge > loads SOP_0001 (checks if 'Display' is 1 or less) if (SOP_0001/Display) less than 1 then loads SOP_0002 and checks display again and so on until all the sequence is done,

-----

*Each SOP is name sequentially

*Each SOP has different keyframe information, some last 2 frames some others a bit more until it changes to the next one

 

 

Any thoughts on this is highly appreciate it!

Thanks everyone!

houdini_bIr93mmOLb.png

Link to comment
Share on other sites

I'm not sure you need any Switch SOPs for this. You can use an expression in a single Object Merge's merge path to change which node's output is read.
 

`strcat("/obj/subnet/NewLayer6_", padzero(4, $F))`

 

Edit: I didn't read the asterisk points.. hmm.

Edited by Fenolis
Link to comment
Share on other sites

If you're just using the File/Import menu, try bringing the FBX into Houdini using other methods. Drop down an Agent node and change it to FBX mode. There is also FBX Character Import node and FBX Animation Import node. if you supply the same file to each, you can separate the animation from the skinning.

Edited by Atom
Link to comment
Share on other sites

Hi guys!

Thanks for your replies and thoughts on this,

I manage to get a few solutions working althought they still need refinement. Since Im dealing with Quill VR stop motion animated data, when you import it. It brings hundreds / thousands of layers into houdini that they need to be processed somehow for any 3D to properly read the data.

 

1.The first one is very similar to what I was trying above,

So since I had ODTools I just copied everything from that subnet in fig.1 and ctrl+shift v into a new sop in obj level. Then I added the below expression into the switch which basically searches for the name of the merged SOP and its 'Display' animated parameter without me having to manually copy over thousands of of these.

ch("../../subnet1/" + opname(opinputpath(".", 1)) + "/display")

 

2. Second solution, a lot more automated than the first and I got a bit of help from someone in the CGWiki Discord channel. But still needs a bit of refinement and Im working on it also, since Im dealing with stop motion data and some frames are 1,2,3,4... some others 2,4,6,10,18... and those gaps need to be filled manually for this method to work. , and he basically created a foreach loop with a bit of python that basically writes every group nodes correctly named into alembic sequences like 1.abc,2.abc,3.abc.... then we bring back all of that and merge them into 1 and export everything again. 

 

image.thumb.png.9bc6bbafc2d32748394d525dcc270714.png

 

Thanks again guys! 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...