Closed MostHated closed 2 years ago
We put in a small fix to address this, but perhaps the fix addressed a different issue, and we didn't fully understand the bug that you brought up. Could you please attach a small project that we can open to reproduce this ?
Oh, sorry, it's not a bug I don't believe, more of a feature request. The items in the hierarchy (Section_1 - 4) are GameObjects within a subscene (each has a component on it of type SubSceneDetailsComponentAuthoring).
As it stands, queries don't seem to be able to access subscenes hierarchy to return those GameObjects, which I did not expect it to be able to, as in order to reference those objects myself now, I have to use something along the lines of this:
SubScene subScene;
...
if (!subScene.EditingScene.isLoaded) return;
var rootGameObjects = subScene.GetRootGameObjects();
for (int i = 0; i < rootGameObjects.Length; i++)
{
// Do whatever
}
I was merely wondering if it were possible to extend the reach of the queries to be able to traverse the subscene hierarchy as well.
Ah, silly me. For some reason, I thought this was related to a bug you brought up previously. Please give me some time to discuss this with the team.
I believe if the selection group scope is set to 'Editor', it will be able to reference objects across all loaded scenes.
I appreciate the reply. I will be sure to give this a try and report back.
I can't seem to win, lol. I attempted to give this a go, and this was the result.
It seems to be only this window that has the issue, and it persists regardless of restarting the editor, resetting my layout, closing all other windows, etc. See below the image for the stack. I thought maybe it was due to having a pretty large number of groups at first (it was about an entire page full, so probably 30-35?), so I removed most of them and tried again with just the few that are seen here, but it didn't make a difference.
The first Error:
[Error] GUI Window tried to begin rendering while something else had not finished rendering! Either you have a recursive OnGUI rendering, or the previous OnGUI did not clean up properly.
@MostHated Is it possible for you to give us a sample project to reproduce this ? I tried what you showed in the screenshot, but I couldn't reproduce the error.
I had been trying to remove anything excess that I had in my project just in case it had anything to do with something else in there.
I cleared out the library folder and reimported everything, I tried closing all windows and tabs except the main window, but nothing helped, it was still happening, so I will try and see if I can get something small together.
Ok, with a brand new project in which I only added some of the packages I was currently using, I was able to repro it with none of my code in the project.
I can compress it up, where should I upload it? I can just put it on my Google drive and provide a link, if that works?
Sounds great. You can use Google Drive, or you can just drag and drop it here when creating a comment.
Oh, I didn't even realize you could upload actual files here. That said, I tried and it gave me an error.
So I just uploaded it here. I deleted the library contents, as it was over 2gb even though it was a new project due to being an hdrp project (I wanted to try and simulate my setup as much as I could). It's only 30mb now.
https://drive.google.com/file/d/1kAwrg8NWCys2Tx0m4YeXOq9Y_VZ-iBVt/view?usp=sharing
Here is exactly what I did to get the error with this exact project.
I cannot replicate this using your project, however I will examine the stack trace and see if I can make a workaround.
Not the best solution, but if I make the package a local and point to it via file:/ in the manifset and then modify SelectionGroupConfigurationDialog.cs as seen below, this does resolve the issue on my end.
private static bool windowReady;
internal static void Open(ISelectionGroup @group, SelectionGroupEditorWindow parentWindow)
{
var dialog = EditorWindow.GetWindow<SelectionGroupConfigurationDialog>();
dialog.group = group;
dialog.parentWindow = parentWindow;
dialog.refreshQuery = true;
dialog.titleContent.text = $"Configure {group.Name}";
windowReady = true;
dialog.ShowPopup();
dialog.debugInformation = null;
}
private void OnEnable()
{
windowReady = false;
}
void OnGUI()
{
if (!windowReady) return;
if (group == null)
{
Close();
return;
}
// ...
}
Not the best solution, but if I make the package a local and point to it via file:/ in the manifset and then modify SelectionGroupConfigurationDialog.cs as seen below, this does resolve the issue on my end.
@MostHated
Sorry for the delay.
I also checked your project and I could not reproduce the error that you showed up there.
It seems strange to me that OnGUI
is called even when the window hasn't been opened
Do you still have this error now ?
I have just been using my modified version, I will have to test it out with a new default version and get back to you.
Btw, SelectionGroups in version 0.5.5-preview
can contain GameObject in subscenes.
But if you unload the subscene, then it will be deleted.
I believe we have resolved this issue, so I am going to close it. Please feel free to reopen it if necessary
Hey again, I didn't expect it to work, but I wanted to give it a try anyways. Of course, the result was that it didn't work, but I was wondering what the likelihood would be of supporting the ability to query/add members from within open SubScenes?
Ex.
Thanks, -MH