surface

Used for surface attribute operations.


xshade
shape
surface

List of Methods

append_mapping_layer Appends a mapping layer
insert_mapping Inserts a mapping layer
load Loads a surface attribute settings file
mapping_layer Returns the mapping layer of the texture layer specified by argument
move_down_mapping_layer Moves the mapping layer of the specified index down the specified number of hierarchy levels
move_mapping Moves the mapping layer
move_up_mapping_layer Moves the mapping layer of the specified index up the specified number of hierarchy levels
remove_mapping Deletes the mapping layer
save Saves the surface attribute settings

List of Properties

aberration The aberration
ambient The ambient intensity
ambient_color The ambient color
anisotropic Anisotropic
backlight Back Light
backlight_color The Back Light color
black_key_mask Black Key Mask on/off
current_mapping_layer The current mapping layer
current_mapping_layer_index The current mapping layer index
diffuse Diffuse reflection
diffuse_color The Diffuse color
direct_illumination The weight of direct illumination
dont_reflect_background More Shading: Do Not Reflect Background
dont_visible_to_camera More Shading: Visible to Camera Disabled
dont_visible_to_indirect_rays More Shading: Indirect Light Attributes Disabled
dont_visible_to_reflection_rays More Shading: Reflection Attributes Disabled
dont_visible_to_refraction_rays More Shading: Refraction Attributes Disabled
do_not_cast_shadow Do Not Cast Shadows on/off
do_not_reflect_objects Do Not Reflect Other Objects on/off
do_not_show_shadow Do Not Show Shadows on/off
fresnel_reflection Fresnel
glow Glow
glow_color The Glow color
has_aberration Whether or not aberration is set
has_ambient Ambient on/off
has_anisotropic Anisotropic on/off
has_aux Whether or not other attributes are set
has_backlight Back Light on/off
has_current_mapping_layer Whether it has a mapping layer or not
has_diffuse Diffuse on/off
has_fresnel_reflection Fresnel on/off
has_glow Glow on/off
has_mapping_layers Mapping on/off
has_metallic Metallic on/off
has_pseudo_caustics Whether or not Pseudo Caustics is set
has_reflection Reflection on/off
has_refraction Refraction on/off
has_roughness Roughness on/off
has_shader_node Whether or not textures are set
has_specular_1 Specular 1 on/off
has_specular_2 Specular 2 on/off
has_transparency Transparency on/off
highlight Specular 1
highlight_2 Specular 2
highlight_color The Specular 1 color
highlight_color_2 The Specular 2 color
highlight_size The Specular 1 size
highlight_size_2 The Specular 2 size
indirect_illumination The weight of indirect illumination
is_master_surface Whether or not a master surface is set
local_coordinates Local Coordinates on/off
metallic Metallic
metallic_color The Metallic color
no_shading No Shading on/off
number_of_mapping_layers The number of mapping layers
pseudo_caustics Pseudo Caustics
pseudo_caustics_aberration Pseudo Caustics Aberration
pseudo_caustics_brightness Pseudo Caustics Brightness
pseudo_caustics_bump Pseudo Caustics Bump
reflection Reflection
reflection_color The Reflection color
refraction Refraction
roughness Roughness
smoother_shading Smoother Shading on/off
soft_glow Soft Glow
thumbnail_image The thumbnail image object
transparency Transparency
transparency_color The Transparency color
white_key_mask White Key Mask on/off




Used after getting an object with a method such as xshade.scene().active_shape().
Used for objects with surface attributes set, or master surface objects.

Method Details

append_mapping_layer

Appends a mapping layer.
See also :
  mapping_layer
If there are no mapping layers, or if run after surface attributes have just been created, the mapping layer is appended to number 1.

xshade.scene().active_shape().surface.append_mapping_layer()

insert_mapping

Inserts a mapping layer.
Arguments :
  int : the index of the insert position
See also :
  mapping_layer
If there is no mapping layer, causes an error.

#Insert a mapping layer at index 0
xshade.scene().active_shape().surface.insert_mapping(0)

load

Loads a surface attribute settings file.
Arguments :
  file_path

#Load a surface attribute settings file
dialog = xshade.create_dialog_with_uuid()
file_path = dialog.ask_path(True, '*.shdsfc|shdsfc')
xshade.scene().active_shape().surface.load(file_path)

mapping_layer

Returns the mapping layer of the texture layer specified by argument.
Return value :
  mapping_layer object
Arguments :
  int : the index of the mapping layer
See also :
  mapping_layer

#Output the name of the mapping layer pattern of index 0
print xshade.scene().active_shape().surface.mapping_layer(0).pattern_name

move_down_mapping_layer

Moves the mapping layer of the specified index down the specified number of hierarchy levels.
Arguments :
  int : the amount to move
Arguments :
  int : the index of the mapping layer
See also :
  mapping_layer

#Move the mapping layer of the index 2 down the specified number of hierarchy levels
xshade.scene().active_shape().surface.move_down_mapping_layer(1,2)

move_mapping

Moves the mapping layer.
Arguments :
  int : the index of the mapping layer to move
Arguments :
  int : the index of the mapping layer destination
See also :
  mapping_layer
Only moves in the direction from a larger index to a smaller index.

#Move mapping layer of index 1 to index 0
xshade.scene().active_shape().surface.move_mapping(1, 0)

move_up_mapping_layer

Moves the mapping layer of the specified index up the specified number of hierarchy levels.
Arguments :
  int : the amount to move
Arguments :
  int : the index of the mapping layer
See also :
  mapping_layer

#Move the mapping layer of index 2 up one hierarchy level
xshade.scene().active_shape().surface.move_up_mapping_layer(1,2)

remove_mapping

Deletes the mapping layer.
Arguments :
  int : the index of the mapping layer
Specifying 0 for int in Shade 10.5.3 causes a crash.

#Delete the mapping layer at index 1
xshade.scene().active_shape().surface.remove_mapping(1)

save

Saves the surface attribute settings.
Arguments :
  file_path

#Save the surface attribute settings
dialog = xshade.create_dialog_with_uuid()
file_path = dialog.ask_path(False, '*.shdsfc|shdsfc')
xshade.scene().active_shape().surface.save(file_path)

Property Details

aberration

The aberration.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.aberration

ambient

The ambient intensity.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.ambient

ambient_color

The ambient color.

  • Get
  • Set

Type :
  rgb
When set, Ambient is enabled automatically.

print xshade.scene().active_shape().surface.ambient_color

anisotropic

Anisotropic.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.anisotropic

backlight

Back Light.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.backlight

backlight_color

The Back Light color.

  • Get
  • Set

Type :
  rgb

print xshade.scene().active_shape().surface.backlight_color

black_key_mask

Black Key Mask on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.black_key_mask

current_mapping_layer

The current mapping layer.

  • Get
  • Set

Type :
  mapping_layer object
See also :
  mapping_layer

#Output the name of the current mapping layer pattern
print xshade.scene().active_shape().surface.current_mapping_layer.pattern_name

current_mapping_layer_index

The current mapping layer index.

  • Get
  • Set

Type :
  int
If not set, returns -1.

print xshade.scene().active_shape().surface.current_mapping_layer_index

diffuse

Diffuse reflection.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.diffuse

diffuse_color

The Diffuse color.

  • Get
  • Set

Type :
  rgb

print xshade.scene().active_shape().surface.diffuse_color

direct_illumination

The weight of direct illumination.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.direct_illumination

dont_reflect_background

More Shading: Do Not Reflect Background.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.dont_reflect_background

dont_visible_to_camera

More Shading: Visible to Camera Disabled.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.dont_visible_to_camera

dont_visible_to_indirect_rays

More Shading: Indirect Light Attributes Disabled.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.dont_visible_to_indirect_rays

dont_visible_to_reflection_rays

More Shading: Reflection Attributes Disabled.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.dont_visible_to_reflection_rays

dont_visible_to_refraction_rays

More Shading: Refraction Attributes Disabled.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.dont_visible_to_refraction_rays

do_not_cast_shadow

Do Not Cast Shadows on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.do_not_cast_shadow

do_not_reflect_objects

Do Not Reflect Other Objects on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.do_not_reflect_objects

do_not_show_shadow

Do Not Show Shadows on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.do_not_show_shadow

fresnel_reflection

Fresnel.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.fresnel_reflection

glow

Glow.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.glow

glow_color

The Glow color.

  • Get
  • Set

Type :
  rgb

print xshade.scene().active_shape().surface.glow_color

has_aberration

Whether or not aberration is set.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_aberration

has_ambient

Ambient on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_ambient

has_anisotropic

Anisotropic on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_anisotropic

has_aux

Whether or not other attributes are set.

  • Get
  • Set

Type :
  bool
There is no 'off' button on the interface, so normally only returns "True".

print xshade.scene().active_shape().surface.has_aux

has_backlight

Back Light on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_backlight

has_current_mapping_layer

Whether it has a mapping layer or not.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_current_mapping_layer

has_diffuse

Diffuse on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_diffuse

has_fresnel_reflection

Fresnel on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_fresnel_reflection

has_glow

Glow on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_glow

has_mapping_layers

Mapping on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_mapping_layers

has_metallic

Metallic on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_metallic

has_pseudo_caustics

Whether or not Pseudo Caustics is set.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_pseudo_caustics

has_reflection

Reflection on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_reflection

has_refraction

Refraction on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_refraction

has_roughness

Roughness on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_roughness

has_shader_node

Whether or not textures are set.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_shader_node

has_specular_1

Specular 1 on/off

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_specular_1

has_specular_2

Specular 2 on/off

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_specular_2

has_transparency

Transparency on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.has_transparency

highlight

Specular 1.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.highlight

highlight_2

Specular 2.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.highlight_2

highlight_color

The Specular 1 color.

  • Get
  • Set

Type :
  rgb

print xshade.scene().active_shape().surface.highlight_color

highlight_color_2

The Specular 2 color.

  • Get
  • Set

Type :
  rgb

print xshade.scene().active_shape().surface.highlight_color_2

highlight_size

The Specular 1 size.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.highlight_size

highlight_size_2

The Specular 2 size.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.highlight_size_2

indirect_illumination

The weight of indirect illumination.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.indirect_illumination

is_master_surface

Whether or not a master surface is set.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.is_master_surface

local_coordinates

Local Coordinates on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.local_coordinates

metallic

Metallic.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.metallic

metallic_color

The Metallic color.

  • Get
  • Set

Type :
  rgb

print xshade.scene().active_shape().surface.metallic_color

no_shading

No Shading on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.no_shading

number_of_mapping_layers

The number of mapping layers.

  • Get
  • Set

Type :
  int

print xshade.scene().active_shape().surface.number_of_mapping_layers

pseudo_caustics

Pseudo Caustics.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.pseudo_caustics

pseudo_caustics_aberration

Pseudo Caustics Aberration.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.pseudo_caustics_aberration

pseudo_caustics_brightness

Pseudo Caustics Brightness.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.pseudo_caustics_brightness

pseudo_caustics_bump

The Pseudo Caustics Bump value.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.pseudo_caustics_bump

reflection

Reflection.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.reflection

reflection_color

The Reflection color.

  • Get
  • Set

Type :
  rgb

print xshade.scene().active_shape().surface.reflection_color

refraction

Refraction.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.refraction

roughness

Roughness.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.roughness

smoother_shading

Smoother Shading on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.smoother_shading

soft_glow

Soft Glow.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.soft_glow

thumbnail_image

The thumbnail image object.

  • Get
  • Set

Type :
  image object
See also :
  image

#Set the rendered image to the thumbnail image
rimage = xshade.scene().rendering.image
xshade.scene().active_shape().surface.thumbnail_image = rimage

transparency

Transparency.

  • Get
  • Set

Type :
  float

print xshade.scene().active_shape().surface.transparency

transparency_color

The Transparency color

  • Get
  • Set

Type :
  rgb

print xshade.scene().active_shape().surface.transparency_color

white_key_mask

White Key Mask on/off.

  • Get
  • Set

Type :
  bool

print xshade.scene().active_shape().surface.white_key_mask