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);
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();
}
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);
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
source.prepareToAppendValues();
- KeyBlock * kb = (KeyBlock*)key->block.first;
+ KeyBlock *kb = (KeyBlock *)key->block.first;
//skip the basis
kb = kb->next;
for (; kb; kb = kb->next) {
source.prepareToAppendValues();
- KeyBlock * kb = (KeyBlock*)key->block.first;
+ KeyBlock *kb = (KeyBlock *)key->block.first;
//skip the basis
kb = kb->next;
for (; kb; kb = kb->next) {
// can also try the base element and param alternative
COLLADASW::BaseExtraTechnique extra;
- KeyBlock * kb = (KeyBlock*)key->block.first;
+ KeyBlock * kb = (KeyBlock *)key->block.first;
//skip the basis
kb = kb->next;
for (; kb; kb = kb->next) {
// XXX why is the weight not used here and set to 0.0?
- float weight = kb->curval;
+ // float weight = kb->curval;
extra.addExtraTechniqueParameter ("KHR", "morph_weights" , 0.000, "MORPH_WEIGHT_TO_TARGET");
}
}