maxon.frameworks.volume.VolumeInterface

Description

maxon.frameworks.volume.VolumeInterface represents a core volume object in cinema.

Inheritance diagram

Inheritance

Parent Class:

Child Class:

Methods Signature

CreateFromFile(url, scale, gridIndex) Creates a new volume from a .vdb file.
GetActiveVoxelCount() Retrieve the active voxel count.
GetActiveVoxelDim() Retrieve the active voxel dimensions.
GetBackground() Retrieve the background value of the grid.
GetGridClass() Retrieve the grid class of this grid.
GetGridName() Retrieve the grid name for this grid.
GetGridTransform() Retrieve the grid transform for this grid.
GetGridType() Retrieve the datatype of this grid.
GetMemUsage() Returns the amount of memory in bytes used by this volume.
GetMinMaxValues([includeBackground])
Returns the Min and Max values of the volume.
GetWorldBoundingBox() Retrieve the bounding box of all active voxels of this grid.
HasGrid() Retrieve if a grid is attached to this volume.
LoadFromFile(url, scale, gridIndex) Loads a grid from .vdb file into this volume object.
SetGridClass(gridClass) Set the grid class for this grid.
SetGridName(name) Set the grid name for this grid.
SetGridTransform(newTransform) Set the grid transform for this grid.
WriteToFile(url, scale[, metaData]) 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:

maxon.frameworks.volume.VolumeRef

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:maxon.IntVector32
VolumeInterface.GetBackground()

Retrieve the background value of the grid.

Returns:The background value of the grid.
Return type:maxon.Data
VolumeInterface.GetGridClass()

Retrieve the grid class of this grid.

Returns:The GRIDCLASS of this volume.
Return type:maxon.GRIDCLASS
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:maxon.Matrix
VolumeInterface.GetGridType()

Retrieve the datatype of this grid.

Returns:The GRIDTYPE of this volume.
Return type:maxon.GRIDTYPE
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=DataDictionary)

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