表面材質のマッピングの一つのレイヤの操作に使用する。
| xshade |
| ↑ |
| shape |
| ↑ |
| mapping_layer |
| load_image | イメージを読み込む |
| actual_size | マッピングイメージの実寸サイズ(横、縦) |
| actual_size_mode | 実寸のオン/オフ |
| area | マッピング画像の使用範囲 |
| blend_mode | 合成モード |
| blur | スムーズのオン/オフ |
| bump_height | 高さ |
| channel_mix | イメージのチャンネルの合成方法 |
| flip_color | 反転のオン/オフ |
| horizontal_flip | 左右反転のオン/オフ |
| image | イメージオブジェクト |
| mapping_color | マッピングの色 |
| mapping_size | マッピングサイズ |
| origin | 原点の位置 |
| parameter_mapping | UVの種類 |
| pattern | マッピングパターン |
| pattern_name | パターンの名前 |
| phase | 位相 |
| projection | 投影の種類 |
| repeat_image | マッピングイメージのタイリングのオン/オフ |
| repetition_x | 横方向の繰り返し回数 |
| repetition_y | 縦方向の繰り返し回数 |
| softness | ソフト |
| swap_axes | 縦と横の交換 |
| transformation | テクスチャーの座標変換マトリクス |
| turbulence | 乱れ |
| type | マッピングタイプ |
| uv_mapping | マッピングレイヤのUV |
| vertical_flip | 上下反転のオン/オフ |
| weight | 適用率 |
xshade.scene().active_shape().surface.mapping_layer(0)(マッピングレイヤの取得)のようにマッピングレイヤを取得して使用する。
load_image
イメージを読み込む。
引数 :
file_path
マッピングパターンをイメージに設定してから使用しないと無効。
#jpgイメージファイルを読み込む
dialog = xshade.create_dialog_with_uuid()
file_path = dialog.ask_path(True, '*.jpg|jpg')
xshade.scene().active_shape().surface.mapping_layer(0).load_image(file_path)
actual_size
マッピングイメージの実寸サイズ(横、縦)。
型 :
float : 横(mm)
型 :
float : 縦(mm)
投影が「ラップ」「球」以外で「実寸」がオンでないと無効。
print xshade.scene().active_shape().surface.mapping_layer(0).actual_size
actual_size_mode
実寸のオン/オフ。
型 :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).actual_size_mode
area
マッピング画像の使用範囲。
型 :
rectangle
print xshade.scene().active_shape().surface.mapping_layer(0).area
blend_mode
合成モード。
型 :
int :
| 0 | 通常 |
| 1 | αブレンド |
| 2 | 加算 |
| 3 | 減算 |
| 4 | 乗算(レガシー) |
| 5 | 比較(明) |
| 6 | 比較(暗) |
| 7 | 乗算 |
print xshade.scene().active_shape().surface.mapping_layer(0).blend_mode
blur
スムーズのオン/オフ。
型 :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).blur
bump_height
高さ。
型 :
float
print xshade.scene().active_shape().surface.mapping_layer(0).bump_height
channel_mix
イメージのチャンネルの合成方法。
型 :
int :
| 0 | アルファ乗算済み |
| 1 | アルファ透明 |
| 2 | アルファ乗算 |
| 3 | グレイスケール(A) |
| 4 | グレイスケール(R) |
| 5 | グレイスケール(G) |
| 6 | グレイスケール(B) |
| 7 | グレイスケール(輝度) |
| 8 | グレイスケール(平均) |
| 9 | 未使用 |
print xshade.scene().active_shape().surface.mapping_layer(0).channel_mix
flip_color
反転のオン/オフ。
型 :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).flip_color
horizontal_flip
左右反転のオン/オフ。
型 :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).horizontal_flip
image
#マッピングレイヤー0のイメージをウインドウに表示する
xshade.scene().active_shape().surface.mapping_layer(0).image.create_window('mapping_image')
mapping_color
マッピングの色。
型 :
rgb
print xshade.scene().active_shape().surface.mapping_layer(0).mapping_color
mapping_size
マッピングサイズ。
型 :
float
print xshade.scene().active_shape().surface.mapping_layer(0).mapping_size
origin
原点の位置。
型 :
vec3
print xshade.scene().active_shape().surface.mapping_layer(0).origin
parameter_mapping
UVの種類。
型 :
int : 0:距離補正、1:UV
print xshade.scene().active_shape().surface.mapping_layer(0).parameter_mapping
pattern
マッピングパターン。
型 :
int :
| 0 | なし |
| 1 | 未使用 |
| 2 | ストライプ |
| 3 | チェック |
| 4 | スポット |
| 5 | 大理石 |
| 6 | 木目 |
| 7 | 丸太 |
| 8 | 未使用 |
| 9 | 未使用 |
| 10 | 波 |
| 11 | 海 |
| 12 | 雲 |
| 13 | 未使用 |
| 14 | イメージマッピング |
| 827326721 | グリッド |
| 827326722 | バンプアレイ |
| 827326723 | レンガ |
| 827326725 | ブロブ |
| 827326726 | 蜂の巣 |
| 827326727 | 砂 |
| 827326728 | 葉脈 |
| 827326729 | 三角チェック |
| 827326737 | グラデーション |
| 827326739 | fBm |
print xshade.scene().active_shape().surface.mapping_layer(0).pattern
pattern_name
パターンの名前。
型 :
string
print xshade.scene().active_shape().surface.mapping_layer(0).pattern_name
phase
位相
型 :
float
print xshade.scene().active_shape().surface.mapping_layer(0).phase
projection
投影の種類。
型 :
int :
| 0 | X |
| 1 | Y |
| 2 | Z |
| 3 | ラップ |
| 4 | 円筒 |
| 5 | 球 |
| 6 | ボックス |
print xshade.scene().active_shape().surface.mapping_layer(0).projection
repeat_image
マッピングイメージのタイリングのオン/オフ。
型 :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).repeat_image
repetition_x
横方向の繰り返し回数。
型 :
int
print xshade.scene().active_shape().surface.mapping_layer(0).repetition_x
repetition_y
縦方向の繰り返し回数。
型 :
int
print xshade.scene().active_shape().surface.mapping_layer(0).repetition_y
softness
ソフト。
型 :
float
print xshade.scene().active_shape().surface.mapping_layer(0).softness
swap_axes
縦と横の交換のオン/オフ。
型 :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).swap_axes
transformation
テクスチャーの座標変換マトリクス。
型 :
mat4
print xshade.scene().active_shape().surface.mapping_layer(0).transformation
turbulence
乱れ。
型 :
float
print xshade.scene().active_shape().surface.mapping_layer(0).turbulence
type
マッピングタイプ。
型 :
int :
| 0 | 拡散反射 |
| 1 | 光沢1 |
| 2 | 光沢2 |
| 3 | 反射 |
| 4 | 透明度 |
| 5 | バンプ |
| 6 | トリム |
| 7 | 環境 |
| 8 | 発光 |
| 9 | バックライト |
| 10 | マット |
| 11 | 屈折 |
| 12 | 反射の荒さ |
| 13 | 異方性反射 |
| 14 | フレネル反射 |
| 15 | 屈折の収差 |
| 16 | 環境光 |
| 17 | ボリューム減衰距離 |
| 18 | ボリューム色 |
| 19 | ボリューム透明度 |
| 20 | ボリューム発光 |
| 21 | ノーマル |
| 22 | ディスプレイスメント |
| 23 | ライトマッピング |
| 24 | 不透明マスク |
print xshade.scene().active_shape().surface.mapping_layer(0).type
uv_mapping
マッピングレイヤのUV。
型 :
int
print xshade.scene().active_shape().surface.mapping_layer(0).uv_mapping
vertical_flip
上下反転のオン/オフ。
型 :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).vertical_flip
weight
適用率。
型 :
float
print xshade.scene().active_shape().surface.mapping_layer(0).weight