simAssimp Plugin API reference

Plugin for importing CAD files

simAssimp.exportMeshes
simAssimp.exportShapes
simAssimp.exportShapesDlg
simAssimp.getExportFormat
simAssimp.getImportFormat
simAssimp.importMeshes
simAssimp.importShapes
simAssimp.importShapesDlg

simAssimp.exportMeshes

Description Exports the specified mesh data.
Lua synopsis simAssimp.exportMeshes(table allVertices, table allIndices, string filename, string formatId, float scaling=1.0, int upVector=simassimp_upvect_z, int options=0)
Lua parameters
allVertices (table): A table containing tables of vertices (one table entry per mesh)
allIndices (table): A table containing tables of indices (one table entry per mesh)
filename (string): The filename including its extension
formatId (string): see simAssimp.getExportFormat
scaling (float, default: 1.0): The desired mesh scaling.
upVector (int, default: simassimp_upvect_z): The desired up-vector (see simAssimp.upVector)
options (int, default: 0): Export flags (256=silent)
Lua return values
Python synopsis simAssimp.exportMeshes(list allVertices, list allIndices, string filename, string formatId, float scaling=1.0, int upVector=simassimp_upvect_z, int options=0)

simAssimp.exportShapes

Description Exports the specified shapes. Depending on the fileformat, several files will be created (e.g. myFile.obj, myFile.mtl, myFile_2180010.png, etc.)
Lua synopsis simAssimp.exportShapes(int[] shapeHandles, string filename, string formatId, float scaling=1.0, int upVector=simassimp_upvect_z, int options=0)
Lua parameters
shapeHandles (table of int): The handles of the shapes to export
filename (string): The filename including its extension
formatId (string): see simAssimp.getExportFormat
scaling (float, default: 1.0): The desired mesh scaling.
upVector (int, default: simassimp_upvect_z): The desired up-vector (see simAssimp.upVector)
options (int, default: 0): Export flags (1=drop textures, 2=ignore colors, 4=drop normals, 8=export only visible, 256=silent, 512=coordinates relative to first shape's frame)
Lua return values
Python synopsis simAssimp.exportShapes(list shapeHandles, string filename, string formatId, float scaling=1.0, int upVector=simassimp_upvect_z, int options=0)

simAssimp.exportShapesDlg

Description Offers export parameters via dialog, before calling simAssimp.export
Lua synopsis simAssimp.exportShapesDlg(string filename, int[] shapeHandles)
Lua parameters
filename (string): The filename (including extension) of the CAD data
shapeHandles (table of int): The handles of the shapes to export
Lua return values -
Python synopsis simAssimp.exportShapesDlg(string filename, list shapeHandles)

simAssimp.getExportFormat

Description Allows to loop through supported file formats for export
Lua synopsis string formatDescription, string formatExtension, string formatId = simAssimp.getExportFormat(int index)
Lua parameters
index (int): Zero-based index
Lua return values
formatDescription (string): The description of the file format at the specified index, or an empty string
formatExtension (string): The file extension of the file format at the specified index, or an empty string
formatId (string): The file format ID at the specified index (needed when exporting), or an empty string
Python synopsis string formatDescription, string formatExtension, string formatId = simAssimp.getExportFormat(int index)

simAssimp.getImportFormat

Description Allows to loop through supported file formats for import
Lua synopsis string formatDescription, string formatExtension = simAssimp.getImportFormat(int index)
Lua parameters
index (int): Zero-based index
Lua return values
formatDescription (string): The description of the file format at the specified index, or an empty string
formatExtension (string): The file extension of the file format at the specified index, or an empty string
Python synopsis string formatDescription, string formatExtension = simAssimp.getImportFormat(int index)

simAssimp.importMeshes

Description Imports the specified files as mesh data
Lua synopsis table allVertices, table allIndices = simAssimp.importMeshes(string filenames, float scaling=0.0, int upVector=simassimp_upvect_auto, int options=0)
Lua parameters
filenames (string): The filenames (semicolon-separated), including their extensions
scaling (float, default: 0.0): The desired mesh scaling. 0.0 for automatic scaling
upVector (int, default: simassimp_upvect_auto): The desired up-vector (see simAssimp.upVector)
options (int, default: 0): Import flags (8=do not optimize meshes, 16=keep inditical vertices, 32=one mesh per file, 128=ignore up vector coded in fileformat (e.g. Collada), 256=silent)
Lua return values
allVertices (table): A table containing tables of vertices (one table entry per mesh)
allIndices (table): A table containing tables of indices (one table entry per mesh)
Python synopsis list allVertices, list allIndices = simAssimp.importMeshes(string filenames, float scaling=0.0, int upVector=simassimp_upvect_auto, int options=0)

simAssimp.importShapes

Description Imports the specified files as shapes
Lua synopsis int[] shapeHandles = simAssimp.importShapes(string filenames, int maxTextureSize=512, float scaling=0.0, int upVector=simassimp_upvect_auto, int options=0)
Lua parameters
filenames (string): The filenames (semicolon-separated), including their extensions
maxTextureSize (int, default: 512): The desired maximum texture size (textures will be scaled)
scaling (float, default: 0.0): The desired mesh scaling. 0.0 for automatic scaling
upVector (int, default: simassimp_upvect_auto): The desired up-vector (see simAssimp.upVector)
options (int, default: 0): Import flags (1=drop textures, 2=ignore colors, 4=ignore transparency, 8=do not optimize meshes, 16=keep identical vertices, 32=generate one shape per file, 64=shapes have aligned orientations, 128=ignore up vector coded in fileformat (e.g. Collada), 256=silent)
Lua return values
shapeHandles (table of int): Handles of imported shapes
Python synopsis list shapeHandles = simAssimp.importShapes(string filenames, int maxTextureSize=512, float scaling=0.0, int upVector=simassimp_upvect_auto, int options=0)

simAssimp.importShapesDlg

Description Offers import parameters via dialog, before calling simAssimp.import
Lua synopsis int[] handles = simAssimp.importShapesDlg(string filename)
Lua parameters
filename (string): The filename (including extension) of the CAD data
Lua return values
handles (table of int): The handles of the imported shapes
Python synopsis list handles = simAssimp.importShapesDlg(string filename)



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.

simAssimp.upVector

auto: The up vector is automatically picked
z: The up vector is along the file's Z-coordinate
y: The up vector is along the file's Y-coordinate