Sculpt: fix T103454: SCULPT_vertex_is_occluded is not compatible with
filters
This commit is contained in:
parent
daedf19315
commit
bc3da3ad41
Notes:
blender-bot
2023-02-14 01:35:49 +01:00
Referenced by issue #103454, Sculpt Color/Mesh/Cloth filter auto-masking crash when occlusion is used (missing StrokeCache)
|
@ -6225,9 +6225,12 @@ bool SCULPT_vertex_is_occluded(SculptSession *ss, PBVHVertRef vertex, bool origi
|
|||
copy_v3_v3(co, SCULPT_vertex_co_get(ss, vertex));
|
||||
float mouse[2];
|
||||
|
||||
ED_view3d_project_float_v2_m4(ss->cache->vc->region, co, mouse, ss->cache->projection_mat);
|
||||
ViewContext *vc = ss->cache ? ss->cache->vc : &ss->filter_cache->vc;
|
||||
|
||||
int depth = SCULPT_raycast_init(ss->cache->vc, mouse, ray_end, ray_start, ray_normal, original);
|
||||
ED_view3d_project_float_v2_m4(
|
||||
vc->region, co, mouse, ss->cache ? ss->cache->projection_mat : ss->filter_cache->viewmat);
|
||||
|
||||
int depth = SCULPT_raycast_init(vc, mouse, ray_end, ray_start, ray_normal, original);
|
||||
|
||||
negate_v3(ray_normal);
|
||||
|
||||
|
|
|
@ -152,6 +152,8 @@ void SCULPT_filter_cache_init(bContext *C,
|
|||
Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C);
|
||||
ViewContext vc;
|
||||
ED_view3d_viewcontext_init(C, &vc, depsgraph);
|
||||
|
||||
ss->filter_cache->vc = vc;
|
||||
copy_m4_m4(ss->filter_cache->viewmat, vc.rv3d->viewmat);
|
||||
copy_m4_m4(ss->filter_cache->viewmat_inv, vc.rv3d->viewinv);
|
||||
|
||||
|
|
|
@ -22,6 +22,8 @@
|
|||
#include "BLI_gsqueue.h"
|
||||
#include "BLI_threads.h"
|
||||
|
||||
#include "ED_view3d.h"
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
@ -486,6 +488,8 @@ typedef struct FilterCache {
|
|||
|
||||
/* Pre-smoothed colors used by sharpening. Colors are HSL. */
|
||||
float (*pre_smoothed_color)[4];
|
||||
|
||||
ViewContext vc;
|
||||
} FilterCache;
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue