Fix T60107: gizmos should not show for unselectable objects.

This commit is contained in:
Brecht Van Lommel 2019-01-03 12:39:16 +01:00
parent 853a03c555
commit a2d24345bf
Notes: blender-bot 2023-02-14 04:13:39 +01:00
Referenced by issue #60107, Background Image Empty can't be locked from the outliner
5 changed files with 7 additions and 7 deletions

View File

@ -138,7 +138,7 @@ static bool WIDGETGROUP_armature_spline_poll(const bContext *C, wmGizmoGroupType
ViewLayer *view_layer = CTX_data_view_layer(C);
Base *base = BASACT(view_layer);
if (base && BASE_VISIBLE(v3d, base)) {
if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) {
Object *ob = BKE_object_pose_armature_get(base->object);
if (ob) {
const bArmature *arm = ob->data;

View File

@ -72,7 +72,7 @@ static bool WIDGETGROUP_camera_poll(const bContext *C, wmGizmoGroupType *UNUSED(
ViewLayer *view_layer = CTX_data_view_layer(C);
Base *base = BASACT(view_layer);
if (base && BASE_VISIBLE(v3d, base)) {
if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) {
Object *ob = base->object;
if (ob->type == OB_CAMERA) {
Camera *camera = ob->data;

View File

@ -120,7 +120,7 @@ static bool WIDGETGROUP_empty_image_poll(const bContext *C, wmGizmoGroupType *UN
ViewLayer *view_layer = CTX_data_view_layer(C);
Base *base = BASACT(view_layer);
if (base && BASE_VISIBLE(v3d, base)) {
if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) {
Object *ob = base->object;
if (ob->type == OB_EMPTY) {
if (ob->empty_drawtype == OB_EMPTY_IMAGE) {

View File

@ -64,7 +64,7 @@ static bool WIDGETGROUP_forcefield_poll(const bContext *C, wmGizmoGroupType *UNU
ViewLayer *view_layer = CTX_data_view_layer(C);
Base *base = BASACT(view_layer);
if (base && BASE_VISIBLE(v3d, base)) {
if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) {
Object *ob = base->object;
if (ob->pd && ob->pd->forcefield) {
return true;

View File

@ -65,7 +65,7 @@ static bool WIDGETGROUP_lamp_spot_poll(const bContext *C, wmGizmoGroupType *UNUS
ViewLayer *view_layer = CTX_data_view_layer(C);
Base *base = BASACT(view_layer);
if (base && BASE_VISIBLE(v3d, base)) {
if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) {
Object *ob = base->object;
if (ob->type == OB_LAMP) {
Lamp *la = ob->data;
@ -174,7 +174,7 @@ static bool WIDGETGROUP_lamp_area_poll(const bContext *C, wmGizmoGroupType *UNUS
ViewLayer *view_layer = CTX_data_view_layer(C);
Base *base = BASACT(view_layer);
if (base && BASE_VISIBLE(v3d, base)) {
if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) {
Object *ob = base->object;
if (ob->type == OB_LAMP) {
Lamp *la = ob->data;
@ -258,7 +258,7 @@ static bool WIDGETGROUP_lamp_target_poll(const bContext *C, wmGizmoGroupType *UN
ViewLayer *view_layer = CTX_data_view_layer(C);
Base *base = BASACT(view_layer);
if (base && BASE_VISIBLE(v3d, base)) {
if (base && BASE_VISIBLE(v3d, base) && BASE_SELECTABLE(v3d, base)) {
Object *ob = base->object;
if (ob->type == OB_LAMP) {
Lamp *la = ob->data;