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

referes the roots of the scene graph More...

#include <CoreAPI.h>

Static Public Member Functions

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

Detailed Description

referes the roots of the scene graph

Member Function Documentation

◆ applyLayerBlending()

static void coat::Scene::applyLayerBlending ( int  LayerID)
static

apply layer blending

Parameters
LayerIDthe layer identifier

◆ assignLayerMask()

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

static void coat::Scene::clearScene ( bool  askUser = false)
static

clear the whole scene

Parameters
askUserset true to ask user for unsaved changes

◆ convertSceneUnits()

static bool coat::Scene::convertSceneUnits ( const char *  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()

static SceneElement coat::Scene::current ( )
static

returns the current sculpt object

Returns
current object reference

◆ curvesRoot()

static SceneElement coat::Scene::curvesRoot ( )
static

get the root of all curves

Returns
the root reference

◆ disableClippingLayer()

static void coat::Scene::disableClippingLayer ( int  LayerID)
static

disable the clipping layer

Parameters
LayerIDthe layer identifier

◆ disableLayerMask()

static void coat::Scene::disableLayerMask ( int  LayerID)
static

disable the mask for the layer

Parameters
LayerIDthe layer identifier

◆ enableLayerMask() [1/2]

static void coat::Scene::enableLayerMask ( int  LayerID)
static

enable the mask for the layer

Parameters
LayerIDthe layer identifier

◆ enableLayerMask() [2/2]

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

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

static std::vector< std::string > coat::Scene::getAvailableUnits ( )
static

Get the list of all available units.

Returns
the list of strings

◆ getCurrentLayer()

static int coat::Scene::getCurrentLayer ( )
static

get current layer identifier

Returns
the current layer identifier

◆ getLayer()

static int coat::Scene::getLayer ( const char *  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()

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

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

static const char * coat::Scene::getLayerName ( int  LayerID)
static

get the layer name

Parameters
LayerIDthe layer identifier
Returns
the layer name

◆ GetSceneScale()

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

static vec3 coat::Scene::getSceneShift ( )
static

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

Returns

◆ GetSceneUnits()

static const char * coat::Scene::GetSceneUnits ( )
static

get the name of the current scene units

Returns
the name as string

◆ importMesh()

static SceneElement coat::Scene::importMesh ( const char *  filename,
const 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()

static void coat::Scene::invalidateLayer ( int  LayerID)
static

refresh the layer appearance in scene

Parameters
LayerIDthe layer identifier

◆ invertLayerMask()

static void coat::Scene::invertLayerMask ( int  LayerID)
static

invert the layer mask (if assigned)

Parameters
LayerIDthe layer identifier

◆ isLayerMaskEnabled()

static 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

◆ maskEnabled()

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

static void coat::Scene::mergeLayerDown ( int  LayerID)
static

merge the layer down

Parameters
LayerIDthe layer identifier

◆ PaintMaterialCount()

static int coat::Scene::PaintMaterialCount ( )
static

Get the count of paint materials.

Returns
the amount

◆ PaintMaterialName()

static const char * coat::Scene::PaintMaterialName ( int  idx)
static

Get the reference to the material mane.

Parameters
idxthe index of the material
Returns
the reference

◆ PaintObjectName()

static const char * coat::Scene::PaintObjectName ( int  idx)
static

Get the reference to the object name.

Parameters
idxindex of the object
Returns
the reference

◆ PaintObjectsCount()

static int coat::Scene::PaintObjectsCount ( )
static

Get the count of paint objects in scene.

Returns
the amount

◆ PaintUVSetName()

static const char * 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()

static int coat::Scene::PaintUVSetsCount ( )
static

Get the paint UV-sets (textures) count.

Returns
the amount

◆ removeLayer()

static void coat::Scene::removeLayer ( int  LayerID)
static

remove the layer

Parameters
LayerIDthe layer identifier

◆ removeLayerMask()

static void coat::Scene::removeLayerMask ( int  LayerID)
static

remove the layer mask

Parameters
LayerIDthe layer identifier

◆ RemovePaintMaterial()

static void coat::Scene::RemovePaintMaterial ( int  idx)
static

Remove the paint material.

Parameters
idxthe index of the material

◆ RemovePaintObject()

static void coat::Scene::RemovePaintObject ( int  idx)
static

Remove the paint object.

Parameters
idxthe index of the object

◆ RemoveUVSet()

static void coat::Scene::RemoveUVSet ( int  idx)
static

Remove the UV-set (texture)

Parameters
idxthe index of the UV-set (texture)

◆ ScaleSceneUnits()

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

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

static SceneElement coat::Scene::sculptRoot ( )
static

◆ setActiveLayer()

static void coat::Scene::setActiveLayer ( int  LayerID)
static

activate the layer

Parameters
LayerIDthe layer identifier

◆ setClippingLayer()

static void coat::Scene::setClippingLayer ( int  LayerID)
static

set this layer as clipping layer

Parameters
LayerIDthe layer identifier

◆ setCurrentLayer()

static void coat::Scene::setCurrentLayer ( int  LayerID)
static

set the current layer

Parameters
LayerIDthe layer identifier

◆ setLayerBlending()

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

static void coat::Scene::setLayerColorOpacity ( int  LayerID,
float  Opacity 
)
static

set the layer opacity

Parameters
LayerIDthe layer identifier
Opacitythe color opacity

◆ setLayerDepthOpacity()

static void coat::Scene::setLayerDepthOpacity ( int  LayerID,
float  Opacity 
)
static

set the layer depth opacity

Parameters
LayerIDthe layer identifier
Opacitythe depth opacity

◆ setLayerGlossOpacity()

static void coat::Scene::setLayerGlossOpacity ( int  LayerID,
float  Opacity 
)
static

set the layer gloss/roughness opacity

Parameters
LayerIDthe layer identifier
Opacitythe gloss/roughness opacity

◆ setLayerMetalnessOpacity()

static void coat::Scene::setLayerMetalnessOpacity ( int  LayerID,
float  Opacity 
)
static

set the layer metalness opacity

Parameters
LayerIDthe layer identifier
Opacitythe metalness opacity

◆ setLayerName()

static void coat::Scene::setLayerName ( int  LayerID,
const char *  name 
)
static

set the layer name

Parameters
LayerIDthe layer identifier
namethe new name

◆ setLayerVisibility()

static void coat::Scene::setLayerVisibility ( int  LayerID,
bool  Visible 
)
static

set the layer visibility

Parameters
Visiblethe visibility

◆ setMaskForTheLayer()

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

static void coat::Scene::setSceneShift ( const vec3 shift)
static

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

Parameters
shiftthe new shift value

◆ setSceneUnits()

static bool coat::Scene::setSceneUnits ( const char *  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: