fix: limit precision also for animation matrixes if the limit option is set (gives nicer output for inspection)
This commit is contained in:
@@ -988,6 +988,9 @@ std::string AnimationExporter::create_4x4_source(std::vector<float> &frames, Obj
|
||||
double outmat[4][4];
|
||||
converter.mat4_to_dae_double(outmat, mat);
|
||||
|
||||
if (this->export_settings->limit_precision)
|
||||
bc_sanitize_mat(outmat, 6);
|
||||
|
||||
source.appendValues(outmat);
|
||||
|
||||
j++;
|
||||
|
||||
@@ -864,6 +864,13 @@ void bc_sanitize_mat(float mat[4][4], int precision)
|
||||
mat[i][j] = double_round(mat[i][j], precision);
|
||||
}
|
||||
|
||||
void bc_sanitize_mat(double mat[4][4], int precision)
|
||||
{
|
||||
for (int i = 0; i < 4; i++)
|
||||
for (int j = 0; j < 4; j++)
|
||||
mat[i][j] = double_round(mat[i][j], precision);
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns name of Active UV Layer or empty String if no active UV Layer defined.
|
||||
* Assuming the Object is of type MESH
|
||||
|
||||
@@ -100,6 +100,7 @@ extern EditBone *bc_get_edit_bone(bArmature * armature, char *name);
|
||||
extern int bc_set_layer(int bitfield, int layer, bool enable);
|
||||
extern int bc_set_layer(int bitfield, int layer);
|
||||
extern void bc_sanitize_mat(float mat[4][4], int precision);
|
||||
extern void bc_sanitize_mat(double mat[4][4], int precision);
|
||||
|
||||
extern IDProperty *bc_get_IDProperty(Bone *bone, std::string key);
|
||||
extern void bc_set_IDProperty(EditBone *ebone, const char *key, float value);
|
||||
|
||||
Reference in New Issue
Block a user