fix: #34051 Collada export crashes

This commit is contained in:
Gaia Clary 2013-02-08 12:31:47 +00:00
parent fdd18c7a07
commit 8b37f4724f

@ -246,10 +246,13 @@ void ControllerExporter::export_skin_controller(Object *ob, Object *ob_arm)
float sumw = 0.0f;
for (j = 0; j < vert->totweight; j++) {
int joint_index = joint_index_by_def_index[vert->dw[j].def_nr];
if (joint_index != -1 && vert->dw[j].weight > 0.0f) {
jw[joint_index] += vert->dw[j].weight;
sumw += vert->dw[j].weight;
int idx = vert->dw[j].def_nr;
if (idx >= 0) {
int joint_index = joint_index_by_def_index[idx];
if (joint_index != -1 && vert->dw[j].weight > 0.0f) {
jw[joint_index] += vert->dw[j].weight;
sumw += vert->dw[j].weight;
}
}
}