- 2022.03.28 Monday
- スポンサーサイト
-
一定期間更新がないため広告を表示しています
- | スポンサードリンク | - | | - | - | pookmark |
- 2015.08.03 Monday
- Maya の透明テクスチャ用tga をpngから作成。
-
Maya の透明テクスチャ用tga をpngから作成。
- | whaison | jsx(ExtendScriptToolKit) | 15:45 | comments(0) | - | pookmark |
- 2015.06.18 Thursday
- 透明png32[.png]から3Dソフトでよく使うアルファチャンネル付きTarga[.tga]を自動作成するJSXをこさえたよ。
-
透明png32[.png]から3Dソフトでよく使うアルファチャンネル付きTarga[.tga]を自動作成するJSXをこさえたよ。
http://www.mediafire.com/download/p4ol421aaad1i0k/pngToTga.jsx.zip
#target photoshop // // pngToTga.jsx // // // Generated Thu Jun 18 2015 18:07:14 GMT+0900 // cTID = function(s) { return app.charIDToTypeID(s); }; sTID = function(s) { return app.stringIDToTypeID(s); }; // //==================== pngToTga ============== // var myFilePathStr=""; var myFilePathArr=new Array(); var myFilePathDir=""; var myFileNameStr=""; var myFileNameArr=new Array(); var myFileNameDotArr=new Array(); var myCharacterBaseName=""; var TgaFilePath=""; function pngToTga() { // //Tga保存先設定• function step0(){ //JSの場所 /* const SELF = (function(){ try {app.documents.test()} catch(e) {return File(e.fileName)} })(); //$.writeln(SELF instanceof File); // $.writeln(SELF); // $.writeln(SELF.path) myFilePathStr=SELF.path; $.writeln("myFilePathStr"+myFilePathStr+"") $.writeln("$.fileName"+$.fileName) */ //Tga保存先設定 myFilePathDir = activeDocument.path; $.writeln("myFilePathDir= "+myFilePathDir+"") myFileNameStr=activeDocument.name; $.writeln("myFileNameStr= "+myFileNameStr+"") myFileNameArr=myFileNameStr.split ("_"); $.writeln("myFileNameArr= "+myFileNameArr+"") myFileNameDotArr=myFileNameStr.split ("."); $.writeln("myFileNameArr.length= "+myFileNameArr.length+"") if(myFileNameArr.length>1){ //ネームルール用 myCharacterBaseName=myFileNameArr[0]+"_"+myFileNameArr[1]+"_"+myFileNameArr[2]+"_"; $.writeln("myCharacterBaseName= "+myCharacterBaseName+"") TgaFilePath=myFilePathDir+"/"+myCharacterBaseName+"tga.tga"; }else{ //普通ファイル用 myCharacterBaseName=myFileNameDotArr[0]+"_"; $.writeln("myCharacterBaseName= "+myCharacterBaseName+"") TgaFilePath=myFilePathDir+"/"+myCharacterBaseName+"tga.tga"; } $.writeln("TgaFilePath= "+TgaFilePath+"") } //TGAに保存する。 function step1(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var desc2 = new ActionDescriptor(); desc2.putInteger(cTID('BtDp'), 32); desc2.putInteger(cTID('Cmpr'), 0); desc1.putObject(cTID('As '), cTID('TrgF'), desc2); //desc1.putPath(cTID('In '), new File("/Share/jsx_mel/Sotai/sd_0016_victoria/sd_0016_victoria_tga.tga")); desc1.putPath(cTID('In '), new File(TgaFilePath)); desc1.putInteger(cTID('DocI'), 2139); desc1.putBoolean(cTID('Cpy '), true); desc1.putBoolean(cTID('LwCs'), true); executeAction(sTID('save'), desc1, dialogMode); }; // 選択範囲 透明部分チャンネル function step2(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putProperty(cTID('Chnl'), sTID("selection")); desc1.putReference(cTID('null'), ref1); var ref2 = new ActionReference(); ref2.putEnumerated(cTID('Chnl'), cTID('Chnl'), cTID('Trsp')); desc1.putReference(cTID('T '), ref2); executeAction(sTID('set'), desc1, dialogMode); }; // 複製選択範囲 chara function step3(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putProperty(cTID('Chnl'), sTID("selection")); desc1.putReference(cTID('null'), ref1); desc1.putString(cTID('Nm '), "chara"); executeAction(sTID('duplicate'), desc1, dialogMode); }; // 作成レイヤー function step4(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putClass(cTID('Lyr ')); desc1.putReference(cTID('null'), ref1); executeAction(sTID('make'), desc1, dialogMode); }; // 選択範囲を反転 function step5(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); executeAction(sTID('inverse'), undefined, dialogMode); }; // 描画色を黒に設定 function step6(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putProperty(cTID('Clr '), cTID('FrgC')); desc1.putReference(cTID('null'), ref1); var desc2 = new ActionDescriptor(); desc2.putUnitDouble(cTID('H '), cTID('#Ang'), 359.994506835938); desc2.putDouble(cTID('Strt'), 0); desc2.putDouble(cTID('Brgh'), 0); desc1.putObject(cTID('T '), cTID('HSBC'), desc2); desc1.putString(cTID('Srce'), "photoshopPicker"); executeAction(sTID('set'), desc1, dialogMode); }; // 塗り潰し function step7(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var desc2 = new ActionDescriptor(); desc2.putUnitDouble(cTID('Hrzn'), cTID('#Pxl'), 1); desc2.putUnitDouble(cTID('Vrtc'), cTID('#Pxl'), 1); desc1.putObject(cTID('From'), cTID('Pnt '), desc2); desc1.putInteger(cTID('Tlrn'), 32); desc1.putBoolean(cTID('AntA'), true); desc1.putEnumerated(cTID('Usng'), cTID('FlCn'), cTID('FrgC')); executeAction(sTID('fill'), desc1, dialogMode); }; // レイヤーを作成 function step8(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putClass(cTID('Lyr ')); desc1.putReference(cTID('null'), ref1); executeAction(sTID('make'), desc1, dialogMode); }; // 描画色の設定 白 function step9(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putProperty(cTID('Clr '), cTID('FrgC')); desc1.putReference(cTID('null'), ref1); var desc2 = new ActionDescriptor(); desc2.putUnitDouble(cTID('H '), cTID('#Ang'), 359.994506835938); desc2.putDouble(cTID('Strt'), 0); desc2.putDouble(cTID('Brgh'), 100); desc1.putObject(cTID('T '), cTID('HSBC'), desc2); desc1.putString(cTID('Srce'), "photoshopPicker"); executeAction(sTID('set'), desc1, dialogMode); }; // 選択範囲すべて function step10(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putProperty(cTID('Chnl'), sTID("selection")); desc1.putReference(cTID('null'), ref1); desc1.putEnumerated(cTID('T '), cTID('Ordn'), cTID('Al ')); executeAction(sTID('set'), desc1, dialogMode); }; //描画色 白で塗り潰し function step11(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var desc2 = new ActionDescriptor(); desc2.putUnitDouble(cTID('Hrzn'), cTID('#Pxl'), 1); desc2.putUnitDouble(cTID('Vrtc'), cTID('#Pxl'), 1); desc1.putObject(cTID('From'), cTID('Pnt '), desc2); desc1.putInteger(cTID('Tlrn'), 32); desc1.putBoolean(cTID('AntA'), true); desc1.putEnumerated(cTID('Usng'), cTID('FlCn'), cTID('FrgC')); executeAction(sTID('fill'), desc1, dialogMode); }; // 白で塗り潰したレイヤーを 黒の裏に移動 function step12(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt')); desc1.putReference(cTID('null'), ref1); var ref2 = new ActionReference(); ref2.putIndex(cTID('Lyr '), 1); desc1.putReference(cTID('T '), ref2); desc1.putBoolean(cTID('Adjs'), false); desc1.putInteger(cTID('Vrsn'), 5); executeAction(sTID('move'), desc1, dialogMode); }; // レイヤー1の表示を使用しない function step13(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putName(cTID('Lyr '), "レイヤー 1"); desc1.putReference(cTID('null'), ref1); desc1.putBoolean(cTID('MkVs'), false); executeAction(sTID('select'), desc1, dialogMode); }; // レイヤーを結合‡ function step14(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); executeAction(sTID('mergeLayersNew'), desc1, dialogMode); }; // 選択範囲すべて function step15(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putProperty(cTID('Chnl'), sTID("selection")); desc1.putReference(cTID('null'), ref1); desc1.putEnumerated(cTID('T '), cTID('Ordn'), cTID('Al ')); executeAction(sTID('set'), desc1, dialogMode); }; //コピー function step16(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); executeAction(sTID('copyEvent'), undefined, dialogMode); }; // TGA開く function step17(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); //desc1.putPath(cTID('null'), new File("/Share/jsx_mel/Sotai/sd_0016_victoria/sd_0016_victoria_tga.tga")); desc1.putPath(cTID('null'), new File(TgaFilePath)); executeAction(sTID('open'), desc1, dialogMode); }; // アルファチャンネル1選択 function step18(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putName(cTID('Chnl'), "アルファチャンネル 1"); desc1.putReference(cTID('null'), ref1); executeAction(sTID('select'), desc1, dialogMode); }; // 選択範囲すべて function step19(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var ref1 = new ActionReference(); ref1.putProperty(cTID('Chnl'), sTID("selection")); desc1.putReference(cTID('null'), ref1); desc1.putEnumerated(cTID('T '), cTID('Ordn'), cTID('Al ')); executeAction(sTID('set'), desc1, dialogMode); }; // ペースト function step20(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); desc1.putEnumerated(cTID('AntA'), cTID('Annt'), cTID('Anno')); executeAction(sTID('paste'), desc1, dialogMode); }; // 表示:RGBチャンネル function step21(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); var desc1 = new ActionDescriptor(); var list1 = new ActionList(); var ref1 = new ActionReference(); ref1.putEnumerated(cTID('Chnl'), cTID('Chnl'), cTID('Rd ')); list1.putReference(ref1); var ref2 = new ActionReference(); ref2.putEnumerated(cTID('Chnl'), cTID('Chnl'), cTID('Grn ')); list1.putReference(ref2); var ref3 = new ActionReference(); ref3.putEnumerated(cTID('Chnl'), cTID('Chnl'), cTID('Bl ')); list1.putReference(ref3); desc1.putList(cTID('null'), list1); executeAction(sTID('show'), desc1, dialogMode); }; // 保存 function step22(enabled, withDialog) { if (enabled != undefined && !enabled) return; var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO); executeAction(sTID('save'), undefined, dialogMode); }; step0(); ////Tga保存先設定 step1(); // //TGAに保存する。 step2(); //// 選択範囲 透明部分チャンネル step3(); // // 複製選択範囲 chara step4(); //// 作成レイヤー step5(); //// 選択範囲を反転 step6(); //// 描画色を黒に設定 step7(); //// 塗り潰し step8(); // // レイヤーを作成 step9(); // // 描画色の設定 白 step10(); //// 選択範囲すべて step11(); ////描画色 白で塗り潰し step12(); //// 白で塗り潰したレイヤーを 黒の裏に移動 step13(); // // レイヤー1の表示を使用しない step14(); //// レイヤーを結合‡Œ‹‡ step15(); //// 選択範囲すべて step16(); ////コピー step17(); //// TGA開く step18(); // // アルファチャンネル1選択 step19(); //// 選択範囲すべて step20(); //// ペースト step21(); // // 表示:RGBチャンネル step22(); // 保存 }; //========================================= // pngToTga.main //========================================= // pngToTga.main = function () { pngToTga(); }; pngToTga.main(); // EOF "pngToTga.jsx" // EOF
変換元のatnはこんな内容
- | whaison | jsx(ExtendScriptToolKit) | 19:31 | comments(0) | - | pookmark |
- 2015.06.18 Thursday
- photoshop の Action の [.atn]をjsxへ変換する atn2js.jsx ActionToJavascript.jsxについて
-
photoshop の Action の [.atn]をjsxへ変換する atn2js.jsx ActionToJavascript.jsxについて
ExtendScript Toolkit CC (ESTK CC 4.0.0.1)
で
http://sourceforge.net/projects/ps-scripts/files/xtools/v2.2betas/
xtools-2_2b1.zip
がダウンロードできるが
Macだと直下にフォルダ作っていれとく。
/Developer/xtools/xapps/ActionToJavascript.jsx
そのままじゃ動かなかった件
頭に
#target photoshop
いれれば動く
入れないと
//@include "xlib/xml/atn2bin.jsx" がエラーとか
DescValueType.ALIASTYPE がみつかりません。とか
動けばこんな感じ
変換される
。。
修正したものおいておく。
http://www.mediafire.com/download/7c426c6z16tukyy/xtools-2_2b1_whaison.zip - | whaison | jsx(ExtendScriptToolKit) | 16:49 | comments(0) | - | pookmark |
- 2015.03.27 Friday
- 赤くしたpng24をイラレで開いてパスデータに変換してillustrator8形式で保存
-
赤くしたpng24をイラレで開いてパスデータに変換してillustrator8形式で保存
http://www.mediafire.com/download/acy9z09ba9wtlby/illustratorPngToVectorSaveVer8ai.zip
今回はとにかく上のファイルをダウンロード
for2Dmaya.aia
がないと始まらない。
illustratorPngToVectorSaveVer8ai.jsx
#target Illustrator
// 選択された画像をトレースする
/*
var selObj = activeDocument.selection;
for(var i=0; i<selObj.length; i++){
var selType = selObj[i].typename;
if ((selType == "PlacedItem") || (selType == "RasterItem")){
selObj[i].trace();
}
}
*/
app.loadAction ("/Users/otsuka-noboru/works/Unity5Tutorial/Maya2DCharaMotion/2dtoolkit/estoolkit/for2Dmaya.aia")
app.doScript ("ToVecter", "for2Dmaya");
app.doScript ("unGroup", "for2Dmaya");
/*
var n = activeDocument.layers.length;
var ns = activeDocument.layers[0].layers.length;
alert("レイヤー総数:" + n +"¥rサブレイヤー総数:" + ns);
*/
// 複合パスを削除(ロックされたもの、ロックレイヤー上のものは除く)
var compObj = activeDocument.compoundPathItems;
for(var i=compObj.length-1; i>-1; i--){
try{
compObj[i].remove();
}catch(e){}
}
//app.doScript ("saveDxf", "for2Dmaya");
// AIアクティブドキュメントを保存する
if (activeDocument.saved == true){
activeDocument.save();
}else{
alert("ドキュメントがまだ保存されていません");
var savefile = File.saveDialog("保存ファイル名を入れてください", "*");
if (savefile != null) {
var aiOptions = new IllustratorSaveOptions;
with (aiOptions) {
compatibility=Compatibility.ILLUSTRATOR8;//Mayaで読み込めるバージョン8で書き出す。
pdfCompatible = true ; //PDF互換ファイルを作成→チェックオン
embedLinkedFiles = false ; //配置した画像を含む→チェックオフ
embedICCProfile = false ; //ICCプロファイルを埋め込む→チェックオフ
compressed = true ; //圧縮を使用する→チェックオン
}
activeDocument.saveAs(savefile,aiOptions);
}
}
/*
// EPS形式で保存する
var savefile = File.saveDialog("保存ファイル名を入れてください", "*");
if (savefile != null) {
var opt = new EPSSaveOptions();
opt.cmykPostScript = true; // CMYKポストスクリプト
opt.compatibility = Compatibility.ILLUSTRATOR16; // CS5互換
opt.compatibleGradientPrinting = false; // コンパチブルグラデーション&グラデーションメッシュプリント
opt.embedAllFonts = false; // フォントの埋め込み(trueなら埋め込み)
opt.embedLinkedFiles = true; // リンクファイルの埋め込み(配置した画像を含む)
opt.flattenOuput = OutputFlattening.PRESERVEPATHS; // 透明化の処理
opt.includeDocumentThumbnails = true; // サムネールの作成
opt.overprint = PDFOverprint.PRESERVEPDFOVERPRINT;
opt.postScript = EPSPostScriptLevelEnum.LEVEL3; // PostScript Level 3
opt.preview = EPSPreview.None; // EPSプレビューなし
activeDocument.saveAs(savefile, opt);
}
*/ - | whaison | jsx(ExtendScriptToolKit) | 18:13 | comments(0) | - | pookmark |
- 2015.03.27 Friday
- 透明な部分をデータ化するためにPhotoShopでキャラクターの全パーツを赤にしてランダムな名前のpng24で保存する。
-
透明な部分をデータ化するためにPhotoShopでキャラクターの全パーツを赤にしてランダムな名前のpng24で保存する。
こんなデータを。透明化のマスクや、パス化するために一旦 赤で均一に塗って保存する。
http://www.mediafire.com/download/5b5taujfwu2q3co/hero_psd.zip
できた結果。
2つのjsxを実行する。
PhotoShopAllFillRed.jsx
#target photoshop
//
// all_fill_red.jsx
//
//
// Generated Thu Mar 26 2015 16:22:04 GMT+0900
//
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
//
//==================== all_fill_red ==============
//
function all_fill_red() {
//
function step1(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
//executeAction(sTID('mergeVisible'), undefined, dialogMode);
////////////////////////////////////////////http://www.openspc2.org/book/PhotoshopCS2/easy/layer/016/
docObj = documents;
for (i=0; i<docObj.length; i++)
{
activeDocument = docObj[i];
if (docObj[i].artLayers.length > 1)
{
docObj[i].mergeVisibleLayers();
}
}
////////////////////////////////////////////http://www.openspc2.org/book/PhotoshopCS2/easy/layer/016/
};
//
function step2(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putProperty(cTID('Prpr'), cTID('Lefx'));
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putUnitDouble(cTID('Scl '), cTID('#Prc'), 100);
var desc3 = new ActionDescriptor();
desc3.putBoolean(cTID('enab'), true);
desc3.putEnumerated(cTID('Md '), cTID('BlnM'), cTID('Nrml'));
desc3.putUnitDouble(cTID('Opct'), cTID('#Prc'), 100);
var desc4 = new ActionDescriptor();
desc4.putDouble(cTID('Rd '), 255);
desc4.putDouble(cTID('Grn '), 0.00389105058275);
desc4.putDouble(cTID('Bl '), 0.00389105058275);
desc3.putObject(cTID('Clr '), sTID("RGBColor"), desc4);
desc2.putObject(cTID('SoFi'), cTID('SoFi'), desc3);
desc1.putObject(cTID('T '), cTID('Lefx'), desc2);
executeAction(sTID('set'), desc1, dialogMode);
};
//
function step3(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var ref1 = new ActionReference();
ref1.putProperty(cTID('Prpr'), cTID('Lefx'));
ref1.putEnumerated(cTID('Lyr '), cTID('Ordn'), cTID('Trgt'));
desc1.putReference(cTID('null'), ref1);
var desc2 = new ActionDescriptor();
desc2.putUnitDouble(cTID('Scl '), cTID('#Prc'), 100);
var desc3 = new ActionDescriptor();
desc3.putBoolean(cTID('enab'), true);
desc3.putEnumerated(cTID('Md '), cTID('BlnM'), cTID('Nrml'));
desc3.putUnitDouble(cTID('Opct'), cTID('#Prc'), 100);
var desc4 = new ActionDescriptor();
desc4.putDouble(cTID('Rd '), 255);
desc4.putDouble(cTID('Grn '), 0.00389105058275);
desc4.putDouble(cTID('Bl '), 0.00389105058275);
desc3.putObject(cTID('Clr '), sTID("RGBColor"), desc4);
desc2.putObject(cTID('SoFi'), cTID('SoFi'), desc3);
var desc5 = new ActionDescriptor();
desc5.putBoolean(cTID('enab'), true);
desc5.putEnumerated(cTID('Styl'), cTID('FStl'), cTID('InsF'));
desc5.putEnumerated(cTID('PntT'), cTID('FrFl'), cTID('SClr'));
desc5.putEnumerated(cTID('Md '), cTID('BlnM'), cTID('Nrml'));
desc5.putUnitDouble(cTID('Opct'), cTID('#Prc'), 100);
desc5.putUnitDouble(cTID('Sz '), cTID('#Pxl'), 133);
var desc6 = new ActionDescriptor();
desc6.putDouble(cTID('Rd '), 255);
desc6.putDouble(cTID('Grn '), 0.00389105058275);
desc6.putDouble(cTID('Bl '), 0.00389105058275);
desc5.putObject(cTID('Clr '), sTID("RGBColor"), desc6);
desc2.putObject(cTID('FrFX'), cTID('FrFX'), desc5);
desc1.putObject(cTID('T '), cTID('Lefx'), desc2);
executeAction(sTID('set'), desc1, dialogMode);
};
step1(); //
step2(); //
step3(); //
};
//=========================================
// all_fill_red.main
//=========================================
//
all_fill_red.main = function () {
all_fill_red();
};
all_fill_red.main();
// EOF
"all_fill_red.jsx"
// EOF
PhotoShopWebPng24Out.jsx
#target photoshop
//
// webPngOut.jsx
//
//
// Generated Thu Mar 26 2015 16:26:45 GMT+0900
//
cTID = function(s) { return app.charIDToTypeID(s); };
sTID = function(s) { return app.stringIDToTypeID(s); };
//
//==================== webPngOut ==============
//
function webPngOut() {
// ‘‚«o‚µ
function step1(enabled, withDialog) {
if (enabled != undefined && !enabled)
return;
var dialogMode = (withDialog ? DialogModes.ALL : DialogModes.NO);
var desc1 = new ActionDescriptor();
var desc2 = new ActionDescriptor();
desc2.putEnumerated(cTID('Op '), cTID('SWOp'), cTID('OpSa'));
desc2.putBoolean(cTID('DIDr'), true);
//desc2.putPath(cTID('In '), new File("~/Desktop/File or Folder not found"));
desc2.putPath(cTID('In '), new File("/Users/otsuka-noboru/works/Unity5Tutorial/Maya2DCharaMotion/2dtoolkit/Temp"));
var R=Math.floor(Math.random()*(9999-1000)+1000);
desc2.putString(cTID('ovFN'), "file"+R+".png");
desc2.putEnumerated(cTID('Fmt '), cTID('IRFm'), cTID('PN24'));
desc2.putBoolean(cTID('Intr'), false);
desc2.putBoolean(cTID('Trns'), true);
desc2.putBoolean(cTID('Mtt '), true);
desc2.putBoolean(cTID('EICC'), false);
desc2.putInteger(cTID('MttR'), 255);
desc2.putInteger(cTID('MttG'), 255);
desc2.putInteger(cTID('MttB'), 255);
desc2.putBoolean(cTID('SHTM'), false);
desc2.putBoolean(cTID('SImg'), true);
desc2.putEnumerated(cTID('SWsl'), cTID('STsl'), cTID('SLAl'));
desc2.putEnumerated(cTID('SWch'), cTID('STch'), cTID('CHsR'));
desc2.putEnumerated(cTID('SWmd'), cTID('STmd'), cTID('MDCC'));
desc2.putBoolean(cTID('ohXH'), false);
desc2.putBoolean(cTID('ohIC'), true);
desc2.putBoolean(cTID('ohAA'), true);
desc2.putBoolean(cTID('ohQA'), true);
desc2.putBoolean(cTID('ohCA'), false);
desc2.putBoolean(cTID('ohIZ'), true);
desc2.putEnumerated(cTID('ohTC'), cTID('SToc'), cTID('OC03'));
desc2.putEnumerated(cTID('ohAC'), cTID('SToc'), cTID('OC03'));
desc2.putInteger(cTID('ohIn'), -1);
desc2.putEnumerated(cTID('ohLE'), cTID('STle'), cTID('LE03'));
desc2.putEnumerated(cTID('ohEn'), cTID('STen'), cTID('EN00'));
desc2.putBoolean(cTID('olCS'), false);
desc2.putEnumerated(cTID('olEC'), cTID('STst'), cTID('ST00'));
desc2.putEnumerated(cTID('olWH'), cTID('STwh'), cTID('WH01'));
desc2.putEnumerated(cTID('olSV'), cTID('STsp'), cTID('SP04'));
desc2.putEnumerated(cTID('olSH'), cTID('STsp'), cTID('SP04'));
var list1 = new ActionList();
var desc3 = new ActionDescriptor();
desc3.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC00'));
list1.putObject(cTID('SCnc'), desc3);
var desc4 = new ActionDescriptor();
desc4.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC19'));
list1.putObject(cTID('SCnc'), desc4);
var desc5 = new ActionDescriptor();
desc5.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC28'));
list1.putObject(cTID('SCnc'), desc5);
var desc6 = new ActionDescriptor();
desc6.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC24'));
list1.putObject(cTID('SCnc'), desc6);
var desc7 = new ActionDescriptor();
desc7.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC24'));
list1.putObject(cTID('SCnc'), desc7);
var desc8 = new ActionDescriptor();
desc8.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC24'));
list1.putObject(cTID('SCnc'), desc8);
desc2.putList(cTID('olNC'), list1);
desc2.putBoolean(cTID('obIA'), false);
desc2.putString(cTID('obIP'), "");
desc2.putEnumerated(cTID('obCS'), cTID('STcs'), cTID('CS01'));
var list2 = new ActionList();
var desc9 = new ActionDescriptor();
desc9.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC01'));
list2.putObject(cTID('SCnc'), desc9);
var desc10 = new ActionDescriptor();
desc10.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC20'));
list2.putObject(cTID('SCnc'), desc10);
var desc11 = new ActionDescriptor();
desc11.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC02'));
list2.putObject(cTID('SCnc'), desc11);
var desc12 = new ActionDescriptor();
desc12.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC19'));
list2.putObject(cTID('SCnc'), desc12);
var desc13 = new ActionDescriptor();
desc13.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC06'));
list2.putObject(cTID('SCnc'), desc13);
var desc14 = new ActionDescriptor();
desc14.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC24'));
list2.putObject(cTID('SCnc'), desc14);
var desc15 = new ActionDescriptor();
desc15.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC24'));
list2.putObject(cTID('SCnc'), desc15);
var desc16 = new ActionDescriptor();
desc16.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC24'));
list2.putObject(cTID('SCnc'), desc16);
var desc17 = new ActionDescriptor();
desc17.putEnumerated(cTID('ncTp'), cTID('STnc'), cTID('NC22'));
list2.putObject(cTID('SCnc'), desc17);
desc2.putList(cTID('ovNC'), list2);
desc2.putBoolean(cTID('ovCM'), false);
desc2.putBoolean(cTID('ovCW'), false);
desc2.putBoolean(cTID('ovCU'), true);
desc2.putBoolean(cTID('ovSF'), true);
desc2.putBoolean(cTID('ovCB'), true);
desc2.putString(cTID('ovSN'), "images");
desc1.putObject(cTID('Usng'), sTID("SaveForWeb"), desc2);
executeAction(sTID('export'), desc1, dialogMode);
};
step1(); // ‘‚«o‚µ
};
//=========================================
// webPngOut.main
//=========================================
//
webPngOut.main = function () {
webPngOut();
};
webPngOut.main();
// EOF
"webPngOut.jsx"
// EOF
使ったデータ
http://www.mediafire.com/download/da969et1snc7p02/PhotoShopFillRedPng24.zip
関連
http://sourceforge.net/projects/ps-scripts/files/xtools/
に
xtools/xlib/xml/atn2js.jsx
がありatnアクションを変換した。
バックアップ。
http://www.mediafire.com/download/d1cahadahzhh996/xtools-2_2.zip
- | whaison | jsx(ExtendScriptToolKit) | 18:05 | comments(0) | - | pookmark |