Atom Posted May 10, 2016 Share Posted May 10, 2016 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 Quote Link to comment Share on other sites More sharing options...
Atom Posted May 10, 2016 Author Share Posted May 10, 2016 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. ap_rocks.hipnc Quote Link to comment Share on other sites More sharing options...
dennis.albus Posted May 10, 2016 Share Posted May 10, 2016 (edited) 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 May 10, 2016 by dennis.albus Quote Link to comment Share on other sites More sharing options...
dennis.albus Posted May 10, 2016 Share Posted May 10, 2016 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 Quote Link to comment Share on other sites More sharing options...
Atom Posted May 10, 2016 Author Share Posted May 10, 2016 Thanks Denis, that works just fine. I thought I needed some kind of mapping from object index to frame. Quote Link to comment Share on other sites More sharing options...
Skybar Posted May 10, 2016 Share Posted May 10, 2016 (edited) 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 May 10, 2016 by Skybar Quote Link to comment Share on other sites More sharing options...
Recommended Posts
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.