Quantcast
Channel: Adobe Community : Discussion List - After Effects Scripting
Viewing all articles
Browse latest Browse all 2143

ScriptUI Panel Resource String Question

$
0
0

I'm creating a little tool to use to keep my projects organized, and want to create a dropdown that will eventually list off render templates I have created. Right now, for testing purposes (since I'm brand new to ExtendScript), I'm just trying to pass a pre-created array from a function so I can build in the code to access the Render Templates later.

 

{

function joshPipe(thisObj){

    function joshPipe_buildUI(thisObj){

        var pipePanel = (thisObj instanceof Panel) ? thisObj : new Window("palette","Josh Pipeline", undefined, {resizeable:true});

       

        var rsdPath = 'Workspace not loaded';

        var presetList = ['Render Template 1','Render Template 2','Render Template 3'];

       

        function getPath(){

            return "Project Loaded";

            }

        function getPresets(){

            list = ['Render Template 1','Render Template 2','Render Template 3'];

            return list;

            }

       

       

        queueTab = "group{orientation:'column', alignment: 'fill', alignChildren:['fill','fill'],\

                    group0: Group{orientation:'column', alignChildren:'fill',\

                            loadPipeButton: Button{text:'Setup Workspace'},\

                    },\

                    group1: Panel{orientation:'row',text:'Render Settings',alignChildren:['fill','fill'],\

                        group1_1: Group{orientation:'column', alignChildren:'left',\

                            fullRadioButton: RadioButton{text:'Full (Delivery)'},\

                            halfRadioButton: RadioButton{text:'Half (Review)'},\

                        },\

                        group1_2: Group{orientation:'column', alignment:'right',\

                            renderTemplateDD: DropDownList{properties:{items:['Template 1','Template 2','Template 3']}},\

                        },\

                    },\

                    group2: Group{orientation:'column', alignChildren:'fill',\

                            rsdString: StaticText{multiline: 'true', text:'"+rsdPath+"'},\

                            renderButton: Button{text:'Setup Render',},\

                    },\

                }}";

               

       

        pipePanel.grp = pipePanel.add(queueTab);

       

        var loadPipeCtrl = pipePanel.grp.group0.loadPipeButton;

        var fullRenderSelCtrl = pipePanel.grp.group1.group1_1.fullRadioButton;

        var halfRenderSelCtrl = pipePanel.grp.group1.group1_1.halfRadioButton;

        var renderTemplateDDCtrl = pipePanel.grp.group1.group1_2.renderTemplateDD;

        var rsdStringCtrl = pipePanel.grp.group2.rsdString;

        var renderButtonCtrl = pipePanel.grp.group2.renderButton;

       

        loadPipeCtrl.onClick = function(){

            rsdPath = getPath();

            rsdStringCtrl.text = rsdPath;

            renderTemplateDDCtrl.item[0] = 'yo momma';

            }

       

        renderButtonCtrl.onClick = function(){

            rsdStringCtrl.text = 'Project Unloaded';

            }       

       

           

       

        //Defaults

        //pipePanel.grp.group1.group1_2.renderTemplateDD.selection = 0;

       

        //window size

        pipePanel.layout.layout(true); 

        pipePanel.grp.minimumSize = pipePanel.grp.size; 

           

        //panels resize

        pipePanel.layout.resize(); 

        pipePanel.onResizing = pipePanel.onResize = function(){this.layout.resize()};

 

 

    return pipePanel;     //Returns final result of pipePanel

    }

    var pipeScriptPal = joshPipe_buildUI(thisObj);

   

    if((pipeScriptPal != null) && (pipeScriptPal instanceof Window)){

        pipeScriptPal.center();

        pipeScriptPal.show();

    }

 

 

}

 

 

joshPipe(this);

}

 

The rub is that want this tool to be a panel that I can dock. As near as I can tell (using David Torno's Extendscript series as my guide) I have to read in the UI and its options initially as a resource string, and I can't figure out how to make it work. Any suggestions?


Viewing all articles
Browse latest Browse all 2143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>