/*
トラック内のキーの値を変更してみるテスト
*/
fn Test_TrackView =
(
format "Test start\n"
-- トラック選択ダイアログを表示する
theInt = 0 -- ダイアログのオプション用変数
theInt = bit.set theInt 1 true --animated tracks only
-- theInt = bit.set theInt 3 true --display selected nodes only
-- Track View Pick Dialogを表示
tvp = trackview.pickTrackDlg options:theInt
if tvp == undefined then return undefined
-- 選択ノードのsubAnimを取得
a = tvp.anim
if a == undefined then return undefined
-- Transformを選択してOKクリックだと3 Transform/Positionを選択した場合0
format "a.numSubs %\n" a.numSubs -- 選択ノードの子ノード数が返った
for i = 1 to a.numSubs do
(
-- 子ノードの名前の取得
n = getSubAnimName a i
format "name %\n" n
-- コントローラーの取得
c = a[i].Controller
if c != undefined then
(
-- コントローラーからキーの配列を取得
k = c.keys
--kp = k[#position] -- ERROR
--format "kp %\n" kp[3].value
format "k.count %\n" k.count -- キーフレーム数が返った
-- MAXKey
--format "MaxKey %\n" k[2]
--if n == "#position" then
-- if 0 == stricmp n "#position" then -- 実行されない
if 0 == stricmp n "position" then -- #がいらない
(
format "POSITION\n"
-- 移動アニメを無効にしてみるテスト 変更できた
for j = 1 to k.count do
(
k[j].value.z = 0.0
)
)
format "key value %\n" k[2].value -- キーの値が出力された
)
)
format "tvp.name %\n" tvp.name -- 選択したオブジェクトの名前?
format "tvp.subNum %\n" tvp.subNum -- subAnimの数
format "Test end\n"
)
-- Test関数の実行
Test_TrackView()