Francois36853938zmve
Community Beginner
Francois36853938zmve
Community Beginner
Activity
‎May 08, 2024
12:23 PM
When creating a dropdown in After Effects ExtendScript code. The dropdowns sometimes display extra bottom spacing. For example, this code: var window = new Window("palette", "Dropdown Example", undefined);
window.add(
"dropdownlist",
undefined,
["Option 1", "Option 2", "Option 3", "Option 4", "Option 5"]
);
window.show(); Creates this dropdown: Notice the gap at the bottom, where I drew the green star in the screenshot. Note, we have also noticed, changing your Windows Display Scaling has an effect on this.
... View more
‎Apr 23, 2024
07:03 AM
I tested what @Airweb_AE said and their trick works perfectly well. See the code below. var parentWindow = new Window("palette", "Parent");
var parentPanel = parentWindow.add("panel", undefined, "Panel Title");
parentPanel.alignment = "fill";
var myButton = parentPanel.add("button", undefined, "Open UI");
myButton.onClick = function () {
var childWindow = new Window("palette", "Child");
var childPanel = childWindow.add("panel", undefined, "Panel Title");
childPanel.alignment = "fill";
addButton(childPanel);
childWindow.show();
// childWindow.onClick = function(){};
}
parentWindow.show();
function addButton(panel) {
panel.add("button", undefined, "OK");
}
... View more
‎Apr 23, 2024
06:48 AM
@Airweb_AE what console do you have open there in your video? How can I open it myself?
... View more
‎Apr 19, 2024
12:41 PM
1 Upvote
Good day. I have a problem where, when you place your functions that add controls to a panel in another file, then they don't work. Have a look at this example: This works fine (when everything is in one file): # myFile.jsx
myButton.onClick = function () {
var myWindow = new Window("dialog", "My Dialog");
var myPanel = myWindow.add("panel", undefined, "Panel Title");
myPanel.alignment = "fill";
localAddButton(myPanel);
myWindow.show();
}
function localAddButton(panel) {
panel.add("button", undefined, "OK");
} But this does not work (when things live in different files): # myFile.jsx
#include "otherFile.jsx"
myButton.onClick = function () {
var myWindow = new Window("dialog", "My Dialog");
var myPanel = myWindow.add("panel", undefined, "Panel Title");
myPanel.alignment = "fill";
otherAddButton(myPanel);
myWindow.show();
}
# --------------------------------------------------------------
# otherFile.jsx
function otherAddButton(panel) {
panel.add("button", undefined, "OK");
} Note that this is definitely not a problem with my include or paths or anything. I can import functions and variables just fine. This is a small example, but in practise this is quite a large hinderance to a project because it means all our tools need to live in one single file. Or we have to copy-paste the same functions into multiple files. Is there any temporary solution to this issue?
... View more
‎Apr 19, 2024
08:56 AM
2 Upvotes
Good day. I have found a problem where you cannot add controls in another function if you are using a pallete window type. Have a look at this example. myButton.onClick = function () {
var myWindow = new Window("dialog", "My Window");
var myPanel = myWindow.add("panel", undefined, "Panel Title");
myPanel.alignment = "fill";
addButton(myPanel);
myWindow.show();
}
function addButton(panel) {
panel.add("button", undefined, "OK");
} This code will only work if the window is a `dialog` type. If it is a `palette` type, it won't work. With `palette` the window flickers for a milisecond and then goes away. This is a small example, but in practise this is quite a large hinderance to a project. It means you cannot reuse any UI building logic in multiple places. Is there any temporary solution to this issue?
... View more