diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-06 16:50:24 +0300 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2018-06-06 16:50:24 +0300 |
commit | 48e871ab1d57ef2e95047b2be5718cee5d3cefe6 (patch) | |
tree | 65088effec7dac68ea72fe2ae60e32df544d99a6 /source/blender/collada/ArmatureExporter.cpp | |
parent | bfbd85e9d66be3793e51ef989f793bdd69214493 (diff) |
Cleanup: Nuke moar G.main usages...
Diffstat (limited to 'source/blender/collada/ArmatureExporter.cpp')
-rw-r--r-- | source/blender/collada/ArmatureExporter.cpp | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/source/blender/collada/ArmatureExporter.cpp b/source/blender/collada/ArmatureExporter.cpp index 92ec8b470a8..9afe4662f74 100644 --- a/source/blender/collada/ArmatureExporter.cpp +++ b/source/blender/collada/ArmatureExporter.cpp @@ -62,10 +62,11 @@ ArmatureExporter::ArmatureExporter(COLLADASW::StreamWriter *sw, const ExportSett } // write bone nodes -void ArmatureExporter::add_armature_bones(Object *ob_arm, Scene *sce, +void ArmatureExporter::add_armature_bones(bContext *C, Object *ob_arm, Scene *sce, SceneExporter *se, std::list<Object *>& child_objects) { + Main *bmain = CTX_data_main(C); // write bone nodes bArmature * armature = (bArmature *)ob_arm->data; @@ -77,11 +78,11 @@ void ArmatureExporter::add_armature_bones(Object *ob_arm, Scene *sce, for (Bone *bone = (Bone *)armature->bonebase.first; bone; bone = bone->next) { // start from root bones if (!bone->parent) - add_bone_node(bone, ob_arm, sce, se, child_objects); + add_bone_node(C, bone, ob_arm, sce, se, child_objects); } if (!is_edited) { - ED_armature_from_edit(armature); + ED_armature_from_edit(bmain, armature); ED_armature_edit_free(armature); } } @@ -160,7 +161,7 @@ void ArmatureExporter::find_objects_using_armature(Object *ob_arm, std::vector<O #endif // parent_mat is armature-space -void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene *sce, +void ArmatureExporter::add_bone_node(bContext *C, Bone *bone, Object *ob_arm, Scene *sce, SceneExporter *se, std::list<Object *>& child_objects) { @@ -234,7 +235,7 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene *sce, mul_m4_m4m4((*i)->parentinv, temp, (*i)->parentinv); } - se->writeNodes(*i, sce); + se->writeNodes(C, *i, sce); copy_m4_m4((*i)->parentinv, backup_parinv); child_objects.erase(i++); @@ -243,13 +244,13 @@ void ArmatureExporter::add_bone_node(Bone *bone, Object *ob_arm, Scene *sce, } for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) { - add_bone_node(child, ob_arm, sce, se, child_objects); + add_bone_node(C, child, ob_arm, sce, se, child_objects); } node.end(); } else { for (Bone *child = (Bone *)bone->childbase.first; child; child = child->next) { - add_bone_node(child, ob_arm, sce, se, child_objects); + add_bone_node(C, child, ob_arm, sce, se, child_objects); } } } |