Help me get the user-defined attribute of Alembic file

   1583   2   0
User Avatar
Member
1 posts
Joined: March 2021
Offline
I use the following function:
def addAttrs():
nodeName = ‘|objects:pCylinder1|objects:pCylinderShape1’

# compound attribute
cmpAttrName = ‘crease__objects_cyCreaseSet0’
cmds.addAttr(nodeName, ln=cmpAttrName, sn=cmpAttrName, at='compound', readable=True, writable=True, storable=True, keyable=True, numberOfChildren=6)

# child attribues
attrName = cmpAttrName+'name'
cmds.addAttr(nodeName, ln=attrName, sn=attrName, dt='string', readable=True, writable=True, storable=True, keyable=True, parent=cmpAttrName)
attrName = cmpAttrName+'owner'
cmds.addAttr(nodeName, ln=attrName, sn=attrName, dt='string', readable=True, writable=True, storable=True, keyable=True, parent=cmpAttrName)
attrName = cmpAttrName+'level'
cmds.addAttr(nodeName, ln=attrName, sn=attrName, at='float', readable=True, writable=True, storable=True, keyable=True, parent=cmpAttrName)
attrName = cmpAttrName+'edgecnt'
cmds.addAttr(nodeName, ln=attrName, sn=attrName, at='long', readable=True, writable=True, storable=True, keyable=True, parent=cmpAttrName)
attrName = cmpAttrName+'edges'
cmds.addAttr(nodeName, ln=attrName, sn=attrName, dt='Int32Array', readable=True, writable=True, storable=True, keyable=True, parent=cmpAttrName)
attrName = cmpAttrName+'vertex'
cmds.addAttr(nodeName, ln=attrName, sn=attrName, dt='Int32Array', readable=True, writable=True, storable=True, keyable=True, parent=cmpAttrName)


And I export the alembic file from Maya with the following command:
cmds.AbcExport(jobArg=' -frameRange 1 2 -userAttrPrefix “crease__” -file “test.ma.crease__.abc”')


I use abcecho command to confirm that the user-defined attributes are exported into abc file:
Object name=/objects:pCylinder1
CompoundProperty name=.xform;schema=AbcGeom_Xform_v3
Object name=/objects:pCylinder1/objects:pCylinderShape1
CompoundProperty name=.geom;schema=AbcGeom_PolyMesh_v1
ScalarProperty name=.selfBnds;interpretation=box;datatype=float64_t;arraysize=6;numsamps=1
ArrayProperty name=P;interpretation=point;datatype=float32_t;arraysize=42;numsamps=1
ArrayProperty name=.faceIndices;interpretation=;datatype=int32_t;arraysize=200;numsamps=1
ArrayProperty name=.faceCounts;interpretation=;datatype=int32_t;arraysize=60;numsamps=1
CompoundProperty name=.arbGeomParams;schema=
CompoundProperty name=.userProperties;schema=
ScalarProperty name=crease__objects_cyCreaseSet0name;interpretation=;datatype=string;arraysize=1;numsamps=1
ScalarProperty name=crease__objects_cyCreaseSet0owner;interpretation=;datatype=string;arraysize=1;numsamps=1
ScalarProperty name=crease__objects_cyCreaseSet0level;interpretation=;datatype=float32_t;arraysize=1;numsamps=1
ScalarProperty name=crease__objects_cyCreaseSet0edgecnt;interpretation=;datatype=int32_t;arraysize=1;numsamps=1
ArrayProperty name=crease__objects_cyCreaseSet0edges;interpretation=;datatype=int32_t;arraysize=20;numsamps=1
ArrayProperty name=crease__objects_cyCreaseSet0vertex;interpretation=;datatype=int32_t;arraysize=40;numsamps=1
ScalarProperty name=crease__objects_cyCreaseSet1name;interpretation=;datatype=string;arraysize=1;numsamps=1
ScalarProperty name=crease__objects_cyCreaseSet1owner;interpretation=;datatype=string;arraysize=1;numsamps=1
ScalarProperty name=crease__objects_cyCreaseSet1level;interpretation=;datatype=float32_t;arraysize=1;numsamps=1
ScalarProperty name=crease__objects_cyCreaseSet1edgecnt;interpretation=;datatype=int32_t;arraysize=1;numsamps=1
ArrayProperty name=crease__objects_cyCreaseSet1edges;interpretation=;datatype=int32_t;arraysize=3;numsamps=1
ArrayProperty name=crease__objects_cyCreaseSet1vertex;interpretation=;datatype=int32_t;arraysize=6;numsamps=1
ArrayProperty name=N;interpretation=normal;datatype=float32_t;arraysize=200;numsamps=1


I'm going to use these attributes to control the softness of the mesh edges in rendering. But I don't know how to get these user-defined attributes in Houdini.
I use Houdini 12~14, and it seems that Houdini doesn't show the user-defined attributes by default, but I'm not sure about this.

So, my question is:
Could you tell me how to get these user-defined attributes in Houdini?
User Avatar
Member
2551 posts
Joined: June 2008
Offline
Try dropping down an Unpack node after importing the Alembic. The attributes may be there, they're just zipped up.
Using Houdini Indie 20.0
Windows 11 64GB Ryzen 16 core.
nVidia 3050RTX 8BG RAM.
User Avatar
Member
86 posts
Joined: Oct. 2015
Offline
What Enivob said should fix your issue.

You might also try to add convert after the unpack SOP.

One other way is to choose Unpack Alembic Delayed Load Primitives on your Alembic.

Attachments:
Unpack ABC.jpg (49.4 KB)

  • Quick Links