[Bf-blender-cvs] [8b347fc2cdc] master: Armature: increase maximum delectable bones from 4096 to 8192

Campbell Barton noreply at git.blender.org
Fri Jun 5 08:14:41 CEST 2020


Commit: 8b347fc2cdc67d73255623c5e86994fbba767d64
Author: Campbell Barton
Date:   Fri Jun 5 16:04:35 2020 +1000
Branches: master
https://developer.blender.org/rB8b347fc2cdc67d73255623c5e86994fbba767d64

Armature: increase maximum delectable bones from 4096 to 8192

Remove BONESEL_NOSEL which isn't needed.

Addresses issue raised in T77378.

===================================================================

M	source/blender/editors/armature/armature_select.c
M	source/blender/editors/include/ED_armature.h

===================================================================

diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c
index b946c19dbe5..08b285a9163 100644
--- a/source/blender/editors/armature/armature_select.c
+++ b/source/blender/editors/armature/armature_select.c
@@ -184,7 +184,7 @@ static void *ed_armature_pick_bone_from_selectbuffer_impl(const bool is_editmode
   for (i = 0; i < hits; i++) {
     hitresult = buffer[3 + (i * 4)];
 
-    if (!(hitresult & BONESEL_NOSEL)) {
+    {
       if (hitresult & BONESEL_ANY) { /* to avoid including objects in selection */
         Base *base = NULL;
         bool sel;
@@ -659,8 +659,8 @@ static EditBone *get_nearest_editbonepoint(
     EditBone *ebone;
   } *result = NULL,
 
-    result_cycle = {.hitresult = BONESEL_NOSEL, .base = NULL, .ebone = NULL},
-    result_bias = {.hitresult = BONESEL_NOSEL, .base = NULL, .ebone = NULL};
+    result_cycle = {.hitresult = -1, .base = NULL, .ebone = NULL},
+    result_bias = {.hitresult = -1, .base = NULL, .ebone = NULL};
 
   /* find the bone after the current active bone, so as to bump up its chances in selection.
    * this way overlapping bones will cycle selection state as with objects. */
@@ -732,7 +732,7 @@ cache_end:
   /* See if there are any selected bones in this group */
   if (hits > 0) {
     if (hits == 1) {
-      if (!(buffer[3] & BONESEL_NOSEL)) {
+      {
         result_bias.hitresult = buffer[3];
         result_bias.base = ED_armature_base_and_ebone_from_select_buffer(
             bases, bases_len, result_bias.hitresult, &result_bias.ebone);
@@ -774,7 +774,7 @@ cache_end:
 
       for (int i = 0; i < hits; i++) {
         const uint hitresult = buffer[3 + (i * 4)];
-        if (!(hitresult & BONESEL_NOSEL)) {
+        {
           Base *base = NULL;
           EditBone *ebone;
           base = ED_armature_base_and_ebone_from_select_buffer(
@@ -859,7 +859,7 @@ cache_end:
 
     result = (use_cycle && result_cycle.ebone) ? &result_cycle : &result_bias;
 
-    if (!(result->hitresult & BONESEL_NOSEL)) {
+    if (result->hitresult != -1) {
       *r_base = result->base;
 
       *r_selmask = 0;
diff --git a/source/blender/editors/include/ED_armature.h b/source/blender/editors/include/ED_armature.h
index 102c0dc0659..ac9eb415b23 100644
--- a/source/blender/editors/include/ED_armature.h
+++ b/source/blender/editors/include/ED_armature.h
@@ -120,13 +120,11 @@ typedef struct EditBone {
   } temp;
 } EditBone;
 
-#define BONESEL_ROOT (1 << 28)
-#define BONESEL_TIP (1 << 29)
-#define BONESEL_BONE (1 << 30)
+#define BONESEL_ROOT (2 << 29u)
+#define BONESEL_TIP (1 << 30u)
+#define BONESEL_BONE (1 << 31u)
 #define BONESEL_ANY (BONESEL_TIP | BONESEL_ROOT | BONESEL_BONE)
 
-#define BONESEL_NOSEL (1u << 31u)
-
 /* useful macros */
 #define EBONE_VISIBLE(arm, ebone) \
   (CHECK_TYPE_INLINE(arm, bArmature *), \



More information about the Bf-blender-cvs mailing list