Results 1 to 6 of 6
  1. #1
    Join Date
    Jul 2008
    Location
    Shalimar
    Posts
    21

    Bad Script in the Maya ADP course.

    Hey guys. I'm taking the Maya ADP course, and there seems to be a bad script in the tool development folder (or bad instruction).
    It's the script we build in the "Getting info" and "Looping" video's. I've re-done it several times now, and it just doesn't do what it's supposed to.
    Anyone know how to fix it so I can continue the folder?
    Here's the script, the problem seems to be in the last section.
    /*
    Joint Splitter Script
    This script will take a 2-joint chain and split it into a given number of segments.

    */

    //Create a "default" orientation -xyz
    joint -e -oj xyz -sao zdown -ch -zso;

    //Store desired number of segments
    int $inputSegments = 6; //At this time, this value is hard coded.

    //Store the name of our joints
    string $selected[] = `ls -sl`;
    string $firstJoint = $selected[0];

    string $children[] = `listRelatives -c $firstJoint`;
    string $secondJoint = $children[0];

    //Store length of original chain
    float $originalLength =`getAttr ($secondJoint + ".tx")`;

    //Calculate and store segment length
    float $segmentLength = $originalLength/$inputSegments;

    //Loop for number of segments
    for($i=1;$i<$inputSegments;$i++)
    {

    //Insert a new joint under parent
    insertJoint;

    //Move inserted joint by segment length along 1st orientation axis
    move -os -x $segmentLength;
    }
    //Move original child as well
    select $secondJoint;
    move -os -x $segmentLength;

  2. #2
    Join Date
    Feb 2005
    Location
    /..
    Posts
    2,597
    I think (...and it is 60% guess) that in newer versions of Maya they changed the default axis on the last joint in the chain. In the script the last line moves in object space on the x axis, with the change I think it will need to be the y axis.

    Will have to look into it more later
    There is an exception to every rule, apart from this one.

  3. #3
    Join Date
    Jul 2008
    Location
    Shalimar
    Posts
    21
    Hahaha, that did it....thank you sir!!
    You're a gentleman and a scholar, that was driving me nuts.

  4. #4
    Join Date
    Jul 2008
    Location
    Shalimar
    Posts
    21
    It's weird though, I'm taking the course in 2008 (the same version Zak is using).
    Must have changed it in service pack 1.

  5. #5
    Join Date
    Jul 2010
    Location
    Dickson, TN
    Posts
    564
    Nice catch! I've added a txt file to the assets and a note to the video description noting the change. Thanks, Faux!

  6. #6
    Join Date
    Feb 2005
    Location
    /..
    Posts
    2,597
    It's weird though, I'm taking the course in 2008 (the same version Zak is using). Must have changed it in service pack 1
    Hmm, can't see it mentioned in the 2008sp1 release notes.
    Like I said I'll try and dig more into this and re-watch the tool building section.

    Let me know if switching the axis to y has any later effect for you, can't see why it would mind
    There is an exception to every rule, apart from this one.

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •