I had the 'opportunity' to extract multiple polyBlindData attributes and values from scene files that are bordering a decade old, with little to no documentation. Below is a quick explanation of blind data and how it used. I've also included a short clip of the code I used to retrieve the data.
You can use blind data to store custom data values directly to individual polygon components, or to any DAG object.
This has the advantage of allowing your geometry to carry your custom data with it when imported or referenced, without interfering with, nor overwriting, any custom data you may have already applied in your working scene.
Using blind data carries more of a burden, however. The commands to apply blind data are more complex than for simple attributes, and you'll need a custom UI for your artists to manage the application of blind data. Also, in contrast to attributes, blind data is applied partly via construction history, which means its use will potentially impact the complexity of the dependency graph for your scene. Finally, blind data queries can be painfully slow (particularly the selection and false colouring mechanism).
Warning! A unfortunate limitation of blind data arises from the fact that it is stored as attributes - either on the geometry itself, or on polyBlindData nodes connected to the object. One of Maya's scene optimizations is to not store attributes whose current value is equal to its default value. Thus, if you apply blind data using its default value, Maya will not save this data. Always define your blind data using default values that are not intended to be applied to your scene.
Quote from Bryan Ewert over at http://xyz2.net/mel/mel.100.htm
I used PyMEL in this example. Check out the page header to find out where you can get it.
def GetPolyBlindDataAttributes(self, obj = None, attr = None):
#Set data dictionaries
blindData = {}
#Iterate the connection types for polyBlindData nodes
for connection in pm.listConnections(obj):
if connection.type() == 'polyBlindData':
connection_attrs = pm.listAttr(connection)
#Iterate polyBlindData node attributes
for attribute in connection_attrs[len(connection_attrs) - 1:]:
#Get the typeId for each attribute
id = connection.getAttr('typeId')
#Get face blind data
faces = str(obj.faces)
#Set full attribute name
attributeName = obj + '.' + attribute
#Query the compound polyBlindData attributes for child attributes
polyBlindQuery = pm.polyQueryBlindData(faces, typeId = id)
#Iterate the attributes for integer values of 1 and return the length
for i in polyBlindQuery:
#Set value of the attribute
if i == 1:
value = len(polyBlindQuery)
else:
value = pm.polyQueryBlindData(faces, typeId = id)
#Add the attribute and value to the blindData dictionary
blindData[attributeName] = value
return blindData