3DCoat Python API
The 3DCoat Python API documentation.
Loading...
Searching...
No Matches
coat.Scene Class Reference

Static Public Member Functions

 clearScene (bool askUser=False)
 clear the whole scene
 
SceneElement current ()
 returns the current sculpt object
 
SceneElement sculptRoot ()
 get the root of all sculpt objects
 
SceneElement curvesRoot ()
 get the root of all curves
 
int getLayer (str name, bool addIfNotExists=True)
 get the Layer ID by name, add the layer if not exists
 
str getLayerName (int LayerID)
 get the layer name
 
 setLayerName (int LayerID, str name)
 set the layer name
 
int getLayerBlending (int LayerID)
 get the layer blending mode
 
 setLayerBlending (int LayerID, int mode)
 set the layer blending mode
 
int getCurrentLayer ()
 get current layer identifier
 
 setCurrentLayer (int LayerID)
 set the current layer
 
 mergeVisibleLayers ()
 merge all visible layers
 
 mergeLayerDown (int LayerID)
 merge the layer down
 
 applyLayerBlending (int LayerID)
 apply layer blending
 
 invalidateLayer (int LayerID)
 refresh the layer appearance in scene
 
 setActiveLayer (int LayerID)
 activate the layer
 
 removeLayer (int LayerID)
 remove the layer
 
bool layerIsEmpty (int layerID)
 Check if the layer is empty.
 
 removeEmptyLayers ()
 remove all unused layers
 
bool layerVisible (int LayerID)
 return the layer visibility
 
 setLayerVisibility (int LayerID, bool Visible)
 set the layer visibility
 
 setLayerColorOpacity (int LayerID, float Opacity)
 set the layer opacity
 
 setLayerDepthOpacity (int LayerID, float Opacity)
 set the layer depth opacity
 
 setLayerMetalnessOpacity (int LayerID, float Opacity)
 set the layer metalness opacity
 
 setLayerGlossOpacity (int LayerID, float Opacity)
 set the layer gloss/roughness opacity
 
int assignLayerMask (int LayerID)
 assign the mask to the layer if it is not assigned before
 
 removeLayerMask (int LayerID)
 remove the layer mask
 
 extractMaskAsLayer (int LayerID)
 If the layer has the mask attached, the mask will be extracted as a new layer and the masking disabled.
 
 setMaskForTheLayer (int LayerID, int MaskLayerID)
 set the MaskLayerID to be used as mask for the LayerID.
 
 enableLayerMask (int LayerID, bool enable)
 enable or disable the layer mask
 
bool isLayerMaskEnabled (int LayerID)
 check if the mask is enabled for the layer
 
 invertLayerMask (int LayerID)
 invert the layer mask (if assigned)
 
int getLayerMaskLayer (int LayerID)
 get the mask identifier assigned to the layer
 
 disableLayerMask (int LayerID)
 disable the mask for the layer
 
 enableLayerMask (int LayerID)
 enable the mask for the layer
 
bool maskEnabled (int LayerID)
 check if the mask is enabled for the layer
 
 setClippingLayer (int LayerID)
 set this layer as clipping layer
 
 disableClippingLayer (int LayerID)
 disable the clipping layer
 
int PaintObjectsCount ()
 Get the count of paint objects in scene.
 
int PaintMaterialCount ()
 Get the count of paint materials.
 
int PaintUVSetsCount ()
 Get the paint UV-sets (textures) count.
 
 RemovePaintObject (int idx)
 Remove the paint object.
 
 RemovePaintMaterial (int idx)
 Remove the paint material.
 
 RemoveUVSet (int idx)
 Remove the UV-set (texture)
 
str PaintObjectName (int idx)
 Get the reference to the object name.
 
str PaintMaterialName (int idx)
 Get the reference to the material mane.
 
str PaintUVSetName (int idx)
 Get the reference to the UV set name.
 
SceneElement importMesh (str filename, mat4 transform=mat4.Identity)
 import mesh into scene, it is the same as File->Import->Import mesh for vertex painting/reference ... This is the optimal way to import mesh into the scene
 
 ScaleSceneVisually (float scale)
 Scale the whole scene visually but keep the export size.
 
 ScaleSceneUnits (float scale)
 Keep the scene visial size in scene, but scale the export size.
 
float GetSceneScale ()
 the length of 1 scene unit when you export the scene
 
str GetSceneUnits ()
 get the name of the current scene units
 
bool setSceneUnits (str units)
 Set the scene units without actual scaling the scene to new units, just name change.
 
vec3 getSceneShift ()
 get the scene shift value, look the Edit->Scale master->X,Y,Z
 
 setSceneShift (vec3 shift)
 set the scene shift value, look the Edit->Scale master->X,Y,Z
 
list getAvailableUnits ()
 Get the list of all available units.
 
bool convertSceneUnits (str destination_unit_name)
 Convert the scene units to the new units, the scene scale will be changed, visual size will be kept.
 

Member Function Documentation

◆ applyLayerBlending()

coat.Scene.applyLayerBlending ( int LayerID)
static

apply layer blending

Parameters
LayerIDthe layer identifier

◆ assignLayerMask()

int coat.Scene.assignLayerMask ( int LayerID)
static

assign the mask to the layer if it is not assigned before

Parameters
LayerIDthe layer identifier to assign the mask
Returns
the mask identifier

◆ clearScene()

coat.Scene.clearScene ( bool askUser = False)
static

clear the whole scene

Parameters
askUserset true to ask user for unsaved changes

◆ convertSceneUnits()

bool coat.Scene.convertSceneUnits ( str destination_unit_name)
static

Convert the scene units to the new units, the scene scale will be changed, visual size will be kept.

Parameters
destination_unit_namethe name of new units
Returns
false if units are not supported

◆ current()

SceneElement coat.Scene.current ( )
static

returns the current sculpt object

Returns
current object reference

◆ curvesRoot()

SceneElement coat.Scene.curvesRoot ( )
static

get the root of all curves

Returns
the root reference

◆ disableClippingLayer()

coat.Scene.disableClippingLayer ( int LayerID)
static

disable the clipping layer

Parameters
LayerIDthe layer identifier

◆ disableLayerMask()

coat.Scene.disableLayerMask ( int LayerID)
static

disable the mask for the layer

Parameters
LayerIDthe layer identifier

◆ enableLayerMask() [1/2]

coat.Scene.enableLayerMask ( int LayerID)
static

enable the mask for the layer

Parameters
LayerIDthe layer identifier

◆ enableLayerMask() [2/2]

coat.Scene.enableLayerMask ( int LayerID,
bool enable )
static

enable or disable the layer mask

Parameters
LayerIDthe layer identifier
enabletrue to enable, false to disable

◆ extractMaskAsLayer()

coat.Scene.extractMaskAsLayer ( int LayerID)
static

If the layer has the mask attached, the mask will be extracted as a new layer and the masking disabled.

Parameters
LayerIDthe layer identifier

◆ getAvailableUnits()

list coat.Scene.getAvailableUnits ( )
static

Get the list of all available units.

Returns
the list of strings

◆ getCurrentLayer()

int coat.Scene.getCurrentLayer ( )
static

get current layer identifier

Returns
the current layer identifier

◆ getLayer()

int coat.Scene.getLayer ( str name,
bool addIfNotExists = True )
static

get the Layer ID by name, add the layer if not exists

Parameters
namelayer name
addIfNotExistsset true to add layer if it does not exist
Returns
layer identifier

◆ getLayerBlending()

int coat.Scene.getLayerBlending ( int LayerID)
static

get the layer blending mode

Parameters
LayerIDthe layer identifier
Returns
the index of blending mode as it is ordered in the Layers UI

◆ getLayerMaskLayer()

int coat.Scene.getLayerMaskLayer ( int LayerID)
static

get the mask identifier assigned to the layer

Parameters
LayerIDthe layer identifier
Returns
the mask layer identifier

◆ getLayerName()

str coat.Scene.getLayerName ( int LayerID)
static

get the layer name

Parameters
LayerIDthe layer identifier
Returns
the layer name

◆ GetSceneScale()

float coat.Scene.GetSceneScale ( )
static

the length of 1 scene unit when you export the scene

Returns
the 1 unit of scene length in the exported model

◆ getSceneShift()

vec3 coat.Scene.getSceneShift ( )
static

get the scene shift value, look the Edit->Scale master->X,Y,Z

◆ GetSceneUnits()

str coat.Scene.GetSceneUnits ( )
static

get the name of the current scene units

Returns
the name as string

◆ importMesh()

SceneElement coat.Scene.importMesh ( str filename,
mat4 transform = mat4.Identity )
static

import mesh into scene, it is the same as File->Import->Import mesh for vertex painting/reference ... This is the optimal way to import mesh into the scene

Parameters
filenamethe filename, if it is empty, the dialog appears
Returns
the scene element reference

◆ invalidateLayer()

coat.Scene.invalidateLayer ( int LayerID)
static

refresh the layer appearance in scene

Parameters
LayerIDthe layer identifier

◆ invertLayerMask()

coat.Scene.invertLayerMask ( int LayerID)
static

invert the layer mask (if assigned)

Parameters
LayerIDthe layer identifier

◆ isLayerMaskEnabled()

bool coat.Scene.isLayerMaskEnabled ( int LayerID)
static

check if the mask is enabled for the layer

Parameters
LayerIDthe layer identifier
Returns
true if masking is enabled and assigned, false if disabled or not assigned

◆ layerIsEmpty()

bool coat.Scene.layerIsEmpty ( int layerID)
static

Check if the layer is empty.

Parameters
layerIDthe layer identifier
Returns
true if the layer is empty

◆ layerVisible()

bool coat.Scene.layerVisible ( int LayerID)
static

return the layer visibility

◆ maskEnabled()

bool coat.Scene.maskEnabled ( int LayerID)
static

check if the mask is enabled for the layer

Parameters
LayerIDthe layer identifier
Returns
true if enabled, false if disabled of not assigned

◆ mergeLayerDown()

coat.Scene.mergeLayerDown ( int LayerID)
static

merge the layer down

Parameters
LayerIDthe layer identifier

◆ mergeVisibleLayers()

coat.Scene.mergeVisibleLayers ( )
static

merge all visible layers

◆ PaintMaterialCount()

int coat.Scene.PaintMaterialCount ( )
static

Get the count of paint materials.

Returns
the amount

◆ PaintMaterialName()

str coat.Scene.PaintMaterialName ( int idx)
static

Get the reference to the material mane.

Parameters
idxthe index of the material
Returns
the reference

◆ PaintObjectName()

str coat.Scene.PaintObjectName ( int idx)
static

Get the reference to the object name.

Parameters
idxindex of the object
Returns
the reference

◆ PaintObjectsCount()

int coat.Scene.PaintObjectsCount ( )
static

Get the count of paint objects in scene.

Returns
the amount

◆ PaintUVSetName()

str coat.Scene.PaintUVSetName ( int idx)
static

Get the reference to the UV set name.

Parameters
idxthe index of the UV set
Returns
the reference

◆ PaintUVSetsCount()

int coat.Scene.PaintUVSetsCount ( )
static

Get the paint UV-sets (textures) count.

Returns
the amount

◆ removeEmptyLayers()

coat.Scene.removeEmptyLayers ( )
static

remove all unused layers

◆ removeLayer()

coat.Scene.removeLayer ( int LayerID)
static

remove the layer

Parameters
LayerIDthe layer identifier

◆ removeLayerMask()

coat.Scene.removeLayerMask ( int LayerID)
static

remove the layer mask

Parameters
LayerIDthe layer identifier

◆ RemovePaintMaterial()

coat.Scene.RemovePaintMaterial ( int idx)
static

Remove the paint material.

Parameters
idxthe index of the material

◆ RemovePaintObject()

coat.Scene.RemovePaintObject ( int idx)
static

Remove the paint object.

Parameters
idxthe index of the object

◆ RemoveUVSet()

coat.Scene.RemoveUVSet ( int idx)
static

Remove the UV-set (texture)

Parameters
idxthe index of the UV-set (texture)

◆ ScaleSceneUnits()

coat.Scene.ScaleSceneUnits ( float scale)
static

Keep the scene visial size in scene, but scale the export size.

Parameters
scalethe scale, >1 means objects become bigger in export

◆ ScaleSceneVisually()

coat.Scene.ScaleSceneVisually ( float scale)
static

Scale the whole scene visually but keep the export size.

Parameters
scalethe scale, >1 means objects become bigger in scene

◆ sculptRoot()

SceneElement coat.Scene.sculptRoot ( )
static

get the root of all sculpt objects

Returns
the root reference

◆ setActiveLayer()

coat.Scene.setActiveLayer ( int LayerID)
static

activate the layer

Parameters
LayerIDthe layer identifier

◆ setClippingLayer()

coat.Scene.setClippingLayer ( int LayerID)
static

set this layer as clipping layer

Parameters
LayerIDthe layer identifier

◆ setCurrentLayer()

coat.Scene.setCurrentLayer ( int LayerID)
static

set the current layer

Parameters
LayerIDthe layer identifier

◆ setLayerBlending()

coat.Scene.setLayerBlending ( int LayerID,
int mode )
static

set the layer blending mode

Parameters
LayerIDthe layer identifier
modethe index of blending mode as it is ordered in the Layers UI

◆ setLayerColorOpacity()

coat.Scene.setLayerColorOpacity ( int LayerID,
float Opacity )
static

set the layer opacity

Parameters
LayerIDthe layer identifier
Opacitythe color opacity

◆ setLayerDepthOpacity()

coat.Scene.setLayerDepthOpacity ( int LayerID,
float Opacity )
static

set the layer depth opacity

Parameters
LayerIDthe layer identifier
Opacitythe depth opacity

◆ setLayerGlossOpacity()

coat.Scene.setLayerGlossOpacity ( int LayerID,
float Opacity )
static

set the layer gloss/roughness opacity

Parameters
LayerIDthe layer identifier
Opacitythe gloss/roughness opacity

◆ setLayerMetalnessOpacity()

coat.Scene.setLayerMetalnessOpacity ( int LayerID,
float Opacity )
static

set the layer metalness opacity

Parameters
LayerIDthe layer identifier
Opacitythe metalness opacity

◆ setLayerName()

coat.Scene.setLayerName ( int LayerID,
str name )
static

set the layer name

Parameters
LayerIDthe layer identifier
namethe new name

◆ setLayerVisibility()

coat.Scene.setLayerVisibility ( int LayerID,
bool Visible )
static

set the layer visibility

Parameters
Visiblethe visibility

◆ setMaskForTheLayer()

coat.Scene.setMaskForTheLayer ( int LayerID,
int MaskLayerID )
static

set the MaskLayerID to be used as mask for the LayerID.

The MaskLayerID will disappear among the layers list

Parameters
LayerIDthe layer to be masked
MaskLayerIDthe mask layer

◆ setSceneShift()

coat.Scene.setSceneShift ( vec3 shift)
static

set the scene shift value, look the Edit->Scale master->X,Y,Z

Parameters
shiftthe new shift value

◆ setSceneUnits()

bool coat.Scene.setSceneUnits ( str units)
static

Set the scene units without actual scaling the scene to new units, just name change.

Parameters
unitsthe name of new units
Returns
false if units are not supported

The documentation for this class was generated from the following file: