How to export a custom attribute on alembic export attached to the actual AlembicNode?

How to export a custom attribute on alembic export attached to the actual AlembicNode?

sophia.berger966CF
Explorer Explorer
1,944 Views
3 Replies
Message 1 of 4

How to export a custom attribute on alembic export attached to the actual AlembicNode?

sophia.berger966CF
Explorer
Explorer

Hello, I am having a bit of an issue exporting a custom attribute. I add the attribute via 

cmds.addAttr("myAttrName")

then set using 

cmds.setAttr("myAttrName", myValue)

then finally add the custom flag 

-attr myAttrName -userAttr myAttrName

on export using the cmds.AbcExport option. This does export the attribute, but on the geometry for the imported alembic, and not the actual AlembicNode. I would like that attribute to show up on the AlembicNode itself (under the "Extra Attributes" tab) but I can't figure out how to get that to happen. Is there a way to achieve this using the alembic python module, or better yet, within Maya? 

0 Likes
1,945 Views
3 Replies
Replies (3)
Message 2 of 4

Kahylan
Advisor
Advisor

Hi!

 

Sadly I don't think this is possible, atleast not while exporting. The Alembic Node is just created when it is exported, so you can't really add any attributes to it beforehand and the AbcExport command only has flags to write attributes onto the geometry.

 

What you could do, is create a script for importing your alembic that automatically adds the attribute to the alembic Node after it is imported...

 

What do you need this attribute for?

0 Likes
Message 3 of 4

sophia.berger966CF
Explorer
Explorer

It's just an integer that is meant to pass a value through our pipeline, it was requested it be on the alembic node - I'm trying to see if there's a way to modify the alembicNode post export via alembic's OArchive but I think your solution is probably better

0 Likes
Message 4 of 4

madugundikau
Community Visitor
Community Visitor

Is it possible to import values to custom attributes using script?

for example I have 3 custom attributes 

 

 

attribute    Minimum value    Maximum value

  p1                      0                               1

  p2                      0                              1

  p3                     0                               1

 

with its range

 

now I have to pass below shown values to that custom attributes. is there any script for this?

 

 

{p1  0.1,     p2  0.4 ,    p3  0.3

 p1  0.4 ,    p2  0.2  ,   p3  0.5

 p1  0.5,     p2  0.5 ,    p3  0.1

 p1  0.3      p2  0.5      p3  0.5}

 

script as to read 1st set of parameters values (p1 0.1,    p2 0.4 ,    p3 0.3) and save the files in STL format 

again script as to read 2nd set of values(p1  0.4 ,   p2  0.2,    p3  0.5) and save the file in STL format and continue the set for parameters values

 

Please help me with this script

0 Likes