maxon.GridAccessorCreationInterface

Description

Helper class to create the templated interface maxon.GridAccessorInterface.

Warning

This function is only there to expose a C++ Object to Python.
As a Python developer you normally don’t have to use this class directly.
Instead create a Reference and use maxon.GridAccessorRef.

Inheritance diagram

Inheritance

Child Class:

Methods Signature

GetActiveState(coords)

Retrieve the active state of a voxel at a voxel index.

GetCoords(position)

Retrieve the sub voxel index position of the volume at the given world position.

GetValue(coords)

_GetValue(coords) Retrieve the value of the volume at the given world position.

Init(volume[, sampler])

Initialize the accessor with a volume object in a read only state.

InitWithWriteAccess(volume[, sampler])

Initialize the accessor with a volume object with both read and write access.

SetActiveState(coords, state)

Sets the active state of a voxel at a voxel index.

SetSampler(sampler)

Changes the sampler Type.

SetValue(coords, val)

_SetValue(coords, val) Sets a voxel value at a voxel index.

SetValueOnly(coords, val)

Sets a voxel value at a voxel index.

Methods Definition

GridAccessorCreationInterface.GetActiveState(coords)

Retrieve the active state of a voxel at a voxel index.

Parameters

coords (maxon.Vector) – The voxel index at which the active state will be checked.

Returns

The active state of the voxel at that voxel index.

Return type

bool

GridAccessorCreationInterface.GetCoords(position)

Retrieve the sub voxel index position of the volume at the given world position.

Note

This value depends on the maxon.VOLUMESAMPLER that was set.

Parameters

position (Union[maxon.Vector, c4d.Vector]) – The world position at which the sub voxel index position should be retrieved.

Returns

The sub voxel index position at the passed position.

Return type

maxon.Vector

GridAccessorCreationInterface.GetValue(coords)

_GetValue(coords) Retrieve the value of the volume at the given world position.

Note

This value depends on the VOLUMESAMPLER that was set.

Parameters

coords (Union[maxon.Vector, c4d.Vector]) – The world position at which the data should be retrieved.

Returns

The voxel value at the world position.

Return type

Any

GridAccessorCreationInterface.Init(volume, sampler=maxon.VOLUMESAMPLER.NEAREST)

Initialize the accessor with a volume object in a read only state.

Parameters
GridAccessorCreationInterface.InitWithWriteAccess(volume, sampler=maxon.VOLUMESAMPLER.NEAREST)

Initialize the accessor with a volume object with both read and write access.

New in version R21.

Parameters
GridAccessorCreationInterface.SetActiveState(coords, state)

Sets the active state of a voxel at a voxel index.

Parameters
  • coords (maxon.Vector) – The voxel index at which the active state will be set.

  • state (bool) – The state to set, true means active, false inactive.

GridAccessorCreationInterface.SetSampler(sampler)

Changes the sampler Type.

Parameters

sampler (maxon.VOLUMESAMPLER) – The used sampler for position sampling.

GridAccessorCreationInterface.SetValue(coords, val)

_SetValue(coords, val) Sets a voxel value at a voxel index.

Note

This will activate a voxel

Parameters
  • coords (maxon.Vector) – The voxel index at which the value will be set.

  • val (Any) – The value to set.

GridAccessorCreationInterface.SetValueOnly(coords, val)

Sets a voxel value at a voxel index.

Note

Same as maxon.GridAccessorCreationInterface._SetValue(), but this will not activate a voxel

Parameters
  • coords (maxon.Vector) – The voxel index at which the value will be set.

  • val (Any) – The value to set.