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