Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorGaia Clary <gaia.clary@machinimatrix.org>2013-02-08 23:52:02 +0400
committerGaia Clary <gaia.clary@machinimatrix.org>2013-02-08 23:52:02 +0400
commitdeeeaed3d858cf8be7d9fba294e96db3778aa587 (patch)
tree8bf255c5f1451a4920f62c79f1a76964cd4f90b4 /source
parentd26c06312138d9032f8534282af5ba2a1cad0089 (diff)
[#33955] Collada Model Import Hangs Blender. Optimized Object import for better performance. Added logging messages
Diffstat (limited to 'source')
-rw-r--r--source/blender/collada/DocumentImporter.cpp18
-rw-r--r--source/blender/collada/collada_utils.cpp3
2 files changed, 19 insertions, 2 deletions
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index da19fe11783..835812fddbb 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -76,6 +76,9 @@ extern "C" {
#include "MEM_guardedalloc.h"
+#include "WM_api.h"
+#include "WM_types.h"
+
}
#include "ExtraHandler.h"
@@ -207,6 +210,12 @@ void DocumentImporter::finish()
for (unsigned int i = 0; i < roots.getCount(); i++) {
write_node(roots[i], NULL, sce, NULL, false);
}
+
+ Main *bmain = CTX_data_main(mContext);
+ DAG_scene_sort(bmain, sce);
+ DAG_ids_flush_update(bmain, 0);
+ WM_event_add_notifier(mContext, NC_OBJECT | ND_TRANSFORM, NULL);
+
}
@@ -424,9 +433,16 @@ void DocumentImporter::write_node(COLLADAFW::Node *node, COLLADAFW::Node *parent
Object *ob = NULL;
bool is_joint = node->getType() == COLLADAFW::Node::JOINT;
bool read_transform = true;
+ std::string id = node->getOriginalId();
+ std::string name = node->getName();
std::vector<Object *> *objects_done = new std::vector<Object *>();
+ fprintf(stderr,
+ "Writing node id='%s', name='%s'\n",
+ id.c_str(),
+ name.c_str());
+
if (is_joint) {
armature_importer.add_joint(node, parent_node == NULL || parent_node->getType() != COLLADAFW::Node::JOINT, par, sce);
}
@@ -449,8 +465,6 @@ void DocumentImporter::write_node(COLLADAFW::Node *node, COLLADAFW::Node *parent
ob = mesh_importer.create_mesh_object(node, geom[geom_done], false, uid_material_map,
material_texture_mapping_map);
if (ob == NULL) {
- std::string id = node->getOriginalId();
- std::string name = node->getName();
fprintf(stderr,
"<node id=\"%s\", name=\"%s\" >...contains a reference to an unknown instance_mesh.\n",
id.c_str(),
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp
index 58e6301a084..9fdca048177 100644
--- a/source/blender/collada/collada_utils.cpp
+++ b/source/blender/collada/collada_utils.cpp
@@ -116,9 +116,12 @@ int bc_set_parent(Object *ob, Object *par, bContext *C, bool is_parent_space)
ob->recalc |= OB_RECALC_OB | OB_RECALC_DATA;
par->recalc |= OB_RECALC_OB;
+ /** done once after import
DAG_scene_sort(bmain, sce);
DAG_ids_flush_update(bmain, 0);
WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, NULL);
+ */
+
return true;
}