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

Add rotation ability to material editor preview. #49466

Merged
merged 1 commit into from
Sep 7, 2022

Conversation

AnilBK
Copy link
Contributor

@AnilBK AnilBK commented Jun 9, 2021

Mesh editor(Inspector while selecting MeshInstance3D) already had the ability to rotate the preview of currently edited mesh.

That feature is added to material editor.Just a copy paste from mesh_editor class.

Normal Preview:

normal-preview.mp4

Shader Preview:

shader-preview.mp4

Useful especially while shader editor is zoomed. If more primitives are added along with the built in sphere and cube then, it low key would act like that scrapped dedicated shader editor PR.
shader editor full screen

@Calinou Calinou added cherrypick:3.x Considered for cherry-picking into a future 3.x release enhancement topic:3d topic:editor usability labels Jun 9, 2021
@Calinou Calinou added this to the 4.0 milestone Jun 9, 2021
Copy link
Member

@akien-mga akien-mga left a comment

Choose a reason for hiding this comment

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

Code looks good to me, I'll let @JFonS or @aaronfranke confirm feature-wise.

editor/plugins/mesh_editor_plugin.h Outdated Show resolved Hide resolved
editor/plugins/material_editor_plugin.cpp Outdated Show resolved Hide resolved
editor/plugins/material_editor_plugin.cpp Outdated Show resolved Hide resolved
editor/plugins/material_editor_plugin.cpp Outdated Show resolved Hide resolved
@JFonS
Copy link
Contributor

JFonS commented Jun 2, 2022

The feature looks good. I think this needs a rebase and some code clean-up as @aaronfranke mentioned.

@AnilBK
Copy link
Contributor Author

AnilBK commented Jul 30, 2022

The feature looks good. I think this needs a rebase and some code clean-up as @aaronfranke mentioned.

I still coudn't figure out how to implement code clean-ups as @aaronfranke mentioned.
So, I don't know what to do further.

This PR is still good as it is, since it's the same way mesh editor's preview code implements.

void MeshEditor::_update_rotation() {
Transform3D t;
t.basis.rotate(Vector3(0, 1, 0), -rot_y);
t.basis.rotate(Vector3(1, 0, 0), -rot_x);
rotation->set_transform(t);
}

@fire
Copy link
Member

fire commented Sep 6, 2022

Can I ask for a rebase? Want to review it again for godot 4 beta

@AnilBK
Copy link
Contributor Author

AnilBK commented Sep 6, 2022

Can I ask for a rebase? Want to review it again for godot 4 beta

Rebased.

@fire fire requested a review from a team September 6, 2022 19:32
Copy link
Member

@aaronfranke aaronfranke left a comment

Choose a reason for hiding this comment

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

Sorry about my comment of "Just do it like this" earlier, I just checked and actually the rotation order is different for this code, so trying to do it that way won't work as expected.

editor/plugins/material_editor_plugin.cpp Outdated Show resolved Hide resolved
Copy link
Member

@fire fire left a comment

Choose a reason for hiding this comment

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

Test does what I expected.

@akien-mga akien-mga merged commit f7261e6 into godotengine:master Sep 7, 2022
@akien-mga
Copy link
Member

Thanks!

@AnilBK AnilBK deleted the rotate-previews branch September 7, 2022 17:35
@timothyqiu
Copy link
Member

timothyqiu commented Dec 17, 2022

Cherry-picked for 3.6.

@timothyqiu timothyqiu removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Dec 17, 2022
@akien-mga akien-mga changed the title Add rotation ability to material editor preview. [3.x] Add rotation ability to material editor preview. Sep 9, 2024
@akien-mga akien-mga changed the title [3.x] Add rotation ability to material editor preview. Add rotation ability to material editor preview. Sep 9, 2024
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.

7 participants