You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 line
7.4 KiB
1 line
7.4 KiB
{
|
|
/////////////////////////////////////////////////////////////////////////
|
|
//
|
|
// MAkinE Disney Customizer
|
|
//
|
|
// ©2017 Jorge Vasquez
|
|
// Author: Jorge Vasquez
|
|
//
|
|
// Version History
|
|
//
|
|
////////////////////////////////////////////////////////////////////////
|
|
|
|
var tcd_scriptName = "MAkinE - Disney Customizer ";
|
|
var tcd_version = "0.1";
|
|
//
|
|
|
|
|
|
function applyPallette( palette_string ){
|
|
var comp = app.project.activeItem;
|
|
|
|
var color_targets = {
|
|
col_title: comp.layer("TITLE")("Effects")("Fill")("Color"),
|
|
col_bubble: comp.layer("DONT_TOUCH_bubble")("Effects")("Fill")("Color"),
|
|
col_bubble_shadow: comp.layer("DONT_TOUCH_bubble_shadow")("Effects")("Fill")("Color"),
|
|
col_logo_bg : comp.layer("DISNEY_LOGO_Bubble")("Effects")("Logo_BG")("To"),
|
|
col_logo_fg: comp.layer("DISNEY_LOGO_Bubble")("Effects")("Logo_FG")("To"),
|
|
col_bg: comp.layer("MAIN_BG")("Effects")("Fill")("Color"),
|
|
col_ears: comp.layer("BG_Ears")("Effects")("Fill")("Color")
|
|
};
|
|
var opacity_targets =
|
|
{
|
|
opacity_ears: comp.layer("BG_Ears")("Transform")("Opacity"),
|
|
opacity_vignette: comp.layer("Vignette")("Transform")("Opacity")
|
|
}
|
|
|
|
|
|
for ( var i in color_targets )
|
|
{
|
|
color_targets[i].setValue(hexToColor(palettes[palette_string][i]));
|
|
}
|
|
for ( var i in opacity_targets )
|
|
{
|
|
opacity_targets[i].setValue(palettes[palette_string][i]);
|
|
}
|
|
}
|
|
function hexToColor(theHex){
|
|
var r = theHex >> 16;
|
|
var g = (theHex & 0x00ff00) >> 8;
|
|
var b = theHex & 0xff;
|
|
return [r/255,g/255,b/255,1];
|
|
}
|
|
function tcd_buildUI(thisObj) {
|
|
|
|
if (thisObj instanceof Panel) {
|
|
var myPal = thisObj;
|
|
} else {
|
|
var myPal = new Window("palette",tcd_scriptName + " v" + tcd_version,undefined, {resizeable:true});
|
|
}
|
|
|
|
if (myPal != null) {
|
|
|
|
var res =
|
|
"group { \
|
|
alignment: ['fill','fill'], \
|
|
alignChildren: ['left','top'], \
|
|
orientation: 'column', \
|
|
match: Group { \
|
|
alignment: ['fill','top'], \
|
|
alignChildren: ['fill','top'], \
|
|
orientation:'column', \
|
|
suffix: Group { \
|
|
alignment: ['fill','top'], \
|
|
alignChildren: ['fill','top'], \
|
|
paletteText: StaticText {text:'Piece Palette', alignment: ['left','center']}, \
|
|
paletteOption: DropDownList {alignment: ['left','center']}, \
|
|
suffixTxt: StaticText {text:'Show Title', alignment: ['left','center']}, \
|
|
suffixString: EditText {text: 'SHOW TITLE HERE', alignment: ['fill','center']}, \
|
|
} \
|
|
} \
|
|
doItBtn: Button {text: 'Customize', alignment: ['right','top']} , \
|
|
}";
|
|
|
|
myPal.grp = myPal.add(res);
|
|
|
|
var paletteOptions = ["A","C","D","E","F","G","H"];
|
|
for (var i=0; i<paletteOptions.length; i++) {
|
|
myPal.grp.match.suffix.paletteOption.add("item",paletteOptions[i]);
|
|
}
|
|
|
|
myPal.grp.match.suffix.paletteOption.selection = 0;
|
|
myPal.grp.match.suffix.paletteOption.minimumSize.width = myPal.grp.match.suffix.paletteOption.preferredSize.width = 75;
|
|
|
|
myPal.grp.match.suffix.paletteOption.onChange = function () {
|
|
}
|
|
|
|
|
|
myPal.grp.doItBtn.onClick = function () {
|
|
var checkError = false;
|
|
if (checkError == false) tcd_doIt ();
|
|
} //myPal.grp.doItBtn.onClick = function ()
|
|
|
|
myPal.layout.layout(true);
|
|
myPal.layout.resize();
|
|
myPal.onResizing = myPal.onResize = function () {this.layout.resize();}
|
|
|
|
} //if (myPal != null)
|
|
return myPal;
|
|
}
|
|
function applyShowTitle( new_title ){
|
|
var comp = app.project.activeItem;
|
|
var title_layer = comp.layer("TITLE");
|
|
var ctrl_layer = comp.layer("ctrl_bubble");
|
|
title_layer.sourceText.setValue( new_title );
|
|
|
|
width = title_layer.sourceRectAtTime(0, false).width;
|
|
var new_scale;
|
|
var new_center;
|
|
|
|
if ( width >= 1300 )
|
|
{
|
|
new_scale = (1500/width)*100;
|
|
new_center = [787,540];
|
|
}
|
|
else if ( width > 640 )
|
|
{
|
|
new_scale = 100;
|
|
new_center = [960,540];
|
|
}
|
|
else
|
|
{
|
|
new_scale = 100;
|
|
new_center = [1040,540];
|
|
|
|
}
|
|
|
|
comp.layer("DONT_TOUCH_CTRL_CENTER")("Transform")("Position").setValue(new_center);
|
|
comp.layer("ctrl_bubble")("Transform")("Scale").setValue([new_scale,new_scale]);
|
|
|
|
ctrl_layer("Effects")("width")("Slider").setValue(width + 75);
|
|
}
|
|
function tcd_doIt (){
|
|
|
|
applyPallette(myPalette.grp.match.suffix.paletteOption.selection);
|
|
applyShowTitle( myPalette.grp.match.suffix.suffixString.text );
|
|
|
|
|
|
|
|
} //function tcd_doIt (palObj)
|
|
/*
|
|
var tcd_mode = 0; // 0 - none, 1 - add suffix, 2 - search and replace
|
|
var tcd_suffix = "";
|
|
var tcd_searchTerm = "";
|
|
var tcd_replaceTerm = "";
|
|
*/
|
|
var palettes = {
|
|
A : {
|
|
col_title: 0xFFFB00,
|
|
col_bubble: 0x3BCCFD,
|
|
col_bubble_shadow: 0x2A9BC1,
|
|
col_logo_bg : 0xFAF800,
|
|
col_logo_fg: 0xE74DB7,
|
|
col_bg: 0x6B00C0,
|
|
col_ears: 0x0D0D0F,
|
|
opacity_ears: 35,
|
|
opacity_vignette: 60
|
|
},
|
|
C : {
|
|
col_title: 0xE74DB7,
|
|
col_bubble: 0xFFFC00,
|
|
col_bubble_shadow: 0xBBB900,
|
|
col_logo_bg : 0xE74DB7,
|
|
col_logo_fg: 0xFAF800,
|
|
col_bg: 0x00D4CF,
|
|
col_ears: 0x000000,
|
|
opacity_ears: 50,
|
|
opacity_vignette: 55
|
|
},
|
|
D : {
|
|
col_title: 0xFFFB00,
|
|
col_bubble: 0x3BCCFD,
|
|
col_bubble_shadow: 0x2A9BC1,
|
|
col_logo_bg : 0xE74DB7,
|
|
col_logo_fg: 0xFAF800,
|
|
col_bg: 0x3A404A,
|
|
col_ears: 0x000000,
|
|
opacity_ears: 35,
|
|
opacity_vignette: 45
|
|
},
|
|
E : {
|
|
col_title: 0x288492,
|
|
col_bubble: 0xFFFC00,
|
|
col_bubble_shadow: 0xBBB900,
|
|
col_logo_bg : 0xFAF800,
|
|
col_logo_fg: 0x7D2CE5,
|
|
col_bg: 0x3290EB,
|
|
col_ears: 0x000000,
|
|
opacity_ears: 35,
|
|
opacity_vignette: 8
|
|
},
|
|
F : {
|
|
col_title: 0x1BF0FF,
|
|
col_bubble: 0xE74DB7,
|
|
col_bubble_shadow: 0xA93886,
|
|
col_logo_bg : 0x7D2CE5,
|
|
col_logo_fg: 0x3CCCFE,
|
|
col_bg: 0xF0ED00,
|
|
col_ears: 0xA28600,
|
|
opacity_ears: 85,
|
|
opacity_vignette: 8
|
|
}
|
|
}
|
|
|
|
//main
|
|
var myPalette = tcd_buildUI(this);
|
|
var tcd_folderName, tcd_addFolder, tcd_origParentFolder, tcd_parentFolder, previousComps, previousFolders;
|
|
|
|
if (parseFloat(app.version) < 8) {
|
|
alert("This script requires Adobe After Effects CS3 or later.", tcd_scriptName);
|
|
} else {
|
|
if (myPalette != null && myPalette instanceof Window) {
|
|
//myPalette.center();
|
|
|
|
myPalette.show();
|
|
}
|
|
}
|
|
|
|
}
|