Jump to content

Particle Exporter for Octane CSV


mnlrbr

Recommended Posts

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

 

Link to comment
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

Link to comment
Share on other sites

  • 7 months later...

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

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