blog

2015/07/23

MAXscript リセットオールトランスフォーム的な

SIでいう「Ctrl+Shift+R」
リセットオールトランスフォームが欲しかっただけなのです。
標準機能で無さそうだったのではぢめてのMAXscriptとなりました。

こんな感じ
oSel = selection.count;

if oSel == 0 then (
    print "何も選択されていません";
)else if val == 1 then (
    in coordsys parent $.pos = [0,0,0]
 in coordsys parent $.scale = [1,1,1]
 in coordsys parent $.rotation = (quat 0 0 0 0)
)else(
 in coordsys parent $selection.pos = [0,0,0]
 in coordsys parent $selection.scale = [1,1,1]
 in coordsys parent $selection.rotation = (quat 0 0 0 0)
)

何とか動いてるっぽいからとりあえずコレでいいや(´・ω・`)
こいつをショートカット登録したかったのでマクロスクリプトとやらにして

macroScript Reset_Transform
category:"My_Tools"
toolTip:"Reset_Transform"
(
 oSel = selection.count;
 
 if oSel == 0 then (
  print "何も選択されていません";
 )else if val == 1 then (
  in coordsys parent $.pos = [0,0,0]
  in coordsys parent $.scale = [1,1,1]
  in coordsys parent $.rotation = (quat 0 0 0 0)
 )else(
  in coordsys parent $selection.pos = [0,0,0]
  in coordsys parent $selection.scale = [1,1,1]
  in coordsys parent $selection.rotation = (quat 0 0 0 0)
 )

)

ひとまず完成。
 

2015/06/08

Maya 選択しているオブジェクトのアニメーションオフセット

ググったけどそんな感じのmelさん見当たらなかったので、
コピペして勘で弄ったらとりあえず動いたのでメモ。
時間ないからとりあえず動けば良い。後でちゃんと調べて汎用性高くしたいが。。

string $obj[] = `ls -sl`;
string $attrList[] = `listConnections -s 1 -type "animCurve" $obj`;

selectKey -add -k $attrList ;
keyframe -animation keys -option over -relative -timeChange (0 + 10) ;



-timeChangeのところにオフセットさせるフレーム数入れる。

2015/05/08

複数アウトライナ

とりあえずメモ。
 
SDKに書いてあったのとネットで拾ったのくっつけただけだけど。
何が起きてるのかよく分かってないけど挙動は大体望んだ感じに
なってるからOKってことにしておこう。。 
 
しかしWindowが指定した大きさ以下にならないのが何でだか分からんけどとりあえず
後回しにしてお仕事お仕事ε≡≡ヘ( ´Д`)ノ 
 
 
window -t "Outliner"; 
frameLayout -labelVisible false -h 400 -w 280;;
string $panel = `outlinerPanel`;
string $outliner = `outlinerPanel -query -outlinerEditor $panel`;
outlinerEditor -edit
    -mainListConnection "worldList"
    -selectionConnection "modelList"
    -showShapes false
    -showReferenceNodes false
    -showReferenceMembers false
    -showAttributes false
    -showConnected false
    -showAnimCurvesOnly false
    -autoExpand false
    -showDagOnly true
    -ignoreDagHierarchy false
    -expandConnections false
    -showCompounds true
    -showNumericAttrsOnly false
    -highlightActive true
    -autoSelectNewObjects false
    -doNotSelectNewObjects false
    -transmitFilters true
    -showSetMembers true
    -setFilter defaultSetFilter
    $outliner;
showWindow;