Jump to content

Procedural OBJ splitting


Recommended Posts

Let's say I have an OBJ with 4 pieces of geo. Is there anyway to split these objects up so I can randomly copy to points? My next OBJ could have 16 objects and I don't want to create a blast node and manually select the group every time.

I've managed to figure out how to select the group through an expression and a for loop using `arg(primgrouplist("../OBJ"),detail("../repeat_begin2_metadata1/",iteration,0)).

The Transform is in there for a placeholder but I'd like to center each object at the origin so it isn't offset when it's copied.

splitOBJ.png

Link to comment
Share on other sites

dgani > connectivity can't actually split the geo, it will just identify pieces and then you have to split it by hand or by some other method.

my solution would be to use Python script that can do blast SOP (or a new geo container) per group. i've posted it the thread below.

i can imagine you could do that with TOP network as well... 

 

Link to comment
Share on other sites

hey, yeah that's certainly possible.

steps you need to do:

1 - turn group names into a string names

2 - loop over names and pack each name into a packed prim (useful if you want to deal with chunks of geometry as if they were a single points)

3 - on your template points generate an attribute that specifies which instance number is supposed to be copied onto each point

4 - before copying the geometry on points, refer to that instance number attribute and delete all packed prims that don't match that number

5 - loop over the template points and for each of them copy matching packed prims 

check the hip file for an example.

 

screen_copy_groups.JPG

obj_instance_groups.hiplc

Link to comment
Share on other sites

I learned so much from this one: (timestamp to jump to the for each block). I had to watch that part several times, especially the spare parameters which are so useful if not absolutely mandatory. Spare inputs at the 0:51:50 mark

 

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