Update the view3d depth buffer cache after rotating, moving, or scaling the view (for sculptmode)
This commit is contained in:
@@ -72,7 +72,7 @@ void window_to_3d_delta(struct ARegion *ar, float *vec, short mx, short my);
|
||||
|
||||
/* Depth buffer */
|
||||
float read_cached_depth(struct ViewContext *vc, int x, int y);
|
||||
void request_depth_update(struct ViewContext *vc);
|
||||
void request_depth_update(struct RegionView3D *rv3d);
|
||||
|
||||
/* Projection */
|
||||
#define IS_CLIPPED 12000
|
||||
|
||||
@@ -1522,8 +1522,6 @@ static int sculpt_brush_stroke_modal(bContext *C, wmOperator *op, wmEvent *event
|
||||
{
|
||||
PointerRNA itemptr;
|
||||
Sculpt *sd = CTX_data_tool_settings(C)->sculpt;
|
||||
Object *ob= CTX_data_active_object(C);
|
||||
ARegion *ar = CTX_wm_region(C);
|
||||
float center[3];
|
||||
int mouse[2] = {event->x, event->y};
|
||||
|
||||
@@ -1547,7 +1545,7 @@ static int sculpt_brush_stroke_modal(bContext *C, wmOperator *op, wmEvent *event
|
||||
|
||||
/* Finished */
|
||||
if(event->type == LEFTMOUSE && event->val == 0) {
|
||||
request_depth_update(&sd->session->cache->vc);
|
||||
request_depth_update(sd->session->cache->vc.rv3d);
|
||||
|
||||
sculpt_cache_free(sd->session->cache);
|
||||
|
||||
|
||||
@@ -503,6 +503,7 @@ static int viewrotate_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
default:
|
||||
if(event->type==vod->origkey && event->val==0) {
|
||||
request_depth_update(CTX_wm_region_view3d(C));
|
||||
|
||||
MEM_freeN(vod);
|
||||
op->customdata= NULL;
|
||||
@@ -598,6 +599,7 @@ static int viewmove_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
default:
|
||||
if(event->type==vod->origkey && event->val==0) {
|
||||
request_depth_update(CTX_wm_region_view3d(C));
|
||||
|
||||
MEM_freeN(vod);
|
||||
op->customdata= NULL;
|
||||
@@ -753,6 +755,7 @@ static int viewzoom_modal(bContext *C, wmOperator *op, wmEvent *event)
|
||||
|
||||
default:
|
||||
if(event->type==vod->origkey && event->val==0) {
|
||||
request_depth_update(CTX_wm_region_view3d(C));
|
||||
|
||||
MEM_freeN(vod);
|
||||
op->customdata= NULL;
|
||||
@@ -789,6 +792,7 @@ static int viewzoom_exec(bContext *C, wmOperator *op)
|
||||
if(rv3d->viewlock)
|
||||
view3d_boxview_sync(CTX_wm_area(C), CTX_wm_region(C));
|
||||
|
||||
request_depth_update(CTX_wm_region_view3d(C));
|
||||
ED_region_tag_redraw(CTX_wm_region(C));
|
||||
|
||||
return OPERATOR_FINISHED;
|
||||
|
||||
@@ -525,10 +525,10 @@ float read_cached_depth(ViewContext *vc, int x, int y)
|
||||
return 1;
|
||||
}
|
||||
|
||||
void request_depth_update(ViewContext *vc)
|
||||
void request_depth_update(RegionView3D *rv3d)
|
||||
{
|
||||
if(vc->rv3d->depths)
|
||||
vc->rv3d->depths->damaged= 1;
|
||||
if(rv3d->depths)
|
||||
rv3d->depths->damaged= 1;
|
||||
}
|
||||
|
||||
void view3d_get_object_project_mat(RegionView3D *rv3d, Object *ob, float pmat[4][4], float vmat[4][4])
|
||||
|
||||
Reference in New Issue
Block a user