Forum Replies Created

Page 7 of 11
  • It looks that is a lot of workarround on this question, i can recomend to you this links:

    -Must-see workshop: https://www.provideocoalition.com/after-effects-extendscript-training-complete-series/

    -The nightstand book : https://blogs.adobe.com/aftereffects/files/2012/06/After-Effects-CS6-Scripting-Guide.pdf?file=2012/06/After-Effects-CS6-Scripting-Guide.pdf

    I hope it helps

  • Miguel De mendoza

    April 4, 2016 at 3:03 pm in reply to: Mirroning position

    You have to set a reference point on the axis you want to be the center of the mirror. I.E if you want to mirror this objects arround the middle of the comp in the x axis you can write something like this:

    //in the square
    L=comp("man").layer("C_feet_rgt");
    center = [comp("man").width /2, 0]
    P= center + value+L.toWorld(L.anchorPoint) ;
    parent.fromWorld(P);

    //In the circle
    L=comp("man").layer("C_feet_rgt");
    center = [comp("man").width /2, 0];
    squarePos = comp("squareComp").layer("squareLayer").position
    P= center - squarePos ;
    parent.fromWorld(P);

  • Lets say you name the layers like “shape_1”, “shape_2”, etc… You can write this on the opacity:

    sliderValue = //Your link to the slider
    nameSplit = name.split("_");
    shapeNum = nameSplit[nameSplit.length - 1];
    if (shapeNum <= sliderValue) {
    value = 100;
    } else {
    value = 0;
    }

    You can reference the shape layers by index to, but this is a way to fix your referenceing.

  • After some depth search I found the way to keyframe the stage object, down is the code snippet if somone needs something similar. The samples parameter is simply a list of dict values to reference the camera name and his inpoint:

    def setKeysFromCameraSamples(samples):
    # DESCRIPTION:
    # Set the keyframes from the samples object to the stage object
    if samples is None or len(samples) is 0:
    return False

    stageList = doc.GetActiveObjectsFilter(True, c4d.NOTOK, 5136) # Find selcted stage objects
    if len(stageList) is 0: # Check if there are stage objects selected
    c4d.gui.MessageDialog('Select a stage object') # If not, return
    return False
    elif len(stageList) > 1: # Check if there are more than one object selected
    c4d.gui.MessageDialog('Select only one stage object') # If there are, return
    return False

    stage = stageList[0] # Select the first scene object
    dCamera = c4d.DescID(c4d.STAGEOBJECT_CLINK) # Reference to a cameraLink property
    cameraTrack = stage.FindCTrack(dCamera) # Reference the camera link track

    if not cameraTrack: # If there is no camera track, create it
    cameraTrack = c4d.CTrack(stage, c4d.STAGEOBJECT_CLINK) # Create a track
    stage.InsertTrackSorted(cameraTrack) # Insert the track

    fps = doc.GetFps() # Get the document framerate
    curve = cameraTrack.GetCurve() # Reference the track curve

    for curSample in samples: # Iterate through sample list
    frame = curSample['INPOINT'] # Get the inpoint of the sample
    cameraName = curSample['CAMERA'] # Get the sample camera
    curCamera = doc.SearchObject(cameraName) # Find that camera in the project
    frameTime = c4d.BaseTime(frame, fps) # Parse the key frame to c4d time
    keyDict = curve.AddKey(frameTime) # Add a new key to the curve
    keyDict['key'].SetGeData(curve, camera) # Link the current camera to the key
    c4d.eventAdd() # Refresh

    Return True

  • I think the best is Notepad ++, it’s free and recongnizes allmost all languages. But I usualy work with layer panel (it is a matter of getting used) or in Extendscript Toolkit.

  • Yes, I can see is a script generated dropdown menu, that simply changes the opacity of the layers by a expression on such property, so you cant achieve what you are trying because YOU CAN’T CHANGE THE IN/OUT points of the work area by expressions.

  • The file give me a message of a missing effect called “Dropdown”, I never heard about that effect/plugin and I cant’t find anithing about it on the web, so I can¡’t help you with that effect. What I can tell you is that if that effect dont have that trim functionality you must go on scripting.

  • It’s a little confusing what are you trying to achieve. What “dropdown menu” are you talking about? In advance I can tell you that you can only change the in/out point of the work area by hand or by script, not by expressions. If you can give more info about your project, maybe I can help 😉

  • How are you creating the dropdown menu?

  • Miguel De mendoza

    March 28, 2016 at 5:20 pm in reply to: [Scripting] What Am I Doing Wrong?

    Short answer: selectedLayers and selectedProperties are arrays , that means that the first element is 0, not 1, is not the same when you are selecting layers through the layerCollection object: layer(1). So you must change your for loops consecuently:


    for (var i = 0; i < numSelLay; i++) {
    ...
    for (var x = 0; x < numSelProp; x++) {
    ...
    }
    }

Page 7 of 11

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