DPK_rigCreateConstObj 1.04		Dec 12, 2003


---------
Contents:
---------
1. Files Included
2. Installation
3. Quick Start
---------



-----------------
1. Files Included

- DPK_rigCreateConstObj.mel               Version: 1.04
- DPK_getFlagAsString.mel                 Version: 1.01
- DPK_rigShortName.mel                    Version: 1.00
- readme.txt


---------------
2. Installation

Copy the ".mel" file into your scripts directory (e.g.: ../maya/scripts) and
create a shelf button with the following command (including all "{}"):

// -- start -- //

{
    // Get the selected objects.
    string $sels[] = `ls -sl`;

    // With no objects selected, we can't constrain anything.
    if (!size($sels)) {
        error "No objects selected.";
    }

    // Get the type of constraint the user wants to have.
    string $result = `confirmDialog -t "Contrain?"
        -m "Please select which constraint should be created."
        -b "point" -b "orient" -b "both" -b "none"`;

    // We store the choice in two variables.
    int $point, $orient;
    if ($result == "point" || $result == "both")
        $point = 1;
    if ($result == "orient" || $result == "both")
        $orient = 1;

    // Iterate through all selected objects and create a constraint object for
    // each. We'll store the new objects in the $const array, so that we can
    // select them later.
    int $c;
    string $const[];
    for ($sel in $sels) {
        $const[$c++] = `DPK_rigCreateConstObj
                                $sel
                                ("-p "+$point+" -o "+$orient)`;
    }

    // Select the new objects.
    select $const;
}

// -- end -- //


The shelf button is a little complicated because this scrpit is intended to be
used within other scripts.


--------------
3. Quick Start

- Create several objects such as spheres or cubes and move/rotate them into
  any position.

- Select one or two of them and press the shelf button.

- When asked which constraint should be made, select "both".

- Parent the newly created transform node to any other object and move it
  around to see how it affects the constrained objects.

- Now repeat the steps above but click the button several times for one
  object. Parent the new transform nodes under different objects and move them
  to see the result.


(See file header for information on the usage of the script itself.)


--------------
If you have any comments or suggestions, please email me at:
daniel@dpk.stargrav.com

Daniel Pook-Kolb
