Merge branch 'master' into blender2.8

This commit is contained in:
Campbell Barton 2018-01-25 10:31:37 +11:00
commit 032129ef35
6 changed files with 29 additions and 10 deletions

View File

@ -51,9 +51,9 @@ struct PointerRNA;
struct PropertyRNA;
size_t BKE_libblock_get_alloc_info(short type, const char **name);
void *BKE_libblock_alloc_notest(short type);
void *BKE_libblock_alloc(struct Main *bmain, short type, const char *name, const int flag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL();
void BKE_libblock_init_empty(struct ID *id);
void *BKE_libblock_alloc_notest(short type) ATTR_WARN_UNUSED_RESULT;
void *BKE_libblock_alloc(struct Main *bmain, short type, const char *name, const int flag) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1);
void BKE_libblock_init_empty(struct ID *id) ATTR_NONNULL(1);
/**
* New ID creation/copying options.

View File

@ -109,6 +109,8 @@ typedef struct PaintStroke {
* e.g. in sculpt mode, stroke doesn't start until cursor
* passes over the mesh */
bool stroke_started;
/* Set when enough motion was found for rake rotation */
bool rake_started;
/* event that started stroke, for modal() return */
int event_type;
/* check if stroke variables have been initialized */
@ -376,7 +378,12 @@ static bool paint_brush_update(bContext *C,
else if (!(brush->flag & BRUSH_CURVE)) {
if (!paint_calculate_rake_rotation(ups, brush, mouse_init)) {
/* Not enough motion to define an angle. */
is_dry_run = true;
if(!stroke->rake_started) {
is_dry_run = true;
}
}
else {
stroke->rake_started = true;
}
}
}

View File

@ -1858,7 +1858,7 @@ static bool save_image_doit(bContext *C, SpaceImage *sima, wmOperator *op, SaveI
scene = CTX_data_scene(C);
rr = BKE_image_acquire_renderresult(scene, ima);
bool is_mono = rr ? BLI_listbase_count_ex(&rr->views, 2) < 2 : BLI_listbase_count_ex(&ima->views, 2) < 2;
bool is_exr_rr = rr && ELEM(imf->imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER);
bool is_exr_rr = rr && ELEM(imf->imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER) && RE_HasFloatPixels(rr);
/* error handling */
if (!rr) {

View File

@ -392,6 +392,7 @@ void RE_updateRenderInstances(Render *re, int flag);
/******* defined in render_result.c *********/
bool RE_HasCombinedLayer(RenderResult *res);
bool RE_HasFloatPixels(RenderResult *res);
bool RE_RenderResult_is_stereo(RenderResult *res);
struct RenderView *RE_RenderViewGetById(struct RenderResult *res, const int view_id);
struct RenderView *RE_RenderViewGetByName(struct RenderResult *res, const char *viewname);

View File

@ -3395,7 +3395,8 @@ bool RE_WriteRenderViewsImage(ReportList *reports, RenderResult *rr, Scene *scen
return false;
bool is_mono = BLI_listbase_count_ex(&rr->views, 2) < 2;
bool is_exr_rr = ELEM(rd->im_format.imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER);
bool is_exr_rr = ELEM(rd->im_format.imtype, R_IMF_IMTYPE_OPENEXR, R_IMF_IMTYPE_MULTILAYER) &&
RE_HasFloatPixels(rr);
if (rd->im_format.views_format == R_IMF_VIEWS_MULTIVIEW && is_exr_rr)
{
@ -3413,14 +3414,11 @@ bool RE_WriteRenderViewsImage(ReportList *reports, RenderResult *rr, Scene *scen
BLI_strncpy(filepath, name, sizeof(filepath));
for (view_id = 0, rv = rr->views.first; rv; rv = rv->next, view_id++) {
/* Sequencer and OpenGL render can't save multiple EXR layers. */
bool is_float = rv->rect32 == NULL;
if (!is_mono) {
BKE_scene_multiview_view_filepath_get(&scene->r, filepath, rv->name, name);
}
if (is_exr_rr && is_float) {
if (is_exr_rr) {
ok = RE_WriteRenderResult(reports, rr, name, &rd->im_format, rv->name, -1);
render_print_save_message(reports, name, ok, errno);

View File

@ -1417,6 +1417,19 @@ bool RE_HasCombinedLayer(RenderResult *res)
return (rv->rect32 || rv->rectf);
}
bool RE_HasFloatPixels(RenderResult *res)
{
RenderView *rview;
for (rview = res->views.first; rview; rview = rview->next) {
if (rview->rect32 && !rview->rectf) {
return false;
}
}
return true;
}
bool RE_RenderResult_is_stereo(RenderResult *res)
{
if (! BLI_findstring(&res->views, STEREO_LEFT_NAME, offsetof(RenderView, name)))