ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Adding buttons to a UI panel from that UI panel stopped working in AE19 - works in 18

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Jeroen Rommelaars
Adding buttons to a UI panel from that UI panel stopped working in AE19 - works in 18
on Oct 23, 2019 at 10:42:28 am

Hey guys,
I have a little UI panel with several buttons.
One of these buttons should check some layers, and possibly add a new button to the UI.
This always worked perfect in AE18 and before, but stopped working in AE19.

I used this to add the button:
var button = myPanel.grp.groupTwo.add("button", [1, 1, 80, 20], layerName);

The actual group the button should be added to is created here, and works for the buttons actually added in the extendscript itself:
res = "group{orientation:'row', spacing:0, margins:[0,0,0,0],\
groupOne: Group {orientation:'column', alignment:['left','top']}groupTwo: Group {orientation:'column', alignment:['right','top']},\
}";

//UI elements

myPanel.grp = myPanel.add(res);
//dd = myPanel.grp.groupOne.add("dropdownlist", undefined, myList);
//var applyButton = myPanel.grp.groupOne.add("button",[10,10,180,30],"apply ddl");
var newScaleButton = myPanel.grp.groupOne.add("button", [1, 1, 80, 20], "new scale");
//var subsButton = myPanel.grp.groupTwo.add("button", [1, 1, 80, 20], "subs");
var vertButton = myPanel.grp.groupTwo.add("button", [1, 1, 80, 20], "vert pos");
var firstName = myPanel.grp.groupOne.add("button", [1, 1, 80, 20], "first name");
var lastName = myPanel.grp.groupTwo.add("button", [1, 1, 80, 20], "last name");


The debugger highlights the row where the button is added and says "undefined is not an object".
Something has changed in AE19 Extendscript, but I have no idea what, nor do I know what method I should use to add buttons in ae19 since the debugger is no help at all.

Does anyone know what could have changed?

ps. the code still works perfectly in AE18.


Return to posts index

Dan Ebberts
Re: Adding buttons to a UI panel from that UI panel stopped working in AE19 - works in 18
on Oct 23, 2019 at 12:42:22 pm

Hard to say without seeing it in context, but when it halts on error, I think I'd try a few $.writeln() commands in the console to see what the undefined object is. My guess is it's myPanel. Then you figure out why it's undefined at that point in the code...

Dan



Return to posts index

Jeroen Rommelaars
Re: Adding buttons to a UI panel from that UI panel stopped working in AE19 - works in 18
on Nov 8, 2019 at 1:59:26 pm

Its been a while - but I figured out the solution. If someone ever encounters this as well:
It had nothing to do with AE18/AE19.
I was running two ui elements coded by me, and both of them were using a variable called myPanel for the ui buttons.
I was under the impression that a variable like that would be contained in the script of one ui panel, but apparently it messed up when two panels were using the same name. It started adding buttons to the other panel, or bugged out completely.

Hope this helps someone in the future ;)


Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2019 CreativeCOW.net All Rights Reserved
[TOP]