Skip to content
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

ability to lock spatial nodes transform in editor #12359

Merged
merged 1 commit into from
Nov 20, 2017

Conversation

kubecz3k
Copy link
Contributor

Works in the same fashion as lock icon for 2d nodes:
spatial_lock
It locks translation, scale and rotation.
Change in editor_data.cpp is needed because it was possible to create infinite loop of selection_changed signals in the case when selection_changed signal was connected to the method that uses editor_data.get_selected_node_list (it happened when changed variable of editor_data was set to false).

@groud groud added this to the 3.0 milestone Oct 23, 2017
@ghost ghost added the usability label Oct 23, 2017
//SpatialEditorSelectedItem spatial_data = editor_selection.get_node_editor_data<SpatialEditorSelectedItem>(spatial);
spatial->set_meta("_edit_lock_", Variant());
emit_signal("item_lock_status_changed");
//emit_signal("item_lock_status_changed");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Doesn't seem really useful to keep? ;)
Please check the other commented statements and see if they're needed or should be removed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, my bad will clean them asap

@mhilbrunner
Copy link
Member

mhilbrunner commented Oct 30, 2017

UX-wise it'd be great if the transform Gizmo handles would be hidden or at least have no active hover effect once the selected node is locked.

This hopefully communicates the locked state & helps avoid confusing users that toggled the lock accidentally, wondering why they can't grab those handles even though they light up on mouse over.

@kubecz3k
Copy link
Contributor Author

Sure I will take a look at this when I will have some time. Gizmos for sure should be still visible (so user could see where is pivot point of the node), but I can disable the hover effect for locked nodes. I also wanted to take a look into not allowing selection when clicking in viewport on locked node. But I'm not sure when exactly I will dig into this.

@kubecz3k
Copy link
Contributor Author

kubecz3k commented Nov 2, 2017

I just noticed there is a problem when locking subscenes. The lock in that case is not stored between sessions. Will need to investigate this (take a look at how it's working in 2d in such case).

@kubecz3k
Copy link
Contributor Author

kubecz3k commented Nov 11, 2017

I was looking hard to find how it's done for 2d subscenes. In the end it turns out it's not done at all (from my tests).
Which is pretty not fun. I will want to add this functionality for 2d and 3d subscenes.
Not sure how yet (probably will need somehow to implement meta_data saving for scene root).

@kubecz3k
Copy link
Contributor Author

If someone has any hints on how to save meta_data for subscenes I will be obligated, there is not much time left before 20 :)

@reduz
Copy link
Member

reduz commented Nov 11, 2017 via email

@kubecz3k
Copy link
Contributor Author

@reduz oh I see, so storing metadata is not the best way to fix that issue.

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.

5 participants