Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2020-06-05 09:04:35 +0300
committerCampbell Barton <ideasman42@gmail.com>2020-06-05 09:04:35 +0300
commit8b347fc2cdc67d73255623c5e86994fbba767d64 (patch)
tree9c4bd05fa79154c19f47e0b810bc3c98975b6bba
parentfd63220a35e432136c41b35399630d7e10b79516 (diff)
Armature: increase maximum delectable bones from 4096 to 8192
Remove BONESEL_NOSEL which isn't needed. Addresses issue raised in T77378.
-rw-r--r--source/blender/editors/armature/armature_select.c12
-rw-r--r--source/blender/editors/include/ED_armature.h8
2 files changed, 9 insertions, 11 deletions
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 *), \