Fix polling function for background image removal not checking linked ID.
Linked ID is (almost) never editable... Also rename that function to add the `_poll` suffix.
This commit is contained in:
parent
e7544e3ce4
commit
fb62fcf071
|
@ -596,7 +596,7 @@ bool ED_operator_posemode_context(struct bContext *C);
|
|||
bool ED_operator_posemode(struct bContext *C);
|
||||
bool ED_operator_posemode_local(struct bContext *C);
|
||||
bool ED_operator_mask(struct bContext *C);
|
||||
bool ED_operator_camera(struct bContext *C);
|
||||
bool ED_operator_camera_poll(struct bContext *C);
|
||||
|
||||
/* screen_user_menu.c */
|
||||
|
||||
|
|
|
@ -685,10 +685,10 @@ bool ED_operator_mask(bContext *C)
|
|||
return false;
|
||||
}
|
||||
|
||||
bool ED_operator_camera(bContext *C)
|
||||
bool ED_operator_camera_poll(bContext *C)
|
||||
{
|
||||
struct Camera *cam = CTX_data_pointer_get_type(C, "camera", &RNA_Camera).data;
|
||||
return (cam != NULL);
|
||||
return (cam != NULL && !ID_IS_LINKED(cam));
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -653,7 +653,7 @@ void VIEW3D_OT_background_image_remove(wmOperatorType *ot)
|
|||
|
||||
/* api callbacks */
|
||||
ot->exec = background_image_remove_exec;
|
||||
ot->poll = ED_operator_camera;
|
||||
ot->poll = ED_operator_camera_poll;
|
||||
|
||||
/* flags */
|
||||
ot->flag = 0;
|
||||
|
|
Loading…
Reference in New Issue