Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Sun, 2 Dec 2018 03:32:31 +0000 (14:32 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Sun, 2 Dec 2018 03:37:04 +0000 (14:37 +1100)
source/blender/blenkernel/BKE_armature.h
source/blender/blenkernel/intern/armature.c
source/blender/blenkernel/intern/armature_update.c
source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
source/blender/draw/intern/draw_armature.c
source/blender/editors/armature/armature_skinning.c
source/blender/editors/gpencil/gpencil_armature.c
source/blender/editors/space_view3d/view3d_gizmo_armature.c
source/blender/makesrna/intern/rna_pose_api.c

index 0e356c1557fcb75e98b989e4a93ce68aaa3f6416..bc91ffeb504c7cc84141f08f1bd48328db677c2c 100644 (file)
@@ -164,16 +164,26 @@ typedef struct BBoneSplineParameters {
        float curveInX, curveInY, curveOutX, curveOutY;
 } BBoneSplineParameters;
 
-void BKE_pchan_get_bbone_handles(struct bPoseChannel *pchan, struct bPoseChannel **r_prev, struct bPoseChannel **r_next);
-void BKE_pchan_get_bbone_spline_parameters(struct bPoseChannel *pchan, const bool rest, struct BBoneSplineParameters *r_param);
-
-void b_bone_spline_setup(struct bPoseChannel *pchan, const bool rest, Mat4 result_array[MAX_BBONE_SUBDIV]);
-
-void BKE_compute_b_bone_handles(const BBoneSplineParameters *param, float h1[3], float *r_roll1, float h2[3], float *r_roll2, bool ease, bool offsets);
-int BKE_compute_b_bone_spline(struct BBoneSplineParameters *param, Mat4 result_array[MAX_BBONE_SUBDIV]);
-
-void BKE_pchan_cache_bbone_segments(struct bPoseChannel *pchan);
-void BKE_pchan_copy_bbone_segments_cache(struct bPoseChannel *pchan, struct bPoseChannel *pchan_from);
+void BKE_pchan_bbone_handles_get(
+        struct bPoseChannel *pchan, struct bPoseChannel **r_prev, struct bPoseChannel **r_next);
+void BKE_pchan_bbone_spline_params_get(
+        struct bPoseChannel *pchan, const bool rest, struct BBoneSplineParameters *r_param);
+
+void BKE_pchan_bbone_spline_setup(
+        struct bPoseChannel *pchan, const bool rest, Mat4 result_array[MAX_BBONE_SUBDIV]);
+
+void BKE_pchan_bbone_handles_compute(
+        const BBoneSplineParameters *param,
+        float h1[3], float *r_roll1,
+        float h2[3], float *r_roll2,
+        bool ease, bool offsets);
+int  BKE_pchan_bbone_spline_compute(
+        struct BBoneSplineParameters *param, Mat4 result_array[MAX_BBONE_SUBDIV]);
+
+void BKE_pchan_bbone_segments_cache_compute(
+        struct bPoseChannel *pchan);
+void BKE_pchan_bbone_segments_cache_copy(
+        struct bPoseChannel *pchan, struct bPoseChannel *pchan_from);
 
 /* like EBONE_VISIBLE */
 #define PBONE_VISIBLE(arm, bone) ( \
index 9abd20679d8436f091e017e70b4504bddcf0d40e..8c32bed4a3b83c4301cc76a1b9f520a9a69e921d 100644 (file)
@@ -436,7 +436,7 @@ static void equalize_bbone_bezier(float *data, int desired)
 }
 
 /* Get "next" and "prev" bones - these are used for handle calculations. */
-void BKE_pchan_get_bbone_handles(bPoseChannel *pchan, bPoseChannel **r_prev, bPoseChannel **r_next)
+void BKE_pchan_bbone_handles_get(bPoseChannel *pchan, bPoseChannel **r_prev, bPoseChannel **r_next)
 {
        if (pchan->bone->bbone_prev_type == BBONE_HANDLE_AUTO) {
                /* Use connected parent. */
@@ -463,7 +463,7 @@ void BKE_pchan_get_bbone_handles(bPoseChannel *pchan, bPoseChannel **r_prev, bPo
 }
 
 /* Compute B-Bone spline parameters for the given channel. */
-void BKE_pchan_get_bbone_spline_parameters(struct bPoseChannel *pchan, const bool rest, struct BBoneSplineParameters *param)
+void BKE_pchan_bbone_spline_params_get(struct bPoseChannel *pchan, const bool rest, struct BBoneSplineParameters *param)
 {
        bPoseChannel *next, *prev;
        Bone *bone = pchan->bone;
@@ -487,7 +487,7 @@ void BKE_pchan_get_bbone_spline_parameters(struct bPoseChannel *pchan, const boo
                }
        }
 
-       BKE_pchan_get_bbone_handles(pchan, &prev, &next);
+       BKE_pchan_bbone_handles_get(pchan, &prev, &next);
 
        /* Find the handle points, since this is inside bone space, the
         * first point = (0, 0, 0)
@@ -645,17 +645,17 @@ void BKE_pchan_get_bbone_spline_parameters(struct bPoseChannel *pchan, const boo
 
 /* Fills the array with the desired amount of bone->segments elements.
  * This calculation is done within unit bone space. */
-void b_bone_spline_setup(bPoseChannel *pchan, const bool rest, Mat4 result_array[MAX_BBONE_SUBDIV])
+void BKE_pchan_bbone_spline_setup(bPoseChannel *pchan, const bool rest, Mat4 result_array[MAX_BBONE_SUBDIV])
 {
        BBoneSplineParameters param;
 
-       BKE_pchan_get_bbone_spline_parameters(pchan, rest, &param);
+       BKE_pchan_bbone_spline_params_get(pchan, rest, &param);
 
-       pchan->bone->segments = BKE_compute_b_bone_spline(&param, result_array);
+       pchan->bone->segments = BKE_pchan_bbone_spline_compute(&param, result_array);
 }
 
 /* Computes the bezier handle vectors and rolls coming from custom handles. */
-void BKE_compute_b_bone_handles(const BBoneSplineParameters *param, float h1[3], float *r_roll1, float h2[3], float *r_roll2, bool ease, bool offsets)
+void BKE_pchan_bbone_handles_compute(const BBoneSplineParameters *param, float h1[3], float *r_roll1, float h2[3], float *r_roll2, bool ease, bool offsets)
 {
        float mat3[3][3];
        float length = param->length;
@@ -756,7 +756,7 @@ void BKE_compute_b_bone_handles(const BBoneSplineParameters *param, float h1[3],
 
 /* Fills the array with the desired amount of bone->segments elements.
  * This calculation is done within unit bone space. */
-int BKE_compute_b_bone_spline(BBoneSplineParameters *param, Mat4 result_array[MAX_BBONE_SUBDIV])
+int BKE_pchan_bbone_spline_compute(BBoneSplineParameters *param, Mat4 result_array[MAX_BBONE_SUBDIV])
 {
        float scalemat[4][4], iscalemat[4][4];
        float mat3[3][3];
@@ -772,7 +772,7 @@ int BKE_compute_b_bone_spline(BBoneSplineParameters *param, Mat4 result_array[MA
                length *= param->scale[1];
        }
 
-       BKE_compute_b_bone_handles(param, h1, &roll1, h2, &roll2, true, true);
+       BKE_pchan_bbone_handles_compute(param, h1, &roll1, h2, &roll2, true, true);
 
        /* Make curve. */
        CLAMP_MAX(param->segments, MAX_BBONE_SUBDIV);
@@ -858,7 +858,7 @@ static void allocate_bbone_cache(bPoseChannel *pchan, int segments)
 }
 
 /** Compute and cache the B-Bone shape in the channel runtime struct. */
-void BKE_pchan_cache_bbone_segments(bPoseChannel *pchan)
+void BKE_pchan_bbone_segments_cache_compute(bPoseChannel *pchan)
 {
        bPoseChannelRuntime *runtime = &pchan->runtime;
        Bone *bone = pchan->bone;
@@ -876,8 +876,8 @@ void BKE_pchan_cache_bbone_segments(bPoseChannel *pchan)
        DualQuat *b_bone_dual_quats = runtime->bbone_dual_quats;
        int a;
 
-       b_bone_spline_setup(pchan, false, b_bone);
-       b_bone_spline_setup(pchan, true, b_bone_rest);
+       BKE_pchan_bbone_spline_setup(pchan, false, b_bone);
+       BKE_pchan_bbone_spline_setup(pchan, true, b_bone_rest);
 
        /* Compute deform matrices. */
        /* first matrix is the inverse arm_mat, to bring points in local bone space
@@ -901,7 +901,7 @@ void BKE_pchan_cache_bbone_segments(bPoseChannel *pchan)
 }
 
 /** Copy cached B-Bone segments from one channel to another */
-void BKE_pchan_copy_bbone_segments_cache(bPoseChannel *pchan, bPoseChannel *pchan_from)
+void BKE_pchan_bbone_segments_cache_copy(bPoseChannel *pchan, bPoseChannel *pchan_from)
 {
        bPoseChannelRuntime *runtime = &pchan->runtime;
        bPoseChannelRuntime *runtime_from = &pchan_from->runtime;
index f5519966ac28f3087a6d9cf0dc26deedac7f9206..1460a3cb205f7b2a93ec1417f39111f180c62a24 100644 (file)
@@ -728,10 +728,10 @@ void BKE_pose_eval_bbone_segments(struct Depsgraph *depsgraph,
        bPoseChannel *pchan = pose_pchan_get_indexed(ob, pchan_index);
        DEG_debug_print_eval(depsgraph, __func__, pchan->name, pchan);
        if (pchan->bone != NULL && pchan->bone->segments > 1) {
-               BKE_pchan_cache_bbone_segments(pchan);
+               BKE_pchan_bbone_segments_cache_compute(pchan);
                bArmature *arm = (bArmature *)ob->data;
                if (DEG_is_active(depsgraph) && arm->edbo == NULL) {
-                       BKE_pchan_copy_bbone_segments_cache(pchan->orig_pchan, pchan);
+                       BKE_pchan_bbone_segments_cache_copy(pchan->orig_pchan, pchan);
                }
        }
 }
@@ -857,5 +857,5 @@ void BKE_pose_eval_proxy_copy_bone(
        BLI_assert(pchan != NULL);
        BLI_assert(pchan_from != NULL);
        BKE_pose_copyesult_pchan_result(pchan, pchan_from);
-       BKE_pchan_copy_bbone_segments_cache(pchan, pchan_from);
+       BKE_pchan_bbone_segments_cache_copy(pchan, pchan_from);
 }
index 1260ce013ea56d091838709484d323f408eee5a1..ff8b13b4442e1b9bfb885925ba43f06abf75aff6 100644 (file)
@@ -498,7 +498,7 @@ void DepsgraphRelationBuilder::build_rig(Object *object)
                        add_relation(bone_done_key, bone_segments_key, "Done -> B-Bone Segments");
                        /* B-Bone shape depends on final position of handle bones. */
                        bPoseChannel *prev, *next;
-                       BKE_pchan_get_bbone_handles(pchan, &prev, &next);
+                       BKE_pchan_bbone_handles_get(pchan, &prev, &next);
                        if (prev) {
                                OperationKey prev_key(&object->id,
                                                      DEG_NODE_TYPE_BONE,
index aec25274ab104c8e3bc5d0065bb7076485e53367..b8b53fbbb788d1321ad83939ac197e8b311bfd3e 100644 (file)
@@ -940,7 +940,7 @@ static void edbo_compute_bbone_child(bArmature *arm)
        }
 }
 
-/* A version of b_bone_spline_setup() for previewing editmode curve settings. */
+/* A version of BKE_pchan_bbone_spline_setup() for previewing editmode curve settings. */
 static void ebone_spline_preview(EditBone *ebone, float result_array[MAX_BBONE_SUBDIV][4][4])
 {
        BBoneSplineParameters param;
@@ -1043,7 +1043,7 @@ static void ebone_spline_preview(EditBone *ebone, float result_array[MAX_BBONE_S
        param.curveOutX = ebone->curveOutX;
        param.curveOutY = ebone->curveOutY;
 
-       ebone->segments = BKE_compute_b_bone_spline(&param, (Mat4 *)result_array);
+       ebone->segments = BKE_pchan_bbone_spline_compute(&param, (Mat4 *)result_array);
 }
 
 static void draw_bone_update_disp_matrix_bbone(EditBone *eBone, bPoseChannel *pchan)
@@ -1086,7 +1086,7 @@ static void draw_bone_update_disp_matrix_bbone(EditBone *eBone, bPoseChannel *pc
                                memcpy(bbones_mat, pchan->runtime.bbone_pose_mats, sizeof(Mat4) * bbone_segments);
                        }
                        else {
-                               b_bone_spline_setup(pchan, false, bbones_mat);
+                               BKE_pchan_bbone_spline_setup(pchan, false, bbones_mat);
                        }
 
                        for (int i = bbone_segments; i--; bbones_mat++) {
index 06385ab0cee04ec0b603ad9be36711e4b7050252..462c17e9008a5907a900448a705bdae1897fc4f8 100644 (file)
@@ -326,7 +326,7 @@ static void add_verts_to_dgroups(
                                if ((par->pose) && (pchan = BKE_pose_channel_find_name(par->pose, bone->name))) {
                                        if (bone->segments > 1) {
                                                segments = bone->segments;
-                                               b_bone_spline_setup(pchan, true, bbone_array);
+                                               BKE_pchan_bbone_spline_setup(pchan, true, bbone_array);
                                                bbone = bbone_array;
                                        }
                                }
index d69f64f3eafe42601fed13588d6cdcb48f72b789..d62984020cd8faefdd0ce1e88866c0bb205a9c7c 100644 (file)
@@ -323,7 +323,7 @@ static void gpencil_add_verts_to_dgroups(
                        {
                                if (bone->segments > 1) {
                                        segments = bone->segments;
-                                       b_bone_spline_setup(pchan, true, bbone_array);
+                                       BKE_pchan_bbone_spline_setup(pchan, true, bbone_array);
                                        bbone = bbone_array;
                                }
                        }
index 4e91712491f3a31711bf837d4ddb6428fcf9db08..0a3d20979a0e1f0b2b095e637306c4424b94911d 100644 (file)
@@ -59,7 +59,7 @@
 /*
  * TODO(campbell): Current conversion is a approximation (usable not correct),
  * we'll need to take the next/previous bones into account to get the tangent directions.
- * First last matrices from 'b_bone_spline_setup' are close but also not quite accurate
+ * First last matrices from 'BKE_pchan_bbone_spline_setup' are close but also not quite accurate
  * since they're not at either end-points on the curve.
  *
  * Likely we'll need a function especially to get the first/last orientations.
index f4463e0f7d85fc822155ff0172bde5b7e961314a..6b7a8e4e2ff6f28676d8285ca0e45b8377a66867 100644 (file)
@@ -95,8 +95,8 @@ static void rna_PoseBone_compute_bbone_handles(
 
        BBoneSplineParameters params;
 
-       BKE_pchan_get_bbone_spline_parameters(pchan, rest, &params);
-       BKE_compute_b_bone_handles(&params, ret_h1, ret_roll1, ret_h2, ret_roll2, ease || offsets, offsets);
+       BKE_pchan_bbone_spline_params_get(pchan, rest, &params);
+       BKE_pchan_bbone_handles_compute(&params, ret_h1, ret_roll1, ret_h2, ret_roll2, ease || offsets, offsets);
 }
 #else