ADOBE AFTER EFFECTS: Forum Expressions Tutorials Creative Cloud

Different code for dockable panel.

COW Forums : Adobe After Effects Expressions

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
Andrei Popa
Different code for dockable panel.
on Aug 10, 2017 at 2:15:09 pm

I am curious if there is any major differences when creating a dockable panel between this two codes

function createUI(thisObj) {
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My Tools",[100, 100, 300, 300]);
myPanel.add("button", [10, 10, 100, 30], "Tool #1");
return myPanel;
}
var myToolsPanel = createUI(this);


function createUI(thisObj) {
var myPanel = (thisObj instanceof Panel) ? thisObj : new Window("palette", "My Tools",[100, 100, 300, 300]);
var res = "group{orientation:'column',alignChildren:'fill',button:Button{text:'Tool #1'}}";
myPanel.grp = myPanel.add(res);

myPanel.layout.layout(true);
myPanel.grp.minimumSize = myPanel.grp.size;
myPanel.layout.resize();
return myPanel;
}
var myToolsPanel = createUI(this);


I am referring as technique. Because i think it would be much easier to use the first version. And both of them have the same output. But in most scripts i see the second version. Anyone who can enlight me on this?

Andrei


Return to posts index

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