Armature: increase maximum delectable bones from 4096 to 8192
Remove BONESEL_NOSEL which isn't needed. Addresses issue raised in T77378.
This commit is contained in:
@@ -184,7 +184,7 @@ static void *ed_armature_pick_bone_from_selectbuffer_impl(const bool is_editmode
|
|||||||
for (i = 0; i < hits; i++) {
|
for (i = 0; i < hits; i++) {
|
||||||
hitresult = buffer[3 + (i * 4)];
|
hitresult = buffer[3 + (i * 4)];
|
||||||
|
|
||||||
if (!(hitresult & BONESEL_NOSEL)) {
|
{
|
||||||
if (hitresult & BONESEL_ANY) { /* to avoid including objects in selection */
|
if (hitresult & BONESEL_ANY) { /* to avoid including objects in selection */
|
||||||
Base *base = NULL;
|
Base *base = NULL;
|
||||||
bool sel;
|
bool sel;
|
||||||
@@ -659,8 +659,8 @@ static EditBone *get_nearest_editbonepoint(
|
|||||||
EditBone *ebone;
|
EditBone *ebone;
|
||||||
} *result = NULL,
|
} *result = NULL,
|
||||||
|
|
||||||
result_cycle = {.hitresult = BONESEL_NOSEL, .base = NULL, .ebone = NULL},
|
result_cycle = {.hitresult = -1, .base = NULL, .ebone = NULL},
|
||||||
result_bias = {.hitresult = BONESEL_NOSEL, .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.
|
/* 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. */
|
* 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 */
|
/* See if there are any selected bones in this group */
|
||||||
if (hits > 0) {
|
if (hits > 0) {
|
||||||
if (hits == 1) {
|
if (hits == 1) {
|
||||||
if (!(buffer[3] & BONESEL_NOSEL)) {
|
{
|
||||||
result_bias.hitresult = buffer[3];
|
result_bias.hitresult = buffer[3];
|
||||||
result_bias.base = ED_armature_base_and_ebone_from_select_buffer(
|
result_bias.base = ED_armature_base_and_ebone_from_select_buffer(
|
||||||
bases, bases_len, result_bias.hitresult, &result_bias.ebone);
|
bases, bases_len, result_bias.hitresult, &result_bias.ebone);
|
||||||
@@ -774,7 +774,7 @@ cache_end:
|
|||||||
|
|
||||||
for (int i = 0; i < hits; i++) {
|
for (int i = 0; i < hits; i++) {
|
||||||
const uint hitresult = buffer[3 + (i * 4)];
|
const uint hitresult = buffer[3 + (i * 4)];
|
||||||
if (!(hitresult & BONESEL_NOSEL)) {
|
{
|
||||||
Base *base = NULL;
|
Base *base = NULL;
|
||||||
EditBone *ebone;
|
EditBone *ebone;
|
||||||
base = ED_armature_base_and_ebone_from_select_buffer(
|
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;
|
result = (use_cycle && result_cycle.ebone) ? &result_cycle : &result_bias;
|
||||||
|
|
||||||
if (!(result->hitresult & BONESEL_NOSEL)) {
|
if (result->hitresult != -1) {
|
||||||
*r_base = result->base;
|
*r_base = result->base;
|
||||||
|
|
||||||
*r_selmask = 0;
|
*r_selmask = 0;
|
||||||
|
|||||||
@@ -120,13 +120,11 @@ typedef struct EditBone {
|
|||||||
} temp;
|
} temp;
|
||||||
} EditBone;
|
} EditBone;
|
||||||
|
|
||||||
#define BONESEL_ROOT (1 << 28)
|
#define BONESEL_ROOT (2 << 29u)
|
||||||
#define BONESEL_TIP (1 << 29)
|
#define BONESEL_TIP (1 << 30u)
|
||||||
#define BONESEL_BONE (1 << 30)
|
#define BONESEL_BONE (1 << 31u)
|
||||||
#define BONESEL_ANY (BONESEL_TIP | BONESEL_ROOT | BONESEL_BONE)
|
#define BONESEL_ANY (BONESEL_TIP | BONESEL_ROOT | BONESEL_BONE)
|
||||||
|
|
||||||
#define BONESEL_NOSEL (1u << 31u)
|
|
||||||
|
|
||||||
/* useful macros */
|
/* useful macros */
|
||||||
#define EBONE_VISIBLE(arm, ebone) \
|
#define EBONE_VISIBLE(arm, ebone) \
|
||||||
(CHECK_TYPE_INLINE(arm, bArmature *), \
|
(CHECK_TYPE_INLINE(arm, bArmature *), \
|
||||||
|
|||||||
Reference in New Issue
Block a user