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

Move "Create Debug Tangents" on MeshInstance3D into an editor plugin #62188

Merged
merged 1 commit into from
Oct 4, 2022

Conversation

MaeIsBad
Copy link

This closes #50158

@MaeIsBad MaeIsBad requested a review from a team as a code owner June 19, 2022 00:04
@Calinou Calinou added this to the 4.0 milestone Jun 19, 2022
@MaeIsBad
Copy link
Author

MaeIsBad commented Jun 19, 2022

Oops I should've ran the format myself, my bad it's kinda late here, added a git-hook so it won't happen again

@MaeIsBad MaeIsBad force-pushed the master branch 2 times, most recently from 19f95d1 to b089a8a Compare June 19, 2022 22:24
@MaeIsBad
Copy link
Author

Third attempt! Now compiles with tools=off

@MaeIsBad MaeIsBad requested a review from a team as a code owner June 28, 2022 10:38
@MaeIsBad MaeIsBad changed the title Add undo/redo to "Create Debug Tangents" on MeshInstance3D Move "Create Debug Tangents" on MeshInstance3D into an editor plugin Jun 28, 2022
@MaeIsBad
Copy link
Author

This moves "Create Debug Tangents" from the manage object properties menu in the inspector(godot 3 screenshot)
image
to the mesh menu above the viewport
image

@@ -383,13 +383,13 @@ void MeshInstance3D::_mesh_changed() {
update_gizmos();
}

void MeshInstance3D::create_debug_tangents() {
MeshInstance3D *MeshInstance3D::create_debug_tangents_node() {
Copy link
Author

Choose a reason for hiding this comment

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

I would suggest making create_debug_tangents return the mesh instance it creates and adds as a child, but I think that would require me to open a GIP

@KoBeWi
Copy link
Member

KoBeWi commented Oct 1, 2022

Needs squash and rebase btw.

@MaeIsBad MaeIsBad force-pushed the master branch 2 times, most recently from 4606cc9 to cb3f284 Compare October 3, 2022 21:28
@MaeIsBad MaeIsBad requested review from a team as code owners October 3, 2022 21:28
Instead of exporting the "create_debug_tangents" function via
METHOD_FLAG_EDITOR it gets executed by an editor plugin.

This moves it from the "Manage object properties" menu into a mesh menu. It also adds undo/redo functionality to the create debug tangents option.
}

add_child(mi, true);
if (is_inside_tree() && this == get_tree()->get_edited_scene_root()) {
Copy link
Member

Choose a reason for hiding this comment

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

This was previously wrapped in #ifdef TOOLS_ENABLED, but I think it's fine to leave it, because get_edited_scene_root() just returns null in non-editor builds.

@akien-mga akien-mga merged commit 163582d into godotengine:master Oct 4, 2022
@akien-mga
Copy link
Member

Thanks! And congrats for your first merged Godot contribution 🎉

@MaeIsBad
Copy link
Author

MaeIsBad commented Oct 4, 2022

Thanks for your patience with me ^^ @KoBeWi

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.

"Create Debug Tangents" action on MeshInstance3D is missing undo/redo
4 participants