diff options
| author | Juan Linietsky | 2014-06-27 23:21:45 -0300 |
|---|---|---|
| committer | Juan Linietsky | 2014-06-27 23:21:45 -0300 |
| commit | 2af2a84a03fd707cfa4c682aff34d722343d8985 (patch) | |
| tree | 50d064e8bba7d5efb5974e3fa3a67e076fb5ef8b /tools/editor/io_plugins | |
| parent | 1cc96a4d7440d9e8a20f7dbf17cf5771170de83d (diff) | |
| download | godot-2af2a84a03fd707cfa4c682aff34d722343d8985.tar.gz godot-2af2a84a03fd707cfa4c682aff34d722343d8985.tar.zst godot-2af2a84a03fd707cfa4c682aff34d722343d8985.zip | |
Misc Fixes
==========
-NOTIFICATION_WM_QUIT fixed on android (seems tha way this is reported changed in newer sdk)
-WIP implementation of APK Expansion APIs for publishing games larger than 50mb in Play Store
-Feaures in the new tutorials are all present in the sourcecode
-This (hopefully) should get rid of the animation list order getting corrupted
-Improved 3D Scene Importer (Skeletons, Animations and other stuff were not being merged). Anything missing?
-In code editor, the automatic syntax checker will only use file_exists() to check preload() else it might freeze the editor too much while typing if the preload is a big resource
-Fixed bugs in PolygonPathFinder, stil pending to do a node and a demo
Diffstat (limited to 'tools/editor/io_plugins')
| -rw-r--r-- | tools/editor/io_plugins/editor_import_collada.cpp | 8 | ||||
| -rw-r--r-- | tools/editor/io_plugins/editor_scene_import_plugin.cpp | 47 |
2 files changed, 43 insertions, 12 deletions
diff --git a/tools/editor/io_plugins/editor_import_collada.cpp b/tools/editor/io_plugins/editor_import_collada.cpp index 6cd6170bb..5b4f9960a 100644 --- a/tools/editor/io_plugins/editor_import_collada.cpp +++ b/tools/editor/io_plugins/editor_import_collada.cpp @@ -199,7 +199,7 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { return OK; //well, it's an ambient light.. Light *l = memnew( DirectionalLight ); - l->set_color(Light::COLOR_AMBIENT,ld.color); +// l->set_color(Light::COLOR_AMBIENT,ld.color); l->set_color(Light::COLOR_DIFFUSE,Color(0,0,0)); l->set_color(Light::COLOR_SPECULAR,Color(0,0,0)); node = l; @@ -208,8 +208,8 @@ Error ColladaImport::_create_scene(Collada::Node *p_node, Spatial *p_parent) { //well, it's an ambient light.. Light *l = memnew( DirectionalLight ); - if (found_ambient) //use it here - l->set_color(Light::COLOR_AMBIENT,ambient); + //if (found_ambient) //use it here + // l->set_color(Light::COLOR_AMBIENT,ambient); l->set_color(Light::COLOR_DIFFUSE,ld.color); l->set_color(Light::COLOR_SPECULAR,Color(1,1,1)); @@ -661,7 +661,7 @@ Error ColladaImport::_create_mesh_surfaces(Ref<Mesh>& p_mesh,const Map<String,Co const Collada::MeshData::Source *color_src=NULL; int color_ofs=0; - if (false && p.sources.has("COLOR")) { + if (p.sources.has("COLOR")) { String color_source_id = p.sources["COLOR"].source; color_ofs = p.sources["COLOR"].offset; diff --git a/tools/editor/io_plugins/editor_scene_import_plugin.cpp b/tools/editor/io_plugins/editor_scene_import_plugin.cpp index 78280c32f..0b7ffd55f 100644 --- a/tools/editor/io_plugins/editor_scene_import_plugin.cpp +++ b/tools/editor/io_plugins/editor_scene_import_plugin.cpp @@ -173,7 +173,7 @@ public: static const char *anim_flag_names[]={ - "Detect Loop", + "Detect Loop (-loop,-cycle)", "Keep Value Tracks", "Optimize", NULL @@ -680,7 +680,7 @@ EditorSceneImportDialog::EditorSceneImportDialog(EditorNode *p_editor, EditorSce import_choose->connect("pressed", this,"_browse"); hbc = memnew( HBoxContainer ); - vbc->add_margin_child("Target Scene:",hbc); + vbc->add_margin_child("Target Path:",hbc); save_path = memnew( LineEdit ); save_path->set_h_size_flags(SIZE_EXPAND_FILL); @@ -1024,7 +1024,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> if (fm.is_valid()) { fm->set_flag(Material::FLAG_UNSHADED,true); fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); - fm->set_hint(Material::HINT_NO_DEPTH_DRAW,true); + fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); fm->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true); } } @@ -1129,7 +1129,7 @@ Node* EditorSceneImportPlugin::_fix_node(Node *p_node,Node *p_root,Map<Ref<Mesh> if (fm.is_valid()) { fm->set_flag(Material::FLAG_UNSHADED,true); fm->set_flag(Material::FLAG_DOUBLE_SIDED,true); - fm->set_hint(Material::HINT_NO_DEPTH_DRAW,true); + fm->set_depth_draw_mode(Material::DEPTH_DRAW_NEVER); fm->set_fixed_flag(FixedMaterial::FLAG_USE_ALPHA,true); } } @@ -1501,6 +1501,37 @@ void EditorSceneImportPlugin::_merge_existing_node(Node *p_node,Node *p_imported room_node->set_room( room_imported->get_room() ); + } else if (p_node->get_type()=="Skeleton") { + //for paths, overwrite path + + Skeleton *skeleton_imported =imported_node->cast_to<Skeleton>(); + Skeleton *skeleton_node =p_node->cast_to<Skeleton>(); + + //use imported bones, obviously + skeleton_node->clear_bones(); + for(int i=0;i<skeleton_imported->get_bone_count();i++) { + + skeleton_node->add_bone(skeleton_imported->get_bone_name(i)); + skeleton_node->set_bone_parent(i,skeleton_imported->get_bone_parent(i)); + skeleton_node->set_bone_rest(i,skeleton_imported->get_bone_rest(i)); + skeleton_node->set_bone_pose(i,skeleton_imported->get_bone_pose(i)); + } + } else if (p_node->get_type()=="AnimationPlayer") { + //for paths, overwrite path + + AnimationPlayer *aplayer_imported =imported_node->cast_to<AnimationPlayer>(); + AnimationPlayer *aplayer_node =p_node->cast_to<AnimationPlayer>(); + + //use imported bones, obviously + List<StringName> anims; + aplayer_imported->get_animation_list(&anims); + //use imported animations, could merge some stuff though + for (List<StringName>::Element *E=anims.front();E;E=E->next()) { + + + aplayer_node->add_animation(E->get(),aplayer_imported->get_animation(E->get())); + } + } else if (p_node->get_type()=="CollisionShape") { //for paths, overwrite path @@ -1877,14 +1908,14 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c if (merge) { - print_line("MERGING?????"); + progress.step("Merging..",103); FileAccess *fa = FileAccess::create(FileAccess::ACCESS_RESOURCES); - print_line("OPEN IN FS: "+p_dest_path); + if (fa->file_exists(p_dest_path)) { - print_line("TRY REALLY TO MERGE?"); + //try to merge Ref<PackedScene> s = ResourceLoader::load(p_dest_path); @@ -1915,7 +1946,7 @@ Error EditorSceneImportPlugin::import2(Node *scene, const String& p_dest_path, c packer->set_import_metadata(from); print_line("SAVING TO: "+p_dest_path); - err = ResourceSaver::save(p_dest_path,packer); + err = ResourceSaver::save(p_dest_path,packer,ResourceSaver::FLAG_REPLACE_SUBRESOURCE_PATHS); //EditorFileSystem::get_singleton()->update_resource(packer); |
