Jump to content
mnlrbr

Particle Exporter for Octane CSV

Recommended Posts

Posted (edited)

Hello everyone,

 

I'm starting with Houdini and Python and I have a doubt which would influence my learning curve significantly.

I'd like to know if someone has specific information about reaching the transformation matrix of particles in Houdini - preferably in Python.

From the SideFx Python Documentation says it's not yet implemented. I also read somewhere here that it's possible through VOP/VEX.

The objective is to make a particle export script from Houdini to Octane's CSV - to adapt Houdini to an existing workflow. This CSV file only has these particle's transform matrix. And it would have to be usable, for example, for 5 million particles.

 

Does anyone has any tips?

 

Or in alternative if someone has this script already, it would be great! I'm not a coder (MaxScript only) and it will take me ages to get it done... 

 

Thanks in advance!

M

Edited by mnlrbr

Share this post


Link to post
Share on other sites

Houdini doesn't store particles (or points) transform matrix explicitly, so you don't need any special functionality for it. You can make it by your self from:

  • position (P attribute) 
  • optional scale (pscale attribute)
  • optional rotation (orient attribute)

Perhaps the easiest way is to use Make Instance Transform VOP inside AttributeVOP. It will create nice 4x4 matrix for you given the above (and possibly other) attributes are provided... Export it to a point attribute called, say, 'xform' and use Python to save subset of this matrix to a file (google says Octane stores 12 out of 16 floats of 4x4 matrix). Super easy (there are more elegant but verbose ways too):

xforms = hou.node("/obj/my_particles/OUT").geometry().pointAttribValues('xform')

xform is now a tuple of 16 x #particles floats, which can be saved to a file suitable for Octane.

hth,

skk.

 

Share this post


Link to post
Share on other sites

I'll start from here! I was watching python integration with houdini and it is in fact super easy (for an expert :P).

This narrows a bit my first incursion in the hou module.

Thanks!

Best

M

Share this post


Link to post
Share on other sites

Hi,

I have an HDA that can help you do look at the video below and let me know if it works for you.

 

Share this post


Link to post
Share on other sites

Hey manx151089,

Thank you so much for the answer!

This is super useful! What you are now showing is the answer for a single particle animation exporter, it's great! In fact you showed me how I can import a particle animation in OStandalone, :D Thanks!

What did you use? Python? Does this work in 17? Can this be done in Apprentice? :) so many questions!

Can you share your HDA?

Best

Manel

Share this post


Link to post
Share on other sites

The hda and also the codes are on GitHub link you'll find both of them in the video description. I used python for export and Vex to compile the matrix into the Octane readable matrix format.

Let me know if it works.

Cheers,

Manish

Edited by manx151089

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

×