This example provides a good starting point for writing your own importer/exporter using the Softimage C++ API. The example shows how to create a user interface for a typical import/export application, export geometry using the CGeometryAccessor class, and import polygon meshes using the CMeshBuilder class.
Location | |
Files |
importexport.cpp
importexport_menu.cpp
importexport_prop.cpp
importmesh_command.cpp
exportmesh_command.cpp
helper.cpp
helper.h
GNUmakefile
ImportExport.vcproj
|
To run the example
To export geometry information and cluster properties, select a polygon mesh object and click Export. Note that you can subdivide the exported geometry if you want. The data is exported to the text file specified in the text box.
To import a file, type the name of the file in the text box in the Import group, and then click Import Polygons to import a mesh with quads, or Import Triangles to import a mesh with triangles. The chunk size allows you to optimize the memory allocation when importing large sets of polygon mesh data.
Notes
The exporter demo outputs the following information:
Softimage SDK includes a compiled version of ImportExport. If you want to modify the code, you can rebuild the example by following these instructions.
To build the example on Windows
Open an Softimage command prompt, and type devenv to start Visual Studio .NET.
Starting Visual Studio .NET from an Softimage command prompt ensures that environment variables such as XSISDK_ROOT are set (otherwise you'll get build and link errors).
Tip To load the ImportExport project from the command line, type:
devenv ImportExport.vcproj
To build the example on Linux
In a shell (tcsh) window, type:
source $XSI_HOME/.xsi_<xsi_version>
Change directories to
cppsrc
To remove all intermediate files before building the example, run this command:
gmake clean
To compile the example, run this command:
gmake
This example uses the following keywords:
C++ example, import, export, mesh, polygons, vertex, vertices, CMeshFileReader, CMeshBuilder, ProgressBar, IsCancelPressed, GetUIToolkit, GotoSection, EndSection, GetLongValues, AddPolygons, AddVertices, PolygonMesh, CErrorDescriptor, CustomProperty, AddProperty, GetParameters, AddParameter, PPGItem, PutLabelMinPixels, PutLabelPercentage, AddEnumControl, AddButton, PutAttribute, AddGroup, AddRow, EndGroup, EndRow, PPGEvent, callback, PPGEventContext,GetAttribute, Button, GetParameterValue, ExecuteCommand, Menu, MenuItem, AddCallbackItem, XSILoadPlugin, RegisterCommand, RegisterMenu, siMenuMainTopLevelID, RegisterProperty