aboutsummaryrefslogtreecommitdiff
path: root/tools/editor/editor_node.cpp
diff options
context:
space:
mode:
authorJuan Linietsky2014-11-02 11:31:01 -0300
committerJuan Linietsky2014-11-02 11:31:01 -0300
commitd85b67be53bac252c0a28b799d56d1b359c4ee99 (patch)
tree5227e145e3271bfee542bdd3e4237c3378565306 /tools/editor/editor_node.cpp
parent738eb2c1a88d441eacc4149ce8f1c12a90267191 (diff)
downloadgodot-d85b67be53bac252c0a28b799d56d1b359c4ee99.tar.gz
godot-d85b67be53bac252c0a28b799d56d1b359c4ee99.tar.zst
godot-d85b67be53bac252c0a28b799d56d1b359c4ee99.zip
Bug Fixes
-=-=-=-=- -Fixed problem with scaling shapes (#827), related to not taking scale in consideration for calculating the moment of inertia -Added support for multiline strings (or comments) using """ -Save subscene bug, properties not being saved in root node (#806) -Fix Crash in CollisionPolygon2DEditor (#814) -Restored Ability to compile without 3D (#795) -Fix InterpolatedCamera (#803) -Fix UV Import for OBJ Meshes (#771) -Fixed issue with modifier gizmos (#794) -Fixed CapsuleShape gizmo handle (#50) -Fixed Import Button (not properly working in 3D) (#733) -Many misc fixes (though no new features)
Diffstat (limited to 'tools/editor/editor_node.cpp')
-rw-r--r--tools/editor/editor_node.cpp47
1 files changed, 45 insertions, 2 deletions
diff --git a/tools/editor/editor_node.cpp b/tools/editor/editor_node.cpp
index 701704fbf..b23f6c276 100644
--- a/tools/editor/editor_node.cpp
+++ b/tools/editor/editor_node.cpp
@@ -1310,6 +1310,8 @@ void EditorNode::_edit_current() {
p->add_item("Copy Params",OBJECT_COPY_PARAMS);
p->add_item("Set Params",OBJECT_PASTE_PARAMS);
p->add_separator();
+ p->add_item("Make Resources Unique",OBJECT_UNIQUE_RESOURCES);
+ p->add_separator();
p->add_icon_item(gui_base->get_icon("Help","EditorIcons"),"Class Reference",OBJECT_REQUEST_HELP);
List<MethodInfo> methods;
current_obj->get_method_list(&methods);
@@ -2023,6 +2025,47 @@ void EditorNode::_menu_option_confirm(int p_option,bool p_confirmed) {
editor_data.paste_object_params(current);
editor_data.get_undo_redo().clear_history();
} break;
+ case OBJECT_UNIQUE_RESOURCES: {
+
+ editor_data.apply_changes_in_editors();;
+ if (current) {
+ List<PropertyInfo> props;
+ current->get_property_list(&props);
+ Map<RES,RES> duplicates;
+ for (List<PropertyInfo>::Element *E=props.front();E;E=E->next()) {
+
+ if (!(E->get().usage&PROPERTY_USAGE_STORAGE))
+ continue;
+
+ Variant v = current->get(E->get().name);
+ if (v.is_ref()) {
+ REF ref = v;
+ if (ref.is_valid()) {
+
+ RES res = ref;
+ if (res.is_valid()) {
+
+ if (!duplicates.has(res)) {
+ duplicates[res]=res->duplicate();
+ }
+ res=duplicates[res];
+
+ current->set(E->get().name,res);
+ }
+
+ }
+ }
+
+ }
+ }
+
+ editor_data.get_undo_redo().clear_history();
+ if (editor_plugin_screen) { //reload editor plugin
+ editor_plugin_over->edit(NULL);
+ editor_plugin_over->edit(current);
+ }
+
+ } break;
case OBJECT_CALL_METHOD: {
editor_data.apply_changes_in_editors();;
@@ -3950,8 +3993,8 @@ EditorNode::EditorNode() {
Ref<EditorSceneImportPlugin> _scene_import = memnew(EditorSceneImportPlugin(this) );
Ref<EditorSceneImporterCollada> _collada_import = memnew( EditorSceneImporterCollada);
_scene_import->add_importer(_collada_import);
- Ref<EditorSceneImporterFBXConv> _fbxconv_import = memnew( EditorSceneImporterFBXConv);
- _scene_import->add_importer(_fbxconv_import);
+// Ref<EditorSceneImporterFBXConv> _fbxconv_import = memnew( EditorSceneImporterFBXConv);
+// _scene_import->add_importer(_fbxconv_import);
editor_import_export->add_import_plugin( _scene_import);
editor_import_export->add_import_plugin( Ref<EditorSceneAnimationImportPlugin>( memnew(EditorSceneAnimationImportPlugin(this))));
editor_import_export->add_import_plugin( Ref<EditorMeshImportPlugin>( memnew(EditorMeshImportPlugin(this))));