So I'm currently trying to find a nice fast way to export some user added attributes and values to a json file, based on their prefix of 'mtoa_' or 'mol_' in the attribute name. I actually have all this working just fine, but it takes quite some time to complete. The reason is that I'm currently iterating through all the shape nodes of a scene (2500+ shapes) and then for each node iterating through the attributes to see if the name contains the prefix. There must be a better way. It would be super cool if the pm.PyNode().hasAttr() method supported wildcards, which does not seem to be the case.
Does anyone have any suggestions for a better way to go about this? Thanks! -Kenny -- You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/c841473a-fdf1-4232-83eb-aabc45224b06%40googlegroups.com. For more options, visit https://groups.google.com/d/optout.
