Regular API function

simCreateTexture / sim.createTexture

Description Creates a planar shape, that will be textured with a new, or imported texture. See also sim.getTextureId, sim.readTexture, sim.writeTexture and sim.setShapeTexture.
C/C++
synopsis
simInt simCreateTexture(const simChar* fileName,simInt options,const simFloat* planeSizes,const simFloat* scalingUV,const simFloat* xy_g,simInt fixedResolution,simInt* textureId,simInt* resolution,const simVoid* reserved)
C/C++
parameters
fileName: the filename of the texure to import, or an empty string if you wish to create a new texture.
options: bit-coded:
bit0 set (1) =do not interpolate adjacent color patches.
bit1 set (2) =apply the texture in decal-mode.
bit2 set (4) =repeat the texture along the U direction.
bit3 set (8) =repeat the texture along the V direction.
planeSizes: a pointer to 2 values: the dimensions of the planar shape that will be generated. Can be nullptr for default dimensions.
scalingUV: a pointer to 2 values: the desired scaling of the texture, along the U and V directions. Can be nullptr for default scalings.
xy_g: a pointer to 3 values: the texture x/y shift, and the texture gamma-rotation. Can be nullptr for default shift/rotation values.
fixedResolution: 0 to import the shape with its original resolution. Otherwise, specify a power of 2 value which will be the maximum texture resolution (the texture will also be applied a power of 2 resolution).
resolution: a pointer to 2 values representing the desired texture resolution when creating a new texture. The same pointer is used to return the effective resolution of the created/imported texture.
textureId: a pointer to an integer that will be used to return the new texture ID. If a same texture is already present, the old texture ID will be returned. Can be nullptr.
reserved: reserved. Set to nullptr.
C/C++
return value
-1 in case of an error, otherwise the object handle of the created planar shape.
Lua
synopsis
int shapeHandle,int textureId,int[2] resolution=sim.createTexture(string fileName,int options,float[2] planeSizes=nil,float[2] scalingUV=nil,float[2] xy_g=nil,int fixedResolution=0,int[2] resolution=nil)
Lua
parameters
Similar to the C-function counterpart
Lua
return values
Similar to the C-function counterpart
Python
synopsis
int shapeHandle,int textureId,list resolution=sim.createTexture(string fileName,int options,list planeSizes=None,list scalingUV=None,list xy_g=None,int fixedResolution=0,list resolution=None)