~siretart/ubuntu/utopic/blender/libav10

« back to all changes in this revision

Viewing changes to source/blender/editors/io/io_collada.c

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2014-02-19 11:24:23 UTC
  • mfrom: (14.2.23 sid)
  • Revision ID: package-import@ubuntu.com-20140219112423-rkmaz2m7ha06d4tk
Tags: 2.69-3ubuntu1
* Merge with Debian; remaining changes:
  - Configure without OpenImageIO on armhf, as it is not available on
    Ubuntu.

Show diffs side-by-side

added added

removed removed

Lines of Context:
96
96
        int use_object_instantiation;
97
97
        int sort_by_name;
98
98
        int export_transformation_type;
99
 
        int second_life; 
 
99
        int open_sim; 
100
100
 
101
101
        if (!RNA_struct_property_is_set(op->ptr, "filepath")) {
102
102
                BKE_report(op->reports, RPT_ERROR, "No filename given");
106
106
        RNA_string_get(op->ptr, "filepath", filepath);
107
107
        BLI_ensure_extension(filepath, sizeof(filepath), ".dae");
108
108
 
 
109
 
 
110
        /* Avoid File write exceptions in Collada */
 
111
        if (!BLI_exists(filepath)) {
 
112
                BLI_make_existing_file(filepath);
 
113
                if (!BLI_file_touch(filepath)) {
 
114
                        BKE_report(op->reports, RPT_ERROR, "Can't create export file");
 
115
                        fprintf(stdout, "Collada export: Can not create: %s\n", filepath);
 
116
                        return OPERATOR_CANCELLED;
 
117
                }
 
118
        }
 
119
        else if (!BLI_file_is_writable(filepath)) {
 
120
                BKE_report(op->reports, RPT_ERROR, "Can't overwrite export file");
 
121
                fprintf(stdout, "Collada export: Can not modify: %s\n", filepath);
 
122
                return OPERATOR_CANCELLED;
 
123
        }
 
124
 
 
125
        /* Now the exporter can create and write the export file */
 
126
 
109
127
        /* Options panel */
110
128
        apply_modifiers          = RNA_boolean_get(op->ptr, "apply_modifiers");
111
129
        export_mesh_type         = RNA_enum_get(op->ptr,    "export_mesh_type_selection");
124
142
        use_object_instantiation   = RNA_boolean_get(op->ptr, "use_object_instantiation");
125
143
        sort_by_name               = RNA_boolean_get(op->ptr, "sort_by_name");
126
144
        export_transformation_type = RNA_enum_get(op->ptr,    "export_transformation_type_selection");
127
 
        second_life                = RNA_boolean_get(op->ptr, "second_life");
 
145
        open_sim                   = RNA_boolean_get(op->ptr, "open_sim");
128
146
 
129
147
        /* get editmode results */
130
148
        ED_object_editmode_load(CTX_data_edit_object(C));
131
149
 
 
150
 
 
151
 
132
152
        if (collada_export(CTX_data_scene(C),
133
153
                           filepath,
134
154
                           apply_modifiers,
148
168
                           use_object_instantiation,
149
169
                           sort_by_name,
150
170
                           export_transformation_type,
151
 
                           second_life))
 
171
                           open_sim))
152
172
        {
153
173
                return OPERATOR_FINISHED;
154
174
        }
216
236
        row = uiLayoutRow(box, FALSE);
217
237
        uiItemR(row, imfptr, "deform_bones_only", 0, NULL, ICON_NONE);
218
238
        row = uiLayoutRow(box, FALSE);
219
 
        uiItemR(row, imfptr, "second_life", 0, NULL, ICON_NONE);
 
239
        uiItemR(row, imfptr, "open_sim", 0, NULL, ICON_NONE);
220
240
 
221
241
        /* Collada options: */
222
242
        box = uiLayoutBox(layout);
330
350
        RNA_def_enum(ot->srna, "export_transformation_type_selection", prop_bc_export_transformation_type, 0,
331
351
                     "Transform", "Transformation type for translation, scale and rotation");
332
352
 
333
 
        RNA_def_boolean(ot->srna, "second_life", 0, "Export for Second Life",
334
 
                        "Compatibility mode for Second Life");
 
353
        RNA_def_boolean(ot->srna, "open_sim", 0, "Export for OpenSim",
 
354
                        "Compatibility mode for OpenSim and compatible online worlds");
335
355
}
336
356
 
337
357