c4d.RangeData

class c4d.RangeData

Range data type (CUSTOMDATATYPE_RANGE) for RangeCustomGui.

New in version R19.

Methods Signatures

RangeData.__init__(self, v)

Creates a c4d.RangeData.

RangeData.Init(self, rangeNumber)

Initializes the range data with the passed range number.

RangeData.Reset(self[, invalidateObject])

Resets the range data to the initial state.

RangeData.CopyTo(self, dest)

Copies the range data.

RangeData.AddValue(self, value)

Adds a value and splits existing range.

RangeData.GetCurrentValue(self)

Retrieves the current value.

RangeData.SetCurrentValue(self, value)

Sets the current value.

RangeData.GetRangesCount(self)

Retrieves the number of ranges.

RangeData.GetKnotsCount(self)

Retrieves the numbers of knots.

RangeData.SetKnotValue(self, knotIndex, value)

Sets the value for a knot.

RangeData.GetKnotValue(self, knotIndex)

Retrieves the value for a knot.

RangeData.GetKnotIndexByValue(self, value)

Searches for a knot with the specified value.

RangeData.DeleteKnot(self, knotIndex)

Deletes a knot.

RangeData.GetRange(self, index)

Retrieves the range at the specified index.

RangeData.GetRangeIndex(self, value)

Returns the range index for the specified value.

RangeData.GetSelectedRange(self)

Retrieves the selected range.

RangeData.GetSelectedKnot(self)

Retrieves the selected knot.

RangeData.SetSelectedKnot(self, knotIndex)

Sets the selected knot.

RangeData.SetSelectedRange(self, rangeIndex)

Sets the selected range.

RangeData.IsPerRangeColorMode(self)

Checks if the color mode is stored per range, or just as single color.

RangeData.SetColorMode(self, perRange)

Sets the mode indicating if the color need to be stored per range, or just as single color.

RangeData.GetRangeColor(self, index)

Retrieves the range color for the specified range index.

RangeData.SetRangeColor(self, index, color)

Sets the range color at the specified range index.

RangeData.IsRandomColorMode(self)

Checks if the colors are randomized or user defined.

RangeData.SetRandomColorMode(self, random)

Sets the random color mode.

Inheritance

Parent Class:

Methods Documentation

RangeData.__init__(self, v)

Creates a c4d.RangeData.

Parameters

v (c4d.RangeData) – An optional c4d.RangeData to copy.

Return type

c4d.RangeData

Returns

The new RangeData.

RangeData.Init(self, rangeNumber)

Initializes the range data with the passed range number.

Note

The interval in between ranges will be the same.

Parameters

rangeNumber (int) – The number of ranges.

RangeData.Reset(self, invalidateObject=False)

Resets the range data to the initial state.

Parameters

invalidateObject (bool) – True to initialize the ranges after reset operation, otherwise the object will be initialized but functions with one single range.

RangeData.CopyTo(self, dest)

Copies the range data.

Parameters

dest (c4d.RangeData) – The destination range data.

RangeData.AddValue(self, value)

Adds a value and splits existing range.

Parameters

value (float) – The value to add.

Return type

bool

Returns

True if successful, otherwise False.

RangeData.GetCurrentValue(self)

Retrieves the current value.

Return type

float

Returns

the current value.

RangeData.SetCurrentValue(self, value)

Sets the current value.

Parameters

value (float) – The value, must be in the range [0.0, 1.0].

RangeData.GetRangesCount(self)

Retrieves the number of ranges.

Return type

int

Returns

The ranges count.

RangeData.GetKnotsCount(self)

Retrieves the numbers of knots.

Return type

int

Returns

The knots count.

RangeData.SetKnotValue(self, knotIndex, value)

Sets the value for a knot.

Parameters
  • knotIndex (int) – The knot index to set the value.

  • value (float) – The value to set.

Return type

bool

Returns

True if successful, otherwise False.

RangeData.GetKnotValue(self, knotIndex)

Retrieves the value for a knot.

Parameters

knotIndex (int) – The knot index to get the value.

Return type

float

Returns

The knot value.

RangeData.GetKnotIndexByValue(self, value)

Searches for a knot with the specified value.

Parameters

value (float) – The value used to search for.

Return type

int

Returns

The knot index, or NOTOK/-1 if not found.

RangeData.DeleteKnot(self, knotIndex)

Deletes a knot.

Parameters

knotIndex (int) – The index of the knot to delete.

RangeData.GetRange(self, index)

Retrieves the range at the specified index.

Parameters

index (int) – The range index.

Return type

tuple(float, float)

Returns

The range minimum and maximum values. (0, 0) if the function failed.

RangeData.GetRangeIndex(self, value)

Returns the range index for the specified value.

Parameters

value (float) – The value, must be in the range [0.0, 1.0].

Return type

int

Returns

The range index. 0 if the function failed

RangeData.GetSelectedRange(self)

Retrieves the selected range.

Return type

int

Returns

The selected range index, or NOTOK/-1 if not found.

RangeData.GetSelectedKnot(self)

Retrieves the selected knot.

Return type

int

Returns

The selected knot index, or NOTOK/-1 if not found.

RangeData.SetSelectedKnot(self, knotIndex)

Sets the selected knot.

Parameters

knotIndex (int) – The index to select, or NOTOK/-1 to deselect all.

RangeData.SetSelectedRange(self, rangeIndex)

Sets the selected range.

Parameters

rangeIndex (int) – The range index to select, or NOTOK/-1 to deselect all.

RangeData.IsPerRangeColorMode(self)

Checks if the color mode is stored per range, or just as single color.

Return type

bool

Returns

True if the color is stored is stored per range, otherwise False.

RangeData.SetColorMode(self, perRange)

Sets the mode indicating if the color need to be stored per range, or just as single color.

Parameters

perRange (bool) – True to store the color per range, False to store it just as single color.

RangeData.GetRangeColor(self, index)

Retrieves the range color for the specified range index.

Parameters

index (int) – The index of the range to get the color.

Return type

c4d.Vector

Returns

The range color, or a default c4d.Vector() if the function failed.

RangeData.SetRangeColor(self, index, color)

Sets the range color at the specified range index.

Note

If IsPerRangeColorMode() returns False, the range index is not evaluated and the color is stored at the first index.

Parameters
  • index (int) – The index of the range to set the color.

  • color (c4d.Vector) – The color to be assigned to the range.

RangeData.IsRandomColorMode(self)

Checks if the colors are randomized or user defined.

Return type

bool

Returns

True if the colors are randomized, otherwise False.

RangeData.SetRandomColorMode(self, random)

Sets the random color mode.

Parameters

random (bool) – True to randomize colors, otherwise False.