diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2019-05-22 22:33:50 +0300 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2019-05-22 22:34:43 +0300 |
commit | b471e48c305b6fdee69a862b50547a59dd368c4d (patch) | |
tree | a59adcdd1cf3b89c770254f4bc1375b554f001ed /source/blender | |
parent | 8fdbd1377e53144d62148d3e5e8277e467bed1a7 (diff) |
fix T64873 collada export crashes Blender on Mac
Diffstat (limited to 'source/blender')
-rw-r--r-- | source/blender/collada/AnimationExporter.cpp | 4 | ||||
-rw-r--r-- | source/blender/collada/collada_utils.cpp | 13 | ||||
-rw-r--r-- | source/blender/collada/collada_utils.h | 2 |
3 files changed, 10 insertions, 9 deletions
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, |