blackears / cyclopsLevelBuilder

A Godot plugin to let you block in levels inside the Godot editor.
MIT License
920 stars 36 forks source link

Unable to select blocks by clicking within the space in the editing interface #177

Open xklse opened 1 month ago

xklse commented 1 month ago

I speculate this may be a common issue with plugins, where third-party nodes cannot be selected

blackears commented 4 weeks ago

I have plans to redesign this, but it will be a big redesign. Unfortunately there is no easy way to fix this with the way Godot's editor handles things.

blackears commented 4 weeks ago

You can select nodes in the Scene window. Once one node is selected, it will be possible to select others.

xklse commented 4 weeks ago

Yes, this issue seems to occur in many nodes involving scene editing. The alternative operation you mentioned is also my current backup process. Besides that, I think the plugin functionality is very good. I look forward to seeing future improvements.

hayahane commented 4 weeks ago

Running into a similar problem when making custom terrain, do you know how to achieve selectable 3d nodes? At first I thought it is gizmos issue, but after reading the editor code i suspect it's a renderingserver instance issue, which returns nothing when the custom node inherits VisualInstance3D and use setbase internal.

blackears commented 4 weeks ago

The issue is that a plugin will only accept input events when one of the objects that it manages is selected. So I can't run my selection code unless a CyclopsBlock is already selected.

hayahane commented 3 weeks ago

I managed to use EditorNode3DGizmoPlugin to solve my problem. I don't know if it will helpful, but I'll post it here.

Godot uses ray intersection to find a visual instance internally. Since a visual instance is not a node at most times, Godot then look up the node which is the base of that instance. After that the editor will try to get it's gizmo and do ray intersection with the collision of the gizmo. So the most important step is to update gizmo's collision_mesh/collision_segment in _redraw virtual function, that's how it a custom node can be selected.

I read some of the code of Cyclops, and it's to complicated for a short-time explore. Maybe using a more standard EditorNode3DGizmoPlugin can solve the problem? I'm not sure.

image

https://github.com/blackears/cyclopsLevelBuilder/assets/39263675/f73c4ebf-555a-4a24-9f4a-77a0990d4306

blackears commented 3 weeks ago

I looked at EditorNode3DGizmoPlugin back when I started. It only gives you a small selection of handles to work with. It doesn't provide the input even options I need for the more complicated things that Cyclops does.

hayahane commented 3 weeks ago

Maybe only use this for selection? There seems to be no way to select any node without a valid gizmo attached.

blackears commented 3 weeks ago

I have something else planned.

hayahane commented 3 weeks ago

I have something else planned.

Great, looking forward to it!