Thank you. My silence since your reply was me attempting to understand the expression. I'll be the first to admit I'm not the sharpest tool in the shed with expressions. But though I feel like I figured out the components, I just couldn't apply them and get the result I was looking for.
In your example it looks like the framesToTime is taking frame 500 and converting it to Time that AE can then work with.
Then there's valueAtTime, which I'm thinking gets the value for something at a time (when?) .... at the Time specified in the framesToTime component. You then multiplied the result with a negative one (-1) to get the opposite value.
I pasted this into the Particles Rot Z property and even added at the top the Comp / Layer / Transform to get the Value from the Camera Rot Z. . . (I removed the 500 since I want the value at Time for all time, over time .. ) but the whole issue of getting a value at a later time and using it allll the way back when the Particles are all emitted at frame 1 .. escapes me. (Mylenium was the one in my Particles post who pointed out that once the Particles were emitted (frame greater than 1) the Rotation wouldn't affect them)
Where's the bouncing paper clip hologram for After Effects so I don't have to keep bugging y'all with my inability to grasp these concepts? "I see you're trying to write an expression...!"
Thank you again,
I'm not sure what you are hoping to achieve. Just filling in time will only return the current comp time. Otherwise of course using valueAtTime() will not do much if a property isn't actually animated. I understand what you are trying to do, but it seems to me you have some things going on that work against you...
I think you are barking up the wrong tree. I'm not sure because I don't know how you have set up your camera and I don't know what you are using for the Sprite Texture.
Particle>Rotation>Rotate Z sets the angle of the particle (sprite) at birth. There is no way to change the rotation of a sprite after birth. If you want the angle of the particle to match the Z rotation of the camera then your sprite must be a pre-comp or a layer in the Main Comp suitable for a sprite rotation would have to be animated there. The sprite layer could even be 3d if you wanted to match all of the camera's movement.
To do rotation just use the - trick. If you name the comp then the expression will still work if you need to pre-compose the sprite layer. Here's what it looks like:
- comp("Main Comp").layer("Camera 1").transform.zRotation
Just set the Sprite texture to Current time and you should be good to go.
Thanks for the suggestions. Bummer is that when my particle volume is generated all at once on frame one the Sprites source a comp that has 20+ unique still images, each one frame long. The Sprite is set to Random Still Frame - this creates a great variety. I tried just using 1 image and having each particle be randomly scaled/oriented but you can still tell it's the same particle.
So I can't have a pre-comp of the Sprite animating its rotation based on the camera. This would work if I had 20+ unique Sprite precomps (one for each texture) and 20+ particle emitters but since Particular is a 3D effect applied to a 2D layer the variety wouldn't be intermixed with each other - one after the other after the other would just lay on 'top'.
My work around has been to go to a frame, look at what the camera Rot Z value is, and then go to the Rot Z value of Particular and manually update that (opposite) value - since it's not an animated function curve that entry is now the value for the entire length of the comp duration - current time, AND now the start time. I now render the current frame. I then advance a frame, get the camera Rot Z again, change Particular again.. rinse and repeat. It's working great - I'm pulling off the illusion but I feel like a 2x4 not being able to figure out how to automate this. Thank god it's a personal project - there's no deadline and I'm in no rush.
This sounds more like a job for Trapcode Mir or maybe Form instead of Particular. From your description it would just a matter of generating the particle cloud then flying the camera through it with no worries about anything else. I did something like that with the logos of the fortune 500 companies a while ago.