Index: source/blender/makesrna/intern/rna_scene_api.c =================================================================== --- source/blender/makesrna/intern/rna_scene_api.c (revision 46936) +++ source/blender/makesrna/intern/rna_scene_api.c (working copy) @@ -85,9 +85,15 @@ /* don't remove this, as COLLADA exporting cannot be done through operators in render() callback. */ #include "../../collada/collada.h" -static void rna_Scene_collada_export(Scene *scene, const char *filepath, int selected, int apply_modifiers, int second_life) +static void rna_Scene_collada_export( + Scene *scene, + const char *filepath, + int selected, + int apply_modifiers, + int include_bone_attachments, + int second_life) { - collada_export(scene, filepath, selected, apply_modifiers, second_life); + collada_export(scene, filepath, selected, apply_modifiers, include_bone_attachments, second_life); } #endif @@ -117,6 +123,7 @@ RNA_def_property_subtype(parm, PROP_FILEPATH); /* allow non utf8 */ parm = RNA_def_boolean(func, "selected", 0, "Selection Only", "Export only selected elements"); parm = RNA_def_boolean(func, "apply_modifiers", 0, "Apply Modifiers", "Apply modifiers (in Preview resolution)"); + parm = RNA_def_boolean(func, "include_bone_attachments", 0, "Include Bone Attachments", "Include all objects attached to bones of selected Armature(s)"); parm = RNA_def_boolean(func, "second_life", 0, "Export for Second Life", "Compatibility mode for Second Life"); RNA_def_function_ui_description(func, "Export to collada file"); #endif Index: source/blender/windowmanager/intern/wm_operators.c =================================================================== --- source/blender/windowmanager/intern/wm_operators.c (revision 46936) +++ source/blender/windowmanager/intern/wm_operators.c (working copy) @@ -2155,7 +2155,7 @@ static int wm_collada_export_exec(bContext *C, wmOperator *op) { char filename[FILE_MAX]; - int selected, second_life, apply_modifiers; + int selected, second_life, apply_modifiers, include_bone_attachments; if (!RNA_struct_property_is_set(op->ptr, "filepath")) { BKE_report(op->reports, RPT_ERROR, "No filename given"); @@ -2165,14 +2165,22 @@ RNA_string_get(op->ptr, "filepath", filename); /* Options panel */ - selected = RNA_boolean_get(op->ptr, "selected"); - second_life = RNA_boolean_get(op->ptr, "second_life"); - apply_modifiers = RNA_boolean_get(op->ptr, "apply_modifiers"); + selected = RNA_boolean_get(op->ptr, "selected"); + apply_modifiers = RNA_boolean_get(op->ptr, "apply_modifiers"); + include_bone_attachments = RNA_boolean_get(op->ptr, "include_bone_attachments"); + second_life = RNA_boolean_get(op->ptr, "second_life"); + /* get editmode results */ ED_object_exit_editmode(C, 0); /* 0 = does not exit editmode */ - if (collada_export(CTX_data_scene(C), filename, selected, apply_modifiers, second_life)) { + if (collada_export( + CTX_data_scene(C), + filename, + selected, + apply_modifiers, + include_bone_attachments, + second_life)) { return OPERATOR_FINISHED; } else { @@ -2193,10 +2201,16 @@ ot->flag |= OPTYPE_PRESET; WM_operator_properties_filesel(ot, FOLDERFILE | COLLADAFILE, FILE_BLENDER, FILE_SAVE, WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY); + RNA_def_boolean(ot->srna, "selected", 0, "Selection Only", "Export only selected elements"); + RNA_def_boolean(ot->srna, "apply_modifiers", 0, "Apply Modifiers", "Apply modifiers (Preview Resolution)"); + + RNA_def_boolean(ot->srna, "include_bone_attachments", 0, "Include Bone Attachments", + "Include all objects attached to bones of selected Armature(s)"); + RNA_def_boolean(ot->srna, "second_life", 0, "Export for Second Life", "Compatibility mode for Second Life"); } Index: source/blender/collada/SceneExporter.cpp =================================================================== --- source/blender/collada/SceneExporter.cpp (revision 46936) +++ source/blender/collada/SceneExporter.cpp (working copy) @@ -79,25 +79,28 @@ bool is_skinned_mesh = arm_exporter->is_skinned_mesh(ob); std::list child_objects; - // list child objects - Base *b = (Base*) sce->base.first; - while (b) { - // cob - child object - Object *cob = b->object; - if (cob->parent == ob) { - switch (cob->type) { - case OB_MESH: - case OB_CAMERA: - case OB_LAMP: - case OB_EMPTY: - case OB_ARMATURE: - child_objects.push_back(cob); - break; + if (this->export_settings->include_bone_attachments) { + // list child objects + Base *b = (Base*) sce->base.first; + while (b) { + // cob - child object + Object *cob = b->object; + + if (cob->parent == ob) { + switch (cob->type) { + case OB_MESH: + case OB_CAMERA: + case OB_LAMP: + case OB_EMPTY: + case OB_ARMATURE: + child_objects.push_back(cob); + break; + } } + + b = b->next; } - - b = b->next; } Index: source/blender/collada/ExportSettings.h =================================================================== --- source/blender/collada/ExportSettings.h (revision 46936) +++ source/blender/collada/ExportSettings.h (working copy) @@ -32,6 +32,7 @@ public: bool selected; bool apply_modifiers; + bool include_bone_attachments; bool second_life; char *filepath; }; Index: source/blender/collada/collada.cpp =================================================================== --- source/blender/collada/collada.cpp (revision 46936) +++ source/blender/collada/collada.cpp (working copy) @@ -49,14 +49,21 @@ return 0; } - int collada_export(Scene *sce, const char *filepath, int selected, int apply_modifiers, int second_life) + int collada_export( + Scene *sce, + const char *filepath, + int selected, + int apply_modifiers, + int include_bone_attachments, + int second_life) { ExportSettings export_settings; - export_settings.selected = selected != 0; - export_settings.apply_modifiers = apply_modifiers != 0; - export_settings.second_life = second_life != 0; - export_settings.filepath = (char *)filepath; + export_settings.selected = selected != 0; + export_settings.apply_modifiers = apply_modifiers != 0; + export_settings.include_bone_attachments = include_bone_attachments != 0; + export_settings.second_life = second_life != 0; + export_settings.filepath = (char *)filepath; /* annoying, collada crashes if file cant be created! [#27162] */ if (!BLI_exists(filepath)) { Index: source/blender/collada/collada.h =================================================================== --- source/blender/collada/collada.h (revision 46936) +++ source/blender/collada/collada.h (working copy) @@ -37,7 +37,13 @@ * both return 1 on success, 0 on error */ int collada_import(bContext *C, const char *filepath); - int collada_export(Scene *sce, const char *filepath, int selected, int apply_modifiers, int second_life); + int collada_export( + Scene *sce, + const char *filepath, + int selected, + int apply_modifiers, + int include_bone_attachments, + int second_life); #ifdef __cplusplus } #endif