diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2010-09-24 02:44:03 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2010-09-24 02:44:03 +0400 |
commit | af277741588099a3dcb7603f5b13d2af5eddcd3d (patch) | |
tree | bc86384f28ad662a3ecda3ead2b305cfbd9f3d30 /source/blender/editors/render | |
parent | 02fd98e1cf488e33cc813eefc99466fb1fa13b7c (diff) |
Fix [#23539] Blender Generated Static Environments Fail To Save
reported by bowels
Saving environment map didn't look at relative_path setting, made it do so.
Diffstat (limited to 'source/blender/editors/render')
-rw-r--r-- | source/blender/editors/render/render_shading.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c index 24796441fe4..debd13c8d99 100644 --- a/source/blender/editors/render/render_shading.c +++ b/source/blender/editors/render/render_shading.c @@ -816,6 +816,7 @@ static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *str, int ImBuf *ibuf=NULL; int dx; int retval; + int relative= (RNA_struct_find_property(op->ptr, "relative_path") && RNA_boolean_get(op->ptr, "relative_path")); if(env->cube[1]==NULL) { BKE_report(op->reports, RPT_ERROR, "There is no generated environment map available to save"); @@ -842,6 +843,9 @@ static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *str, int if (scene->r.color_mgt_flag & R_COLOR_MANAGEMENT) ibuf->profile = IB_PROFILE_LINEAR_RGB; + /* to save, we first get absolute path */ + BLI_path_abs(str, G.sce); + if (BKE_write_ibuf(scene, ibuf, str, imtype, scene->r.subimtype, scene->r.quality)) { retval = OPERATOR_FINISHED; } @@ -849,6 +853,9 @@ static int save_envmap(wmOperator *op, Scene *scene, EnvMap *env, char *str, int BKE_reportf(op->reports, RPT_ERROR, "Error saving environment map to %s.", str); retval = OPERATOR_CANCELLED; } + /* in case we were saving with relative paths, change back again */ + if(relative) + BLI_path_rel(str, G.sce); IMB_freeImBuf(ibuf); ibuf = NULL; |