Version 1.2
Mapping Operations is designed to help you apply various relational functions, by relating directly one set of user selected objects to another set as a mapping text file.
The mapping text file is automatically generated based on two separate source and target text files that each list the required selected objects in the correct order. Using a text editor (e.g. Notepad++) you can easily reorder the lists to match them up before creating the mapping text file.
The main benefit of this approach is that once a mapping file is setup for a collection of related objects, you can simply re-load that file again to reapply the operations later on.
Operations include:
Align
Bind
Link
Mirror
Constrain
In the File name field enter the name of a source or target file to output based on any currently selected objects. Use the X button to clear the edit field.
Choose a File type to automatically populate either the mapping Source or Target load buttons after creating the file (for convenience).
Choose a Sort by option:
Default - will sort the list by either scene order (if box selected), or the order in which you individually picked the objects.
Hierarchy - assumes only a single hierarchy is selected and finds the root object then all the child objects and lists them in their top-down tree order.
Only one object in the hierarchy is required to be selected.
Name - sorts by ascending object name order.
Save Names To Text File button will use the settings to generate a new text file in the same folder as the current scene file. It will then open the new file in your default text editor so you can easily re-order items as necessary.
Note: Once the text files are created its important to then check both the list orders to make sure the source and target items line up (from top to bottom) according to how you'd like them to be mapped.
This is especially important for hierarchies, where the top down (root to leaf) ordering will matter when applying transform operations.
e.g For a human character skeleton you typically want to have the root at the top followed by the major hubs down to the limbs and fingers/toes.
root
hips/pelvis
spine1
spine2
spine 3
neck1
neck2
head
clavicle L
upperarm L
lowerarm L
etc...
Thigh L
Calf L
Foot L
etc...
Exclude hidden objects will avoid adding objects to the list that are hidden in the Max scene.
If toggled true - for hierarchies it will avoid including the hidden objects, but will still include other members of the chain that it finds still visible. For non-hierarchies where you are able to select hidden objects using the Scene Explorer, it will avoid including those that are hidden.
The Load Source File button will display a file browser to find a text file to load as the source file. This may already be occupied if the above save names to text file process was used with the Source option.
The Load Target File button will display a file browser to find a text file to load as the target file. This may already be occupied if the above save names to text file process was used with the Target option.
You can supply your own Mapping file name or use the default "mapping.txt" as the output file. The X button will clear the edit field and the folder button will open an Explorer window to the current scene location.
Once you've inspected both the source and target text files for the correct alignment mapping order and they populate the source and target slots, you can then click the Create Mapping File button to generate a mapping text file.
This file will then be displayed in your default text editor for examination. You will notice the source objects have been mapped to the target objects via a tilde "~" delimiter.
The notepad buttons (next to the load buttons) will open their respective loaded files in the default text editor.
The Load Mapping File button is used to load a mapping text file that the script uses to reference the scene objects for applying the source to target mapping operation. This slot will be populated automatically if the Create Mapping File method was used to create the file, otherwise you'll need to load an existing mapping text file before applying operations.
The Align operation will take each of the source objects and either align the transforms to the target objects they are mapped to, or bake with animated keys for the full time range if the Bake checkbox is toggle on. This can be applied with either Position only, Rotation only, or Both options.
The Bind operation will create new point helpers (prefixed with HLP_) for each source object. The helpers will align their transforms to the source objects and have their transforms locked. The source objects will be constrained to these helpers and the helpers in turn will be linked directly to the mapped target objects. This method is particularly useful for attaching one hierarchy to another where the source and target objects have different pivot orientations (e.g. character skeleton retargeting).
The Link operation will simply link the source objects as children of their mapped target objects. Note that this method will cause each object in a hierarchy to be re-linked to their target objects, thereby dismantling the original hierarchy.
The Mirror operation is used to align the transforms of the source objects to the mirror of the target objects across a chosen Mirror axis. The operation can be applied using either the World coordinate system or a picked object's Local coordinate system. If a valid mirror axis object is picked (in Local mode) you'll be able to select it using the Select Mirror Object button for quickly determining it's local axis to use. After the mirroring is finished, the source objects will have their scale reset to avoid having negative values. Mirroring can be also be animated across the full time range using the Bake checkbox.
The mirror operation is useful for character skeleton hierarchies where you want to mirror the pose from one side to the other.
The Constrain operation will allow either Position, Orientation, or Both constraint types to be applied from source to target objects. Optionally you can allow Keep initial offsets for each configuration as needed.
Remove Constraints will take the current selection and replace the position controller with Position XYZ and the rotation controller with Euler XYZ controllers - effectively removing the constraints.