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

sampleImage() and Vector Layers

$
0
0

I've been using sampleImage to scan a layer's alpha channel with great success.

Until I started working with vector layers.

These are my issues:

 

The sampleImage function works differently on Shape Layers and Text Layers -

It scans the layer using composition's dimensions and not the layer's -- meaning that if a text layer is off the screen than the sampleImage will not find any non-transparent pixels.

This is unlike AV Layers in which sampleImage scans the layer itself regardless of position in the comp. So even non-transparent pixels that are off the comp's screen are scanned.

Is there anyway around this and sample a text or shape layer regardless of the comp? I can think of a very long way to get this done using a duplicate comp resized to match the sourceRecAtTime of the text/shape layer, solo the layer and scanning the duplicate precomp but that seems like a hassle...

 

Another issue I found is with Vector footage layer (e.g. an illustrator file) that has the Collapse Transformations switch enabled -- sampleImage returns completely different values than with this switch disabled... haven't figured out the pattern yet.  Anyone encountered this before?

 

Thanks a bunch

Roy


relation between active layer and enable layer

$
0
0

I am using AE CC 12.2.1. I think this is not specific to AE version but general thing.

When I read my layer property through extendscript, it shows layer.enabled =true and layer.active = false. And if I change layer.enabled from false to true, active property seems to follow enabled property also.  I don't know exact meaning of "active" because even layer.active = false, there is no problem to handle layer in AE.

I'd like to know something.

1. How to know layer.active status in AE UI even I can check it in script source ?

2. What's the difference between layer.active = false and true ?

3. What's the relation between active layer and enabled layer ?

 

Thanks in advance.

 

[Moved to the After Effects scripting forum - moderator]

My script's UI is freezing during render time. Is there a fix for this?

$
0
0

Hello,

 

I recently wrote a script that renders multiple parts of my composition based on markers I placed there. Since these renders can take up more than just a couple of minutes, I built a progress bar to display ... the progress. Basically, I know the total time of how much I'm rendering, and every time the current job is done, I add to a counter how long the video I just rendered was, and divide this counter by the total time. Then, I multiply by 100 and update the progress bar.

 

So, what happens: my script adds the first job, starts rendering it, and after a couple of seconds freezes. It does its job well in the background, but I can't see the progress, I can see it only when it has finished.

 

This is the code for this specific part.

 

for (i=0;i<tm;i++) {

     myComp.workAreaStart = movIn[i]; myComp.workAreaDuration = movOut[i]-movIn[i];

     var RQitem = myQueue.items.add(myComp);

     var OMitem = RQitem.outputModules[1];

     var finLoc = myPal.grp.renderGrp.locationGrp.renLoc.text+movName[i]+".mov";

     OMitem.file = new File(finLoc);

     myQueue.render();

     timeDone+= (movOut[i]-movIn[i]);

     prDone = timeDone*100/totalTime;

     myPal.grp.renderGrp.rndButGrp.renProg.value = prDone;

}

alert("Render Complete!", scriptName);

myPal.grp.renderGrp.rndButGrp.renProg.value = 0;

How does one install AE Adobe ExtendScript toolkit?

$
0
0

I'm new to AE and I've just learned that I must install the Adobe ExtendScript toolkit before I can begin working with a plugin.

 

I'm not finding any helpful information regarding the toolkits for this current version, so am I to assume that I can download the ESTK 3.5 Mac OS: AdobeExtendScriptToolkit3.5.0-mul.dmg(DMG, 76.7 MB) from this link ExtendScript Toolkit Archives  | Adobe Developer Connection ?

 

If so, I *think* it's corrupt because I get a message that reads, "Install.app" is damaged and can't be opened. You should eject the disk image."

 

Now what? Am I going about this the wrong way?

 

Please help this newb.

 

TIA, Lisa

Change fillColor in a Text Layer with the Source Text keyframe?

$
0
0

Dear all. In ExtendScript I'd like to change the color of a text more than once in a comp, without transitions. I know it can be done with an Animator, but I'd like to do it in the Source Text keyframe so that the comp keeps as minimal as possible.

 

I know how to change the fillcolor of a textlayer using:

 

var TextColorLayer = comp.layer("MyTextLayer").property("Text").property("Source Text");

var TextDocument = TextColorLayer.value;

TextDocument.fillColor = [1,1,1];

TextColorLayer.setValue(TextDocument);

 

 

Obviously this next one does not work, but I have no idea where to put the fillColor here..

 

var TextColorLayer = comp.layer("MyTextLayer").property("Text").property("Source Text");

var TextColorAddKeys = [currentTime];

var TextColorAddValues = [[1,1,1]];

TextColorLayer.setValuesAtTimes(TextColorAddKeys,TextColorAddValues);

 

Hope someone can help me out, otherwise I use the Animator-solution which has it's advantages too.

open composition with scripting

$
0
0

Hi.

how can i open in viewer a compostion that does not active with scripting?

change position of many layers

$
0
0

Hello,

 

i tried out a lot and found many things by google, but I can not find any working solution.

I have about 60 layers in my Composition. They all has the same position at this time. The idea is to iterate thru this Items and change them y-position with an offset value.

What I learned so far is, that there is a layer.property("Transform").property("Position"). First I thought this is an Array like [x,y,z], but this seams to be only a ... property.

Now I can check if my layers has the property "Position"...but I already knew this. I found no way to set or even get any values.

 

I know how to set the position when I create a new Layer, but this seams to be a different thing.

Is there some Possibility to change the Position of an existing Layer by script?

 

best regards

G

Do you use scripting methods to initiate previews?

$
0
0

If you ever use a scripting call to initiate a preview, respond to this thread with details about how you do this and why.

 

We're in the middle of making some preview changes that have implications for scripting, so your answer will inform when and how we make certain changes.


Export keyframe data to .txt file

$
0
0

Hello,

 

is it possible to get keyframe data using script? I am talking about the information which you get when select property in AE, press ctrl+c and ctrl+v it into txt file. Looks like this:

 

Adobe After Effects 8.0 Keyframe Data

 

    Units Per Second    30

    Source Width    100

    Source Height    100

    Source Pixel Aspect Ratio    1

    Comp Pixel Aspect Ratio    1

 

Transform    Position

    Frame    X pixels    Y pixels    Z pixels   

    343    960    540    0   

    376    430.101    98.6763    0   

    397    430.101    98.6763    0   

    416    493.813    221.439    0   

...

 

But when i try this:

var logger = selLayers[0].property("ADBE Transform Group").property("ADBE Position");

     myFile.open('w');

     myFile.write(logger);

     myFile.close();

 

I get a text file with "[object Property]" in it.

 

How can I get the data in the format like stated above please?

 

Thank you,

Martin

How to get keyframe data for Rotation

$
0
0

I am able to get all keyframe data for Position and Scale referencing the item and layer as follows:

 

     var propertyPosition = app.project.item(1).layer(1).property("ADBE Transform Group").property("ADBE Position");

     var propertyScale = app.project.item(1).layer(1).property("ADBE Transform Group").property("ADBE Scale");

 

But, the following always returns null for me:

     var propertyRotation = app.project.item(1).layer(1).property("ADBE Transform Group").property("ADBE Rotation");

 

Any ideas?

Add a complex Expression

$
0
0

Hello,

 

I would like to set an expression for a bunch of layers from my script.

This works with a simple expression like ...property("Orientation").expression = "wiggle(5,5)"

 

But now I would like to use this expression:

 

L = thisComp.layer("Camera 1");

u = fromWorldVec(L.toWorldVec([1,0,0]));

v = fromWorldVec(L.toWorldVec([0,1,0]));

w = normalize(fromWorldVec(L.toWorldVec([0,0,1])));

sinb = clamp(w[0],-1,1);

b = Math.asin(sinb);

cosb = Math.cos(b);

if (Math.abs(cosb) > .0005){

  c = -Math.atan2(v[0],u[0]);

  a = -Math.atan2(w[1],w[2]);

}else{

  a = (sinb < 0 ? -1 : 1)*Math.atan2(u[1],v[1]);

  c = 0;

}

[radiansToDegrees(a),radiansToDegrees(b),radiansToDegrees(c)]

 

So far this is not working. I guess the quotes in the first Line are a problem. Does somebody knows a solution for that?

 

best regards

G

change time of the marker key

$
0
0

Hi,

 

How can I change time of the marker key?

Spinning wheel and bad window bahaviour

$
0
0

Hi

 

I have a script which is looping through a lot of layers and converting their expressions to keyframes. Like a bake script. A progress window is showing the progress while it's running and then disappears when done.

 

This works great. On mac. But on PC (win10, newest ae) I get the spinning blue wheel and the progressbar stops updating. The script will otherwise run as it is supposed to, baking all the expressions. But when it's done the progress window doesn't close. It gets stuck and I can't even close it using the red close button top right corner. The only way to get rid of it is to run another operation which uses the same progress window.

 

I'm suspecting that this line of my baking script is causing the trouble:

app.executeCommand(app.findMenuCommandId("Convert Expression to Keyframes"));

 

This is the script for the progress window:

 

    this.launchProgressWindow = function(message)

    {

        propgressWindow = new Window("palette");

        propgressWindow.orientation = "column";

        propgressWindow.alignChildren = "left";

        propgressWindow.add("statictext",undefined, message);

        progressBar = propgressWindow.add("progressbar");

        progressBar.size = [300,5];

        progressBar.value = 0;

        propgressWindow.show();

        propgressWindow.update();

    }

 

    this.updateProgressWindow = function(value)

    {

        progressBar.value = value;

        propgressWindow.update();

    }

 

    this.closeProgressWindow = function()

    {

        propgressWindow.hide();

        propgressWindow.update();

    }

 

 

Any help?

 

Thanks,

Jakob

looking for AEscript gury for paid project

$
0
0

I'm looking to contract an experience AEscript developer to help automate some steps in my studio's production pipeline.

The task has to do with automating certain fairly simple changes such as adding layers, replacing footage items. changing parameters of layers and effects. In order to batch apply those changes to large numbers of AEP projects (hundreds)

 

In my understanding it's fairly simple script . but we need it to be robust.

if interested please email me 3dpasha@3dpasha.com ASAP for details

this project it fairly urgent.

CC Vector Blur 'Amount'

$
0
0

Hi all,

 

I'm working with the CC vector plugin. Not entirely in the way it was intended...

 

I'm using it to create abstract stills at high resolutions, but the 'amount' variable is capped at '500'. At resolutions greatly beyond HD, this starts to be an extremely limiting factor.

 

Is there any way to force the plugin into values above 500? Are there any alternatives I can try that use similar algorithmic blurs but perhaps without this limitation? Would definitely like to see this upper value raised in future updates.

 

Many thanks,

Owen.


Classic 3D renderer options

$
0
0

In a comp viewer, the "Fast Previews" menu (the one that pops up when one clicks the "lightning" icon button at the bottom of the viewer) has an item (the last one) called Renderer Options.

If the current renderer is "Classic 3D" (the one i'm concerned with), there is one single option: set the "Shadow Map Resolution" to something else than "comp".

OK... now the question:

Is it possible to modify that option through script ?

 

Xavier

DropDownList Items width bug?

$
0
0

Hello Community.

 

I've stumbled over a strange behavior with DropDownLists that could be a bug with AFX. Maybe somebody can confirm or - even better - knows a solution.

 

I have a plugin with a fluid interface . By fluid I mean: alignment:['fill','fill'], alignChildren:['fill','fill']. I've put a DropDownList into this and it change its size as intended. I can drag the window or panel to make it wider and the list gets wider too. However, when I narrow the window or panel again, the size of the items in the list stays at their previous width.

 

It's not happening when I run the script with ExtendScript Toolkit CC, only in AFX.

 

The relevant code:

 

group{orientation:'column', alignment:['fill','fill'], alignChildren:['fill','fill'],\

                        panelComp: Panel{text:'Composition', orientation:'row', alignment:['fill','top'], alignChildren:['fill','fill'],\

                            compList: DropDownList{properties:{items:['all', 'selected']}},\

                        },\

 

Screenshots:

 

1. normal size:

afx1.jpgest1.jpg

2. wider:

afx2.jpgest2.jpg

3. back to normal size:

afx3.jpgest3.jpg

 

Thank you!

Martin

StaticText resource string line break

$
0
0

It took me half a day to figure out, so this might be useful for anybody else:

 

If you are building your UI with a resource string and you want to force a line break in a StaticText object, the escape characters needs double backslashes.

 

Use "\\n" instead of "\n", use "\\r" instead of "\r".

 

The whole code should look like this:

 

res = "group{orientation:'column', alignment:['fill','fill'], alignChildren:['fill','fill'],\

                        groupTxt: Group{orientation:'column', alignment:['fill','fill'],\

                            myTxt: StaticText{properties:{multiline: true}, text:'FirstLine\\nSecondLine'},\

                        },\

          }";

 

Hope it helps somebody.

CC 2015 onDraw Throws Error during Rendering

$
0
0

I have a ScriptUI Panel with some custom buttons. I use onDraw event to draw the buttons. Works fine except when rendering. I receive an error "Can not run a script while a modal dialog is waiting for response"

Happening only on CC 2015. Try-catch will not fix as that is still scripting. Any workarounds?

JScript editor doesn't work in AE 2015.3

$
0
0

Hello everybody

 

I'm trying to create a new JScript opening the Script Editor from the file menu and can't save it nor open one saved before in CS6

It looks like the editor doesn't work

I try the CS6 editor and works fine

Somebody knows if is there any issue in this sense

 

THX

 

Running AE 2015.3 in a Mac Mini late 2012, 2,3 i7, 16GB Ram, OSX 10.11.6

Viewing all 2143 articles
Browse latest View live


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