[Bf-blender-cvs] [b471e48c305] master: fix T64873 collada export crashes Blender on Mac

Gaia Clary noreply at git.blender.org
Wed May 22 21:55:16 CEST 2019


Commit: b471e48c305b6fdee69a862b50547a59dd368c4d
Author: Gaia Clary
Date:   Wed May 22 21:33:50 2019 +0200
Branches: master
https://developer.blender.org/rBb471e48c305b6fdee69a862b50547a59dd368c4d

fix T64873 collada export crashes Blender on Mac

===================================================================

M	source/blender/collada/AnimationExporter.cpp
M	source/blender/collada/collada_utils.cpp
M	source/blender/collada/collada_utils.h

===================================================================

diff --git a/source/blender/collada/AnimationExporter.cpp b/source/blender/collada/AnimationExporter.cpp
index a34f92f66d6..eaa1626f7d8 100644
--- a/source/blender/collada/AnimationExporter.cpp
+++ b/source/blender/collada/AnimationExporter.cpp
@@ -79,13 +79,13 @@ bool AnimationExporter::exportAnimations()
 {
   Scene *sce = blender_context.get_scene();
 
-  LinkNode &export_set = *this->export_settings->export_set;
+  LinkNode *export_set = this->export_settings->export_set;
   bool has_anim_data = bc_has_animations(sce, export_set);
   int animation_count = 0;
   if (has_anim_data) {
 
     BCObjectSet animated_subset;
-    BCAnimationSampler::get_animated_from_export_set(animated_subset, export_set);
+    BCAnimationSampler::get_animated_from_export_set(animated_subset, *export_set);
     animation_count = animated_subset.size();
     BCAnimationSampler animation_sampler(blender_context, animated_subset);
 
diff --git a/source/blender/collada/collada_utils.cpp b/source/blender/collada/collada_utils.cpp
index 9f2d3f951ec..c0e3ab2ca47 100644
--- a/source/blender/collada/collada_utils.cpp
+++ b/source/blender/collada/collada_utils.cpp
@@ -1026,15 +1026,16 @@ bool bc_has_animations(Object *ob)
   return false;
 }
 
-bool bc_has_animations(Scene *sce, LinkNode &export_set)
+bool bc_has_animations(Scene *sce, LinkNode *export_set)
 {
   LinkNode *node;
+  if (export_set) {
+    for (node = export_set; node; node = node->next) {
+      Object *ob = (Object *)node->link;
 
-  for (node = &export_set; node; node = node->next) {
-    Object *ob = (Object *)node->link;
-
-    if (bc_has_animations(ob))
-      return true;
+      if (bc_has_animations(ob))
+        return true;
+    }
   }
   return false;
 }
diff --git a/source/blender/collada/collada_utils.h b/source/blender/collada/collada_utils.h
index dfd5519be31..522aeb1ad1e 100644
--- a/source/blender/collada/collada_utils.h
+++ b/source/blender/collada/collada_utils.h
@@ -235,7 +235,7 @@ extern bool bc_get_property_matrix(Bone *bone, std::string key, float mat[4][4])
 extern void bc_enable_fcurves(bAction *act, char *bone_name);
 extern bool bc_bone_matrix_local_get(Object *ob, Bone *bone, Matrix &mat, bool for_opensim);
 extern bool bc_is_animated(BCMatrixSampleMap &values);
-extern bool bc_has_animations(Scene *sce, LinkNode &node);
+extern bool bc_has_animations(Scene *sce, LinkNode *node);
 extern bool bc_has_animations(Object *ob);
 
 extern void bc_create_restpose_mat(const ExportSettings *export_settings,



More information about the Bf-blender-cvs mailing list