You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-05 12:10:55 +00:00
Merge pull request #12359 from kubecz3k/spatial-lock
ability to lock spatial nodes transform in editor
This commit is contained in:
@@ -88,7 +88,7 @@ void SceneTreeEditor::_cell_button_pressed(Object *p_item, int p_column, int p_i
|
||||
|
||||
} else if (p_id == BUTTON_LOCK) {
|
||||
|
||||
if (n->is_class("CanvasItem")) {
|
||||
if (n->is_class("CanvasItem") || n->is_class("Spatial")) {
|
||||
n->set_meta("_edit_lock_", Variant());
|
||||
_update_tree();
|
||||
emit_signal("node_changed");
|
||||
@@ -266,6 +266,10 @@ bool SceneTreeEditor::_add_nodes(Node *p_node, TreeItem *p_parent) {
|
||||
_update_visibility_color(p_node, item);
|
||||
} else if (p_node->is_class("Spatial")) {
|
||||
|
||||
bool is_locked = p_node->has_meta("_edit_lock_");
|
||||
if (is_locked)
|
||||
item->add_button(0, get_icon("Lock", "EditorIcons"), BUTTON_LOCK, false, TTR("Node is locked.\nClick to unlock"));
|
||||
|
||||
bool v = p_node->call("is_visible");
|
||||
if (v)
|
||||
item->add_button(0, get_icon("Visible", "EditorIcons"), BUTTON_VISIBILITY, false, TTR("Toggle Visibility"));
|
||||
|
||||
Reference in New Issue
Block a user