merge from master
[blender.git] / source / blender / collada / DocumentExporter.cpp
index 2b5d56928718cbda5e18434ffb308611b7d63c7a..0e020c9011b964306d62a54ace789b6f73b42ea7 100644 (file)
@@ -138,8 +138,7 @@ extern bool bc_has_object_type(LinkNode *export_set, short obtype);
 char *bc_CustomData_get_layer_name(const struct CustomData *data, int type, int n)
 {
        int layer_index = CustomData_get_layer_index(data, type);
-       if (layer_index < 0)
-               return NULL;
+       if (layer_index < 0) return NULL;
 
        return data->layers[layer_index + n].name;
 }
@@ -148,10 +147,9 @@ char *bc_CustomData_get_active_layer_name(const CustomData *data, int type)
 {
        /* get the layer index of the active layer of type */
        int layer_index = CustomData_get_active_layer_index(data, type);
-       if (layer_index < 1)
-               return NULL;
+       if (layer_index < 0) return NULL;
 
-       return bc_CustomData_get_layer_name(data, type, layer_index-1);
+       return data->layers[layer_index].name;
 }
 
 DocumentExporter::DocumentExporter(const ExportSettings *export_settings) : export_settings(export_settings) {
@@ -287,7 +285,7 @@ int DocumentExporter::exportCurrentScene(EvaluationContext *eval_ctx, Scene *sce
        // <library_geometries>
        if (bc_has_object_type(export_set, OB_MESH)) {
                GeometryExporter ge(writer, this->export_settings);
-               ge.exportGeom(sce);
+               ge.exportGeom(eval_ctx, sce);
        }
 
        // <library_controllers>
@@ -295,7 +293,7 @@ int DocumentExporter::exportCurrentScene(EvaluationContext *eval_ctx, Scene *sce
        ControllerExporter controller_exporter(writer, this->export_settings);
        if (bc_has_object_type(export_set, OB_ARMATURE) || this->export_settings->include_shapekeys) 
        {
-               controller_exporter.export_controllers(sce);
+               controller_exporter.export_controllers(eval_ctx, sce);
        }
 
        // <library_visual_scenes>
@@ -305,9 +303,9 @@ int DocumentExporter::exportCurrentScene(EvaluationContext *eval_ctx, Scene *sce
        if (this->export_settings->include_animations) {
                // <library_animations>
                AnimationExporter ae(writer, this->export_settings);
-               ae.exportAnimations(sce);
+               ae.exportAnimations(eval_ctx, sce);
        }
-       se.exportScene(sce);
+       se.exportScene(eval_ctx, sce);
        
        // <scene>
        std::string scene_name(translate_id(id_name(sce)));