Announcements

Between mid-October and November, the content on AREA will be relocated to the Autodesk Community M&E Hub and the Autodesk Community Gallery. Learn more HERE.

Importing Alembic point cloud with multiple instanced meshes

Importing Alembic point cloud with multiple instanced meshes

kresimir2
Contributor Contributor
367 Views
13 Replies
Message 1 of 14

Importing Alembic point cloud with multiple instanced meshes

kresimir2
Contributor
Contributor

Hello,

 

I hope that you can help me as I was not able to find any example for this scenery.

I am writing an Alembic exporter in 3ds max that writes particle cloud and also particle shapes as instances as well as an index for each particle (named "class") which indicates which mesh the particle uses.

 

In Houdini importing such a cache file is working smoothly, but in Bifrost I don't know how to extract those shapes and then assign to particle based on the "class" data.
This is quite important as any other option would generate a much larger Alembic file.

Included is a screenshot of data browser as well as the .abc cache file example.

Thank you!

 

Bifrost.jpg

0 Likes
Accepted solutions (1)
368 Views
13 Replies
Replies (13)
Message 2 of 14

sepu6
Advisor
Advisor

so the .abc it just brings 3 point and not geometry and it looks booked anyway.
Anyhow so when you look at the ports you can see that the read alembic node the outputs have an hat icon that means that is an array and the get geo property is a square which means 1 object that is why you are getting the warning, To know more about what the ports mean in BF have a look at this 

https://help.autodesk.com/view/BIFROST/ENU/?guid=Bifrost_Common_build_a_graph_about_data_types_html
https://help.autodesk.com/view/BIFROST/ENU/?guid=Bifrost_Common_build_a_graph_port_types_html

Also the property/attribute is call class is not a path as you are doing it now, and is int not a float which the green color is telling + the data browser you so you need to change that so you get the right data type. 

Anyhow, it should look like this

maya_54m9qfuxKw.png

0 Likes
Message 3 of 14

kresimir2
Contributor
Contributor

 

Hello,

Thank you for the information, however I would need to use the meshes that are stored inside the .abc file  (/prototypes ) and assign those to particles based on the "class".
You will need to connect time/frame to load other cached frames.
Meshes can be anything - not just simple primitives used for this test.

Included is frame 25 from 3ds max for a reference. 
I have also included an output of the Alembic file structure.

 

3dsmax.jpg

 

 

0 Likes
Message 4 of 14

sepu6
Advisor
Advisor

ok first of all did you check the file that I sent? that should do it.

I cant read the geometry from your file in Maya or BF as you can see even in Houdini the meshes are reverse and not clean, etc, but Houdini can read them, BF should be able but not sure why anyhow If clean up the geo and re-export from houdini the meshes, there are quite a bit of duplicate meshes as well, I just exported 4 meshes and I can load them fine in BF.   

 

houdini_6DKouvLeBg.png

 

maya_vhIfvSmxL7.gif

0 Likes
Message 5 of 14

kresimir2
Contributor
Contributor

Hello,

 

Sure I've checked your file and tried to modify it to work with caches from the .abc file.

As for the mesh reversal, sorry, we have set this correctly for Houdini but did't work for Bifrost.
Updated .abc is attached.

I followed your latest setup, but was not able to load particle cloud and geometry from the same file.
In your video, the geometry assignment is off (class), as those leftmost shapes should be all octahedrons.

Here is the Houdini setup, although the Attrib Wrangler is not needed as we've matched the names for H.
Also, included the latest Bifrost graph - trying to get everything from the same Alembic cache file.

Thank you for your help.

Houdini.jpg
Bifrost.jpg

 

0 Likes
Message 6 of 14

sepu6
Advisor
Advisor

look at the data type, you are getting/reading the `class` attribute incorrectly is what I said at the begging, you are interpreting the data as a float and the class attribute is an integer. you need to change the data type from a float to int by right clicking on the type and picking the correct data type. Its working fine. 

BF Frame 28

QlUylQMV09.png

H Frame 28

houdini_XUA9uyndsY.png

 

maya_sejrbmcjGj.gif

0 Likes
Message 7 of 14

kresimir2
Contributor
Contributor

Hello,

 

Thanks for the hint - I though the node would automatically determine the input type of the "class" properly (from a developer's viewpoint, that is a few lines of code).

 

From the second Read Alembic node, you're still reading from meshes2.abc - is it possible to read particles and geometry from the same, NodeWorks2Bifrost.abc at all?

 

Thanks!

0 Likes
Message 8 of 14

sepu6
Advisor
Advisor

About the data, well that happens in Houdini as well, if you do not cast your attributes by default Houdini will read them as float unless you tell it exactly what type of data it is.
Bifrost is not different on that aspect. 

 

About the meshes, is because the .abc that you posted the meshes are not clean as I mentioned, and BF does not read them, so I just read them in the houdini, clean them up and read them back into BF, so just make sure you models are clean and do not have the normals reverse, etc. But to answer your question yes you can bring both types into one abc, points, strands and meshes. 

 

 

0 Likes
Message 9 of 14

kresimir2
Contributor
Contributor

Unfortunately, due to the lack of information, it seems that we'll never know why Bifrost won't load meshes.
I can't even load into Bifrost when only vertices and faces are exported without normals or other channels.

Houdini loads the cache I have updated in previous post without any issues - proper orientation, colors, scaling and selection.


It would be helpful if there are any specs that provide information about Bifrost Alembic import.


Thanks.

0 Likes
Message 10 of 14

sepu6
Advisor
Advisor

No the meshes are reverse (not clean), to check them in Houdini, you need to unpack the data to see how the polygons look like, pack data wont show these correctly, the meshes are not clean. 
The only difference is that Houdini is reading this data. BF cant, which it probably should (probably a bug) but again if you clean the data out and save as the .abc again, BF will read them correctly.
So from whatever these meshes are coming from are not clean. 

 

You can see it here.

 

houdini_AVtSffywoK.gif

0 Likes
Message 11 of 14

kresimir2
Contributor
Contributor

Ok, I see now. Thank you very much.
That's been fixed now in attached caches, but still not sure how to load into the Bifrost.


0 Likes
Message 12 of 14

sepu6
Advisor
Advisor

What type of geo is this? Anyway here you go a working .abc

 

 

0 Likes
Message 13 of 14

kresimir2
Contributor
Contributor

 

It's a simple geometry exported from 3ds max using the exported we're developing.

 

So, the main difference is that in your .abc all meshes are now collapsed into one mesh. Thus, in Bifrost you have to use Separate Mesh node to restore individual meshes.

The exported Alembic layout that we currently have and that works with Houdini is cleaner approach, but I'll try to follow the Bifrost requirements and create Alembic with one merged mesh and see if that'll work.

Thank you very much for your help.

Edit:

I have added code to export one merged mesh and now Bifrost is able to load Alembic directly. I might submit a case to Bifrost devs to see if there are other solutions.


0 Likes
Message 14 of 14

kresimir2
Contributor
Contributor
Accepted solution

Hello,

 

With the help from the Autodesk there is a solution to this problem. Their solution used only USD nodes to load .abc, but it required point cloud attributes remapping (which takes time).

My variation uses USD node to load geometry and Alembic node to load point cloud that already have Bifrost-friendly attribute names.

However, I'd like to bring the execution performance issue to the Bifrost developers.
Although all the operations seems simple, loading of frame take quite a bit. I hope that this can be improved in future Maya builds.

Attached is the solution how to load 3ds max NodeWorks caches into the Bifrost.

0 Likes