Page 1 of 3

Create a custom Control effect

Posted: October 16th, 2006, 8:16 am
by nab
Hi all,

I've found an 'easy' way to create a Control effect with multiple controls.
It's handy when you use expressions and don't want to add a different effect for each parameter.

These multiple control effects are called "pseudo" effects and they are used for presets animation;
a XML file (located in the \Support Files folder) contains a list of all pseudo effects with their description (type of control, default value, etc).
So here is the trick (screenshots to make it as clear as possible).

1. Locate the XML file "PresetEffects.xml" in your AE files, and make a copy (say "PresetEffects_backup.xml").


2. Open it ("PresetEffects.xml") with your favorite text editor. You'll see many "<Effect...>" tags, each one defines an effect as a combination of slider, checkbox,.., point, angle control. In my example, I was looking for an effect with 6 sliders so I've copied/pasted the (3) lines of the effect named "Separate XYZ Position" (on top of the list), renamed strings (parameter names in the interface) and adjusted default values and range.
[DO NOT modify the first line <Effect matchname=... !!, controls description only]
Then save the file and open After Effects 7.0.


3. Create a new comp, add a solid and apply the preset you chose (in my case "Separate XYZ Position"). This preset uses expressions but AE can't find the expected parameters so it sends an alert; click OK.


4. Your custom effect appears in the effect panel, rename it to whatever you want


5. Save it as a new animation preset.


6. You're done !

This custom effect can now be applied for example to a null layer in your expression-based animations.

note: this operation is far from perfect...these two effects (original and fake) has the same matchName; if you apply the original preset ("Separate XYZ Position"), the effect will now appear with 6 sliders (as defined in the XML file); via scripting, we'll use its name rather than the matchName.

There is no guarantee ("sunday's experiments") :).

Other example with different types of controls.


Posted: October 17th, 2006, 6:27 am
by bradshaw1965
nice sleuthing Nab!


Posted: October 21st, 2006, 3:39 am
by Paul Tuersley
Nab, thanks for posting this.

Rather than altering the existing "Separate XYZ Position' preset in PresetEffects.xml, you can create a new one with a unique name/matchname and then use a short script to apply it for the first time. I just modified the existing CineonAdjust.jsx script in the (demos) folder. Then save the resulting effect as an Anim Preset.

I guess it might be possible to write a script that modifies the PresetEffects.xml file automatically. For example, you apply a number of Expression Control effects to a layer, select them and run a "Merge to Custom Effect.jsx" script.

Paul T

Posted: October 24th, 2006, 4:14 pm
by nab
thanks for your comment.

I'm not sure to properly understand what you mean.
When you use the animation preset you've created the effect appears in the effects panel with the sliders (names) of the Cineon Converter effect, isnt'it ?
or can you set your own names for each slider with this method ? (without modifying the xml file as I did in my test)

Posted: October 24th, 2006, 4:30 pm
by Paul Tuersley
I was just saying that if you use a unique name and don't use the "Separate XYZ Position' preset, the only way to apply that effect is to use a script. So I modified the add cineon script to add my custom preset effect instead, then saved it as a preset.

Posted: October 25th, 2006, 1:32 pm
by nab
perfectly clear !
Thanks Paul, works like a charm.

I will try to write this "MergeToEffect" script next week-end.

Posted: October 30th, 2006, 9:06 pm
by nab
Here is my script : ... Effect.jsx

It's not exctaly a "Merge To Custom Effect" is more a "Effect Creator".
In fact you choose a name/matchName for your effect, the numbers of controls you want ( + their names) and the script will change the xml file accordingly.
The restriction is that AE doesn't seem to look at the PresetEffects.xml file dynamically, so you have to close and reopen the app in order to load the new parameters.
The script also creates a startup script to complete the procedure (applying the new effect to a solid).

Well, it's a bit experimental :)

Posted: January 11th, 2007, 10:41 am
by Shralldam

I discovered scripting and expressions a couple of months ago, and while I understand the basics I still need to understand a few points. I'm really happy to have found this forum.

Anyway, I read this post with interest, but I think I ran into an OS-specific problem: I work on a Mac, and I obviously use After Effects under Mac OS X.

The fact is that, on the Mac, the PresetEffects.xml file you're talking about is not located in a folder called "Support Files", but it is embedded in the application itself. On Mac OS X, think of applications as special folders that contain everything needed to run the software, but appear as a single file not clearly showing it contains tons of other files (if you see what I mean).

In other words, it means that any tool other than AE itself can't tell where is this file!

Here's an example: if I'm in an application and choose "File > Open...", I can navigate through my hard disk and pick a file stored anywhere, as long as it is "external". But, when I click on an application, I can't open it because the system assumes it's a single file, although it is structured like a folder. Think of a ZIP archive without the compression: it is seen by the OS as a single file, but without a special tool, you can't tell what's inside.

So, what's the "path" to this file under Mac OS X? I tried to reproduce the Windows method by creating a Support Files folder manually inside After Effect's folder, and by dropping a copy of the .xml file in this folder, but after trying the script, nothing was modified, in the original PresetEffects.xml file (contained in the application) as well as in the copy (in the manually created Support Files folder).

I guess I need to open the script and modify the path used, but I don't know if it will work.

Have some Mac users here have encountered the same issue?

Thanks in advance!

P.S. : I'm not a native English speaker, I hope I made myself clear in the lines above ;-)

Posted: January 12th, 2007, 11:22 am
by bradshaw1965
Shralldam wrote:So, what's the "path" to this file under Mac OS X?
Hey Shrallldam,

I don't have time to test this right now but the path is

Code: Select all

/Applications/Adobe\ After\ Effects\ 7.0/Adobe\ After\ Effects\

Posted: January 13th, 2007, 4:45 am
by Shralldam
Guess what? It worked!

Thank you very much for the tip! I did the same thing but without the "\" character before spaces in the names (and I got no results). With your suggestion it worked perfectly, I just needed to add the volume where AE is installed.

Then, if you have AE installed anywhere but on the startup disk like me, you can try this:

Code: Select all

/Volumes/Name_of_your_disk/Applications_or_your_host_folder/Adobe\ After\ Effects\ 7.0/Adobe\ After\ Effects\
Thanks again for the help, I wasn't aware of the "\" trick! And thank you for the wonderful script too, nab!

Posted: January 14th, 2007, 9:35 am
by bradshaw1965
Shralldam wrote:Thanks again for the help, I wasn't aware of the "" trick! And thank you for the wonderful script too, nab!

Glad it worked for you. The \ character escapes the next character in Unix, so you can use the next character as a literal instead of feeding it to the command interpreter, otherwise the space is interpreted as a command or a switch.

Posted: June 4th, 2007, 7:48 am
by Lord Scales
Hi there! I was looking for something like this, and I found it very useful!
I always modified the effects in .xml file, but if I added for example a Color control to Separate XYZ, in other computer it wouldn't appear.

But I've got a problem with the script. I click in Create and nothing happens. I am with "Allow Scripts to..." activated, but even this way it doesn't work.

This is my screen (it is just a test):

I think I am doing the wrong in matchName and name. What I have is the version 2 of my Lightning preset, which is in C:\Arquivos de programas\Adobe\Adobe After Effects 7.0\Support Files\Presets\My Presets, and it's name is Lightning v2.0.

So, if anyone could help me, I thank very much!

Posted: June 4th, 2007, 2:10 pm
by Lord Scales
Forget, hehe
I did what Paul said, with Cineon Adjust and it worked very nice. Thanks Paul and nab!

Posted: September 14th, 2007, 9:19 am
by Shralldam
I discovered that if there are spaces in the matchname, the script doesn't function. Without spaces, it works.

Re: Create a custom Control effect

Posted: February 23rd, 2008, 10:55 pm
by explorer
Hey.... I have some questions about Mac's paths and I hope someone could help me out.

Is there something like "Browse for folder" dialog on a Mac?
If there is what would be a path returned by that dialog look like if one would navigate to the AE instal dir?

I'm writing a cross-platform app to deal with some stuff in AE, and I just need to sort this issue out,
and I don't have a Mac to test this on my own.

could someone please help me on this?