"Click" Buttons in Duik in a Script
Posted: Wed Aug 28, 2019 12:04 pm
Hi everyone!
TLTR: I'm looking for a way to "click Duik buttons" with a jsx script.
At the moment I work on creating a custom macro keyboard for use with AfterEffects and of course Duik.
My knowlegde of extendscript is limited, though I figured out that I can use DuAEF to include/reproduce Duik functionality in my script.
For example I have a key to create a spine structure. I want to mimic Duik's behaviour as close as possible, so I dug a bit into the code and basically tried to copy the code for what Duik does when creating a spine.
Here's my solution so far:
While this 'kinda works', the original function is more sophisticated, and takes into consideration spine options and other stuff. Also if the code changed with a new release I would have to manually update every function I create this way to reflect the changes.
So what (I think) I'm looking for is a way to call for example
inside the active duik panel and have it do its thing while respecting the corresponding settings.
Any insight on how this could be achieved is highly appreciated.
PS: I have another plugin (SortIt by EyeDesyn) that allows to execute functionality via a keyboard shortcut. There is one .jsx file per shortcut (and the shortcut gets added in AE to execute the corresponding script). Each .jsx contains only a few lines of code like this:
To my understanding the "targetengine" allows the script to have access to the same variables and objects as the main script that has the panel and functionality. Unfortunately I haven't figured out how the "action side" of this works since the main script is in binary format.
Maybe if I figured out how it works for this plugin it might bring me closer to do it for Duik.
TLTR: I'm looking for a way to "click Duik buttons" with a jsx script.
At the moment I work on creating a custom macro keyboard for use with AfterEffects and of course Duik.
My knowlegde of extendscript is limited, though I figured out that I can use DuAEF to include/reproduce Duik functionality in my script.
For example I have a key to create a spine structure. I want to mimic Duik's behaviour as close as possible, so I dug a bit into the code and basically tried to copy the code for what Duik does when creating a spine.
Here's my solution so far:
Code: Select all
#include DuAEF_no_bin.jsxinc
function spine()
{
var comp = DuAEF.DuAE.Project.getActiveComp();
if (!comp) return;
app.beginUndoGroup('Duik | ' + "Create spine structure");
DuAEF.DuAE.Project.setProgressMode(true);
DuAEF.Duik.Structure.createSpine(1,2,1,true);
DuAEF.DuAE.Project.setProgressMode(false);
app.endUndoGroup();
}
So what (I think) I'm looking for is a way to call for example
Code: Select all
ui_spineValidButton_clicked(true);
Any insight on how this could be achieved is highly appreciated.
PS: I have another plugin (SortIt by EyeDesyn) that allows to execute functionality via a keyboard shortcut. There is one .jsx file per shortcut (and the shortcut gets added in AE to execute the corresponding script). Each .jsx contains only a few lines of code like this:
Code: Select all
#targetengine "sort-it";
try{
groupLayersShortcut.pressed = true;
}catch(err){
}
Maybe if I figured out how it works for this plugin it might bring me closer to do it for Duik.