GetInstancesByIterator
If input instance is zero, the handle will point to the first relevant instance.
If all instances are past (or no relevant instances are found), the function will return 0.
Syntax
// // Strong typing definition // OwlInstance GetInstancesByIterator( OwlModel model, OwlInstance owlInstance ); // // Weak typing definition // int64_t __declspec(dllexport) __stdcall GetInstancesByIterator( int64_t model, int64_t owlInstance );
Property model
Size: 64 bit / 8 byte (value)Property owlInstance
Size: 64 bit / 8 byte (value)
Example (based on pure API calls)
Here you can find code snippits that show how the API call GetInstancesByIterator can be used.
#include "./include/engine.h" int64_t GetInstanceCnt(int64_t model) { int64_t instanceCnt = 0, myIteratedInstance = GetInstancesByIterator(model, 0); while (myIteratedInstance) { char * instanceName = nullptr, * className = nullptr; GetNameOfInstance(myIteratedInstance, &instanceName); GetNameOfClass(GetInstanceClass(myIteratedInstance), &className); // // The name of the class can be checked by placing a breakpoint after this point while debugging // myIteratedInstance = GetInstancesByIterator(model, myIteratedInstance); instanceCnt++; } return instanceCnt; } int _tmain(int argc, _TCHAR* argv[]) { int64_t model = CreateModel(); if (model) { int64_t instanceCnt = GetInstanceCnt(model); // // Add a new class // CreateInstance(GetClassByName(model, "Collection"), "CreatedInstanceToTestInstanceCnt"); assert(GetInstanceCnt(model) == instanceCnt + 1); int64_t instanceCntThroughAPI = 0; OrderedHandles(model, nullptr, nullptr, &instanceCntThroughAPI, 0, 0); assert(GetInstanceCnt(model) == instanceCntThroughAPI); CloseModel(model); } return 0; }