diff options
author | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-03-02 19:58:13 +0400 |
---|---|---|
committer | Gaia Clary <gaia.clary@machinimatrix.org> | 2013-03-02 19:58:13 +0400 |
commit | be701b6278769465495ec43d1d6817cf5fbfeaca (patch) | |
tree | 70537dfc0e93b55d2f88fe16af25c5481c7c18f8 /source/blender/collada/ControllerExporter.cpp | |
parent | 723e231ce0c92d72bb959096613e901ea781d84a (diff) |
Collada: Added support for ngon export/import and added triangulate option to export
Diffstat (limited to 'source/blender/collada/ControllerExporter.cpp')
-rw-r--r-- | source/blender/collada/ControllerExporter.cpp | 35 |
1 files changed, 14 insertions, 21 deletions
diff --git a/source/blender/collada/ControllerExporter.cpp b/source/blender/collada/ControllerExporter.cpp index 39ed0334ae0..6b367b9cea9 100644 --- a/source/blender/collada/ControllerExporter.cpp +++ b/source/blender/collada/ControllerExporter.cpp @@ -201,13 +201,12 @@ void ControllerExporter::export_skin_controller(Object *ob, Object *ob_arm) bool use_instantiation = this->export_settings->use_object_instantiation; Mesh *me; - if (this->export_settings->apply_modifiers) - me = bc_to_mesh_apply_modifiers(scene, ob, this->export_settings->export_mesh_type); - else - me = (Mesh *)ob->data; + me = bc_get_mesh_copy(scene, + ob, + this->export_settings->export_mesh_type, + this->export_settings->apply_modifiers, + this->export_settings->triangulate); - BKE_mesh_tessface_ensure(me); - if (!me->dvert) return; std::string controller_name = id_name(ob_arm); @@ -292,10 +291,8 @@ void ControllerExporter::export_skin_controller(Object *ob, Object *ob_arm) add_joints_element(&ob->defbase, joints_source_id, inv_bind_mat_source_id); add_vertex_weights_element(weights_source_id, joints_source_id, vcounts, joints); - if (this->export_settings->apply_modifiers) - { - BKE_libblock_free_us(&(G.main->mesh), me); - } + BKE_libblock_free_us(&(G.main->mesh), me); + closeSkin(); closeController(); } @@ -305,13 +302,11 @@ void ControllerExporter::export_morph_controller(Object *ob, Key *key) bool use_instantiation = this->export_settings->use_object_instantiation; Mesh *me; - if (this->export_settings->apply_modifiers) { - me = bc_to_mesh_apply_modifiers(scene, ob, this->export_settings->export_mesh_type); - } - else { - me = (Mesh *)ob->data; - } - BKE_mesh_tessface_ensure(me); + me = bc_get_mesh_copy(scene, + ob, + this->export_settings->export_mesh_type, + this->export_settings->apply_modifiers, + this->export_settings->triangulate); std::string controller_name = id_name(ob) + "-morph"; std::string controller_id = get_controller_id(key, ob); @@ -332,10 +327,8 @@ void ControllerExporter::export_morph_controller(Object *ob, Key *key) COLLADASW::URI(COLLADABU::Utils::EMPTY_STRING, morph_weights_id))); targets.add(); - if (this->export_settings->apply_modifiers) - { - BKE_libblock_free_us(&(G.main->mesh), me); - } + BKE_libblock_free_us(&(G.main->mesh), me); + //support for animations //can also try the base element and param alternative |