ImportModelS
The design tree will be added to the given existing model.
The return value contains the first instance not referenced by any other instance or zero
if it does not exist. In case the imported model is created with SaveInstanceTree() this instance is
unique and equal to the instance used within the call SaveInstanceTree().
Syntax
// // Strong typing definition // OwlInstance ImportModelS( OwlModel model, const void * callback ); // // Weak typing definition // int64_t __declspec(dllexport) __stdcall ImportModelS( int64_t model, const void * callback );
Property model
Size: 64 bit / 8 byte (value)Property callback
Size: 64 bit / 8 byte (reference)
Example (based on pure API calls)
Here you can find code snippits that show how the API call ImportModelS can be used.
#include "./include/engine.h" #include <assert.h> const int_t BLOCK_LENGTH_READ = 65535; // MAX: 65535 FILE * myFileRead = nullptr; int_t __stdcall ReadCallBackFunction(unsigned char * content) { if (myFileRead == nullptr || feof(myFileRead)) { return -1; } int_t size = fread(content, 1, BLOCK_LENGTH_READ, myFileRead); return size; } void ImportModelByStream(int64_t model, wchar_t * fileName) { assert(myFileRead == nullptr); _wfopen_s(&myFileRead, fileName, L"rb"); if (model && &myFileRead) { ImportModelS(model, &ReadCallBackFunction); fclose(myFileRead); } else { assert(false); } }