1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-11 13:10:58 +00:00

Enable material editor preview to be rotated.

This commit is contained in:
Anilforextra
2022-09-07 11:02:57 +05:45
parent 5fb84e5702
commit d4ee903004
2 changed files with 37 additions and 13 deletions

View File

@@ -45,11 +45,14 @@ class SubViewportContainer;
class MaterialEditor : public Control {
GDCLASS(MaterialEditor, Control);
Vector2 rot = Vector2();
HBoxContainer *layout_2d = nullptr;
ColorRect *rect_instance = nullptr;
SubViewportContainer *vc = nullptr;
SubViewport *viewport = nullptr;
Node3D *rotation = nullptr;
MeshInstance3D *sphere_instance = nullptr;
MeshInstance3D *box_instance = nullptr;
DirectionalLight3D *light1 = nullptr;
@@ -87,7 +90,8 @@ class MaterialEditor : public Control {
protected:
virtual void _update_theme_item_cache() override;
void _notification(int p_what);
static void _bind_methods();
void gui_input(const Ref<InputEvent> &p_event) override;
void _update_rotation();
public:
void edit(Ref<Material> p_material, const Ref<Environment> &p_env);