mapping layer

Used for operations concerning one mapping layer of the surface attributes.


xshade
shape
mapping_layer

List of Methods

load_image Loads an image

List of Properties

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).

Method Details

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)

Property Details

actual_size

Actual size of the mapping image (width, height).

  • Get
  • Set

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.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.mapping_layer(0).actual_size_mode

area

Area of the mapping image to use.

  • Get
  • Set

Type :
  rectangle

print xshade.scene().active_shape().surface.mapping_layer(0).area

blend_mode

Blend Mode.

  • Get
  • Set

Type :
  int :

0Normal
1Alpha Blend
2Add
3Subtract
4Multiply (Legacy)
5Max
6Min
7Multiply
print xshade.scene().active_shape().surface.mapping_layer(0).blend_mode

blur

Whether Smooth is on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.mapping_layer(0).blur

bump_height

The height.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.mapping_layer(0).bump_height

channel_mix

The channel blend method of the image.

  • Get
  • Set

Type :
  int :

0Premultiplied Alpha
1Transparent Alpha
2Multiply Alpha
3Grayscale (A)
4Grayscale (R)
5Grayscale (G)
6Grayscale (B)
7Grayscale (Luminance)
8Grayscale (Average)
9Not used
print xshade.scene().active_shape().surface.mapping_layer(0).channel_mix

flip_color

Invert on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.mapping_layer(0).flip_color

horizontal_flip

Horizontal Flip on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.mapping_layer(0).horizontal_flip

image

The image object.

  • Get
  • Set

Type :
  image object
See also :
  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.

  • Get
  • Set

Type :
  rgb

print xshade.scene().active_shape().surface.mapping_layer(0).mapping_color

mapping_size

The mapping size.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.mapping_layer(0).mapping_size

origin

The position of the origin.

  • Get
  • Set

Type :
  vec3

print xshade.scene().active_shape().surface.mapping_layer(0).origin

parameter_mapping

The UV type.

  • Get
  • Set

Type :
  int : 0: distance correction, 1: UV

print xshade.scene().active_shape().surface.mapping_layer(0).parameter_mapping

pattern

The mapping pattern.

  • Get
  • Set

Type :
  int :

0None
1Not used
2Stripes
3Checked
4Spotted
5Marble
6Wood
7Log
8Not used
9Not used
10Wave
11Ocean
12Cloud
13Not used
14Image
827326721Grid
827326722Bump Array
827326723Brick
827326725Blob
827326726Beehive
827326727Sand
827326728Veins
827326729Triangle Check
827326737Gradation
827326739fBm
print xshade.scene().active_shape().surface.mapping_layer(0).pattern

pattern_name

The pattern name.

  • Get
  • Set

Type :
  string

print xshade.scene().active_shape().surface.mapping_layer(0).pattern_name

phase

The phase

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.mapping_layer(0).phase

projection

The projection type.

  • Get
  • Set

Type :
  int :

0X
1Y
2Z
3Wrap
4Cylinder
5Sphere
6Box
print xshade.scene().active_shape().surface.mapping_layer(0).projection

repeat_image

Mapping image tiling on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.mapping_layer(0).repeat_image

repetition_x

Number of repetitions in the horizontal direction.

  • Get
  • Set

Type :
  int

print xshade.scene().active_shape().surface.mapping_layer(0).repetition_x

repetition_y

Number of repetitions in the vertical direction.

  • Get
  • Set

Type :
  int

print xshade.scene().active_shape().surface.mapping_layer(0).repetition_y

softness

The softness.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.mapping_layer(0).softness

swap_axes

Swap vertical and horizontal axes on/off

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.mapping_layer(0).swap_axes

transformation

The texture coordinates transformation matrix.

  • Get
  • Set

Type :
  mat4

print xshade.scene().active_shape().surface.mapping_layer(0).transformation

turbulence

The turbulence.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.mapping_layer(0).turbulence

type

The mapping type.

  • Get
  • Set

Type :
  int :

0Diffuse reflection
1Specular 1
2Specular 2
3Reflection
4Transparency
5Bump
6Trim
7Environment
8Glow
9Back Light
10Weight
11Refraction
12Roughness
13Anisotropic
14Fresnel Reflection
15Aberration
16Ambient
17Volume Distance
18Volume Color
19Volume Transparency
20Volume Glow
21Normal
22Displacement
23Light Mapping
24Opacity Mask
print xshade.scene().active_shape().surface.mapping_layer(0).type

uv_mapping

The mapping layer UV.

  • Get
  • Set

Type :
  int

print xshade.scene().active_shape().surface.mapping_layer(0).uv_mapping

vertical_flip

Vertical Flip on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.mapping_layer(0).vertical_flip

weight

The weight.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.mapping_layer(0).weight