Welcome to od|forum

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

Sign in to follow this  
Followers 0
tottman1

Export Multiple FBX Using Python

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

Share this post


Link to post
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.

Share this post


Link to post
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. 

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
Sign in to follow this  
Followers 0