3DCoat Python API
The 3DCoat Python API documentation.
Loading...
Searching...
No Matches
Public Member Functions | List of all members
coat.Scene Class Reference

Public Member Functions

 clearScene (askUser=bool)
 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 (name=str, addIfNotExists=bool)
 get the Layer ID by name, add the layer if not exists
 
str getLayerName (LayerID=int)
 get the layer name
 
 setLayerName (LayerID=int, name=str)
 set the layer name
 
int getLayerBlending (LayerID=int)
 get the layer blending mode
 
 setLayerBlending (LayerID=int, mode=int)
 set the layer blending mode
 
int getCurrentLayer ()
 get current layer identifier
 
 setCurrentLayer (LayerID=int)
 set the current layer
 
 mergeVisibleLayers ()
 merge all visible layers
 
 mergeLayerDown (LayerID=int)
 merge the layer down
 
 applyLayerBlending (LayerID=int)
 apply layer blending
 
 invalidateLayer (LayerID=int)
 refresh the layer appearance in scene
 
 setActiveLayer (LayerID=int)
 activate the layer
 
 removeLayer (LayerID=int)
 remove the layer
 
bool layerVisible (LayerID=int)
 return the layer visibility
 
 setLayerVisibility (LayerID=int, Visible=bool)
 set the layer visibility
 
 setLayerColorOpacity (LayerID=int, Opacity=float)
 set the layer opacity
 
 setLayerDepthOpacity (LayerID=int, Opacity=float)
 set the layer depth opacity
 
 setLayerMetalnessOpacity (LayerID=int, Opacity=float)
 set the layer metalness opacity
 
 setLayerGlossOpacity (LayerID=int, Opacity=float)
 set the layer gloss/roughness opacity
 
int assignLayerMask (LayerID=int)
 assign the mask to the layer if it is not assigned before
 
 removeLayerMask (LayerID=int)
 remove the layer mask
 
int getLayerMaskLayer (LayerID=int)
 get the mask identifier assigned to the layer
 
 disableLayerMask (LayerID=int)
 disable the mask for the layer
 
 enableLayerMask (LayerID=int)
 enable the mask for the layer
 
bool maskEnabled (LayerID=int)
 check if the mask is enabled for the layer
 
 setClippingLayer (LayerID=int)
 set this layer as clipping layer
 
 disableClippingLayer (LayerID=int)
 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 (idx=int)
 Remove the paint object.
 
 RemovePaintMaterial (idx=int)
 Remove the paint material.
 
 RemoveUVSet (idx=int)
 Remove the UV-set (texture)
 
str PaintObjectName (idx=int)
 Get the reference to the object name.
 
str PaintMaterialName (idx=int)
 Get the reference to the material mane.
 
str PaintUVSetName (idx=int)
 Get the reference to the UV set name.
 
SceneElement importMesh (filename=str, transform=mat4)
 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 (scale=float)
 Scale the whole scene visually but keep the export size.
 
 ScaleSceneUnits (scale=float)
 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 (units=str)
 Set the scene units without actual scaling the scene to new units, just name change.
 
list getAvailableUnits ()
 Get the list of all available units.
 
bool convertSceneUnits (destination_unit_name=str)
 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 (   LayerID = int)

apply layer blending

Parameters
LayerIDthe layer identifier

◆ assignLayerMask()

int coat.Scene.assignLayerMask (   LayerID = int)

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 (   askUser = bool)

clear the whole scene

Parameters
askUserset true to ask user for unsaved changes

◆ convertSceneUnits()

bool coat.Scene.convertSceneUnits (   destination_unit_name = str)

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

returns the current sculpt object

Returns
current object reference

◆ curvesRoot()

SceneElement coat.Scene.curvesRoot ( )

get the root of all curves

Returns
the root reference

◆ disableClippingLayer()

coat.Scene.disableClippingLayer (   LayerID = int)

disable the clipping layer

Parameters
LayerIDthe layer identifier

◆ disableLayerMask()

coat.Scene.disableLayerMask (   LayerID = int)

disable the mask for the layer

Parameters
LayerIDthe layer identifier

◆ enableLayerMask()

coat.Scene.enableLayerMask (   LayerID = int)

enable the mask for the layer

Parameters
LayerIDthe layer identifier

◆ getAvailableUnits()

list coat.Scene.getAvailableUnits ( )

Get the list of all available units.

Returns
the list of strings

◆ getCurrentLayer()

int coat.Scene.getCurrentLayer ( )

get current layer identifier

Returns
the current layer identifier

◆ getLayer()

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

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 (   LayerID = int)

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 (   LayerID = int)

get the mask identifier assigned to the layer

Parameters
LayerIDthe layer identifier
Returns
the mask layer identifier

◆ getLayerName()

str coat.Scene.getLayerName (   LayerID = int)

get the layer name

Parameters
LayerIDthe layer identifier
Returns
the layer name

◆ GetSceneScale()

float coat.Scene.GetSceneScale ( )

the length of 1 scene unit when you export the scene

Returns
the 1 unit of scene length in the exported model

◆ GetSceneUnits()

str coat.Scene.GetSceneUnits ( )

get the name of the current scene units

Returns
the name as string

◆ importMesh()

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

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 (   LayerID = int)

refresh the layer appearance in scene

Parameters
LayerIDthe layer identifier

◆ layerVisible()

bool coat.Scene.layerVisible (   LayerID = int)

return the layer visibility

◆ maskEnabled()

bool coat.Scene.maskEnabled (   LayerID = int)

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 (   LayerID = int)

merge the layer down

Parameters
LayerIDthe layer identifier

◆ mergeVisibleLayers()

coat.Scene.mergeVisibleLayers ( )

merge all visible layers

◆ PaintMaterialCount()

int coat.Scene.PaintMaterialCount ( )

Get the count of paint materials.

Returns
the amount

◆ PaintMaterialName()

str coat.Scene.PaintMaterialName (   idx = int)

Get the reference to the material mane.

Parameters
idxthe index of the material
Returns
the reference

◆ PaintObjectName()

str coat.Scene.PaintObjectName (   idx = int)

Get the reference to the object name.

Parameters
idxindex of the object
Returns
the reference

◆ PaintObjectsCount()

int coat.Scene.PaintObjectsCount ( )

Get the count of paint objects in scene.

Returns
the amount

◆ PaintUVSetName()

str coat.Scene.PaintUVSetName (   idx = int)

Get the reference to the UV set name.

Parameters
idxthe index of the UV set
Returns
the reference

◆ PaintUVSetsCount()

int coat.Scene.PaintUVSetsCount ( )

Get the paint UV-sets (textures) count.

Returns
the amount

◆ removeLayer()

coat.Scene.removeLayer (   LayerID = int)

remove the layer

Parameters
LayerIDthe layer identifier

◆ removeLayerMask()

coat.Scene.removeLayerMask (   LayerID = int)

remove the layer mask

Parameters
LayerIDthe layer identifier

◆ RemovePaintMaterial()

coat.Scene.RemovePaintMaterial (   idx = int)

Remove the paint material.

Parameters
idxthe index of the material

◆ RemovePaintObject()

coat.Scene.RemovePaintObject (   idx = int)

Remove the paint object.

Parameters
idxthe index of the object

◆ RemoveUVSet()

coat.Scene.RemoveUVSet (   idx = int)

Remove the UV-set (texture)

Parameters
idxthe index of the UV-set (texture)

◆ ScaleSceneUnits()

coat.Scene.ScaleSceneUnits (   scale = float)

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 (   scale = float)

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

get the root of all sculpt objects

Returns
the root reference

◆ setActiveLayer()

coat.Scene.setActiveLayer (   LayerID = int)

activate the layer

Parameters
LayerIDthe layer identifier

◆ setClippingLayer()

coat.Scene.setClippingLayer (   LayerID = int)

set this layer as clipping layer

Parameters
LayerIDthe layer identifier

◆ setCurrentLayer()

coat.Scene.setCurrentLayer (   LayerID = int)

set the current layer

Parameters
LayerIDthe layer identifier

◆ setLayerBlending()

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

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 (   LayerID = int,
  Opacity = float 
)

set the layer opacity

Parameters
LayerIDthe layer identifier
Opacitythe color opacity

◆ setLayerDepthOpacity()

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

set the layer depth opacity

Parameters
LayerIDthe layer identifier
Opacitythe depth opacity

◆ setLayerGlossOpacity()

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

set the layer gloss/roughness opacity

Parameters
LayerIDthe layer identifier
Opacitythe gloss/roughness opacity

◆ setLayerMetalnessOpacity()

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

set the layer metalness opacity

Parameters
LayerIDthe layer identifier
Opacitythe metalness opacity

◆ setLayerName()

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

set the layer name

Parameters
LayerIDthe layer identifier
namethe new name

◆ setLayerVisibility()

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

set the layer visibility

Parameters
Visiblethe visibility

◆ setSceneUnits()

bool coat.Scene.setSceneUnits (   units = str)

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: