Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/fcurve.c
| Show First 20 Lines • Show All 1,554 Lines • ▼ Show 20 Lines | if (pchan) { | ||||
| /* bone */ | /* bone */ | ||||
| if (dtar->flag & DTAR_FLAG_LOCALSPACE) { | if (dtar->flag & DTAR_FLAG_LOCALSPACE) { | ||||
| if (dtar->flag & DTAR_FLAG_LOCAL_CONSTS) { | if (dtar->flag & DTAR_FLAG_LOCAL_CONSTS) { | ||||
| float mat[4][4]; | float mat[4][4]; | ||||
| /* extract transform just like how the constraints do it! */ | /* extract transform just like how the constraints do it! */ | ||||
| copy_m4_m4(mat, pchan->pose_mat); | copy_m4_m4(mat, pchan->pose_mat); | ||||
| BKE_constraint_mat_convertspace( | BKE_constraint_mat_convertspace( | ||||
| ob, pchan, mat, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_LOCAL, false); | ob, pchan, mat, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_LOCAL); | ||||
| /* ... and from that, we get our transform */ | /* ... and from that, we get our transform */ | ||||
| copy_v3_v3(tmp_loc, mat[3]); | copy_v3_v3(tmp_loc, mat[3]); | ||||
| } | } | ||||
| else { | else { | ||||
| /* transform space (use transform values directly) */ | /* transform space (use transform values directly) */ | ||||
| copy_v3_v3(tmp_loc, pchan->loc); | copy_v3_v3(tmp_loc, pchan->loc); | ||||
| } | } | ||||
| Show All 9 Lines | else { | ||||
| if (dtar->flag & DTAR_FLAG_LOCALSPACE) { | if (dtar->flag & DTAR_FLAG_LOCALSPACE) { | ||||
| if (dtar->flag & DTAR_FLAG_LOCAL_CONSTS) { | if (dtar->flag & DTAR_FLAG_LOCAL_CONSTS) { | ||||
| /* XXX: this should practically be the same as transform space... */ | /* XXX: this should practically be the same as transform space... */ | ||||
| float mat[4][4]; | float mat[4][4]; | ||||
| /* extract transform just like how the constraints do it! */ | /* extract transform just like how the constraints do it! */ | ||||
| copy_m4_m4(mat, ob->obmat); | copy_m4_m4(mat, ob->obmat); | ||||
| BKE_constraint_mat_convertspace( | BKE_constraint_mat_convertspace( | ||||
| ob, NULL, mat, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL, false); | ob, NULL, mat, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL); | ||||
| /* ... and from that, we get our transform */ | /* ... and from that, we get our transform */ | ||||
| copy_v3_v3(tmp_loc, mat[3]); | copy_v3_v3(tmp_loc, mat[3]); | ||||
| } | } | ||||
| else { | else { | ||||
| /* transform space (use transform values directly) */ | /* transform space (use transform values directly) */ | ||||
| copy_v3_v3(tmp_loc, ob->loc); | copy_v3_v3(tmp_loc, ob->loc); | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | if (pchan->rotmode > 0) { | ||||
| use_eulers = true; | use_eulers = true; | ||||
| } | } | ||||
| if (dtar->flag & DTAR_FLAG_LOCALSPACE) { | if (dtar->flag & DTAR_FLAG_LOCALSPACE) { | ||||
| if (dtar->flag & DTAR_FLAG_LOCAL_CONSTS) { | if (dtar->flag & DTAR_FLAG_LOCAL_CONSTS) { | ||||
| /* just like how the constraints do it! */ | /* just like how the constraints do it! */ | ||||
| copy_m4_m4(mat, pchan->pose_mat); | copy_m4_m4(mat, pchan->pose_mat); | ||||
| BKE_constraint_mat_convertspace( | BKE_constraint_mat_convertspace( | ||||
| ob, pchan, mat, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_LOCAL, false); | ob, pchan, mat, CONSTRAINT_SPACE_POSE, CONSTRAINT_SPACE_LOCAL); | ||||
| } | } | ||||
| else { | else { | ||||
| /* specially calculate local matrix, since chan_mat is not valid | /* specially calculate local matrix, since chan_mat is not valid | ||||
| * since it stores delta transform of pose_mat so that deforms work | * since it stores delta transform of pose_mat so that deforms work | ||||
| * so it cannot be used here for "transform" space | * so it cannot be used here for "transform" space | ||||
| */ | */ | ||||
| BKE_pchan_to_mat4(pchan, mat); | BKE_pchan_to_mat4(pchan, mat); | ||||
| } | } | ||||
| Show All 11 Lines | if (ob->rotmode > 0) { | ||||
| use_eulers = true; | use_eulers = true; | ||||
| } | } | ||||
| if (dtar->flag & DTAR_FLAG_LOCALSPACE) { | if (dtar->flag & DTAR_FLAG_LOCALSPACE) { | ||||
| if (dtar->flag & DTAR_FLAG_LOCAL_CONSTS) { | if (dtar->flag & DTAR_FLAG_LOCAL_CONSTS) { | ||||
| /* just like how the constraints do it! */ | /* just like how the constraints do it! */ | ||||
| copy_m4_m4(mat, ob->obmat); | copy_m4_m4(mat, ob->obmat); | ||||
| BKE_constraint_mat_convertspace( | BKE_constraint_mat_convertspace( | ||||
| ob, NULL, mat, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL, false); | ob, NULL, mat, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL); | ||||
| } | } | ||||
| else { | else { | ||||
| /* transforms to matrix */ | /* transforms to matrix */ | ||||
| BKE_object_to_mat4(ob, mat); | BKE_object_to_mat4(ob, mat); | ||||
| } | } | ||||
| } | } | ||||
| else { | else { | ||||
| /* worldspace matrix - just the good-old one */ | /* worldspace matrix - just the good-old one */ | ||||
| ▲ Show 20 Lines • Show All 1,479 Lines • Show Last 20 Lines | |||||