Houdini Alembic to Maya group - how to keep pieces separate?

   11053   12   3
User Avatar
Member
29 posts
Joined: Feb. 2015
Offline
I've got a fracture sim in houdini that's all set up and I'm trying to export it to an Alembic sequence to bring in to Maya.

This all works well except for one thing, the Alembic file, once imported into Maya is one single object.

I tried following the video - https://vimeo.com/92866922 [vimeo.com]
And messed around with the suggestions here - https://www.sidefx.com/index.php?option=com_forum&Itemid=172&page=viewtopic&p=175018&sid=f1f97f13881eb72110f08c9ebc4866a8 [sidefx.com]

But nothing seems to work. When I do use the name attribute I do get individual pieces, but they're all empty in Maya.

Any help would be much appreciated.
User Avatar
Member
258 posts
Joined:
Offline
You should probably post a file…I use this method all the time and it works. One thing that I have noticed is that the nameSop should be the last sop before the Alembic rop and it also needs to be clicked on. Meaning that even though the alembic rop is the last in the chain, the namesop should be next up and clicked blue so that it is active.

Also check your name attribute in the spreadsheet and make sure that it is being propagated.
User Avatar
Member
29 posts
Joined: Feb. 2015
Offline
Here is an example file. One question, does the name attribute need to be point or prim? There is a name point attribute and I tried using that for the partitioning, but I still get a single mesh.

Also for ref I'm using Maya 2016 and Houdini 14

Attachments:
sphereTest.hip (228.4 KB)

User Avatar
Member
258 posts
Joined:
Offline
You were almost there…I just unpacked and changed the alembic file format to hdf5. I think Maya 2016 supports ogawa now. make sure you have display shapes on in the outliner. I included a Maya file.

As a side note - If you do not have a “piece” attribute but have partitioned groups or really any groupings, i.e- mygroup01, etc - then you can:

1. use nameSop
2. set it to name by group with * being in the group prefix
3. put in one groups name in the group field
4. put the extact same name in the name field

This will map your groups to name attribute that you can export and have in Maya

Attachments:
alembic_test.rar (292.7 KB)

User Avatar
Member
29 posts
Joined: Feb. 2015
Offline
So that actually gave me the same results.
Let me expand on my issue.
I'm able to bring in the alembic with all the shapes like in the example you sent me (unpack not necessary for that). I also wrote a script that extracts the shapes to individual objects in Maya. My problem is that I then need to back that animation down to a keyframe animations. The problem is that the objects brought in by alembic bake down with no motion (because as far as transforms go, there is no motion).

The video I posted above shows the objects coming in as individual objects in Maya with transforms and all. I actually managed to do this the first time I was following along with the video, but I have not been able to replicate it. I'm not sure what magic button I hit the first time (and I followed the video exactly every time), but I can't reproduce those results.

So I guess my real request is a way to get Houdini simulations to a Maya keyframe animation. Is Alembic a viable method for that?
User Avatar
Member
258 posts
Joined:
Offline
Ahhh, I mis-understood , I could not understand why this wasn't working but now do…

I just watched the video and tried to use his script. One thing that I noticed is that he is typing in $F into the file name and that gives you groups, as well. It appears in Maya that his geo is imported just as in yours, under a shape node but when I run the script, it is unsuccessful.

I would also like to get this working so I will spend some time with it….
User Avatar
Member
29 posts
Joined: Feb. 2015
Offline
Huzzah, I'm not insane! Well… anyway

It's something to do with my version of Houdini. When I followed the video I was using Houdini 14.0.258. I recently updated to 14.0.361. Just for the heck of it I loaded up my old version and it all works perfectly!

Not sure why that is, but at least I found a solution.
User Avatar
Member
7 posts
Joined: Feb. 2013
Offline
Glad you found a solution. I saw your comment on vimeo but I can't check it at the moment as I'm on vacation and only have access to apprentice. No Alembic export allowed.
User Avatar
Member
4 posts
Joined: Dec. 2014
Offline
For me, I was exporting an OBJ file out of Maya which had materials. I bring it into Houdini and using a File node and it's able to read all my objects. Downstream, I wanted to export to Alembic file so I can import it back into Maya and re-texture/shade it. But it was coming in as 1 object.

What I did that got it working:
Create an Attribute Wrangle and make Run Over "Primitives".
Here is my VEXpression:
string v[] = split(s@shop_materialpath, "/");
s@path="case/"+v[-1]+"/"+v[-1];
Basically, this copies the string from my shop_materialpath attribute and formats it into a "path" attribute. Using this specific format for
s@path
which is PARENT_GROUP / OBJ_GROUP / OBJ_GROUP might look like "mat/GlassSG/GlassSG" will make sure when you import your Alembic file, it will come in as separate objects.
In your ROP Alembic Output node, enable "Build Hierarchy From Attribute" and for Path Attribute type "path".
Export.
Imported into Maya.
Works.

Another way is creating a Name node, class "Primitive" enable "Name from Group", Group Mask is "*" Group should be any 1 group name, in my case "Body" and for Name, use the same as Group use "Body". This will add a "name" attribute and the value will be the group name, it will rename accordingly for all groups even though you used one name. Then you can use Attribute Wrangle to create a "path" attribute, or use "name" attribute in the ROP Alembic Output node.
Edited by Guy Micciche - Jan. 19, 2023 19:53:05
User Avatar
Staff
329 posts
Joined: July 2005
Offline
Guy Micciche
What I did that got it working:
Create an Attribute Wrangle and make Run Over "Primitives".

Alembic archives have a structure similar to a filesystem. This structure is meaningful to many tools that process Alembic archives. Here are some good guidelines when using the Alembic ROP:

1) Explicitly tell the Alembic ROP where to place everything in the Alembic archive via "path" attribute. This should be a primitive string attribute.
2) Make sure each Alembic Shape node has a unique parent (for example, use paths for your shapes like "/piece0/piece0Shape", "/piece1/piece1Shape", "/piece2/piece2Shape"... instead of "/pieces/piece0", "/pieces/piece1", "/pieces/piece2").
3) Change the "Packed Transform" parameter to "Merge With Parent Transform" to avoid complication with packed primitives that will force the Alembic ROP to rename your nodes.
User Avatar
Member
8555 posts
Joined: July 2007
Offline
derrick
3) Change the "Packed Transform" parameter to "Merge With Parent Transform" to avoid complication with packed primitives that will force the Alembic ROP to rename your nodes.
I'd prefer if those complications were eased

since we want to keep only transforms and preferably instancing
it's not ideal that Houdini appends Packed and Instance suffixes to object paths even if they are already unique per packed primitive
if multiple packed primitives have the same path, then it makes sense that it would be made unique but it would be nice if it respected if they are already unique
Tomas Slancik
FX Supervisor
Method Studios, NY
User Avatar
Staff
329 posts
Joined: July 2005
Offline
tamte
I'd prefer if those complications were eased
since we want to keep only transforms and preferably instancing

The current default is "Deform Geometry". This pretty much prevents the use of instancing.

"Merge With Parent Transform" sounds like the behaviour you are actually asking for. Its unfortunately confusing name probably hides the fact it is the mode you really want. Ideally, this should be made the default and the Alembic ROP should behave better when using "Merge With Parent Transform" without a "path" attribute.
User Avatar
Member
8555 posts
Joined: July 2007
Offline
derrick
"Merge With Parent Transform" sounds like the behaviour you are actually asking for. Its unfortunately confusing name probably hides the fact it is the mode you really want. Ideally, this should be made the default and the Alembic ROP should behave better when using "Merge With Parent Transform" without a "path" attribute.
that's not exactly desirable, since that prevents exporting multiple transforms, we usually have thousands of packed primitives with individual transforms at sop level that need to be preserved

by complications I meant the automatic unnecessary name changing which breaks our naming conventions and round tripping of assets that just needed to be transformed or instanced in Houdini

I've just submitted an RFE#126566, outlining the issues with the naming with example file
Edited by tamte - Jan. 21, 2023 02:01:22
Tomas Slancik
FX Supervisor
Method Studios, NY
  • Quick Links