Regular API function
simGetShapeColor / sim.getShapeColor
Description
|
Retrieves the color of a shape. See also other rendering related functions. |
C/C++ synopsis
|
simInt simGetShapeColor(simInt shapeHandle,const simChar* colorName,simInt colorComponent,simFloat* rgbData)
|
C/C++ parameters |
shapeHandle: handle of the shape
colorName: name of a color. If a name is provided, a specific color component will be retrieved (e.g. if a shape is a compound shape. Can be nullptr. If colorName is @compound, then rgb data for every component of a compound shape will be returned (in that case make sure to have enough space in rgbData, e.g. via simGetObjectInt32Param(shapeHandle,sim.shapeintparam_component_cnt))
rgbData (output): red, green and blue components of the color (3 values), or the transparency value (1 value)
|
C/C++ return value
|
-1 if operation was not successful. 0 if the color name was not found in the shape. Otherwise, the operation was successful
|
Lua synopsis
|
int result,float[3] rgbData=sim.getShapeColor(int shapeHandle,string colorName,int colorComponent)
|
Lua parameters |
Similar to the C-function counterpart
|
Lua return values
|
Similar to the C-function counterpart
|
Python synopsis |
int result,list rgbData=sim.getShapeColor(int shapeHandle,string colorName,int colorComponent) |
|