ShaderEditorPlugin::ShaderEditorPlugin(EditorNode *p_node, bool p_2d) { editor=p_node; shader_editor = memnew( ShaderEditor ); _2d=p_2d; if (p_2d) add_custom_control(CONTAINER_CANVAS_EDITOR_BOTTOM,shader_editor); else add_custom_control(CONTAINER_SPATIAL_EDITOR_BOTTOM,shader_editor); // editor->get_viewport()->add_child(shader_editor); // shader_editor->set_area_as_parent_rect(); shader_editor->hide(); }
BakedLightEditorPlugin::BakedLightEditorPlugin(EditorNode *p_node) { editor=p_node; baked_light_editor = memnew( BakedLightEditor ); editor->get_viewport()->add_child(baked_light_editor); add_custom_control(CONTAINER_SPATIAL_EDITOR_MENU,baked_light_editor->bake_hbox); baked_light_editor->hide(); baked_light_editor->bake_hbox->hide(); }
void EditorInspectorPluginGradient::parse_begin(Object *p_object) { Gradient *gradient = Object::cast_to<Gradient>(p_object); Ref<Gradient> g(gradient); GradientEditor *editor = memnew(GradientEditor); editor->set_gradient(g); add_custom_control(editor); }
void EditorInspectorPluginCurve::parse_begin(Object *p_object) { Curve *curve = Object::cast_to<Curve>(p_object); ERR_FAIL_COND(!curve); Ref<Curve> c(curve); CurveEditor *editor = memnew(CurveEditor); editor->set_curve(curve); add_custom_control(editor); }
ColorRampEditorPlugin::ColorRampEditorPlugin(EditorNode *p_node) { editor=p_node; ramp_editor = memnew( ColorRampEdit ); add_custom_control(CONTAINER_CANVAS_EDITOR_BOTTOM,ramp_editor); //add_custom_control(CONTAINER_SPATIAL_EDITOR_BOTTOM,ramp_editor); ramp_editor->set_custom_minimum_size(Size2(100, 48)); ramp_editor->hide(); ramp_editor->connect("ramp_changed", this, "ramp_changed"); }
void EditorInspectorPluginMaterial::parse_begin(Object *p_object) { Material *material = Object::cast_to<Material>(p_object); if (!material) { return; } Ref<Material> m(material); MaterialEditor *editor = memnew(MaterialEditor); editor->edit(m, env); add_custom_control(editor); }