maxon.VolumeInterface¶
Description¶
maxon.VolumeInterface
represents a core volume object in cinema.
Methods Signature¶
|
Creates a new volume from a .vdb file. |
Retrieve the active voxel count. |
|
Retrieve the active voxel dimensions. |
|
Retrieve the background value of the grid. |
|
Retrieve the grid class of this grid. |
|
Retrieve the grid name for this grid. |
|
Retrieve the grid transform for this grid. |
|
Retrieve the datatype of this grid. |
|
Returns the amount of memory in bytes used by this volume. |
|
|
Returns the Min and Max values of the volume.
|
Retrieve the bounding box of all active voxels of this grid. |
|
|
Retrieve if a grid is attached to this volume. |
|
Loads a grid from .vdb file into this volume object. |
|
Set the grid class for this grid. |
|
Set the grid name for this grid. |
|
Set the grid transform for this grid. |
|
Writes the attached grid to a .vdb file. |
Methods Definition¶
-
static
VolumeInterface.
CreateFromFile
(url, scale, gridIndex)¶ Creates a new volume from a .vdb file.
- Parameters
url (
maxon.Url
) – The url of the file.scale (float) – The scale to load the volume with.
gridIndex (int) – The index of the grid in the file.
- Returns
The created volume.
- Return type
-
VolumeInterface.
GetActiveVoxelCount
()¶ Retrieve the active voxel count.
- Returns
The amount of active voxels in this volume.
- Return type
int
-
VolumeInterface.
GetActiveVoxelDim
()¶ Retrieve the active voxel dimensions.
- Returns
The active voxel dimensions of this volume.
- Return type
-
VolumeInterface.
GetBackground
()¶ Retrieve the background value of the grid.
- Returns
The background value of the grid.
- Return type
-
VolumeInterface.
GetGridClass
()¶ Retrieve the grid class of this grid.
- Returns
The GRIDCLASS of this volume.
- Return type
-
VolumeInterface.
GetGridName
()¶ Retrieve the grid name for this grid.
- Returns
The name of this volume.
- Return type
str
-
VolumeInterface.
GetGridTransform
()¶ Retrieve the grid transform for this grid.
- Returns
The transformation matrix of this volume.
- Return type
-
VolumeInterface.
GetGridType
()¶ Retrieve the datatype of this grid.
- Returns
The GRIDTYPE of this volume.
- Return type
-
VolumeInterface.
GetMemUsage
()¶ Returns the amount of memory in bytes used by this volume.
- Returns
The memory usage in bytes.
- Return type
int
-
VolumeInterface.
GetMinMaxValues
(includeBackground=False)¶ - Returns the Min and Max values of the volume.If it is the first time being called the resulting values are being cached.Only works for numerical gridtypes.If the volume is a vector volume, the magnitude of the vectors will be used.
- Parameters
includeBackground (bool) – If true the volume background will be part of the
maxon.Range
, otherwise not.- Returns
The Minimum and Maximum Value of this volume.
- Returns
maxon.Range
(maxon.Float
)
-
VolumeInterface.
GetWorldBoundingBox
()¶ Retrieve the bounding box of all active voxels of this grid.
- Returns
The bounding box of the active voxels of this volume.
- Return type
maxon.Range
(maxon.Vector
)
-
VolumeInterface.
HasGrid
()¶ Retrieve if a grid is attached to this volume.
- Returns
True if this volume holds a grid.
- Return type
bool
-
VolumeInterface.
LoadFromFile
(url, scale, gridIndex)¶ Loads a grid from .vdb file into this volume object.
- Parameters
url (
maxon.Url
) – The url of the file.scale (float) – The scale to load the volume with.
gridIndex (int) – The index of the grid in the file.
-
VolumeInterface.
SetGridClass
(gridClass)¶ Set the grid class for this grid.
- Parameters
gridClass (
maxon.GRIDCLASS
) – The GRIDCLASS to set for this volume.
-
VolumeInterface.
SetGridName
(name)¶ Set the grid name for this grid.
- Parameters
name (str) – The name to set for this volume.
-
VolumeInterface.
SetGridTransform
(newTransform)¶ Set the grid transform for this grid.
- Parameters
newTransform (
maxon.Matrix
) – The transformation matrix to set for this volume.
-
VolumeInterface.
WriteToFile
(url, scale, metaData)¶ Writes the attached grid to a .vdb file.
- Parameters
url (
maxon.Url
) – The url of the file.scale (float) – The scale to write the volume with.
metaData (
maxon.DataDictionary
) –Optional meta data to write to the file.
These need to be stored with a string key in the data dictionary.
metaData –