You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-14 13:41:12 +00:00
Merge pull request #106070 from IphStich/fix-duplicate-gizmos
Fix for Node3D request gizmos multiple times
This commit is contained in:
@@ -229,7 +229,8 @@ void Node3D::_notification(int p_what) {
|
||||
}
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
if (is_part_of_edited_scene()) {
|
||||
if (is_part_of_edited_scene() && !data.gizmos_requested) {
|
||||
data.gizmos_requested = true;
|
||||
get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringName(_spatial_editor_group), SNAME("_request_gizmo_for_id"), get_instance_id());
|
||||
}
|
||||
#endif
|
||||
@@ -841,7 +842,10 @@ void Node3D::update_gizmos() {
|
||||
}
|
||||
|
||||
if (data.gizmos.is_empty()) {
|
||||
if (!data.gizmos_requested) {
|
||||
data.gizmos_requested = true;
|
||||
get_tree()->call_group_flags(SceneTree::GROUP_CALL_DEFERRED, SceneStringName(_spatial_editor_group), SNAME("_request_gizmo_for_id"), get_instance_id());
|
||||
}
|
||||
return;
|
||||
}
|
||||
if (data.gizmos_dirty) {
|
||||
@@ -1542,6 +1546,7 @@ Node3D::Node3D() :
|
||||
data.fti_processed = false;
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
data.gizmos_requested = false;
|
||||
data.gizmos_disabled = false;
|
||||
data.gizmos_dirty = false;
|
||||
data.transform_gizmo_visible = true;
|
||||
|
||||
@@ -157,6 +157,7 @@ private:
|
||||
|
||||
#ifdef TOOLS_ENABLED
|
||||
Vector<Ref<Node3DGizmo>> gizmos;
|
||||
bool gizmos_requested : 1;
|
||||
bool gizmos_disabled : 1;
|
||||
bool gizmos_dirty : 1;
|
||||
bool transform_gizmo_visible : 1;
|
||||
|
||||
Reference in New Issue
Block a user