motion

モーションの操作に使用する。


xshade
shape
motion

メソッド一覧

add_group 選択されているモーションポイントでポイントグループを新規作成する
copy 選択されているモーションポイントをコピーする
create_motion_point 指定されたシーケンス値にモーションポイントを追加作成する
delete_motion_point モーションポイントを削除する
deselect_all_motion_points すべてのモーションポイントを選択解除する
get_joint_offset 指定されたフレームでのジョイントオフセット値を評価して返す
get_joint_rotation 指定されたフレームでのジョイント回転値を評価して返す
get_joint_value 指定されたフレームでのジョイント値を返す
get_motion_point 指定したインデックスのモーションポイントを返す
get_motion_point_offset ボールジョイントやオブジェクトカメラのオフセット移動を返す
get_motion_point_rotation ボールジョイントの回転やオブジェクトカメラの向きを返す
get_number_of_motion_points モーションポイントの数を返す
load モーション設定ファイルを読み込む
paste コピーしたモーションポイントを現在のシーケンス値を基準に貼り付ける
prohibit_update モーションウインドウの更新を禁止する
resume_update モーションウインドウの更新を再開する
save モーション設定ファイルを保存する
select_all_motion_points すべてのモーションポイントを選択する
select_motion_point モーションポイントを追加選択する
set_motion_point_offset ボールジョイントやオブジェクトカメラのオフセット移動を設定する
set_motion_point_rotation ボールジョイントの回転やオブジェクトカメラの向きを設定する

プロパティ一覧

auto_key オートキーのオン/オフ
current_joint_offset 現在のジョイントのオフセット
current_joint_rotation 現在のジョイントの回転
current_joint_value カレントのジョイント
default_joint_offset デフォルトジョイントオフセット
default_joint_rotation デフォルトジョイント回転
default_joint_value ジョイントのデフォルト
default_max_joint_value ジョイントのデフォルト上限
default_min_joint_value ジョイントのデフォルト下限
max_joint_value ジョイントの上限
min_joint_value ジョイントの下限
repetition モーション曲線の繰返しの回数
sequence_mode シーケンスのオン/オフ




xshade.scene().active_shape()(選択形状の取得)のように形状を取得して使用する。

メソッド詳細

add_group

選択されているモーションポイントでポイントグループを新規作成する。
引数 :
  string : グループ名(過去互換用)
引数 :
  int : グループマーカーのインデックス

0
1
2
3
4
5

stringは過去互換用でShade9以降無効となる。引数の要素として必要なのでNoneなどを指定する。

#マーカー緑でグループを新規作成する
xshade.scene().active_shape().motion.add_group(None, 3)

copy

選択されているモーションポイントをコピーする。

xshade.scene().active_shape().motion.copy()

create_motion_point

指定されたシーケンス値にモーションポイントを追加作成する。
戻り値 :
  int : 作成されたモーションポイントのインデックス番号
引数 :
  float : シーケンス値
モーションポイントを追加すると、インデックス番号がソートされるので、作成されたモーションポイントのインデックス番号は戻り値から取得する。

#シーケンス90にモーションポイントを作成する
xshade.scene().active_shape().motion.create_motion_point(90)

delete_motion_point

モーションポイントを削除する。
引数 :
  int : モーションポイントのインデックス番号
参照 :
  motion_point

#インデックス2のモーションポイントを削除する
xshade.scene().active_shape().motion.delete_motion_point(2)

deselect_all_motion_points

すべてのモーションポイントを選択解除する。

xshade.scene().active_shape().motion.deselect_all_motion_points()

get_joint_offset

指定されたフレームでのジョイントオフセット値を評価して返す。
戻り値 :
  float3
引数 :
  float : シーケンス値

#フレーム100のオフセット値を出力する
print xshade.scene().active_shape().motion.get_joint_offset(100)

get_joint_rotation

指定されたフレームでのジョイント回転値を評価して返す。
戻り値 :
  quaternion
引数 :
  float : シーケンス値

#フレーム150のジョイント回転値を出力する
print xshade.scene().active_shape().motion.get_joint_rotation(150)

get_joint_value

指定されたフレームでのジョイント値を返す。
戻り値 :
  float
引数 :
  float : シーケンス値

#フレーム200のジョイント値を出力する
print xshade.scene().active_shape().motion.get_joint_value(200)

get_motion_point

指定したインデックスのモーションポイントを返す。
戻り値 :
  motion_pointオブジェクト
引数 :
  int : モーションポイントのインデックス番号
モーションポイントはシーケンス値順にソートされている。
参照 :
  motion_point

#インデックス0のモーションポイントのジョイント値を出力する
print xshade.scene().active_shape().motion.get_motion_point(0).value

get_motion_point_offset

ボールジョイントやオブジェクトカメラのオフセット移動を返す。
戻り値 :
  float3
引数 :
  int : モーションポイントのインデックス番号
参照 :
  motion_point

#インデックス0のオフセット値を出力する
print xshade.scene().active_shape().motion.get_motion_point_offset(0)

get_motion_point_rotation

ボールジョイントの回転やオブジェクトカメラの向きを返す。
戻り値 :
  quaternion
引数 :
  int : モーションポイントのインデックス番号
参照 :
  motion_point

#インデックス0の向きを出力する
print xshade.scene().active_shape().motion.get_motion_point_rotation(0)

get_number_of_motion_points

モーションポイントの数を返す。
戻り値 :
  int

#モーションポイントの数を出力する
print xshade.scene().active_shape().motion.get_number_of_motion_points()

load

モーション設定ファイルを読み込む。
引数 :
  file_path
参照 :
  save

#モーション設定ファイルを読み込む
dialog = xshade.create_dialog_with_uuid()
file_path = dialog.ask_path(True, '*.shdmtn|shdmtn')
xshade.scene().active_shape().motion.load(file_path)

paste

コピーしたモーションポイントを現在のシーケンス値を基準に貼り付ける

xshade.scene().active_shape().motion.paste()

prohibit_update

モーションウインドウの更新を禁止する。

xshade.scene().active_shape().motion.prohibit_update()

resume_update

モーションウインドウの更新を再開する。

xshade.scene().active_shape().motion.resume_update()

save

モーション設定ファイルに保存する。
引数 :
  file_path
参照 :
  load

#モーション設定ファイルに保存する
dialog = xshade.create_dialog_with_uuid()
file_path = dialog.ask_path(False, '*.shdmtn|shdmtn')
xshade.scene().active_shape().motion.save(file_path)

select_all_motion_points

すべてのモーションポイントを選択する。

xshade.scene().active_shape().motion.select_all_motion_points()

select_motion_point

モーションポイントを追加選択する。
引数 :
  int : モーションポイントのインデックス番号

#インデックス2を追加選択する
xshade.scene().active_shape().motion.select_motion_point(2)

set_motion_point_offset

ボールジョイントやオブジェクトカメラのオフセット移動を設定する。
引数 :
  int : モーションポイントのインデックス番号
引数 :
  float3
参照 :
  motion_point

#インデックス2にオフセット移動を設定する
xshade.scene().active_shape().motion.set_motion_point_offset(2,(100, 0.0, 0.0))

set_motion_point_rotation

ボールジョイントの回転やオブジェクトカメラの向きを設定する。
引数 :
  int : モーションポイントのインデックス番号
引数 :
  quaternion
参照 :
  motion_point

#インデックス2に向きを設定する
xshade.scene().active_shape().motion.set_motion_point_rotation(2,(1.0, 0.0, 0.0, 0.0))

プロパティ詳細

auto_key

オートキーのオン/オフ。

  • 取得
  • 設定

型 :
  bool

print xshade.scene().active_shape().motion.auto_key

current_joint_offset

現在のジョイントのオフセット。

  • 取得
  • 設定

型 :
  float3
ボールジョイントやオブジェクトカメラのオフセット移動を保持している。

print xshade.scene().active_shape().motion.current_joint_offset

current_joint_rotation

現在のジョイントの回転

  • 取得
  • 設定

型 :
  quaternion
ボールジョイントの回転やオブジェクトカメラの向きをクォータニオンで保持している。

print xshade.scene().active_shape().motion.current_joint_rotation

current_joint_value

カレントのジョイント。

  • 取得
  • 設定

型 :
  float

print xshade.scene().active_shape().motion.current_joint_value

default_joint_offset

デフォルトジョイントオフセット。

  • 取得
  • 設定

型 :
  float3
「ジョイントをリセット」を行ったときに適用される値。

print xshade.scene().active_shape().motion.default_joint_offset

default_joint_rotation

デフォルトジョイント回転。

  • 取得
  • 設定

型 :
  quaternion
「ジョイントをリセット」を行ったときに適用される値。

print xshade.scene().active_shape().motion.default_joint_rotation

default_joint_value

ジョイントのデフォルト。

  • 取得
  • 設定

型 :
  float
「ジョイントをリセット」を行ったときに適用される値

print xshade.scene().active_shape().motion.default_joint_value

default_max_joint_value

ジョイントのデフォルト上限。

  • 取得
  • 設定

型 :
  float
初期値以上の数値に設定することで、より広い範囲に有効なジョイントとなる。

print xshade.scene().active_shape().motion.default_max_joint_value

default_min_joint_value

ジョイントのデフォルト下限。

  • 取得
  • 設定

型 :
  float
初期値以下の数値に設定することで、より広い範囲に有効なジョイントとなる。

print xshade.scene().active_shape().motion.default_min_joint_value

max_joint_value

ジョイントの上限。

  • 取得
  • 設定

型 :
  float
ジョイントスライダのリミッタの位置が変更される。

print xshade.scene().active_shape().motion.max_joint_value

min_joint_value

ジョイントの下限。

  • 取得
  • 設定

型 :
  float
ジョイントスライダのリミッタの位置が変更される。

print xshade.scene().active_shape().motion.min_joint_value

repetition

モーション曲線の繰返しの回数。

  • 取得
  • 設定

型 :
  int
Shade7までのモーション全体の繰り返し回数。
Shade10でのモーションウインドウの「繰り返し」の数値には反映されない。

print xshade.scene().active_shape().motion.repetition

sequence_mode

シーケンスのオン/オフ。

  • 取得
  • 設定

型 :
  bool

print xshade.scene().active_shape().motion.sequence_mode