diff options
author | Ton Roosendaal <ton@blender.org> | 2010-12-27 22:26:38 +0300 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2010-12-27 22:26:38 +0300 |
commit | b2be78c0ccbeb24995584ad7d5c70ae9f49ef04a (patch) | |
tree | 6e660b3186714bf5b8e26a468748027529030003 /source/blender/render | |
parent | 1a8cc0a8f051c92e03bee4ad9cb4ae0727b0a4e5 (diff) |
Bugfix #25392
Compositor: Texture node didn't use texture-nodes itself.
Now composites initialize texture nodes correctly.
Also reviewed the fix for crashing texture nodes for displace.
It appears texture nodes also are used for sculpt/paint
brushes, in these cases it can be allowed again. But, don't
do this during rendering for now!
Diffstat (limited to 'source/blender/render')
-rw-r--r-- | source/blender/render/extern/include/RE_shader_ext.h | 4 | ||||
-rw-r--r-- | source/blender/render/intern/source/texture.c | 10 |
2 files changed, 12 insertions, 2 deletions
diff --git a/source/blender/render/extern/include/RE_shader_ext.h b/source/blender/render/extern/include/RE_shader_ext.h index 71ce269fce6..26e34a741f7 100644 --- a/source/blender/render/extern/include/RE_shader_ext.h +++ b/source/blender/render/extern/include/RE_shader_ext.h @@ -189,7 +189,11 @@ typedef struct ShadeInput /* node shaders... */ struct Tex; struct MTex; +/* this one uses nodes */ int multitex_ext(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres); +/* nodes disabled */ +int multitex_ext_safe(struct Tex *tex, float *texvec, struct TexResult *texres); +/* only for internal node usage */ int multitex_nodes(struct Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, struct TexResult *texres, short thread, short which_output, struct ShadeInput *shi, struct MTex *mtex); diff --git a/source/blender/render/intern/source/texture.c b/source/blender/render/intern/source/texture.c index 9e3c3c4e1d6..684732c10d3 100644 --- a/source/blender/render/intern/source/texture.c +++ b/source/blender/render/intern/source/texture.c @@ -1348,18 +1348,24 @@ int multitex_mtex(ShadeInput *shi, MTex *mtex, float *texvec, float *dxt, float /* Warning, if the texres's values are not declared zero, check the return value to be sure * the color values are set before using the r/g/b values, otherwise you may use uninitialized values - Campbell */ -/* extern-tex doesn't support nodes (ntreeBeginExec() can't be called when rendering is going on) */ int multitex_ext(Tex *tex, float *texvec, float *dxt, float *dyt, int osatex, TexResult *texres) { + return multitex_nodes(tex, texvec, dxt, dyt, osatex, texres, 0, 0, NULL, NULL); +} + +/* extern-tex doesn't support nodes (ntreeBeginExec() can't be called when rendering is going on) */ +int multitex_ext_safe(Tex *tex, float *texvec, TexResult *texres) +{ int use_nodes= tex->use_nodes, retval; tex->use_nodes= 0; - retval= multitex_nodes(tex, texvec, dxt, dyt, osatex, texres, 0, 0, NULL, NULL); + retval= multitex_nodes(tex, texvec, NULL, NULL, 0, texres, 0, 0, NULL, NULL); tex->use_nodes= use_nodes; return retval; } + /* ------------------------------------------------------------------------- */ /* in = destination, tex = texture, out = previous color */ |