Skip to content

feat(skeleton): viewport bone picking with gizmo priority - #906

Merged
fernandotonon merged 2 commits into
masterfrom
feat/bone-viewport-picking
Jul 16, 2026
Merged

feat(skeleton): viewport bone picking with gizmo priority#906
fernandotonon merged 2 commits into
masterfrom
feat/bone-viewport-picking

Conversation

@fernandotonon

@fernandotonon fernandotonon commented Jul 16, 2026

Copy link
Copy Markdown
Owner

Summary

  • Mouse-pick skeleton-debug bones in the viewport when the skeleton overlay is visible (bones over meshes).
  • Gizmo hits always win over bone picks; bone selection no longer briefly clears SelectionSet, so Edit Mode stays active when picking bones on the already-selected mesh.
  • Tag bone visuals with owning entity name and gate picks via PropertiesPanelController::isSkeletonDebugActive / hasAnySkeletonDebugActive.

Test plan

  • Import a rigged mesh, enable Show Skeleton, pick bones in Select mode (Q)
  • Confirm bone pick works from Edit Mode without switching to Object Mode
  • With W/E/R active and a bone selected, click a gizmo handle that overlaps another bone — expect gizmo drag, not re-picking the other bone
  • With skeleton overlay off, clicking the mesh selects the mesh (no bone pick)
  • Unit tests: SkeletonDebug* / TransformOperator*

Made with Cursor

Summary by CodeRabbit

  • New Features

    • Added direct screen-click selection for bones when skeleton debug overlays are enabled.
    • Bone selections now identify and select both the owning entity and its corresponding bone.
    • Added status checks for skeleton debugging on individual entities and across the scene.
  • Bug Fixes

    • Bone picks take priority over gizmos, meshes, and box-selection interactions when applicable.
  • Tests

    • Added coverage for identifying owning entities and handling invalid bone-visual references.

Allow mouse-picking skeleton-debug bones when the overlay is visible,
preferring bones over meshes while keeping gizmos above bone picks and
avoiding Edit Mode exit when re-selecting the active mesh.

Co-authored-by: Cursor <cursoragent@cursor.com>
@coderabbitai

coderabbitai Bot commented Jul 16, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@fernandotonon, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 28 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a9f71aad-8397-433a-937c-2fd46eaeb0bc

📥 Commits

Reviewing files that changed from the base of the PR and between 3471489 and 1775ed2.

📒 Files selected for processing (4)
  • src/SkeletonDebug_test.cpp
  • src/TransformOperator.cpp
  • src/TransformOperator.h
  • src/TransformOperator_test.cpp
📝 Walkthrough

Walkthrough

Skeleton debug visuals now retain their owning entity names. PropertiesPanelController exposes skeleton-debug activity queries, and TransformOperator prioritizes active skeleton bone picks across selection and transform mouse interactions.

Changes

Skeleton bone picking

Layer / File(s) Summary
Tag skeleton visuals with entity identity
src/SkeletonDebug.cpp, src/SkeletonDebug.h
Bone and axes visuals store the owning entity name, which can be retrieved from tagged movable objects.
Expose skeleton debug state
src/PropertiesPanelController.cpp, src/PropertiesPanelController.h
Controller methods report per-entity and scene-wide skeleton debug activity.
Prioritize bone picks in selection input
src/TransformOperator.cpp, src/TransformOperator.h, src/SkeletonDebug_test.cpp
Screen clicks ray-pick active skeleton bones before mesh selection or transforms, update entity and animation selections, and validate entity-name lookup behavior.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant MouseEvent
  participant TransformOperator
  participant SkeletonDebug
  participant PropertiesPanelController
  participant AnimationControlController
  MouseEvent->>TransformOperator: provide screen click
  TransformOperator->>SkeletonDebug: ray-pick tagged bone visual
  TransformOperator->>PropertiesPanelController: verify skeleton debug activity
  TransformOperator->>AnimationControlController: select owning entity and bone
  TransformOperator-->>MouseEvent: bypass mesh selection or transform
Loading

Possibly related PRs

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title concisely and accurately summarizes viewport bone picking with gizmo priority.
Description check ✅ Passed The description covers the main behavior and test plan, though the template's Technical Details section is not explicitly formatted.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/bone-viewport-picking

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 34714890f0

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/TransformOperator.cpp Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
src/SkeletonDebug_test.cpp (1)

125-125: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Assert the exact owning entity name.

A non-empty but incorrect tag still passes this test and would make picking resolve the wrong mesh. Compare entityNameForMovable(obj) with the fixture entity’s actual Ogre name.

As per coding guidelines, "src/**/*_test.cpp: Add Google Test unit tests for new functionality."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/SkeletonDebug_test.cpp` at line 125, Update the test around
SkeletonDebug::entityNameForMovable(obj) to assert equality with the fixture
entity’s actual Ogre name instead of only checking that the result is non-empty.
Preserve the existing movable object setup and use the fixture’s owning entity
name as the expected value.

Source: Coding guidelines

src/TransformOperator.cpp (1)

955-1025: 📐 Maintainability & Code Quality | 🔵 Trivial | 🏗️ Heavy lift

Add focused tests for bone-picking priority and selection semantics.

Cover overlay-disabled misses, inactive-owner hits, gizmo overlap, mesh fallback, ADD_SELECT/DEL_SELECT, and preserving Edit Mode when the owner is already selected. Tests should run under Xvfb without requiring a real display.

As per coding guidelines, "src/**/*_test.cpp: Add Google Test unit tests for new functionality. Tests should work under Xvfb and avoid assumptions about a real display."

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@src/TransformOperator.cpp` around lines 955 - 1025, add focused Google Test
coverage for TransformOperator::tryPickBoneAt, using Xvfb-compatible test setup
without requiring a real display. Exercise overlay-disabled and inactive-owner
misses, gizmo-overlap priority, mesh fallback, NEW_SELECT/ADD_SELECT/DEL_SELECT
semantics, and the already-selected owner path preserving Edit Mode; use
existing test fixtures and mocks/helpers for ray queries, properties, selection,
and controller state rather than introducing unrelated refactors.

Source: Coding guidelines

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@src/SkeletonDebug_test.cpp`:
- Line 125: Update the test around SkeletonDebug::entityNameForMovable(obj) to
assert equality with the fixture entity’s actual Ogre name instead of only
checking that the result is non-empty. Preserve the existing movable object
setup and use the fixture’s owning entity name as the expected value.

In `@src/TransformOperator.cpp`:
- Around line 955-1025: add focused Google Test coverage for
TransformOperator::tryPickBoneAt, using Xvfb-compatible test setup without
requiring a real display. Exercise overlay-disabled and inactive-owner misses,
gizmo-overlap priority, mesh fallback, NEW_SELECT/ADD_SELECT/DEL_SELECT
semantics, and the already-selected owner path preserving Edit Mode; use
existing test fixtures and mocks/helpers for ray queries, properties, selection,
and controller state rather than introducing unrelated refactors.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: e8ab8776-16ad-44a5-b6c3-37d5c04e5786

📥 Commits

Reviewing files that changed from the base of the PR and between 5415810 and 3471489.

📒 Files selected for processing (7)
  • src/PropertiesPanelController.cpp
  • src/PropertiesPanelController.h
  • src/SkeletonDebug.cpp
  • src/SkeletonDebug.h
  • src/SkeletonDebug_test.cpp
  • src/TransformOperator.cpp
  • src/TransformOperator.h

Hidden transform gizmos still carry GIZMO_QUERY_FLAGS in Select mode, so
an unconditional gizmo gate stole bone hits. Gate only for W/E/R and
cover the policy with a unit test; assert exact entity tags on overlays.

Co-authored-by: Cursor <cursoragent@cursor.com>
@fernandotonon

Copy link
Copy Markdown
Owner Author

Addressed review feedback:

  • Codex P2: Select-mode bone picks no longer bail out on hidden gizmos (shouldPreferGizmoOverBonePick only for W/E/R).
  • CodeRabbit: assert exact owning entity name on tagged skeleton visuals; added unit coverage for the gizmo-vs-bone policy helper (full ray-query integration remains covered manually / via existing TransformOperator suite).

@sonarqubecloud

Copy link
Copy Markdown

@fernandotonon
fernandotonon merged commit 0c95b75 into master Jul 16, 2026
21 checks passed
@fernandotonon
fernandotonon deleted the feat/bone-viewport-picking branch July 16, 2026 02:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant