[Maya] Copy/paste multiple values in channel box

Every now and then I find myself wanting to copy multiple transformation values (translate/rotate/scale etc) from one object to another in the channel box. I usually end up copying them one by one, which is kinda tedious. I'm thinking I could probably use constraints instead but I'm not sure it'll actually be quicker.
Does anyone know if there's a mel script for this or are there other quick ways to do it?

Replies

  • warby
    Offline / Send Message
    warby polycounter lvl 13
    -dublicate the object that has the transform you want
    -select that object than the object you wished had the proper transform values
    -modify > replace objects.
  • natsu
    Offline / Send Message
    natsu polycounter lvl 6
    Select all your objects that you want the attributes to copied to then select the object(so it will be greenly highlighted if you have default color settings) you want to copy from.

    Then just select in the channel box what you want to copy and press TAB.
  • o2_is_alright
    @natsu That's exactly what I was looking for, thanks^^ Although it only works with one value at a time it's so fast it doesn't matter.
    @warby Replace objects is a good option especially if you want to copy many values. Although it seems the translation is always copied though so it might not work to only copy rotation or scale(?).

    Thanks for your help guys!
  • AVFX
    Hey guys, I tried both methods, but I'm having trouble getting results..

    @Warby - I tried your method but seems to just create a copy of my object in a different location despite them being in duplicate hierarchies and I can't figure out why.
    Duplicating the object is not ideal though as the objects I'm duplicating the transforms of are controls of a rig (I have several copies of the same character imported to do similar things with)


    @Natsu - This method would be perfect, but it just isn't doing it..
    I've tried multiple combinations, but the only thing Tab will do is zero out all the values no matter what's selected or in whatever order..
    I'm using Maya 2014, perhaps they broke that and left it like they broke hitting Enter to close the Edit Layer dialogue?

    Cheers,
    Tony
  • AVFX
    Aha, I found out my mistake in Natsu's method.
    I took it to literally mean select all of the attributes and hit TAB.
    You actually have to just click the highest one you're after and keep hitting TAB to go through them, like in this 10 second video:
    https://vimeo.com/26338568
  • g5264137
    Thanks for natsu's nice tip.
    But can I do this tip among different frames?
  • birns
    Offline / Send Message
    birns null
    I am a little late but I will post this none the less for whoever views this thread later. You can create a tool to copy transform values from one object to another rather simply. Go into the script editor and under MEL paste this code:
    string $selCtrl[] = `ls -sl`;
    //Get values from Source…
    float $srcTX = `getAttr ($selCtrl[0] + ".tx")`;
    float $srcTY = `getAttr ($selCtrl[0] + ".ty")`;
    float $srcTZ = `getAttr ($selCtrl[0] + ".tz")`;
    float $srcRX = `getAttr ($selCtrl[0] + ".rx")`;
    float $srcRY = `getAttr ($selCtrl[0] + ".ry")`;
    float $srcRZ = `getAttr ($selCtrl[0] + ".rz")`;
    //Translate values to Target…
    setAttr ($selCtrl[1] + ".tx") $srcTX;
    setAttr ($selCtrl[1] + ".ty") $srcTY;
    setAttr ($selCtrl[1] + ".tz") $srcTZ;
    setAttr ($selCtrl[1] + ".rx") $srcRX;
    setAttr ($selCtrl[1] + ".ry") $srcRY;
    setAttr ($selCtrl[1] + ".rz") $srcRZ;

    From there click File > Save Script to shelf. Name it 'Copy Transform values' or whatever you prefer. Any time you want to use it just click the object you want to copy from first then select the object you are copying to and then click the tool. 



  • Bartalon
    Offline / Send Message
    Bartalon polycounter lvl 7
    Maya 2016 has a "Match Transformations" option set under the Modify menu.  It lets you match all transformations, translate only, rotate only, scale only, and pivot location.
  • saeed_s261
    birns said:
    I am a little late but I will post this none the less for whoever views this thread later. You can create a tool to copy transform values from one object to another rather simply. Go into the script editor and under MEL paste this code:
    string $selCtrl[] = `ls -sl`;
    //Get values from Source…
    float $srcTX = `getAttr ($selCtrl[0] + ".tx")`;
    float $srcTY = `getAttr ($selCtrl[0] + ".ty")`;
    float $srcTZ = `getAttr ($selCtrl[0] + ".tz")`;
    float $srcRX = `getAttr ($selCtrl[0] + ".rx")`;
    float $srcRY = `getAttr ($selCtrl[0] + ".ry")`;
    float $srcRZ = `getAttr ($selCtrl[0] + ".rz")`;
    //Translate values to Target…
    setAttr ($selCtrl[1] + ".tx") $srcTX;
    setAttr ($selCtrl[1] + ".ty") $srcTY;
    setAttr ($selCtrl[1] + ".tz") $srcTZ;
    setAttr ($selCtrl[1] + ".rx") $srcRX;
    setAttr ($selCtrl[1] + ".ry") $srcRY;
    setAttr ($selCtrl[1] + ".rz") $srcRZ;

    From there click File > Save Script to shelf. Name it 'Copy Transform values' or whatever you prefer. Any time you want to use it just click the object you want to copy from first then select the object you are copying to and then click the tool. 



    That was brilliant man

  • ASoapyBagel
    First select the one you want to change
    Then select the one you want to copy
    Then select "Modify" > "Match All Transformations", this will copy everything: roation, scale, transforms. Thanks  Barlaton :)

    This works well with rig CTRLs 
Sign In or Register to comment.