Jump to content

Export Multiple FBX Using Python


tottman1

Recommended Posts

Hey, so I have a situation where i have exported a load of rbd simulations to alembic and i now, after re-importing them back in as alembic archives, I want to export them out from Houdini as FBX. 

Now, i can do this fine on an individual level, but it takes a while to export each one and then I have to come back and export the next one when thats finished, usually an hour later or something. What i I would prefer to do is to create a python script to automatically export the next one so i can leave them all going over night or something but I dont have any idea how to do this.

Can someone please help me out or point me in the right direction? :)

Thanks

Edited by tottman1
Link to comment
Share on other sites

I would use a queue manager like HQueue or Deadline and submit these as jobs. If you're using a one off workstation you can certainly use Python to automate this process. It could be as simple as a list of things to do in order. An example is below.

# Run for foo
hou.parm('/obj/geo1/file1/file').set('$HIP/geo/foo.abc')
hou.parm('/out/filmboxfbx1/sopoutput').set('$HIP/geo/foo.fbx')
hou.parm('/out/filmboxfbx1/execute').pressButton()
# Run for bar
hou.parm('/obj/geo1/file1/file').set('$HIP/geo/bar.abc')
hou.parm('/out/filmboxfbx1/sopoutput').set('$HIP/geo/bar.fbx')
hou.parm('/out/filmboxfbx1/execute').pressButton()

The script could get fancier like looking for files in a directory to automatically do this for, a list of parameters to change and a for loop, or any other way you want to go about it. This example is the least complex way of doing it and the most manual.

  • Thanks 1
Link to comment
Share on other sites

One other thing to consider when doing lots of actions like this, it's likely using only one processor core (or a couple of processor cores). If you're on a machine with lots of memory and lots of cores you can run many of these tasks concurrently. It'll use more memory linearly since it's concurrent instead of parallel but it'll speed up linearly as well. 

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...