-
-
Notifications
You must be signed in to change notification settings - Fork 23.3k
Add a scene painter tool #109360
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
base: master
Are you sure you want to change the base?
Add a scene painter tool #109360
Conversation
53d7c0a
to
d5f2afc
Compare
Will it be allowed to create folders in the Scene Painter so that we can manage the panel and keep it tidy and clean and logical? |
This wasn't in my plan, but I'll add it. |
Should the |
d5f2afc
to
f07efdd
Compare
I think it's better to set it for each scene that are listed in the painter |
What about 3D? |
It is currently being developed for 2D, it remains to be seen whether it has the desired result or not, later a new proposal for 3D should be presented, the way this is implemented is only for 2D and for 3D something new needs to be developed. |
f07efdd
to
a656919
Compare
Hi @groud, could you check it so far? I would appreciate your feedback. |
I think you can add a preview that follows the cursor so as to help users to accurately know how and where the scene will be painted. |
I'm not strongly against this feature (with all respect to DexterFstone work, really) but... |
Oh sorry, I didn't check that earlier. I didn't expect you would do it that fast! I had a thought about the feature btw. I am thinking that, instead of using a dedicated panel at the bottom, why not reuse the filesystem dock ? One simple solution would be to check when the selection changes then, if a scene is selected, use it as the scene to paint. That would simplify things a lot IMO, as you would not have to manage yet another set of scenes in the bottom panel, save the list, etc... (we could still keep the controls in the bottom panel though, I think that's fine). Also, if go that route, maybe we can add a lock next to "selected scene" field notifying which scene is being painted. And if you toggle the lock on, selecting a scene won't change the painted scene anymore (in case you have something to do in the filesystem dock at the same time) Aside from that it looks pretty nice from the videos already. Good job!
No, instantiating many scenes in a 2D world is a hassle. Like, if you want to paint an organic forest such a tool is a real blessing. So it being core makes quite a lot of sense to me, especially if we manage to add it without too much code. But that being said, the primary reason I want this feature is that people keep asking about being able to modify the properties of scenes instantiated by a TileMapLayer, which is not possible without a significant amount of code in an area that's already bloated, and with a performance cost that could end up hidden to the users. Instead, this solution simply brings the quite nice usability of TileMap to scene instantiation. It's simpler, less code, and a lot easier to maintain, while leveraging all the capabilities of the inspector, 2D editor and so on. |
That's why plugins exist. https://github.com/dalexeev/godot-node-brush-plugin for example. Related proposal - godotengine/godot-proposals#5553.
Unfortunately it sounds like even more bloat - "we have problem X in entity Y, so let's add new entity Z with the same functionality but with some changes". But again, I'm not insisting on anything and I respect the work DexterFstone has done (what he has implemented definitely looks great). |
No, that's quite the opposite. If problem X is better and more simply solved by a new, different solution Z, that's perfectly fine. Trying to make a generic solution that fixes everything is usually bad, as it makes code more difficult to maintain. See https://docs.godotengine.org/en/stable/contributing/development/best_practices_for_engine_contributors.html#to-each-problem-its-own-solution But to make it clear, the goal of the TileMap and scene instantiation are quite different. TileMap aims to quite performance-focused, scene instantiation is more about flexibility. It's a bit like the MultiMeshInstance node for example. |
One solution I can think of is the |
a656919
to
4b6edcb
Compare
Scene paint preview and edit scene properties are added |
b879bd7
to
06d8546
Compare
06d8546
to
95fe8e3
Compare
So I gave this a test. Aside from the missing undo/redo:
|
8ad2d65
to
2920882
Compare
Doesn't seem fixed: gz6cNhi8LK.mp4I can't see nor paint any scenes, though I can delete them. |
What is the steps to reproduce? I'm asking because I have no issues |
More like what are the steps to paint? EDIT: |
Yes, first press i to select picker tool, then select a scene, then paint |
This comment was marked as resolved.
This comment was marked as resolved.
Patch that adds undo/redo: |
Let me explain how the grid system works. First, if none of the options are enabled, the painting is free. When toggling the grid, it works like a tile map layer, and when snap to grid is enabled, it works like a canvas item snapping |
I tested it, but nothing happened |
I tested it again and it seems to happen randomly. |
The error occurs when if (selected_scene && !instance) {
instance = Object::cast_to<Node2D>(selected_scene->duplicate()); |
How should the behavior work when picking a scene from |
That behavior is fine.
Ah, I forgot I was testing something with grab radius and had it changed to some big value. Although if grid snap is enabled, I'd expect the deletion to respect grid instead and ignore that radius. |
I changed the functionality, now I use |
Is this the best way to implement, or should I develop my own? |
2920882
to
785f486
Compare
Done |
The hack should be done differently, but otherwise that's how it should be implemented. |
I implemented something like this:
|
Use |
Another crash xd
Happens when reloading the scene while painting. I didn't check, but it might involve a freed node. Also something is wrong with the grid. godot.windows.editor.dev.x86_64_OEWiiOBq6H.mp4Show Grid still snaps, while Snap to Grid makes things snap at intersection of grid lines?? That's weird, but might be useful (depending on how you setup the scenes), but then the options need to be renamed. Although instead of this weird behavior, there could be grid offset. I think this can be left for later. |
785f486
to
9279605
Compare
yes |
Here, another bug :) 2025-09-22.22-40-25.mp4Edit: I tested again, but it didn't happen :) |
As I see it, there are separate grid settings for the painter tool, in addition to the existing grid settings. Why not use the existing grid settings? Or is it inconvenient? |
What is your suggestion? |
9279605
to
b135914
Compare
I couldn't reproduce that, but I added a |
Closes godotengine/godot-proposals#12945
2025-09-15.02-51-09.mp4
Tasks
ScenePaint
toolAddScenePaintEditor
ImplementFolder
,Add Folder
,Remove Folder
ImplementAdd Scene
,Open Scene
,Remove Scene
FreePainting
,GridPainting
,Erasing
ImplementPicker
toolMakegrid step
unique for eachFolder
andScene
ImplementNew ScenePalette
,Save ScenePalette
,Load ScenePalette