forked from bartvdbraak/blender
Fix: 8bit raw and 'blender voxel' voxel data texture formats didn't support relative paths
This commit is contained in:
parent
a0517e6338
commit
8f657c174d
@ -39,6 +39,7 @@
|
|||||||
#include "IMB_imbuf.h"
|
#include "IMB_imbuf.h"
|
||||||
#include "IMB_imbuf_types.h"
|
#include "IMB_imbuf_types.h"
|
||||||
|
|
||||||
|
#include "BKE_global.h"
|
||||||
#include "BKE_image.h"
|
#include "BKE_image.h"
|
||||||
#include "BKE_main.h"
|
#include "BKE_main.h"
|
||||||
#include "BKE_modifier.h"
|
#include "BKE_modifier.h"
|
||||||
@ -267,6 +268,7 @@ static void cache_voxeldata(struct Render *re,Tex *tex)
|
|||||||
VoxelData *vd = tex->vd;
|
VoxelData *vd = tex->vd;
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
int curframe;
|
int curframe;
|
||||||
|
char path[FILE_MAX];
|
||||||
|
|
||||||
if (!vd) return;
|
if (!vd) return;
|
||||||
|
|
||||||
@ -285,6 +287,8 @@ static void cache_voxeldata(struct Render *re,Tex *tex)
|
|||||||
else
|
else
|
||||||
curframe = re->r.cfra;
|
curframe = re->r.cfra;
|
||||||
|
|
||||||
|
BLI_strncpy(path, vd->source_path, FILE_MAX);
|
||||||
|
|
||||||
switch(vd->file_format) {
|
switch(vd->file_format) {
|
||||||
case TEX_VD_IMAGE_SEQUENCE:
|
case TEX_VD_IMAGE_SEQUENCE:
|
||||||
load_frame_image_sequence(vd, tex);
|
load_frame_image_sequence(vd, tex);
|
||||||
@ -293,8 +297,9 @@ static void cache_voxeldata(struct Render *re,Tex *tex)
|
|||||||
init_frame_smoke(vd);
|
init_frame_smoke(vd);
|
||||||
return;
|
return;
|
||||||
case TEX_VD_BLENDERVOXEL:
|
case TEX_VD_BLENDERVOXEL:
|
||||||
if (!BLI_exists(vd->source_path)) return;
|
BLI_path_abs(path, G.main->name);
|
||||||
fp = fopen(vd->source_path,"rb");
|
if (!BLI_exists(path)) return;
|
||||||
|
fp = fopen(path,"rb");
|
||||||
if (!fp) return;
|
if (!fp) return;
|
||||||
|
|
||||||
if(read_voxeldata_header(fp, vd))
|
if(read_voxeldata_header(fp, vd))
|
||||||
@ -304,8 +309,9 @@ static void cache_voxeldata(struct Render *re,Tex *tex)
|
|||||||
|
|
||||||
return;
|
return;
|
||||||
case TEX_VD_RAW_8BIT:
|
case TEX_VD_RAW_8BIT:
|
||||||
if (!BLI_exists(vd->source_path)) return;
|
BLI_path_abs(path, G.main->name);
|
||||||
fp = fopen(vd->source_path,"rb");
|
if (!BLI_exists(path)) return;
|
||||||
|
fp = fopen(path,"rb");
|
||||||
if (!fp) return;
|
if (!fp) return;
|
||||||
|
|
||||||
if (load_frame_raw8(vd, fp, curframe))
|
if (load_frame_raw8(vd, fp, curframe))
|
||||||
|
Loading…
Reference in New Issue
Block a user