Why can't I get model scenes?


#1

I want to use this code to get model scenes, but it can’t. The res is SU_ERROR_OVERWRITE_VALID, and realcount is 0, why?

size_t num_s = 0, realcount = 0;
SUModelGetNumScenes(model, &num_s);
SUSceneRef *p_scenes = new SUSceneRef[num_s];
res = SUModelGetScenes(model, num_s, p_scenes, &realcount);


#2

After you create your SUSceneRef array, you must initialize each SUSceneRef to SU_INVALID to ensure there is no junk data in the array:

SUSceneRef *p_scenes = new SUSceneRef[num_s];
for (size_t i = 0; i < num_s; ++i) {
SUSetInvalid(p_scenes[i]);
}
res = SUModelGetScenes(model, num_s, p_scenes, &realcount);

Hope that helps,
Adam


#3

This topic was automatically closed 91 days after the last reply. New replies are no longer allowed.