diff options
Diffstat (limited to 'editor/editor_plugin.cpp')
-rw-r--r-- | editor/editor_plugin.cpp | 62 |
1 files changed, 31 insertions, 31 deletions
diff --git a/editor/editor_plugin.cpp b/editor/editor_plugin.cpp index 2cafbe3cca..8faaabc1fb 100644 --- a/editor/editor_plugin.cpp +++ b/editor/editor_plugin.cpp @@ -41,7 +41,7 @@ #include "plugins/node_3d_editor_plugin.h" #include "scene/3d/camera_3d.h" #include "scene/gui/popup_menu.h" -#include "servers/visual_server.h" +#include "servers/rendering_server.h" Array EditorInterface::_make_mesh_previews(const Array &p_meshes, int p_preview_size) { @@ -64,25 +64,25 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh int size = p_preview_size; - RID scenario = VS::get_singleton()->scenario_create(); + RID scenario = RS::get_singleton()->scenario_create(); - RID viewport = VS::get_singleton()->viewport_create(); - VS::get_singleton()->viewport_set_update_mode(viewport, VS::VIEWPORT_UPDATE_ALWAYS); - VS::get_singleton()->viewport_set_scenario(viewport, scenario); - VS::get_singleton()->viewport_set_size(viewport, size, size); - VS::get_singleton()->viewport_set_transparent_background(viewport, true); - VS::get_singleton()->viewport_set_active(viewport, true); - RID viewport_texture = VS::get_singleton()->viewport_get_texture(viewport); + RID viewport = RS::get_singleton()->viewport_create(); + RS::get_singleton()->viewport_set_update_mode(viewport, RS::VIEWPORT_UPDATE_ALWAYS); + RS::get_singleton()->viewport_set_scenario(viewport, scenario); + RS::get_singleton()->viewport_set_size(viewport, size, size); + RS::get_singleton()->viewport_set_transparent_background(viewport, true); + RS::get_singleton()->viewport_set_active(viewport, true); + RID viewport_texture = RS::get_singleton()->viewport_get_texture(viewport); - RID camera = VS::get_singleton()->camera_create(); - VS::get_singleton()->viewport_attach_camera(viewport, camera); + RID camera = RS::get_singleton()->camera_create(); + RS::get_singleton()->viewport_attach_camera(viewport, camera); - RID light = VS::get_singleton()->directional_light_create(); - RID light_instance = VS::get_singleton()->instance_create2(light, scenario); + RID light = RS::get_singleton()->directional_light_create(); + RID light_instance = RS::get_singleton()->instance_create2(light, scenario); - RID light2 = VS::get_singleton()->directional_light_create(); - VS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7)); - RID light_instance2 = VS::get_singleton()->instance_create2(light2, scenario); + RID light2 = RS::get_singleton()->directional_light_create(); + RS::get_singleton()->light_set_color(light2, Color(0.7, 0.7, 0.7)); + RID light_instance2 = RS::get_singleton()->instance_create2(light2, scenario); EditorProgress ep("mlib", TTR("Creating Mesh Previews"), p_meshes.size()); @@ -101,8 +101,8 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh mesh_xform = (*p_transforms)[i]; } - RID inst = VS::get_singleton()->instance_create2(mesh->get_rid(), scenario); - VS::get_singleton()->instance_set_transform(inst, mesh_xform); + RID inst = RS::get_singleton()->instance_create2(mesh->get_rid(), scenario); + RS::get_singleton()->instance_set_transform(inst, mesh_xform); AABB aabb = mesh->get_aabb(); Vector3 ofs = aabb.position + aabb.size * 0.5; @@ -121,32 +121,32 @@ Vector<Ref<Texture2D>> EditorInterface::make_mesh_previews(const Vector<Ref<Mesh xform.invert(); xform = mesh_xform * xform; - VS::get_singleton()->camera_set_transform(camera, xform * Transform(Basis(), Vector3(0, 0, 3))); - VS::get_singleton()->camera_set_orthogonal(camera, m * 2, 0.01, 1000.0); + RS::get_singleton()->camera_set_transform(camera, xform * Transform(Basis(), Vector3(0, 0, 3))); + RS::get_singleton()->camera_set_orthogonal(camera, m * 2, 0.01, 1000.0); - VS::get_singleton()->instance_set_transform(light_instance, xform * Transform().looking_at(Vector3(-2, -1, -1), Vector3(0, 1, 0))); - VS::get_singleton()->instance_set_transform(light_instance2, xform * Transform().looking_at(Vector3(+1, -1, -2), Vector3(0, 1, 0))); + RS::get_singleton()->instance_set_transform(light_instance, xform * Transform().looking_at(Vector3(-2, -1, -1), Vector3(0, 1, 0))); + RS::get_singleton()->instance_set_transform(light_instance2, xform * Transform().looking_at(Vector3(+1, -1, -2), Vector3(0, 1, 0))); ep.step(TTR("Thumbnail..."), i); Main::iteration(); Main::iteration(); - Ref<Image> img = VS::get_singleton()->texture_2d_get(viewport_texture); + Ref<Image> img = RS::get_singleton()->texture_2d_get(viewport_texture); ERR_CONTINUE(!img.is_valid() || img->empty()); Ref<ImageTexture> it(memnew(ImageTexture)); it->create_from_image(img); - VS::get_singleton()->free(inst); + RS::get_singleton()->free(inst); textures.push_back(it); } - VS::get_singleton()->free(viewport); - VS::get_singleton()->free(light); - VS::get_singleton()->free(light_instance); - VS::get_singleton()->free(light2); - VS::get_singleton()->free(light_instance2); - VS::get_singleton()->free(camera); - VS::get_singleton()->free(scenario); + RS::get_singleton()->free(viewport); + RS::get_singleton()->free(light); + RS::get_singleton()->free(light_instance); + RS::get_singleton()->free(light2); + RS::get_singleton()->free(light_instance2); + RS::get_singleton()->free(camera); + RS::get_singleton()->free(scenario); return textures; } |