Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all 2143 articles
Browse latest View live

cansetexpression is false, unable to set value

$
0
0

Hey guys,

I'm writing a script that will copy the layer setup (complete with layer styles, effects, etc) of a comp that I can duplicate on another comp.

 

For the most part, it's working, except on a specific effect I'm trying to copy. I'm finding I can't set the value for certain attributes - they throw the following error:

Error: After Effects error: Can not “set value” with this property, because the property or a parent property is hidden.

But if I write a separate script that attempts to set the value well after the whole effect has been populated, it has no problems.

 

By the way, in case it's relevant, the effect that's causing the problems is called OLM Color Key, and it has a property called Number of Colors that allows you to change the number of colors it samples (up to 25, I believe). Each of those colors has a Color attribute and a Use Color attribute. The Use Color property is the property I mentioned above that's causing problems. If Use Color is unchecked, the effect behaves as if that color wasn't in its array. The problem is I can set the Use Color property with Extendscript for the FIRST color, but no colors afterward. Do you guys have any idea why that would be the case? Does it have anything to do with the Number of Colors attribute enabling/disabling colors?

 


HTML textarea value to jsx in AE extensions

$
0
0

I want text from html textarea to my text layer in ae.

myComp.layers.addText(textFromHTML);

This works in browser, but how to get that string into my jsx file?

HTML:

<textarea name="message" id="name" rows="5" cols="30">

Type your text here!</textarea>

JS:

function write_name(){

    var name = document.getElementById('name').value;

    alert(name);

}

I found this but don't know ho to use it on my example:

JS:

varcsInterface=newCSInterface();

csInterface.evalScript('sayHello("Ciao", 2014)');

JSX:

functionsayHello(str,num){

   alert("Photoshop says "+str+"! Have a great "+num);

}

 

Thanks

manipulating data from the AEPX

$
0
0

Hey guys,

I'm trying to write a script to save a layer setup, effects, layer styles, and all, and be able to apply it to other comps later (with source footage changes). It's mostly working except for some problem effects, like effects with propertyValueTypes that are CUSTOM_VALUEs. I'm wondering if a more foolproof way to do this would be to avoid trying to recreate the structure, and instead somehow use the XML data for the comp I'm saving from the .aepx to directly copy the comp structure.

 

The problem is I'm completely new to working with AEPX XMLs, and don't even know if what I'm wanting to do is possible, or if people have tried this before. All I'm seeing is a bunch of XML tags like tdmn tdbs aRbs aRbp and some hex sandwiched between rows of 0s.

output module "Full Flat Path" not working as expected

$
0
0

Hello,

 

My script contains this line:

 

var new_dataMOVIE = {"Output File Info": {"Full Flat Path": fullFlatPathMOVIE + myCompText}};

 

The path it creates is correct, but when AE makes the output module it's adding a duplicate volume and subdirectory to the beginning of the path.

 

For example, the script builds a path that reads:

"/Volumes/ourserver/PROJECTS/ourproject/user/shot/...etc"

Which is what the actual path should be.

 

But after it adds the output module, the output module path now reads:

"/Volumes/PROJECTS/Volumes/ourserver/PROJECTS/ourproject/user/shot...etc"

 

Am I using "Full Flat Path" incorrectly?

 

Thanks, all, for any help.

Script to add layer markers?

$
0
0

Hey guys! I want to create a script that would allow me to add layer markers to a solid layer at consistent intervals based on the number of AV layers I have in the comp. So say I input the interval value at 10 seconds, and I have 5 AV layers (not counting the solid layer I want to put the markers on). Then the script would put on marker at the 0 sec mark, 10 sec mark 20 sec mark...till the 40 sec mark. So 5 AV layer, 5 markers.  Does anyone have any idea how to do this? I am at a lost and I have no clue where to start.

 

Thanks in advance mates!

Do I need Mac and PC to make cross-platform scripts?

$
0
0

Hi everyone

 

I know that a script developed on Windows should by default work on Mac and vice versa, but is that always true regardless of how complex the script is? Do developers of big or popular scripts test their scripts on both Mac and Windows? I want to sell my scripts online but my greatest fear is that Mac users will report bugs to me and I will not be able to reproduce the bugs because I use Windows. Do you think I should acquire a Mac as well?

 

Any help would be greatly appreciated. Thanks!

Position keyframe equality

$
0
0

How do i check if 2 keyframes have the same value?

 

I have 1 layer in composition with 2 identical keyframes. But when I try to compare their values, the result is "false". Why? What am I missing?

 

Here is the code:

$.writeln(app.project.activeItem.layer(1).position.numKeys);

$.writeln(app.project.activeItem.layer(1).position.keyValue(1));

$.writeln(app.project.activeItem.layer(1).position.keyValue(2));

$.writeln(app.project.activeItem.layer(1).position.keyValue(1) == app.project.activeItem.layer(1).position.keyValue(2));

 

Here is the result from console:

2

960,540,0

960,540,0

false

 

Thanks,

Martin

How to display dialog that contains some text fields and buttons?

$
0
0

I am beginner on after effect plugin.

I am going to display a dialog that customer can enter some informations inside my plugin.

How can I implement the function(cross-plateform)?

 

Thank you.


Create and delete text layer

$
0
0

Hello.

 

I've searched the web upside down searching for a script that would do the following:

 

In the first script would be for text creation and searching I was able to find how to create a script, but it only creates in a composition. How do I create in all compositions?

 

{

activeComp = app.project.activeItem;

 

T = activeComp.layers.addText ();

T.name = "COMPOSITION";

T.startTime = 0;

T.outPoint = activeComp.duration;

T.text.sourceText.expression = "thisComp.name";

T.transform.position.setValue ([40,82,0]);

T.locked = true;

}

 

The second script would be delete in all the compositions the layer text created above.

 

If anybody can provide a script that would be such a thing - it would be highly appreciated.

 

Regards,

Hernrique

change default property of applyPreset()

$
0
0

I am using applyPreset(file) on a text layer. The preset is simple and is meant for testing purposes:

 

sr = sourceRectAtTime(time,true);

transform.anchorPoint = [sr.left+sr.width,sr.top];

 

This is how I apply it:

 

var presetPath = "filepathhere";

var presetFile = new File(presetPath);

myTextLayer.applyPreset(presetFile);

 

Unfortunately, preset gets applied to SourceText instead of anchor point. How can I change this default behaviour?

 

Screen Shot 2017-08-24 at 11.16.55.png

Identify if a layer is c4d layer

$
0
0

You can use layer instanceof TextLayer to identify layer being a text layer. How can cinema 4d layer be identified as a c4d layer? These layers have a cineware effect, so hypothetically you could check if CINEWARE effects is present. Perhaps this question should be, how to check if a effect is present?

My script for discovering the names of AE properties

$
0
0

Here's a short script I wrote some time ago which recursively walks through the property chain of layer(s). I use it whenever I need to find a property name for a given element within AE. To run the script, select the layer(s) you're interested in and then execute inside Adobe's ExtendScript CC debugger. It'll dump the outupt to the javascript console. Below is the script and the sample output:

 

 

(function() { // wrap entire script in an anonymous function to create a private scope within AE's global namespace  

main();      
function dumpPropTree(rootObj, nestingLevel) {     var countProps = rootObj.numProperties;    for (var propIndex=1; propIndex <= countProps; propIndex++) {        var prop = rootObj.property(propIndex);        $.writeln(Array(nestingLevel*4).join(" ") + "[" + nestingLevel + "-" + propIndex + "] " + "matchName: \"" + prop.matchName + "\", name: \"" + prop.name + "\"");        if (prop.numProperties > 0)            dumpPropTree(prop, nestingLevel+1);    }
}

function main() {
    var activeComp = app.project.activeItem;    if (activeComp == null) {        alert("Error: No active composition");        return;    }      var countSelectedLayers = activeComp.selectedLayers.length;    if (countSelectedLayers == 0) {        alert("Error: No selected layer(s)");        return;    }      for (selectedLayerIndex=0; selectedLayerIndex < countSelectedLayers; selectedLayerIndex++) {        var layer = activeComp.selectedLayers[selectedLayerIndex];        $.writeln("***************** [ Layer: \"" + layer.name + "\" ] *****************");        dumpPropTree(layer, 0);    }   
}

})();   // end of anonymous function that encapsulates entire script

 

Sample output for a simple shape layer:

 

***************** [ Layer: "Shape Layer 1" ] *****************
[0-1] matchName: "ADBE Marker", name: "Marker"
[0-2] matchName: "ADBE Root Vectors Group", name: "Contents"   [1-1] matchName: "ADBE Vector Group", name: "Rectangle 1"       [2-1] matchName: "ADBE Vector Blend Mode", name: "Blend Mode"       [2-2] matchName: "ADBE Vectors Group", name: "Contents"           [3-1] matchName: "ADBE Vector Shape - Group", name: "Path 1"               [4-1] matchName: "ADBE Vector Shape Direction", name: "Shape Direction"               [4-2] matchName: "ADBE Vector Shape", name: "Path"           [3-2] matchName: "ADBE Vector Graphic - Stroke", name: "Stroke 1"               [4-1] matchName: "ADBE Vector Blend Mode", name: "Blend Mode"               [4-2] matchName: "ADBE Vector Composite Order", name: "Composite"               [4-3] matchName: "ADBE Vector Stroke Color", name: "Color"               [4-4] matchName: "ADBE Vector Stroke Opacity", name: "Opacity"               [4-5] matchName: "ADBE Vector Stroke Width", name: "Stroke Width"               [4-6] matchName: "ADBE Vector Stroke Line Cap", name: "Line Cap"               [4-7] matchName: "ADBE Vector Stroke Line Join", name: "Line Join"               [4-8] matchName: "ADBE Vector Stroke Miter Limit", name: "Miter Limit"               [4-9] matchName: "ADBE Vector Stroke Dashes", name: "Dashes"                   [5-1] matchName: "ADBE Vector Stroke Dash 1", name: "Dash"                   [5-2] matchName: "ADBE Vector Stroke Gap 1", name: "Gap"                   [5-3] matchName: "ADBE Vector Stroke Dash 2", name: "Dash 2"                   [5-4] matchName: "ADBE Vector Stroke Gap 2", name: "Gap 2"                   [5-5] matchName: "ADBE Vector Stroke Dash 3", name: "Dash 3"                   [5-6] matchName: "ADBE Vector Stroke Gap 3", name: "Gap 3"                   [5-7] matchName: "ADBE Vector Stroke Offset", name: "Offset"           [3-3] matchName: "ADBE Vector Graphic - Fill", name: "Fill 1"               [4-1] matchName: "ADBE Vector Blend Mode", name: "Blend Mode"               [4-2] matchName: "ADBE Vector Composite Order", name: "Composite"               [4-3] matchName: "ADBE Vector Fill Rule", name: "Fill Rule"               [4-4] matchName: "ADBE Vector Fill Color", name: "Color"               [4-5] matchName: "ADBE Vector Fill Opacity", name: "Opacity"       [2-3] matchName: "ADBE Vector Transform Group", name: "Transform"           [3-1] matchName: "ADBE Vector Anchor", name: "Anchor Point"           [3-2] matchName: "ADBE Vector Position", name: "Position"           [3-3] matchName: "ADBE Vector Scale", name: "Scale"           [3-4] matchName: "ADBE Vector Skew", name: "Skew"           [3-5] matchName: "ADBE Vector Skew Axis", name: "Skew Axis"           [3-6] matchName: "ADBE Vector Rotation", name: "Rotation"           [3-7] matchName: "ADBE Vector Group Opacity", name: "Opacity"       [2-4] matchName: "ADBE Vector Materials Group", name: "Material Options"           [3-1] matchName: "ADBE Vec3D Front RGB", name: "Front Color"           [3-2] matchName: "ADBE Vec3D Front Ambient", name: "Front Ambient"           [3-3] matchName: "ADBE Vec3D Front Diffuse", name: "Front Diffuse"           [3-4] matchName: "ADBE Vec3D Front Specular", name: "Front Specular Intensity"           [3-5] matchName: "ADBE Vec3D Front Shininess", name: "Front Specular Shininess"           [3-6] matchName: "ADBE Vec3D Front Metal", name: "Front Metal"           [3-7] matchName: "ADBE Vec3D Front Reflection", name: "Front Reflection Intensity"           [3-8] matchName: "ADBE Vec3D Front Gloss", name: "Front Reflection Sharpness"           [3-9] matchName: "ADBE Vec3D Front Fresnel", name: "Front Reflection Rolloff"           [3-10] matchName: "ADBE Vec3D Front Xparency", name: "Front Transparency"           [3-11] matchName: "ADBE Vec3D Front XparRoll", name: "Front Transparency Rolloff"           [3-12] matchName: "ADBE Vec3D Front IOR", name: "Front Index of Refraction"           [3-13] matchName: "ADBE Vec3D Bevel RGB", name: "Bevel Color"           [3-14] matchName: "ADBE Vec3D Bevel Ambient", name: "Bevel Ambient"           [3-15] matchName: "ADBE Vec3D Bevel Diffuse", name: "Bevel Diffuse"           [3-16] matchName: "ADBE Vec3D Bevel Specular", name: "Bevel Specular Intensity"           [3-17] matchName: "ADBE Vec3D Bevel Shininess", name: "Bevel Specular Shininess"           [3-18] matchName: "ADBE Vec3D Bevel Metal", name: "Bevel Metal"           [3-19] matchName: "ADBE Vec3D Bevel Reflection", name: "Bevel Reflection Intensity"           [3-20] matchName: "ADBE Vec3D Bevel Gloss", name: "Bevel Reflection Sharpness"           [3-21] matchName: "ADBE Vec3D Bevel Fresnel", name: "Bevel Reflection Rolloff"           [3-22] matchName: "ADBE Vec3D Bevel Xparency", name: "Bevel Transparency"           [3-23] matchName: "ADBE Vec3D Bevel XparRoll", name: "Bevel Transparency Rolloff"           [3-24] matchName: "ADBE Vec3D Bevel IOR", name: "Bevel Index of Refraction"           [3-25] matchName: "ADBE Vec3D Side RGB", name: "Side Color"           [3-26] matchName: "ADBE Vec3D Side Ambient", name: "Side Ambient"           [3-27] matchName: "ADBE Vec3D Side Diffuse", name: "Side Diffuse"           [3-28] matchName: "ADBE Vec3D Side Specular", name: "Side Specular Intensity"           [3-29] matchName: "ADBE Vec3D Side Shininess", name: "Side Specular Shininess"           [3-30] matchName: "ADBE Vec3D Side Metal", name: "Side Metal"           [3-31] matchName: "ADBE Vec3D Side Reflection", name: "Side Reflection Intensity"           [3-32] matchName: "ADBE Vec3D Side Gloss", name: "Side Reflection Sharpness"           [3-33] matchName: "ADBE Vec3D Side Fresnel", name: "Side Reflection Rolloff"           [3-34] matchName: "ADBE Vec3D Side Xparency", name: "Side Transparency"           [3-35] matchName: "ADBE Vec3D Side XparRoll", name: "Side Transparency Rolloff"           [3-36] matchName: "ADBE Vec3D Side IOR", name: "Side Index of Refraction"           [3-37] matchName: "ADBE Vec3D Back RGB", name: "Back Color"           [3-38] matchName: "ADBE Vec3D Back Ambient", name: "Back Ambient"           [3-39] matchName: "ADBE Vec3D Back Diffuse", name: "Back Diffuse"           [3-40] matchName: "ADBE Vec3D Back Specular", name: "Back Specular Intensity"           [3-41] matchName: "ADBE Vec3D Back Shininess", name: "Back Specular Shininess"           [3-42] matchName: "ADBE Vec3D Back Metal", name: "Back Metal"           [3-43] matchName: "ADBE Vec3D Back Reflection", name: "Back Reflection Intensity"           [3-44] matchName: "ADBE Vec3D Back Gloss", name: "Back Reflection Sharpness"           [3-45] matchName: "ADBE Vec3D Back Fresnel", name: "Back Reflection Rolloff"           [3-46] matchName: "ADBE Vec3D Back Xparency", name: "Back Transparency"           [3-47] matchName: "ADBE Vec3D Back XparRoll", name: "Back Transparency Rolloff"           [3-48] matchName: "ADBE Vec3D Back IOR", name: "Back Index of Refraction"
[0-3] matchName: "ADBE Mask Parade", name: "Masks"
[0-4] matchName: "ADBE Effect Parade", name: "Effects"
[0-5] matchName: "ADBE Transform Group", name: "Transform"   [1-1] matchName: "ADBE Anchor Point", name: "Anchor Point"   [1-2] matchName: "ADBE Position", name: "Position"   [1-3] matchName: "ADBE Position_0", name: "X Position"   [1-4] matchName: "ADBE Position_1", name: "Y Position"   [1-5] matchName: "ADBE Position_2", name: "Z Position"   [1-6] matchName: "ADBE Scale", name: "Scale"   [1-7] matchName: "ADBE Orientation", name: "Orientation"   [1-8] matchName: "ADBE Rotate X", name: "X Rotation"   [1-9] matchName: "ADBE Rotate Y", name: "Y Rotation"   [1-10] matchName: "ADBE Rotate Z", name: "Rotation"   [1-11] matchName: "ADBE Opacity", name: "Opacity"   [1-12] matchName: "ADBE Envir Appear in Reflect", name: "Appears in Reflections"
[0-6] matchName: "ADBE Layer Styles", name: "Layer Styles"   [1-1] matchName: "ADBE Blend Options Group", name: "Blending Options"       [2-1] matchName: "ADBE Global Angle2", name: "Global Light Angle"       [2-2] matchName: "ADBE Global Altitude2", name: "Global Light Altitude"       [2-3] matchName: "ADBE Adv Blend Group", name: "Advanced Blending"           [3-1] matchName: "ADBE Layer Fill Opacity2", name: "Fill Opacity"           [3-2] matchName: "ADBE R Channel Blend", name: "Red"           [3-3] matchName: "ADBE G Channel Blend", name: "Green"           [3-4] matchName: "ADBE B Channel Blend", name: "Blue"           [3-5] matchName: "ADBE Blend Interior", name: "Blend Interior Styles as Group"           [3-6] matchName: "ADBE Blend Ranges", name: "Use Blend Ranges from Source"   [1-2] matchName: "dropShadow/enabled", name: "Drop Shadow"       [2-1] matchName: "dropShadow/mode2", name: "Blend Mode"       [2-2] matchName: "dropShadow/color", name: "Color"       [2-3] matchName: "dropShadow/opacity", name: "Opacity"       [2-4] matchName: "dropShadow/useGlobalAngle", name: "Use Global Light"       [2-5] matchName: "dropShadow/localLightingAngle", name: "Angle"       [2-6] matchName: "dropShadow/distance", name: "Distance"       [2-7] matchName: "dropShadow/chokeMatte", name: "Spread"       [2-8] matchName: "dropShadow/blur", name: "Size"       [2-9] matchName: "dropShadow/noise", name: "Noise"       [2-10] matchName: "dropShadow/layerConceals", name: "Layer Knocks Out Drop Shadow"   [1-3] matchName: "innerShadow/enabled", name: "Inner Shadow"       [2-1] matchName: "innerShadow/mode2", name: "Blend Mode"       [2-2] matchName: "innerShadow/color", name: "Color"       [2-3] matchName: "innerShadow/opacity", name: "Opacity"       [2-4] matchName: "innerShadow/useGlobalAngle", name: "Use Global Light"       [2-5] matchName: "innerShadow/localLightingAngle", name: "Angle"       [2-6] matchName: "innerShadow/distance", name: "Distance"       [2-7] matchName: "innerShadow/chokeMatte", name: "Choke"       [2-8] matchName: "innerShadow/blur", name: "Size"       [2-9] matchName: "innerShadow/noise", name: "Noise"   [1-4] matchName: "outerGlow/enabled", name: "Outer Glow"       [2-1] matchName: "outerGlow/mode2", name: "Blend Mode"       [2-2] matchName: "outerGlow/opacity", name: "Opacity"       [2-3] matchName: "outerGlow/noise", name: "Noise"       [2-4] matchName: "outerGlow/AEColorChoice", name: "Color Type"       [2-5] matchName: "outerGlow/color", name: "Color"       [2-6] matchName: "outerGlow/gradient", name: "Colors"       [2-7] matchName: "outerGlow/gradientSmoothness", name: "Gradient Smoothness"       [2-8] matchName: "outerGlow/glowTechnique", name: "Technique"       [2-9] matchName: "outerGlow/chokeMatte", name: "Spread"       [2-10] matchName: "outerGlow/blur", name: "Size"       [2-11] matchName: "outerGlow/inputRange", name: "Range"       [2-12] matchName: "outerGlow/shadingNoise", name: "Jitter"   [1-5] matchName: "innerGlow/enabled", name: "Inner Glow"       [2-1] matchName: "innerGlow/mode2", name: "Blend Mode"       [2-2] matchName: "innerGlow/opacity", name: "Opacity"       [2-3] matchName: "innerGlow/noise", name: "Noise"       [2-4] matchName: "innerGlow/AEColorChoice", name: "Color Type"       [2-5] matchName: "innerGlow/color", name: "Color"       [2-6] matchName: "innerGlow/gradient", name: "Colors"       [2-7] matchName: "innerGlow/gradientSmoothness", name: "Gradient Smoothness"       [2-8] matchName: "innerGlow/glowTechnique", name: "Technique"       [2-9] matchName: "innerGlow/innerGlowSource", name: "Source"       [2-10] matchName: "innerGlow/chokeMatte", name: "Choke"       [2-11] matchName: "innerGlow/blur", name: "Size"       [2-12] matchName: "innerGlow/inputRange", name: "Range"       [2-13] matchName: "innerGlow/shadingNoise", name: "Jitter"   [1-6] matchName: "bevelEmboss/enabled", name: "Bevel and Emboss"       [2-1] matchName: "bevelEmboss/bevelStyle", name: "Style"       [2-2] matchName: "bevelEmboss/bevelTechnique", name: "Technique"       [2-3] matchName: "bevelEmboss/strengthRatio", name: "Depth"       [2-4] matchName: "bevelEmboss/bevelDirection", name: "Direction"       [2-5] matchName: "bevelEmboss/blur", name: "Size"       [2-6] matchName: "bevelEmboss/softness", name: "Soften"       [2-7] matchName: "bevelEmboss/useGlobalAngle", name: "Use Global Light"       [2-8] matchName: "bevelEmboss/localLightingAngle", name: "Angle"       [2-9] matchName: "bevelEmboss/localLightingAltitude", name: "Altitude"       [2-10] matchName: "bevelEmboss/highlightMode", name: "Highlight Mode"       [2-11] matchName: "bevelEmboss/highlightColor", name: "Highlight Color"       [2-12] matchName: "bevelEmboss/highlightOpacity", name: "Highlight Opacity"       [2-13] matchName: "bevelEmboss/shadowMode", name: "Shadow Mode"       [2-14] matchName: "bevelEmboss/shadowColor", name: "Shadow Color"       [2-15] matchName: "bevelEmboss/shadowOpacity", name: "Shadow Opacity"   [1-7] matchName: "chromeFX/enabled", name: "Satin"       [2-1] matchName: "chromeFX/mode2", name: "Blend Mode"       [2-2] matchName: "chromeFX/color", name: "Color"       [2-3] matchName: "chromeFX/opacity", name: "Opacity"       [2-4] matchName: "chromeFX/localLightingAngle", name: "Angle"       [2-5] matchName: "chromeFX/distance", name: "Distance"       [2-6] matchName: "chromeFX/blur", name: "Size"       [2-7] matchName: "chromeFX/invert", name: "Invert"   [1-8] matchName: "solidFill/enabled", name: "Color Overlay"       [2-1] matchName: "solidFill/mode2", name: "Blend Mode"       [2-2] matchName: "solidFill/color", name: "Color"       [2-3] matchName: "solidFill/opacity", name: "Opacity"   [1-9] matchName: "gradientFill/enabled", name: "Gradient Overlay"       [2-1] matchName: "gradientFill/mode2", name: "Blend Mode"       [2-2] matchName: "gradientFill/opacity", name: "Opacity"       [2-3] matchName: "gradientFill/gradient", name: "Colors"       [2-4] matchName: "gradientFill/gradientSmoothness", name: "Gradient Smoothness"       [2-5] matchName: "gradientFill/angle", name: "Angle"       [2-6] matchName: "gradientFill/type", name: "Style"       [2-7] matchName: "gradientFill/reverse", name: "Reverse"       [2-8] matchName: "gradientFill/align", name: "Align with Layer"       [2-9] matchName: "gradientFill/scale", name: "Scale"       [2-10] matchName: "gradientFill/offset", name: "Offset"   [1-10] matchName: "patternFill/enabled", name: "Pattern Overlay"       [2-1] matchName: "patternFill/mode2", name: "Blend Mode"       [2-2] matchName: "patternFill/opacity", name: "Opacity"       [2-3] matchName: "patternFill/align", name: "Link with Layer"       [2-4] matchName: "patternFill/scale", name: "Scale"       [2-5] matchName: "patternFill/phase", name: "Offset"   [1-11] matchName: "frameFX/enabled", name: "Stroke"       [2-1] matchName: "frameFX/mode2", name: "Blend Mode"       [2-2] matchName: "frameFX/color", name: "Color"       [2-3] matchName: "frameFX/size", name: "Size"       [2-4] matchName: "frameFX/opacity", name: "Opacity"       [2-5] matchName: "frameFX/style", name: "Position"
[0-7] matchName: "ADBE Extrsn Options Group", name: "Geometry Options"   [1-1] matchName: "ADBE Bevel Styles", name: "Bevel Style"   [1-2] matchName: "ADBE Bevel Direction", name: "Bevel Direction"   [1-3] matchName: "ADBE Bevel Depth", name: "Bevel Depth"   [1-4] matchName: "ADBE Hole Bevel Depth", name: "Hole Bevel Depth"   [1-5] matchName: "ADBE Extrsn Depth", name: "Extrusion Depth"
[0-8] matchName: "ADBE Material Options Group", name: "Material Options"   [1-1] matchName: "ADBE Casts Shadows", name: "Casts Shadows"   [1-2] matchName: "ADBE Light Transmission", name: "Light Transmission"   [1-3] matchName: "ADBE Accepts Shadows", name: "Accepts Shadows"   [1-4] matchName: "ADBE Accepts Lights", name: "Accepts Lights"   [1-5] matchName: "ADBE Appears in Reflections", name: "Appears in Reflections"   [1-6] matchName: "ADBE Ambient Coefficient", name: "Ambient"   [1-7] matchName: "ADBE Diffuse Coefficient", name: "Diffuse"   [1-8] matchName: "ADBE Specular Coefficient", name: "Specular Intensity"   [1-9] matchName: "ADBE Shininess Coefficient", name: "Specular Shininess"   [1-10] matchName: "ADBE Metal Coefficient", name: "Metal"   [1-11] matchName: "ADBE Reflection Coefficient", name: "Reflection Intensity"   [1-12] matchName: "ADBE Glossiness Coefficient", name: "Reflection Sharpness"   [1-13] matchName: "ADBE Fresnel Coefficient", name: "Reflection Rolloff"   [1-14] matchName: "ADBE Transparency Coefficient", name: "Transparency"   [1-15] matchName: "ADBE Transp Rolloff", name: "Transparency Rolloff"   [1-16] matchName: "ADBE Index of Refraction", name: "Index of Refraction"
[0-9] matchName: "ADBE Audio Group", name: "Audio"   [1-1] matchName: "ADBE Audio Levels", name: "Audio Levels"

move a Keyframes in timeline

$
0
0

Hi guys, How can I move a Keyframes forward or backwards in timeline with scripting?

Would like some help with some lines of code

$
0
0

Hello community.
I am looking for a way to create a template for a series I am working on.

 

I made a base template with a comp called _SCENE. This is the work composition and I am trying to get all elements in this comp when importing.
So far so good, till I want to import a .psd.

 

I seem not to find that part of code (I am REALLY new to coding) that gives me the standard after effects pop-up window, when importing manually a photoshop document.

 


Could you help me out please?

 

Cheers,

 

Marc Konings

 

 

 


here is the code I have till now:

 

 

 

 

 

 

 

 

/* TEMPLATE  AE COMPOSITING production name */

// MK

// version  15062017-002

 

 

var currentFootageItem;

var maDate=new Date();

var myfps=25;

var mySearch=/EP000_SC000/;

var nom=prompt("Episode and Scene number :","EP000_SC000","production name AE");

var myDuree=prompt("Frames : ","480","production name AE")/25;

var z,z1=false;

var myDoc = app.activeDocument

var myProject = app.project.items;

var q = app.project.renderQueue.items

 

 

 

 

    var folderProjectName = myProject.addFolder(nom);

   

    var folderScene = myProject.addFolder("07_SCENE");

    var folderRenderComp = myProject.addFolder("RENDER_COMPS");

    var folderOther = myProject.addFolder("05_OTHER");

    var folderComps = myProject.addFolder("06_COMPS");

    var folderAnimaticRefs = myProject.addFolder("01_ANIMATIC & REFS");

    var folderAnim = myProject.addFolder("02_ANIM");

    var folderBg = myProject.addFolder("03_BG");

    var folderFx = myProject.addFolder("04_FX");

   

    folderScene.parentFolder=folderProjectName;

    folderRenderComp.parentFolder=folderProjectName;

    folderOther.parentFolder=folderProjectName;

    folderComps.parentFolder=folderProjectName;

    folderAnimaticRefs.parentFolder=folderProjectName;

    folderAnim.parentFolder=folderProjectName;

    folderBg.parentFolder=folderProjectName;

    folderFx.parentFolder=folderProjectName;

   

 

alert("Choose your ANIMATIC file");

 

var animatic = File.openDialog("Select ANIMATIC");

if(animatic != null) {

    var myImportOptions = new ImportOptions();

    myImportOptions.file = animatic;

    var myAnimatic = app.project.importFile(myImportOptions);

    myAnimatic.parentFolder = folderAnimaticRefs;

 

 

for (it=myProject.length; it>=1; it--){

        if(myProject[it].name==nom+"_SCENE"){

            myProject[it].layers.add(myAnimatic)

            }

       

        }   

   

   

    }

 

 

 

alert("Choose your PHOTOSHOP / BG file");

 

var bg= File.openDialog("Select BACKGROUND / .PSD");

if(bg != null) {

    var myImportOptions2 = new ImportOptions();

    myImportOptions2.file = bg;

    var myBg = app.project.importFile(myImportOptions2);

    myBg.parentFolder = folderBg;   

 

//I am struggling here, I seem not to get to choose a .psd AND to choose in what way I want to import  this .psd

//It would be awesome if I could import this also instantly in 'comp_SCENE'.

 

    }

 

    { 

    if(myImportOptions2.canImportAs(ImportAsType.COMP)){ 

    myImportOptions2.importAs = ImportAsType.COMP; 

    }else{ 

    myImportOptions2.ImportAs=ImportAsType.FOOTAGE; 

 

    for (it=myProject.length; it>=1; it--){

        if(myProject[it].name==nom+"_SCENE"){

            myProject[it].layers.add(myAnimatic)

            }

 

    }        

    

}

 

 

alert("Choose your ANIMATION folder");

 

var mySwfFolder = Folder.selectDialog ("Select ANIMATION Folder");

var mySwfFiles = mySwfFolder.getFiles ("*.SWF");

for(var i = 0; i < mySwfFiles.length; i++){

    var myImportOptions3 = new ImportOptions();

     myImportOptions3.file =mySwfFiles[i]

     var mySwf = app.project.importFile(myImportOptions3);

     mySwf.parentFolder = folderAnim;

 

 

for (it=myProject.length; it>=1; it--){

        if(myProject[it].name==nom+"_SCENE"){

            myProject[it].layers.add(mySwf)

            }

       

        }   

 

};

 

 

 

 

 

for (i=app.project.numItems; i>=1; i--){

    if(mySearch.test(myProject[i].name)){

        myProject[i].name=myProject[i].name.replace(mySearch,nom)

        myProject[i].duration=myDuree;

        z=true;

       

        if(myProject[i].name==nom+"_NOMENCLATURE"){

            for(j=1;j<=myProject[i].numLayers;j++){

                if(mySearch.test(myProject[i].layer(j).name)){

                    myProject[i].layer(j).sourceText.setValue(nom);

                    myProject[i].layer(j).name=nom;

                    z1=true;

                }

            }

        }

    }

}

 

 

if(z&&z1){

 

 

   

    // Folder creation + variable of each ones creation   b = folderProjectName

   

 

 

   

    for (i2=myProject.length; i2>=1; i2--){

       

        if(myProject[i2].name==nom+"_SCENE"){myProject[i2].parentFolder=folderScene;}

        if(myProject[i2].name==nom+"_QT_T1"){myProject[i2].parentFolder=folderRenderComp;}       

        if(myProject[i2].name==nom+"_NOMENCLATURE"){myProject[i2].parentFolder=folderOther;}

        if(myProject[i2].name==nom+"_CONFO_T1"){myProject[i2].parentFolder=folderRenderComp;}

 

 

 

           

        if(myProject[i2].name==nom&&!(myProject[i2] instanceof FolderItem)){

            myProject[i2].parentFolder=folderProjectName;

            myProject[i2].selected=true;

            currentFootageItem=myProject[i2]

            }

        myProject[i2].selected=false

    }

   

    function aff_Date(x){

        if(x>9){

            return x;

        }

        else{

            return "0"+x;

        }

    }

 

    var d=app.project.saveWithDialog();

    var e=app.project.file.path;   

    var f=app.project.file.fsName;

    var h = e.toString().split("/");

 

    h.pop();

 

    var g="";

   

    for (i=0;i<h.length;i++){

        g=g+h[i]+"/";

        }

   

    g=g+ "OUTPUT_"+nom+"/" + nom + "_QT_T1_"+maDate.getFullYear().toString().substring (2,4)+aff_Date(maDate.getMonth()+1)+aff_Date(maDate.getDate());

    var curItemQ = q[1];

    var curItemQOut = curItemQ.outputModule(1);

    // var oldLocation = curItemQOut.file;

    curItemQOut.file = new File(g);

 

 

    var w="";

    for (i=0;i<h.length;i++){

        w=w+h[i]+"/";

    }

    w=w+ "OUTPUT_"+nom+"/" + nom + "_CONFO_T1_[#####]_"+maDate.getFullYear().toString().substring (2,4)+aff_Date(maDate.getMonth()+1)+aff_Date(maDate.getDate());

    var curItemQ = q[2];

    var curItemQOut = curItemQ.outputModule(1);

    // var oldLocation = curItemQOut.file;

    curItemQOut.file = new File(w);   

   

}

else{

    alert ("Script stopped working : The AE project doesn't look like a copy of the template: EP000_SC000.aet" , "Production name AE", true)

}

onResizing

$
0
0

hi,

 

What should I do in order to make the script responds like the script that attaches to the gif?

Comp 1.gif

{

var myWin = buildUI(this);

if (myWin != null && myWin instanceof Window) {

  myWin.show();

  }

 

 

function buildUI (thisObject) {

 

 

if (thisObject instanceof Panel) {

  var myWin = thisObject;

  } else {

    var myWin = new Window ("palette", undefined, undefined, {resizeable:true});

  }

 

 

if (myWin != null ) {

 

  var res =

        "Group { \

                alignment: ['fill','fill'],\

                alignChildren: ['fill','fill'],\

                orientation:'column' ,\

                    spacing:0,\

                 AllBtms:Panel{\

                    alignment: ['fill','fill'],\

                    alignChildren: ['fill','fill'],\

                    orientation:'Row',\

                    spacing:0,\

                    aBtn:Button{text:'a',alignment: ['left','top'],preferredSize:[30,30]}\

                    bBtn:Button{text:'b',alignment: ['left','top'],preferredSize:[30,30]}\

                    cBtn:Button{text:'c',alignment: ['left','top'],preferredSize:[30,30]}\

                    dBtn:Button{text:'d',alignment: ['left','top'],preferredSize:[30,30]}\

                   fBtn :Button{text:'f',alignment: ['left','top'],preferredSize:[30,30]}\

                    gBtn:Button{text:'g',alignment: ['left','top'],preferredSize:[30,30]}\

                    hBtn:Button{text:'h',alignment: ['left','top'],preferredSize:[30,30]}\

                                    }\

              }";//GroupRes

       

  myWin.grp = myWin.add(res);

  myWin.layout.layout(true);

  myWin.layout.resize();

   

//======================================================================================= =====

 

//======================================================================================= =====

 

  myWin.onResizing = myWin.onRize = function () {

     

     

     

     

      this.layout.resize();

        }

 

 

  } //if (myWin != null )

return myWin;

} //function buildUI (thisObject)

 

 

}


Test my script

$
0
0

Can someone test if this script works on Windows & Mac correctly?

Some say they get "Connection error" When send massages. Please?

Thanks

 

My Script Link Is Here

Selecting layers - how to capture this event?

$
0
0

Hello,

 

is it possible to call addEventListener or something like this that would capture selecting layers? I want to change something in my script depending on layers, but I don't want to reload values manually everytime I'm switching between layers - I just want to do it automatically.

Create new wav file

$
0
0

Hello guys,

 

Here is the situation. I have a CEP panel in AE with bunch of buttons, where each of them runs different functions of a .jsx script. One of these buttons is "Check AE", which checks if everything is correctly setup in AE for the other scripts to work properly. As part of this function I need to somehow create stretched versions of all .wav files I have in AE to 120%. I need physical .wav files for the other script to work. It cannot be another layer with 120% duration.

 

So I have created a new comp for each .wav in project with 120% duration and inserted the wav file there with 120% stretch. But when I add it to renderqueue, there is no default render template for .wav and with the setSettings() function, the format is not settable. I know I can create a new template for wav, but I need to run this script on a lot of computers without loading the template manually first. Is there a way i can load the template with script?

 

Second option I tried is to send these new comps to AME. Even though AME has a default .wav preset, it uses the last used preset and the change of the preset is not settable as far as I know. Is there a way how to set the default wav preset?

 

Another possible option i have thought of is that you can create scripts with extendscript for Audition. But i haven't worked with audition and couldn't even find any good guide for scripting and I am not even sure if I can run script for Audition from CEP panel in AE. Can I run it somehow? What would be the code for the script to import files to Audition, stretch them to 120% and saving them as wav in a different folder?

 

Is there some other way I could do this i didn't think of?

 

Thanks in advance for suggestions,

Martin

AE error: This property has no maximum value

$
0
0

I am iterating through comp layers and layer properties and saving them in an object. I then call JSON.stringify() on the object created put in JSON valid format. Unfortunately I am getting an error:

 

Unable to execute script at line 230. After effects error: This property has no maximum value.

 

This is the function and line that the debugger points to. This is just a small piece of code.

 

function storeAVLayerData(avLayer){

    var layer = new Object();

    var layerTypeData = determineLayerType(avLayer);

 

 

    alert("layername: "+avLayer.name);

    layer.name = avLayer.name;

    layer.type = layerTypeData.type;

    layer.index = avLayer.index;

    layer.height = avLayer.height;

    layer.width = avLayer.width;

    layer.motionBlur = avLayer.motionBlur;

    layer.effectsActive = avLayer.effectsActive;

    layer.adjustmentLayer = avLayer.adjustmentLayer;

    layer.guideLayer = avLayer.guideLayer;

    layer.threeDLayer = avLayer.threeDLayer;

    layer.threeDPerChar = avLayer.threeDPerChar;

    layer.environmentLayer = avLayer.environmentLayer;

    layer.canSetCollapseTransformation = avLayer.canSetCollapseTransformation;

    layer.collapseTransformation = avLayer.collapseTransformation;

    layer.frameBlending = avLayer.frameBlending;

    layer.frameBlendingType = avLayer.frameBlendingType;

    layer.canSetTimeRemapEnabled = avLayer.canSetTimeRemapEnabled;

    layer.timeRemapEnabled = avLayer.timeRemapEnabled;

    layer.autoOrient = avLayer.autoOrient;

    layer.hasTrackMatte = avLayer.hasTrackMatte;

    layer.trackMatteType = avLayer.trackMatteType;

    layer.isTrackMatte = avLayer.isTrackMatte;

    layer.preserveTransparency = avLayer.preserveTransparency;

    layer.quality = avLayer.quality;

    layer.preserveTransparency = avLayer.preserveTransparency;

    layer.parent = avLayer.parent;

    layer.startTime = avLayer.startTime;

    layer.stretch = avLayer.stretch;

    layer.inPoint = avLayer.inPoint;

    layer.outPoint = avLayer.outPoint;

    layer.enabled = avLayer.enabled;

    layer.solo = avLayer.solo;

    layer.shy = avLayer.shy;

    layer.locked = avLayer.locked;

 

 

    return layer; //this is line 230

}

 

If I don't call the JSON.stringify() on an object, then the error is never thrown. This seems like an error in structure of object. This code works for a lot of projects, but some issue an error. How can I debug this and what does the error actually mean? It is kinda vague and google seems to be clueless.

Mysterious PropertyValueType.CUSTOM_VALUE

$
0
0

I've read a discussion started in 2014, stating that you can't access property values of type PropertyValueType.CUSTOM_VALUE. Also, you can't set it. There is pretty much nothing you can do with them.

 

Typical path:

comp.layer(1).property("ADBE Effect Parade").property("ADBE CurvesCustom").property("ADBE CurvesCustom-0001").value;

 

Curves, Levels, Hue and Saturation are the effects (that I know of) that are using this CUSTOM_VALUE. Is extend script still incapable of doing anything with this properties? Is there a way to get a glimps of what they store internally?

Viewing all 2143 articles
Browse latest View live


Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>