now dragging an image onto an empty can be done without holding Ctrl.

Make it set the empty draw type for existing empty object.
change from yakca on IRC

also some whitespace cleanup.
This commit is contained in:
Campbell Barton
2013-03-02 12:05:25 +00:00
parent 8f01b50e14
commit 7d5c51a96f
4 changed files with 17 additions and 20 deletions

View File

@@ -1057,10 +1057,10 @@ static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode)
node->prim_indices,
node->totprim);
break;
case PBVH_BMESH:
case PBVH_BMESH:
node->draw_buffers =
GPU_build_bmesh_buffers(bvh->flags &
PBVH_DYNTOPO_SMOOTH_SHADING);
GPU_build_bmesh_buffers(bvh->flags &
PBVH_DYNTOPO_SMOOTH_SHADING);
break;
}
@@ -1089,12 +1089,12 @@ static void pbvh_update_draw_buffers(PBVH *bvh, PBVHNode **nodes, int totnode)
node->face_vert_indices,
bvh->show_diffuse_color);
break;
case PBVH_BMESH:
case PBVH_BMESH:
GPU_update_bmesh_buffers(node->draw_buffers,
bvh->bm,
node->bm_faces,
node->bm_unique_verts,
node->bm_other_verts);
bvh->bm,
node->bm_faces,
node->bm_unique_verts,
node->bm_other_verts);
break;
}

View File

@@ -2951,7 +2951,7 @@ void MESH_OT_select_random(wmOperatorType *ot)
/* props */
RNA_def_float_percentage(ot->srna, "percent", 50.f, 0.0f, 100.0f,
"Percent", "Percentage of elements to select randomly", 0.f, 100.0f);
RNA_def_boolean(ot->srna, "extend", false, "Extend", "Extend the selection");
RNA_def_boolean(ot->srna, "extend", false, "Extend", "Extend the selection");
}
static int edbm_select_next_loop_exec(bContext *C, wmOperator *UNUSED(op))

View File

@@ -777,16 +777,16 @@ static int empty_drop_named_image_invoke(bContext *C, wmOperator *op, wmEvent *e
return OPERATOR_CANCELLED;
ob = ED_object_add_type(C, OB_EMPTY, NULL, rot, FALSE, layer);
ob->empty_drawtype = OB_EMPTY_IMAGE;
/* add under the mouse */
ED_object_location_from_view(C, ob->loc);
ED_view3d_cursor3d_position(C, ob->loc, event->mval);
}
ob->empty_drawtype = OB_EMPTY_IMAGE;
ob->data = ima;
return OPERATOR_FINISHED;
return OPERATOR_FINISHED;
}
void OBJECT_OT_drop_named_image(wmOperatorType *ot)

View File

@@ -526,15 +526,12 @@ static int view3d_ima_bg_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
static int view3d_ima_empty_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
{
Base *base;
Base *base = ED_view3d_give_base_under_cursor(C, event->mval);
if (!event->ctrl)
return false;
base = ED_view3d_give_base_under_cursor(C, event->mval);
if (!base || (base && base->object->type == OB_EMPTY)) {
/* either holding and ctrl and no object, or dropping to empty */
if ((event->ctrl && !base) || (base && base->object->type == OB_EMPTY))
return view3d_ima_drop_poll(C, drag, event);
}
return 0;
}
@@ -543,8 +540,8 @@ static int view3d_ima_mesh_drop_poll(bContext *C, wmDrag *drag, wmEvent *event)
Base *base = ED_view3d_give_base_under_cursor(C, event->mval);
if (base && base->object->type == OB_MESH)
return view3d_ima_drop_poll(C, drag, event);
return 0;
return view3d_ima_drop_poll(C, drag, event);
return 0;
}
static void view3d_ob_drop_copy(wmDrag *drag, wmDropBox *drop)