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