Fix: Make SetPose UI not editable for planes#3811
Conversation
|
|
||
| // Check if any collision in this model has plane geometry. | ||
| bool containsPlane = false; | ||
| _ecm.EachNoCache<components::Collision, |
There was a problem hiding this comment.
Did you check how this change performs in a world with many entities (i.e. 3k_shapes)? Does it need to be the NoCache variant of Each?
If it affects performance significantly I think we should not backport it, if #3447 gets in EachNoCache will have no significant performance hit so merging it forward should be OK.
There was a problem hiding this comment.
I wasn't really paying attention to performance. You're right - even on a mid-size scene impact is noticeable, let alone on 3k_shapes.
Yeah, NoCache variant is indeed unnecessary here.
It's also iterating over everything, which is also unnecessary.
Thanks for the catch.
I've modified the check to fix both problems.
Signed-off-by: Pavel Petrykin <silverducks@altlinux.org>
🦟 Bug fix
Fixes #3483
Summary
Fix makes Pose UI fields read-only when selection has plane geometry.

To achieve this, Component Inspector was extended with an extra property - modelContainsPlane - and that property was added to readOnly block in Pose3d.qml. Screenshot with PR applied:
Steps to reproduce the bug:
Expected behavior: Pose UI for planes is either not editable or applies edits
Actual behavior: Pose UI for planes is editable but silently fails to apply edits
Backport Policy
Checklist
codecheckpassed (See contributing)