Forum Replies Created

Page 1 of 10
  • Bryan Woods

    April 20, 2019 at 12:44 am in reply to: Source text issue with new AE javascript

    Ah, I see. have to be more specific now I guess. Thanks!

  • Awesome, I’ll give this a try. Thanks!

  • Bryan Woods

    October 9, 2017 at 1:56 am in reply to: AE scripting – identify a two-node camera

    Thanks Dan. What is the benefit of checking .canSetExpression if we can already identify Point of Interest? Is it necessary?

  • Bryan Woods

    October 8, 2017 at 6:55 pm in reply to: 2D to spherical coordinate script

    I was able to figure out a solution to my problem. I needed to add the camera’s current positions to the spherical coordinates in order to offset the origin. Because its based around the active camera, regardless what camera is used, the objects will always remain locked in a sphere around the current camera.

    Try copy/pasting the below script onto a 3D layer’s position, with a single-node camera in the scene. Now reposition the 3D layer, and you’ll see it moves around in a sphere. Switch to top view and move the 3D layer around for a better idea of how it works.

    r= transform.position[2]+1000*-1;

    //convert X,Y 2D coordinates with the comp dimensions as a reference
    convertX = transform.position[0]/thisComp.width*2*Math.PI-Math.PI;
    convertY = transform.position[1]/thisComp.width*2*Math.PI-Math.PI/2;

    //spherical coordinates
    sX = -(Math.cos(convertX-Math.PI/2))*(Math.cos(convertY))*r+thisComp.activeCamera.position[0];
    sY = -Math.sin(convertY)*r+thisComp.activeCamera.position[1];
    sZ = (Math.sin(convertX-Math.PI/2))*(Math.cos(convertY))*r+thisComp.activeCamera.position[2];

    [sX,sY,sZ]

  • Bryan Woods

    October 5, 2017 at 5:28 pm in reply to: 2D to spherical coordinate script

    Well, part of this code comes from another script I wrote that would take a 2D coordinate on a latlong image, and represent it on a sphere in a separate comp. This was great for motion tracking an object in a 360 video. Track the object in the footage as a latlong, then concert that tracking data to spherical coordinates and attach other objects, masks, etc. to it. The code above is a conversion from cartesian to spherical coordinates, and requires the width of the image and assumes a 2:1 aspect ratio for a lat long image.

    I’m trying to adapt this code to now work independently of any dimensions. Essentially I’m trying to get a 3D layer to be able to orbit around the camera in a scene. As I drag the layer up/down/left/right, it maintains its distance away from the camera and moves in an arc around the camera, being locked to a sphere. The distance from the camera to the object is the sphere’s radius.

    My biggest issue is that I have to set my camera to be at world 0 for this to work as I intend. However, AE cameras when first created, are not placed exactly at world 0, but have an offset of about 1500 in the neg Z.

    Hope that helps. If you take my code right now and apply it to the position of a 3D object with a camera in the scene at world 0, it will work correctly and you can see how it orbits around you as you drag the object around.

  • Bryan Woods

    January 26, 2017 at 10:41 pm in reply to: sourceRectAtTime issue with text layer

    No ideas how to get the inverse of the linear function?

  • Bryan Woods

    January 26, 2017 at 12:30 am in reply to: sourceRectAtTime issue with text layer

    The problem I’m having is that i’m getting the inverse of the thickness. As I move the layer closer in Z, the thickness shrinks, and visa versa. I need to get the inverse result.

  • Bryan Woods

    January 25, 2017 at 9:19 pm in reply to: sourceRectAtTime issue with text layer

    Thanks Dan. I’m also trying to link the beam’s starting thickness to the distance of the layer’s parent position, relative to the camera.

    I’ve got this working in the beam’s start thickness parameter:
    p1 = thisLayer.parent.position[2];
    p2 = thisComp.activeCamera.position;

    value+length(p1, p2);

    but I notice as the layer moves in z towards the camera, the thickness decreases, and visa versa, when it should be the other way around. I thought I could invert the result by multiplying by -1, but that doesn’t seem to be doing anything.

  • Bryan Woods

    January 14, 2017 at 12:12 am in reply to: Fade out at the end of comp

    I came across this and I wanted to use it for a shape layer, but apparently there’s no such thing as thisLayer.duration? What is the equivalent to get this code to work for a shape layer?

  • Bryan Woods

    January 12, 2017 at 12:55 am in reply to: If else loop not working in Text Source

    Ah, makes sense. Thanks for the explanation.

Page 1 of 10

We use anonymous cookies to give you the best experience we can.
Our Privacy policy | GDPR Policy