412 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+5 more
patrickjansen says

Hey felt_tips, thanx for the effort to solve this puzzle, I appreciate it and from the amount you explain you took some time. But still not what I meant, the way you describe you’re placing the 10 stickmen manually at their positions, The way I do that it becomes automated and an exact/perfect circle

I think everybody is misinterpreting what I want, i’ll try to explain a little more, I don’t want the stickmen to move at all, they’re supposed to stand still in a circle but facing with their heads upwards. Nothing more nothing less at this moment. The links I gave show the difference between what I have and what I want.

http://www.patrickjansen.net/AE/tmp.html is what it does http://www.patrickjansen.net/AE/tmp2.html is what I want

I’m not actually using stickmen, nor 360 copies, but just to avoid answer “do it manually” i describe it this way.

What I do is what I describe

1) create a 50×50 comp “C” with a stickman

2) create a 200×200 comp “B” and place “C” in it… then drag “C” to the top-middle of comp “B”

3) create a e.g 500×500 comp “A” (size doesn’t matter) and place 10 items of “B” in it, and give each “B” a rotation to create a perfect circle (0, 36, 72, 108 degrees etc)

At this point I have the first link, 10 stickmen in a perfect circle. Because in “B” the stickmen “C”’s position was offset (to the top-middle), in “A” they create a circle with the radius of that exact offset. The further I dragged “C” away from the middle of comp “B”s center, the larger the circle.

They’re not supposed to move or animate, only facing their heads upwards (which they don’t, see the link). What I want at this point is to get from link 1 to link 2 -> I need all of them to correct their heads upwards.

The easiest way to describe what I’m looking for (not using terminology but simple words) is this -> since A has ten items of B with manual rotations, each “B” should do a correction on it’s internal stickman “C” rotation so that each stickman faces upward again.

That “could” happen if each “B” “knows/extracts” how much it himself has been rotated (manually in “A”), and then apply that same value negative to “C”, basically applying something like I would in flash

C.rotation = -this.rotation

Sorry if my descriptions are difficult, I’m not a AE expert so still struggle to get things sorted out.

412 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+5 more
patrickjansen says

ps in the links I put the green square and red square to show “C” in “B” and to the left the stickmen circle result in “A”

5169 posts
  • Provided great contribution to our forums
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
+12 more
felt_tips Moderator says

Basically, you want an expression that arranges your stickmen in a circle while facing upwards.

You want to adjust the rotation of your stickman in Comp B to achieve this.

It can’t be done like you’re describing it, because if you rotate the stickman in Comp B, then it will rotate the stick man in every single instance of Comp B and you specifically want to achieve a separate rotation of the stickman for each instance (the source of which is a single comp). Therefore your expression has to be on the instance, not in the underlying comp.

One way would be rotate the stick man in the original comp through a full 360 degrees and then put an expression on the Time Remap property of the instance, pulling out the correct counter rotation. Then you could muck around with the rotation and anchorPoint as much as you like to get your circle. Downside is that your stickman or whatever can’t then be animated.

My solution would be to parent the stickman to a null, while keeping the stickman instance’s anchorpoint in the middle and then setting the position rather than the rotation with expressions.

Make a Null – this will do nothing other than control the centre of your circle
Add a Slider Control effect to the stick man layer.
Name the Slider Control “radius”. Set it to 200 – this is your circle’s radius
Add an Angle Control effect to the stick man. Call it “angle offset”.

The position would look like this. (sorry code blocks on VH forums don’t allow much formatting)

tR = thisLayer.effect("radius")(1).value; tP = thisLayer.parent; tA = degreesToRadians(thisLayer.effect("angle offset")(1).value); pW = [tR*Math.cos(tA), tR*Math.sin(tA)] + tP.toWorld(tP.anchorPoint); tPos = tP.fromWorld(pW);

The rotation has no expression.

Now you can dup up your stick man as many times as you like, give each one a different rotation around the center, by changing angle offset. And you can move the center by moving the null… Oh and don’t forget the radius. You could hook up all the radius sliders of all the stick men to a central control on the Null and change the radius of the whole lot simultaneously.

412 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+5 more
patrickjansen says
||+521906|felt_tips said-|| It can’t be done like you’re describing it, because if you rotate the stickman in Comp B, then it will rotate the stick man in every single instance of Comp B and you specifically want to achieve a separate rotation of the stickman for each instance (the source of which is a single comp). Therefore your expression has to be on the instance, not in the underlying comp.

really? that’s very disappointing, and a bit unbelievable In Flash this is matter of seconds, in flash you can simply have each Comp B extract how much it has been rotated within its parent with line this.rotation, and then recycle that value into C.rotation = -this.rotation and voila all stickmen upwards.

||+521906|felt_tips said-|| My solution would be to parent the stickman to a null, while keeping the stickman instance’s anchorpoint in the middle and then setting the position rather than the rotation with expressions.

Yeah, I had already achieved a similar way by simply giving each instance of “B” an expression for X and Y position based on a “angle=X” for each one and then calculating math.sin/cos for each with a radius of e.g. 100.

5169 posts
  • Provided great contribution to our forums
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
+12 more
felt_tips Moderator says

really? that’s very disappointing, and a bit unbelievable

... in flash you can simply have each Comp B…

What do you mean each Comp B? There is only one Comp B! There are several layer’s whose source is an instance of Comp B, but there is one single Comp B and any changes you make to it will be propagated to all of its instances.

An instance is an instance and a source is a source. That’s the same in Flash as it is in After Effects.

5169 posts
  • Provided great contribution to our forums
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
+12 more
felt_tips Moderator says
||+521928|patrickjansen said-|| Yeah, I had already achieved a similar way

So you didn’t need the help at all.

412 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+5 more
patrickjansen says
So you didn’t need the help at all.

? is that meant in a negative way ? If so, while the hostility??? you’d prefer i just sit back in my couch and wait for someone to hand me over a solution to a problem? No, while awaiting responses I was trying different things to see if they’d do the trick. And I did … so at some point i had a solution … “a” solution, which obviously as you can see from my description of how i usually solve it in flash (an extra one line script) would not be close to the cleanest solution but it would work.

412 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+5 more
patrickjansen says
What do you mean each Comp B? There is only one Comp B! There are several layer’s whose source is an instance of Comp B, but there is one single Comp B and any changes you make to it will be propagated to all of its instances. An instance is an instance and a source is a source. That’s the same in Flash as it is in After Effects.

yes, each “instance” of comp B. But as i’m a little unsure of AE terminology i’ve been describing as best/safe as i could.

5169 posts
  • Provided great contribution to our forums
  • Elite Author: Sold more than $75,000 on Envato Market
  • Has sold $125,000+ on Envato Market
  • Has been part of the Envato Community for over 5 years
+12 more
felt_tips Moderator says

? is that meant in a negative way ? If so, while the hostility??? you’d prefer i just sit back in

No hard feelings, but it did strike me as a bit strange that after I’d written around 1500 words in response to your problem, that you suggest it’s a disappointing solution and you’d solved it anyway.

I agree that much of the issue that you have with After Effects is that although you’ve obviously got a good grasp of Flash and Actionscript, you haven’t quite got your head around the different structural elements of After Effects. My Flash experience is rather out of date I’m afraid, but they’re not so very different programs. The single most frustrating difference if you’re used to Flash, is the persistence of variables. In After Effects they don’t persist at all from frame to frame, so any calculations such as physical dynamics calculations need to be worked out from the beginning of the composition on each new frame…. There’s a reason for this, but it does make certain things difficult to code. If you’re interested in that side of things, you should have a look at Extendscript Toolkit and scripting. Scripting is perfect for producing your own workflow tools. You could for instance write a script that arranges a number of layers in a circle around a certain point and hard-codes their position values.

By the way, if you want a solution that uses the single line of code you mentioned…

thisLayer.rotation = -thisLayer.parent.rotation

...then you need to structure your parenting differently. A central Null has a number of other Nulls as children. Each of these has one of the stickmen as its child, position offset by an amount… say [200, 0], the x offset corresponding to the radius of the circle. Each null is rotated a different amount and each stickman has the above expression on its rotation.

The code variant I mentioned above, effectively achieves this structuring with code and does away with the need for X extra null layers.

If you want to take into account the rotation of the central null too, it starts to get a bit more complex. But imagine you had a chain of 10 nulls all rotated differently. Here you could have a look at AE’s layer space transform methods, which are excellent for switching positions and vectors between world (global) space, layer space (position relative to immediate parent) and composition space (position as projected to the screen). You could use stickmanLayer.toCompVec([0,1,0]) with a bit of simple trigonometry (Math.atan2(x,y)) to find out a layer’s global rotation, regardless of position in the parenting hierarchy. It saves you doing complicated unrotates up an arbitrarily long parenting chain…. which obviously gets quite complicated quite quickly in 3D space.

412 posts
  • Has been part of the Envato Community for over 5 years
  • Has referred 1+ members
  • Has sold $10,000+ on Envato Market
  • Has been a beta tester for an Envato feature
+5 more
patrickjansen says

i’ve only just started digging more into AE and only recently discovered the possibility of scripting for values, so I’m still just exploring the waters and what it can do and what is different from flash. At this moment i’m too new with AE possibilities to give a real opinion about any of it, but it does look extremely promising.

The suggestion you describe, breaking my brain for now, not very familiar yet with “layer space”, “composition space” and the 3D and camera workings … but if i understood correctly you link multiple instances of the stickmen to multiple null-s, then use the different null position values as base/input for the stitckmen circle-position/angle.

Would that mean still manually creating like 10 stickmen and 10 nulls. That’s a remaining thing which i was wondering about… is it possible to create like 50 stickmen dynamically? like i’d do with flash something like

var A=[]; for(var i=0;i<50;i++){ A[i] = new stickmencomposition(); addChild(A[i] }

tnx for the feedback, i can see you know what you’re talking about, thoroughly, and do appreciate the details of your answers, that’s a rare nice thing to see … I only wish I were up to a higher level already so i could brainstorm up to speed with you ;)

by
by
by
by
by
by