Skip to content

Commit 0b18837

Browse files
committed
Presets need full path to file now
1 parent 25c23a7 commit 0b18837

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

lib/src/after-effects-environment.js

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -426,20 +426,21 @@ pub.isShape = function (layer) {
426426
* @category Baffects.js
427427
* @method addPreset
428428
* @param {Properties} layer Object or AVLayer to add preset to
429-
* @param {String} name Name of the preset to add to layer
430-
*@returnss {Object} Object hierarchy containing all properties of each effect. For every effect it returns an object with attributes names without spaces and lower case. (Ej. "fx.fill.color" To get the property "Effects/Fill/Color").
429+
* @param {String} name Full path to preset
430+
*@returns {Object} Object hierarchy containing all properties of each effect. For every effect it returns an object with attributes names without spaces and lower case. (Ej. "fx.fill.color" To get the property "Effects/Fill/Color").
431431
*/
432432
pub.addPreset = function (layer, name) {
433433
if (!validateLayer(layer))
434434
layer = layer.layer;
435435

436-
var osPath;
437-
if (system.osName == "MacOS")
438-
osPath = Folder.startup.parent.parent.parent.fsName + "/Presets/";
439-
else
440-
osPath = Folder.startup.fsName + encodeURI("/Presets/");
436+
// March 12, 2021 | Adobe changed preset folder for Windows and macOS, it needs full path name now
437+
// var osPath;
438+
// if (system.osName == "MacOS")
439+
// osPath = Folder.startup.parent.parent.parent.fsName + "/Presets/";
440+
// else
441+
// osPath = Folder.startup.fsName + encodeURI("/Presets/");
441442

442-
var file = new File(osPath + name + ".ffx");
443+
var file = new File(name);
443444

444445
var preset = layer.applyPreset(file);
445446

0 commit comments

Comments
 (0)