Skip to main content
Inspiring
April 13, 2016
Answered

Is it a good idea to add preset effects using presetEffects.xml?

  • April 13, 2016
  • 4 replies
  • 885 views

Hi

I'm currently working on a plugin using scriptUI.
One thing I'm doing is adding a control-null, which have a lot of expression controls.

My basic problem is I would like to sort these into groups, for better usability. The only way I have found to do that, is adding some snippets to presetEffects.xml. (please tell me if you know any other way)

This all works. So great. But now I'm thinking, is this really a good idea? My main concern is: Will they remain there? When the user updates to a newer version of AE will they be overwritten?

Is there any other trouble I should be aware of?

Thanks,
Jakob

This topic has been closed for replies.
Correct answer Alex White

If you wouldn't add any new effects into the null-controller, I think the best way to organize things is to create custom preset ( you can use this script ‌)

then store it as binary inside of your script and apply that preset.

4 replies

Inspiring
April 13, 2016

Thank you guys, got it working now.

Inspiring
April 13, 2016

Thank you both for quick answers.

So if I had the custom preset. How do I save that as a binary?

I have been looking in the tool guide, I'm not sure what to look for.

Alex White
Legend
April 13, 2016

You can use my snippet for that:

var myPan = new Window("palette",  undefined);

select = myPan.add("button", [0,0, 100,30], "Select file");

edittext = myPan.add("edittext", [0,0, 400,150], "", {multiline: true});

select.onClick = function(){

  

   var bin = "";

   

  var targetFile = File.openDialog("Import File");

 

  targetFile.open("r");

  targetFile.encoding = "BINARY";

  bin = targetFile.read();

  targetFile.close();

  bin = bin.toSource();

  bin = bin.substring(12, bin.length - 2);

   

edittext.text = bin.toString();   

   

    }

myPan.show();

myPan.center();

UQg
Legend
April 13, 2016

When a new version of AE is installed, it is naked, the presetEffects.xml file is the original one.

So I'd think it is more or less ok to use this feature as long as the script can "install" the preset by itself "in one click". Otherwise it can quickly become a mess. In particular, keeping the XML bit of code in a separate file to install by hand is a very bad idea i think.

To install the preset from the script itself, you'd need to write a bit of code that will find/open/read/close the preset file, parse an XML from it, then append a <Effect>... <Effect> entry in that XML corresponding to your own effect, then save file with the new XML content, including XML comments.

All the info needed to do that (File API, XML API) can be found in the JavaScript Tool Guide.pdf (the pdf which is common to all scriptable apps, not the After Effects one).

Xavier

UQg
Legend
April 13, 2016

All right, was too slow !

Alex White
Alex WhiteCorrect answer
Legend
April 13, 2016

If you wouldn't add any new effects into the null-controller, I think the best way to organize things is to create custom preset ( you can use this script ‌)

then store it as binary inside of your script and apply that preset.