particle attributes

   8059   12   2
User Avatar
Member
3 posts
Joined: May 2014
Offline
how do I access attributes sored on points in a bgeo?

I read the bgeo cache into the Houdini engine, and can render these particles in Arnold. Standard attributes for color / velocity etc. render fine, but how do I pick up arbitrary point attributes stored in the begeo to use in my Arnold shader. I know what attributes are in the bgeo files, but they don't seem to be available in maya? I put the name into an arnold user data node, but they don't have any effect.
awong
Member
818 posts
Joined: Sept. 2013
Offline
The non-standard attributes aren't being outputted at the moment. How does Arnold expect to find the arbitrary attributes? Would they simply be dynamic attributes on the shape nodes?

Arbitrary point attributes do get outputted for particles though, since Maya natively supports arbitrary per-particle attributes.
Andrew / アンドリュー
User Avatar
Member
3 posts
Joined: May 2014
Offline
Hi,

on a particle shape, yes all the extra attributes could be stored as dynamic attributes. When using Arnold, the particle shape has a field to type in what attributes you want to export to Arnold. These can then be picked up in shading networks using the aiUserDataColor/Float/Vector shading nodes.

Mesh shapes are different and don't hold point data like Houdini, but can hold multiple colorSets which would be required to hold velocity data for motion blur, and other color data such as opacity or temperature for example.

thanks.
awong
Member
818 posts
Joined: Sept. 2013
Offline
For particles, you need to create a dynamic attribute (with the corresponding point attribute name) on the particle node. Then, the data from the custom point attribute will be available in that dynamic attribute. See the attached Maya scene.

Note that when you hit “sync”, the nodes below the asset are re-created. So you'd have to manually re-create the dynamic attribute too.

Attachments:
particle_attribute.zip (10.0 KB)

Andrew / アンドリュー
User Avatar
Member
3 posts
Joined: May 2014
Offline
HI,

this is good, and makes sense, however it would be better if all possible attributes in a particle bgeo are added as dynamic attributes to the maya particle shape by the Houdini engine when you press sync. I cant see any reason why you wouldn't want this, as you should only be exporting from Houdini the attributes that you will need.

Thanks,
Dave.
awong
Member
818 posts
Joined: Sept. 2013
Offline
I agree. And this should be fairly straightforward to do for particles. Let me look into this.
Andrew / アンドリュー
awong
Member
818 posts
Joined: Sept. 2013
Offline
I just made the changes to automatically create the particle attributes according to what are being outputted from the asset's geometries. Note that Maya's particles only support float and vector per-particle attributes. This means only float and vector (or float3) attributes can be outputted as per-particle attributes. This means that only tuple size of 1 and 3 can be outputted. String and int type attributes also can't be outputted.
Andrew / アンドリュー
User Avatar
Member
1767 posts
Joined: Oct. 2010
Offline
omg…! is that what this is?

• Maya: Added support for outputting extra geometry attributes into Maya mesh and particle nodes.


does that mean that I can also output arbitrary attributes to any geometry? (i.e. a point attribute called foo will come through in maya somehow? )
-G
awong
Member
818 posts
Joined: Sept. 2013
Offline
Yup, attributes on meshes will also be outputted! This includes detail, prim, point, and vertex attributes. They will be created as dynamic attributes on the mesh node or particle node. The Maya dynamic attributes will be named exactly as the Houdini geometry attributes coming out of the asset.

Prim, point, and vertex attributes are always array type attributes on the shape nodes. When creating arrays, since the only tuple size that Maya supports is vector (i.e. float3), attributes will simply comes in as a flat array. Vector (float3) attributes is the only exception, and they will come in as a vector array.

Detail attributes get a bit more interesting. Maya supports a few tuple sizes, such as int 2 and float 3. So detail attributes could actually come in as simple value types. Since the Maya attributes use the exact name as the Houdini geometry attributes, if an attribute of the same name already exist on the shape node, then those attributes will be used. This basically means you could control certain shape (mesh/particle) node attributes using detail attributes!
Edited by - March 31, 2015 11:03:10
Andrew / アンドリュー
awong
Member
818 posts
Joined: Sept. 2013
Offline
I just realized there's a bug in outputting string attributes… :? Looking into fixing that.
Andrew / アンドリュー
User Avatar
Member
1767 posts
Joined: Oct. 2010
Offline
man… this is super awesome.. you just gave me a drop dead reason to get latest
-G
User Avatar
Member
1767 posts
Joined: Oct. 2010
Offline
hey Andrew, thank you again for implementing this! I am quite enjoying it

one thing that I was wondering is, I see the new extra attributes in the attribute editor of the shape node, but for some reason, I could not find them in the connection editor.. it is not a huge deal as I was able to find the appropriate plugs in the HoudiniAsset node, but I am wondering whether those extra attributes should be in the connection editor?

so also, for example, if I wanted to getAttr on those dynamic attributes, how would I call them? (is it getAttr meshShape.myAttrName?)

thank you!
-G
awong
Member
818 posts
Joined: Sept. 2013
Offline
They should show up in the connection editor. I see them in my connection editor. The connection editor does have some options to filter out attributes. Maybe the attributes are just being filtered out?

Attachments:
extra_attributes.png (151.4 KB)

Andrew / アンドリュー
  • Quick Links