polygon mesh

ポリゴンメッシュの操作に使用する。


xshade
shape
polygon_mesh

メソッド一覧

append_edge ポリゴンメッシュに稜線を追加する
append_face 頂点からポリゴンメッシュに面を追加する
append_faces_from_edges 稜線からポリゴンメッシュに面を追加する
append_face_group フェイスグルーブを追加する
append_point ポリゴンメッシュに頂点を追加する
append_uv_layer UV層を追加する
append_vertex_color_layer 頂点カラー層を追加する
begin_removing_control_points 頂点の削除を開始する
begin_removing_edges 稜線の削除を開始する
begin_removing_faces 面の削除を開始する
begin_selecting_control_points 頂点の選択を開始する
clean_winged_edge ウイングドエッジデータを削除する
cleanup_redundant_edges 重複稜線を削除する
cleanup_redundant_vertices 近傍頂点の結合をする
clear_face_group フェイスグループをすべて削除する
clear_uv_layers UV層をすべて削除する
clear_vertex_color_layers 頂点カラー層をすべて削除する
eccwfv 面の頂点を中心として反時計向きにある稜線を返す
ecwfv 面の頂点を中心として時計向きにある稜線を返す
edge 指定された稜線のedgeオブジェクトを返す
end_removing_control_points 頂点の削除を終了する
end_removing_edges 稜線の削除を終了する
end_removing_faces 面の削除を終了する
end_selecting_control_points 頂点の選択を終了する
face 指定された面のfaceオブジェクトを返す
fccwev 稜線の頂点を中心として反時計向きにある面を返す
fcwev 稜線の頂点を中心として時計向きにある面を返す
get_face_group 指定面に対応するフェイスグループのmaster_surfaceを返す
get_face_group_index 指定面に対応するフェイスグループ番号を返す
get_face_group_surface 指定番号のフェイスグループのマスターサーフェスを返す
get_number_of_face_groups フェイスグループの数を返す
get_number_of_uv_layers UV層の数を返す
get_plane_equation 平面方程式を返す
make_edge ポリゴンメッシュの指定したポイント間に稜線を追加する
make_edges ポリゴンメッシュに必要な稜線を生成する
remove_control_point 指定された頂点を削除する
remove_edge 指定された稜線を削除する
remove_face 指定された面を削除する
remove_face_group 指定番号のフェイスグループを削除する
remove_uv_layer 指定番号のUV層を削除する
remove_vertex_color_layer 指定番号の頂点カラー層を削除する
set_face_group_index 面にフェイスグループ番号を設定する
set_face_group_surface 指定番号のフェイスグループにマスターサーフェスを設定する
select_border_edges エラー診断選択の境界稜線選択をする
select_boundary_edges 境界選択をする
select_concave_faces エラー診断選択の凹面選択をする
select_contiguous_surface 連続面選択をする
select_contiguous_surface_uv UVの連続面選択をする
select_coplanar_faces 同一平面選択をする
select_grow 選択範囲を拡大する
select_inner_region_faces 面の内側領域選択をする
select_internal_faces エラー診断選択の内包面選択をする
select_loop_edges 稜線のループ選択をする
select_loop_faces 面のループ選択をする
select_non_manifold_edges エラー診断選択の三面稜線選択をする
select_non_planar_faces エラー診断選択の非平面選択をする
select_overlapping_faces エラー診断選択の重複面選択をする
select_overlapping_vertices エラー診断選択の重複点選択をする
select_ring_edges 稜線のリング選択をする
select_shrink 選択範囲を縮小する
separate_all_non_manifold_edges すべての三面稜線から面を分離する
separate_non_manifold_edges 三面稜線から面を分離する
separate_selected_faces 選択面の分離、または複製を行う
setup_normal 法線を設定する
setup_plane_equation 平面方程式を設定する
setup_winged_edge ウイングドエッジデータを設定する
subdivide サブディビジョンサーフェスを設定したポリゴンメッシュに対して、サブディビジョンを行う
triangulate_faces 面を三角分割する
unify_normals 法線の向きを統一する
unsubdivide サブディビジョンを取り消す
vertex 指定された頂点のvertexオブジェクトを返す

プロパティ一覧

active_edge_indices 選択されている稜線の番号のタプル
active_face_indices 選択されている面の番号のタプル
has_inconsistent_faces 辻褄の合っていない面があるかどうか
number_of_active_control_points 選択されている頂点の数
number_of_edges 稜線の数
number_of_faces 面の数
number_of_non_manifold_edges 三面稜線の数
number_of_vertex_color_layers 頂点カラー層の数
round サブディビジョンサーフェスの適用率
roundness_boundary_rule OpenSubdivの境界ルール
roundness_adaptive_subdivision_level OpenSubdivの適応分割レベル
roundness_adaptive_tessellation OpenSubdivの特徴適応分割のオン/オフ
roundness_preview_adaptive_tessellation OpenSubdivの特徴適応分割の図面に表示のオン/オフ
roundness_preview_subdivision_level OpenSubdivの表示分割レベル
roundness_render_subdivision_level OpenSubdivのレンダリング分割レベル
roundness_show_edge_sharpness OpenSubdivの稜線のシャープネスの色表示のオン/オフ
roundness_smooth_triangles OpenSubdivのスムーズ三角形
roundness_type サブディビジョンサーフェスの分割手法
roundness_uses_render_subdivision_level OpenSubdivのレンダリング分割レベルのオン/オフ
roundness_uv サブディビジョンサーフェスのUV補正
show_edges ポリゴンメッシュの稜線を表示のオン/オフ
smooth_edges スムーズのオン/オフ
threshold スムーズの限界値




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

メソッド詳細

append_edge

ポリゴンメッシュに稜線を追加する。
引数 :
  int : 稜線の始点となる頂点の番号
引数 :
  int : 稜線の終点となる頂点の番号

#頂点0,1からなる稜線を追加する
xshade.scene().active_shape().append_edge(0, 1)

append_face

頂点からポリゴンメッシュに面を追加する。
引数 :
  int : 頂点の番号のリスト/タプル
5箇所以上の頂点をつないで面を作ることも可能。
ただし、すべての頂点が同一平面にない場合の表示結果は保証されない。

#頂点0,1,3からなる面を追加する
xshade.scene().active_shape().append_face((0, 1, 3))

append_faces_from_edges

稜線からポリゴンメッシュに面を追加する。
引数 :
  int : 稜線の番号のリスト/タプル
戻り値 :
  int : 追加した面の数
稜線の接続関係を探索して、閉じている個所に面を追加する。
閉じていない個所や、すでに面のある個所は無視される。
複数の面をまとめて追加することも可能。
5箇所以上の頂点をつないで面を作ることも可能。
ただし、すべての頂点が同一平面にない場合の表示結果は保証されない。

#選択されている稜線に面を追加する
indices = xshade.scene().active_shape().active_edge_indices
xshade.scene().active_shape().append_faces_from_edges(indices)

append_face_group

フェイスグルーブを追加する 。
戻り値 :
  int : 追加したフェイスグループ番号

#フェイスグループを追加して、追加された番号を出力する
print xshade.scene().active_shape().append_face_group()

append_point

ポリゴンメッシュに頂点を追加する。
引数 :
  vec3 : 頂点を追加する座標

#原点に頂点を追加する
xshade.scene().active_shape().append_point((0.0, 0.0, 0.0))

append_uv_layer

UV層を追加する。
戻り値 :
  int : 追加したUV層番号。最大8層まで

#UV層を追加して、追加された番号を出力する
print xshade.scene().active_shape().append_uv_layer()

append_vertex_color_layer

頂点カラー層を追加する。
戻り値 :
  int : 追加した頂点カラー層番号。最大8層まで

#頂点カラー層を追加して、追加された番号を出力する
print xshade.scene().active_shape().append_vertex_color_layer()

begin_removing_control_points

頂点の削除を開始する。
end_removing_control_points()が呼ばれるまで、削除による番号の再設定が行われなくなる。
通常コントロールポイントを削除すると、番号は再設定されるため、複数のコントロールポイントを削除する場合は末尾から削除する必要がある。
この場合は、再設定が行われないので先頭から任意の番号を連続して削除することが可能になる。
参照 :
  remove_control_point

#先頭から0番と2番のコントロールポイントを削除する
xshade.scene().active_shape().begin_removing_control_points()
xshade.scene().active_shape().remove_control_point(0)
xshade.scene().active_shape().remove_control_point(2)
xshade.scene().active_shape().end_removing_control_points()

begin_removing_edges

稜線の削除を開始する。
end_removing_edges()が呼ばれるまで、削除による番号の再設定が行われなくなる。
通常稜線を削除すると、番号は再設定されるため、複数の稜線を削除する場合は末尾から削除する必要がある。
この場合は、再設定が行われないので先頭から任意の番号を連続して削除することが可能になる。
参照 :
  remove_edge

#先頭から0番と2番の稜線を削除する
xshade.scene().active_shape().begin_removing_edges()
xshade.scene().active_shape().remove_edge(0)
xshade.scene().active_shape().remove_edge(2)
xshade.scene().active_shape().end_removing_edges()

begin_removing_faces

面の削除を開始する。
end_removing_faces()が呼ばれるまで、削除による番号の再設定が行われなくなる。
通常面を削除すると、番号は再設定されるため、複数の面を削除する場合は末尾から削除する必要がある。
この場合は、再設定が行われないので先頭から任意の番号を連続して削除することが可能になる。
参照 :
  remove_face

#先頭から0番と2番の面を削除する
xshade.scene().active_shape().begin_removing_faces()
xshade.scene().active_shape().remove_face(0)
xshade.scene().active_shape().remove_face(2)
xshade.scene().active_shape().end_removing_faces()

begin_selecting_control_points

頂点の選択を開始する。

#0番と1番の頂点を選択する
xshade.scene().active_shape().begin_selecting_control_points()
xshade.scene().active_shape().set_active_control_point(0,True)
xshade.scene().active_shape().set_active_control_point(1,True)
xshade.scene().active_shape().end_selecting_control_points()

clean_winged_edge

ウイングドエッジデータを削除する。
参照 :
  setup_winged_edge

#0番の面の0番の頂点を中心として反時計向きにある稜線番号を出力する
xshade.scene().active_shape().setup_winged_edge()
print xshade.scene().active_shape().eccwfv(0,0,True)
xshade.scene().active_shape().clean_winged_edge()

cleanup_redundant_edges

重複稜線を削除する。

xshade.scene().active_shape().cleanup_redundant_edges()

cleanup_redundant_vertices

近傍頂点の結合をする。 引数 :
  bool : 選択頂点のみ
引数 :
  bool : 相対・絶対距離のどちらで扱うか
Trueのときは相対距離、Falseのときは絶対距離
引数 :
  float : 頂点の結合を行う距離
相対距離のときは形状のバウンディングボックスに対する倍率。絶対距離のときはmmで設定する。
参照 :
  select_overlapping_vertices

#引数を省略した場合は、すべての頂点、相対距離、倍率0.00001で処理を行う
xshade.scene().active_shape().cleanup_redundant_vertices()

clear_face_group

フェイスグループをすべて削除する。

xshade.scene().active_shape().clear_face_group()

clear_uv_layers

UV層をすべて削除する。

xshade.scene().active_shape().clear_uv_layers()

clear_vertex_color_layers

頂点カラー層をすべて削除する。

xshade.scene().active_shape().clear_vertex_color_layers()

eccwfv

面の頂点を中心として反時計向きにある稜線を返す。
引数 :
  int : 面番号
引数 :
  int : 面を構成する基準となる頂点番号
引数 :
  bool : エラーチェック
エラーチェックをTrueにすると、三面稜線など不正な結果になる場合に-1を返してエラー通知するが、処理速度は遅くなる。
戻り値 :
  int : 稜線番号
必ずsetup_winged_edge()を呼び出してウイングドエッジデータを設定してから使用する。
使用後はかならずclean_winged_edge()でウイングドエッジデータをクリアする。
参照 :
  ecwfv
  fccwev
  fcwev

#0番の面の0番の頂点を中心として反時計向きにある稜線番号を出力する
xshade.scene().active_shape().setup_winged_edge()
print xshade.scene().active_shape().eccwfv(0,0,True)
xshade.scene().active_shape().clean_winged_edge()

ecwfv

面の頂点を中心として時計向きにある稜線を返す。
引数 :
  int : 面番号
引数 :
  int : 面を構成する基準となる頂点番号
引数 :
  bool : エラーチェック
エラーチェックをTrueにすると、三面稜線など不正な結果になる場合に-1を返してエラー通知するが、処理速度は遅くなる。
戻り値 :
  int : 稜線番号
必ずsetup_winged_edge()を呼び出してウイングドエッジデータを設定してから使用する。
使用後はかならずclean_winged_edge()でウイングドエッジデータをクリアする。
参照 :
  eccwfv
  fccwev
  fcwev

#0番の面の0番の頂点を中心として時計向きにある稜線番号を出力する
xshade.scene().active_shape().setup_winged_edge()
print xshade.scene().active_shape().ecwfv(0,0,True)
xshade.scene().active_shape().clean_winged_edge()

edge

指定された稜線のedgeオブジェクトを返す。
戻り値 :
  edgeオブジェクト
引数 :
  int : 稜線の番号
参照 :
  edge

#0番の稜線のedgeオブジェクトの両方の頂点を出力する
print xshade.scene().active_shape().edge(0).v0
print xshade.scene().active_shape().edge(0).v1

end_removing_control_points

頂点の削除を終了する。
参照 :
  begin_removing_control_points
  remove_control_point

#先頭から0番と2番のコントロールポイントを削除する
xshade.scene().active_shape().begin_removing_control_points()
xshade.scene().active_shape().remove_control_point(0)
xshade.scene().active_shape().remove_control_point(2)
xshade.scene().active_shape().end_removing_control_points()

end_removing_edges

稜線の削除を終了する。
参照 :
  begin_removing_edges
  remove_edge

#先頭から0番と2番の稜線を削除する
xshade.scene().active_shape().begin_removing_edges()
xshade.scene().active_shape().remove_edge(0)
xshade.scene().active_shape().remove_edge(2)
xshade.scene().active_shape().end_removing_edges()

end_removing_faces

面の削除を終了する。
参照 :
  begin_removing_faces
  remove_face

#先頭から0番と2番の面を削除する
xshade.scene().active_shape().begin_removing_faces()
xshade.scene().active_shape().remove_face(0)
xshade.scene().active_shape().remove_face(2)
xshade.scene().active_shape().end_removing_faces()

end_selecting_control_points

頂点の選択を終了する。
参照 :
  begin_selecting_control_points

#0番と1番の頂点を選択する
xshade.scene().active_shape().begin_selecting_control_points()
xshade.scene().active_shape().set_active_control_point(0,True)
xshade.scene().active_shape().set_active_control_point(1,True)
xshade.scene().active_shape().end_selecting_control_points()

face

指定された面のfaceオブジェクトを返す。
戻り値 :
  faceオブジェクト
引数 :
  int : 面の番号
参照 :
  face

#0番の面の面を構成する頂点の数を出力する
print xshade.scene().active_shape().face(0).number_of_vertices

fccwev

稜線の頂点を中心として反時計向きにある面を返す。
引数 :
  int : 稜線番号
引数 :
  int : 稜線を構成する基準となる頂点番号
引数 :
  bool : チェック
エラーチェックをTrueにすると、三面稜線など不正な結果になる場合に-1を返してエラー通知するが、処理速度は遅くなる。
戻り値 :
  int : 面番号
必ずsetup_winged_edge()を呼び出してウイングドエッジデータを設定してから使用する。
使用後はかならずclean_winged_edge()でウイングドエッジデータをクリアする。
参照 :
  eccwfv
  ecwfv
  fcwev

#0番の面の0番の頂点を中心として反時計向きにある面番号を出力する
xshade.scene().active_shape().setup_winged_edge()
print xshade.scene().active_shape().fccwev(0,0,True)
xshade.scene().active_shape().clean_winged_edge()

fcwev

稜線の頂点を中心として時計向きにある面を返す。
引数 :
  int : 稜線番号
引数 :
  int : 稜線を構成する基準となる頂点番号
引数 :
  bool : チェック
エラーチェックをTrueにすると、三面稜線など不正な結果になる場合に-1を返してエラー通知するが、処理速度は遅くなる。
戻り値 :
  int : 面番号
必ずsetup_winged_edge()を呼び出してウイングドエッジデータを設定してから使用する。
使用後はかならずclean_winged_edge()でウイングドエッジデータをクリアする。
参照 :
  eccwfv
  ecwfv
  fccwev

#0番の面の0番の頂点を中心として時計向きにある面番号を出力する
xshade.scene().active_shape().setup_winged_edge()
print xshade.scene().active_shape().fcwev(0,0,True)
xshade.scene().active_shape().clean_winged_edge()

get_face_group

指定面に対応するフェイスグループのmaster_surfaceを返す。
戻り値 :
  master_surface
引数 :
  int : 面の番号

#0番の面に対応するフェイスグループのマスターサーフェスの名前を出力する
print xshade.scene().active_shape().get_face_group(0).name

get_face_group_index

指定面に対応するフェイスグループ番号を返す 。
戻り値 :
  int : フェイスグループ番号。無い場合は-1が返る
引数 :
  int : 面の番号

#0番の面に対応するフェイスグループの番号を出力する
print xshade.scene().active_shape().get_face_group_index(0)

get_face_group_surface

指定番号のフェイスグループのマスターサーフェスを返す。
戻り値 :
  master_surface
引数 :
  int : フェイスグループの番号

#0番のフェイスグループのマスターサーフェスの名前を出力する
print xshade.scene().active_shape().get_face_group_surface(0).name

get_number_of_face_groups

フェイスグループの数を返す。
戻り値 :
  int

print xshade.scene().active_shape().get_number_of_face_groups()

get_number_of_uv_layers

UV層の数を返す。
戻り値 :
  int

print xshade.scene().active_shape().get_number_of_uv_layers()

get_plane_equation

平面方程式を返す。
戻り値 :
  float4
引数 :
  int : 面の番号
setup_plane_equationで設定した平面方程式を返す。
存在しない面の番号を指定すると(0.0, 0.0, 0.0, 0.0)を返す。

#0番の面の平面方程式を出力する
xshade.scene().active_shape().setup_plane_equation()
print xshade.scene().active_shape().get_plane_equation(0)

make_edge

ポリゴンメッシュの指定したポイント間に稜線を追加する。
引数 :
  int : 稜線の始点の番号
引数 :
  int : 稜線の終点の番号

#頂点1と3からなる稜線を追加する
xshade.scene().active_shape().make_edge(1, 3)

make_edges

ポリゴンメッシュに必要な稜線を生成する。
稜線を持たない面を検出して稜線を生成する。

xshade.scene().active_shape().make_edges()

remove_control_point

指定された頂点を削除する。
引数 :
  int: 削除する頂点の番号
参照 :
  begin_removing_control_points
  end_removing_control_points

#先頭から0番と2番のコントロールポイントを削除する
xshade.scene().active_shape().begin_removing_control_points()
xshade.scene().active_shape().remove_control_point(0)
xshade.scene().active_shape().remove_control_point(2)
xshade.scene().active_shape().end_removing_control_points()

remove_edge

指定された稜線を削除する。
引数 :
  int : 削除する稜線の番号
参照 :
  begin_removing_edges
  end_removing_edges

#先頭から0番と2番の稜線を削除する
xshade.scene().active_shape().begin_removing_edges()
xshade.scene().active_shape().remove_edge(0)
xshade.scene().active_shape().remove_edge(2)
xshade.scene().active_shape().end_removing_edges()

remove_face

指定された面を削除する。
引数 :
  int : 削除する面の番号
参照 :
  begin_removing_faces
  end_removing_faces

#先頭から0番と2番の面を削除する
xshade.scene().active_shape().begin_removing_faces()
xshade.scene().active_shape().remove_face(0)
xshade.scene().active_shape().remove_face(2)
xshade.scene().active_shape().end_removing_faces()

remove_face_group

指定番号のフェイスグループを削除する。
引数 :
  int : 削除するフェイスグループの番号

#0番のフェイスグループを削除する
xshade.scene().active_shape().remove_face_group(0)

remove_uv_layer

指定番号のUV層を削除する。
引数 :
  int : 削除するUV層の番号

#1番のUV層を削除する
xshade.scene().active_shape().remove_uv_layer(1)

remove_vertex_color_layer

指定番号の頂点カラー層を削除する。
引数 :
  int : 削除する頂点カラー層の番号

#1番の頂点カラー層を削除する
xshade.scene().active_shape().remove_vertex_color_layer(1)

set_face_group_index

面にフェイスグループ番号を設定する。
引数 :
  int : 面の番号
引数 :
  int : フェイスグループの番号

#0番の面に1番のフェイスグループを設定する
xshade.scene().active_shape().set_face_group_index(0, 1)

set_face_group_surface

指定番号のフェイスグループにマスターサーフェスを設定する。
引数 :
  int : フェイスグループの番号
引数 :
  master_surface

#0番のフェイスグループに名前が「red」のマスターサーフェスを設定する
m_surface = xshade.scene().get_shape_by_name("red")
xshade.scene().active_shape().set_face_group_surface(0, m_surface)

select_border_edges

エラー診断選択の境界稜線選択をする。

#選択ポリゴンメッシュの境界稜線を選択する
xshade.scene().active_shape().select_border_edges()

select_boundary_edges

境界選択をする。

#選択している面の輪郭の稜線を選択する
xshade.scene().active_shape().select_boundary_edges()

select_concave_faces

エラー診断選択の凹面選択をする。

xshade.scene().active_shape().select_concave_faces()

select_contiguous_surface

連続面選択をする。
現在のメッシュ編集モードに合わせて、面、稜線、頂点にいずれかが選択される
参照 :
  selection_mode

xshade.scene().active_shape().select_contiguous_surface()

select_contiguous_surface_uv

UVの連続面選択をする。
現在のメッシュ編集モードに合わせて、面、稜線、頂点にいずれかが選択される
参照 :
  selection_mode

xshade.scene().active_shape().select_contiguous_surface_uv()

select_coplanar_faces

同一平面選択をする。
引数 :
  bool : 連続面のみ
Trueのときは、選択面と接続している面のみ選択される。Falseのときは、同一平面であれば非接続の面も選択される

xshade.scene().active_shape().select_coplanar_faces(True)

select_grow

選択範囲を拡大する。

xshade.scene().active_shape().select_grow()

select_inner_region_faces

面の内側領域選択をする。

xshade.scene().active_shape().select_inner_region_faces()

select_internal_faces

エラー診断選択の内包面選択をする。

xshade.scene().active_shape().select_internal_faces()

select_loop_edges

稜線のループ選択をする。

xshade.scene().active_shape().select_loop_edges()

select_loop_faces

面のループ選択をする。

xshade.scene().active_shape().select_loop_faces()

select_non_manifold_edges

エラー診断選択の三面稜線選択をする。
現在のメッシュ編集モードに合わせて、面、稜線、頂点にいずれかが選択される。
参照 :
  selection_mode

xshade.scene().active_shape().select_non_manifold_edges()

select_non_planar_faces

エラー診断選択の非平面選択をする。

xshade.scene().active_shape().select_non_planar_faces()

select_overlapping_faces

エラー診断選択の重複面選択をする。

xshade.scene().active_shape().select_overlapping_faces()

select_overlapping_vertices

エラー診断選択の重複点選択をする。

xshade.scene().active_shape().select_overlapping_vertices()

select_ring_edges

稜線のリング選択をする。

xshade.scene().active_shape().select_ring_edges()

select_shrink

選択範囲を縮小する。

xshade.scene().active_shape().select_shrink()

separate_all_non_manifold_edges

すべての三面稜線から面を分離する。

xshade.scene().active_shape().separate_all_non_manifold_edges()

separate_non_manifold_edges

三面稜線から面を分離する。
引数 :
  int : 面の番号のリスト/タプル
三面稜線に接する箇所に対してのみ、面の分離を行う。

#選択されている面を三面稜線から分離する
indices = xshade.scene().active_shape().active_face_indices
xshade.scene().active_shape().separate_non_manifold_edges(indices)

separate_selected_faces

選択面の分離、または複製を行う。
引数 :
  bool : 複製
Trueのときは面を複製をする。Falseのときは面の分離をする。
  bool : 形状作成
新しい形状を作成して、そこに面を分離、複製するかどうか。

#選択されている面を新規形状に複製する
xshade.scene().active_shape().separate_selected_faces(True, True)

setup_normal

法線を設定する。
実行するとfaceshading_normalsvertexnormalで頂点の法線を取得できるようになる。

#0番の頂点の法線を出力する
xshade.scene().active_shape().setup_normal()
print xshade.scene().active_shape().vertex(0).normal

setup_plane_equation

平面方程式を設定する。
参照 :
  get_plane_equation

#0番の面の平面方程式を出力する
xshade.scene().active_shape().setup_plane_equation()
print xshade.scene().active_shape().get_plane_equation(0)

setup_winged_edge

ウイングドエッジデータを設定する。
使用後はかならずclean_winged_edge()でウイングドエッジデータを削除する。
参照 :
  eccwfv() 面の頂点を中心として反時計向きにある稜線
  ecwfv() 面の頂点を中心として時計向きにある稜線
  fccwev() 稜線の頂点を中心として反時計向きにある面
  fcwev() 稜線の頂点を中心として時計向きにある面

#0番の面の0番の頂点を中心として反時計向きにある稜線番号を出力する
xshade.scene().active_shape().setup_winged_edge()
print xshade.scene().active_shape().eccwfv(0,0,True)
xshade.scene().active_shape().clean_winged_edge()

subdivide

角の丸めを設定したポリゴンメッシュに対して、サブディビジョンを行う。
引数 :
  int : 分割レベル

0分割しない
1荒い
2普通
3細かい
4最も細かい

サブディビジョンを行うと、角の丸めで分割された頂点、面、稜線の情報を算出して内部的に保持する。
保持された頂点、面、稜線の情報は通常通りの方法で取得できる(角の丸めの適用前の情報と入れ替わる)。
情報の保持のみを行うので、形状自体は変化しない。
情報の取得後はunsubdivide()でサブディビジョンを取り消す。

#サブディビジョン前と後の違い
#球から分割無しで変換したポリゴンに、丸め1を設定
#最初のnumber_of_faceは8を出力する
#次のnumber_of_faceでは丸め方式が「カトマル・クラーク」では24、「ドゥ・サビン」では26が出力される
xshade.scene().active_shape().round = 1.0
print xshade.scene().active_shape().number_of_faces
xshade.scene().active_shape().subdivide(1)
print xshade.scene().active_shape().number_of_faces
xshade.scene().active_shape().unsubdivide()

triangulate_faces

面を三角分割する。
引数 :
  int : 面の番号のリスト/タプル

#選択されている面を三角分割する
indices = xshade.scene().active_shape().active_face_indices
xshade.scene().active_shape().triangulate_faces(indices)

unify_normals

法線の向きを統一する。
引数 :
  bool : 外側に向ける
Trueにすると、法線の統一をした後、面を外側に向ける。
引数 :
  bool : 選択面のみ
参照 :
  has_inconsistent_faces

xshade.scene().active_shape().unify_normals(True,False)

unsubdivide

サブディビジョンを取り消す。
subdivide()で保持した情報を開放する。

xshade.scene().active_shape().unsubdivide()

vertex

指定された頂点のvertexオブジェクトを返す。
戻り値 :
  vertexオブジェクト
引数 :
  int : 頂点の番号
参照 :
  vertex

#0番の頂点の座標を出力する
print xshade.scene().active_shape().vertex(0).position

プロパティ詳細

active_edge_indices

選択されている稜線の番号のタプル。

  • 取得
  • 設定

型 :
  intのタプル
参照 :
  active_vertex_indices
  active_face_indices

print xshade.scene().active_shape().active_edge_indices

active_face_indices

選択されている面の番号のタプル。

  • 取得
  • 設定

型 :
  intのタプル
参照 :
  active_vertex_indices
  active_edge_indices

print xshade.scene().active_shape().active_face_indices

has_inconsistent_faces

辻褄の合っていない面があるかどうか。

  • 取得

型 :
  bool
参照 :
  unify_normals

if xshade.scene().active_shape().has_inconsistent_faces:
	xshade.scene().active_shape().unify_normals(False,False)

number_of_active_control_points

選択されている頂点の数。

  • 取得

型 :
  int

print xshade.scene().active_shape().number_of_active_control_points

number_of_edges

稜線の数。

  • 取得

型 :
  int

print xshade.scene().active_shape().number_of_edges

number_of_faces

面の数。

  • 取得

型 :
  int

print xshade.scene().active_shape().number_of_faces

number_of_non_manifold_edges

三面稜線の数。

  • 取得

型 :
  int

print xshade.scene().active_shape().number_of_non_manifold_edges

number_of_vertex_color_layers

頂点カラー層の数。

  • 取得

型 :
  int

print xshade.scene().active_shape().number_of_vertex_color_layers

round

サブディビジョンサーフェスの適用率。

  • 取得
  • 設定

型 :
  float
参照 :
  subdivide() サブディビジョンサーフェスで分割された結果のポリゴンメッシュの情報

print xshade.scene().active_shape().round

roundness_boundary_rule

OpenSubdivの境界ルール。

  • 取得
  • 設定

型 :
  int : 0:稜線とコーナー、1:稜線のみ

print xshade.scene().active_shape().roundness_boundary_rule

roundness_adaptive_subdivision_level

OpenSubdivの適応分割レベル。

  • 取得
  • 設定

型 :
  int : 分割レベル

print xshade.scene().active_shape().roundness_adaptive_subdivision_level

roundness_adaptive_tessellation

OpenSubdivの特徴適応分割のオン/オフ。

  • 取得
  • 設定

型 :
  bool

print xshade.scene().active_shape().roundness_adaptive_tessellation

roundness_preview_adaptive_tessellation

OpenSubdivの特徴適応分割の図面に表示のオン/オフ。

  • 取得
  • 設定

型 :
  bool

print xshade.scene().active_shape().roundness_preview_adaptive_tessellation

roundness_preview_subdivision_level

OpenSubdivの表示分割レベル。

  • 取得
  • 設定

型 :
  int : 分割レベル

print xshade.scene().active_shape().roundness_preview_subdivision_level

roundness_render_subdivision_level

OpenSubdivのレンダリング分割レベル。

  • 取得
  • 設定

型 :
  int : 分割レベル

print xshade.scene().active_shape().roundness_render_subdivision_level

roundness_show_edge_sharpness

OpenSubdivの稜線のシャープネスの色表示のオン/オフ。

  • 取得
  • 設定

型 :
  bool

print xshade.scene().active_shape().roundness_show_edge_sharpness

roundness_smooth_triangles

OpenSubdivのスムーズ三角形。

  • 取得
  • 設定

型 :
  bool

print xshade.scene().active_shape().roundness_smooth_triangles

roundness_type

サブディビジョンサーフェスの分割手法。

  • 取得
  • 設定

型 :
  int : 0:なし、1:カトマル・クラーク、2:ドゥ・サビン、3: OpenSubdiv

print xshade.scene().active_shape().roundness_type

roundness_uses_render_subdivision_level

OpenSubdivのレンダリング分割レベルのオン/オフ。

  • 取得
  • 設定

型 :
  bool

print xshade.scene().active_shape().roundness_uses_render_subdivision_level

roundness_uv

サブディビジョンサーフェスのUV補正。

  • 取得
  • 設定

型 :
  bool

print xshade.scene().active_shape().roundness_uv

show_edges

ポリゴンメッシュの稜線を表示のオン/オフ。

  • 取得
  • 設定

型 :
  bool

print xshade.scene().active_shape().show_edges

smooth_edges

スムーズのオン/オフ。

  • 取得
  • 設定

型 :
  bool
参照 :
  threshold スムーズの限界値

print xshade.scene().active_shape().smooth_edges

threshold

スムーズの限界値。

  • 取得
  • 設定

型 :
  int
参照 :
  smooth_edges スムーズのオン/オフ

print xshade.scene().active_shape().threshold