Jump to content

ROP Driver In FOREACH?


Recommended Posts

HI All,

I can't seem to figure this out.

I have a cube that is fractured. I have discarded all the edge/exterior pieces so I only have the interior pieces.

I want to write each of those pieces to an OBJ file and center them at world origin.

 

I tried using an expression in the filename of a ROP Driver inside a FOREACH but it does not work.

$HOME/Houdini_Scenes/GEO/rock_` stamp("..","FORVALUE",0)`.obj

I only get one OBJ file written to disk and it contains no points (only 128 bytes).

Does anyone know how to write an object per-group instead of an object per-frame?

ap_rocks.hipnc

Link to comment
Share on other sites

Ok, I figured out how to center a single resulting rock object by manually adding an index attribute and using a stamp expression but I still don't know how to iterate over a group or detect what index I need.

 

My result set is piece30, piece39 and piece45. So I have 3 pieces. I need to loop 3 times and write an OBJ for each resulting piece.

Untitled-1.jpg

ap_rocks.hipnc

Link to comment
Share on other sites

EDIT: Sorry I just realized that this is probably what you already meant by "writing an object per frame".

The way I usually do this is by using the framenumber to isolate my groups with a blast or delete node (piece`$F4`). Then you can simply render per frame but get a per group output.

I've attached a modified version of your file. Hope this helps.

-dennis

ap_rocks.hipnc

Edited by dennis.albus
Link to comment
Share on other sites

Ok, second try.

I guess that you only choose those 3 pieces because the others have flat sides from the original cube.

I have adjusted the file a little more to automatically blast everything with "original" geometry (flat sides). Then I recreate geometry groups to get them sorted in order. Finally you can output the groups per frame.

I hope this is what you need ;)

-dennis

ap_rocks.hipnc

Link to comment
Share on other sites

I generally avoid loops like the plague if there are other ways to do stuff. Gave it a try on my ancient laptop that can barely run houdini (seriously, it takes like 5 minutes to even start the program and has no middle-click), might give you ideas for the future atleast.

edit: Oh missed that you only wanted a few of the pieces and not all, optional nodes in green.

 

ap_rocks.hipnc

Edited by Skybar
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...