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