[Bf-blender-cvs] [af2740abc0b] master: Fix T97718: Crash using "Text on Curve"
Hans Goudey
noreply at git.blender.org
Tue May 3 09:47:41 CEST 2022
Commit: af2740abc0b003fd9d307933480ace3a99803669
Author: Hans Goudey
Date: Tue May 3 09:25:19 2022 +0200
Branches: master
https://developer.blender.org/rBaf2740abc0b003fd9d307933480ace3a99803669
Fix T97718: Crash using "Text on Curve"
8e4c3c6a2414 mistakenly used the `vec` argument
of `BKE_where_on_path` like it was optional. Fix by
making that argument optional too.
===================================================================
M source/blender/blenkernel/intern/anim_path.c
===================================================================
diff --git a/source/blender/blenkernel/intern/anim_path.c b/source/blender/blenkernel/intern/anim_path.c
index a8c25069c19..dc12519a843 100644
--- a/source/blender/blenkernel/intern/anim_path.c
+++ b/source/blender/blenkernel/intern/anim_path.c
@@ -320,18 +320,22 @@ bool BKE_where_on_path(const Object *ob,
key_curve_position_weights(frac, w, KEY_BSPLINE);
}
- r_vec[0] = /* X */
- w[0] * p0->vec[0] + w[1] * p1->vec[0] + w[2] * p2->vec[0] + w[3] * p3->vec[0];
- r_vec[1] = /* Y */
- w[0] * p0->vec[1] + w[1] * p1->vec[1] + w[2] * p2->vec[1] + w[3] * p3->vec[1];
- r_vec[2] = /* Z */
- w[0] * p0->vec[2] + w[1] * p1->vec[2] + w[2] * p2->vec[2] + w[3] * p3->vec[2];
+ if (r_vec) {
+ r_vec[0] = /* X */
+ w[0] * p0->vec[0] + w[1] * p1->vec[0] + w[2] * p2->vec[0] + w[3] * p3->vec[0];
+ r_vec[1] = /* Y */
+ w[0] * p0->vec[1] + w[1] * p1->vec[1] + w[2] * p2->vec[1] + w[3] * p3->vec[1];
+ r_vec[2] = /* Z */
+ w[0] * p0->vec[2] + w[1] * p1->vec[2] + w[2] * p2->vec[2] + w[3] * p3->vec[2];
+ }
/* Clamp weights to 0-1 as we don't want to extrapolate other values than position. */
clamp_v4(w, 0.0f, 1.0f);
- /* Tilt, should not be needed since we have quat still used. */
- r_vec[3] = w[0] * p0->tilt + w[1] * p1->tilt + w[2] * p2->tilt + w[3] * p3->tilt;
+ if (r_vec) {
+ /* Tilt, should not be needed since we have quat still used. */
+ r_vec[3] = w[0] * p0->tilt + w[1] * p1->tilt + w[2] * p2->tilt + w[3] * p3->tilt;
+ }
if (r_quat) {
float totfac, q1[4], q2[4];
More information about the Bf-blender-cvs
mailing list