Halfbaked version :(

This commit is contained in:
2015-03-17 17:02:34 -07:00
parent b77c9bd56f
commit 13741e9c95
4 changed files with 11 additions and 68 deletions
+1 -1
View File
@@ -1 +1 @@
function yToolBox(thisObj){ yToolBox = new Object(); yToolBox.icon = new File('../yScripts/yNet.png'); yToolBox.header = new File('../yScripts/header.png'); yToolBox.info = 'yorchnet.com'; yToolBox.name ='yToolBox'; yToolBox.ver ='0.4.2.1 alpha'; yToolBox.desc='Working tools so far...'; yToolBox.buttonWidth=126; yToolBox.buttonHeight=30; yToolBox.tools = []; #include "../yScripts/y_JSExtensions.jsx"; //INCLUDED TOOLS #include "../yScripts/y_setStructure.jsx"; #include "../yScripts/y_puppetRig.jsx"; #include "../yScripts/y_colorProbe.jsx"; #include "../yScripts/y_yBindBetween2.jsx"; #include "../yScripts/y_stopMotionLayer.jsx"; #include "../yScripts/y_CornerPin.jsx"; yToolBox.window = (thisObj instanceof Panel) ? thisObj : new Window("palette", yToolBox.info , undefined, {resizeable:true}); //MAIN WINDOW STRUCTURE. var res_header ="group { orientation:'column', alignment:['fill','fill'],margins:[0,0,0,0] \ header: Group { orientation:'column', alignment:['center','top'],margins:[0,0,0,0]\ title: Image {icon:'"+yToolBox.header.path+'/'+yToolBox.header.name+"',preferredSize: [175, 35]},\ ver: StaticText { text:'"+yToolBox.ver+"', alignment:['center','center']}\ desc: StaticText { text:'"+yToolBox.desc+"', alignment:['center','center']}, \ }, \ main: Group { orientation:'column',alignment:['fill','fill'], alignChildren:['center','center']," var res = ""; //To be populated with the included Tools var res_footer ="}, \ cmds: Group { alignment:['center','bottom'], \ icn_app: Image {icon:'"+ yToolBox.icon.path+'/'+ yToolBox.icon.name+"',preferredSize: [15, 18]},\ txt_info: StaticText { text:'"+yToolBox.info+"', alignment:['fill','center'] },\ }, \ }"; //POPULATE res with included tools. for (i=0;i<yToolBox.tools.length;i++){ res = res + yToolBox.tools [i].btnLayout; } //LAYOUT Stuff yToolBox.window.grp = yToolBox.window.add(res_header+res+res_footer); yToolBox.window.layout.layout(true); yToolBox.window.onResize = resize; yToolBox.window.onClose = function () {delete yToolBox;}; //ASSIGN buttons to the activate function of each tool; var toolBtns = yToolBox.window.grp.main.children; for(n=0;n<toolBtns.length;n++){ toolBtns[n].onClick=yToolBox.tools[n].activate; } return yToolBox.window}function resize(){ this.layout.resize(); customize; }function customize(){ g = yToolBox.window.grp.main.graphics; myFont = ScriptUI.newFont('Cooper Std Black',ScriptUI.FontStyle.REGULAR ,14 ); myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [1, .45, 0, 1]); g.backgroundColor = myBrush; /*g = yToolBox.window.grp.header.title.graphics; g.font = myFont; g =yToolBox.window.grp.header.graphics; g.backgroundColor = myBrush; */ }ytb = yToolBox(this);ytb.window.grp.onDraw = resize;ytb.window.grp.onDraw = customize;
var YToolBox = function YToolBox(thisObj){ var resources = { icon : new File('../yScripts/yNet.png'), header : new File('../yScripts/header.png') } var info = { url : 'yorchnet.com', name :'yToolBox', ver :'0.4.2.1 alpha', description : 'Working tools so far...' } var gui = { buttonWidth : 126, buttonHeight : 30 } var tools = []; #include "../yScripts/y_JSExtensions.jsx"; this.addTool = function addTool(aTool) { alert("AddTool : Adding"); alert("AddTool : there are " + this.tools.length + " tools right now"); this.tools.push(aTool); alert("AddTool : there are " + this.tools.length + " tools right now"); } //alert(thisObj);␍ this.customize = function customize()␍ {␍ /* g = this.window.grp.main.graphics; myFont = ScriptUI.newFont('Cooper Std Black',ScriptUI.FontStyle.REGULAR ,14 ); myBrush = g.newBrush(g.BrushType.SOLID_COLOR, [1, .45, 0, 1]); g.backgroundColor = myBrush; */␍ alert();␍ }␍␍ this.resize = function resize()␍ {␍ this.layout.resize();␍ this.customize; ␍ }␍ ␍ this.createGui = function createGui()␍ {␍ //MAIN WINDOW STRUCTURE. this.gui.header = "group\␍ {\␍ orientation:'column',\␍ alignment:['fill','fill'],\␍ margins:[0,0,0,0]\␍ \␍ header: Group\␍ {\␍ orientation:'column', \␍ alignment:['center','top'],\␍ margins:[0,0,0,0]\␍ \␍ title: Image\␍ {\␍ icon:'"+this.resources.header.path+'/'+this.resources.header.name+"',\␍ preferredSize: [175, 35]},\␍ ver: StaticText { text:'"+this.info.ver+"',\␍ alignment:['center','center']}\␍ desc: StaticText\␍ {\␍ text:'"+this.info.description+"',\␍ alignment:['center','center']\␍ },\␍ },\␍ main: Group {\␍ orientation:'column',\␍ alignment:['fill','fill'],\␍ alignChildren:['center','center']\␍ ," this.gui.main= ""; //To be populated with the included Tools this.gui.footer ="}, \ cmds: Group\ {\ alignment:['center','bottom'],\ icn_app: Image\ {\ icon:'"+ this.resources.icon.path+'/'+ this.resources.icon.name+"',\ preferredSize: [15, 18]\ },\ txt_info: StaticText\ {\ text:'"+ this.info.url+"',\ alignment:['fill','center']\ },\ },\ }"; alert(this.tools); this.window.grp = this.window.add( this.gui.header + this.gui.main + this.gui.footer ); this.window.layout.layout(true); this.window.onResize = this.resize; this.window.onClose = function () {delete yToolBox;}; //ASSIGN buttons to the activate function of each tool; var toolBtns = this.window.grp.main.children; for( var n = 0 ; n < toolBtns.length ; n++ ){ toolBtns[n].onClick = this.tools[n].activate; } } this.init = function init() { this.resources = resources; this.info = info; this.gui = gui; this.tools = tools; this.window = (thisObj instanceof Panel) ? thisObj : new Window("palette", this.info , undefined, {resizeable:true}); this.createGui(); } this.init(); return this}var ytb = new YToolBox(this);#include "../yScripts/y_setStructure.jsx";
+1
View File
@@ -0,0 +1 @@
scriptUIpanel = this;ytb = { // INFO RESOURCES & PREFERENCES info : { name :'yToolBox', url : 'yorchnet.com', ver :'0.5', status : 'alpha', description : 'My mixed bag of tricks' }, resources : { icon : new File('../yScripts/yNet.png'), header : new File('../yScripts/header.png') }, gui : { buttonWidth : 126, buttonHeight : 30 }, //METHODS syncWindow : function syncWindow() { this.window = ( ( scriptUIpanel instanceof Panel ) ? scriptUIpanel : new Window ( "palette" , this.info , undefined, { resizeable:true , alignment:['fill','fill'] , orientation:'column' } ) ); }, customize : function customize() { //myFont = ScriptUI.newFont('Cooper Std Black',ScriptUI.FontStyle.REGULAR ,14 ); g = this.window.graphics; naranja = g.newBrush(g.BrushType.SOLID_COLOR, [1, .45, 0, 1]); black = g.newBrush(g.BrushType.SOLID_COLOR, [0, 0, 0, 1]); gray1 = g.newBrush(g.BrushType.SOLID_COLOR, [.125, .125, .125, 1]); gray2 = g.newBrush(g.BrushType.SOLID_COLOR, [.25, .25, .25, 1]); gray3 = g.newBrush(g.BrushType.SOLID_COLOR, [.5, .5, .5, 1]); gray4 = g.newBrush(g.BrushType.SOLID_COLOR, [.75, .75, .75, 1]); white = g.newBrush(g.BrushType.SOLID_COLOR, [1, 1, 1, 1]); g.backgroundColor = naranja; this.window.grp.main.graphics.backgroundColor = gray1; this.window.grp.header.graphics.backgroundColor = naranja; this.window.grp.main.graphics.backgroundColor = gray2; this.window.grp.footer.graphics.backgroundColor = gray3; }, createGui : function createGui() { //MAIN WINDOW STRUCTURE. var gui = "group\ {\ orientation:'column',\ alignment:['fill','fill'],\ margins:[0,0,0,0]\ \ header: Group\ {\ orientation:'column', \ alignment:['center','top'],\ margins:[0,0,0,0]\ \ title: Image\ {\ icon:'"+this.resources.header.path+'/'+this.resources.header.name+"',\ preferredSize: [175, 35]},\ ver: StaticText { text:'"+this.info.ver+"',\ alignment:['center','center']}\ desc: StaticText\ {\ text:'"+this.info.description+"',\ alignment:['center','center']\ },\ },\ main: Group {\ orientation:'column',\ alignment:['fill','fill'],\ alignChildren:['center','center']\ ,\ }, \ footer: Group\ {\ alignment:['center','bottom'],\ icn_app: Image\ {\ icon:'"+ this.resources.icon.path+'/'+ this.resources.icon.name+"',\ preferredSize: [15, 18]\ },\ txt_info: StaticText\ {\ text:'"+ this.info.url+"',\ alignment:['fill','center']\ },\ },\ }"; this.window.grp = this.window.add( gui ); this.window.layout.layout(true); this.customize(); //Assignacion de Manejo de Eventos. this.window.onResize = this.resize; this.window.onClose = this.selfDestruct; }, addTool : function addTool( aTool ) { alert(" A darle "); }, //Manejo de Eventos resize : function resize() { this.layout.resize(); }, selfDestruct : function selfDestruct() { delete this; }, init : function init() { this.syncWindow(); this.createGui(); }} ytb.init();