Jump to content

Separating groups into individual objects


Recommended Posts

Hi. Newbie question again. I'm exporting a lot of my 3ds max assets (grass patches etc) to Houdini and I need them for scattering, which means I need to be able to pick individual objects. I'm exporting using alembic and each object inside the alembic have a group, but I can't figure out how to separate them. I found posts about writing a python script that separates each group into geo, but I'd prefer a less manual way, if there is one, since the contents of the alembic might change. What's the best way to do this? Thank you.

Link to comment
Share on other sites

hi,

if you make an attribute from groups and export as alembic you should get an object per attribute value (typicallyhaven't  its a @path attribute) when imported to a 3d software. note that attribute needs to be a primitive string data type.

 read the docs for more info: https://www.sidefx.com/docs/houdini/io/alembic.html

cheers, D.

 

edit: sorry I haven't been reading your post properly - if you want to import alembic groups as objects into Houdini, just use alembic archive object instead of alembic SOP.

edit 2: but for scattering. it's actually much better to have your objects as a single geo. you can use packed geometry that basically splits the object into individual elemets by groups, an attribute, or connectivity.

   

Edited by davpe
Link to comment
Share on other sites

17 minutes ago, davpe said:

hi,

if you make an attribute from groups and export as alembic you should get an object per attribute value (typicallyhaven't  its a @path attribute) when imported to a 3d software. note that attribute needs to be a primitive string data type.

 read the docs for more info: https://www.sidefx.com/docs/houdini/io/alembic.html

cheers, D.

 

edit: sorry I haven't been reading your post properly - if you want to import alembic groups as objects into Houdini, just use alembic archive object instead of alembic SOP.

edit 2: but for scattering. it's actually much better to have your objects as a single geo. you can use packed geometry that basically splits the object into individual elemets by groups, an attribute, or connectivity.

   

Hi. Thanks for answering. I didn't know there was an alembic archive node, I'll check it out when I'm in front of Houdini. About your second answer: Would you happen to have an example of how that works? How do I pick the individual elements to be used for scattering? I have the scatter set up, I just need the objects to feed it. Thanks.

Link to comment
Share on other sites

yeah, alembic archive just loads the whole scene hierarchy as you see it in 3ds max or whatever software you use. it can be useful for rendering but it's not too convenient to work with 

with Alembic SOP, objects load as packed primitives by default - 3 objects in 3ds max are loaded as 3 packed prims, but are all part of the same object if it makes sense.

alembic_scatter.PNG

alembic_scatter.hiplc

in the  example it works as following:

1) in the stream on the right hand side, attribute_randomize SOP randomly generates an attribute called @instance, with values between 0 and 2 (this is for 3 alembic objects numbered from 0 to 2)

2) in the stream on the left hand side, there is an alembic SOP containing 3 different objects. delete SOP wired after that reads the @instance attribute value for each point, and all the primitives not matching that number are removed. only the selected object makes it through.

3) after that the copy_to_points SOP inside of the loop makes the actual instancing.

there are many ways how to handle this, this is one.

also check out his video - little bit different workflow but it can help you understand better how things work:

 

 

 

Edited by davpe
Link to comment
Share on other sites

10 hours ago, davpe said:

yeah, alembic archive just loads the whole scene hierarchy as you see it in 3ds max or whatever software you use. it can be useful for rendering but it's not too convenient to work with 

with Alembic SOP, objects load as packed primitives by default - 3 objects in 3ds max are loaded as 3 packed prims, but are all part of the same object if it makes sense.

 

in the  example it works as following:

1) in the stream on the right hand side, attribute_randomize SOP randomly generates an attribute called @instance, with values between 0 and 2 (this is for 3 alembic objects numbered from 0 to 2)

2) in the stream on the left hand side, there is an alembic SOP containing 3 different objects. delete SOP wired after that reads the @instance attribute value for each point, and all the primitives not matching that number are removed. only the selected object makes it through.

3) after that the copy_to_points SOP inside of the loop makes the actual instancing.

there are many ways how to handle this, this is one.

also check out his video - little bit different workflow but it can help you understand better how things work:

https://vimeo.com/manage/338056551/general

 

alembic_scatter.PNG

alembic_scatter.hiplc

Thank you very much! That video had lots of good info (the link points to your vimeo dashboard, by the way), I'll try it out.

This will work perfectly for what I need now, but for future reference: if I want to single out specific objects from an alembic file (each object has a corresponding group), how would I do that?

 

Link to comment
Share on other sites

if you need to separate groups into it's own nodes then you've got basically three options I know about:

1) manually with delete SOP nodes (in each one select a group and delete non-selected)

2) Python script that can make it automatically (you can put it in the shelf and have one-click solution)

3) Alembic Archive instead of Alembic SOP - that will give you the same object hierarchy as in other apps, if that's what you want

Edited by davpe
Link to comment
Share on other sites

1 hour ago, davpe said:

if you need to separate groups into it's own nodes then you've got basically three options I know about:

1) manually with delete SOP nodes (in each one select a group and delete non-selected)

2) Python script that can make it automatically (you can put it in the shelf and have one-click solution)

3) Alembic Archive instead of Alembic SOP - that will give you the same object hierarchy as in other apps, if that's what you want

Sounds like alembic archives might be the way to go if I get there. Or a python script, once I learn Houdini python. Thanks again.

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