Page 1 of 1

How to Deactivate a scene without Disposing of it using Remoting

Posted: 21 Nov 2019, 05:31
by Etienne
I've been trying to remove a scene from a port using

Code: Select all

PortStatus(portIID, portIndex.Value, null, null, null, null)
but it seems to dispose of the scene instead of simply removing it from the port. The Remoting4 Demo uses the same approach and disposes of the scene if you use the Deactivate option in the Loaded Scenes context menu.

Is it possible to simply remove the scene from the port but keep it loaded and reuse later on?

Thanks for your help with this.

Re: How to Deactivate a scene without Disposing of it using Remoting

Posted: 21 Nov 2019, 11:26
by Karol
Hi Etienne,

why do you assume that the PortStatus() call disposes the scene?
Actually it does not!
You have to call Release() to dispose the scene.

Best Regards
Karol

Re: How to Deactivate a scene without Disposing of it using Remoting

Posted: 21 Nov 2019, 17:35
by Etienne
In general you are correct, the deactivated scene just returns to Validated state, but if you have a scene loaded in a scene layer's port and deactivate it, it gets disposed (or at least that's what the SceneStatus code says). If you ignore the code and try to reactivate the disposed scene, you get an activation error.

You should be able to replicate this by creating a scene with two scene layers. Save the "layout" scene with scenes in each layer. Deactivate one of the scenes and you will see that it will show as "Disposed" (in the Remoting4 Demo).

Thanks a lot for that demo project BTW, it's been very useful.