Forum Replies Created
-
Anthony Hairgrow
April 22, 2020 at 7:18 pm in reply to: Absolute Layer Possition [toWorld() expression]Man, this was so long ago that I can barely remember what I was working on at the time. I believe I was trying to do a Squash and Stretch rig. I think I got it to work, but I’d have to dig threw old files to find it. The solution I came up with has actually been implemented directly in After Effects now.
-
Anthony Hairgrow
January 13, 2017 at 7:45 pm in reply to: Custom Keyboard Shortcut Not Working in AE 2017 on Mac Os X 10Well this kind of odd, but in case anyone else has this problem, it seems in AE 2017 you have to set your custom keyboard shortcut to the second menu item in the list (“ExecuteScriptMenuItem02” = “()”), in order to execute the first script in the folder. Odd, but it works. Not sure if this is a bug but I’m running with it for now.
-
That’s funny. As soon as I got it, thats when you posted your response. Thanks for explanation. There’s still lots for me to understand.
-
Never mind. I tried what you said again and got it to work. I guess calling and passing information into the function first doesn’t work if it’s being called again from somewhere else.
var myComp = app.project.activeItem;
if (myComp == null || (myComp instanceof CompItem) == false ){
alert(“Please select a Composition”);
}else{
alertReturn();
};
function testFunction(a,b){
var results = a + b;
return results;
};
function alertReturn(){
var c = testFunction(1,1);
alert(c);
}; -
Thanks for your response Dan, but please forgive me for my lack of understanding. After reading your comment, I’ve tried a few different ways and now I’m getting “undefined”. Are you saying the parameters that need to be passed to testFunction(), should be passed in by alertReturn(). I saw a Javascript example, non AE related, from like 2013, where the returned value from one function could be used in another.
Here’s the example:
function firstFunction()
{
//Do something;
return “testing 123”;
}function testCase()
{
var test=firstFunction();
alert(test);
}This is basically the format I was following. I thought I could pass the parameters, testFunction(1,1), at line 5 and then everything would proceed as expected. I was thinking the order of operation would be:
1. testFunction() is called at line 5 with parameters being passed to it.
2. testFunction does it calculation
3. testFunction returns the result
4. alertReturn() is then called right after (at line 6)
5. testFunction is assigned as the value for variable a, in alertReturn, essentially making its value the returned value.
6. alert variable a.I’m still lost.
-
Anthony Hairgrow
December 13, 2016 at 2:13 pm in reply to: scale & move chain of solids with lowest one anchoredHi Filip,
I’ve discovered your expression some years later and I believe this is getting me closer to my solution for a character rig that I’m creating.
When I implemented this expression for the position on several solid layers, I noticed that when I moved the “first” layer all the in between layers were moving at the same amount/rate.
Is there a way to alter this so that the layers that are closer to the bottom move at a slower rate than the ones towards the top?
Essentially, I’m creating a squash and stretch rig. My first implementation utilized several null points that were parented to a master null. The parent was located at the bottom of the character, sort of like a global position controller. The parent null was then scaled non uniformly, like 64,140 or 140, 64, which caused the children to move appropriately. When I did this, I noticed that the children closer to the bottom where the parent was located was moved at a slightly lower rate than the ones towards the top of the character.
This works out fine, but I wanted to improve the rig, but implementing the same look without having to parent the children and using the scale to move them.
Essentially I’d like to have a controller that I can move up and down, that would cause the other “non parented” children to move appropriately.
I’m familiar with working with expressions, but unfortunately I’m just an animator, with no programming skills, so I couldn’t begin to figure out the math equation to implement this.
I hope I was able to clearly explain what I’m looking for.
-
Anthony Hairgrow
November 29, 2016 at 3:48 pm in reply to: Absolute Layer Possition [toWorld() expression]Hi Dan,
I wanted to know how I could convert the local coordinates of a nested Shape Group to it’s absolute World(Comp) position?
I’m developing a rig using nested Shape Groups within a single Shape Layer and wanted to know how I could obtain the Global position of a nested Shape Group. I’m trying to use the toWorld or toComp functions but those methods don’t seem to work within Shape Layer contents. I keep getting errors.
As an example, lets say I have a Shape Layer called Controls. Within the shape layer, I have 2 Shape Groups, Group A and Group B. Within Group A, I have 2 other groups, Group A1 and Group A2. The position values of Group A1 and A2 are relative to Group A. Essentially, if I move Group A into position, Group A1 and A2 will follow but I still have independent control over the two nested groups. I’d like to convert the local value of the nest groups to either a World position or Comp position.
If I can obtain this number then I can link anything to the individual Shape Groups regardless of how it’s parented/nested.
I’ve read previous forum posts where you’ve mentioned something like:
L = thisComp.layer(“Null 1”);
p = L.toComp(L.anchorPoint);
fromComp(p)But this structure doesn’t seem to work with Shape Layer groups.
In the first line I can’t point directly to the Shape Layer Group Name. AE won’t let me pick whip it. I have to explicitly point to the Position property of the Nest Group. Which works, but that’s not the value I want.
Once I point to the Position property of the Nested Shape Group, then the second line will throw an error stating that “l.toComp is undefined”
Thanks in advanced.