Used for operations concerning one mapping layer of the surface attributes.
xshade |
↑ |
shape |
↑ |
mapping_layer |
load_image | Loads an image |
actual_size | Actual size of the mapping image (width, height) |
actual_size_mode | Actual Size on/off |
area | Area of the mapping image to use |
blend_mode | Blend Mode |
blur | Whether Smooth is on/off |
bump_height | The height |
channel_mix | The channel blend method of the image |
flip_color | Invert on/off |
horizontal_flip | Horizontal Flip on/off |
image | The image object |
mapping_color | The mapping color |
mapping_size | The mapping size |
origin | The position of the origin |
parameter_mapping | The UV type |
pattern | The mapping pattern |
pattern_name | The pattern name |
phase | The phase |
projection | The projection type |
repeat_image | Mapping image tiling on/off |
repetition_x | Number of repetitions in the horizontal direction |
repetition_y | Number of repetitions in the vertical direction |
softness | The softness |
swap_axes | Swap vertical and horizontal axes |
transformation | The texture coordinates transformation matrix |
turbulence | The turbulence |
type | The mapping type |
uv_mapping | The mapping layer UV |
vertical_flip | Vertical Flip on/off |
weight | The weight |
Used after getting the mapping layer with a method such as xshade.scene().active_shape().surface.mapping_layer(0).
load_image
Loads an image.
Arguments :
file_path
Disabled unless the mapping pattern is set to Image.
#Load a jpg image file
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
Actual size of the mapping image (width, height).
Type :
float : width (mm)
Type :
float : height (mm)
Enabled only when a projection other than Wrap or Sphere is selected, and Actual Size is on.
print xshade.scene().active_shape().surface.mapping_layer(0).actual_size
actual_size_mode
Actual Size on/off.
Type :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).actual_size_mode
area
Area of the mapping image to use.
Type :
rectangle
print xshade.scene().active_shape().surface.mapping_layer(0).area
blend_mode
Blend Mode.
Type :
int :
0 | Normal |
1 | Alpha Blend |
2 | Add |
3 | Subtract |
4 | Multiply (Legacy) |
5 | Max |
6 | Min |
7 | Multiply |
print xshade.scene().active_shape().surface.mapping_layer(0).blend_mode
blur
Whether Smooth is on/off.
Type :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).blur
bump_height
The height.
Type :
float
print xshade.scene().active_shape().surface.mapping_layer(0).bump_height
channel_mix
The channel blend method of the image.
Type :
int :
0 | Premultiplied Alpha |
1 | Transparent Alpha |
2 | Multiply Alpha |
3 | Grayscale (A) |
4 | Grayscale (R) |
5 | Grayscale (G) |
6 | Grayscale (B) |
7 | Grayscale (Luminance) |
8 | Grayscale (Average) |
9 | Not used |
print xshade.scene().active_shape().surface.mapping_layer(0).channel_mix
flip_color
Invert on/off.
Type :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).flip_color
horizontal_flip
Horizontal Flip on/off.
Type :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).horizontal_flip
image
#Display the image in mapping layer 0 in a window
xshade.scene().active_shape().surface.mapping_layer(0).image.create_window('mapping_image')
mapping_color
The mapping color.
Type :
rgb
print xshade.scene().active_shape().surface.mapping_layer(0).mapping_color
mapping_size
The mapping size.
Type :
float
print xshade.scene().active_shape().surface.mapping_layer(0).mapping_size
origin
The position of the origin.
Type :
vec3
print xshade.scene().active_shape().surface.mapping_layer(0).origin
parameter_mapping
The UV type.
Type :
int : 0: distance correction, 1: UV
print xshade.scene().active_shape().surface.mapping_layer(0).parameter_mapping
pattern
The mapping pattern.
Type :
int :
0 | None |
1 | Not used |
2 | Stripes |
3 | Checked |
4 | Spotted |
5 | Marble |
6 | Wood |
7 | Log |
8 | Not used |
9 | Not used |
10 | Wave |
11 | Ocean |
12 | Cloud |
13 | Not used |
14 | Image |
827326721 | Grid |
827326722 | Bump Array |
827326723 | Brick |
827326725 | Blob |
827326726 | Beehive |
827326727 | Sand |
827326728 | Veins |
827326729 | Triangle Check |
827326737 | Gradation |
827326739 | fBm |
print xshade.scene().active_shape().surface.mapping_layer(0).pattern
pattern_name
The pattern name.
Type :
string
print xshade.scene().active_shape().surface.mapping_layer(0).pattern_name
phase
The phase
Type :
float
print xshade.scene().active_shape().surface.mapping_layer(0).phase
projection
The projection type.
Type :
int :
0 | X |
1 | Y |
2 | Z |
3 | Wrap |
4 | Cylinder |
5 | Sphere |
6 | Box |
print xshade.scene().active_shape().surface.mapping_layer(0).projection
repeat_image
Mapping image tiling on/off.
Type :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).repeat_image
repetition_x
Number of repetitions in the horizontal direction.
Type :
int
print xshade.scene().active_shape().surface.mapping_layer(0).repetition_x
repetition_y
Number of repetitions in the vertical direction.
Type :
int
print xshade.scene().active_shape().surface.mapping_layer(0).repetition_y
softness
The softness.
Type :
float
print xshade.scene().active_shape().surface.mapping_layer(0).softness
swap_axes
Swap vertical and horizontal axes on/off
Type :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).swap_axes
transformation
The texture coordinates transformation matrix.
Type :
mat4
print xshade.scene().active_shape().surface.mapping_layer(0).transformation
turbulence
The turbulence.
Type :
float
print xshade.scene().active_shape().surface.mapping_layer(0).turbulence
type
The mapping type.
Type :
int :
0 | Diffuse reflection |
1 | Specular 1 |
2 | Specular 2 |
3 | Reflection |
4 | Transparency |
5 | Bump |
6 | Trim |
7 | Environment |
8 | Glow |
9 | Back Light |
10 | Weight |
11 | Refraction |
12 | Roughness |
13 | Anisotropic |
14 | Fresnel Reflection |
15 | Aberration |
16 | Ambient |
17 | Volume Distance |
18 | Volume Color |
19 | Volume Transparency |
20 | Volume Glow |
21 | Normal |
22 | Displacement |
23 | Light Mapping |
24 | Opacity Mask |
print xshade.scene().active_shape().surface.mapping_layer(0).type
uv_mapping
The mapping layer UV.
Type :
int
print xshade.scene().active_shape().surface.mapping_layer(0).uv_mapping
vertical_flip
Vertical Flip on/off.
Type :
bool
print xshade.scene().active_shape().surface.mapping_layer(0).vertical_flip
weight
The weight.
Type :
float
print xshade.scene().active_shape().surface.mapping_layer(0).weight