Skip to content

Add proper empty Resource handling in Polygon3D editor#121731

Open
KoBeWi wants to merge 1 commit into
godotengine:masterfrom
KoBeWi:all_this_code_just_to_edit_some_polygon_smh
Open

Add proper empty Resource handling in Polygon3D editor#121731
KoBeWi wants to merge 1 commit into
godotengine:masterfrom
KoBeWi:all_this_code_just_to_edit_some_polygon_smh

Conversation

@KoBeWi

@KoBeWi KoBeWi commented Jul 24, 2026

Copy link
Copy Markdown
Member

What problem(s) does this PR solve?

See #118486 (comment)

This replaces the editor hack in OccluderInstance3D with an internal signal that notifies the editor that editing status may have changed. The editor's code was changed to handle it.

Additional information

With this PR, Polygon3DEditor has a concept of "empty" state, i.e. a state where it doesn't have edited node, or the node doesn't have valid polygon resource. Note that the polygon editor can edit both nodes and their resources, so I added a kind of "resource mode", which is determined by the existence of _get_editable_3d_polygon_resource() method. The method can now return null and it makes the editor inactive until a valid resource is assigned to node. The newly added _editable_3d_polygon_changed signal is intended for notifying the editor about polygon object changes.

The OccluderInstance3D is no longer conditionally editable. The editor will always edit it, but stay inactive if the occluder does not have polygon assigned.

I think similar logic may need to be applied in other nodes, if their polygon object can change. We might have some undiscovered bugs here.

@KoBeWi KoBeWi added this to the 4.x milestone Jul 24, 2026
@KoBeWi
KoBeWi requested review from a team as code owners July 24, 2026 20:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant