simGLTF Plugin API reference

Plugin for glTF format support

simGLTF.animationFrameCount
simGLTF.clear
simGLTF.exportAllObjects
simGLTF.exportAnimation
simGLTF.exportObject
simGLTF.exportObjects
simGLTF.exportSelectedObjects
simGLTF.exportShape
simGLTF.getExportTextureFormat
simGLTF.loadASCII
simGLTF.loadBinary
simGLTF.recordAnimation
simGLTF.saveASCII
simGLTF.saveBinary
simGLTF.serialize
simGLTF.setExportTextureFormat

simGLTF.animationFrameCount

Description Return count of animation frames.
Lua synopsis int count=simGLTF.animationFrameCount()
Lua parameters -
Lua return values
count (int): count of frames
Python synopsis int count=simGLTF.animationFrameCount()

simGLTF.clear

Description Clear all data stored in memory (geometry, material, animation, cache).
Lua synopsis simGLTF.clear()
Lua parameters -
Lua return values -
Python synopsis simGLTF.clear()

simGLTF.exportAllObjects

Description Export all objects to glTF model.
Lua synopsis simGLTF.exportAllObjects()
Lua parameters -
Lua return values -
Python synopsis simGLTF.exportAllObjects()

simGLTF.exportAnimation

Description Export animation data to glTF model.
Lua synopsis simGLTF.exportAnimation()
Lua parameters -
Lua return values -
Python synopsis simGLTF.exportAnimation()

simGLTF.exportObject

Description Export object to glTF model.
Lua synopsis int nodeIndex=simGLTF.exportObject(int objectHandle)
Lua parameters
objectHandle (int): handle of the object
Lua return values
nodeIndex (int): index of the new node (may contain sub-nodes)
Python synopsis int nodeIndex=simGLTF.exportObject(int objectHandle)

simGLTF.exportObjects

Description Export objects to glTF model.
Lua synopsis simGLTF.exportObjects(int[] objectHandles)
Lua parameters
objectHandles (table of int): handles of the objects
Lua return values -
Python synopsis simGLTF.exportObjects(list objectHandles)

simGLTF.exportSelectedObjects

Description Export selected objects to glTF model.
Lua synopsis simGLTF.exportSelectedObjects()
Lua parameters -
Lua return values -
Python synopsis simGLTF.exportSelectedObjects()

simGLTF.exportShape

Description Export shape to glTF model.
Lua synopsis int nodeIndex=simGLTF.exportShape(int shapeHandle, int parentHandle=-1, int parentNodeIndex=0)
Lua parameters
shapeHandle (int): handle of the shape
parentHandle (int, default: -1): handle of the parent object. if specified the matrix of the node will be relative to this. use this in conjunction with parentNodeIndex parameter.
parentNodeIndex (int, default: 0): index of parent node
Lua return values
nodeIndex (int): index of the new node (may contain sub-nodes)
Python synopsis int nodeIndex=simGLTF.exportShape(int shapeHandle, int parentHandle=-1, int parentNodeIndex=0)

simGLTF.getExportTextureFormat

Description Set the image format (bmp, png, jpg) in which textures are exported.
Lua synopsis int textureFormat, string formatName=simGLTF.getExportTextureFormat()
Lua parameters -
Lua return values
textureFormat (int): Format of exported texture images. See simGLTF.TextureFormat.
formatName (string): Format name.
Python synopsis int textureFormat, string formatName=simGLTF.getExportTextureFormat()

simGLTF.loadASCII

Description Load an ASCII glTF model.
Lua synopsis bool result, string warnings, string errors=simGLTF.loadASCII(string filepath)
Lua parameters
filepath (string)
Lua return values
result (bool): true if success
warnings (string): warning message(s)
errors (string): error message(s)
Python synopsis bool result, string warnings, string errors=simGLTF.loadASCII(string filepath)

simGLTF.loadBinary

Description Load a binary (.glb) glTF model.
Lua synopsis bool result, string warnings, string errors=simGLTF.loadBinary(string filepath)
Lua parameters
filepath (string)
Lua return values
result (bool): true if success
warnings (string): warning message(s)
errors (string): error message(s)
Python synopsis bool result, string warnings, string errors=simGLTF.loadBinary(string filepath)

simGLTF.recordAnimation

Description Export animation data to glTF model.
Lua synopsis simGLTF.recordAnimation(bool enable)
Lua parameters
enable (bool): if true the plugin will record the pose of all objects during simulation
Lua return values -
Python synopsis simGLTF.recordAnimation(bool enable)

simGLTF.saveASCII

Description Save a glTF model to an ASCII file.
Lua synopsis bool result=simGLTF.saveASCII(string filepath)
Lua parameters
filepath (string)
Lua return values
result (bool): true if success
Python synopsis bool result=simGLTF.saveASCII(string filepath)

simGLTF.saveBinary

Description Save a glTF model to a binary file.
Lua synopsis bool result=simGLTF.saveBinary(string filepath)
Lua parameters
filepath (string)
Lua return values
result (bool): true if success
Python synopsis bool result=simGLTF.saveBinary(string filepath)

simGLTF.serialize

Description Serialize glTF model to JSON string.
Lua synopsis string json=simGLTF.serialize()
Lua parameters -
Lua return values
json (string): the JSON document
Python synopsis string json=simGLTF.serialize()

simGLTF.setExportTextureFormat

Description Set the image format (bmp, png, jpg) in which textures are exported.
Lua synopsis simGLTF.setExportTextureFormat(int textureFormat)
Lua parameters
textureFormat (int): Format of exported texture images. See simGLTF.TextureFormat.
Lua return values -
Python synopsis simGLTF.setExportTextureFormat(int textureFormat)



Constants

Constants used in the various functions. Refer to each constant using enumName.constantName, i.e. simUI.curve_type.xy for xy constant in simUI.curve_type enum.

simGLTF.TextureFormat

bmp
png
jpg