Skip to content

fix WorldScape3DGradientOperationBuilder - #1421

Open
OldDev78 wants to merge 3 commits into
Redot-Engine:masterfrom
OldDev78:fix-ws3d-gradient-operation-builder
Open

OldDev78 wants to merge 3 commits into
Redot-Engine:masterfrom
OldDev78:fix-ws3d-gradient-operation-builder

Conversation

@OldDev78

@OldDev78 OldDev78 commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

An incorrect cast was effectively disabling the WorldScape3DGradientOperationBuilder, which forces users to always draw the slope. This change allows to choose between automatic or manual operation, just like the original plugin did.
Extend ToolSettings class to allow direct access to the MultiPicker through the settings dictionary.

Fixes #1420 .

Summary by CodeRabbit

  • Bug Fixes
    • Improved WorldScape 3D gradient editing by preserving gradient point settings accurately when using the point picker.
    • Improved the reliability of gradient-based decal visibility updates during WorldScape 3D editing.
    • Improved handling of gradient points that are positioned very close together, helping prevent invalid or unstable gradient height edits.

@OldDev78
OldDev78 requested review from a team September 14, 2026 05:01
@coderabbitai

coderabbitai Bot commented Sep 14, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Advanced

Run ID: 5dc81e14-05b1-4fa2-8673-a54829798be1

📥 Commits

Reviewing files that changed from the base of the PR and between 051de06 and b6c4138.

📒 Files selected for processing (1)
  • modules/worldscape_3d/editor/worldscape_3d_editor.cpp

Included review availability: Your plan provides up to 8 included reviews per hour; 6 remain after this review.


Walkthrough

The change adds raw setting access for gradient points, moves decal visibility reset logic, and raises the minimum squared distance for gradient points.

Changes

WorldScape3D UI fixes

Layer / File(s) Summary
Raw gradient setting access
modules/worldscape_3d/editor/ui/worldscape_3d_tools.h, modules/worldscape_3d/editor/ui/worldscape_3d_tools.cpp, modules/worldscape_3d/editor/ui/worldscape_3d_operations.cpp
WorldScape3DToolSettings exposes get_setting(), which returns the stored Variant. get_point_picker() uses it for gradient_points instead of convert_setting().
Decal visibility reset
modules/worldscape_3d/editor/ui/worldscape_3d_ui.cpp
update_decal() resets editor decal visibility after the brushing-operations switch. The gradient branch can re-enable both decals when valid points exist.
Gradient-point validation
modules/worldscape_3d/editor/worldscape_3d_editor.cpp
Gradient-point validation now rejects points with a squared distance below 0.125.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Suggested reviewers: arctis-fireblight, decryptedchaos

Merge Risk: ⚪ Minimal · up to b6c41

The available evidence does not identify a current behavior that should block merging.

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 9 functions across 5 files. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly identifies the primary change: fixing WorldScape3DGradientOperationBuilder. It is concise and directly related to the pull request.
Linked Issues check ✅ Passed The changes satisfy #1420. get_point_picker() now retrieves the MultiPicker control with get_setting("gradient_points"). is_ready() and apply_operation() use is_drawable() so the tool gene…
Out of Scope Changes check ✅ Passed All reviewed changes support #1420. The direct settings accessor enables MultiPicker retrieval. The point-distance criterion and decal visibility update support valid gradient operation and its user…
  • Fix all pre-merge checks with AI
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

JoltedJon
JoltedJon previously approved these changes Sep 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Open

Development

Successfully merging this pull request may close these issues.

WorldScape3D: gradient/slope tool never automatic

2 participants