maxon.frameworks.volume.GridAccessorCreationInterface¶
Description¶
Helper class to create the templated interface maxon.GridAccessorInterface.
Warning
maxon.frameworks.volume.GridAccessorRef.Inheritance diagram¶
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) |
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) |
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.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: maxon.Vector
-
GridAccessorCreationInterface.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.frameworks.volume.VolumeRef) – The volume object to initialize this accessor for. - sampler (
maxon.VOLUMESAMPLER) – The used sampler for position sampling
- volume (
-
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.frameworks.volume.VolumeRef) – The volume object to initialize this accessor for. - sampler (
maxon.VOLUMESAMPLER) – The used sampler for position sampling
- volume (
-
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.
- coords (
-
GridAccessorCreationInterface.SetSampler(sampler)¶ Changes the sampler Type.
Parameters: sampler ( maxon.VOLUMESAMPLER) – The used sampler for position sampling.
-
GridAccessorCreationInterface.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.
- coords (
-
GridAccessorCreationInterface.SetValueOnly(coords, val)¶ Sets a voxel value at a voxel index.
Note
Same as
maxon.frameworks.volume.GridAccessorCreationInterface.SetValue(), but this will not activate a voxelParameters: - coords (
maxon.Vector) – The voxel index at which the value will be set. - val (Any) – The value to set.
- coords (