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

The progress bar is updated only after the end of the cycle. Help, please!

$
0
0

I added to the bar element, the Progressbar. It works, all is well.

 

One of the functions has a loop, like

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

myProgressBar.value = (i+1)*(100/myArray.length);

}

When the panel is opened and script is executed, the value of the progress bar is zero after the loop ends, the value of the progress bar from 100.

I also tried adding alert(""); for each iteration of the loop, then the value of the progress bar with each step of the cycle is updated. What could be wrong?

  1. Thank You!

Access / Change Fill Effect Color from ExtendScript

$
0
0

Hey all,

 

This may be a pretty simple answer but I'm new to scripting, and I have a layer with the effect "Fill" and I would like to change the color value in my script.  Am I not accessing the effect correctly or I am putting in the wrong value?

 

app.project.item("Controls").layers("Colors").effect("Fill")(3) == '#ffffff';

 

So the comp is called "Controls", it has a solid inside it called "Colors" and the effect is "Fill".  I am trying to change it to white.

Thanks in advance!

 

 

 

batch render with substituted images

$
0
0

So I am totally newbee. Sorry about that.

 

I have a project in AE which has a IMAGE1.PNG sliding in from left and IMAGE2.PNG sliding in from right.

I need to make 600 of there animation files. But each of those 600 has a different IMAGE1 and IMAGE2, but they are all the same format/size.

These images are team (soccer) emblems.


I am looking for a solution (a hint) where I can take my project and render it. Then substitute IMAGE1 and IMAGE2 and render it again. And so forth.

Its perfectly alright with a external file to tell it what to render:

 

team1.png, team2.png

team1.png, team3.png

team1.png, team4.png

and so forth...

 

I hope it makes sense - and also that I am in the right forum

 

Sincerely,

Henrik

update statictext in dockable palette?

$
0
0

This seems rudimentary but I've spent several days now searching forums, guides, and other jsx scripts and come up empty:

 

I have a dockable palette that contains some labels that I'd like to update via a Refresh button. I'm using StaticText, which seemed like the logical choice, but I can't find a method to update the text. Is this possible?

 

Thank you!

Find project item given folder and name.

$
0
0

Suppose I have a comp with a layer containing apple.png. Now I would like to replace it with orange.png. To call replaceSource(), I need to supply it with newSource item:

 

app.project.item(index).layer(index).replaceSource (newSource, fixExpressions)

 

 

My newbee question is how to navigate to orange.png if my project structure looks like this:

 

- Comps

- Solids

- Pictures

-- fruit

---apple.png

---orange.png

---lemon.png

 

I guess that looping through all project items and checking item name would work, but is there a more intelligent way to do that?

Refresh Disabled

$
0
0

Hi everyone!

 

Quick question, I have a script that does a lot of tasks such as importing, replacing and switching layers on and off, if refresh is not disabled (Caps Lock Button is off), when running the script it goes very slow, but if the Caps Button is on, it is amazingly quick. I wanted to know if there is a way to turn on and off the 'refresh disabled' option through script, so that the user does not have to do it manually every time?

 

Thanks!!

 

Fabio

selecting render queue items via script

$
0
0

Hi

i'm looking for a way to select items in the render queue via script.

i'm creating a listBox that contains all the RQ items ( i need to list them in a simpler way then the RQ window, and i'm keeping the index number of each item), and i want to select from that list items and select them in the RQ.

ideas?

thanks

Dror

 

 try{    
function createUserInterface (thisObj,userInterfaceString,scriptName){            var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", scriptName,                                        undefined,{resizeable: true});            if (pal == null) return pal;                       var UI=pal.add(userInterfaceString);                       pal.layout.layout(true);            pal.layout.resize();            pal.onResizing = pal.onResize = function () {                                                            this.layout.resize();                                                            }            if ((pal != null) && (pal instanceof Window)) {                    pal.show();            }    return UI;
};






{var res ="group {orientation:'column',\
                                    alignment:['fill','fill'],\                                    alignChildren:['fill','top'],\                                    folderPathListbox:ListBox{\                                                        alignment:['fill','fill'],\                                                        properties:{\                                                        multiline:true,\                                                        multiselect:true,\                                                        numberOfColumns:6,\                                                        showHeaders:true,\                                                        columnTitles: ['#','OM','Date','Time', 'Comp Name', 'Render Path']}\                                                        },\                                    buttonGroup:Group{orientation:'row',\                                                            alignment:['fill','bottom']\                                                            alignChildren:['fill','bottom'],\                                                            buttonPanel: Panel{\                                                                                    text:'Actions',\                                                                                    orientation: 'row',\                                                                                     alignment:['fill','bottom']\                                                                                    refButton: Button{text:'Refresh'}\                                                                                    dupButton: Button{text:'Duplicate'}\                                                                                    selButton: Button{text:'Select in RQ'}\                                                                                    expButton: Button{text:'Export'}\                                                                                }\                                                            searchPanel: Panel{\                                                                                    text:'Search',\                                                                                    orientation: 'row',\                                                                                    searchBox: EditText{text:'search by fileName'},\                                                                                    searchButton: Button{text:'Search'},    \                                                                                }\                                                            }\                    }";                       
}
function listRQ (rqList){    try{            var folderPathListbox = rqList;            var proj = app.project;            var totalRenderQ = proj.renderQueue.numItems;            for(var i= 1; i<=totalRenderQ;  i++){                    var totalOM= proj.renderQueue.item(i).numOutputModules;                     for (var om= 1; om<=totalOM; om++){                                    var dateList, timeList, curItem;                                    if (proj.renderQueue.item(i).startTime != null){                                                var min = proj.renderQueue.item(i).startTime.getMinutes() <10 ? "0"+ proj.renderQueue.item(i).startTime.getMinutes() : proj.renderQueue.item(i).startTime.getMinutes();                                                var year = proj.renderQueue.item(i).startTime.getFullYear().toString().substr (-2,2);                                                timeList = (proj.renderQueue.item(i).startTime.getHours()-1)+":" + min;                                                dateList =proj.renderQueue.item(i).startTime.getDate()+"/"+(proj.renderQueue.item(i).startTime.getMonth()+1)+"/"+year ;                                    }else{                                                 dateList = "not ";                                            timeList = "rendered";                                        }                                    curItem = folderPathListbox.add ('item', i );                              // Column 1                                    curItem.subItems[0].text = om;                                               // Column 2                                    curItem.subItems[1].text = dateList.toString();                          // Column 3                                    curItem.subItems[2].text = timeList.toString();                          // Column 4                                    curItem.subItems[3].text = proj.renderQueue.item(i).comp.name; // Column 5                                    curItem.subItems[4].text = proj.renderQueue.item(i).outputModule(om).file.toString().replace(new RegExp(",","g"), "\r").replace(new RegExp("%20","g"), " ").replace(new RegExp("%5B","g"), "[").replace(new RegExp("%5D","g"), "]"); // Column 6                                   }            }          }catch(err){alert(err)}    return folderPathListbox;    }


var UI = createUserInterface(this,res,"Better RQ");
var myList = UI.folderPathListbox;
var lsRq = listRQ(myList);
//~ alert(lsRq.toString());


{ // buttons action
UI.buttonGroup.buttonPanel.refButton.onClick = function () {
                                                    lsRq.removeAll();                                                    listRQ(myList);                                                    writeLn("all done");                                                    }
UI.buttonGroup.buttonPanel.dupButton.onClick = function () {                                                    var lstSlct = new Array ;                                                    lstSlct = myList.selection;                                                    if ( lstSlct != null){                                                        var totalDup = lstSlct.length;                                                        for (var i= 0; i<totalDup;  i++){                                                                var lsId = lstSlct[i].toString();                                                                var dup =  parseInt(lsId);                                                                app.project.renderQueue.item(dup).duplicate();                                                                writeLn("duplicated #"+dup);                                                            }                                                      }else{                                                        alert ("select Something");                                                       }                                                                                                       }
UI.buttonGroup.buttonPanel.selButton.onClick = function () {                                                                        app.project.renderQueue.showWindow(true) ; //shows the RQ                                                                        alert ("selButton");    }
UI.buttonGroup.buttonPanel.expButton.onClick = function () {                                                                                       // var  compName = myList.                                                                                                              alert ("expButton");    }
}




}
catch(err){
    alert ("Error at line # " + err.line.toString() + "\r" + err.toString());    }

insert color into color range effect

$
0
0

I am trying to add the color range effect to a layer, and set the color value for it. I tried

 

var theEffect = selected[0].property("ADBE Effect Parade").addProperty("Color Range");

theEffect.property('Preview').setValue(color);

 

I get an error that there is no set value available for the parameter.  Is there any way to update this effect through scripting?


TimeSpan Duration Scripting error

$
0
0

Hello everyone

 

I'm getting a weird error from my script. Everything is working perfect besides when I attempt to create a custom timespan to render a single frame to a PNG. I am receiving the following error:

 

     After Effects error: Value 0.03 out of range 0.03 to 71654440

 

I originally hardcoded a variable. For example:

 

     var x = 0.033

 

This produced the same error. I then tried to use 0.34 and discovered anything above the actual number I need it renders 2 frames. Next idea was to use the following functions:

 

function setTimeSpan (startTime) {

        for (var i = 1; i <= app.project.renderQueue.numItems; i++) {

                app.project.renderQueue.item(i).timeSpanStart = startTime;

                app.project.renderQueue.item(i).timeSpanDuration = this.duration;

            }

    }

 

 

 

 

function frameDuration () {

        this.duration = this.pointer.frameDuration;

    }

 

The first function I used in the first attempts, but instead of this.duration I used the hardcoded variable. The second function I added to set my object's property 'duration' to this.pointer.frameDuration. (this.pointer = app.project.item(whichever comp it's currently on) )

 

I'm honestly stumped... is there a way to just use timecode in extendscript? Any help would be greatly appreciated!

 

 

 

Garrett

list in tabbed panel won't fill on resize

$
0
0

hi

i'm getting weird results when i try to resize my panel, i have 2 tabbed panels, each containing a list, they show nice initially, but when i try to resize the panel they act weird, i have to resize vert/ horz to make them fill the space again, but in my lower panel (that also contains  list) the behavior it perfect, is it a bug with the tabbed panel? did i miss something on the way?

any help will be appreciated

thanks

D

 

 

 

    

function createUserInterface (thisObj,userInterfaceString,scriptName){            var pal = (thisObj instanceof Panel) ? thisObj : new Window("palette", scriptName,                                        undefined,{resizeable: true});            if (pal == null) return pal;                       var UI=pal.add(userInterfaceString);                       pal.layout.layout(true);            pal.layout.resize();            pal.onResizing = pal.onResize = function () {                                                            this.layout.resize();                                                            }            if ((pal != null) && (pal instanceof Window)) {                    pal.show();            }    return UI;
};






{var res ="group {orientation:'column',\
                                    alignment:['fill','fill'],\                                    alignChildren:['fill','fill'],\                                    listPanel:Panel{type:'tabbedpanel', alignment:['fill','fill'], alignChildren:['fill','fill'],\                                        rqList:Panel{type:'tab', text:'All', alignment:['fill','fill'], alignChildren:['fill','fill'],  \                                                    folderPathListbox:ListBox{ \                                                                        properties:{ multiline:true, multiselect:true, numberOfColumns:6, showHeaders:true,\                                                                        columnTitles: ['#','OM','Date','Time', 'Comp Name', 'Render Path']}\                                                                        },\                                            }\                                        resultsList:Panel{type:'tab', text:'Results', alignment:['fill','fill'], alignChildren:['fill','fill'],\                                                            resultsListbox:ListBox{ \                                                                        properties:{ multiline:true, multiselect:true, numberOfColumns:6, showHeaders:true,\                                                                        columnTitles: ['#','OM','Date','Time', 'Comp Name', 'Render Path']}\                                                                        },\                                            }\                                        }\                                    buttonGroup:Group{orientation:'row',\                                                            alignment:['fill','bottom']\                                                            alignChildren:['fill','top'],\                                                            buttonPanel: Panel{ text:'Actions', orientation: 'column',alignment:['left','bottom']\                                                                                    refButton: Button{text:'Refresh'}\                                                                                    dupButton: Button{text:'Duplicate'}\                                                                                    delButton: Button{text:'Delete'}\                                                                                }\                                                            searchPanel: Panel{\                                                                                    text:'Search', orientation: 'column',alignment:['left','fill']alignChildren:['left','fill'],\                                                                                    searchBox: EditText{text:'use & to search 2 values', characters: 20},\                                                                                    typeGrp: Group{orientation:'row',\                                                                                                        searchDate: RadioButton{text:'Date'}\                                                                                                        searchComp: RadioButton{text:'Comp'}\                                                                                                        searchFile: RadioButton{text:'Path'}\                                                                                                        }\                                                                                    buttonGrp: Group{orientation:'row',\                                                                                                    searchButton: Button{text:'Search', alignment:['right','fill']},    \                                                                                                    clearListButton: Button{text:'Clear Results',alignment:['right','fill'] }\                                                                                    }\                                                                                }\                                                            textPanel: Panel{\                                                                                    text:'Search results', orientation: 'column', alignment:['fill','fill'], alignChildren:['fill','fill'],\                                                                                    searchRes: ListBox{\                                                                                                                alignment:['fill','fill'], properties:{ multiline:true, numberOfColumns:2, showHeaders:true,\                                                                                                                columnTitles: ['searched','Found in RQ #']}\                                                                                                                },\                                                                                    }\                                                            }\                    }";                       
}
function listRQ (rqList){    try{            var folderPathListbox = rqList;            var proj = app.project;            var totalRenderQ = proj.renderQueue.numItems;            for(var i= 1; i<=totalRenderQ;  i++){                    var totalOM= proj.renderQueue.item(i).numOutputModules;                     for (var om= 1; om<=totalOM; om++){                                    var dateList, timeList, curItem, outputs;                                    if (totalOM == 1){                                        outputs = "";                                        }else{                                            outputs = om;                                            }                                    if (proj.renderQueue.item(i).startTime != null){                                                var min = proj.renderQueue.item(i).startTime.getMinutes() <10 ? "0"+ proj.renderQueue.item(i).startTime.getMinutes() : proj.renderQueue.item(i).startTime.getMinutes();                                                var year = proj.renderQueue.item(i).startTime.getFullYear().toString().substr (-2,2);                                                timeList = (proj.renderQueue.item(i).startTime.getHours())+":" + min;                                                dateList =proj.renderQueue.item(i).startTime.getDate()+"/"+(proj.renderQueue.item(i).startTime.getMonth()+1)+"/"+year ;                                    }else{                                                 dateList = "not ";                                            timeList = "rendered";                                        }                                    curItem = folderPathListbox.add ('item', i );                              // Column 1                                    curItem.subItems[0].text = outputs;                                        // Column 2                                    curItem.subItems[1].text = dateList.toString();                          // Column 3                                    curItem.subItems[2].text = timeList.toString();                          // Column 4                                    curItem.subItems[3].text = proj.renderQueue.item(i).comp.name; // Column 5                                    curItem.subItems[4].text = proj.renderQueue.item(i).outputModule(om).file ==null ?  "Not yet specified" : proj.renderQueue.item(i).outputModule(om).file.toString().replace(new RegExp(",","g"), "\r").replace(new RegExp("%20","g"), " ").replace(new RegExp("%5B","g"), "[").replace(new RegExp("%5D","g"), "]"); // Column 6                                   }            }          }catch(err){alert(err)}    return folderPathListbox;    }
var UI = createUserInterface(this,res,"List Render Queue");
var myList = UI.listPanel.rqList.folderPathListbox;
var lsRq = listRQ(myList);

{ // buttons action
UI.buttonGroup.buttonPanel.refButton.onClick = function () {
                                                    lsRq.removeAll();                                                    listRQ(myList);                                                    writeLn("all done");                                                    }
UI.buttonGroup.buttonPanel.dupButton.onClick = function () {                                                    var lstSlct = new Array() ;                                                    var rqId = new Array();                                                    lstSlct = myList.selection;                                                    totalSelect = lstSlct.length;                                                    if ( lstSlct != null){                                                        try{                                                            for (var j = 0; j<totalSelect; j++ ){                                                                if(j+1 != totalSelect){                                                                    if (lstSlct[j].toString() !=lstSlct[j+1].toString() ){                                                                        rqId[rqId.length] = lstSlct[j].toString();                                                                        }                                                                    }else{                                                                        rqId[rqId.length] = lstSlct[j].toString();                                                                        }                                                                }                                                            }catch (err){                                                                 //nothing                                                                }                                                                                                                   var totalDup = rqId.length;                                                        for (var i= 0; i<totalDup;  i++){                                                                var dup = parseInt(rqId[i]);                                                                app.project.renderQueue.item(dup).duplicate();                                                                writeLn("duplicated #"+dup.toString());                                                            }                                                      }else{                                                        alert ("select Something");                                                       }                                                    lsRq.removeAll();                                                    listRQ(myList);                                                    }

UI.buttonGroup.buttonPanel.delButton.onClick = function () {
                                                    var lstSlct = new Array() ;                                                    var rqId = new Array();                                                    lstSlct = myList.selection;                                                    totalSelect = lstSlct.length;                                                    if ( lstSlct != null){                                                        try{                                                            for (var j = 0; j<totalSelect; j++ ){                                                                if(j+1 != totalSelect){                                                                    if (lstSlct[j].toString() !=lstSlct[j+1].toString() ){                                                                        rqId[rqId.length] = lstSlct[j].toString();                                                                        }                                                                    }else{                                                                        rqId[rqId.length] = lstSlct[j].toString();                                                                        }                                                                }                                                            }catch (err){                                                                //nothing                                                                }                                                        var totalDel = rqId.length;                                                        var rqIdDel = new Array ();                                                        rqIdDel = rqId.sort(function(a, b){return b-a});                                                        for (var i= 0; i<totalDel;  i++){                                                                var del = parseInt(rqIdDel[i]);                                                                app.project.renderQueue.item(del).remove();                                                                writeLn("Deleted #"+del.toString());                                                            }                                                      }else{                                                        alert ("select Something");                                                       }                                                    lsRq.removeAll();                                                    listRQ(myList);    }// end function

UI.buttonGroup.searchPanel.buttonGrp.searchButton.onClick = function () {
                                                                                       lsRq.removeAll();                                                                                       listRQ(myList);                                                                                       var searchtxt = UI.buttonGroup.searchPanel.searchBox.text.toLowerCase().toString();                                                                                       var listLength = myList.items.length;                                                                                       var found = new Array;                                                                                       var radioBtn = UI.buttonGroup.searchPanel.typeGrp;                                                                                       var and = "&";                                                                                       var searchLst = UI.buttonGroup.textPanel.searchRes;                                                                                                                                                                             if(radioBtn.searchFile.value == false && radioBtn.searchComp.value == false && radioBtn.searchDate.value == false) {                                                                                                alert ("select search type");                                                                                        }else{                                                                                            resList = searchLst.add ('item', searchtxt,0);                                                                                            for (var i = 0; i < listLength; i++){                                                                                                    var dateCol = myList.items[i].subItems[1].text.toLowerCase().toString();                                                                                                    var compCol = myList.items[i].subItems[3].text.toLowerCase().toString();                                                                                                    var fileNameCol = myList.items[i].subItems[4].text.toLowerCase().toString();                                                                                                    var searchType;                                                                                                    if (radioBtn.searchDate.value == true){                                                                                                        searchType = dateCol;                                                                                                        }                                                                                                    if (radioBtn.searchComp.value == true){                                                                                                        searchType = compCol;                                                                                                        }                                                                                                    if (radioBtn.searchFile.value == true){                                                                                                        searchType = fileNameCol;                                                                                                        }                                                                                                 if (searchtxt.match(and) == and){                                                                                                     searchtxtAry = searchtxt.split(" & ");                                                                                                     if(searchType.match(searchtxtAry[0])==searchtxtAry[0] && searchType.match(searchtxtAry[1])==searchtxtAry[1] ){                                                                                                        var rqId = myList.items[i].text;                                                                                                        var curFound =  "render queue #"+ rqId;                                                                                                        if (curFound != found[found.length-1]){                                                                                                            found[found.length] = rqId;                                                                                                            }                                                                                                         }                                                                                                 }else{                                                                                                    if (searchType.match(searchtxt) == searchtxt){                                                                                                        var rqId = myList.items[i].text;                                                                                                        var curFound =  "render queue #"+ rqId;                                                                                                        if (curFound != found[found.length-1]){                                                                                                            found[found.length] = rqId;                                                                                                            }                                                                                                        } //if search match end                                                                                                    }//else "and" end                                                                                                } //for loop end                                                                                            if (found.length >0){                                                                                                try{                                                                                                    var newFound = new Array();                                                                                                        for (var j = 0; j<found.length; j++ ){                                                                                                            if(j+1 != found.length){                                                                                                                if (found[j].toString() !=found[j+1].toString() ){                                                                                                                    newFound[newFound.length] = found[j].toString();                                                                                                                    }                                                                                                                }else{                                                                                                                    newFound[newFound.length] = found[j].toString();                                                                                                                    }                                                                                                            }                                                                                                }catch (err){                                                                                                     //nothing                                                                                                    }                                                                                                                                                                                               resList.subItems[0].text =  newFound.toString();                                                                                                                                                                                                                                                                                        }else{                                                                                                resList.subItems[0].text =  "nothing found";
//~                                                                                                 alert("not found");                                                                                                }                                                                                                                                                                                       }//else end                                                                                                  }// searchPanel.searchButton function end

UI.buttonGroup.searchPanel.buttonGrp.clearListButton.onClick = function (){
    UI.buttonGroup.textPanel.searchRes.removeAll();    }
} //button section End

FYI: 'aftereffects' variable no longer defined in CC2015.3

$
0
0

So, this update caused a bit of a surprise for me, with my users suddenly reporting errors like "aftereffects is undefined". Turns out, with this update Adobe does not set the global 'aftereffects' variable any more (I used it to check for version numbers).

 

So make sure to check for its existence and fall back to app.version or something otherwise...

obj.watch() and app object model

$
0
0

I'm following up on this question:

https://forums.adobe.com/message/3744139#3744139

 

Basically, Extendscript supports a "watch()" function that lets you bind a callback to whenever a property changes on an object.  It works on objects you create, but does not appear to work on objects in the app... object tree.

 

Is there anyway to bind a callback to a property changing in the object model?  I'm looking to run a script whenever the active item changes...

 

Thanks

Dan Sully

[Moved from the general AE forum to After Effects Scripting - MOD]

aerender currently open project

$
0
0

Hi guys, this is the first time I am trying to do this and not sure what I might be doing wrong...

 

I would like to use the aerender engine to render a project but using a path inside a variable instead of writting the path right inside the callSystem().

 

So, when I do:

system.callSystem('osascript -e \'tell\ application\ "Terminal"\ to\ do\ script\ [\"time\ command\ /Applications/Adobe\\\\ After\\\\ Effects\\\\ CC\\\\ 2014/aerender -project ~/Desktop/DESKTOP/delete/Untitled\\\\ Project.aep\"]\'');

 

Works great, it opens terminal and renders.

 

When I try the same thing, but using app.project.file as the project to render, After Effects freezes.. Not sure if Im typing something incorrectly.

var f = app.project.file;
var h = f.toString().replace(new RegExp("%20", "g"), "\\\\\\\\ ");
var cmd = "'osascript -e \\'tell\\ application\\ \"Terminal\"\\ to\\ do\\ script\\ [\\\"time\\ command\\ /Applications/Adobe\\\\\\\\ After\\\\\\\\ Effects\\\\\\\\ CC\\\\\\\\ 2014/aerender -project "
var loc = cmd+h+"\\\"]\\'');"
var fileToRender = (loc);


system.callSystem(fileToRender);


 

 

How can I use aerender to do a filepath in a variable or just use app.project.file?

 

Thanks for the help!

The Position of The Top Left Corner of Any Shape Layer

$
0
0

Hi there guys,

 

So for the last couple of days I've been working on a script that would allow me to center X number of layers to middle of the containing comp, just like if the selected layers were just one layer. So my approach to achieve that is first to know the positions of each layer's four corners. My code so far is working perfectly with AVLayers and TextLayers, however it doesn't always work with ShapeLayers. Here is the formula I'm using to calculate the position of the top left corner of shape layers:

 

x = position[x] - anchorPoint[x] - (layerWidth / 2)

y = position[y] - anchorPoint[y] - (layerHeight / 2)

 

So the formula assumes the anchor point is on the middle of the shape layer if the anchor point is [0, 0], and that seems incorrect.

 

Untitled2.png

And this is the layer's properties.

Untitled.png

So the question is, what is the way to calculate the position of the top left corner of ANY shape layer?

 

Thank you so much!

how best to deal with changed maskMode values ?

$
0
0

hi People

 

I've just discovered that the enumerated values for maskModes have changed between CC14 and CC15 which has broken most of my masking scripts.

i.e MaskMode.ADD in CC14 has the value 6413 but in CC15 it is 6813.

 

what's the best way to deal with this ? is there a simple workaround or do I have to check the version of AE that is being used and adjust from there ?

is there a direct way to access the name  i.e "MaskMode.ADD" instead of the value ?

 

thanks../JL


Create Shape Layer with Script in After Effects

$
0
0

I wrote a simple script for After Effects and it works well but there is a weird problem.

 

My script creates a shape layer which includes group, ellipse path, stroke and fill. Why does the "Group 1" have "Material Options: Group 1" property group? It's empty and it disappers when I click on its eyeball button. I don't want to display the property group. It seems like this problem doesn't happen on CS5.

 

Are there any solutions to avoid this? Is this a AE CC bug?

 

 

OS: Windows8.1

After Effects: version 12.2.1.5

 

 

 

Here's my script code.

 

app.beginUndoGroup("Add new shape layer");

 var curComp = app.project.activeItem;

 if(curComp){ var shapeLayer = curComp.layers.addShape();
 var shapeGroup = shapeLayer.property("Contents").addProperty("ADBE Vector Group");
 shapeGroup.property("Contents").addProperty("ADBE Vector Shape - Ellipse");
 shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Stroke");
 shapeGroup.property("Contents").addProperty("ADBE Vector Graphic - Fill");
 }

app.endUndoGroup();

weirdMaterialOptions.jpg

sampleImage not registering color RGBA when you scale or rotate solids

$
0
0

So when I try and capture an RGBA value using sampleImage it works great for shape layers and solids sometimes.  When solids are scaled or rotated sampledImage only outputs RGBA values when sampling pixels within the original scale factor ie 100%. So if I create a 100px X 100px solid and put a text expression to sample the images RGBA value it works perfectly at a given samplePoint within the original dimensions, if I scale that same layer it only registers RGBA values for pixels within the original 100px X 100px and nothing outside of that. Help please!

 

To recreate this bug:

Create a null named ColorPicker

Clear a Point Controller on the null you just created and call it ColorPicker as well

Create a solid

Place the null on the top right corner of the solid

create a text layer and put this expression in the source text

 

targetLayer=thisComp.layer("ScaleMe")

samplePoint = thisComp.layer("ColorPicker").effect("ColorPicker")("Point");

            sampleRadius = [.5,.5];

            sampledColor_8bpc =targetLayer.sampleImage(samplePoint, sampleRadius, false);

            R = sampledColor_8bpc[0];

      G = sampledColor_8bpc[1];

            B = sampledColor_8bpc[2];

            A = sampledColor_8bpc[3];

[R,G,B,A]

 

Drag the point controller over the solid and see the RGBA value update in the text layer.

Now scale the solid and see how it olly samples from the original size not the new pixels being drawn due to scaling.

 

is this a bug?

 

 

 

Replace rectangle with an image.

$
0
0

What would be an easy way to programmatically replace a rectangle (either a solid or a shape) with an image? I'm assuming that the image has the same aspect ratio as the initial rectangle. Thanks!

extendscript app crash on preferences panel when clicking on colors and fonts sub menu

$
0
0

hello there,

I'm newbie to After effects scripting.

i'm using AE cc2015 with extend script app (osX el captain).

here is my problem :

when i try to change font size in preferences panel,

the app crashes when i click on colors and fonts submenu (in preferences panel).

Are there some tips to correct this trouble ?

Is there a pro that can help me on this ?

 

Regards

Changing the centerpoint for addlight

$
0
0

Using this example code:

 

 

app.project.item(index).layers.addLight(name, centerPoint)

 

 

I created the following test code where I add a light to my second scene (composition) in my project to create a shadow:

 

 

var s2light1 = scene2.layers.addLight("s2light1", [1143,121]);

 

 

This works perfectly. But I now also want to set the 3rd (Z) value for the centerPoint in Extendscript (as is possible in After Effects).

 

 

However according to the After Effects CS6 scripting guide it seems you can only set the X and Y values: "The center of the new camera, a floating-point array [x, y]. This is used to set the initial x and y values of the new camera’s Point of Interest property. The z value is set to 0." Is there another approach or work around to set the Z-value for the center point in Extendscript which I can try?

 

Many thanks.

Daviti Gokadze

Homepage: wings.io

 

Viewing all 2143 articles
Browse latest View live


Latest Images

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