diff options
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_add.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_edit.c | 10 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 10 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_transform.c | 16 |
6 files changed, 26 insertions, 28 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index 0ce58461268..5ad6e2d557c 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -999,7 +999,7 @@ static int convert_poll(bContext *C) Object *obact= CTX_data_active_object(C); Scene *scene= CTX_data_scene(C); - return (!scene->id.lib && obact && scene->obedit != obact && (obact->flag & SELECT)); + return (!scene->id.lib && obact && scene->obedit != obact && (obact->flag & SELECT) && !(obact->id.lib)); } static int convert_exec(bContext *C, wmOperator *op) @@ -1510,7 +1510,7 @@ static int join_poll(bContext *C) { Object *ob= CTX_data_active_object(C); - if (!ob) return 0; + if (!ob || ob->id.lib) return 0; if (ELEM4(ob->type, OB_MESH, OB_CURVE, OB_SURF, OB_ARMATURE)) return ED_operator_screenactive(C); @@ -1563,7 +1563,7 @@ static int join_shapes_poll(bContext *C) { Object *ob= CTX_data_active_object(C); - if (!ob) return 0; + if (!ob || ob->id.lib) return 0; /* only meshes supported at the moment */ if (ob->type == OB_MESH) diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index eababfe8080..19ba5f7b32b 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -885,7 +885,7 @@ void OBJECT_OT_constraints_clear(wmOperatorType *ot) /* callbacks */ ot->exec= object_constraints_clear_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; } /************************ add constraint operators *********************/ @@ -1212,7 +1212,7 @@ void OBJECT_OT_constraint_add(wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= object_constraint_add_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -1231,7 +1231,7 @@ void OBJECT_OT_constraint_add_with_targets(wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= object_constraint_add_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c index 4678ee35fcd..4fed6108f86 100644 --- a/source/blender/editors/object/object_edit.c +++ b/source/blender/editors/object/object_edit.c @@ -553,7 +553,7 @@ void OBJECT_OT_posemode_toggle(wmOperatorType *ot) /* api callbacks */ ot->exec= posemode_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flag */ ot->flag= OPTYPE_REGISTER; @@ -1651,6 +1651,7 @@ void OBJECT_OT_shade_flat(wmOperatorType *ot) ot->idname= "OBJECT_OT_shade_flat"; /* api callbacks */ + ot->poll= ED_operator_object_active_editable; ot->exec= shade_smooth_exec; /* flags */ @@ -1664,8 +1665,9 @@ void OBJECT_OT_shade_smooth(wmOperatorType *ot) ot->idname= "OBJECT_OT_shade_smooth"; /* api callbacks */ + ot->poll= ED_operator_object_active_editable; ot->exec= shade_smooth_exec; - + /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; } @@ -1958,7 +1960,7 @@ void OBJECT_OT_mode_set(wmOperatorType *ot) /* api callbacks */ ot->exec= object_mode_set_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -2013,6 +2015,7 @@ void OBJECT_OT_game_property_new(wmOperatorType *ot) /* api callbacks */ ot->exec= game_property_new; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -2049,6 +2052,7 @@ void OBJECT_OT_game_property_remove(wmOperatorType *ot) /* api callbacks */ ot->exec= game_property_remove; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 88763f63f7b..0c1e6b86a99 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -542,7 +542,7 @@ void OBJECT_OT_modifier_add(wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_menu_invoke; ot->exec= modifier_add_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -574,7 +574,6 @@ void OBJECT_OT_modifier_remove(wmOperatorType *ot) ot->name= "Remove Modifier"; ot->description= "Remove a modifier from the active object."; ot->idname= "OBJECT_OT_modifier_remove"; - ot->poll= ED_operator_object_active; ot->exec= modifier_remove_exec; ot->poll= modifier_poll; @@ -605,7 +604,6 @@ void OBJECT_OT_modifier_move_up(wmOperatorType *ot) ot->name= "Move Up Modifier"; ot->description= "Move modifier up in the stack."; ot->idname= "OBJECT_OT_modifier_move_up"; - ot->poll= ED_operator_object_active; ot->exec= modifier_move_up_exec; ot->poll= modifier_poll; @@ -636,7 +634,6 @@ void OBJECT_OT_modifier_move_down(wmOperatorType *ot) ot->name= "Move Down Modifier"; ot->description= "Move modifier down in the stack."; ot->idname= "OBJECT_OT_modifier_move_down"; - ot->poll= ED_operator_object_active; ot->exec= modifier_move_down_exec; ot->poll= modifier_poll; @@ -674,7 +671,6 @@ void OBJECT_OT_modifier_apply(wmOperatorType *ot) ot->name= "Apply Modifier"; ot->description= "Apply modifier and remove from the stack."; ot->idname= "OBJECT_OT_modifier_apply"; - ot->poll= ED_operator_object_active; //ot->invoke= WM_menu_invoke; ot->exec= modifier_apply_exec; @@ -709,7 +705,6 @@ void OBJECT_OT_modifier_convert(wmOperatorType *ot) ot->name= "Convert Modifier"; ot->description= "Convert particles to a mesh object."; ot->idname= "OBJECT_OT_modifier_convert"; - ot->poll= ED_operator_object_active; ot->exec= modifier_convert_exec; ot->poll= modifier_poll; @@ -740,7 +735,6 @@ void OBJECT_OT_modifier_copy(wmOperatorType *ot) ot->name= "Copy Modifier"; ot->description= "Duplicate modifier at the same position in the stack."; ot->idname= "OBJECT_OT_modifier_copy"; - ot->poll= ED_operator_object_active; ot->exec= modifier_copy_exec; ot->poll= modifier_poll; @@ -769,7 +763,7 @@ void OBJECT_OT_multires_higher_levels_delete(wmOperatorType *ot) { ot->name= "Delete Higher Levels"; ot->idname= "OBJECT_OT_multires_higher_levels_delete"; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; ot->exec= multires_higher_levels_delete_exec; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 749b1e34651..b8839360296 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -475,7 +475,7 @@ void OBJECT_OT_parent_clear(wmOperatorType *ot) ot->invoke= WM_menu_invoke; ot->exec= parent_clear_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -733,7 +733,7 @@ void OBJECT_OT_parent_set(wmOperatorType *ot) ot->invoke= parent_set_invoke; ot->exec= parent_set_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -788,7 +788,7 @@ void OBJECT_OT_parent_no_inverse_set(wmOperatorType *ot) /* api callbacks */ ot->invoke= WM_operator_confirm; ot->exec= parent_noinv_set_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index d990df72c0d..69a2315fd5d 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -119,7 +119,7 @@ void OBJECT_OT_location_clear(wmOperatorType *ot) /* api callbacks */ ot->exec= object_location_clear_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -255,7 +255,7 @@ void OBJECT_OT_rotation_clear(wmOperatorType *ot) /* api callbacks */ ot->exec= object_rotation_clear_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -313,7 +313,7 @@ void OBJECT_OT_scale_clear(wmOperatorType *ot) /* api callbacks */ ot->exec= object_scale_clear_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -357,7 +357,7 @@ void OBJECT_OT_origin_clear(wmOperatorType *ot) /* api callbacks */ ot->exec= object_origin_clear_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -579,7 +579,7 @@ void OBJECT_OT_visual_transform_apply(wmOperatorType *ot) /* api callbacks */ ot->exec= visual_transform_apply_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -599,7 +599,7 @@ void OBJECT_OT_location_apply(wmOperatorType *ot) /* api callbacks */ ot->exec= location_apply_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -619,7 +619,7 @@ void OBJECT_OT_scale_apply(wmOperatorType *ot) /* api callbacks */ ot->exec= scale_apply_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; @@ -639,7 +639,7 @@ void OBJECT_OT_rotation_apply(wmOperatorType *ot) /* api callbacks */ ot->exec= rotation_apply_exec; - ot->poll= ED_operator_object_active; + ot->poll= ED_operator_object_active_editable; /* flags */ ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO; |