working with componentTags and the api

69 views
Skip to first unread message

vince touache

unread,
May 11, 2023, 8:19:41 PM5/11/23
to Python Programming for Autodesk Maya
hello, 

I'm trying to wrap my head around the new componentTag workflow from maya2022+, but I find the documentation somewhat light on this topic.

I understand I can interact with component tags using a MFnGeometryData, but every command seems to expect so called "keys", which, based on the C++ doc, seems to be strings. But I have no clue what those keys are. Any idea how I can query componentTags for a given deformer with the api? And follow up question, how do I query what's vertices/faces/edges are actually in those components (similar to cmds.geometryAttrInfo), using the api?

Thank you


vince touache

unread,
May 11, 2023, 8:25:41 PM5/11/23
to Python Programming for Autodesk Maya
to facilitate testing, you can create a cluster on a mesh, and run
  1. fn = MFnGeometryFilter(MGlobal.getSelectionListByName('cluster1').getDependNode(0))
  2. fnData = MFnGeometryData(fn.object())
then, if you try to print tags (which should return a key and give a hint on what those keys are)
  1. fnData.componentTags()
you get a RuntimeError: (kFailure): Object does not exist

This is on Maya2023
Reply all
Reply to author
Forward
0 new messages