• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Expression Query (adding an additional expression)

New Here ,
Feb 27, 2013 Feb 27, 2013

Copy link to clipboard

Copied

Hey there

I shall try to explain this as best as possible and please refer to the images or links if the images fail to embed.

the following code http://d.pr/i/keMI allows, on a certain dgree of rotation to rotate a NULL which in then lifts the Skirt as the knee rotates towards it.

The issue im having is the one code you can see works fine with the right leg, but when im adding code for the other leg, it seems only to affect either or and not both..

I think im missing some vital CODE link between the seperate scripts but Im afraid im just not that adept at coding.. yet 😕

------------------------------------------------------------------------------

Both scripts work fine, tried and tested with the other leg on the backside of the skirt and therefore other NULLS for it to consider.

I just need both knees NULLS to lift the front of the skirt when the rotation reaches a certain degree..

I hope that makes sense. here are the images of the skirt to help clarify.. i hope

Right knee working http://d.pr/i/bu2s

Left knee NOT http://d.pr/i/z7E9

CODE ATTEMPTED: http://d.pr/i/dXxP

Thanks you in advance!! xxx

http://d.pr/i/e4CEhttp://d.pr/i/bu2s

Images of the knee coming past the skirt layer..

http://d.pr/i/bu2s

http://d.pr/i/mMDN

Code I want to add too..

http://d.pr/i/keMI

Attempted code..

http://d.pr/i/dXxP

TOPICS
Expressions

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Feb 28, 2013 Feb 28, 2013

Ah yes, sorry--I left a close paren out of this (corrected) line:

}else if (Hip_LFT_Rot<-20){

Votes

Translate

Translate
Community Expert ,
Feb 27, 2013 Feb 27, 2013

Copy link to clipboard

Copied

Thanks for the screenshots. They are easier to look at if you use the forum tools to embed them.

Screen Shot 2013-02-27 at 1.42.19 PM.png

It's also much easier to figure out what your code is doing if we have the code instead of a screenshot. It's just a lot easier to read. When I get to a place where I can take a better look at your problem I'll try and help out. The most common error in this kind of rigging is to point to the wrong controller or to tie two transformations to the same one. I suspect that is what is going on here.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2013 Feb 28, 2013

Copy link to clipboard

Copied

Thanks for the quick response Gerard! sorry we are on differen time-scales here so I didnt get a chance to respond till now.

Here is the code, which works perfectly for the right..

Hip_RT_Rot=thisComp.layer("Hip_RT").transform.rotation;

if(Hip_RT_Rot<-18){

          transform.rotation+(Hip_RT_Rot+18);

}else{

          transform.rotation;

}

And here is the codes which I used for the other leg which then works with LFT_Hip rotation in order to shift the back end of the skirt. Ideally id love both the left and right leg to shift, both the left and right Hip nulls but maybe im asking to much so if i can just get the front to shift for now ill be a happy bunny.

It's also much easier to figure out what your code is doing if we have the code instead of a screenshot. It's just a lot easier to read. When I get to a place where I can take a better look at your problem I'll try and help out. The most common error in this kind of rigging is to point to the wrong controller or to tie two transformations to the same one. I suspect that is what is going on here.

Hip_LFT_Rot=thisComp.layer("Hip_LFT").transform.rotation;

if(Hip_LFT_Rot>12){

          transform.rotation+(Hip_LFT_Rot-12);

}else{

          transform.rotation;

}

In regards to attaching images, the INSERT is never active despite whatever format I try to upload (all with in the recomended guidelines of course) so its being a bit of a nuisance 😕

So apolagies as I need to link elsewhere in order to get you something.....scrap that I just left clicked in this window and seems to work here..oops!

Screenshot 2013-02-28 at 10.39.45.png

here you can see the hip Nulls which are connected to puppet pins which in turn rotate the puppet pin Nulls at the knees of the dress..

Screen Shot 2013-02-28 at 10.50.13.png

Thank you once again for your help guys this is my first time in the forums 😃

J x

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Feb 27, 2013 Feb 27, 2013

Copy link to clipboard

Copied

Simple: You are not converting to world coordinates anbd thus your roations effectively never change in your hierarchy. You need to work with toWorldVec() and toComp().

Mylenium

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2013 Feb 28, 2013

Copy link to clipboard

Copied

Thanks Mylenium,

I kinda get what you mean, but for me to apply this and have it work is another story

I wonder if you could take a look at the code i submitted above / below and show me an example.. sorry im still very much a novice at coding..

Aprreciate your help

J x

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2013 Feb 28, 2013

Copy link to clipboard

Copied

Are you just looking to account for the effect of either leg rotating into the skirt? I think that would be like this for your first expression:

Hip_RT_Rot=thisComp.layer("Hip_RT").transform.rotation;

Hip_LFT_Rot=thisComp.layer("Hip_LFT").transform.rotation;

if(Hip_RT_Rot<-18){

  value + (Hip_RT_Rot+18);

}else if (Hip_LFT_Rot<-18{

  value + (Hip_LFT_Rot+18);

}else{

  value;

}

The other would be similar.

Dan

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2013 Feb 28, 2013

Copy link to clipboard

Copied

Wow Dan Ebberts (code king)!

Now i feel in safe hands!

Thank you for this code I have just tried  it and as you can see below it just seems to disable itself without showing any error to what might be..

Screen Shot 2013-03-01 at 01.07.54.png

Please let me know if you require anything to help solve this, its pretty vital 😕 I would send the AE file but it is extremely large..

I played with the number etc and also when i take the:

}else if (Hip_LFT_Rot<-18{

  value + (Hip_LFT_Rot+18);

...out, then it works again.. this should work perfectly but it just doesnt seem to take..

Thanks again for helping!

Jx

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Feb 28, 2013 Feb 28, 2013

Copy link to clipboard

Copied

Ah yes, sorry--I left a close paren out of this (corrected) line:

}else if (Hip_LFT_Rot<-20){

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Feb 28, 2013 Feb 28, 2013

Copy link to clipboard

Copied

LATEST

Boy I should of spotted that! it is way past my bed time!

Dan thank you! it makes all the difference!

..Code King..

J x

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines