Beauty Salon α-BET (alphabet)

space001
Blender3d Collada dae modeling Use Papervision3d on Progression3 and 4 http://a-bet.secret.jp/#/access
more whaison works.
whaison space
space002
http://whaison.jugem.jp/ https://jp.pinterest.com/whaison/ https://www.instagram.com/whaison/ https://whaison.amebaownd.com/
https://suzuri.jp/whaison
http://whaison.blogspot.com/
http://whaison.tumblr.com/ http://qiita.com/users/whaison http://www.behance.net/whaison https://github.com/whaison/ https://bitbucket.org/whaison http://serato.com/user/whaison http://whaison.hatenablog.jp/

typo memo
http://d.hatena.ne.jp/whaison/


dayNote
http://www.myspace.com/whaison http://ameblo.jp/whaison/ http://blog.crooz.jp/whaison/ http://blog.crooz.jp/whaisoncafe/ http://nenpyo.org/whaison

fulldisk
http://full.shin-gen.jp/
http://whaison.client.jp/
http://www.dclog.jp/whaison/
featured forums.
space004
forum.unity3d.com/

forums.unrealengine.com.

Progression Forum.

FlashDevelop Forum.

Papervision3D Forum.

FlexUserGroup Forum.

SparkProjectForum.





Twitter







Mobile
qrcode
Calendar
SunMonTueWedThuFriSat
1234567
891011121314
15161718192021
22232425262728
293031    
<< March 2015 >>
New Entries
Archives
Categories
Recent comment
  • FlashDevelopでフォント埋め込み
    感謝!! (12/24)
  • cocos2d-x-3.0rc0 ,c++ ,cpp でTexturePacker で 吐き出した、plist と png でパラパラアニメーションのコード例
    whaison (04/17)
  • Blender2.67にbvh(web上に2500個以上ころがってる)入れてそのBoneオブジェクトをUnity4.0のmecanimで使う
    whaison (08/19)
  • Apple Dev Center 「Certificates, Identifiers & Profiles」で Adhoc をつくってXCode4.6.1でArchiveしてipaを書き出し
    whaison (04/30)
  • Flash CS6でプロパティーパネルで物理演算のジャンプの高さを設定できるCitrus Engine
    whaison (03/01)
  • 「Flash以外、例えばKinectとか」ON TOKYO (会場:高田馬場4-11-8 Floor 6階 ) 短縮URL http://bit.ly/dI0Bfx
    uka (03/02)
  • App Store Review Guidelines アップル社のアプリ審査基準ガイドライン和訳 Apple が 開発者を悩ませ ユーザーをハッピーにしたいガイドライン。w
    whaison (01/25)
  • Unity3d では ADOBE JAPAN OSAKIで行われたFITC 2010 TOKYOでは、 「iOS用にパブリッシュするためには、フリー版ではなくて、有料版を買ってください。さらに追加のパッケージである、"iOS Package (for Development)"を買ってください」とのことだった。
    whaison (01/25)
  • enjoy Adidas-Futsal-Park
    whaison (01/16)
  • MacBookAir にFlashPlayer入れたらなった。Mac Flash Player 10.1/10.2でUstream などでカメラが認識されないバグそんなときはUstreamProducer!でもなくiPhoneだと直ぐにライブ配信できた
    whaison (01/14)
simple sintax high lighter2.0
space003
SyntaxHighlighter2.0用 の貼り付けコード作成する!
ブログパーツ-BLOG PARTS.
Profile
Links
Recommend
Sponsored Links
Admin
無料ブログ作成サービス JUGEM
Seach this site
            
2022.03.28 Monday
スポンサーサイト

一定期間更新がないため広告を表示しています

| スポンサードリンク | - | | - | - | pookmark |
            
2015.03.30 Monday
定義済みのデリゲートAction C#
定義済みのデリゲートAction C#
https://msdn.microsoft.com/ja-jp/library/system.action(v=vs.110).aspx

-------------------------------------------普通なデリゲート---------------------------------------------------
SelectedPlayerManager.cs
using UnityEngine;
using System;
using System.Collections;
using System.Diagnostics;
namespace UnityChan
{


        /// <summary>
        /// ///////////////////////////////EventHandler
        /// </summary>

        public delegate void PlayerChangedEventHandler(object sender, PlayerChangedEventArgs eventArgs);

        SelectedPlayerId selectedPlayer;
        public class PlayerChangedEventArgs : EventArgs 
        {
                private SelectedPlayerId player_;

                //Constructor.
                public PlayerChangedEventArgs(SelectedPlayerId player) 
                {
                        player_ =player;
                }


                public SelectedPlayerId getNewPlayer() 
                {
                        return player_;
                }
        }



        ///////////////
        /// 
        /// ///////////////////////////////EnevtHandler
        /// 



        public class SelectedPlayerManager : MonoBehaviour
        {
                #region Singleton

                private static SelectedPlayerManager instance = null;

                public static SelectedPlayerManager Instance {
                        get {
                                if (instance == null) {
                                        instance = FindObjectOfType<SelectedPlayerManager> ();
                                }
                                return instance;
                        }
                }

                #endregion






              public SelectedPlayerId SelectedPlayer {
                        get {
                                return selectedPlayer;
                        }
                        set {

                                selectedPlayerOLD = selectedPlayer;
                                UnityEngine.Debug.Log ("/////SelectedPlayerManager---------------SelectedPlayer=" + value);
                                selectedPlayer = value;

                                ///////////////////////////////////////
                                didPlayerChangeEvent(selectedPlayer);
                                ////////////////////////////////////////
                        }
                }

                  void Start(){
                        /// ////////////////////////////
                        EventHandler += OnPlayerChangedEventHandler;
                        /// ///////////////////////////
                }

                  public event PlayerChangedEventHandler EventHandler;

                  private void didPlayerChangeEvent(SelectedPlayerId player)
                {
                        PlayerChangedEventArgs eventArgs = new PlayerChangedEventArgs( SelectedPlayerManager.Instance.SelectedPlayer);
                        if (EventHandler != null) {
                                EventHandler (this, eventArgs);
                        }
                }


        }
}
SelectedPlayerId.cs

using System.Collections;
using UnityEngine;

namespace UnityChan
{ 
        public enum SelectedPlayerId
        {
                none=0,
                unitychan_live,
                unitychan_dynamic_locomotion,
                unitychan_hw,


        }
}
ThirdPersonCamera.cs

using UnityEngine;
using System.Collections;
using System.Collections.Generic;
using UnityChan;

namespace UnityChan
{
        public class ThirdPersonCamera : MonoBehaviour
        {
                public GameObject selectedPlayer;

                  public void OnPlayerChangedEventHandler(object sender, PlayerChangedEventArgs eventArgs){
                        Debug.Log ("///ThirdPersonCamera----OnPlayerChangedEventHandler-----eventArgs.getNewPlayer=" + eventArgs.getNewPlayer());


                        SelectPlayerChenge ();
                }
                void Start ()
                {
                        ////////////////////////////////////////////////add EventHandler
                        SelectedPlayerManager.Instance.EventHandler += OnPlayerChangedEventHandler;
                        /////////////////////////////////////////////////////////
                          SelectPlayerChenge ();
                  }
                  void SelectPlayerChenge(){
                  }
          }
}


-----------------------------------------------------------------------------------------------------------
------------------------------------定義済みのデリゲートAction C#------------------------------
MyClassA.cs

using System;
using UnityEngine;
using System.Collections;

public class MyClassA
{
    private string instanceName;

    public MyClassA(string name)
    {
        this.instanceName = name;
        //return this;
    }
        

    public void DisplayToWindow()
    {
        Debug.Log ("DisplayToWindow---" + this.instanceName);

    }
}

MyActionDelegates.cs

using System;
using UnityEngine;
using System.Collections;

public class MyActionDelegates : MonoBehaviour {
    public Action showMethod;
    void Start () {

        MyClassA testName = new MyClassA("Koani");
        showMethod+= testName.DisplayToWindow;
        showMethod();
        //showMethod=-=testName.DisplayToWindow;

        Debug.Log("what?");
    }
}
出力
DisplayToWindow---Koani
what?
-----------------------------------------------------------------------------------------------------------
| whaison | Unity3d | 19:02 | comments(0) | - | pookmark |
            
2015.03.27 Friday
illustrator8形式.aiで保存したデータをMayaで開いてフェースを作成。
illustrator8形式.aiで保存したデータをMayaで開いてフェースを作成。

AiToFace001.mel

createNode makeIllustratorCurves -n "illustratorForBevel#";
// 結果: illustratorForBevel1 // 
setAttr -type "string" illustratorForBevel1.illustratorFilename "/Users/otsuka-noboru/works/Unity5Tutorial/Maya2DCharaMotion/2dtoolkit/Temp/temp/file080162756191567.ai";
createNode bevelPlus;
// 結果: bevelPlus1 // 
createNode styleCurve -n "innerStyleCurve#";
// 結果: innerStyleCurve1 // 
createNode styleCurve -n "outerStyleCurve#";
// 結果: outerStyleCurve1 // 
setAttr outerStyleCurve1.style 0;
setAttr innerStyleCurve1.style 0;
setAttr bevelPlus1.width 0;
setAttr bevelPlus1.depth 0;
setAttr bevelPlus1.extrudeDepth 0.1;
setAttr bevelPlus1.capSides 4;
setAttr bevelPlus1.numberOfSides 4;
setAttr bevelPlus1.tolerance 0.01;
setAttr bevelPlus1.bevelInside 0;
setAttr bevelPlus1.normalsOutwards true;
setAttr bevelPlus1.polyOutUseChordHeight false;
setAttr bevelPlus1.polyOutUseChordHeightRatio false;
setAttr bevelPlus1.orderedCurves true;
createNode mesh;
// 結果: polySurfaceShape1 // 
connectAttr illustratorForBevel1.outputCurves bevelPlus1.inputCurves;
connectAttr illustratorForBevel1.count bevelPlus1.count;
connectAttr illustratorForBevel1.position bevelPlus1.position;
connectAttr innerStyleCurve1.outCurve bevelPlus1.innerStyleCurve;
connectAttr outerStyleCurve1.outCurve bevelPlus1.outerStyleCurve;
connectAttr bevelPlus1.outputPoly polySurfaceShape1.inMesh;
sets -edit -forceElement initialShadingGroup polySurfaceShape1;
select polySurfaceShape1;
 int $intArr[] = `polyEvaluate -v`; int $numVerts = 0; if (size($intArr) > 0) $numVerts = $intArr[0]; if ($numVerts == 0) { catch(error("ベベルの出力の作成に失敗しました")); delete illustratorForBevel1 bevelPlus1 polySurface1 innerStyleCurve1 outerStyleCurve1 ; } else if ($numVerts > 0) { polyCleanupArgList 3 { "0","2","1","0","1","0","0","0","0","1e-005","0","1e-005","1","0","0","-1","0" };
polyProjection -ch 1 -type Planar -ibd off -icx 0.5 -icy 0.5 -ra 0 -isu 1 -isv 1 -md z ;
select -r `listConnections -t "shape"`;
};
changeSelectMode -object;


関連
http://detail.chiebukuro.yahoo.co.jp/qa/question_detail/q1458698824

「Mayaのメニューの[作成]にある[Adobe(R)Illustrator(R)オブジェクト]からインポートできます。オプションでカーブを選択するとNurbusカーブとして作成され、ベベルを選ぶとポリゴンとして作成されますが、ベベルが入っているとのちのち作業しにくいので、ベベルの幅とデプスは0で読み込むことをオススメします。」
の部分

 
| whaison | MEL(Maya Embedded Language) | 19:41 | 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 |
            
2015.03.25 Wednesday
Unity C# Statsを実機でも表示したくて FPSとメモリ使用量を表示するスクリプト
AllocationStatsをカスタマイズしてみた。らしいProfileStatsだが
FPSががたつきすぎて目視できないので

http://ftvoid.com/blog/post/773
上記サイトを参考に変更してみた。

using UnityEngine;
using System.Collections;
using System.Text;
using System.Linq;

//[ExecuteInEditMode()]

public class ProfileAllocationFpsMeasureStats : MonoBehaviour
{
    //------------------------------------------------------------
    // constant
    //------------------------------------------------------------
    public const int    SIZE_KB = 1024;
    public const int    SIZE_MB = 1024 * 1024;
    int frameCount;
    int frameCountOld;
    float nextTime;
    //------------------------------------------------------------
    // Start
    //------------------------------------------------------------
    void Start()
    {
        useGUILayout = false;
        nextTime = Time.time + 1;
    }
    void Update () {
        frameCount++;

        if ( Time.time >= nextTime ) {
            // 1秒経ったらFPSを表示
            Debug.Log("FPS : " + frameCount);
            frameCountOld = frameCount;
            frameCount = 0;
            nextTime += 1;
        }
    }
    //------------------------------------------------------------
    // OnGUI
    //------------------------------------------------------------
    void OnGUI()
    {
        // profile
        profileStats();
        // draw
        if( m_IsShow ){
            if( Application.isPlaying ){
                drawStats();
            }else{
                if( m_IsShowEditor ){
                    drawStats();
                }
            }
        }
    }

    //------------------------------------------------------------
    // profile stats
    //------------------------------------------------------------
    private void    profileStats()
    {
        // check GC
        int collCount = System.GC.CollectionCount( 0 );
        if( m_LastCollectNum != collCount )
        {
            m_LastCollectNum        = collCount;
            m_CollectDeltaTime      = Time.realtimeSinceStartup - m_LastCollectTime;
            m_LastCollectTime       = Time.realtimeSinceStartup;
            m_LastCollectDeltaTime  = Time.deltaTime;
            m_CollectMemSize        = m_UsedMemSize;
        }

        // check memory
        m_UsedMemSize = System.GC.GetTotalMemory( false );  // byte
        if( m_UsedMemSize > m_MaxUsedMemSize ){
            m_MaxUsedMemSize = m_UsedMemSize;
        }

        // calc alloc rate
        if( (Time.realtimeSinceStartup - m_LastAllocSet) > 0.3f )
        {
            long diff = m_UsedMemSize - m_LastAllocMemSize;

            m_LastAllocMemSize  = m_UsedMemSize;
            m_LastAllocSet      = Time.realtimeSinceStartup;

            if( diff >= 0 ){
                m_AllocRate = diff;
            }
        }
    }
    //------------------------------------------------------------
    // draw stats
    //------------------------------------------------------------
    private void    drawStats()
    {
        // make string with builder
        StringBuilder text = new StringBuilder();

        //----------------------------------
        // FPS
        text.Append( frameCountOld + " : FPS" )
            .AppendLine();
        //--------------------------------------
        // FPS
        text.Append( (1f/Time.deltaTime).ToString("0.000") + " FPS" )
            .AppendLine();

        // current memory
        text.Append( "Used Mem                      " )
            .Append( ((float)m_UsedMemSize / SIZE_MB).ToString("0.00") + " MB" )
            .AppendLine();
        // max used memory
        text.Append( "Max Used Mem              " )
            .Append( ((float)m_MaxUsedMemSize / SIZE_MB).ToString("0.00") + " MB" )
            .AppendLine();
        // Profiler.usedHeapSize
        text.Append( "Used Prog Heap                " )
            .Append( ((float)Profiler.usedHeapSize / SIZE_MB).ToString("0.00") + " MB" )
            .AppendLine();
| whaison | Unity3d | 11:38 | comments(0) | - | pookmark |
            
2015.03.24 Tuesday
MEL(Maya Embedded Language)003-複数の板ポリをメッシュ結合してUVとマテリアルをつくってテクスチャのファイルにpngを貼付けて UVごとに分解し別メッシュにする。

MEL(Maya Embedded Language)002-複数の板ポリにマテリアルをつくってテクスチャのファイルにpngを貼付ける
http://whaison.jugem.jp/?eid=658
を実行したあとに。

MEL(Maya Embedded Language)003-複数の板ポリをメッシュ結合してUVとマテリアルをつくってテクスチャのファイルにpngを貼付けて UVごとに分解し別メッシュにする。

今回はこの部分UVというかFaceごとに分解し別メッシュにする。

やってる作業はメッシュごとコピーしていらないフェースを削除する。って作業。

メッシュの最大faceの長さの取り方がわからなかったので固定にしてありますのよ。

//------------------------------
int $undalate_int;
$undalate_int = 0;
int $box;
$box = 0;
int $i;
for( $box=0; $box<16; ++$box )
{
                print "###################### undalate_int ==";
                print $undalate_int;
                print " #################################¥n";



select -r pPlane17 ;
move 4 0 0;
//複製したら0 0 0へ移動
duplicate -rr;
move 0 0 0;
//rename "pPlane118" ;
//string $planeName
//$planeName=ls -selection;

string $names[] = `ls -sl`; 
                print "-----names[0] ==";
                print $names[0];
                print " -----¥n";
select -r $names[0] ;

//string $faceNameLengthStr;
//int $faceNameLengthInt;
               //$faceNameLengthStr=$names[0]+".f[].length";
               //$faceNameLengthStr=$names[0]+".f.length";
               //$faceNameLengthInt=eval($faceNameLengthStr);
//print "-----faceNameLengthInt ==";
                //print $faceNameLengthInt;
//print " -----¥n";

for( $i=15; $i>-1; --$i )
{
            string $faceName;
               $faceName=$names[0]+".f["+$i+"]";
               print "-----faceName ";
                print $faceName;
                print " -----¥n";
                
            if($undalate_int==$i){
                print "---------------------live ";
                print $i;
                print " -----------------------¥n";
            }else{
               // select -tgl |pPlane18.f[$i] ;
               
                select -tgl $faceName ;
                //doDelete;
                delete $faceName;
                //polyCut -deleteFaces true;
                //delete -tgl |pPlane18.f[$i] ;
                //select -tgl |pPlane18.f[2] ;
                print "-----del ";
                print $i;
                print " -----¥n";
            }
                    
}
//doDelete;
//delete;
$undalate_int=$undalate_int+1;
}
//select -tgl |pPlane18.f[1] ;
//select -tgl |pPlane18.f[2] ;
//select -tgl |pPlane18.f[3] ;
//select -tgl |pPlane18.f[4] ;
//select -tgl |pPlane18.f[5] ;
//select -tgl |pPlane18.f[6] ;
//select -tgl |pPlane18.f[7] ;
//select -tgl |pPlane18.f[8] ;
//select -tgl |pPlane18.f[9] ;
//select -tgl |pPlane18.f[10] ;
//select -tgl |pPlane18.f[11] ;
//select -tgl |pPlane18.f[12] ;
//select -tgl |pPlane18.f[13] ;
//select -tgl |pPlane18.f[14] ;
//select -tgl |pPlane18.f[15] ;


//------------------------------


できたー!!!!

| whaison | MEL(Maya Embedded Language) | 11:10 | comments(0) | - | pookmark |
            
2015.03.23 Monday
MEL(Maya Embedded Language)002-複数の板ポリにUVとマテリアルをつくってテクスチャのファイルにpngを貼付ける
MEL(Maya Embedded Language)002-複数の板ポリにマテリアルをつくってテクスチャのファイルにpngを貼付ける


この画像をダウンロードして保存して下のmelの内部パスに設定。


新規ファイル
ビュー>定義済みのブックマーク>上面
を選択して。



2、そのあとこれ実行

※MayaLT2015用です。
MayaPro2015 は「phong1」を「lambert1」に検索置換してください。


polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r -1.5 0 -1.5 ;
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r -0.5 0 -1.5 ;
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r 0.5 0 -1.5 ;
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r 1.5 0 -1.5 ;
//----------------------------------------
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r -1.5 0 -0.5 ;
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r -0.5 0 -0.5 ;
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r 0.5 0 -0.5 ;
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r 1.5 0 -0.5 ;
//---------------------------------------
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r -1.5 0 0.5 ;
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r -0.5 0 0.5 ;
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r 0.5 0 0.5 ;
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r 1.5 0 0.5 ;
//---------------------------------------
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r -1.5 0 1.5 ;
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r -0.5 0 1.5 ;
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r 0.5 0 1.5 ;
polyPlane -ch on -o on -w 1 -h 1 -sw 1 -sh 1 -cuv 2 ;move -r 1.5 0 1.5 ;
select -r pPlane1 pPlane2 pPlane3 pPlane4 pPlane5 pPlane6 pPlane7 pPlane8 pPlane9 pPlane10 pPlane11 pPlane12 pPlane13 pPlane14 pPlane15 pPlane16 ;
polyUnite -ch 1 -mergeUVSets 1 -name pPlane1 pPlane1 pPlane2 pPlane3 pPlane4 pPlane5 pPlane6 pPlane7 pPlane8 pPlane9 pPlane10 pPlane11 pPlane12 pPlane13 pPlane14 pPlane15 pPlane16;
rename |pPlane17|pPlane17Shape "pPlane1" ;
// 結果: pPlane17 polyUnite1 // 

// 結果: uvSet1camera // 



//hilite pPlane1 ;
selectMode -component ;
select -r pPlane1.f[0:15] ;
polyProjection -type Planar -md p -cm on -uvSetName uvSet1camera pPlane1.f[0:15];
// 結果: polyPlanarProj1 // 
polyUVSet -luv;


ShowShadingGroupAttributeEditor;
showEditor initialShadingGroup;
defaultNavigation -createNew -destination "phong1.color";
createRenderNode -allWithTexturesUp "defaultNavigation -force true -connectToExisting -source %node -destination phong1.color" "";
defaultNavigation -defaultTraversal -destination "phong1.color";
shadingNode -asTexture file;
// 結果: file1 // 
shadingNode -asUtility place2dTexture;
// 結果: place2dTexture1 // 
connectAttr -f place2dTexture1.coverage file1.coverage;
// 結果: place2dTexture1.coverage を file1.coverage に接続しました。 // 
connectAttr -f place2dTexture1.translateFrame file1.translateFrame;
// 結果: place2dTexture1.translateFrame を file1.translateFrame に接続しました。 // 
connectAttr -f place2dTexture1.rotateFrame file1.rotateFrame;
// 結果: place2dTexture1.rotateFrame を file1.rotateFrame に接続しました。 // 
connectAttr -f place2dTexture1.mirrorU file1.mirrorU;
// 結果: place2dTexture1.mirrorU を file1.mirrorU に接続しました。 // 
connectAttr -f place2dTexture1.mirrorV file1.mirrorV;
// 結果: place2dTexture1.mirrorV を file1.mirrorV に接続しました。 // 
connectAttr -f place2dTexture1.stagger file1.stagger;
// 結果: place2dTexture1.stagger を file1.stagger に接続しました。 // 
connectAttr -f place2dTexture1.wrapU file1.wrapU;
// 結果: place2dTexture1.wrapU を file1.wrapU に接続しました。 // 
connectAttr -f place2dTexture1.wrapV file1.wrapV;
// 結果: place2dTexture1.wrapV を file1.wrapV に接続しました。 // 
connectAttr -f place2dTexture1.repeatUV file1.repeatUV;
// 結果: place2dTexture1.repeatUV を file1.repeatUV に接続しました。 // 
connectAttr -f place2dTexture1.offset file1.offset;
// 結果: place2dTexture1.offset を file1.offset に接続しました。 // 
connectAttr -f place2dTexture1.rotateUV file1.rotateUV;
// 結果: place2dTexture1.rotateUV を file1.rotateUV に接続しました。 // 
connectAttr -f place2dTexture1.noiseUV file1.noiseUV;
// 結果: place2dTexture1.noiseUV を file1.noiseUV に接続しました。 // 
connectAttr -f place2dTexture1.vertexUvOne file1.vertexUvOne;
// 結果: place2dTexture1.vertexUvOne を file1.vertexUvOne に接続しました。 // 
connectAttr -f place2dTexture1.vertexUvTwo file1.vertexUvTwo;
// 結果: place2dTexture1.vertexUvTwo を file1.vertexUvTwo に接続しました。 // 
connectAttr -f place2dTexture1.vertexUvThree file1.vertexUvThree;
// 結果: place2dTexture1.vertexUvThree を file1.vertexUvThree に接続しました。 // 
connectAttr -f place2dTexture1.vertexCameraOne file1.vertexCameraOne;
// 結果: place2dTexture1.vertexCameraOne を file1.vertexCameraOne に接続しました。 // 
connectAttr place2dTexture1.outUV file1.uv;
// 結果: place2dTexture1.outUV を file1.uvCoord に接続しました。 // 
connectAttr place2dTexture1.outUvFilterSize file1.uvFilterSize;
//----------------------------------------------------------------------------
setAttr ("file1.fileTextureName") -type "string" "/Users/otsuka-noboru/Documents/1024x1024_number.png";
//-----------------------------------------------------------------------
// 結果: place2dTexture1.outUvFilterSize を file1.uvFilterSize に接続しました。 // 
defaultNavigation -force true -connectToExisting -source file1 -destination phong1.color; window -e -vis false createRenderNodeWindow;
//connectAttr -force file1.outColor phong1.color;
// 結果: file1.outColor を phong1.color に接続しました。 // 
// 結果: createRenderNodeWindow // 
select -r pPlane17.f[0:15] ;
select -r pPlane17.vtx[0:63] ;
polyCopyUV -uvSetNameInput "uvSet1camera" -uvSetName "map1"  -ch 1 pPlane17.vtx[0:63];

できた!!!!


| whaison | MEL(Maya Embedded Language) | 18:40 | comments(0) | - | pookmark |
            
2015.03.23 Monday
MEL(Maya Embedded Language)001-板ポリにマテリアルをつくってテクスチャのファイルにjpgを貼付ける
MEL(Maya Embedded Language)001-板ポリにマテリアルをつくってテクスチャのファイルにjpgを貼付ける

※MayaLT用です。
MayaPro板 は「phong1」を「lambert1」に検索置換してください。



polyPlane -ch on -o on -w 1.094694 -h 0.98886 -sw 1 -sh 1 -cuv 2 ;
// 結果: pPlane1 polyPlane1 // 
ShowShadingGroupAttributeEditor;
showEditor initialShadingGroup;
defaultNavigation -createNew -destination "phong1.color";
createRenderNode -allWithTexturesUp "defaultNavigation -force true -connectToExisting -source %node -destination phong1.color" "";
defaultNavigation -defaultTraversal -destination "phong1.color";
shadingNode -asTexture file;
// 結果: file1 // 
shadingNode -asUtility place2dTexture;
// 結果: place2dTexture1 // 
connectAttr -f place2dTexture1.coverage file1.coverage;
// 結果: place2dTexture1.coverage を file1.coverage に接続しました。 // 
connectAttr -f place2dTexture1.translateFrame file1.translateFrame;
// 結果: place2dTexture1.translateFrame を file1.translateFrame に接続しました。 // 
connectAttr -f place2dTexture1.rotateFrame file1.rotateFrame;
// 結果: place2dTexture1.rotateFrame を file1.rotateFrame に接続しました。 // 
connectAttr -f place2dTexture1.mirrorU file1.mirrorU;
// 結果: place2dTexture1.mirrorU を file1.mirrorU に接続しました。 // 
connectAttr -f place2dTexture1.mirrorV file1.mirrorV;
// 結果: place2dTexture1.mirrorV を file1.mirrorV に接続しました。 // 
connectAttr -f place2dTexture1.stagger file1.stagger;
// 結果: place2dTexture1.stagger を file1.stagger に接続しました。 // 
connectAttr -f place2dTexture1.wrapU file1.wrapU;
// 結果: place2dTexture1.wrapU を file1.wrapU に接続しました。 // 
connectAttr -f place2dTexture1.wrapV file1.wrapV;
// 結果: place2dTexture1.wrapV を file1.wrapV に接続しました。 // 
connectAttr -f place2dTexture1.repeatUV file1.repeatUV;
// 結果: place2dTexture1.repeatUV を file1.repeatUV に接続しました。 // 
connectAttr -f place2dTexture1.offset file1.offset;
// 結果: place2dTexture1.offset を file1.offset に接続しました。 // 
connectAttr -f place2dTexture1.rotateUV file1.rotateUV;
// 結果: place2dTexture1.rotateUV を file1.rotateUV に接続しました。 // 
connectAttr -f place2dTexture1.noiseUV file1.noiseUV;
// 結果: place2dTexture1.noiseUV を file1.noiseUV に接続しました。 // 
connectAttr -f place2dTexture1.vertexUvOne file1.vertexUvOne;
// 結果: place2dTexture1.vertexUvOne を file1.vertexUvOne に接続しました。 // 
connectAttr -f place2dTexture1.vertexUvTwo file1.vertexUvTwo;
// 結果: place2dTexture1.vertexUvTwo を file1.vertexUvTwo に接続しました。 // 
connectAttr -f place2dTexture1.vertexUvThree file1.vertexUvThree;
// 結果: place2dTexture1.vertexUvThree を file1.vertexUvThree に接続しました。 // 
connectAttr -f place2dTexture1.vertexCameraOne file1.vertexCameraOne;
// 結果: place2dTexture1.vertexCameraOne を file1.vertexCameraOne に接続しました。 // 
connectAttr place2dTexture1.outUV file1.uv;
// 結果: place2dTexture1.outUV を file1.uvCoord に接続しました。 // 
connectAttr place2dTexture1.outUvFilterSize file1.uvFilterSize;

setAttr ("file1.fileTextureName") -type "string" "/Users/otsuka-noboru/Documents/whaison.tumblr.com_01.jpg";
// 結果: place2dTexture1.outUvFilterSize を file1.uvFilterSize に接続しました。 // 
defaultNavigation -force true -connectToExisting -source file1 -destination phong1.color; window -e -vis false createRenderNodeWindow;
connectAttr -force file1.outColor phong1.color;
// 結果: file1.outColor を phong1.color に接続しました。 // 
// 結果: createRenderNodeWindow // 


やっとできたー!!!!!!



| whaison | MEL(Maya Embedded Language) | 14:56 | comments(0) | - | pookmark |