Skip to main content

MaskRenderPropertiesOperations

Other

Provides an interface for managing render properties of 3D mask objects. This class enables control over visual representation, material properties, lighting, and display widgets for mask objects in the 3D scene.

Import​

import ScriptingApi as api

# Access via Application
app = api.Application()
ops = app.get_mask_render_properties_operations()

Methods​

Properties​

set_representation​

Sets the 3D preview surface visualization representation mode. Controls how the 3D preview surface geometry is displayed (points, wireframe, solid, or solid with edges).

Signature:

set_representation(maskNames: list, representation: SurfaceRepresentation) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
representationSurfaceRepresentationVisualization mode. Use api.SurfaceRepresentation.Points, api.SurfaceRepresentation.Wireframe, api.SurfaceRepresentation.Solid, or api.SurfaceRepresentation.SolidEdges.

set_interpolation​

Sets the 3D preview surface shading interpolation method. Controls the shading algorithm used for rendering the 3D preview surface.

Signature:

set_interpolation(maskNames: list, interpolation: SurfaceInterpolation) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
interpolationSurfaceInterpolationShading method. Use api.SurfaceInterpolation.Flat, api.SurfaceInterpolation.Gouraud, api.SurfaceInterpolation.Phong, or api.SurfaceInterpolation.PBR (Physically Based Rendering).

set_line_width​

Sets the line width for wireframe and edges visualization.

Signature:

set_line_width(maskNames: list, width: float) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
widthfloatLine width value in pixels (typically 1.0 to 10.0).

set_point_size​

Sets the point size for point cloud visualization.

Signature:

set_point_size(maskNames: list, size: float) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
sizefloatPoint size value in pixels (typically 1.0 to 16.0).

set_face_culling​

Sets which 3D preview surface sides are visible (face culling).

Signature:

set_face_culling(maskNames: list, cullingType: FaceCullingType) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
cullingTypeFaceCullingTypeFace visibility mode. Use api.FaceCullingType.ShowAll, api.FaceCullingType.ShowFrontSideOnly, api.FaceCullingType.ShowBackSideOnly, or api.FaceCullingType.HideAll.

set_scalar_visibility​

Enables or disables scalar color visualization. When enabled, displays colors based on scalar data stored in the 3D preview surface points. When disabled, uses the material color instead.

Signature:

set_scalar_visibility(maskNames: list, visible: bool) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
visibleboolTrue to enable scalar colors, false to use material color.

set_color​

Sets the material base color for the surfaces.

Signature:

set_color(maskNames: list, color: list) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
colorlistRGB color components in range [0.0, 1.0].

set_random_color​

Assigns random colors to the specified surfaces.

Signature:

set_random_color(maskNames: list) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.

set_random_colors_to_labels​

Sets random colors to the given labels in a mask.

Signature:

set_random_colors_to_labels(maskName: str, labels: list) -> None

Parameters:

ParameterTypeDescription
maskNamestrName of the mask to modify.
labelslistList of label values to modify.

set_color_to_labels​

Sets specific colors to the given labels in a mask.

Signature:

set_color_to_labels(maskName: str, labels: list, rgb: list) -> None

Parameters:

ParameterTypeDescription
maskNamestrName of the mask to modify.
labelslistList of label values to modify.
rgblistRGB color [R, G, B] components in range [0.0, 1.0].

set_opacity​

Sets the opacity (transparency) of the surfaces.

Signature:

set_opacity(maskNames: list, opacity: float) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
opacityfloatOpacity value in range [0.0, 1.0], where 0.0 is fully transparent and 1.0 is fully opaque.

set_ambient_color​

Sets the ambient lighting color. Ambient light represents constant illumination from all directions.

Signature:

set_ambient_color(maskNames: list, color: list) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
colorlistRGB color [R, G, B] components in range [0.0, 1.0].

set_diffuse_color​

Sets the diffuse lighting color. Diffuse light represents matte surface reflection based on angle to light source.

Signature:

set_diffuse_color(maskNames: list, color: list) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
colorlistRGB color [R, G, B] components in range [0.0, 1.0].

set_specular_color​

Sets the specular (highlight) color. Specular light represents shiny surface reflections and highlights.

Signature:

set_specular_color(maskNames: list, color: list) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
colorlistRGB color [R, G, B] components in range [0.0, 1.0].

set_ambient_coefficient​

Sets the ambient lighting coefficient.

Signature:

set_ambient_coefficient(maskNames: list, coefficient: float) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
coefficientfloatAmbient intensity in range [0.0, 1.0].

set_diffuse_coefficient​

Sets the diffuse lighting coefficient.

Signature:

set_diffuse_coefficient(maskNames: list, coefficient: float) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
coefficientfloatDiffuse intensity in range [0.0, 1.0].

set_specular_coefficient​

Sets the specular lighting coefficient.

Signature:

set_specular_coefficient(maskNames: list, coefficient: float) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
coefficientfloatSpecular intensity in range [0.0, 1.0].

set_specular_power​

Sets the specular power (shininess). Higher values create tighter, more focused highlights.

Signature:

set_specular_power(maskNames: list, power: float) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
powerfloatSpecular power in range [0.0, 128.0].

set_metallic_coefficient​

Sets the metallic coefficient for PBR rendering. Controls how metallic the surface appears. Only used with PBR interpolation.

Signature:

set_metallic_coefficient(maskNames: list, coefficient: float) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
coefficientfloatMetallic value in range [0.0, 1.0], where 0.0 is non-metallic and 1.0 is fully metallic.

set_roughness_coefficient​

Sets the roughness coefficient for PBR rendering. Controls surface roughness. Only used with PBR interpolation.

Signature:

set_roughness_coefficient(maskNames: list, coefficient: float) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
coefficientfloatRoughness value in range [0.0, 1.0], where 0.0 is glossy and 1.0 is rough.

set_lighting_enabled​

Enables or disables lighting calculations for the surfaces. When disabled, surfaces display flat colors without shading.

Signature:

set_lighting_enabled(maskNames: list, enable: bool) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
enableboolTrue to enable lighting, false to disable.

set_bounding_box_visible​

Shows or hides the outline bounding box. Displays a wireframe box representing the object's extent.

Signature:

set_bounding_box_visible(maskNames: list, visible: bool) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
visibleboolTrue to show bounding box, false to hide.

set_corner_bounding_box_visible​

Shows or hides the corner bounding box markers. Displays small markers at the corners of the bounding box.

Signature:

set_corner_bounding_box_visible(maskNames: list, visible: bool) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
visibleboolTrue to show corner markers, false to hide.

set_axis_labels_visible​

Shows or hides the axis labels on the bounding box. Displays coordinate labels (e.g., "X", "Y", "Z") on bounding box edges.

Signature:

set_axis_labels_visible(maskNames: list, visible: bool) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
visibleboolTrue to show labels, false to hide.

set_bounding_box_color​

Sets the color of the outline bounding box.

Signature:

set_bounding_box_color(maskNames: list, color: list) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
colorlistRGBA color [R, G, B, A] components in range [0.0, 1.0].

set_corner_bounding_box_color​

Sets the color of the corner bounding box markers.

Signature:

set_corner_bounding_box_color(maskNames: list, color: list) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
colorlistRGBA color [R, G, B, A] components in range [0.0, 1.0].

set_axis_labels_color​

Sets the color of the axis labels.

Signature:

set_axis_labels_color(maskNames: list, color: list) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
colorlistRGBA color [R, G, B, A] components in range [0.0, 1.0].

get_opacity​

Retrieves the opacity (transparency) value for the specified mask.

Signature:

get_opacity(maskName: str) -> float

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: float — Opacity value in range [0.0, 1.0] where 0.0 is fully transparent and 1.0 is opaque.


get_color​

Retrieves the RGB color for the specified mask.

Signature:

get_color(maskName: str) -> list

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: list — Array of RGB color components in range [0.0, 1.0].


get_representation​

Retrieves the 3D preview surface representation mode.

Signature:

get_representation(maskName: str) -> SurfaceRepresentation

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: SurfaceRepresentation — api.SurfaceRepresentation enum value (Points, Wireframe, Solid, or SolidEdges).


get_interpolation​

Retrieves the 3D preview surface interpolation mode.

Signature:

get_interpolation(maskName: str) -> SurfaceInterpolation

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: SurfaceInterpolation — api.SurfaceInterpolation enum value (Flat, Gouraud, Phong, or PBR).


get_line_width​

Retrieves the line width for the specified 3D preview surface.

Signature:

get_line_width(maskName: str) -> float

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: float — Line width value in pixels.


get_point_size​

Retrieves the point size for the specified 3D preview surface.

Signature:

get_point_size(maskName: str) -> float

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: float — Point size value in pixels.


get_face_culling​

Retrieves the face culling type for the specified 3D preview surface. Retrieves the face culling type for a single mask.

Signature:

get_face_culling(maskName: str) -> FaceCullingType

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: FaceCullingType — api.FaceCullingType enum value.


get_scalar_visibility​

Gets the scalar visibility flag for the specified 3D preview surface.

Signature:

get_scalar_visibility(maskName: str) -> bool

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: bool — True if scalar visibility is enabled, false otherwise.


get_ambient_color​

Retrieves the ambient color for the specified 3D preview surface.

Signature:

get_ambient_color(maskName: str) -> list

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: list — Array of RGB color components in range [0.0, 1.0].


get_diffuse_color​

Retrieves the diffuse color for the specified 3D preview surface.

Signature:

get_diffuse_color(maskName: str) -> list

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: list — Array of RGB color components in range [0.0, 1.0].


get_specular_color​

Retrieves the specular color for the specified 3D preview surface.

Signature:

get_specular_color(maskName: str) -> list

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: list — Array of RGB color components in range [0.0, 1.0].


get_ambient_coefficient​

Retrieves the ambient coefficient for the specified 3D preview surface.

Signature:

get_ambient_coefficient(maskName: str) -> float

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: float — Ambient intensity value in range [0.0, 1.0].


get_diffuse_coefficient​

Retrieves the diffuse coefficient for the specified 3D preview surface.

Signature:

get_diffuse_coefficient(maskName: str) -> float

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: float — Diffuse intensity value in range [0.0, 1.0].


get_specular_coefficient​

Retrieves the specular coefficient for the specified 3D preview surface.

Signature:

get_specular_coefficient(maskName: str) -> float

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: float — Specular intensity value in range [0.0, 1.0].


get_specular_power​

Retrieves the specular power for the specified 3D preview surface.

Signature:

get_specular_power(maskName: str) -> float

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: float — Specular power value in range [0.0, 128.0].


get_metallic_coefficient​

Retrieves the metallic coefficient for PBR rendering for the specified 3D preview surface.

Signature:

get_metallic_coefficient(maskName: str) -> float

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: float — Metallic value in range [0.0, 1.0], where 0.0 is non-metallic and 1.0 is fully metallic.


get_roughness_coefficient​

Retrieves the roughness coefficient for PBR rendering for the specified 3D preview surface.

Signature:

get_roughness_coefficient(maskName: str) -> float

Parameters:

ParameterTypeDescription
maskNamestrName of the mask. Must exist in the current scene.

Returns: float — Roughness value in range [0.0, 1.0], where 0.0 is glossy and 1.0 is rough.


Modification​

set_clipping_enabled​

Enables or disables 3D clipping plane interactions. When enabled, surfaces can be clipped by active clipping planes.

Signature:

set_clipping_enabled(maskNames: list, enable: bool) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
enableboolTrue to enable clipping, false to disable.

set_scale_axes_visible​

Shows or hides the scale axes widget. Displays a 3D coordinate system widget showing the object's orientation and scale.

Signature:

set_scale_axes_visible(maskNames: list, visible: bool) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
visibleboolTrue to show scale axes, false to hide.

set_scale_axes_color​

Sets the color of the scale axes widget.

Signature:

set_scale_axes_color(maskNames: list, color: list) -> None

Parameters:

ParameterTypeDescription
maskNameslistList of mask names to modify.
colorlistRGBA color [R, G, B, A] components in range [0.0, 1.0].

See Also​