maxon.GridAccessorCreationInterface¶
Description¶
Helper class to create the templated interface maxon.GridAccessorInterface.
Warning
maxon.GridAccessorRef.Methods Signature¶
|
Retrieve the active state of a voxel at a voxel index. |
|
Retrieve the sub voxel index position of the volume at the given world position. |
|
_GetValue(coords) Retrieve the value of the volume at the given world position. |
|
Initialize the accessor with a volume object in a read only state. |
|
Initialize the accessor with a volume object with both read and write access. |
|
Sets the active state of a voxel at a voxel index. |
|
Changes the sampler Type. |
|
_SetValue(coords, val) Sets a voxel value at a voxel index. |
|
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.VOLUMESAMPLERthat 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
-
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
volume (
maxon.VolumeRef) – The volume object to initialize this accessor for.sampler (
maxon.VOLUMESAMPLER) – The used sampler for position sampling
-
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
volume (
maxon.VolumeRef) – The volume object to initialize this accessor for.sampler (
maxon.VOLUMESAMPLER) – The used sampler for position sampling
-
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.