Merge branch 'master' into sculpt-dev
This commit is contained in:
commit
1199b9e678
|
@ -764,6 +764,10 @@ def brush_settings(layout, context, brush, popover=False):
|
|||
col.prop(brush, "surface_smooth_current_vertex")
|
||||
col.prop(brush, "surface_smooth_iterations")
|
||||
|
||||
elif sculpt_tool == 'DISPLACEMENT_SMEAR':
|
||||
col = layout.column()
|
||||
col.prop(brush, "smear_deform_type")
|
||||
|
||||
elif sculpt_tool == 'MASK':
|
||||
layout.row().prop(brush, "mask_tool", expand=True)
|
||||
|
||||
|
|
|
@ -1840,6 +1840,14 @@ void BKE_brush_sculpt_reset(Brush *br)
|
|||
br->flag &= ~BRUSH_SPACE_ATTEN;
|
||||
br->curve_preset = BRUSH_CURVE_SPHERE;
|
||||
break;
|
||||
case SCULPT_TOOL_DISPLACEMENT_SMEAR:
|
||||
br->alpha = 1.0f;
|
||||
br->spacing = 5;
|
||||
br->hardness = 0.7f;
|
||||
br->flag &= ~BRUSH_ALPHA_PRESSURE;
|
||||
br->flag &= ~BRUSH_SPACE_ATTEN;
|
||||
br->curve_preset = BRUSH_CURVE_SMOOTHER;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
@ -1904,6 +1912,7 @@ void BKE_brush_sculpt_reset(Brush *br)
|
|||
case SCULPT_TOOL_MASK:
|
||||
case SCULPT_TOOL_DRAW_FACE_SETS:
|
||||
case SCULPT_TOOL_DISPLACEMENT_ERASER:
|
||||
case SCULPT_TOOL_DISPLACEMENT_SMEAR:
|
||||
br->add_col[0] = 0.75f;
|
||||
br->add_col[1] = 0.75f;
|
||||
br->add_col[2] = 0.75f;
|
||||
|
|
|
@ -739,6 +739,14 @@ void BLO_update_defaults_startup_blend(Main *bmain, const char *app_template)
|
|||
brush->sculpt_tool = SCULPT_TOOL_DISPLACEMENT_ERASER;
|
||||
}
|
||||
|
||||
brush_name = "Multires Displacement Smear";
|
||||
brush = BLI_findstring(&bmain->brushes, brush_name, offsetof(ID, name) + 2);
|
||||
if (!brush) {
|
||||
brush = BKE_brush_add(bmain, brush_name, OB_MODE_SCULPT);
|
||||
id_us_min(&brush->id);
|
||||
brush->sculpt_tool = SCULPT_TOOL_DISPLACEMENT_SMEAR;
|
||||
}
|
||||
|
||||
brush_name = "Fairing";
|
||||
brush = BLI_findstring(&bmain->brushes, brush_name, offsetof(ID, name) + 2);
|
||||
if (!brush) {
|
||||
|
|
|
@ -150,31 +150,31 @@ static void image_buffer_rect_update(RenderJob *rj,
|
|||
}
|
||||
|
||||
/* xmin here is first subrect x coord, xmax defines subrect width */
|
||||
xmin = renrect->xmin + rr->crop;
|
||||
xmax = renrect->xmax - xmin + rr->crop;
|
||||
xmin = renrect->xmin;
|
||||
xmax = renrect->xmax - xmin;
|
||||
if (xmax < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
ymin = renrect->ymin + rr->crop;
|
||||
ymax = renrect->ymax - ymin + rr->crop;
|
||||
ymin = renrect->ymin;
|
||||
ymax = renrect->ymax - ymin;
|
||||
if (ymax < 2) {
|
||||
return;
|
||||
}
|
||||
renrect->ymin = renrect->ymax;
|
||||
}
|
||||
else {
|
||||
xmin = ymin = rr->crop;
|
||||
xmax = rr->rectx - 2 * rr->crop;
|
||||
ymax = rr->recty - 2 * rr->crop;
|
||||
xmin = ymin = 0;
|
||||
xmax = rr->rectx;
|
||||
ymax = rr->recty;
|
||||
}
|
||||
|
||||
/* xmin ymin is in tile coords. transform to ibuf */
|
||||
rxmin = rr->tilerect.xmin + xmin;
|
||||
rxmin = rr->tilerect.xmin;
|
||||
if (rxmin >= ibuf->x) {
|
||||
return;
|
||||
}
|
||||
rymin = rr->tilerect.ymin + ymin;
|
||||
rymin = rr->tilerect.ymin;
|
||||
if (rymin >= ibuf->y) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -1230,6 +1230,7 @@ static bool sculpt_tool_is_proxy_used(const char sculpt_tool)
|
|||
SCULPT_TOOL_LAYER,
|
||||
SCULPT_TOOL_FAIRING,
|
||||
SCULPT_TOOL_POSE,
|
||||
SCULPT_TOOL_DISPLACEMENT_SMEAR,
|
||||
SCULPT_TOOL_BOUNDARY,
|
||||
SCULPT_TOOL_CLOTH,
|
||||
SCULPT_TOOL_PAINT,
|
||||
|
@ -2367,6 +2368,7 @@ static float brush_strength(const Sculpt *sd,
|
|||
final_pressure = pressure * pressure;
|
||||
return final_pressure * overlap * feather;
|
||||
case SCULPT_TOOL_SMEAR:
|
||||
case SCULPT_TOOL_DISPLACEMENT_SMEAR:
|
||||
return alpha * pressure * overlap * feather;
|
||||
case SCULPT_TOOL_CLAY_STRIPS:
|
||||
/* Clay Strips needs less strength to compensate the curve. */
|
||||
|
@ -3266,6 +3268,147 @@ static void sculpt_fairing_brush_exec_fairing_for_cache(Sculpt *sd, Object *ob)
|
|||
|
||||
/** \} */
|
||||
|
||||
/** \name Sculpt Multires Displacement Smear Brush
|
||||
* \{ */
|
||||
|
||||
static void do_displacement_smear_brush_task_cb_ex(void *__restrict userdata,
|
||||
const int n,
|
||||
const TaskParallelTLS *__restrict tls)
|
||||
{
|
||||
SculptThreadedTaskData *data = userdata;
|
||||
SculptSession *ss = data->ob->sculpt;
|
||||
const Brush *brush = data->brush;
|
||||
const float bstrength = clamp_f(ss->cache->bstrength, 0.0f, 1.0f);
|
||||
|
||||
SculptBrushTest test;
|
||||
SculptBrushTestFn sculpt_brush_test_sq_fn = SCULPT_brush_test_init_with_falloff_shape(
|
||||
ss, &test, data->brush->falloff_shape);
|
||||
const int thread_id = BLI_task_parallel_thread_id(tls);
|
||||
|
||||
PBVHVertexIter vd;
|
||||
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
|
||||
{
|
||||
if (!sculpt_brush_test_sq_fn(&test, vd.co)) {
|
||||
continue;
|
||||
}
|
||||
const float fade = bstrength * SCULPT_brush_strength_factor(ss,
|
||||
brush,
|
||||
vd.co,
|
||||
sqrtf(test.dist),
|
||||
vd.no,
|
||||
vd.fno,
|
||||
vd.mask ? *vd.mask : 0.0f,
|
||||
vd.index,
|
||||
thread_id);
|
||||
|
||||
float current_disp[3];
|
||||
float current_disp_norm[3];
|
||||
float interp_limit_surface_disp[3];
|
||||
|
||||
copy_v3_v3(interp_limit_surface_disp, ss->cache->prev_displacement[vd.index]);
|
||||
|
||||
switch (brush->smear_deform_type) {
|
||||
case BRUSH_SMEAR_DEFORM_DRAG:
|
||||
sub_v3_v3v3(current_disp, ss->cache->location, ss->cache->last_location);
|
||||
break;
|
||||
case BRUSH_SMEAR_DEFORM_PINCH:
|
||||
sub_v3_v3v3(current_disp, ss->cache->location, vd.co);
|
||||
break;
|
||||
case BRUSH_SMEAR_DEFORM_EXPAND:
|
||||
sub_v3_v3v3(current_disp, vd.co, ss->cache->location);
|
||||
break;
|
||||
}
|
||||
|
||||
normalize_v3_v3(current_disp_norm, current_disp);
|
||||
mul_v3_v3fl(current_disp, current_disp_norm, ss->cache->bstrength);
|
||||
|
||||
float weights_accum = 1.0f;
|
||||
|
||||
SculptVertexNeighborIter ni;
|
||||
SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, vd.index, ni) {
|
||||
float vertex_disp[3];
|
||||
float vertex_disp_norm[3];
|
||||
float neighbor_limit_co[3];
|
||||
SCULPT_vertex_limit_surface_get(ss, ni.index, neighbor_limit_co);
|
||||
sub_v3_v3v3(vertex_disp,
|
||||
ss->cache->limit_surface_co[ni.index],
|
||||
ss->cache->limit_surface_co[vd.index]);
|
||||
const float *neighbor_limit_surface_disp = ss->cache->prev_displacement[ni.index];
|
||||
normalize_v3_v3(vertex_disp_norm, vertex_disp);
|
||||
if (dot_v3v3(current_disp_norm, vertex_disp_norm) < 0.0f) {
|
||||
const float disp_interp = clamp_f(
|
||||
-dot_v3v3(current_disp_norm, vertex_disp_norm), 0.0f, 1.0f);
|
||||
madd_v3_v3fl(interp_limit_surface_disp, neighbor_limit_surface_disp, disp_interp);
|
||||
weights_accum += disp_interp;
|
||||
}
|
||||
}
|
||||
SCULPT_VERTEX_NEIGHBORS_ITER_END(ni);
|
||||
|
||||
mul_v3_fl(interp_limit_surface_disp, 1.0f / weights_accum);
|
||||
|
||||
float new_co[3];
|
||||
add_v3_v3v3(new_co, ss->cache->limit_surface_co[vd.index], interp_limit_surface_disp);
|
||||
interp_v3_v3v3(vd.co, vd.co, new_co, fade);
|
||||
|
||||
if (vd.mvert) {
|
||||
vd.mvert->flag |= ME_VERT_PBVH_UPDATE;
|
||||
}
|
||||
}
|
||||
BKE_pbvh_vertex_iter_end;
|
||||
}
|
||||
|
||||
static void do_displacement_smear_store_prev_disp_task_cb_ex(
|
||||
void *__restrict userdata, const int n, const TaskParallelTLS *__restrict UNUSED(tls))
|
||||
{
|
||||
SculptThreadedTaskData *data = userdata;
|
||||
SculptSession *ss = data->ob->sculpt;
|
||||
|
||||
PBVHVertexIter vd;
|
||||
BKE_pbvh_vertex_iter_begin(ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE)
|
||||
{
|
||||
sub_v3_v3v3(ss->cache->prev_displacement[vd.index],
|
||||
SCULPT_vertex_co_get(ss, vd.index),
|
||||
ss->cache->limit_surface_co[vd.index]);
|
||||
}
|
||||
BKE_pbvh_vertex_iter_end;
|
||||
}
|
||||
|
||||
static void do_displacement_smear_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
|
||||
{
|
||||
Brush *brush = BKE_paint_brush(&sd->paint);
|
||||
SculptSession *ss = ob->sculpt;
|
||||
|
||||
BKE_curvemapping_init(brush->curve);
|
||||
|
||||
const int totvert = SCULPT_vertex_count_get(ss);
|
||||
if (!ss->cache->prev_displacement) {
|
||||
ss->cache->prev_displacement = MEM_malloc_arrayN(
|
||||
totvert, sizeof(float[3]), "prev displacement");
|
||||
ss->cache->limit_surface_co = MEM_malloc_arrayN(totvert, sizeof(float[3]), "limit surface co");
|
||||
for (int i = 0; i < totvert; i++) {
|
||||
SCULPT_vertex_limit_surface_get(ss, i, ss->cache->limit_surface_co[i]);
|
||||
sub_v3_v3v3(ss->cache->prev_displacement[i],
|
||||
SCULPT_vertex_co_get(ss, i),
|
||||
ss->cache->limit_surface_co[i]);
|
||||
}
|
||||
}
|
||||
/* Threaded loop over nodes. */
|
||||
SculptThreadedTaskData data = {
|
||||
.sd = sd,
|
||||
.ob = ob,
|
||||
.brush = brush,
|
||||
.nodes = nodes,
|
||||
};
|
||||
|
||||
TaskParallelSettings settings;
|
||||
BKE_pbvh_parallel_range_settings(&settings, true, totnode);
|
||||
BLI_task_parallel_range(
|
||||
0, totnode, &data, do_displacement_smear_store_prev_disp_task_cb_ex, &settings);
|
||||
BLI_task_parallel_range(0, totnode, &data, do_displacement_smear_brush_task_cb_ex, &settings);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
||||
static void do_draw_brush_task_cb_ex(void *__restrict userdata,
|
||||
const int n,
|
||||
const TaskParallelTLS *__restrict tls)
|
||||
|
@ -6090,6 +6233,9 @@ static void do_brush_action(Sculpt *sd, Object *ob, Brush *brush, UnifiedPaintSe
|
|||
case SCULPT_TOOL_DISPLACEMENT_ERASER:
|
||||
do_displacement_eraser_brush(sd, ob, nodes, totnode);
|
||||
break;
|
||||
case SCULPT_TOOL_DISPLACEMENT_SMEAR:
|
||||
do_displacement_smear_brush(sd, ob, nodes, totnode);
|
||||
break;
|
||||
case SCULPT_TOOL_PAINT:
|
||||
SCULPT_do_paint_brush(sd, ob, nodes, totnode);
|
||||
break;
|
||||
|
@ -6685,6 +6831,8 @@ static const char *sculpt_tool_name(Sculpt *sd)
|
|||
return "Draw Face Sets";
|
||||
case SCULPT_TOOL_DISPLACEMENT_ERASER:
|
||||
return "Multires Displacement Eraser";
|
||||
case SCULPT_TOOL_DISPLACEMENT_SMEAR:
|
||||
return "Multires Displacement Smear";
|
||||
case SCULPT_TOOL_PAINT:
|
||||
return "Paint Brush";
|
||||
case SCULPT_TOOL_SMEAR:
|
||||
|
@ -6710,6 +6858,8 @@ void SCULPT_cache_free(StrokeCache *cache)
|
|||
MEM_SAFE_FREE(cache->prefairing_co);
|
||||
MEM_SAFE_FREE(cache->fairing_fade);
|
||||
MEM_SAFE_FREE(cache->fairing_mask);
|
||||
MEM_SAFE_FREE(cache->prev_displacement);
|
||||
MEM_SAFE_FREE(cache->limit_surface_co);
|
||||
|
||||
if (cache->pose_ik_chain) {
|
||||
SCULPT_pose_ik_chain_free(cache->pose_ik_chain);
|
||||
|
@ -6881,6 +7031,7 @@ static void sculpt_update_cache_invariants(
|
|||
SCULPT_TOOL_MASK,
|
||||
SCULPT_TOOL_SMOOTH,
|
||||
SCULPT_TOOL_SIMPLIFY,
|
||||
SCULPT_TOOL_DISPLACEMENT_SMEAR,
|
||||
SCULPT_TOOL_DISPLACEMENT_ERASER) &&
|
||||
(sd->gravity_factor > 0.0f));
|
||||
/* Get gravity vector in world space. */
|
||||
|
|
|
@ -935,6 +935,10 @@ typedef struct StrokeCache {
|
|||
|
||||
float (*prev_colors)[4];
|
||||
|
||||
/* Multires Displacement Smear. */
|
||||
float (*prev_displacement)[3];
|
||||
float (*limit_surface_co)[3];
|
||||
|
||||
/* The rest is temporary storage that isn't saved as a property */
|
||||
|
||||
bool first_time; /* Beginning of stroke may do some things special */
|
||||
|
|
|
@ -457,7 +457,8 @@ typedef enum eBrushSculptTool {
|
|||
SCULPT_TOOL_SMEAR = 29,
|
||||
SCULPT_TOOL_BOUNDARY = 30,
|
||||
SCULPT_TOOL_DISPLACEMENT_ERASER = 31,
|
||||
SCULPT_TOOL_FAIRING = 32,
|
||||
SCULPT_TOOL_DISPLACEMENT_SMEAR = 32,
|
||||
SCULPT_TOOL_FAIRING = 33,
|
||||
} eBrushSculptTool;
|
||||
|
||||
/* Brush.uv_sculpt_tool */
|
||||
|
|
|
@ -373,7 +373,7 @@ typedef struct Brush {
|
|||
typedef struct tPaletteColorHSV {
|
||||
float rgb[3];
|
||||
float value;
|
||||
float h;
|
||||
float h;
|
||||
float s;
|
||||
float v;
|
||||
} tPaletteColorHSV;
|
||||
|
|
|
@ -134,6 +134,7 @@ const EnumPropertyItem rna_enum_brush_sculpt_tool_items[] = {
|
|||
{SCULPT_TOOL_SIMPLIFY, "SIMPLIFY", ICON_BRUSH_DATA, "Simplify", ""},
|
||||
{SCULPT_TOOL_MASK, "MASK", ICON_BRUSH_MASK, "Mask", ""},
|
||||
{SCULPT_TOOL_DISPLACEMENT_ERASER, "DISPLACEMENT_ERASER", ICON_BRUSH_SCULPT_DRAW, "Multires Displacement Eraser", ""},
|
||||
{SCULPT_TOOL_DISPLACEMENT_SMEAR, "DISPLACEMENT_SMEAR", ICON_BRUSH_SCULPT_DRAW, "Multires Displacement Smear", ""},
|
||||
{SCULPT_TOOL_PAINT, "PAINT", ICON_BRUSH_SCULPT_DRAW, "Paint", ""},
|
||||
{SCULPT_TOOL_SMEAR, "SMEAR", ICON_BRUSH_SCULPT_DRAW, "Smear", ""},
|
||||
{SCULPT_TOOL_FAIRING, "FAIRING", ICON_BRUSH_MASK, "Fairing", ""},
|
||||
|
|
|
@ -114,7 +114,7 @@ typedef struct RenderResult {
|
|||
|
||||
/* target image size */
|
||||
int rectx, recty;
|
||||
short crop, sample_nr;
|
||||
short sample_nr;
|
||||
|
||||
/* The following rect32, rectf and rectz buffers are for temporary storage only,
|
||||
* for RenderResult structs created in #RE_AcquireResultImage - which do not have RenderView */
|
||||
|
|
|
@ -288,7 +288,7 @@ RenderResult *RE_engine_begin_result(
|
|||
disprect.ymin = y;
|
||||
disprect.ymax = y + h;
|
||||
|
||||
result = render_result_new(re, &disprect, 0, RR_USE_MEM, layername, viewname);
|
||||
result = render_result_new(re, &disprect, RR_USE_MEM, layername, viewname);
|
||||
|
||||
/* todo: make this thread safe */
|
||||
|
||||
|
@ -846,7 +846,7 @@ int RE_engine_render(Render *re, int do_all)
|
|||
if ((type->flag & RE_USE_SAVE_BUFFERS) && (re->r.scemode & R_EXR_TILE_FILE)) {
|
||||
savebuffers = RR_USE_EXR;
|
||||
}
|
||||
re->result = render_result_new(re, &re->disprect, 0, savebuffers, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
||||
re->result = render_result_new(re, &re->disprect, savebuffers, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
||||
}
|
||||
BLI_rw_mutex_unlock(&re->resultmutex);
|
||||
|
||||
|
|
|
@ -905,7 +905,7 @@ static void render_result_rescale(Render *re)
|
|||
|
||||
if (src_rectf != NULL) {
|
||||
float *dst_rectf = NULL;
|
||||
re->result = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS, "");
|
||||
re->result = render_result_new(re, &re->disprect, RR_USE_MEM, RR_ALL_LAYERS, "");
|
||||
|
||||
if (re->result != NULL) {
|
||||
dst_rectf = RE_RenderViewGetById(re->result, 0)->rectf;
|
||||
|
@ -1162,7 +1162,7 @@ static void render_result_uncrop(Render *re)
|
|||
/* weak is: it chances disprect from border */
|
||||
render_result_disprect_to_full_resolution(re);
|
||||
|
||||
rres = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
||||
rres = render_result_new(re, &re->disprect, RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
||||
rres->stamp_data = BKE_stamp_data_copy(re->result->stamp_data);
|
||||
|
||||
render_result_clone_passes(re, rres, NULL);
|
||||
|
@ -1358,7 +1358,7 @@ static void do_render_composite(Render *re)
|
|||
if ((re->r.mode & R_CROP) == 0) {
|
||||
render_result_disprect_to_full_resolution(re);
|
||||
}
|
||||
re->result = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
||||
re->result = render_result_new(re, &re->disprect, RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
||||
|
||||
BLI_rw_mutex_unlock(&re->resultmutex);
|
||||
|
||||
|
|
|
@ -285,12 +285,8 @@ RenderPass *render_layer_add_pass(RenderResult *rr,
|
|||
/* will read info from Render *re to define layers */
|
||||
/* called in threads */
|
||||
/* re->winx,winy is coordinate space of entire image, partrct the part within */
|
||||
RenderResult *render_result_new(Render *re,
|
||||
rcti *partrct,
|
||||
int crop,
|
||||
int savebuffers,
|
||||
const char *layername,
|
||||
const char *viewname)
|
||||
RenderResult *render_result_new(
|
||||
Render *re, rcti *partrct, int savebuffers, const char *layername, const char *viewname)
|
||||
{
|
||||
RenderResult *rr;
|
||||
RenderLayer *rl;
|
||||
|
@ -308,9 +304,7 @@ RenderResult *render_result_new(Render *re,
|
|||
rr->rectx = rectx;
|
||||
rr->recty = recty;
|
||||
rr->renrect.xmin = 0;
|
||||
rr->renrect.xmax = rectx - 2 * crop;
|
||||
/* crop is one or two extra pixels rendered for filtering, is used for merging and display too */
|
||||
rr->crop = crop;
|
||||
rr->renrect.xmax = rectx;
|
||||
|
||||
/* tilerect is relative coordinates within render disprect. do not subtract crop yet */
|
||||
rr->tilerect.xmin = partrct->xmin - re->disprect.xmin;
|
||||
|
@ -827,20 +821,8 @@ static void do_merge_tile(
|
|||
copylen = tilex = rrpart->rectx;
|
||||
tiley = rrpart->recty;
|
||||
|
||||
if (rrpart->crop) { /* filters add pixel extra */
|
||||
tile += pixsize * (rrpart->crop + ((size_t)rrpart->crop) * tilex);
|
||||
|
||||
copylen = tilex - 2 * rrpart->crop;
|
||||
tiley -= 2 * rrpart->crop;
|
||||
|
||||
ofs = (((size_t)rrpart->tilerect.ymin) + rrpart->crop) * rr->rectx +
|
||||
(rrpart->tilerect.xmin + rrpart->crop);
|
||||
target += pixsize * ofs;
|
||||
}
|
||||
else {
|
||||
ofs = (((size_t)rrpart->tilerect.ymin) * rr->rectx + rrpart->tilerect.xmin);
|
||||
target += pixsize * ofs;
|
||||
}
|
||||
ofs = (((size_t)rrpart->tilerect.ymin) * rr->rectx + rrpart->tilerect.xmin);
|
||||
target += pixsize * ofs;
|
||||
|
||||
copylen *= sizeof(float) * pixsize;
|
||||
tilex *= pixsize;
|
||||
|
@ -1107,7 +1089,7 @@ static void save_render_result_tile(RenderResult *rr, RenderResult *rrpart, cons
|
|||
{
|
||||
RenderLayer *rlp, *rl;
|
||||
RenderPass *rpassp;
|
||||
int offs, partx, party;
|
||||
int partx, party;
|
||||
|
||||
BLI_thread_lock(LOCK_IMAGE);
|
||||
|
||||
|
@ -1120,13 +1102,6 @@ static void save_render_result_tile(RenderResult *rr, RenderResult *rrpart, cons
|
|||
continue;
|
||||
}
|
||||
|
||||
if (rrpart->crop) { /* filters add pixel extra */
|
||||
offs = (rrpart->crop + rrpart->crop * rrpart->rectx);
|
||||
}
|
||||
else {
|
||||
offs = 0;
|
||||
}
|
||||
|
||||
/* passes are allocated in sync */
|
||||
for (rpassp = rlp->passes.first; rpassp; rpassp = rpassp->next) {
|
||||
const int xstride = rpassp->channels;
|
||||
|
@ -1141,13 +1116,13 @@ static void save_render_result_tile(RenderResult *rr, RenderResult *rrpart, cons
|
|||
fullname,
|
||||
xstride,
|
||||
xstride * rrpart->rectx,
|
||||
rpassp->rect + a + xstride * offs);
|
||||
rpassp->rect + a);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
party = rrpart->tilerect.ymin + rrpart->crop;
|
||||
partx = rrpart->tilerect.xmin + rrpart->crop;
|
||||
party = rrpart->tilerect.ymin;
|
||||
partx = rrpart->tilerect.xmin;
|
||||
|
||||
for (rlp = rrpart->layers.first; rlp; rlp = rlp->next) {
|
||||
rl = RE_GetRenderLayer(rr, rlp->name);
|
||||
|
@ -1267,7 +1242,7 @@ void render_result_exr_file_end(Render *re, RenderEngine *engine)
|
|||
/* Create new render result in memory instead of on disk. */
|
||||
BLI_rw_mutex_lock(&re->resultmutex, THREAD_LOCK_WRITE);
|
||||
render_result_free_list(&re->fullresult, re->result);
|
||||
re->result = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
||||
re->result = render_result_new(re, &re->disprect, RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
||||
BLI_rw_mutex_unlock(&re->resultmutex);
|
||||
|
||||
LISTBASE_FOREACH (RenderLayer *, rl, &re->result->layers) {
|
||||
|
@ -1429,7 +1404,7 @@ bool render_result_exr_file_cache_read(Render *re)
|
|||
char *root = U.render_cachedir;
|
||||
|
||||
RE_FreeRenderResult(re->result);
|
||||
re->result = render_result_new(re, &re->disprect, 0, RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
||||
re->result = render_result_new(re, &re->disprect, RR_USE_MEM, RR_ALL_LAYERS, RR_ALL_VIEWS);
|
||||
|
||||
/* First try cache. */
|
||||
render_result_exr_file_cache_path(re->scene, root, str);
|
||||
|
|
|
@ -51,7 +51,6 @@ extern "C" {
|
|||
|
||||
struct RenderResult *render_result_new(struct Render *re,
|
||||
struct rcti *partrct,
|
||||
int crop,
|
||||
int savebuffers,
|
||||
const char *layername,
|
||||
const char *viewname);
|
||||
|
|
Loading…
Reference in New Issue