ObjExport

Description

Exports the selection to a .obj file.

Scripting Syntax

ObjExport( FileName, FilePerObject, FilePerFrame, StartFrame, EndFrame, StepFrame, Polymsh, Surfmsh, Crvlist, Cloud, CoordinateSystem, Tesselation, Material, UV, UserNormal );

Parameters

Parameter Type Description
FileName String Name of the output .obj file
FilePerObject Integer Merge obj file per Object or Separate them ( 0 is Merge, 1 is Separate )
FilePerFrame Boolean 1 obj file per frame ( True or False )
StartFrame Integer Value for the Start Frame
EndFrame Integer Value for the End Frame
StepFrame Integer Value for the Step Frame
Polymsh Boolean Proceed with Polygon Mesh Object
Surfmsh Boolean Proceed with Surface Mesh Object
Crvlist Boolean Proceed with Curves Object
Cloud Boolean Proceed with Cloud Object
CoordinateSystem Integer Select type of hierarchy to be import( none / Null as Parent / Model as Parent
Tesselation Boolean Proceed with Tesselation
Material Boolean Export Materials
UV Boolean Export UVs
UserNormal Boolean Export UserNormals

Examples

VBScript Example

' Set up the scene

NewScene , false

set obj1 = ActiveSceneRoot.AddGeometry( "Sphere", "MeshSurface" )

Selection.Add obj1

set obj2 = ActiveSceneRoot.AddGeometry( "Torus", "MeshSurface" )

Selection.Add obj2

' Export to an OBJ file

sFilePath = InstallationPath( siProjectPath ) & "\foo.obj"

ObjExport sFilePath, 0, False, 1, 100, 1, True, False, False, False, 0, False, False, False, True

DeleteAll false

' Import from the OBJ file

set rtn = ObjImport( sFilePath, 1, 0, True, True )

for each thing in rtn

	logmessage thing.fullname & " (" & typename(thing) & ")"

next

'INFO : sphere,torus

'VERBOSE : Wavefront OBJ Export: <project_path>\foo.obj

'INFO : sphere (X3DObject)

'INFO : torus (X3DObject)