SceneConverter
typedef struct st_LWSceneConverter {
const char *filename;
LWError readFailure;
const char *tmpScene;
void (*deleteTmp) (const char *tmpScene);
} LWSceneConverter;
This class is used in import foreign scene formats.
When the user selects a file to load as a scene, LightWave first attempts
to load it directly as an LWSC format file. If it cannot, it will pass
the filename to each scene converter in sequence. The scene converter
will attempt to read the file and rewrite it as an LWSC file. After
successful translation the server will pass the name of the new scene
back to LightWave. The file will be loaded and the server will be called
back again to delete the translated scene file.
- filename
- Filename of foreign scene file. This is set by the host before activating
the server. This is the file to try to parse.
- readFailure
- If the server can recognize the format but cannot parse the file for some
reason, it should set this error return value.
- tmpScene
- If the server sucessfully parses the foreign scene file, it should write a
translation of that scene as a LWSC format file and return the name of this
translation scene in this field.
- deleteTmp
- After reading the temporary scene file set above, the host will call back
this delete function to dispose of the file and any other temporary state.
The `tmpScene' and `deleteTmp' fields should be set as a pair before the
server returns.
When the server is called, only `filename' will be set. It then must set
the other three fields to one of the following configurations:
- readFailure and tmpScene both null
- This indicates that the server was unable to recognize the file format
and no translation was done. LightWave will simply try the next translator.
- readFailure set, tmpScene null
- This indicates that the file format was recognized, but that a failure
of some kind occured during translation. LightWave will display this
error and will stop attempting to translate the file.
- readFailure null, tmpScene set
- This indicates successful translation. LightWave will read `tmpScene'
as an LWSC file and then will call the `deleteTmp' function to dispose of
it. Note that if tmpScene is set, deleteTmp must be set as well.
|