5 Replies Latest reply on Jul 21, 2014 12:12 PM by BGPictures

    puppet to null

    Arrakis Level 1

      I have a puppet rigged up with duik.  On one part of my puppet I have added some puppet pins and some nulls.  I want the pins to be parented to the null anchor points.   I have tried to use this expression below to parent the pins to the nulls but the pin moves somewhere else on the layer and deforms it and does not parent.  Im not sure why.  I have done this before and didn't have this issue. Anyone have a clue please?

       

      n=thisComp.layer("name of null")
      nullpos=n.toComp(n.anchorPoint);

      fromComp(nullpos);

       


      I then tried this one

       

      L=thisComp.layer("your null here"); L.toWorld(L.anchorPoint);

      The pin gets parented but not in the correct spot. It parents far away and so my layer moves where I dont want it.

        • 1. Re: puppet to null
          BGPictures Level 1

          I have used Duik and it's a pretty elaborate script in itself. Assuming that you are putting your nulls exactly over your puppet pins, and that you are referencing the correct null in each pin position script, I would imagine that Duik script has already offset the positions of your layers so that you may think the pins and nulls are lined up -- but they are only lined up thanks to Duik.

           

          Try turning off Duik to double check your pin/null correspondence. If you can get it to work with Duik disabled, then turn Duik back on and see if there is some constant offset you can use to use both Duik and one of the scripts above.

           

          Or try precomposing the thing you are trying to puppet pin/null before using duik. Will Duik rig something that has pre compositions? Good luck!

          • 2. Re: puppet to null
            Rick Gerard Adobe Community Professional & MVP

            Neither of your expressions will work. You need to study up on layer space transformations.

            Try changing the expression:

            L=thisComp.layer("Null 1");

            L.toComp([0,0,0])

            • 3. Re: puppet to null
              BGPictures Level 1

              Hey Rick. You are assuming there is an [x,y,z] I didn't make that assumption as Duik and both of the scripts mentioned work with 2d. They both work really well when not encumbered by Duik. Not sure why you you are saying that the scripts won't work.

              • 4. Re: puppet to null
                Rick Gerard Adobe Community Professional & MVP

                Not assuming xyz, making it work if you switch the layer to 3D. That is all. The expression still works just fine in 2D.

                 

                I'm not saying the scripts don't work, the problem states was that the expressions didn't work when he applied them to a null. The expression, actually both expressions, are incorrectly written to link a parented layer with a layer that has or is a parent. You have to use ([0, 0, 0]) and not (anchorPoint).

                • 5. Re: puppet to null
                  BGPictures Level 1

                  Hmm. First you are saying that "Neither of your expressions will work." Then you are saying, "I'm not saying the scripts don't work". Help me to understand… are you making a distinction between a script and an expression?

                   

                  FYI, he never said he was applying each to a null. The first one is written to be applied to PUPPET PINS which have no x,y,z irregardless of 2d/3d toggle (and it still works like a charm)

                  n=thisComp.layer("name of null")
                  nullpos=n.toComp(n.anchorPoint);

                  fromComp(nullpos);

                   

                  Best regards,

                  Benjamin