c4d.RangeData

New in version R19.

Range data type (CUSTOMDATATYPE_RANGE) for RangeCustomGui.

Inheritance

Members

RangeData.__init__(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(rangeNumber)

Initializes the range data with the passed range number. The interval in between ranges will be the same.

Parameters:rangeNumber (int) – The number of ranges.
RangeData.Reset(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(dest)

Copies the range data.

Parameters:dest (c4d.RangeData) – The destination range data.
RangeData.AddValue(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()

Retrieves the current value.

Return type:float
Returns:the current value.
RangeData.SetCurrentValue(value)

Sets the current value.

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

Retrieves the number of ranges.

Return type:int
Returns:The ranges count.
RangeData.GetKnotsCount()

Retrieves the numbers of knots.

Return type:int
Returns:The knots count.
RangeData.SetKnotValue(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(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(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(knotIndex)

Deletes a knot.

Parameters:knotIndex (int) – The index of the knot to delete.
RangeData.GetRange(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(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()

Retrieves the selected range.

Return type:int
Returns:The selected range index, or NOTOK/-1 if not found.
RangeData.GetSelectedKnot()

Retrieves the selected knot.

Return type:int
Returns:The selected knot index, or NOTOK/-1 if not found.
RangeData.SetSelectedKnot(knotIndex)

Sets the selected knot.

Parameters:knotIndex (int) – The index to select, or NOTOK/-1 to deselect all.
RangeData.SetSelectedRange(rangeIndex)

Sets the selected range.

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

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(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(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(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()

Checks if the colors are randomized or user defined.

Return type:bool
Returns:True if the colors are randomized, otherwise False.
RangeData.SetRandomColorMode(random)

Sets the random color mode.

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