Skip to content
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

Selection change functors now take scene index as argument. #26

Merged
merged 1 commit into from
Dec 13, 2023

Conversation

ppt-adsk
Copy link
Collaborator

Static functors were capturing the selection scene index once, on construction. This is incorrect, as the selection scene index is destroyed and re-created on switching Hydra renderers.

@ppt-adsk ppt-adsk self-assigned this Dec 13, 2023
@@ -941,37 +941,38 @@ void MtohRenderOverride::SelectionChanged(
// reading the Maya selection must be done from the Maya selection
// changed callback, not the UFE selection changed callback.
using SnOp = Ufe::SelectionCompositeNotification::Op;
static auto appendSn = [this](const SnOp& op) {
_selectionSceneIndex->AddSelection(op.item->path());
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Capturing the selection scene index once, on creation of the static functor, is incorrect, as the selection scene index is destroyed and re-created. We were therefore calling member functions on a destroyed object, causing crashes.

@ppt-adsk ppt-adsk added the ready-for-merge Development process is finished, PR is ready for merge label Dec 13, 2023
@roopavr-adsk roopavr-adsk added the core Related to core plugin label Dec 13, 2023
@roopavr-adsk roopavr-adsk merged commit b9d69f7 into dev Dec 13, 2023
10 checks passed
@roopavr-adsk roopavr-adsk deleted the tremblp/HYDRA-722/fix_selection_change_functors branch December 13, 2023 17:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core Related to core plugin ready-for-merge Development process is finished, PR is ready for merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants