Forum Replies Created
-
What seem to be the problem? The script works like you want it to as it is, except for adding break after addFolder *when you uncomment it):
alert("not found");
app.project.items.addFolder("CNM");
break;and fixing this:
i <= app.project.items.length; -
Oleg Pirogov
February 2, 2019 at 9:45 am in reply to: Retain relative position values while pick whipping two objects within a layer to other layersWhen you pick whip one position to another you get something like in expression window:
thisComp.layer("Shape Layer 1").content("Ellipse 1").transform.position;What you probably need is:
pos = thisComp.layer("Shape Layer 1").content("Ellipse 1").transform.position;
value + pos - pos.valueAtTime(CERTAIN_TIME_POINT);This captures relative change in parent-shape’s position and adds it to the child-shape’s position. That change is relative to a CERTAIN_TIME_POINT (in seconds) which you need to pick up. In the end it works like usual layer parenting.
-
This script substitutes one color for another in all feasible properties (like effects, shapes’ fill colors etc) in all comps and layers:
//converts a color channel from [0,1] range to hex string
function channelToHex(channel){
if (channel<0) return "00";
if (channel>1) return "FF";var channelInt = Math.round(channel*255);
var hex = channelInt.toString(16);
if (hex.length == 1) hex = "0" + hex;
return hex.toUpperCase();
}//recursive function to look for color properties; "path" variable is rudimental
function colorSearch(thePropertyGroup, path, targetColor, substituteColor){
for (var i=1; i<=thePropertyGroup.numProperties; i++){
currentProperty = thePropertyGroup.property(i);//checking, if it's a property and not a property group
if (currentProperty.propertyType == PropertyType.PROPERTY){
//checking, if it's a color property
if (currentProperty.propertyValueType == PropertyValueType.COLOR){
//checking, if color value equals the targetColor (8 bpc) or is its 8 bpc equivalent (16, 32 bpc)
if ([channelToHex(currentProperty.value[0]), channelToHex(currentProperty.value[1]), channelToHex(currentProperty.value[2])].join("") == targetColor){
try{
currentProperty.setValue(substituteColor);
}
//mostly for handling hidden color layers
catch(err){
}
}
}
}
else{
colorSearch(currentProperty, path+" -> "+currentProperty.name, targetColor, substituteColor);
}
}
}function main(){
//dialog window
var dialogWindow = new Window ("dialog", "Color Substitution");var targetColorGroup = dialogWindow.add("group");
targetColorGroup.alignment = "right";
targetColorGroup.add("statictext", undefined, "Target color:");var targetColorBoxGroup = targetColorGroup.add("group");
targetColorBoxGroup.spacing = 0;
targetColorBoxGroup.add("statictext", undefined, "#");
var targetColorHex = targetColorBoxGroup.add("edittext", undefined, "FFFFFF");var substitutionColorGroup = dialogWindow.add("group");
substitutionColorGroup.alignment = "right";
substitutionColorGroup.add("statictext", undefined, "Substitute with:");var substitutionColorBoxGroup = substitutionColorGroup.add("group");
substitutionColorBoxGroup.spacing = 0;
substitutionColorBoxGroup.add("statictext", undefined, "#");
var substitutionColorHex = substitutionColorBoxGroup.add("edittext", undefined, "0000FF");var buttonsGroup = dialogWindow.add("group");
buttonsGroup.add("button", undefined, "Ok");
buttonsGroup.add("button", undefined, "Cancel");var resp = dialogWindow.show();
if (resp == 2){
return;
}var prj = app.project;
//converts hex string to [r, g, b, a] color; a = 1
var hexToRGBa = function(hexColorText){
hex = parseInt(hexColorText, 16);
return [hex >> 16, hex >> 8 & 0xFF, hex & 0xFF, 255]/255;
}var targetColor = targetColorHex.text;
var substituteColor = hexToRGBa(substitutionColorHex.text);//searching in every comp...
for (i=1; i<=prj.numItems; i++){
if (prj.item(i).typeName == "Composition"){
currentComp = prj.item(i);//...and in every layer
for (j=1; j<=currentComp.layers.length; j++){
colorSearch(currentComp.layer(j), currentComp.layer(j).name, targetColor, substituteColor);
}
}
}}
main();
Works fine as far as I’ve tested it.
-
Turn on Collapse Transformations on your vector layer, it should make it behave as you want.
For further reference on how Set Matte works and why you came over this problem:
https://vimeo.com/274047695 -
To use AE’s cool text animating features you need those texts to be AE layers. This inevitably brings you to the second approach, as I see it.
-
Ok, here’s the deal:
The persistent bug somehow involves using sourceRectAtTime within Text Animator:

Even a dummy (sourceRectAtTime is simply assigned and not used afterward) usage of sourceRectAtTime within Text Animator leads to a bug. The result is actual text not shifting to the supposed position, while its bounding rectangle is.The bug is persistent: cache update (like cache cleaning or changing resolution) doesn’t fix it.
On the other hand, cache update help to clear cache artifacts left from this bug, like the one presented in the op post.
Here’s an example, if I delete the dummy line with sourceRectAtTime, the bug will still be observed for [-90, 0] value, but not for [-89, 0] or [-91,0]. This is a cache artifact: cache stores an err frame for [-90, 0] but not for [-89, 0] or [-91,0]. It can be eliminated by cache cleaning.
Long story short:
– apparently, there is a bug when using sourceRectAtTime withing some of text animators
– if sourceRectAtTime was deleted from animator expression but some bug-like effects stay, they can be eliminated with cache clearingI’ve encountered this bug while working with sourceRectAtTime and trying to locate the source of the bug, I’ve deleted most of my expression, which left me with cached err frame which I’ve reported in op post. That has led to a lot of confusion, sorry everyone.
-
Changing font works just like changing Resolution, changing text and clearing cache: sometimes it puts the text to the proper place, sometimes it doesn’t. So, i guess, bug works with any font.
It fills like the bug is somehow “cached” and when that “cached” info is refreshed in any way, the bug disappears.
One more observation. Before writing this post, I’ve opened all my bugged projects and the bug was gone from all of them. Then I’ve cleaned my cache (which was full of other projects’ data) and reopened the bugged files: the bug was there.
-
@ Dave LaRonde
Yes, that would be the best workaround.@ Richard Garabedain
But it’s not a 3D layer.@ Max Haller
Yes, it also renders with that error, that’s the most frustrating part.
Changing Fast Preview options hasn’t got me anything.That thing with Full->Quarter does’t always work. Sometimes the text moves to the right place at Quarter, sometimes it doesn’t. The same goes to cash clearing: sometimes it helps, sometimes doesn’t. By now I have half a dozen almost identical aep files in which this bug behaves differently.
I can’t figure out a pattern, it seems completely random. -
Oleg Pirogov
January 21, 2019 at 7:25 am in reply to: Sun Flare / Flaming effect in After Effects – identifying the one in this clipThat reminds me of this Andrew Kramer’s tutorial:
https://www.youtube.com/watch?v=stW3JNFCaJASome contents or functionalities here are not available due to your cookie preferences!This happens because the functionality/content marked as “Google Youtube” uses cookies that you choosed to keep disabled. In order to view this content or use this functionality, please enable cookies: click here to open your cookie preferences.
-
Oleg Pirogov
January 16, 2019 at 11:18 pm in reply to: Glow Effect and transparent background mechanicsAs for the final touch for the problem:
I used Add blending mode for a glow with black background instead of making a transparent background. And it was fine for me cause, well, I was blending it with another black bg. In different set ups Add blend (surely) won’t be a substitute for a transparent bg.
So here’s the actual workaround to get the transparent bg for a glowing object:
Duplicate the layer with a glow and set the black solid layer to track its Luma matter:

If an original layer with glow is put over such bg, it’s almost what it was supposed to be, except for it will be a bit less bright, so Glow Intensity of the dummy glow layer should be increased a bit.
