パートの操作に使用する。
xshade |
↑ |
shape |
↑ |
part |
clean_surface_part_polygonmesh | 自由曲面からポリゴンメッシュ情報を削除する |
disclose_all | 選択したパートの内容を子階層も含めすべて表示する |
get_plane_equation | 平面方程式を返す |
realize_link | リンクを実体化する |
realize_replicator | リプリケータを実体化する |
reverse | 逆転を行う |
select_camera_joint | カメラオブジェクトを現在アクティブなカメラに設定する |
set_view | 選択したカメラ形状をアクティブなカメラにする |
setup_plane_equation | 平面方程式を設定する |
setup_surface_part_polygonmesh | 自由曲面にポリゴンメッシュ情報を設定する |
switch | 切り替えを行う |
undisclose_all | 選択したパートの内容を子階層も含めすべて隠す |
closed | パートに含まれる線形状がすべて閉じた線形状かどうか |
disclosed | ブラウザでパートの内容が表示されているかどうか |
edge | 指定された稜線のedgeオブジェクトを返す |
face | 指定された面のfaceオブジェクトを返す |
flat_joint | フラット |
group | グループ選択のオン/オフ |
is_master_image | マスターイメージパートかどうか |
is_master_shape | マスターオブジェクトパートかどうか |
is_master_surface | マスターサーフェスパートかどうか |
is_pose_joint | ポーズジョイントかどうか |
joint_blend | ジョイントのブレンド |
joint_matrix | ジョイント変換マトリクス |
link_master | リンク元形状 |
number_of_active_control_points | 選択されているコントロールポイントの数 |
number_of_edges | 稜線の数 |
number_of_faces | 面の数 |
number_of_sons | 1つ下の階層の形状の数 |
number_of_vertices | 頂点の数 |
part_type | パートの種類 |
surface_closed | 自由曲面の交差方向が閉じているかどうか |
surface_switched | 自由曲面が縦横切り替えられているかどうか |
transformation_matrix | 形状の変換マトリクス |
vertex | 指定された頂点のvertexオブジェクトを返す |
view_anchor | モーションウインドウでのオブジェクトカメラの移動モード |
xshade.scene().active_shape()(選択形状の取得)のように形状を取得して使用する。
clean_surface_part_polygonmesh
自由曲面からポリゴンメッシュ情報を削除する。
参照 :
setup_surface_part_polygonmesh
xshade.scene().active_shape().clean_surface_part_polygonmesh()
disclose_all
選択したパートの内容を子階層も含めすべて表示する。
参照 :
undisclose_all
xshade.scene().active_shape().disclose_all()
get_plane_equation
平面方程式を返す。
戻り値 :
float4
引数 :
int : 面の番号
参照 :
setup_plane_equation
setup_surface_part_polygonmesh
setup_surface_part_polygonmesh()でポリゴンメッシュ情報を設定した自由曲面にsetup_plane_equationで設定した平面方程式を返す。
xshade.scene().active_shape().set_plane_equation() print xshade.scene().active_shape().get_plane_equation(0)
realize_link
リンクを実体化する。
戻り値 :
shape
参照 :
shape
#選択した形状がリンクの場合に、実体化
xshade.scene().active_shape().realize_link()
realize_replicator
リプリケータを実体化する。
戻り値 :
shape
参照 :
shape
#選択した形状がリプリケータの場合に、実体化
xshade.scene().active_shape().realize_replicator()
reverse
逆転を行う。
xshade.scene().active_shape().reverse()
select_camera_joint
カメラオブジェクトを現在アクティブなカメラに設定する。
カメラ形状に対してのみ有効。
#選択したカメラ形状を現在アクティブなカメラに設定する
camera_obj = xshade.scene().active_shape()
camera_obj. select_camera_joint()
set_view
選択したカメラ形状をアクティブなカメラにする。
xshade.scene().active_shape().set_view()
setup_plane_equation
平面方程式を設定する。
参照 :
get_plane_equation
setup_surface_part_polygonmesh
setup_surface_part_polygonmesh()でポリゴンメッシュ情報を設定した自由曲面に設定する。
xshade.scene().active_shape().setup_surface_part_polygonmesh() xshade.scene().active_shape().setup_plane_equation()
setup_surface_part_polygonmesh
自由曲面にポリゴンメッシュ情報を設定する。
引数 :
int : ポリゴンメッシュの分割数 : 0:分割しない、1:粗い、2:普通、3:細かい、4:最も細かい
省略時は「2:普通」
設定した自由曲面は以下の情報を取得・設定できる。
get_plane_equation | 平面方程式を返す |
setup_plane_equation | 平面方程式を設定する |
edge | 指定された稜線のedgeオブジェクトを返す |
face | 指定された面のfaceオブジェクトを返す |
number_of_edges | 稜線の数 |
number_of_faces | 面の数 |
number_of_vertices | 頂点の数 |
vertex | 指定された頂点のvertexオブジェクト |
#自由曲目にポリゴンメッシュ情報を設定して情報を出力する #エラーが起きたらエラー内容を出力する try: s = xshade.scene().active_shape() assert s.type == 2 and s.part_type == 1, '自由曲面を選択してください.' if s.type == 2 and s.part_type == 1: s.setup_surface_part_polygonmesh() s.setup_plane_equation() print '面0の平面方程式',s.get_plane_equation(0) print '頂点0の座標',s.vertex(0).position print '面0の距離UV値',s.face(0).distance_uv print '面0のパラメータUV値',s.face(0).parameter_uv print '稜線数',s.number_of_edges print '面数',s.number_of_faces print '頂点数',s.number_of_vertices s.setup_normal() print '頂点0の法線',s.vertex(0).normal s.clean_surface_part_polygonmesh() except AssertionError, message: print message
switch
切り替えを行う。
切り替えを行うと線形状が再生成されるため、パート内の線形状のshapeクラスのポインタも変更される。
xshade.scene().active_shape().switch()
undisclose_all
選択したパートの内容を子階層も含めすべて隠す。
参照 :
disclose_all
xshade.scene().active_shape().undisclose_all()
closed
パートに含まれる線形状がすべて閉じた線形状かどうか。
型 :
bool
print xshade.scene().active_shape().closed
disclosed
ブラウザでパートの内容が表示されているかどうか。
型 :
bool
print xshade.scene().active_shape().disclosed
edge
指定された稜線のedgeオブジェクトを返す。
戻り値 :
edgeオブジェクト
引数 :
int : 稜線の番号
参照 :
edge
setup_surface_part_polygonmesh()でポリゴンメッシュ情報を設定した自由曲面に使用する。
#0番の稜線のedgeオブジェクトの両方の頂点を出力する
xshade.scene().active_shape().setup_surface_part_polygonmesh()
print xshade.scene().active_shape().edge(0).v0
print xshade.scene().active_shape().edge(0).v1
face
指定された面のfaceオブジェクトを返す。
戻り値 :
faceオブジェクト
引数 :
int : 面の番号
参照 :
face
setup_surface_part_polygonmesh()でポリゴンメッシュ情報を設定した自由曲面に使用する。
#0番の面のfaceオブジェクトの距離UV値のリストを出力する
xshade.scene().active_shape().setup_surface_part_polygonmesh()
print xshade.scene().active_shape().edge(0).face(0).distance_uv
flat_joint
フラット。
型 :
bool : True : フラット、False : 階層
print xshade.scene().active_shape().flat_joint
group
グループ選択のオン/オフ。
型 :
bool
print xshade.scene().active_shape().group
is_master_image
マスターイメージパートかどうか。
型 :
bool
print xshade.scene().active_shape().is_master_image
is_master_shape
マスターオブジェクトパートかどうか。
型 :
bool
print xshade.scene().active_shape().is_master_shape
is_master_surface
マスターサーフェスパートかどうか。
型 :
bool
print xshade.scene().active_shape().is_master_surface
is_pose_joint
ポーズジョイントかどうか。
型 :
bool
パート形状名の特殊記号に「|」が含まれているかを判定する。
print xshade.scene().active_shape().is_pose_joint
joint_blend
ジョイントのブレンド。
型 :
float
print xshade.scene().active_shape().joint_blend
joint_matrix
ジョイント変換マトリクス。
型 :
mat4
print xshade.scene().active_shape().joint_matrix
link_master
リンク元形状。
型 :
shapeオブジェクト
リンク形状に対してのみ有効。
#リンク元形状の名称を出力する
print xshade.scene().active_shape().link_master.name
number_of_active_control_points
選択されているコントロールポイントの数。
型 :
int
print xshade.scene().active_shape().number_of_active_control_points
number_of_edges
xshade.scene().active_shape().setup_surface_part_polygonmesh() print xshade.scene().active_shape().number_of_edges
number_of_faces
xshade.scene().active_shape().setup_surface_part_polygonmesh() print xshade.scene().active_shape().number_of_faces
number_of_sons
1つ下の階層の形状の数。
型 :
int
print xshade.scene().active_shape().number_of_sons
number_of_vertices
xshade.scene().active_shape().setup_surface_part_polygonmesh() print xshade.scene().active_shape().number_of_vertices
part_type
パートの種類。
型 :
int
0 | パート | simple_part |
1 | 自由曲面 | surface_part |
2 | 回転ジョイント | rotator_joint |
3 | 直線移動ジョイント | slider_joint |
4 | 拡大縮小ジョイント | scale_joint |
5 | 均等拡大縮小ジョイント | uniscale_joint |
6 | 光源ジョイント | light_joint |
7 | パスジョイント | path_joint |
8 | 変形ジョイント | morph_joint |
9 | カスタムジョイント | custom_joint |
10 | ボールジョイント | ball_joint |
11 | カメラ | camera_joint |
12 | サウンド | sound_part |
13 | スイッチ | switch_joint |
14 | パスリプリケータ | path_replicator |
15 | サーフェスリプリケータ | surface_replicator |
16 | ボーンジョイント | bone_joint |
100 | マスターサーフェス | master_surface_part |
101 | リンク | link_part |
102 | マスターイメージ | master_image_part |
103 | マスターオブジェクト | master_shape_part |
104 | マスターオブジェクト(外部参照形状) | master_shape_object_part |
105 | ローカル座標 | local_axis_part |
特定の種類のパートかどうかは下記のproperyで判定できる。
パート | |
自由曲面 | |
回転ジョイント | shape.is_rotator_joint |
直線移動ジョイント | shape.is_slider_joint |
拡大縮小ジョイント | shape.is_scale_joint |
均等拡大縮小ジョイント | shape.is_uniscale_joint |
光源ジョイント | shape.is_light_effector |
パスジョイント | shape.is_path_joint |
変形ジョイント | shape.is_morph_effector |
カスタムジョイント | shape.is_custom_joint |
ボールジョイント | shape.is_ball_joint |
カメラ | |
サウンド | shape.is_sound_track |
スイッチ | shape.is_switch_effector |
パスリプリケータ | |
サーフェスリプリケータ | |
ボーンジョイント | shape.is_bone_joint |
マスターサーフェス | shape.is_master_surface |
リンク | |
マスターイメージ | shape.is_master_image |
マスターオブジェクト | shape.is_master_shape |
マスターオブジェクト(外部参照形状) | |
ローカル座標 |
print xshade.scene().active_shape().part_type
surface_closed
自由曲面の交差方向が閉じているかどうか。
型 :
bool
print xshade.scene().active_shape().surface_closed
surface_switched
自由曲面が縦横切り替えられているかどうか。
型 :
bool
実際に切り替えるにはswitch()を使う。
TrueならFalse、FalseならTrueのようにnotの値を設定すると、自由曲面の切り替えは行われず、切り替えのフラグのみ反転する。
切り替えを行うと線形状が再生成されるため、パート内の線形状のshapeクラスのポインタも変更される。
print xshade.scene().active_shape().surface_switched
transformation_matrix
形状の変換マトリクス。
型 :
mat4
ジョイントやスキンの影響は考慮しない、単純に形状に割当てられたマトリクス値。
print xshade.scene().active_shape().transformation_matrix
vertex
指定された頂点のvertexオブジェクトを返す。
戻り値 :
vertexオブジェクト
引数 :
int : 頂点の番号
参照 :
vertex
setup_surface_part_polygonmesh()でポリゴンメッシュ情報を設定した自由曲面に使用する。
#0番の頂点のvertexオブジェクトの座標を出力する
xshade.scene().active_shape().setup_surface_part_polygonmesh()
print xshade.scene().active_shape().edge(0).vertex(0).position
view_anchor
モーションウインドウでのオブジェクトカメラの移動モード。
型 :
int :
0 | 視点&注視点 |
1 | 視点 |
2 | 注視点 |
print xshade.scene().active_shape().view_anchor