Pass user data geo properties to maya mesh export

Pass user data geo properties to maya mesh export

DavidHenion
Enthusiast Enthusiast
2,004 Views
10 Replies
Message 1 of 11

Pass user data geo properties to maya mesh export

DavidHenion
Enthusiast
Enthusiast

I'm working on a liquid sim in which I have created a couple user properties with set_geo_property nodes that I then read in hypershade with aiUserDataFloat nodes to drive certain attributes in an aiStandardShader.

 

All works fine when rendering the bifrost mesh directly - but when I use 'create maya mesh' (in order to export it to an alembic cache) - those user data values are gone and parts of the shader break.

 

How can maintain those properties on the maya mesh from bifrost?

 

Or - is there a better way to bake the mesh once I'm happy with the sim? I need those properties for the shader though.

0 Likes
Accepted solutions (1)
2,005 Views
10 Replies
Replies (10)
Message 2 of 11

sepu6
Advisor
Advisor

By the default the bifrost Geo To Maya node just transfer point_color so if you want the rest of the properties just add an asterisk in the properties parameter.

One important thing is that in the mesh under the Arnold tab you have to enable export vertex color, since is uncheck/off by default.

0 Likes
Message 3 of 11

DavidHenion
Enthusiast
Enthusiast

Ah, forgot about that - but it doesn't work, bifrost and maya mesh rendered side by side with the same shader and no go.  Do I specify somehow within bifrost itself to export them?

0 Likes
Message 4 of 11

sepu6
Advisor
Advisor

You can check what has been imported into Maya through the color set editor

Mesh Display > Color set editor

 

What type of attributes are you trying to pass?

0 Likes
Message 5 of 11

DavidHenion
Enthusiast
Enthusiast

I create two custom properties within bifrost, "dh_opacity" computed in bifrost from particle age, and "dh_set" - I'm mixing two liquid emitters and the "dh_set" property keeps track of which liquid is which.  I then use those properties to drive shader opacity, roughness, color, etc....  When I select the maya mesh and open the color set editor, its completely blank.

0 Likes
Message 6 of 11

sepu6
Advisor
Advisor

All float attributes I believe they wont work as expected so you need to make them vector(RGB) attributes so they get transfer correctly to Maya.  But it should all work. I can test it a little later.

0 Likes
Message 7 of 11

sepu6
Advisor
Advisor
Accepted solution

Its working fine as you can see, actually float attributes are working as well but you gotta use the alpha in the user data color since the color editor is telling you that. It marked as foo (a)  and if the connection still exist between BF and Maya you can update the attributes in "realtime"

Sometimes to read the attributes you have to click twice the transfer normal to make it work. Then the attributes should get passed.

 

(view in My Videos)

0 Likes
Message 8 of 11

DavidHenion
Enthusiast
Enthusiast

Very cool - thank you very much!  Its working as intended for the maya mesh - but with the same shader applied to the bifrost object, the alpha output of the aiUserDataColor node is 1.

 

So for the maya mesh - if I drive opacity from aiUserDataColor alpha output - works.

For the bifrost mesh, no good.  I can drive opacity from either the aiUserDataFloat node OR the COLOR output of the aiUserDataColor node though and that works for the bifrost mesh.

 

I can't find a way to set the default alpha on the aiUserDataColor node to 0.  If I could - I could add those two outputs together and it would work.

 

Any way around this other than having two separate shaders?

 

Also - I can't get these properties back from the alembic cache export.  Tried naming them or using *, but just seems they aren't there.  A little off topic now, but any way to get that to work?  All I'm going to do is import that alembic into a separate Maya scene to work quickly to set up final renders - should I use a different type of cache?

0 Likes
Message 9 of 11

sepu6
Advisor
Advisor

Maya vanilla Alembic is not good. You will need to save all the attributes as vectors I think. However I do not use the vanilla so I couldn't tell exactly if that would work or not. My question is why would you want to do this anyway? There is not need, just create a Maya mesh or use the Arnold procedural. 

 

Can you show in video what is not working exactly or even better share a repro scene.

0 Likes
Message 10 of 11

DavidHenion
Enthusiast
Enthusiast

I've been testing just using a file_cache node in bifrost to cache the mpm sim output before getting meshed - so far it works well, so may not need to do a separate export.  Doing it this way even negates the need for the maya mesh.

 

Thank you again for all your help.  btw - what do you use to export alembic if you don't use the built-in maya alembic export?

0 Likes
Message 11 of 11

sepu6
Advisor
Advisor

I use Bifrost for all importing and exporting. The node is call write and read alembic

0 Likes