diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/animation_bezier_editor.cpp | 20 | ||||
-rw-r--r-- | editor/animation_track_editor.cpp | 20 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 5 | ||||
-rw-r--r-- | editor/plugins/sprite_editor_plugin.cpp | 63 | ||||
-rw-r--r-- | editor/spatial_editor_gizmos.cpp | 108 | ||||
-rw-r--r-- | editor/spatial_editor_gizmos.h | 13 |
6 files changed, 1 insertions, 228 deletions
diff --git a/editor/animation_bezier_editor.cpp b/editor/animation_bezier_editor.cpp index 2514663b4c..af2760e82b 100644 --- a/editor/animation_bezier_editor.cpp +++ b/editor/animation_bezier_editor.cpp @@ -491,26 +491,6 @@ void AnimationBezierTrackEdit::_notification(int p_what) { } draw_rect(Rect2(bs_from, bs_to - bs_from), bs); } - -#if 0 - // KEYFAMES // - - { - - float scale = timeline->get_zoom_scale(); - int limit_end = get_size().width - timeline->get_buttons_width(); - - for (int i = 0; i < animation->track_get_key_count(track); i++) { - - float offset = animation->track_get_key_time(track, i) - timeline->get_value(); - if (editor->is_key_selected(track, i) && editor->is_moving_selection()) { - offset += editor->get_moving_selection_offset(); - } - offset = offset * scale + limit; - draw_key(i, scale, int(offset), editor->is_key_selected(track, i), limit, limit_end); - } - } -#endif } } diff --git a/editor/animation_track_editor.cpp b/editor/animation_track_editor.cpp index f6d5312fc7..22a5298d5c 100644 --- a/editor/animation_track_editor.cpp +++ b/editor/animation_track_editor.cpp @@ -4838,25 +4838,6 @@ struct _AnimMoveRestore { void AnimationTrackEditor::_clear_key_edit() { if (key_edit) { - -#if 0 - // going back seems like the most comfortable thing to do, but it results - // in weird behaviors and crashes, because going back to animation editor - // triggers the editor setting up again itself - - bool go_back = false; - if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == key_edit) { - EditorNode::get_singleton()->push_item(NULL); - go_back = true; - } - - memdelete(key_edit); - key_edit = NULL; - - if (go_back) { - EditorNode::get_singleton()->get_inspector_dock()->go_back(); - } -#else //if key edit is the object being inspected, remove it first if (EditorNode::get_singleton()->get_inspector()->get_edited_object() == key_edit || EditorNode::get_singleton()->get_inspector()->get_edited_object() == multi_key_edit) { @@ -4871,7 +4852,6 @@ void AnimationTrackEditor::_clear_key_edit() { memdelete(multi_key_edit); multi_key_edit = NULL; } -#endif } } diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index cab317990e..0774d0b5dc 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -32,18 +32,15 @@ #include "core/io/resource_saver.h" #include "editor/editor_node.h" -#include "scene/resources/packed_scene.h" - #include "scene/3d/collision_shape.h" #include "scene/3d/mesh_instance.h" #include "scene/3d/navigation.h" #include "scene/3d/physics_body.h" -#include "scene/3d/portal.h" -#include "scene/3d/room_instance.h" #include "scene/3d/vehicle_body.h" #include "scene/animation/animation_player.h" #include "scene/resources/animation.h" #include "scene/resources/box_shape.h" +#include "scene/resources/packed_scene.h" #include "scene/resources/plane_shape.h" #include "scene/resources/ray_shape.h" #include "scene/resources/resource_format_text.h" diff --git a/editor/plugins/sprite_editor_plugin.cpp b/editor/plugins/sprite_editor_plugin.cpp index f5ea88eeae..6757b180a3 100644 --- a/editor/plugins/sprite_editor_plugin.cpp +++ b/editor/plugins/sprite_editor_plugin.cpp @@ -474,69 +474,6 @@ void SpriteEditor::_add_as_sibling_or_child(Node *p_own_node, Node *p_new_node) p_new_node->set_owner(this->get_tree()->get_edited_scene_root()); } -#if 0 -void SpriteEditor::_create_uv_lines() { - - Ref<Mesh> sprite = node->get_sprite(); - ERR_FAIL_COND(!sprite.is_valid()); - - Set<SpriteEditorEdgeSort> edges; - uv_lines.clear(); - for (int i = 0; i < sprite->get_surface_count(); i++) { - if (sprite->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES) - continue; - Array a = sprite->surface_get_arrays(i); - - PoolVector<Vector2> uv = a[p_layer == 0 ? Mesh::ARRAY_TEX_UV : Mesh::ARRAY_TEX_UV2]; - if (uv.size() == 0) { - err_dialog->set_text(TTR("Model has no UV in this layer")); - err_dialog->popup_centered_minsize(); - return; - } - - PoolVector<Vector2>::Read r = uv.read(); - - PoolVector<int> indices = a[Mesh::ARRAY_INDEX]; - PoolVector<int>::Read ri; - - int ic; - bool use_indices; - - if (indices.size()) { - ic = indices.size(); - ri = indices.read(); - use_indices = true; - } else { - ic = uv.size(); - use_indices = false; - } - - for (int j = 0; j < ic; j += 3) { - - for (int k = 0; k < 3; k++) { - - SpriteEditorEdgeSort edge; - if (use_indices) { - edge.a = r[ri[j + k]]; - edge.b = r[ri[j + ((k + 1) % 3)]]; - } else { - edge.a = r[j + k]; - edge.b = r[j + ((k + 1) % 3)]; - } - - if (edges.has(edge)) - continue; - - uv_lines.push_back(edge.a); - uv_lines.push_back(edge.b); - edges.insert(edge); - } - } - } - - debug_uv_dialog->popup_centered_minsize(); -} -#endif void SpriteEditor::_debug_uv_draw() { Ref<Texture> tex = node->get_texture(); diff --git a/editor/spatial_editor_gizmos.cpp b/editor/spatial_editor_gizmos.cpp index 418ff1d2a3..c94b0eeab0 100644 --- a/editor/spatial_editor_gizmos.cpp +++ b/editor/spatial_editor_gizmos.cpp @@ -44,11 +44,9 @@ #include "scene/3d/navigation_mesh.h" #include "scene/3d/particles.h" #include "scene/3d/physics_joint.h" -#include "scene/3d/portal.h" #include "scene/3d/position_3d.h" #include "scene/3d/ray_cast.h" #include "scene/3d/reflection_probe.h" -#include "scene/3d/room_instance.h" #include "scene/3d/soft_body.h" #include "scene/3d/spring_arm.h" #include "scene/3d/sprite_3d.h" @@ -1951,112 +1949,6 @@ void PhysicalBoneSpatialGizmoPlugin::redraw(EditorSpatialGizmo *p_gizmo) { p_gizmo->add_lines(points, material); } -// FIXME: Kept as reference for reimplementation in 3.1+ -#if 0 - -void RoomSpatialGizmo::redraw() { - - clear(); - Ref<RoomBounds> roomie = room->get_room(); - if (roomie.is_null()) - return; - PoolVector<Face3> faces = roomie->get_geometry_hint(); - - Vector<Vector3> lines; - int fc = faces.size(); - PoolVector<Face3>::Read r = faces.read(); - - Map<_EdgeKey, Vector3> edge_map; - - for (int i = 0; i < fc; i++) { - - Vector3 fn = r[i].get_plane().normal; - - for (int j = 0; j < 3; j++) { - - _EdgeKey ek; - ek.from = r[i].vertex[j].snapped(Vector3(CMP_EPSILON, CMP_EPSILON, CMP_EPSILON)); - ek.to = r[i].vertex[(j + 1) % 3].snapped(Vector3(CMP_EPSILON, CMP_EPSILON, CMP_EPSILON)); - if (ek.from < ek.to) - SWAP(ek.from, ek.to); - - Map<_EdgeKey, Vector3>::Element *E = edge_map.find(ek); - - if (E) { - - if (E->get().dot(fn) > 0.9) { - - E->get() = Vector3(); - } - - } else { - - edge_map[ek] = fn; - } - } - } - - for (Map<_EdgeKey, Vector3>::Element *E = edge_map.front(); E; E = E->next()) { - - if (E->get() != Vector3()) { - lines.push_back(E->key().from); - lines.push_back(E->key().to); - } - } - - add_lines(lines, EditorSpatialGizmos::singleton->room_material); - add_collision_segments(lines); -} - -RoomSpatialGizmo::RoomSpatialGizmo(Room *p_room) { - - set_spatial_node(p_room); - room = p_room; -} - -///// - -void PortalSpatialGizmo::redraw() { - - clear(); - - Vector<Point2> points = portal->get_shape(); - if (points.size() == 0) { - return; - } - - Vector<Vector3> lines; - - Vector3 center; - for (int i = 0; i < points.size(); i++) { - - Vector3 f; - f.x = points[i].x; - f.y = points[i].y; - Vector3 fn; - fn.x = points[(i + 1) % points.size()].x; - fn.y = points[(i + 1) % points.size()].y; - center += f; - - lines.push_back(f); - lines.push_back(fn); - } - - center /= points.size(); - lines.push_back(center); - lines.push_back(center + Vector3(0, 0, 1)); - - add_lines(lines, EditorSpatialGizmos::singleton->portal_material); - add_collision_segments(lines); -} - -PortalSpatialGizmo::PortalSpatialGizmo(Portal *p_portal) { - - set_spatial_node(p_portal); - portal = p_portal; -} - -#endif ///// RayCastSpatialGizmoPlugin::RayCastSpatialGizmoPlugin() { diff --git a/editor/spatial_editor_gizmos.h b/editor/spatial_editor_gizmos.h index 1d6801a136..81b62981ac 100644 --- a/editor/spatial_editor_gizmos.h +++ b/editor/spatial_editor_gizmos.h @@ -160,19 +160,6 @@ public: PhysicalBoneSpatialGizmoPlugin(); }; -#if 0 -class PortalSpatialGizmo : public EditorSpatialGizmo { - - GDCLASS(PortalSpatialGizmo, EditorSpatialGizmo); - - Portal *portal; - -public: - void redraw(); - PortalSpatialGizmo(Portal *p_portal = NULL); -}; -#endif - class RayCastSpatialGizmoPlugin : public EditorSpatialGizmoPlugin { GDCLASS(RayCastSpatialGizmoPlugin, EditorSpatialGizmoPlugin); |