|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Member |
Is it possible to use multiple scenes that all use the same repository? I want to load some instances and geometries into the repository and then use them in multiple scenes.
The problem I am seeing is that when the first scene is destroyed it seems to unconditionally remove the objects from the repository (specifically, the geometries are removed). At that point, I cannot then reference those things correctly in the other scene. Here's the code that causes the removal: . ipMTSScene->Terminate(); . ipMTSScene = 0; This is the sequence that I follow: 1. Create scene1 2. Load objects into scene1/repository 3. Create scene2 4. Do something for a bit 5. Delete scene2 6. Objects are removed even though they are still referenced in scene1 I see from the example that multiple scenes are supported, but I don't know if I can share objects between them (I only want to load these objects once). TIA, Loz. |
||
|
| <Niko>
|
You're right.
it looks like we have a bug here. what i propose to you, is to remove from the tree, manually, all the instances/geometries you want to keep in the repository. |
||
|
|
Member |
I tried that and it *nearly* fixed the problem. When I issue the ipMTSScene->Terminate() call, *all* the geometries still disappear, even if they were never used in scene2. So I tried:
ipMTSScene->RemoveInstance(0); ipMTSScene->SetSceneRepository(NULL); ipMTSScene->Terminate(); ipMTSScene = 0; Which works with one exception. ipMTSRepository->GetActiveCount(1) goes up and up and up (once for each time I recreate scene2). What is table 1 used for and how do I get the scene to release its reference to this object before calling Terminate(). Leaving things as they are gives me a memory leak. TIA, Loz. |
|||
|
|
Member |
Thanks Niko, I will look into changing how it works.
When you mentioned flags I think this might also explain another problem I was seeing where a shadow on the same instance in two scenes was being displayed sometimes but not others. Obviously, the shared instances are affecting things that they shouldn't. Loz. |
|||
|
| Powered by Eve Community |
| Please Wait. Your request is being processed... |
|

