In Maya, I am not able to cache a custom matrix attribute to an Alembic cache of geometry. The Alembic cache and the attribute data is to be used in Katana.
Our surfacing team asked me if I can pass an Arnold UV projection node’s “placementMatrix” attribute to a model’s Alembic cache.
I added a custom matrix attribute to a relevant geometry shape node, and then connected the Arnold UV projection node’s placementMatrix attribute to it. I cached the geometry. To test whether the attribute survived in the cache, I imported it back into Maya. I received a warning:
// Warning: Unsupported attr, skipping: placementMatrix float64_t[16] //
Not supported? Is what I’m trying to do not possible? We tested the cache in Katana and the attribute does not appear, most likely for the same reasons (surfacing artist did not tell me if they received any errors)
PyMel Example. Make sure the Arnold and Alembic plugins are loaded.
from pymel import core
ball = core.polySphere(name='ball', constructionHistory=False)[0]
ballshape = ball.getShape()
attr_name = 'placementMatrix'
ballshape.addAttr(attr_name, dataType='matrix')
proj = core.createNode('aiUvProjection', name='projection1')
proj.placementMatrix.connect(ballshape.placementMatrix, force=True)
path = r"C:\temp\test.abc" # wherever you want, as long as the folder exists
job_str = ("-frameRange 1 1 -attr {attr} -stripNamespaces "
"-writeColorSets -writeVisibility -writeUVSets -dataFormat "
"ogawa -root {node} -file {path}".format(attr=attr_name,
node=ball.name(),
path=path))
core.AbcExport(j=job_str)
When the resulting Alembic is imported in Maya, you will see the warning.
Any ideas? Surfacing said they wanted a matrix in Katana. I’m not that familiar with Katana, so I don’t know of any alternatives.