Changeset View
Changeset View
Standalone View
Standalone View
source/blender/draw/engines/overlay/overlay_armature.c
| Show First 20 Lines • Show All 1,904 Lines • ▼ Show 20 Lines | static void draw_armature_edit(ArmatureDrawContext *ctx) | ||||
| /* FIXME(campbell): We should be able to use the CoW object, | /* FIXME(campbell): We should be able to use the CoW object, | ||||
| * however the active bone isn't updated. Long term solution is an 'EditArmature' struct. | * however the active bone isn't updated. Long term solution is an 'EditArmature' struct. | ||||
| * for now we can draw from the original armature. See: T66773. */ | * for now we can draw from the original armature. See: T66773. */ | ||||
| // bArmature *arm = ob->data; | // bArmature *arm = ob->data; | ||||
| bArmature *arm = ob_orig->data; | bArmature *arm = ob_orig->data; | ||||
| edbo_compute_bbone_child(arm); | edbo_compute_bbone_child(arm); | ||||
| for (eBone = arm->edbo->first, index = ob_orig->runtime.select_id; eBone; | for (eBone = arm->edbo->first, index = ob->runtime.select_id_cow; eBone; | ||||
fclem: Is this 100% safe? are all edit bones operators flushing updates to evaluated object nowadays? | |||||
Done Inline ActionsWell, tbh, I don't know how I would create an example file that tests this specific case... JacquesLucke: Well, tbh, I don't know how I would create an example file that tests this specific case... | |||||
| eBone = eBone->next, index += 0x10000) { | eBone = eBone->next, index += 0x10000) { | ||||
| if (eBone->layer & arm->layer) { | if (eBone->layer & arm->layer) { | ||||
| if ((eBone->flag & BONE_HIDDEN_A) == 0) { | if ((eBone->flag & BONE_HIDDEN_A) == 0) { | ||||
| const int select_id = is_select ? index : (uint)-1; | const int select_id = is_select ? index : (uint)-1; | ||||
| const short constflag = 0; | const short constflag = 0; | ||||
| /* catch exception for bone with hidden parent */ | /* catch exception for bone with hidden parent */ | ||||
| int boneflag = eBone->flag; | int boneflag = eBone->flag; | ||||
| ▲ Show 20 Lines • Show All 78 Lines • ▼ Show 20 Lines | is_pose_select = | ||||
| (scene->toolsettings->object_flag & SCE_OBJECT_MODE_LOCK) == 0) || | (scene->toolsettings->object_flag & SCE_OBJECT_MODE_LOCK) == 0) || | ||||
| /* Allow selection when in weight-paint mode | /* Allow selection when in weight-paint mode | ||||
| * (selection code ensures this wont become active). */ | * (selection code ensures this wont become active). */ | ||||
| ((draw_ctx->object_mode & OB_MODE_ALL_WEIGHT_PAINT) && | ((draw_ctx->object_mode & OB_MODE_ALL_WEIGHT_PAINT) && | ||||
| (draw_ctx->object_pose != NULL))))) && | (draw_ctx->object_pose != NULL))))) && | ||||
| DRW_state_is_select(); | DRW_state_is_select(); | ||||
| if (is_pose_select) { | if (is_pose_select) { | ||||
| const Object *ob_orig = DEG_get_original_object(ob); | index = ob->runtime.select_id_cow; | ||||
| index = ob_orig->runtime.select_id; | |||||
| } | } | ||||
| } | } | ||||
| /* In weight paint mode retrieve the vertex group lock status. */ | /* In weight paint mode retrieve the vertex group lock status. */ | ||||
| if ((draw_ctx->object_mode & OB_MODE_ALL_WEIGHT_PAINT) && (draw_ctx->object_pose == ob) && | if ((draw_ctx->object_mode & OB_MODE_ALL_WEIGHT_PAINT) && (draw_ctx->object_pose == ob) && | ||||
| (draw_ctx->obact != NULL)) { | (draw_ctx->obact != NULL)) { | ||||
| draw_locked_weights = true; | draw_locked_weights = true; | ||||
| ▲ Show 20 Lines • Show All 280 Lines • Show Last 20 Lines | |||||
Is this 100% safe? are all edit bones operators flushing updates to evaluated object nowadays?
It should be safe but I'm a bit curious to know why this loop was using the original object before.