Xinlai Ni
Forum Replies Created
-
I would do this inside the eye precomp:
In the eye precomp, make two layers (EyeOpen and EyeClosed) last long enough (the duration of the walkcycle or main comp). And animate these two layer’s opacity property:
in one of the layer (e.g., EyeOpen):
// Find which two markers the current time is in between.
var markers = comp(“WalkCycle”).layer(“LayerWithMArker”).marker;
for (i = 1; i <= markers.numKeys + 1; ++i) { if (time < marker.key(i).time) { break; } } (i % 2 == 0) ? 100 : 0 in the other layer ("EyeClosed"), just use 100 - thisComp.layer("EyeOpen).opacity this makes sure when eyeopen is visible, eyeclosed is invisible, vice versa Xinlai Ni Software Engineer, Google Inc. -
You don’t need if statement to do this, the thing you need is this expression of the position of the layer:
xyPos = toComp(thisLayer.position); // project this layer to comp plane
distToCompCenter = length(xyPos – [thisComp.width / 2, thisComp.height / 2]; // how far this layer is to the comp center
distToCameraZ = 10 * distTocompCenter; // how far this layer to the camera in Z direction is 10 times of how far it is to the comp center
[thisLayer.position[0], thisLayer.position[1], thisComp.layer(“Camera”).position[2] + distToCameraZ] // modify this layer’s Z position relative to the camera.This is assuming camera is looking at the Z+ direction, if not, you may want to offset the layer along the “look at” direction of the camera.
Xinlai Ni
Software Engineer, Google Inc. -
Hit “l” on the audio layer, and add keyframes to the “Audio Level” property. a -24db is almost silence.
Xinlai Ni
Software Engineer, Google Inc. -
The naive way to do is using for loop to determine which interval you are in, and decide accordingly:
var interval = [
shake0,
stop0,
shake1,
stop1,
…
shakeN,
stopN
];for (i = 0; i <= 2*N; ++i) { if (time < interval[i]) { break; } } if (i == 0) { // return stop position my_stop_position } else { // Now time is between interval[i - 1] and interval[i] if (i % 2 == 1) { // time is between shake[i] and stop[i], wiggle it. wiggle(...) } else { // stop it my_stop_position } } Xinlai Ni
-
A simple script should do it, you can either read the values from external file, or construct an array containing data points as array in your script. The script just goes throw all layers and assign their expression properties, something like:
{
app.beginUndoGroup(“SetPositionFromValues”);
// js array containing the point values, indexes start from 0.
var DATA_VALUES = [
3, // layer 1
5, // layer 2
…
];
// assume active comp is the comp you want to work on.
var activeComp = proj.activeItem;
for (i = 1; i <= 19; ++i) { // layer indexes start from 1 var dataLayer = activeComp.layers[i]; dataLayer.property("position").expression = "x = 720 * index / 19;\n" + "y = 480 - (" + (DATA_VALUES[i - 1]) + " / 360000) * 480;\n" + "[x, y]"; } app.endUndoGroup(); } Xinlai Ni -
Have you checked the “Render Settings” options of your render queue item? I think it will by default render your work area unless you manually override it to the range you want to render.
Xinlai Ni
-
For the pos expression, you need two variables i and data_value, where i can be read from the layer index (say if your layers containing data points are number 1-19, your x expression for all 19 layers would be x=720*index/19). The point’s data value can be controlled by a slider expression control on each layer, say “Value”, then your expression for y is y=480-((effect(“Value”)(1)/360000)*480);
Xinlai Ni
-
Xinlai Ni
October 10, 2009 at 8:43 am in reply to: how to have layers below adjustment layers unaffectedprecompose adj-layer and the layers that you want the adj-layer to affect, then put the moon layer below the precomp
Xinlai Ni
-
Xinlai Ni
September 18, 2009 at 4:26 pm in reply to: What’s wrong with my script to enable layer styles?yes, nobody answered yet, that’s why I’m broadcasting to some other audiences as well.
Xinlai Ni
-
Xinlai Ni
September 18, 2009 at 2:44 pm in reply to: How do I control a grid of squares in 3d height with one NullI’m not sure how you can control all the squares with one null object going up or down, there certainly are randomness in the heights of squares and the heights seen as a function of x-y plane is continuous, i.e., can’t be totally random.
Not that I have tried this, but I can imagine one to attack this problem from the following directions:
– generate a fractal noise “cloud” layer, which acts as a continuous height map (white = high, black = low)
– use script to iterate through all the small square layers, and set its position[2] (assuming z is is the height dimension) to be proportional to cloudLayer.sampleImage(squarePos…)
so where cloud layer has whiter pixel, the square is positioned higher.
– use a null or simple expression to control the evolution of clouds.The above doesn’t give you much control to where you have bumps and where you have troughs.
Another idea would be to have a few null objects roaming around on the x-y plane, with their z changing continuously, each null contributes to every square’s height displacement by how far the square is from the null, something like:
for (j = 1; j <= numSquares; ++j) { squareDisplacement = 0; for (i = 1; i <= numNullLayers; ++i) { squarePos = [squareLayer[j].position[0], squareLayer[j].position[1]]; nullPos = [nullLayer[i].position[0], nullLayer.position[1]]; distFromNull = (squarePos - nullPos).length; squareDisplacement += 10 / length; } } This essentially raises the square if it's near a null, but falls continuously as it's farther away from a null, and you have controls over the heights of nulls. Xinlai Ni