Jump to content

VoxelData To file


Fleett

Recommended Posts

Hi everyone !

I'm trying to export the density data in primitive intrinsic:voxelId out of houdini. In numpy which would be very convenient for me.

At best i was able to get 1 frame or manually get all my frames as below.

import pickle

node = hou.pwd()
geo = node.geometry()

volume = geo.prims()[0]

densityVox = volume.allVoxels()

f = hou.intFrame()

pickle.dump(densityVox, open(filepath + str(f) +  ".pkl" , "wb"))

My question is pretty simple, is there a way to automatically make a list of those values with all frames(1 to 72 for exemples) and then export it. This would allow me at some point to automate different sims and export them. 

Thanks in advance for any help !

Link to comment
Share on other sites

Hi santOs81, 

Thanks for the reply, I finally found a way to do what I wanted, i made a script in my post-frame script in my rop output or filecache node. So for each frame in my node it also writes down a file with the voxel data. 

 

 

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