-
Notifications
You must be signed in to change notification settings - Fork 332
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ScenePicker is no longer created everytime we pick something #2805
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @achalpandeyy ! Caching the scene picker is indeed a good solution. Although, the way your reset it and recreate it is not resilient and does not work with any project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @achalpandeyy ! Amazing work :)
You solution seems to work, but I think it's a bit complicated. The rendertab has already a lot of connections with other controllers, and adding a new connections with the assmebly tree makes the render tab harder to maintain.
I have few questions :
- Have you tried to update the project context each time we pick ? Or simply update it when it's not available ?
- When is the assembly_tree_build signal is emitted compared to viewports creation ?
And finally, the assembly tree being built should never trigger the activation of material and scene picker. That's not its responsibility. But I'm sure you will find a workaround.
EDIT :
You can check MainWindow::update_workspace
, a place where you can update the tabs accordingly.
src/appleseed.studio/mainwindow/rendering/materialdrophandler.cpp
Outdated
Show resolved
Hide resolved
src/appleseed.studio/mainwindow/rendering/scenepickinghandler.cpp
Outdated
Show resolved
Hide resolved
src/appleseed.studio/mainwindow/rendering/materialdrophandler.cpp
Outdated
Show resolved
Hide resolved
src/appleseed.studio/mainwindow/rendering/scenepickinghandler.cpp
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand the changes, why the changes you made to has_trace_context
make things work ?
@achalpandeyy Yes I did. But the user should not be able to "pick" while its rendering. And if the user picks on an empty render and it doesn't find anything, that's ok. If you leave the previous |
You would get a
|
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @achalpandeyy ! Looks great :)
There is one thing that I'm concerned about. Previously, we used to have multiple texture store (I saw one with 0 parameters and 1 with some paramters). And now, we have the same texture store everywhere and we are not sure which parameters are used. I think that's problematic but I don't know how TextureStore are used.
@dictoon Can you have a look on this ?
src/appleseed.studio/mainwindow/rendering/materialdrophandler.h
Outdated
Show resolved
Hide resolved
src/appleseed.studio/mainwindow/rendering/materialdrophandler.cpp
Outdated
Show resolved
Hide resolved
@oktomus, this is a vaild point. I'd love to test it. Do you know of any test scenes which use the "texture_store" param? I couldn't find any. |
Have you tried |
I haven't tried running Again, from my conversation with @dictoon on Discord, I've found that no scene is supposed to set these are params. They are characteristic of the machine and not the scene. There is an option to force-set these params in appleseed.studio's "Rendering Settings". In the event someone actually does use this, a |
@@ -1254,6 +1254,9 @@ void MainWindow::start_rendering(const RenderingMode rendering_mode) | |||
rendering_mode == RenderingMode::InteractiveRendering ? "interactive" : "final"; | |||
const ParamArray params = get_project_params(configuration_name); | |||
|
|||
if (!project->has_texture_store()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having to manually initialize the texture store before a render is a big problem. In fact, you haven't updated all the other places where we start a render, meaning that rendering there is now broken (appleseed.cli, appleseed.bench, Max plugin, Maya plugin, Blender plugin, Gaffer integration and possibly many others).
Thanks for your work @achalpandeyy! I've thoroughly checked this PR, and overall it looks very good. I replaced a few My main issue now has to do with the new requirement (if I'm not mistaken) that the texture store must be manually initialized before starting a render. See my comment on that. We need to find a solution that doesn't require doing any manual initialization. |
It seems that the unit tests don't pass, possibly for the same reason (texture store not initialized). |
Addresses #2754
Apart from the other regular instantiations of
TextureStore
, it is only created once when we pick an object the first time in the scene or drag and drop a material the first time in the scene.I've tested the code with all the test cases mentioned in the issue.
If you could think of a more elegant solution than what I've done in
MainWindow::slot_open_cornellbox_builtin_project()
, please let me know! :)