diff options
Diffstat (limited to 'editor')
-rw-r--r-- | editor/editor_properties.cpp | 10 | ||||
-rw-r--r-- | editor/editor_properties.h | 2 | ||||
-rw-r--r-- | editor/import/editor_import_collada.cpp | 2 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.cpp | 34 | ||||
-rw-r--r-- | editor/import/resource_importer_scene.h | 2 |
5 files changed, 32 insertions, 18 deletions
diff --git a/editor/editor_properties.cpp b/editor/editor_properties.cpp index c5c78b2590..6eba9a9b67 100644 --- a/editor/editor_properties.cpp +++ b/editor/editor_properties.cpp @@ -2102,12 +2102,18 @@ void EditorPropertyResource::_menu_option(int p_which) { } } -void EditorPropertyResource::_resource_preview(const String &p_path, const Ref<Texture> &p_preview, ObjectID p_obj) { +void EditorPropertyResource::_resource_preview(const String &p_path, const Ref<Texture> &p_preview, const Ref<Texture> &p_small_preview, ObjectID p_obj) { RES p = get_edited_object()->get(get_edited_property()); if (p.is_valid() && p->get_instance_id() == p_obj) { + String type = p->get_class_name(); + + if (ClassDB::is_parent_class(type, "Script")) { + assign->set_text(p->get_path().get_file()); + return; + } + if (p_preview.is_valid()) { - String type = p->get_class_name(); preview->set_margin(MARGIN_LEFT, assign->get_icon()->get_width() + assign->get_stylebox("normal")->get_default_margin(MARGIN_LEFT) + get_constant("hseparation", "Button")); if (type == "GradientTexture") { preview->set_stretch_mode(TextureRect::STRETCH_SCALE); diff --git a/editor/editor_properties.h b/editor/editor_properties.h index 18e70345aa..35d8f4d306 100644 --- a/editor/editor_properties.h +++ b/editor/editor_properties.h @@ -548,7 +548,7 @@ class EditorPropertyResource : public EditorProperty { void _file_selected(const String &p_path); void _menu_option(int p_which); - void _resource_preview(const String &p_path, const Ref<Texture> &p_preview, ObjectID p_obj); + void _resource_preview(const String &p_path, const Ref<Texture> &p_preview, const Ref<Texture> &p_small_preview, ObjectID p_obj); void _resource_selected(); void _viewport_selected(const NodePath &p_path); diff --git a/editor/import/editor_import_collada.cpp b/editor/import/editor_import_collada.cpp index 60ca66e464..e8bb772a64 100644 --- a/editor/import/editor_import_collada.cpp +++ b/editor/import/editor_import_collada.cpp @@ -321,7 +321,7 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { } else { //mesh since nothing else node = memnew(MeshInstance); - Object::cast_to<MeshInstance>(node)->set_flag(GeometryInstance::FLAG_USE_BAKED_LIGHT, true); + //Object::cast_to<MeshInstance>(node)->set_flag(GeometryInstance::FLAG_USE_BAKED_LIGHT, true); } } break; case Collada::Node::TYPE_SKELETON: { diff --git a/editor/import/resource_importer_scene.cpp b/editor/import/resource_importer_scene.cpp index 6d72cb4909..c5a5980fc1 100644 --- a/editor/import/resource_importer_scene.cpp +++ b/editor/import/resource_importer_scene.cpp @@ -365,29 +365,37 @@ Node *ResourceImporterScene::_fix_node(Node *p_node, Node *p_root, Map<Ref<Array return p_node; MeshInstance *mi = Object::cast_to<MeshInstance>(p_node); if (mi) { - Node *col; + Node *col = NULL; if (_teststr(name, "colonly")) { col = mi->create_trimesh_collision_node(); - ERR_FAIL_COND_V(!col, NULL); + if (col == NULL) { + ERR_PRINTS("Error generating collision for mesh: " + name); + } else { - col->set_name(_fixstr(name, "colonly")); + col->set_name(_fixstr(name, "colonly")); + } } else { col = mi->create_convex_collision_node(); - ERR_FAIL_COND_V(!col, NULL); + if (col == NULL) { + ERR_PRINTS("Error generating collision for mesh: " + name); + } else { - col->set_name(_fixstr(name, "convcolonly")); + col->set_name(_fixstr(name, "convcolonly")); + } } - Object::cast_to<Spatial>(col)->set_transform(mi->get_transform()); - p_node->replace_by(col); - memdelete(p_node); - p_node = col; + if (col) { + Object::cast_to<Spatial>(col)->set_transform(mi->get_transform()); + p_node->replace_by(col); + memdelete(p_node); + p_node = col; - StaticBody *sb = Object::cast_to<StaticBody>(col); - CollisionShape *colshape = Object::cast_to<CollisionShape>(sb->get_child(0)); - colshape->set_name("shape"); - colshape->set_owner(p_node->get_owner()); + StaticBody *sb = Object::cast_to<StaticBody>(col); + CollisionShape *colshape = Object::cast_to<CollisionShape>(sb->get_child(0)); + colshape->set_name("shape"); + colshape->set_owner(p_node->get_owner()); + } } else if (p_node->has_meta("empty_draw_type")) { String empty_draw_type = String(p_node->get_meta("empty_draw_type")); StaticBody *sb = memnew(StaticBody); diff --git a/editor/import/resource_importer_scene.h b/editor/import/resource_importer_scene.h index b046e2e975..b81a52ab70 100644 --- a/editor/import/resource_importer_scene.h +++ b/editor/import/resource_importer_scene.h @@ -116,7 +116,7 @@ class ResourceImporterScene : public ResourceImporter { enum LightBakeMode { LIGHT_BAKE_DISABLED, LIGHT_BAKE_ENABLE, - //LIGHT_BAKE_LIGHTMAPS + LIGHT_BAKE_LIGHTMAPS }; void _replace_owner(Node *p_node, Node *p_scene, Node *p_new_owner); |