3DCoat Python API
The 3DCoat Python API documentation.
|
Public Member Functions | |
__init__ (self) | |
__init__ (self, tb=Any) | |
__init__ (self, vo=Any) | |
__init__ (self, vol=Volume) | |
bool | valid (self) |
checks if object is valid | |
bool | isSurface (self) |
Check if in surface mode. | |
bool | isVoxelized (self) |
Check if in voxel mode. | |
toSurface (self) | |
turn to surface mode, the triangles will be tangentially relaxed | |
toVoxels (self) | |
turn to voxels, auto-voxelize | |
enableVoxelsColoring (enable=bool) | |
enable or disable the voxel-based coloring. | |
color (CL=int) | |
set the default color to fill voxels if the voxel coloring enabled | |
color (r=float, g=float, b=float, a=float) | |
assign the color for the voxel operations | |
color (r=float, g=float, b=float) | |
assign the color for the voxel operations | |
color (colorid=str) | |
assign the color for the voxel operations | |
gloss (value=float) | |
assign the gloss for the voxel operations, it will work only if the color already assigned | |
roughness (value=float) | |
assign the roughness for the voxel operations, it will work only if the color already assigned | |
metal (value=float) | |
the metalliclty value for the voxel operations, it will work only if the color already assigned | |
mergeMesh (self, mesh=Mesh, transform=mat4, op=BoolOpType) | |
merge the mesh into scene | |
insertMesh (self, mesh=Mesh, transform=mat4) | |
insert the mesh into the volume, in case of voxels this is identical to addMesh, in case of surface, mesh will be inserted without booleans | |
addMesh (self, mesh=Mesh, transform=mat4) | |
add the mesh to volume (boolean) | |
subtractMesh (self, mesh=Mesh, transform=mat4) | |
subtract the mesh from volume (boolean) | |
intersectWithMesh (self, mesh=Mesh, transform=mat4) | |
intersect the volume with the mesh (boolean) | |
mergeMeshWithTexture (self, mesh=Mesh, transform=mat4, op=BoolOpType) | |
merge the mesh with facture, the volume polygons will be hidden, just the texture will be shown (like leafs in TreesGenerator) | |
float | getExactDencity (self, x=int, y=int, z=int, fromBackup=bool, cache_ref=Any) |
returns the exact voxel density in local space at the exact integer location | |
float | getInterpolatedValue (self, pos=vec3, fromBackup=bool) |
returns interolated voxels density | |
int | getPolycount (self) |
get the volume triangles count | |
float | getVolume (self) |
get the volume of this object in world coordinates | |
float | getSquare (self) |
reg the square of this object in world coordinates | |
boundbox | calcLocalScaceAABB (self) |
Calculate the Axis - Aligned Bound Box of the object in local space. | |
boundbox | calcWorldSpaceAABB (self) |
Calculate the Axis - Aligned Bound Box of the object in world space. | |
Any | tree (self) |
returns the low-level object (VoxTreeBranch) for all low-level operations | |
Any | vo (self) |
returns the low-level object (VolumeObject) for all low-level operations | |
Any | cell (self, cx=int, cy=int, cz=int, create=bool, backup=bool) |
get the cell by cell coordinates, each cell is 8 #8 #8 | |
Any | attributes (self, cx=int, cy=int, cz=int, create=bool, backup=bool) |
get the cell attributes by cell coordinates, each cell is 8 #8 #8, generally it is kept as VolumeCell::Attr | |
dirty (self, cx=int, cy=int, cz=int) | |
mark the cell as dirty. | |
setOpacity (self, Opacity=float) | |
set the volume opacity | |
relaxGpu (self, center=vec3, Radius=float, degree=float) | |
fast voxel-based relax within the sphere with the gradual falloff. | |
relaxVoxels (self, count=int) | |
relax the whole volume, works only for voxels | |
relaxSurface (self, degree=float, tangent=bool, keep_sharp_boolean_edges=bool) | |
relax the object in surface mode | |
relaxOpenEdges (self, nTimes=int) | |
relax the open edges of the mesh, it is applicable only to the surface mode | |
SceneElement | inScene (self) |
Get the Volume placement in the scene. | |
clear (self) | |
Clear and pass to the Undo queue. | |
clearNoUndo (self) | |
Clear quickly, without affecting the Undo queue. | |
assignShader (self, shaderName=str) | |
set the shader for the Volume | |
setBoolShaderProperty (self, property=str, value=bool) | |
set the shader for the Volume | |
setFloatShaderProperty (self, property=str, value=float) | |
set the shader for the Volume | |
setColorShaderProperty (self, property=str, value=int) | |
set the shader for the Volume | |
closeHoles (self, maxSize=int) | |
Close the holes. | |
bool | checkIfMoldingLicenseAvailable () |
check if molding allowed | |
setMoldingParams (direction=vec3, tapering_angle=float, undercuts_density=float, decimation_limit_millions=float, perform_subtraction=bool) | |
set the parameters for the molding | |
removeUndercuts (self) | |
remove undercuts for the current volume | |
basRelief (self, start_point=vec3) | |
perform the bas-relief for the current volume | |
setAutomaticMoldingBox () | |
set the molding bound box to be automatic | |
setMoldingBox (width=float, length=float, thickness=float) | |
set the molding bound box to be user-defined, not automatic | |
setMoldingBorder (width=float) | |
set the molding border around the parting line to fade to the plane, if it is zero, the final shape will not fade to plane | |
generateMoldingCurves (self) | |
generate the automatic molding curves | |
automaticMolding (self) | |
perform the automatic molding | |
curveBasedMolding (self) | |
perform the curve-based mold | |
subtractWithoutUndecuts (self) | |
subtract the current undercutted object from the preliminary generated molding shapes | |
SceneElement | generateMoldingTest (self) |
generate the figure that fills the gap between the molding shapes | |
SceneElement | findMoldingTop (self) |
find the top molding shape (that was previously generated) | |
SceneElement | findMoldingBottom (self) |
find the bottom molding shape (that was previously generated) | |
SceneElement | findMoldingTest (self) |
find the test molding test shape (that was previously generated) | |
removeMoldingShapes (self) | |
remove all molding intermediate shapes, tests, etc. | |
assignLiveBooleans (self, operation=int) | |
Apply the live booleans over the sculpt mesh, it is available for voxels only. | |
collapseBollTree (self) | |
collapse the boolean tree, it is available for this volume | |
coat.Volume.__init__ | ( | self | ) |
coat.Volume.__init__ | ( | self, | |
tb = Any |
|||
) |
coat.Volume.__init__ | ( | self, | |
vo = Any |
|||
) |
coat.Volume.__init__ | ( | self, | |
vol = Volume |
|||
) |
add the mesh to volume (boolean)
mesh | the mesh reference |
transform | the transform applied |
coat.Volume.assignLiveBooleans | ( | self, | |
operation = int |
|||
) |
Apply the live booleans over the sculpt mesh, it is available for voxels only.
operation | 0 - stop live booleans, 1 - subtract from the parent, 2 - intersect, 3 - union |
coat.Volume.assignShader | ( | self, | |
shaderName = str |
|||
) |
set the shader for the Volume
shaderName | the shader name as it is shown in the shader's hint |
Any coat.Volume.attributes | ( | self, | |
cx = int , |
|||
cy = int , |
|||
cz = int , |
|||
create = bool , |
|||
backup = bool |
|||
) |
get the cell attributes by cell coordinates, each cell is 8 #8 #8, generally it is kept as VolumeCell::Attr
cx | cell x |
cy | cell y |
cz | cell z |
create | pass true if you want to create the cell if it does not exist |
backup | drop the cell to backup (if not already dropped) |
coat.Volume.automaticMolding | ( | self | ) |
perform the automatic molding
coat.Volume.basRelief | ( | self, | |
start_point = vec3 |
|||
) |
perform the bas-relief for the current volume
start_point | the cut point |
boundbox coat.Volume.calcLocalScaceAABB | ( | self | ) |
Calculate the Axis - Aligned Bound Box of the object in local space.
boundbox coat.Volume.calcWorldSpaceAABB | ( | self | ) |
Calculate the Axis - Aligned Bound Box of the object in world space.
Any coat.Volume.cell | ( | self, | |
cx = int , |
|||
cy = int , |
|||
cz = int , |
|||
create = bool , |
|||
backup = bool |
|||
) |
get the cell by cell coordinates, each cell is 8 #8 #8
cx | cell x |
cy | cell y |
cz | cell z |
create | pass true if you want to create the cell if it does not exist |
backup | drop the cell to backup (if not already dropped) |
bool coat.Volume.checkIfMoldingLicenseAvailable | ( | ) |
check if molding allowed
coat.Volume.clear | ( | self | ) |
Clear and pass to the Undo queue.
coat.Volume.clearNoUndo | ( | self | ) |
Clear quickly, without affecting the Undo queue.
coat.Volume.closeHoles | ( | self, | |
maxSize = int |
|||
) |
Close the holes.
maxSize | max hole size (edges over the primeter) |
coat.Volume.collapseBollTree | ( | self | ) |
collapse the boolean tree, it is available for this volume
coat.Volume.color | ( | CL = int | ) |
set the default color to fill voxels if the voxel coloring enabled
coat.Volume.color | ( | colorid = str | ) |
assign the color for the voxel operations
colorid | the color in any suitable form: "RGB", "ARGB", "RRGGBB", "AARRGGBB", "#RGB", "#ARGB", "#RRGGBB", "#AARRGGBB", any web-color common name as "red", "green", "purple", google "webcolors" |
coat.Volume.color | ( | r = float , |
|
g = float , |
|||
b = float |
|||
) |
assign the color for the voxel operations
r | red value 0..255 |
g | green value 0..255 |
b | blue value 0..255 |
coat.Volume.color | ( | r = float , |
|
g = float , |
|||
b = float , |
|||
a = float |
|||
) |
assign the color for the voxel operations
r | red value 0..255 |
g | green value 0..255 |
b | blue value 0..255 |
a | alpha value 0..255 |
coat.Volume.curveBasedMolding | ( | self | ) |
perform the curve-based mold
coat.Volume.dirty | ( | self, | |
cx = int , |
|||
cy = int , |
|||
cz = int |
|||
) |
mark the cell as dirty.
This is required if you
cx | |
cy | |
cz |
coat.Volume.enableVoxelsColoring | ( | enable = bool | ) |
enable or disable the voxel-based coloring.
It is applied wherever possible - merging models, brushing, creating parametric voxel figures, etc
enable | true to enable |
SceneElement coat.Volume.findMoldingBottom | ( | self | ) |
find the bottom molding shape (that was previously generated)
SceneElement coat.Volume.findMoldingTest | ( | self | ) |
find the test molding test shape (that was previously generated)
SceneElement coat.Volume.findMoldingTop | ( | self | ) |
find the top molding shape (that was previously generated)
coat.Volume.generateMoldingCurves | ( | self | ) |
generate the automatic molding curves
SceneElement coat.Volume.generateMoldingTest | ( | self | ) |
generate the figure that fills the gap between the molding shapes
float coat.Volume.getExactDencity | ( | self, | |
x = int , |
|||
y = int , |
|||
z = int , |
|||
fromBackup = bool , |
|||
cache_ref = Any |
|||
) |
returns the exact voxel density in local space at the exact integer location
x | X-coordinate |
y | Y-coordinate (up) |
z | Z-coordinate |
fromBackup | take the values from the backup (kept before the modifications started) |
cache_ref | define the variable coat::VolumeCache and pass there (in same thread) to speed up access; |
float coat.Volume.getInterpolatedValue | ( | self, | |
pos = vec3 , |
|||
fromBackup = bool |
|||
) |
returns interolated voxels density
pos | position in local space |
fromBackup | take from the backup |
int coat.Volume.getPolycount | ( | self | ) |
get the volume triangles count
float coat.Volume.getSquare | ( | self | ) |
reg the square of this object in world coordinates
float coat.Volume.getVolume | ( | self | ) |
get the volume of this object in world coordinates
coat.Volume.gloss | ( | value = float | ) |
assign the gloss for the voxel operations, it will work only if the color already assigned
value | the [0..1] value of the gloss |
SceneElement coat.Volume.inScene | ( | self | ) |
Get the Volume placement in the scene.
insert the mesh into the volume, in case of voxels this is identical to addMesh, in case of surface, mesh will be inserted without booleans
mesh | the mesh reference |
transform | the transform applied |
intersect the volume with the mesh (boolean)
mesh | the mesh reference |
transform | the transform applied |
bool coat.Volume.isSurface | ( | self | ) |
Check if in surface mode.
bool coat.Volume.isVoxelized | ( | self | ) |
Check if in voxel mode.
coat.Volume.mergeMesh | ( | self, | |
mesh = Mesh , |
|||
transform = mat4 , |
|||
op = BoolOpType |
|||
) |
merge the mesh into scene
mesh | the Mesh reference |
transform | the transform applied |
op | the type of the merge |
coat.Volume.mergeMeshWithTexture | ( | self, | |
mesh = Mesh , |
|||
transform = mat4 , |
|||
op = BoolOpType |
|||
) |
merge the mesh with facture, the volume polygons will be hidden, just the texture will be shown (like leafs in TreesGenerator)
mesh | the mesh that refers texture |
transform | the transform applied |
op | the boolean operation |
coat.Volume.metal | ( | value = float | ) |
the metalliclty value for the voxel operations, it will work only if the color already assigned
value | the [0..1] metal value |
coat.Volume.relaxGpu | ( | self, | |
center = vec3 , |
|||
Radius = float , |
|||
degree = float |
|||
) |
fast voxel-based relax within the sphere with the gradual falloff.
It works only in voxel mode.
center | the center of |
Radius | the radius of the influence |
degree | the relax degree, < 1 |
coat.Volume.relaxOpenEdges | ( | self, | |
nTimes = int |
|||
) |
relax the open edges of the mesh, it is applicable only to the surface mode
nTimes | amount of iterations |
coat.Volume.relaxSurface | ( | self, | |
degree = float , |
|||
tangent = bool , |
|||
keep_sharp_boolean_edges = bool |
|||
) |
relax the object in surface mode
degree | the degree of smoothing, it may be >1 for the stronger relax |
tangent | use tangent relax |
keep_sharp_boolean_edges | keep the sharp edges appeared due to bolean operations |
coat.Volume.relaxVoxels | ( | self, | |
count = int |
|||
) |
relax the whole volume, works only for voxels
count | the count of relax steps |
coat.Volume.removeMoldingShapes | ( | self | ) |
remove all molding intermediate shapes, tests, etc.
coat.Volume.removeUndercuts | ( | self | ) |
remove undercuts for the current volume
coat.Volume.roughness | ( | value = float | ) |
assign the roughness for the voxel operations, it will work only if the color already assigned
value | the [0..1] value of the roughness |
coat.Volume.setAutomaticMoldingBox | ( | ) |
set the molding bound box to be automatic
coat.Volume.setBoolShaderProperty | ( | self, | |
property = str , |
|||
value = bool |
|||
) |
set the shader for the Volume
shaderName | the shader name as it is shown in the shader's hint |
coat.Volume.setColorShaderProperty | ( | self, | |
property = str , |
|||
value = int |
|||
) |
set the shader for the Volume
shaderName | the shader name as it is shown in the shader's hint |
coat.Volume.setFloatShaderProperty | ( | self, | |
property = str , |
|||
value = float |
|||
) |
set the shader for the Volume
shaderName | the shader name as it is shown in the shader's hint |
coat.Volume.setMoldingBorder | ( | width = float | ) |
set the molding border around the parting line to fade to the plane, if it is zero, the final shape will not fade to plane
width | the width in mm or other default units |
coat.Volume.setMoldingBox | ( | width = float , |
|
length = float , |
|||
thickness = float |
|||
) |
set the molding bound box to be user-defined, not automatic
width | the width of the box |
length | the length of the box |
thickness | the thickness of the box |
coat.Volume.setMoldingParams | ( | direction = vec3 , |
|
tapering_angle = float , |
|||
undercuts_density = float , |
|||
decimation_limit_millions = float , |
|||
perform_subtraction = bool |
|||
) |
set the parameters for the molding
direction | the molding direction |
tapering_angle | the tapering angle in degrees |
undercuts_density | the additional density for the undercuts |
decimation_limit_millions | decimate the final shape if it has triangles count more than this value |
perform_subtraction | set false if no need to subtract the molding from the molding shapes |
coat.Volume.setOpacity | ( | self, | |
Opacity = float |
|||
) |
set the volume opacity
Opacity | the 0..1 opacity value |
subtract the mesh from volume (boolean)
mesh | the mesh reference |
transform | the transform applied |
coat.Volume.subtractWithoutUndecuts | ( | self | ) |
subtract the current undercutted object from the preliminary generated molding shapes
coat.Volume.toSurface | ( | self | ) |
turn to surface mode, the triangles will be tangentially relaxed
coat.Volume.toVoxels | ( | self | ) |
turn to voxels, auto-voxelize
Any coat.Volume.tree | ( | self | ) |
returns the low-level object (VoxTreeBranch) for all low-level operations
bool coat.Volume.valid | ( | self | ) |
checks if object is valid
Any coat.Volume.vo | ( | self | ) |
returns the low-level object (VolumeObject) for all low-level operations