Merge branch 'master' into blender2.8
[blender.git] / source / blender / editors / io / io_collada.c
1 /*
2  * ***** BEGIN GPL LICENSE BLOCK *****
3  *
4  * This program is free software; you can redistribute it and/or
5  * modify it under the terms of the GNU General Public License
6  * as published by the Free Software Foundation; either version 2
7  * of the License, or (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful,
10  * but WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
12  * GNU General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software Foundation,
16  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17  *
18  * The Original Code is Copyright (C) 2008 Blender Foundation.
19  * All rights reserved.
20  *
21  *
22  * Contributor(s): Blender Foundation
23  *
24  * ***** END GPL LICENSE BLOCK *****
25  */
26
27 /** \file blender/editors/io/io_collada.c
28  *  \ingroup collada
29  */
30 #ifdef WITH_COLLADA
31 #include "DNA_space_types.h"
32
33 #include "BLT_translation.h"
34
35 #include "BLI_blenlib.h"
36 #include "BLI_utildefines.h"
37
38 #include "BKE_context.h"
39 #include "BKE_global.h"
40 #include "BKE_main.h"
41 #include "BKE_report.h"
42 #include "BKE_object.h"
43
44 #include "DEG_depsgraph.h"
45
46 #include "ED_screen.h"
47 #include "ED_object.h"
48
49 #include "RNA_access.h"
50 #include "RNA_define.h"
51
52 #include "UI_interface.h"
53 #include "UI_resources.h"
54
55 #include "WM_api.h"
56 #include "WM_types.h"
57
58 #include "../../collada/collada.h"
59
60 #include "io_collada.h"
61
62 static int wm_collada_export_invoke(bContext *C, wmOperator *op, const wmEvent *UNUSED(event))
63 {
64         Main *bmain = CTX_data_main(C);
65
66         if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
67                 char filepath[FILE_MAX];
68                 const char *blendfile_path = BKE_main_blendfile_path(bmain);
69
70                 if (blendfile_path[0] == '\0')
71                         BLI_strncpy(filepath, "untitled", sizeof(filepath));
72                 else
73                         BLI_strncpy(filepath, blendfile_path, sizeof(filepath));
74
75                 BLI_path_extension_replace(filepath, sizeof(filepath), ".dae");
76                 RNA_string_set(op->ptr, "filepath", filepath);
77         }
78
79         WM_event_add_fileselect(C, op);
80
81         return OPERATOR_RUNNING_MODAL;
82 }
83
84 /* function used for WM_OT_save_mainfile too */
85 static int wm_collada_export_exec(bContext *C, wmOperator *op)
86 {
87         char filepath[FILE_MAX];
88         int apply_modifiers;
89         int export_mesh_type;
90         int selected;
91         int include_children;
92         int include_armatures;
93         int include_shapekeys;
94         int deform_bones_only;
95
96         int include_animations;
97         int sample_animations;
98         int sampling_rate;
99
100         int include_material_textures;
101         int use_texture_copies;
102         int active_uv_only;
103
104         int triangulate;
105         int use_object_instantiation;
106         int use_blender_profile;
107         int sort_by_name;
108         int export_transformation_type;
109
110         int open_sim;
111         int limit_precision;
112         int keep_bind_info;
113
114         int export_count;
115
116         if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
117                 BKE_report(op->reports, RPT_ERROR, "No filename given");
118                 return OPERATOR_CANCELLED;
119         }
120
121         RNA_string_get(op->ptr, "filepath", filepath);
122         BLI_path_extension_ensure(filepath, sizeof(filepath), ".dae");
123
124
125         /* Avoid File write exceptions in Collada */
126         if (!BLI_exists(filepath)) {
127                 BLI_make_existing_file(filepath);
128                 if (!BLI_file_touch(filepath)) {
129                         BKE_report(op->reports, RPT_ERROR, "Can't create export file");
130                         fprintf(stdout, "Collada export: Can not create: %s\n", filepath);
131                         return OPERATOR_CANCELLED;
132                 }
133         }
134         else if (!BLI_file_is_writable(filepath)) {
135                 BKE_report(op->reports, RPT_ERROR, "Can't overwrite export file");
136                 fprintf(stdout, "Collada export: Can not modify: %s\n", filepath);
137                 return OPERATOR_CANCELLED;
138         }
139
140         /* Now the exporter can create and write the export file */
141
142         /* Options panel */
143         apply_modifiers          = RNA_boolean_get(op->ptr, "apply_modifiers");
144         export_mesh_type         = RNA_enum_get(op->ptr,    "export_mesh_type_selection");
145         selected                 = RNA_boolean_get(op->ptr, "selected");
146         include_children         = RNA_boolean_get(op->ptr, "include_children");
147         include_armatures        = RNA_boolean_get(op->ptr, "include_armatures");
148         include_shapekeys        = RNA_boolean_get(op->ptr, "include_shapekeys");
149
150         include_animations       = RNA_boolean_get(op->ptr, "include_animations");
151         sample_animations        = RNA_boolean_get(op->ptr, "sample_animations");
152         sampling_rate            = (sample_animations) ? RNA_int_get(op->ptr, "sampling_rate") : 0;
153
154         deform_bones_only        = RNA_boolean_get(op->ptr, "deform_bones_only");
155
156         include_material_textures = RNA_boolean_get(op->ptr, "include_material_textures");
157         use_texture_copies       = RNA_boolean_get(op->ptr, "use_texture_copies");
158         active_uv_only           = RNA_boolean_get(op->ptr, "active_uv_only");
159
160         triangulate                = RNA_boolean_get(op->ptr, "triangulate");
161         use_object_instantiation   = RNA_boolean_get(op->ptr, "use_object_instantiation");
162         use_blender_profile        = RNA_boolean_get(op->ptr, "use_blender_profile");
163         sort_by_name               = RNA_boolean_get(op->ptr, "sort_by_name");
164         export_transformation_type = RNA_enum_get(op->ptr,    "export_transformation_type_selection");
165         open_sim                   = RNA_boolean_get(op->ptr, "open_sim");
166
167         limit_precision = RNA_boolean_get(op->ptr, "limit_precision");
168         keep_bind_info = RNA_boolean_get(op->ptr, "keep_bind_info");
169
170         Main *bmain = CTX_data_main(C);
171
172         /* get editmode results */
173         ED_object_editmode_load(bmain, CTX_data_edit_object(C));
174
175         Scene *scene = CTX_data_scene(C);
176
177         ExportSettings export_settings;
178
179         export_settings.filepath = filepath;
180
181         export_settings.apply_modifiers = apply_modifiers != 0;
182         export_settings.export_mesh_type = export_mesh_type;
183         export_settings.selected = selected != 0;
184         export_settings.include_children = include_children != 0;
185         export_settings.include_armatures = include_armatures != 0;
186         export_settings.include_shapekeys = include_shapekeys != 0;
187         export_settings.deform_bones_only = deform_bones_only != 0;
188         export_settings.include_animations = include_animations;
189         export_settings.sampling_rate = sampling_rate;
190
191         export_settings.active_uv_only = active_uv_only != 0;
192         export_settings.include_material_textures = include_material_textures != 0;
193         export_settings.use_texture_copies = use_texture_copies != 0;
194
195         export_settings.triangulate = triangulate != 0;
196         export_settings.use_object_instantiation = use_object_instantiation != 0;
197         export_settings.use_blender_profile = use_blender_profile != 0;
198         export_settings.sort_by_name = sort_by_name != 0;
199         export_settings.export_transformation_type = export_transformation_type;
200         export_settings.open_sim = open_sim != 0;
201         export_settings.limit_precision = limit_precision != 0;
202         export_settings.keep_bind_info = keep_bind_info != 0;
203
204         int includeFilter = OB_REL_NONE;
205         if (export_settings.include_armatures) includeFilter |= OB_REL_MOD_ARMATURE;
206         if (export_settings.include_children) includeFilter |= OB_REL_CHILDREN_RECURSIVE;
207
208         export_count = collada_export(
209                            C,
210                            CTX_data_depsgraph(C),
211                            scene,
212                            &export_settings
213         );
214
215         if (export_count == 0) {
216                 BKE_report(op->reports, RPT_WARNING, "No objects selected -- Created empty export file");
217                 return OPERATOR_CANCELLED;
218         }
219         else if (export_count < 0) {
220                 BKE_report(op->reports, RPT_WARNING, "Error during export (see Console)");
221                 return OPERATOR_CANCELLED;
222         }
223         else {
224                 char buff[100];
225                 sprintf(buff, "Exported %d Objects", export_count);
226                 BKE_report(op->reports, RPT_INFO, buff);
227                 return OPERATOR_FINISHED;
228         }
229 }
230
231 static void uiCollada_exportSettings(uiLayout *layout, PointerRNA *imfptr)
232 {
233         uiLayout *box, *row, *col, *split;
234         bool include_animations = RNA_boolean_get(imfptr, "include_animations");
235
236         /* Export Options: */
237         box = uiLayoutBox(layout);
238         row = uiLayoutRow(box, false);
239         uiItemL(row, IFACE_("Export Data Options:"), ICON_MESH_DATA);
240
241         row = uiLayoutRow(box, false);
242         split = uiLayoutSplit(row, 0.6f, UI_LAYOUT_ALIGN_RIGHT);
243         col   = uiLayoutColumn(split, false);
244         uiItemR(col, imfptr, "apply_modifiers", 0, NULL, ICON_NONE);
245         col   = uiLayoutColumn(split, false);
246         uiItemR(col, imfptr, "export_mesh_type_selection", 0, "", ICON_NONE);
247         uiLayoutSetEnabled(col, RNA_boolean_get(imfptr, "apply_modifiers"));
248
249         row = uiLayoutRow(box, false);
250         uiItemR(row, imfptr, "selected", 0, NULL, ICON_NONE);
251
252         row = uiLayoutRow(box, false);
253         uiItemR(row, imfptr, "include_children", 0, NULL, ICON_NONE);
254         uiLayoutSetEnabled(row, RNA_boolean_get(imfptr, "selected"));
255
256         row = uiLayoutRow(box, false);
257         uiItemR(row, imfptr, "include_armatures", 0, NULL, ICON_NONE);
258         uiLayoutSetEnabled(row, RNA_boolean_get(imfptr, "selected"));
259
260         row = uiLayoutRow(box, false);
261         uiItemR(row, imfptr, "include_shapekeys", 0, NULL, ICON_NONE);
262         uiLayoutSetEnabled(row, RNA_boolean_get(imfptr, "selected"));
263
264         row = uiLayoutRow(box, false);
265         uiItemR(row, imfptr, "include_animations", 0, NULL, ICON_NONE);
266         row = uiLayoutRow(box, false);
267         if (include_animations) {
268                 uiItemR(row, imfptr, "sample_animations", 0, NULL, ICON_NONE);
269                 row = uiLayoutColumn(box, false);
270                 uiItemR(row, imfptr, "sampling_rate", 0, NULL, ICON_NONE);
271                 uiLayoutSetEnabled(row, RNA_boolean_get(imfptr, "sample_animations"));
272         }
273
274         /* Texture options */
275         box = uiLayoutBox(layout);
276         row = uiLayoutRow(box, false);
277         uiItemL(row, IFACE_("Texture Options:"), ICON_TEXTURE_DATA);
278
279         row = uiLayoutRow(box, false);
280         uiItemR(row, imfptr, "active_uv_only", 0, NULL, ICON_NONE);
281
282         row = uiLayoutRow(box, false);
283         uiItemR(row, imfptr, "include_material_textures", 0, NULL, ICON_NONE);
284
285         row = uiLayoutRow(box, false);
286         uiItemR(row, imfptr, "use_texture_copies", 1, NULL, ICON_NONE);
287
288
289         /* Armature options */
290         box = uiLayoutBox(layout);
291         row = uiLayoutRow(box, false);
292         uiItemL(row, IFACE_("Armature Options:"), ICON_ARMATURE_DATA);
293
294         row = uiLayoutRow(box, false);
295         uiItemR(row, imfptr, "deform_bones_only", 0, NULL, ICON_NONE);
296
297         row = uiLayoutRow(box, false);
298         uiItemR(row, imfptr, "open_sim", 0, NULL, ICON_NONE);
299
300         /* Collada options: */
301         box = uiLayoutBox(layout);
302         row = uiLayoutRow(box, false);
303         uiItemL(row, IFACE_("Collada Options:"), ICON_MODIFIER);
304
305         row = uiLayoutRow(box, false);
306         uiItemR(row, imfptr, "triangulate", 1, NULL, ICON_NONE);
307         row = uiLayoutRow(box, false);
308         uiItemR(row, imfptr, "use_object_instantiation", 1, NULL, ICON_NONE);
309         row = uiLayoutRow(box, false);
310         uiItemR(row, imfptr, "use_blender_profile", 1, NULL, ICON_NONE);
311
312         row = uiLayoutRow(box, false);
313         split = uiLayoutSplit(row, 0.6f, UI_LAYOUT_ALIGN_RIGHT);
314         uiItemL(split, IFACE_("Transformation Type"), ICON_NONE);
315         uiItemR(split, imfptr, "export_transformation_type_selection", 0, "", ICON_NONE);
316         row = uiLayoutRow(box, false);
317         uiItemR(row, imfptr, "sort_by_name", 0, NULL, ICON_NONE);
318
319         row = uiLayoutRow(box, false);
320         uiItemR(row, imfptr, "keep_bind_info", 0, NULL, ICON_NONE);
321
322         row = uiLayoutRow(box, false);
323         uiItemR(row, imfptr, "limit_precision", 0, NULL, ICON_NONE);
324
325 }
326
327 static void wm_collada_export_draw(bContext *UNUSED(C), wmOperator *op)
328 {
329         PointerRNA ptr;
330
331         RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
332         uiCollada_exportSettings(op->layout, &ptr);
333 }
334
335 static bool wm_collada_export_check(bContext *UNUSED(C), wmOperator *op)
336 {
337         char filepath[FILE_MAX];
338         RNA_string_get(op->ptr, "filepath", filepath);
339
340         if (!BLI_path_extension_check(filepath, ".dae")) {
341                 BLI_path_extension_ensure(filepath, FILE_MAX, ".dae");
342                 RNA_string_set(op->ptr, "filepath", filepath);
343                 return true;
344         }
345
346         return false;
347 }
348
349 void WM_OT_collada_export(wmOperatorType *ot)
350 {
351         struct StructRNA *func = ot->srna;
352
353         static const EnumPropertyItem prop_bc_export_mesh_type[] = {
354                 {BC_MESH_TYPE_VIEW, "view", 0, "View", "Apply modifier's view settings"},
355                 {BC_MESH_TYPE_RENDER, "render", 0, "Render", "Apply modifier's render settings"},
356                 {0, NULL, 0, NULL, NULL}
357         };
358
359         static const EnumPropertyItem prop_bc_export_transformation_type[] = {
360                 {BC_TRANSFORMATION_TYPE_MATRIX, "matrix", 0, "Matrix", "Use <matrix> to specify transformations"},
361                 {BC_TRANSFORMATION_TYPE_TRANSROTLOC, "transrotloc", 0, "TransRotLoc", "Use <translate>, <rotate>, <scale> to specify transformations"},
362                 {0, NULL, 0, NULL, NULL}
363         };
364
365         ot->name = "Export COLLADA";
366         ot->description = "Save a Collada file";
367         ot->idname = "WM_OT_collada_export";
368
369         ot->invoke = wm_collada_export_invoke;
370         ot->exec = wm_collada_export_exec;
371         ot->poll = WM_operator_winactive;
372         ot->check = wm_collada_export_check;
373
374         ot->flag |= OPTYPE_PRESET;
375
376         ot->ui = wm_collada_export_draw;
377
378         WM_operator_properties_filesel(
379                 ot, FILE_TYPE_FOLDER | FILE_TYPE_COLLADA, FILE_BLENDER, FILE_SAVE,
380                 WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);
381
382         RNA_def_boolean(func,
383                         "apply_modifiers", 0, "Apply Modifiers",
384                         "Apply modifiers to exported mesh (non destructive))");
385
386         RNA_def_int(func, "export_mesh_type", 0, INT_MIN, INT_MAX,
387                     "Resolution", "Modifier resolution for export", INT_MIN, INT_MAX);
388
389         RNA_def_enum(func, "export_mesh_type_selection", prop_bc_export_mesh_type, 0,
390                      "Resolution", "Modifier resolution for export");
391
392         RNA_def_boolean(func, "selected", false, "Selection Only",
393                         "Export only selected elements");
394
395         RNA_def_boolean(func, "include_children", false, "Include Children",
396                         "Export all children of selected objects (even if not selected)");
397
398         RNA_def_boolean(func, "include_armatures", false, "Include Armatures",
399                         "Export related armatures (even if not selected)");
400
401         RNA_def_boolean(func, "include_shapekeys", false, "Include Shape Keys",
402                         "Export all Shape Keys from Mesh Objects");
403
404         RNA_def_boolean(func, "deform_bones_only", false, "Deform Bones only",
405                         "Only export deforming bones with armatures");
406
407         RNA_def_boolean(func, "include_animations", true,
408                 "Include Animations", "Export Animations if available.\nExporting Animations will enforce the decomposition of node transforms\ninto  <translation> <rotation> and <scale> components");
409
410         RNA_def_boolean(func, "sample_animations", 0,
411                 "Sample Animations", "Auto-generate keyframes with a frame distance set by 'Sampling Rate'.\nWhen disabled, export only the keyframes defined in the animation f-curves (may be less accurate)");
412
413         RNA_def_int(func, "sampling_rate", 1, 1, INT_MAX,
414                 "Sampling Rate", "The distance between 2 keyframes. 1 means: Every frame is keyed", 1, INT_MAX);
415
416
417         RNA_def_boolean(func, "active_uv_only", 0, "Only Selected UV Map",
418                         "Export only the selected UV Map");
419
420         RNA_def_boolean(func, "include_material_textures", 0, "Include Material Textures",
421                         "Export textures assigned to the object Materials");
422
423         RNA_def_boolean(func, "use_texture_copies", 1, "Copy",
424                         "Copy textures to same folder where the .dae file is exported");
425
426
427         RNA_def_boolean(func, "triangulate", 1, "Triangulate",
428                         "Export Polygons (Quads & NGons) as Triangles");
429
430         RNA_def_boolean(func, "use_object_instantiation", 1, "Use Object Instances",
431                 "Instantiate multiple Objects from same Data");
432
433         RNA_def_boolean(func, "use_blender_profile", 1, "Use Blender Profile",
434                 "Export additional Blender specific information (for material, shaders, bones, etc.)");
435
436         RNA_def_boolean(func, "sort_by_name", 0, "Sort by Object name",
437                         "Sort exported data by Object name");
438
439         RNA_def_int(func, "export_transformation_type", 0, INT_MIN, INT_MAX,
440                     "Transform", "Transformation type for translation, scale and rotation", INT_MIN, INT_MAX);
441
442         RNA_def_enum(func, "export_transformation_type_selection", prop_bc_export_transformation_type, 0,
443                      "Transform", "Transformation type for translation, scale and rotation");
444
445         RNA_def_boolean(func, "open_sim", 0, "Export to SL/OpenSim",
446                         "Compatibility mode for SL, OpenSim and other compatible online worlds");
447
448         RNA_def_boolean(func, "limit_precision", 0,
449                 "Limit Precision", "Reduce the precision of the exported data to 6 digits");
450
451         RNA_def_boolean(func, "keep_bind_info", 0,
452                 "Keep Bind Info", "Store Bindpose information in custom bone properties for later use during Collada export");
453
454 }
455
456
457 /* function used for WM_OT_save_mainfile too */
458 static int wm_collada_import_exec(bContext *C, wmOperator *op)
459 {
460         char filename[FILE_MAX];
461         int import_units;
462         int find_chains;
463         int auto_connect;
464         int fix_orientation;
465         int min_chain_length;
466
467         int keep_bind_info;
468         ImportSettings import_settings;
469
470         if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
471                 BKE_report(op->reports, RPT_ERROR, "No filename given");
472                 return OPERATOR_CANCELLED;
473         }
474
475         /* Options panel */
476         import_units     = RNA_boolean_get(op->ptr, "import_units");
477         find_chains      = RNA_boolean_get(op->ptr, "find_chains");
478         auto_connect     = RNA_boolean_get(op->ptr, "auto_connect");
479         fix_orientation  = RNA_boolean_get(op->ptr, "fix_orientation");
480
481         keep_bind_info = RNA_boolean_get(op->ptr, "keep_bind_info");
482
483         min_chain_length = RNA_int_get(op->ptr, "min_chain_length");
484
485         RNA_string_get(op->ptr, "filepath", filename);
486
487         import_settings.filepath = filename;
488         import_settings.import_units = import_units != 0;
489         import_settings.auto_connect = auto_connect != 0;
490         import_settings.find_chains = find_chains != 0;
491         import_settings.fix_orientation = fix_orientation != 0;
492         import_settings.min_chain_length = min_chain_length;
493         import_settings.keep_bind_info = keep_bind_info != 0;
494
495         if (collada_import(C, &import_settings)) {
496                 DEG_id_tag_update(&CTX_data_scene(C)->id, DEG_TAG_BASE_FLAGS_UPDATE);
497                 return OPERATOR_FINISHED;
498         }
499         else {
500                 BKE_report(op->reports, RPT_ERROR, "Errors found during parsing COLLADA document (see console for details)");
501                 return OPERATOR_CANCELLED;
502         }
503 }
504
505 static void uiCollada_importSettings(uiLayout *layout, PointerRNA *imfptr)
506 {
507         uiLayout *box, *row;
508
509         /* Import Options: */
510         box = uiLayoutBox(layout);
511         row = uiLayoutRow(box, false);
512         uiItemL(row, IFACE_("Import Data Options:"), ICON_MESH_DATA);
513
514         row = uiLayoutRow(box, false);
515         uiItemR(row, imfptr, "import_units", 0, NULL, ICON_NONE);
516
517         box = uiLayoutBox(layout);
518         row = uiLayoutRow(box, false);
519         uiItemL(row, IFACE_("Armature Options:"), ICON_MESH_DATA);
520
521         row = uiLayoutRow(box, false);
522         uiItemR(row, imfptr, "fix_orientation", 0, NULL, ICON_NONE);
523
524         row = uiLayoutRow(box, false);
525         uiItemR(row, imfptr, "find_chains", 0, NULL, ICON_NONE);
526
527         row = uiLayoutRow(box, false);
528         uiItemR(row, imfptr, "auto_connect", 0, NULL, ICON_NONE);
529
530         row = uiLayoutRow(box, false);
531         uiItemR(row, imfptr, "min_chain_length", 0, NULL, ICON_NONE);
532
533         box = uiLayoutBox(layout);
534         row = uiLayoutRow(box, false);
535
536         row = uiLayoutRow(box, false);
537         uiItemR(row, imfptr, "keep_bind_info", 0, NULL, ICON_NONE);
538
539 }
540
541 static void wm_collada_import_draw(bContext *UNUSED(C), wmOperator *op)
542 {
543         PointerRNA ptr;
544
545         RNA_pointer_create(NULL, op->type->srna, op->properties, &ptr);
546         uiCollada_importSettings(op->layout, &ptr);
547 }
548
549 void WM_OT_collada_import(wmOperatorType *ot)
550 {
551         ot->name = "Import COLLADA";
552         ot->description = "Load a Collada file";
553         ot->idname = "WM_OT_collada_import";
554
555         ot->invoke = WM_operator_filesel;
556         ot->exec = wm_collada_import_exec;
557         ot->poll = WM_operator_winactive;
558
559         //ot->flag |= OPTYPE_PRESET;
560
561         ot->ui = wm_collada_import_draw;
562
563         WM_operator_properties_filesel(
564                 ot, FILE_TYPE_FOLDER | FILE_TYPE_COLLADA, FILE_BLENDER, FILE_OPENFILE,
565                 WM_FILESEL_FILEPATH, FILE_DEFAULTDISPLAY, FILE_SORT_ALPHA);
566
567         RNA_def_boolean(ot->srna,
568                 "import_units", 0, "Import Units",
569                 "If disabled match import to Blender's current Unit settings, "
570                 "otherwise use the settings from the Imported scene");
571
572         RNA_def_boolean(ot->srna,
573                 "fix_orientation", 0, "Fix Leaf Bones",
574                 "Fix Orientation of Leaf Bones (Collada does only support Joints)");
575
576         RNA_def_boolean(ot->srna,
577                 "find_chains", 0, "Find Bone Chains",
578                 "Find best matching Bone Chains and ensure bones in chain are connected");
579
580         RNA_def_boolean(ot->srna,
581                 "auto_connect", 0, "Auto Connect",
582                 "Set use_connect for parent bones which have exactly one child bone");
583
584         RNA_def_int(ot->srna,
585                 "min_chain_length",
586                 0,
587                 0,
588                 INT_MAX,
589                 "Minimum Chain Length",
590                 "When searching Bone Chains disregard chains of length below this value",
591                 0,
592                 INT_MAX);
593
594         RNA_def_boolean(ot->srna,
595                 "keep_bind_info", 0, "Keep Bind Info",
596                 "Store Bindpose information in custom bone properties for later use during Collada export");
597
598 }
599 #endif