merge Collada changtes from master
This commit is contained in:
commit
1a65168c42
|
@ -214,19 +214,15 @@ void AnimationExporter::export_sampled_matrix_animation(Object *ob, std::vector<
|
|||
|
||||
for (std::vector<float>::iterator ctime = ctimes.begin(); ctime != ctimes.end(); ++ctime) {
|
||||
float fmat[4][4];
|
||||
float outmat[4][4];
|
||||
|
||||
bc_update_scene(eval_ctx, scene, *ctime);
|
||||
BKE_object_matrix_local_get(ob, fmat);
|
||||
|
||||
converter.mat4_to_dae(outmat, fmat);
|
||||
|
||||
if (this->export_settings->limit_precision)
|
||||
bc_sanitize_mat(outmat, 6);
|
||||
bc_sanitize_mat(fmat, 6);
|
||||
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (int j = 0; j < 4; j++)
|
||||
values.push_back(outmat[j][i]);
|
||||
values.push_back(fmat[i][j]);
|
||||
}
|
||||
|
||||
std::string ob_name = id_name(ob);
|
||||
|
@ -252,7 +248,6 @@ void AnimationExporter::export_sampled_transrotloc_animation(Object *ob, std::ve
|
|||
float feul[3];
|
||||
|
||||
bc_update_scene(eval_ctx, scene, *ctime);
|
||||
|
||||
BKE_object_matrix_local_get(ob, fmat);
|
||||
mat4_decompose(floc, fquat, fsize, fmat);
|
||||
quat_to_eul(feul, fquat);
|
||||
|
|
|
@ -201,6 +201,5 @@ protected:
|
|||
|
||||
bool validateConstraints(bConstraint *con);
|
||||
|
||||
//void calc_obmat_at_time(Object *ob, float ctime);
|
||||
|
||||
};
|
||||
|
|
|
@ -764,7 +764,6 @@ void AnimationImporter::apply_matrix_curves(Object *ob, std::vector<FCurve *>& a
|
|||
axis = i - 7;
|
||||
}
|
||||
|
||||
|
||||
if (is_joint)
|
||||
BLI_snprintf(rna_path, sizeof(rna_path), "%s.%s", joint_path, tm_str);
|
||||
else
|
||||
|
@ -780,8 +779,8 @@ void AnimationImporter::apply_matrix_curves(Object *ob, std::vector<FCurve *>& a
|
|||
|
||||
std::vector<float>::iterator it;
|
||||
|
||||
float qref[4];
|
||||
unit_qt(qref);
|
||||
//float qref[4];
|
||||
//unit_qt(qref);
|
||||
|
||||
// sample values at each frame
|
||||
for (it = frames.begin(); it != frames.end(); it++) {
|
||||
|
@ -817,17 +816,7 @@ void AnimationImporter::apply_matrix_curves(Object *ob, std::vector<FCurve *>& a
|
|||
}
|
||||
|
||||
float rot[4], loc[3], scale[3];
|
||||
|
||||
bc_rotate_from_reference_quat(rot, qref, mat);
|
||||
copy_qt_qt(qref, rot);
|
||||
|
||||
#if 0
|
||||
for (int i = 0 ; i < 4; i++) {
|
||||
rot[i] = RAD2DEGF(rot[i]);
|
||||
}
|
||||
#endif
|
||||
copy_v3_v3(loc, mat[3]);
|
||||
mat4_to_size(scale, mat);
|
||||
mat4_decompose(loc, rot, scale, mat);
|
||||
|
||||
// add keys
|
||||
for (int i = 0; i < totcu; i++) {
|
||||
|
@ -1854,12 +1843,7 @@ bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm, float
|
|||
}
|
||||
fcurve_is_used(*it);
|
||||
}
|
||||
|
||||
COLLADAFW::Matrix tm(matrix);
|
||||
dae_matrix_to_mat4(&tm, mat);
|
||||
|
||||
std::vector<FCurve *>::iterator it;
|
||||
|
||||
unit_converter->dae_matrix_to_mat4_(mat, matrix);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -379,22 +379,22 @@ void WM_OT_collada_export(wmOperatorType *ot)
|
|||
RNA_def_enum(func, "export_mesh_type_selection", prop_bc_export_mesh_type, 0,
|
||||
"Resolution", "Modifier resolution for export");
|
||||
|
||||
RNA_def_boolean(func, "selected", 0, "Selection Only",
|
||||
RNA_def_boolean(func, "selected", false, "Selection Only",
|
||||
"Export only selected elements");
|
||||
|
||||
RNA_def_boolean(func, "include_children", 0, "Include Children",
|
||||
RNA_def_boolean(func, "include_children", false, "Include Children",
|
||||
"Export all children of selected objects (even if not selected)");
|
||||
|
||||
RNA_def_boolean(func, "include_armatures", 0, "Include Armatures",
|
||||
RNA_def_boolean(func, "include_armatures", false, "Include Armatures",
|
||||
"Export related armatures (even if not selected)");
|
||||
|
||||
RNA_def_boolean(func, "include_shapekeys", 1, "Include Shape Keys",
|
||||
RNA_def_boolean(func, "include_shapekeys", false, "Include Shape Keys",
|
||||
"Export all Shape Keys from Mesh Objects");
|
||||
|
||||
RNA_def_boolean(func, "deform_bones_only", 0, "Deform Bones only",
|
||||
RNA_def_boolean(func, "deform_bones_only", false, "Deform Bones only",
|
||||
"Only export deforming bones with armatures");
|
||||
|
||||
RNA_def_boolean(func, "include_animations", false,
|
||||
RNA_def_boolean(func, "include_animations", true,
|
||||
"Include Animations", "Export Animations if available.\nExporting Animations will enforce the decomposition of node transforms\ninto <translation> <rotation> and <scale> components");
|
||||
|
||||
RNA_def_boolean(func, "sample_animations", 0,
|
||||
|
|
Loading…
Reference in New Issue