moving solids like a cloth type material

Find out why the . goes before the /

Moderator: Paul Tuersley

Post Reply
horse10735
Posts: 8
Joined: March 7th, 2007, 1:45 pm

Does anyone know of a script that would allow me to control say 50 solids from a point. Say you spread out 50 solids in 3d space(flat---thay are all next to one another). Now in the center of the 50 you make a null that will be the control. What i need is for that null when i move it in space up it needs to take the solids but in order. So one after another but in the same path. think of picking up a towel or a shirt. U pick it up from a point and the rest follows that point. Not sure if i was clear but its early and i've been killing myself trying to come up with something. If ayone can help thanks....cheers

-luis
thomaskiel
Posts: 11
Joined: March 13th, 2007, 9:42 am
Location: Hannover, Germany
Contact:

Hey,

another late answer. So, here's a suggestion as to how you could set this up:

1) Create a camera.

2) Create the solids and distribute them as you like to. The layer that will start off the animation should be right under the camera layer in your timeline window.

3) Name that first solid "Master". Animate it along the y-axis as desired.

4) Apply this code to the "position" tag of each of the other solids:

[position[0],thisComp.layer("Master").position.valueAtTime(time-(index-2)*0.04)[1],position[2]+height*(index-2)]

5) If you want to have more convenient control over the time offset, you should add an expression slider (Effects --> Expression Controls --> Slider Control) to the "Master" layer. Highlight the Effect and hit Enter to rename it to "offset".

Change the code to

[position[0],thisComp.layer("Master").position.valueAtTime(time-(index-2)*thisComp.layer("Master").effect("offset")(1)/25)[1],position[2]+height*(index-2)]

I've added a division by 25 so the slider will actually count frames, not seconds. This is more convenient for moving the slider around.

That's it!
Arriflex
Posts: 1
Joined: December 14th, 2007, 1:17 am

Hi, this is the almost the exact effect I need on a project! But, I'm getting the following error when using your code:

Bad argument: index 2 out of range for stream of dimension 2.

Also, while I'm begging for help :) It it possible to have code that would follow the Master layer in X,Y,Z space? And for super icing on the cake ... rotation as well?

Any help you can give is greatly appreciated!
thomaskiel
Posts: 11
Joined: March 13th, 2007, 9:42 am
Location: Hannover, Germany
Contact:

Hi Arriflex,

seems like I forgot one key point to my little tutorial, let's call it 2 b): Make all of your layers 3d layers. That'll do.

As for the "follow everything" effect: Did you try Trapcode's "Echospace" plug-in? It does the job without all the scripting hassle. If you still want to do it manually, just give me a note and I can come up with something.

Thomas
Post Reply