Customize a template binding set
 
 
 

In addition to updating a binding set from Maya, you can also manually add binding properties to or edit existing binding entries of a template binding set from an external XML editor.

To customize a binding set

  1. Open a text or XML editor and navigate to select a previously saved template file (See Create an asset template).

    By default, the XML template files you create are saved in the assets sub-directory of your current project.

  2. Search for the words “bindingset name.”
  3. Edit the appropriate entry.

    For detailed information on the XML elements allowed within a binding set definition, see Binding Set elements.

Note

You can also use the above method to create additional binding sets by copying and pasting the structure of the existing binding set and giving it a new name. However, Maya’s Autobind feature always uses the binding set with the name “MayaBindings”. You must create a custom mel script to apply binding sets with other names.

Using regular expressions

When defining conditions for binding sets, you can use regular expressions to fill in for attribute names that you don’t know or to account for a range of attribute names that follow a specific naming convention. For example, consider the following binding set:

<bindingset name=”VehicleBindingSet” template=”Vehicle”>
	<binding property=”Color” condition=”.+(\.color)”/>
</bindingset>

The regular expression “.+(\.color)” matches all strings ending in “.color” and can be broken down into the following components:

Thus when the template is bound using this binding set, any attribute whose name ends with “.color” is bound to the Color published name.

Regular expressions for binding sets follow PERL syntax, which can be found here.