すべての種類の形状に共通する操作を扱う基本クラス。
形状の種類ごとに固有の情報を取得、設定するには、このクラスで形状の種類を判定して、それそれ固有のクラスを取得する。
xshade |
↑ |
shape |
activate | 形状を選択する |
adjust_transformation | パートの変換マトリクスを調節する |
begin_set_point | ワイヤーフレームの更新を一時的に停止する |
cancel_transformation | 上位パートにかかっている変換を相殺する |
clear_skin | 選択された頂点のスキンを解除する |
control_point | 引数で指定されたコントロールポイントオブジェクトを返す |
convert_to_polygon_mesh_with_divisions | 縦横の分割数を指定して、形状をポリゴンメッシュに変換する |
convert_to_polygon_mesh_with_subdivision_level | 分割レベルを指定して、形状をポリゴンメッシュに変換する |
copy | 形状をクリップボードにコピーする |
copy_object | 形状を複製する |
end_set_point | ワイヤーフレームの更新を再開する |
get_active_control_point | 指定したコントロールポイントの選択状態を返す |
get_tag_boolValue | tag名称をキーとして形状に登録されている値(bool)を取得する |
get_tag_doubleValue | tag名称をキーとして形状に登録されている値(double)を取得する |
get_tag_floatValue | tag名称をキーとして形状に登録されている値(float)を取得する |
get_tag_intValue | tag名称をキーとして形状に登録されている値(int)を取得する |
get_tag_stringValue | tag名称をキーとして形状に登録されている値(string)を取得する |
has_special_character | 形状名に引数で渡した特殊記号があるかどうかを返す |
has_symbol | 形状名に引数で渡した特殊記号があるかどうかを返す |
has_tag | 指定されたtag名称が形状に設定されているか |
hide | 選択形状を隠す |
inactivate | 選択を解除する |
is_control_point_selected | 指定したコントロールポイントが選択されているかどうかを返す |
move_links | リンク形状の変換を相殺する |
move_object | 形状を移動する |
paste | 形状をクリップボードからペーストする。 |
place_brother | 形状を下に移動する |
place_child | 形状を下に位置するパート内に移動する |
place_parent | 形状を上の階層の先頭に移動する |
place_sister | 形状を上に移動する |
pop_transformation_matrix | マトリクス値をスタックからポップして、パート形状の変換マトリクスに代入する |
push_transformation_matrix | パート形状の変換マトリクス値を(形状ごとの)スタックにプッシュする |
remove | 形状を削除する |
remove_tag | 形状に設定されたtagを削除する |
reset_transformation | 形状の変換状態は維持して変換マトリクスをリセットする |
select | 形状を選択する |
select_all_control_points | 全てのコントロールポイントを選択/非選択にする |
sequence_joint_matrix | 指定シーケンスのジョイントマトリクスを返す |
sequence_local_to_world_matrix | 指定シーケンスでのローカル座標系からワールド座標系へ変換するマトリクスを返す |
sequence_transformation | 指定したシーケンスでのマトリクスを返す |
sequence_world_to_local_matrix | 指定シーケンスでのワールド座標系からローカル座標系へ変換するマトリクスを返す |
set_active_control_point | 指定したコントロールポイントの選択状態を設定する |
set_axis_matrix | 回転体の軸を定義するマトリクスを設定する |
set_tag_boolValue | tag名称をキーとして値(bool)を形状にセットする |
set_tag_doubleValue | tag名称をキーとして値(double)を形状にセットする |
set_tag_floatValue | tag名称をキーとして値(float)を形状にセットする |
set_tag_intValue | tag名称をキーとして値(int)を形状にセットする |
set_tag_stringValue | tag名称をキーとして値(string)を形状にセットする |
solid_clear | 掃引体、回転体を通常の形状に復帰する |
solid_extrude | 掃引体を作成する |
solid_revolve | 回転体を作成する |
tag_value_type | tag名称をキーとしてセットした値を種類を取得する |
transform | 形状にマトリクス変換をかける |
update | 形状を更新する |
update_skin_bindings | 図形ウインドウのスキンに関するキャッシュデータを更新する |
active_vertex_indices | 選択されている頂点・コントロールポイントの番号のタプル |
axis_matrix | 回転体の軸を定義するマトリクス |
ball_joint | ボールジョイントインターフェイス |
bone_joint | ボーンジョイントインターフェイス |
bounding_box_size | バウンディングボックスのサイズ |
bro | 次の形状 |
browsable | 形状がブラウザウインドウに表示可能かどうか |
center_point | すべてのポイントや形状の重心の座標の平均値 |
center_position | バウンディングボックスの中心座標 |
custom_joint | カスタムジョイントインターフェイス |
dad | 親の形状 |
extrude | 掃引の方向と距離 |
flip_face | 面が反転されているかどうか |
has_bro | 次の形状が存在するかどうか |
has_dad | 親の形状が存在するかどうか |
has_motion | モーションを設定できる形状かどうか |
has_shadow_map_bias | シャドウマップバイアスの値が設定されているかどうか |
has_shadow_map_blur | シャドウマップブラーの値が設定されているかどうか |
has_shadow_map_size | シャドウマップサイズの値が設定されているかどうか |
has_sis | 前の形状が存在するかどうか |
has_son | (番兵sentinelでない)子の形状が存在するかどうか |
has_surface_attributes | 表面材質を持っているかどうか |
is_ball_joint | ボールジョイントかどうか |
is_bone_joint | ボーンジョイントかどうか |
is_container | 階層下に形状を含むことができるかどうか(パートかどうか) |
is_custom_joint | カスタムジョイントかどうか |
is_extruded | 掃引体かどうか |
is_light_effector | 光源ジョイントかどうか |
is_morph_effector | 変形ジョイントかどうか |
is_one_of_active_shapes | 形状が選択されているかどうか |
is_path_joint | パスジョイントかどうか |
is_revolved | 回転体かどうか |
is_rotator_joint | 回転ジョイントかどうか |
is_scale_joint | 拡大縮小ジョイントかどうか |
is_shown | 形状が表示されているかどうか |
is_slider_joint | 直線移動ジョイントかどうか |
is_sound_track | サウンドオブジェクトかどうか |
is_switch_effector | スイッチかどうか |
is_switched | 自由曲面の縦横が切り替えられたかどうか |
is_uniscale_joint | 均等拡大縮小ジョイントかどうか |
light_effector | 光源ジョイントインターフェイス |
local_to_world_matrix | ローカル座標系からワールド座標系への変換マトリクス |
master_surface | マスターサーフェスが適用されているかどうか |
modifiable | 形状編集が可能かどうか |
morph_effector | 変形ジョイントインターフェイス |
motion | モーションオブジェクト |
name | 形状の名前 |
number_of_skin_points | スキン設定が可能な頂点の数 |
ordinal | 形状/パートの序数 |
parent | 親の形状 |
path_joint | パスジョイントインターフェイス |
path_replicator | パスリプリケータインターフェイス |
radiosity_attributes | ラジオシティ属性 |
render_flag | レンダリング対象とするかどうか |
revolve_from | 回転体の開始角度 |
revolve_to | 回転体の終了角度 |
rotator_joint | 回転ジョイントインターフェイス |
scale_joint | 拡大縮小ジョイントインターフェイス |
scene | 形状が属するシーン |
shadow_catcher | シャドウキャッチャー |
shadow_map_bias | シャドウマップバイアス |
shadow_map_blur | シャドウマップブラー |
shadow_map_size | シャドウマップサイズ |
shadow_type | 影のタイプ |
sis | 前の形状 |
skin | 頂点を持たない、または1つだけの形状のスキン |
skin_type | スキン方式 (-1 : 割り当てなし、0:クラシック、1 : 頂点ブレンド) |
slider_joint | 直線移動ジョイントインターフェイス |
son | 子の番兵形状(sentinel) |
sound_track | サウンドオブジェクト |
surface | 表面材質オブジェクト |
surface_replicator | サーフェスリプリケータオブジェクト | tags | 形状に設定されたタグ名称リストを取得する |
total_number_of_control_points | 選択形状の子階層を含めたコントロールポイントの総数 |
transformation | ジョイントやスキンの影響を考慮した形状の変換マトリクス |
type | 形状の種類 |
uniscale_joint | 均等拡大縮小ジョイントインターフェイス |
uuid | 形状のuuid |
world_to_local_matrix | ワールド座標系からローカル座標系への変換マトリクス |
switch_effector | スイッチインターフェイス |
xshade.scene().active_shape()(選択形状の取得)のように形状を取得して使用する。
activate
形状を選択する。
#複数選択された形状リストから0番の形状を選択する
xshade.scene().active_shapes[0].activate()
adjust_transformation
パートの変換マトリクスを調節する。
移動以外のマトリクスをリセットする。
内包する形状にかかっている変換要素はそのまま維持される。
xshade.scene().active_shape().adjust_transformation()
begin_set_point
ワイヤーフレームの更新を一時的に停止する。
同じ形状に対して連続してポイントの編集をする場合、begin_set_point()とend_set_point()で囲むと、end_set_point()が呼ばれるまで操作結果はワイヤーフレーム表示に反映されなくなるので、ポイントの編集が高速に行える。
end_set_point()を呼ぶとワイヤーフレームが更新される状態に戻る。
#コントロールポイントが1つになるまで削除する
n = xshade.scene().active_shape().total_number_of_control_points
xshade.scene().active_shape().begin_set_point()
for i in xrange(n-1):
xshade.scene().active_shape().remove_control_point(0)
xshade.scene().active_shape().end_set_point()
cancel_transformation
上位パートにかかっている変換を相殺する。
xshade.scene().active_shape().cancel_transformation()
clear_skin
選択された頂点のスキンを解除する。
xshade.scene().active_shape().clear_skin()
control_point
引数で指定されたコントロールポイントオブジェクトを返す。
戻り値 :
control_pointオブジェクト
引数 :
int : コントロールポイントの番号
ポリゴンメッシュなど、コントロールポイントを持たない形状では例外を投げる。
参照 :
total_number_of_control_points コントロールポイントの数
polygon_mesh.vertex() ポリゴンメッシュの頂点
#0番のコントロールポイントオブジェクトの座標を出力する
print xshade.scene().active_shape().control_point(0).position
convert_to_polygon_mesh_with_divisions
縦横の分割数を指定して、形状をポリゴンメッシュに変換する。
引数 :
int : 横方向の分割数
引数 :
int : 縦方向の分割数
縦横の分割数の指定が意味をなさない形状は、デフォルト(通常)の分割レベルで分割する。
#選択形状を横4縦8の分割でポリゴンメッシュに変換する
xshade.scene().active_shape().convert_to_polygon_mesh_with_divisions(4,8)
convert_to_polygon_mesh_with_subdivision_level
分割レベルを指定して、形状をポリゴンメッシュに変換する。
引数 :
int :
0 | 分割しない |
1 | 荒い |
2 | 普通 |
3 | 細かい |
4 | 最も細かい |
#選択形状を分割荒いでポリゴンメッシュに変換する
xshade.scene().active_shape().convert_to_polygon_mesh_with_subdivision_level(1)
copy
形状をクリップボードにコピーする。
xshade.scene().active_shape().copy()
copy_object
形状を複製する。
戻り値 :
shapeオブジェクト
引数 :
mat4 : 形状複製のための変換マトリクス
参照 :
move_object
#選択形状を均等2倍で複製する
xshade.scene().active_shape().copy_object(((2,0,0,0),(0,2,0,0),(0,0,2,0),(0,0,0,1)))
end_set_point
ワイヤーフレームの更新を再開する。
同じ形状に対して連続してポイントの編集をする場合、begin_set_point()とend_set_point()で囲むと、end_set_point()が呼ばれるまで操作結果はワイヤーフレーム表示に反映されなくなるので、ポイントの編集が高速に行える。
参照 :
begin_set_point
#コントロールポイントが1つになるまで削除する
n = xshade.scene().active_shape().total_number_of_control_points
xshade.scene().active_shape().begin_set_point()
for i in xrange(n-1):
xshade.scene().active_shape().remove_control_point(0)
xshade.scene().active_shape().end_set_point()
get_active_control_point
指定したコントロールポイントの選択状態を返す。
戻り値 :
bool
引数 :
int : コントロールポイントの番号
参照 :
set_active_control_point() 選択状態の設定
#0番の選択状態を出力する
print xshade.scene().active_shape().get_active_control_point(0)
get_tag_boolValue
tag名称をキーとして形状に登録されている値(bool)を取得する。
戻り値 :
bool
引数 :
string : タグ名
#tag1としてタグを割り当て、値を取得する
xshade.scene().active_shape().set_tag_boolValue("tag1", True)
print xshade.scene().active_shape().get_tag_boolValue("tag1")
get_tag_doubleValue
tag名称をキーとして形状に登録されている値(double)を取得する。
戻り値 :
double
引数 :
string : タグ名
#tag1としてタグを割り当て、値を取得する
xshade.scene().active_shape().set_tag_doubleValue("tag1", 0.1)
print xshade.scene().active_shape().get_tag_doubleValue("tag1")
get_tag_floatValue
tag名称をキーとして形状に登録されている値(float)を取得する。
戻り値 :
float
引数 :
string : タグ名
#tag1としてタグを割り当て、値を取得する
xshade.scene().active_shape().set_tag_floatValue("tag1", 0.1)
print xshade.scene().active_shape().get_tag_floatValue("tag1")
get_tag_intValue
tag名称をキーとして形状に登録されている値(int)を取得する。
戻り値 :
int
引数 :
string : タグ名
#tag1としてタグを割り当て、値を取得する
xshade.scene().active_shape().set_tag_intValue("tag1", 5)
print xshade.scene().active_shape().get_tag_intValue("tag1")
get_tag_stringValue
tag名称をキーとして形状に登録されている値(string)を取得する。
戻り値 :
string
引数 :
string : タグ名
#tag1としてタグを割り当て、値を取得する
xshade.scene().active_shape().set_tag_stringValue("tag1", "xxx")
print xshade.scene().active_shape().get_tag_stringValue("tag1")
has_special_character
形状名に引数で渡した特殊記号があるかどうかを返す。
戻り値 :
bool
引数 :
char : ブーリアン記号などの特殊記号
ord('>')のように数値化して渡す。
参照 :
shade.special_characters 特殊記号のリスト
#「>」を含んでいるかどうかを出力する
nc = ord('>')
print xshade.scene().active_shape().has_special_character(nc)
has_symbol
形状名に引数で渡した特殊記号があるかどうかを返す。
戻り値 :
bool
引数 :
char : ブーリアン記号などの特殊記号
ord('>')のように数値化して渡す。
参照 :
shade.special_characters 特殊記号のリスト
#「$」を含んでいるかどうかを出力する
nc = ord('$')
print xshade.scene().active_shape().has_symbol(nc)
has_tag
指定されたtag名称が形状に設定されているか。
戻り値 :
bool
引数 :
string : タグ名
#tag1のタグが設定されているか
print xshade.scene().active_shape().has_tag("tag1")
hide
選択形状を隠す。
xshade.scene().active_shape().hide()
inactivate
選択を解除する。
複数選択されれている形状のうち、1つの形状だけを選択解除する場合に使用。
Shade 3D では形状が1つも選択されていない状態は存在しないため、選択形状が一つだけのときは何もしない。
#選択リストの1番の選択を解除する
xshade.scene().active_shapes[1].inactivate()
is_control_point_selected
指定したコントロールポイントが選択されているかどうかを返す。
戻り値 :
bool
引数 :
int : コントロールポイントの番号
#1番が選択されているかどうかを出力する
print xshade.scene().active_shape().is_control_point_selected(1)
move_links
リンク形状の変換を相殺する。
元形状のみ変換する場合などに使用。
元形状に move_object() などで変換をかけた場合、リンク形状も同様の変換がかかる。
元形状の変換はそのままに、リンク形状に逆行列を掛けて変換を相殺する。
#元形状のみ均等2倍に変換する
xshade.scene().active_shape().move_object(((2,0,0,0),(0,2,0,0),(0,0,2,0),(0,0,0,1)))
xshade.scene().active_shape().move_links(((0.5,0,0,0),(0,0.5,0,0),(0,0,0.5,0),(0,0,0,1)))
move_object
形状を移動する。
引数 :
mat4 : 形状移動のための変換マトリクス
参照 :
copy_object
#選択形状を1.5倍してX方向に100移動する
xshade.scene().active_shape().move_object(((1.5,0,0,0),(0,1.5,0,0),(0,0,1.5,0),(100,0,0,1)))
paste
形状をクリップボードからペーストする。
xshade.scene().active_shape().paste()
place_brother
形状を下に移動する。
引数 :
int : 移動する数
#下に1移動する
xshade.scene().active_shape().place_brother(1)
place_child
形状を下に位置するパート内に移動する。
引数 :
int : 移動するパート内での数
#下のパートの2番目に移動する
xshade.scene().active_shape().place_child(2)
place_parent
選択された形状を上の階層の先頭に移動する。
引数 :
int : 移動する階層の数
#2つ上の階層の先頭に移動する
xshade.scene().active_shape().place_parent(2)
place_sister
形状を上に移動する。
引数 :
int : 移動する数
#ひとつ上に移動する
xshade.scene().active_shape().place_sister(1)
pop_transformation_matrix
マトリクス値をスタックからポップして、パート形状の変換マトリクスに代入する。
popを繰り返してスタックが無くなった形状に対して実行すると全てが0のマトリクスが代入される。
スタックのないパート形状に対して実行すると Shade 3D が落ちる。
参照 :
push_transformation_matrix
xshade.scene().active_shape().pop_transformation_matrix()
push_transformation_matrix
パート形状の変換マトリクス値を(形状ごとの)スタックにプッシュする。
プッシュした後、パート形状に変形をかけてもpop_transformation_matrix()でスタックした値に戻る。
スタックした回数だけポップが可能。
参照 :
pop_transformation_matrix
xshade.scene().active_shape().push_transformation_matrix()
remove
形状を削除する。
xshade.scene().active_shape().remove()
remove_tag
形状に設定されたtagを削除する。
引数 :
string : タグ名
#tag1のタグを削除する
xshade.scene().active_shape().remove_tag("tag1")
reset_transformation
形状の変換状態は維持して変換マトリクスをリセットする。
引数 :
bool : 省略可 : 省略時False
True | 下位階層を含むすべての形状の変換マトリクスをリセット |
False | 選択パートの変換マトリクスをリセットする |
#下位階層を含むすべての形状の変換マトリクスをリセットする
xshade.scene().active_shape().reset_transformation(True)
select
形状を選択する。
#複数選択された形状リストから1番の形状を選択する
xshade.scene().active_shapes[1].select()
select_all_control_points
全てのコントロールポイントを選択/非選択にする。
引数 :
bool : True : 全選択、False : 全非選択
参照 :
get_active_control_point() ポイントごとの選択状態の取得
set_active_control_point() ポイントごとの選択状態の設定
#全てのコントロールポイントを選択する
xshade.scene().active_shape().select_all_control_points(True)
sequence_joint_matrix
指定シーケンスのジョイントマトリクス。
引数 :
int
戻り値 :
mat4
#シーケンス10のジョイントマトリクスを出力する
print xshade.scene().active_shape().sequence_joint_matrix(10)
sequence_local_to_world_matrix
指定シーケンスのローカル座標系からワールド座標系へ変換するマトリクス。
引数 :
int
戻り値 :
mat4
#シーケンス10のローカル座標系からワールド座標系へ変換するマトリクスを出力する
print xshade.scene().active_shape().sequence_local_to_world_matrix(10)
sequence_transformation
指定シーケンスのマトリクス。
引数 :
int
戻り値 :
mat4
#シーケンス10のマトリクスを出力する
print xshade.scene().active_shape().sequence_transformation(10)
sequence_world_to_local_matrix
指定シーケンスのワールド座標系からローカル座標系へ変換するマトリクス。
引数 :
int
戻り値 :
mat4
#シーケンス10のワールド座標系からローカル座標系へ変換するマトリクスを出力する
print xshade.scene().active_shape().sequence_world_to_local_matrix(10)
set_active_control_point
指定したコントロールポイントの選択状態を設定する。
引数 :
int : コントロールポイントの番号
引数 :
bool : True : 選択、False : 非選択
参照 :
get_active_control_point() 選択状態
#コントロールポイント2を選択状態にする
xshade.scene().active_shape().set_active_control_point(2, True)
set_axis_matrix
回転体の軸を定義するマトリクスを設定する。
参照 :
axis_matrix 回転体の軸を定義するマトリクス
is_revolved 回転体かどうか
revolve_from 開始角度
revolve_to 終了角度
#回転体にXのスケールが2倍のマトリクスを定義する
xshade.scene().active_shape().set_axis_matrix(((2.0, 0.0, 0.0, 0.0), (0.0, 1.0, 0.0, 0.0), (0.0, 0.0, 1.0, 0.0), (0.0, 0.0, 0.0, 1.0)))
set_tag_boolValue
tag名称をキーとして値(bool)を形状にセットする 。
引数 :
string : タグ名
引数 :
bool : 割り当てる値
#tag1としてタグを割り当て、値を取得する
xshade.scene().active_shape().set_tag_boolValue("tag1", True)
print xshade.scene().active_shape().get_tag_boolValue("tag1")
set_tag_doubleValue
tag名称をキーとして値(double)を形状にセットする 。
引数 :
string : タグ名
引数 :
double : 割り当てる値
#tag1としてタグを割り当て、値を取得する
xshade.scene().active_shape().set_tag_doubleValue("tag1", 0.1)
print xshade.scene().active_shape().get_tag_doubleValue("tag1")
set_tag_floatValue
tag名称をキーとして値(float)を形状にセットする 。
引数 :
string : タグ名
引数 :
float : 割り当てる値
#tag1としてタグを割り当て、値を取得する
xshade.scene().active_shape().set_tag_floatValue("tag1", 0.1)
print xshade.scene().active_shape().get_tag_floatValue("tag1")
set_tag_intValue
tag名称をキーとして値(int)を形状にセットする 。
引数 :
string : タグ名
引数 :
int : 割り当てる値
#tag1としてタグを割り当て、値を取得する
xshade.scene().active_shape().set_tag_intValue("tag1", 5)
print xshade.scene().active_shape().get_tag_intValue("tag1")
set_tag_stringValue
tag名称をキーとして値(string)を形状にセットする 。
引数 :
string : タグ名
引数 :
dtring : 割り当てる値
#tag1としてタグを割り当て、値を取得する
xshade.scene().active_shape().set_tag_stringValue("tag1", "xxx")
print xshade.scene().active_shape().get_tag_stringValue("tag1")
solid_clear
掃引体、回転体を通常の形状に復帰する。
参照 :
is_extruded 掃引体かどうか
is_revolved 回転体かどうか
xshade.scene().active_shape().solid_clear()
solid_extrude
掃引体を作成する。
引数 :
float3 : 掃引ベクトル
参照 :
is_extruded 掃引体かどうか
#Yベクトル1000の掃引体を作成する
xshade.scene().active_shape().solid_extrude((0,1000,0))
solid_revolve
回転体を作成する。
引数 :
vec3 : 回転軸の始点
引数 :
vec3 : 回転軸の終点
参照 :
is_revolved 回転体かどうか
#原点とX方向100の軸で回転体を作成する
xshade.scene().active_shape().solid_revolve((0.0, 0.0, 0.0), (100.0, 0.0, 0.0))
tag_value_type
tag名称をキーとしてセットした値を種類を取得する。
戻り値 :
int : タグの種類(-1:指定なし、0:int、1:double、2:float、3:string、4:bool)
引数 :
string : タグ名
#tag1でのタグの種類を取得
print xshade.scene().active_shape().tag_value_type("tag1")
transform
形状にマトリクス変換をかける。
引数 :
mat4 : 変換マトリクス
#形状に均等2倍のマトリクス変換をかける
xshade.scene().active_shape().transform(((2.0, 0.0, 0.0, 0.0), (0.0, 2.0, 0.0, 0.0), (0.0, 0.0, 2.0, 0.0), (0.0, 0.0, 0.0, 1.0)))
update
形状を更新する。
xshade.scene().active_shape().update()
update_skin_bindings
図形ウインドウのスキンに関するキャッシュデータを更新する。
スクリプトやプラグインでスキンの状態を変更した形状に対して、スキンの状態を更新するために使用する。
スキンウインドウはskin_view().update()で更新しないと変更が反映されない。
#ブラウザの構成 #球(対象形状) #▼回転 # ▼回転 #球にバインドを追加して次形状の回転ジョイントを設定する xshade.scene().active_shape().skin.append_bind() skin_num = xshade.scene().active_shape().skin.number_of_binds - 1 #追加したバインドの番号を得る xshade.scene().active_shape().skin.get_bind(skin_num).shape = xshade.scene().active_shape().bro xshade.scene().active_shape().update_skin_bindings() #図形ウインドウのスキンに関するキャッシュデータを更新 xshade.skin_view().update() #スキンウインドウを更新して変更を反映する
active_vertex_indices
print xshade.scene().active_shape().active_vertex_indices
axis_matrix
回転体の軸を定義するマトリクス。
型 :
mat4
参照 :
set_axis_matrix() 設定
is_revolved() 回転体かどうか
revolve_from 開始角度
revolve_to 終了角度
print xshade.scene().active_shape().axis_matrix
ball_joint
#ボールジョイントの中心の座標を出力する
print xshade.scene().active_shape().ball_joint.position
bone_joint
#ボーンジョイントの変換行列を出力する
print xshade.scene().active_shape().bone_joint.matrix
bounding_box_size
バウンディングボックスのサイズ。
型 :
float3
print xshade.scene().active_shape().bounding_box_size
bro
#次の形状の名称を出力する
print xshade.scene().active_shape().bro.name
browsable
形状がブラウザウインドウに表示可能かどうか。
型 :
bool : True : 見える、False : 見えない
print xshade.scene().active_shape().browsable
center_point
すべてのポイントや形状の重心の座標の平均値。
型 :
vec3 : 重心の座標値
円や球では中心の座標、線形状やポリゴンメッシュではすべてのポイントの座標の平均値が返される。
また、パートの場合は、パート内に含まれるすべての形状の重心の座標の平均値が返される。
print xshade.scene().active_shape().center_point
center_position
バウンディングボックスの中心座標。
型 :
vec3 : グローバル座標での座標
xshade.scene().active_shape().center_position
custom_joint
#カスタムジョイントのスライダを出力する
print xshade.scene().active_shape().custom_joint.value
dad
親の形状。
型 :
partオブジェクト
ルートパートを選択している場合Noneが返される。
#親の形状の名称を出力する
print xshade.scene().active_shape().dad.name
extrude
print xshade.scene().active_shape().extrude
flip_face
面が反転されているかどうか。
型 :
bool
print xshade.scene().active_shape().flip_face
has_motion
モーションを設定できる形状かどうか。
型 :
bool
モーションはジョイント、カメラに対して設定することができる。
print xshade.scene().active_shape().has_motion
has_shadow_map_bias
シャドウマップバイアスの値が設定されているかどうか。
型 :
bool
print xshade.scene().active_shape().has_shadow_map_bias
has_shadow_map_blur
シャドウマップブラーの値が設定されているかどうか。
型 :
bool
print xshade.scene().active_shape().has_shadow_map_blur
has_shadow_map_size
シャドウマップサイズの値が設定されているかどうか。
型 :
bool
print xshade.scene().active_shape().has_shadow_map_size
has_son
(番兵sentinelでない)子の形状が存在するかどうか。
型 :
bool
参照 :
son 子の形状
print xshade.scene().active_shape().has_son
has_surface_attributes
表面材質を持っているかどうか。
型 :
bool
print xshade.scene().active_shape().has_surface_attributes
is_ball_joint
ボールジョイントかどうか。
型 :
bool
print xshade.scene().active_shape().is_ball_joint
is_bone_joint
ボーンジョイントかどうか。
型 :
bool
print xshade.scene().active_shape().is_bone_joint
is_container
階層下に形状を含むことができるかどうか(パートかどうか)。
型 :
bool
print xshade.scene().active_shape().is_container
is_custom_joint
カスタムジョイントかどうか。
型 :
bool
print xshade.scene().active_shape().is_custom_joint
is_extruded
print xshade.scene().active_shape().is_extruded
is_light_effector
光源ジョイントかどうか。
型 :
bool
print xshade.scene().active_shape().is_light_effector
is_morph_effector
変形ジョイントかどうか。
型 :
bool
print xshade.scene().active_shape().is_morph_effector
is_one_of_active_shapes
形状が選択されているかどうか。
型 :
bool
print xshade.scene().active_shape().is_one_of_active_shapes
is_path_joint
パスジョイントかどうか。
型 :
bool
print xshade.scene().active_shape().is_path_joint
is_revolved
print xshade.scene().active_shape().is_revolved
is_rotator_joint
回転ジョイントかどうか。
型 :
bool
print xshade.scene().active_shape().is_rotator_joint
is_scale_joint
拡大縮小ジョイントかどうか。
型 :
bool
print xshade.scene().active_shape().is_scale_joint
is_shown
形状が表示されているかどうか。
型 :
bool
print xshade.scene().active_shape().is_shown
is_slider_joint
直線移動ジョイントかどうか。
型 :
bool
print xshade.scene().active_shape().is_slider_joint
is_sound_track
サウンドオブジェクトかどうか。
型 :
bool
print xshade.scene().active_shape().is_sound_track
is_switch_effector
スイッチかどうか。
型 :
bool
print xshade.scene().active_shape().is_switch_effector
is_switched
自由曲面の縦横が切り替えられたかどうか。
型 :
bool
print xshade.scene().active_shape().is_switched
is_uniscale_joint
均等拡大縮小ジョイントかどうか。
型 :
bool
print xshade.scene().active_shape().is_uniscale_joint
light_effector
#光源ジョイントのスライダを出力する
print xshade.scene().active_shape().light_effector.value
local_to_world_matrix
ローカル座標系からワールド座標系への変換マトリクス。
型 :
mat4
形状は座標値をローカル座標系で保持しているため、上位パートのマトリクス変換を考慮する必要がある場合にはワールド座標系に変換する。
参照 :
world_to_local_matrix
print xshade.scene().active_shape().local_to_world_matrix
master_surface
print xshade.scene().active_shape().master_surface
modifiable
形状編集が可能かどうか。
型 :
bool : True : 可能、False : 形状編集モード時にコントロールポイントが非表示になる
print xshade.scene().active_shape().modifiable
morph_effector
#変形ジョイントの変形量を出力する
print xshade.scene().active_shape().morph_effector.morph
motion
#シーケンス0のジョイントの値を出力する
print xshade.scene().active_shape().motion.get_joint_value(0)
name
形状の名前。
型 :
string
print xshade.scene().active_shape().name
number_of_skin_points
スキン設定が可能な頂点の数。
型 :
int
print xshade.scene().active_shape().number_of_skin_points
ordinal
形状/パートの序数。
型 :
int
序数はブラウザ上の形状の順序から決定されるブラウザで形状の順序を変更すると序数も変更される。
シーンを閉じて開きなおしたり、形状の削除をアンドゥした場合など、shapeクラスが再生成される場合にも値が変わらない利点がある。
参照 :
scene.get_shape_by_ordinal()
print xshade.scene().active_shape().ordinal
parent
親の形状。
型 :
shapeオブジェクト : None : ルートパート
#親の形状の名称を出力する
print xshade.scene().active_shape().parent.name
path_joint
#パスジョイントのパススライダを出力する
print xshade.scene().active_shape().path_joint.path_position
path_replicator
#パスリプリケータのリプリケーション値を出力する
print xshade.scene().active_shape().path_replicator.replication
radiosity_attributes
#ラジオシティ計算時に影を落とすかどうかを出力する
print xshade.scene().active_shape().radiosity_attributes.cast_shadow
render_flag
レンダリング対象とするかどうか。
型 :
int :
-1 | 継承(デフォルト) |
0 | レンダリングしない |
1 | 常にレンダリング |
継承が設定されている場合は上位パートの設定が有効になる
print xshade.scene().active_shape().render_flag
revolve_from
print xshade.scene().active_shape().revolve_from
revolve_to
print xshade.scene().active_shape().revolve_to
rotator_joint
#回転ジョイントの回転を出力する
print xshade.scene().active_shape().rotator_joint.rotation
scale_joint
#拡大縮小ジョイントの拡大縮小率を出力する
print xshade.scene().active_shape().scale_joint.scale
scene
形状が属するシーン。
型 :
sceneオブジェクト
xshade.scene()はフォアグランドのシーンを返す。
主に Shade 3D 本体とプラグインがバックグラウンドへの処理を行う際に、形状から形状の属するシーンを取得できるように用意されている。
pythonスクリプトは基本的にフォアグラウンドのシーンに対して処理を行うため、とくに意識する必要はないが、shapeを変数に入れて使う場合などにはそのshapeから scene を取得するとスクリプトの安全性が高くなる。
参照 :
scene
#shapeから取得したシーンに円を作成する
shapes = xshade.scene().active_shapes
for shape in shapes:
scene = shape.scene
scene.begin_creating_at(shape)
scene.create_disk(None,[0.0, 0.0, 0.0], 100,0)
scene.end_creating()
shadow_catcher
シャドウキャッチャー。
型 :
int :
-1 | 継承(デフォルト) |
0 | レンダリングする |
1 | 影のみをレンダリング |
print xshade.scene().active_shape().shadow_catcher
shadow_map_bias
シャドウマップバイアス。
型 :
float
print xshade.scene().active_shape().shadow_map_bias
shadow_map_blur
シャドウマップブラー。
型 :
float
print xshade.scene().active_shape().shadow_map_blur
shadow_map_size
シャドウマップサイズ。
型 :
int
print xshade.scene().active_shape().shadow_map_size
shadow_type
影のタイプ。
型 :
0 | 継承(デフォルト) |
1 | レイトレーシング |
2 | シャドウマップ |
print xshade.scene().active_shape().shadow_type
sis
#前の形状の名称を出力する
print xshade.scene().active_shape().sis.name
skin
頂点を持たない、または1つだけの形状のスキン。
型 :
skinオブジェクト
パート、ジョイント、円、球、リンクなどで使用。
参照 :
skin
control_point.get_skin() 線形状のスキン
vertex.get_skin() ポリゴンメッシュのスキン
#選択形状のバインドの数を出力する
print xshade.scene().active_shape().skin.number_of_binds
skin_type
スキン方式 (-1 : 割り当てなし、0:クラシック、1 : 頂点ブレンド)。
型 :
int
#選択形状のスキンの種類を出力する
print xshade.scene().active_shape().skin_type
slider_joint
#直線移動ジョイントの開始座標を出力する
print xshade.scene().active_shape().slider_joint.starting_position
son
子の番兵形状(sentinel)。
型 :
shapeオブジェクト
番兵形状はパート内の形状の終端を表し、空のパートにも必ず存在する。
番兵形状の次の形状(bro)はパート内の一番上、前の形状(sis)はパート内の一番下の形状になる。
#パート内の一番下の形状の名称を出力する
print xshade.scene().active_shape().son.sis.name
sound_track
#サウンドオブジェクトの音量を出力する
print xshade.scene().active_shape().sound_track.value
surface
#表面材質オブジェクトの拡散反射の色を出力する
print xshade.scene().active_shape().surface.diffuse_color
surface_replicator
#サーフェスリプリケータオブジェクトのリプリケーション値を出力する
print xshade.scene().active_shape().surface_replicator.replication
形状に設定されたタグ名称リストを取得する。
型 :
stringの配列
#選択形状に割り当てられているタグ名一覧を取得
print xshade.scene().active_shape().tags
total_number_of_control_points
選択形状の子階層を含めたコントロールポイントの総数。
型 :
int
print xshade.scene().active_shape().total_number_of_control_points
transformation
ジョイントやスキンの影響を考慮した形状の変換マトリクス。
型 :
mat4
print xshade.scene().active_shape().transformation
type
形状の種類。
型 :
int :
0 | sentinel | 番兵形状 |
1 | dxf_insert | 未使用 |
2 | part | パート |
3 | light | 光源 |
4 | line | 線形状 |
5 | sphere | 球 |
6 | disk | 円 |
7 | polygon_mesh | ポリゴンメッシュ |
8 | master_surface | マスターサーフェス |
10 | master_image | マスターイメージ |
print xshade.scene().active_shape().type
uniscale_joint
#均等拡大縮小ジョイントの拡大縮小率を出力する
print xshade.scene().active_shape().uniscale_joint.scale
uuid
形状のuuid。
型 :
uuid : 128ビットの数値
uuidはconvertなどの形状変換以外では変化しない。
ブラウザの位置や自由曲面の切り替え、コントロールポイントの数の変更、名称変更などに影響されない。
参照 :
uuid
print xshade.scene().active_shape().uuid
world_to_local_matrix
ワールド座標系からローカル座標系への変換マトリクス。
型 :
mat4
形状は座標値をローカル座標系で保持しているため、上位パートのマトリクス変換を考慮する必要がある場合にはワールド座標系に変換する。
参照 :
local_to_world_matrix ローカル座標系からワールド座標系
print xshade.scene().active_shape().world_to_local_matrix
switch_effector
#スイッチの選択を出力する
print xshade.scene().active_shape().switch_effector.selection