forked from bartvdbraak/blender
- weight paint poll would crash if no area was found.
- don't print a line for each operator run when in background mode. - extrude was using an invalid type for RNA access.
This commit is contained in:
parent
a69524358b
commit
fc7c3c663e
@ -728,7 +728,7 @@ static int mesh_extrude_invoke(bContext *C, wmOperator *op, wmEvent *UNUSED(even
|
||||
Object *obedit= CTX_data_edit_object(C);
|
||||
EditMesh *em= BKE_mesh_get_editmesh((Mesh *)obedit->data);
|
||||
|
||||
extrude_mesh(obedit, em, op, RNA_int_get(op->ptr, "type"));
|
||||
extrude_mesh(obedit, em, op, RNA_enum_get(op->ptr, "type"));
|
||||
|
||||
BKE_mesh_end_editmesh(obedit->data, em);
|
||||
|
||||
|
@ -127,15 +127,18 @@ int weight_paint_mode_poll(bContext *C)
|
||||
|
||||
int weight_paint_poll(bContext *C)
|
||||
{
|
||||
Object *ob = CTX_data_active_object(C);
|
||||
Object *ob= CTX_data_active_object(C);
|
||||
ScrArea *sa;
|
||||
|
||||
if(ob && ob->mode & OB_MODE_WEIGHT_PAINT &&
|
||||
paint_brush(&CTX_data_tool_settings(C)->wpaint->paint)) {
|
||||
ScrArea *sa= CTX_wm_area(C);
|
||||
if(sa->spacetype==SPACE_VIEW3D) {
|
||||
ARegion *ar= CTX_wm_region(C);
|
||||
if(ar->regiontype==RGN_TYPE_WINDOW)
|
||||
return 1;
|
||||
if( (ob != NULL) &&
|
||||
(ob->mode & OB_MODE_WEIGHT_PAINT) &&
|
||||
(paint_brush(&CTX_data_tool_settings(C)->wpaint->paint) != NULL) &&
|
||||
(sa= CTX_wm_area(C)) &&
|
||||
(sa->spacetype == SPACE_VIEW3D)
|
||||
) {
|
||||
ARegion *ar= CTX_wm_region(C);
|
||||
if(ar->regiontype==RGN_TYPE_WINDOW) {
|
||||
return 1;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
|
@ -446,10 +446,12 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int pop
|
||||
wm_operator_print(C, op); /* todo - this print may double up, might want to check more flags then the FINISHED */
|
||||
|
||||
if (op->type->flag & OPTYPE_REGISTER) {
|
||||
/* Report the python string representation of the operator */
|
||||
char *buf = WM_operator_pystring(C, op->type, op->ptr, 1);
|
||||
BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
|
||||
MEM_freeN(buf);
|
||||
if(G.background == 0) { /* ends up printing these in the terminal, gets annoying */
|
||||
/* Report the python string representation of the operator */
|
||||
char *buf = WM_operator_pystring(C, op->type, op->ptr, 1);
|
||||
BKE_report(CTX_wm_reports(C), RPT_OPERATOR, buf);
|
||||
MEM_freeN(buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user