diff options
Diffstat (limited to 'intern/cycles/render/nodes.cpp')
-rw-r--r-- | intern/cycles/render/nodes.cpp | 33 |
1 files changed, 15 insertions, 18 deletions
diff --git a/intern/cycles/render/nodes.cpp b/intern/cycles/render/nodes.cpp index 1943f8c3e2b..06a2baa8a38 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -1520,6 +1520,19 @@ void PointDensityTextureNode::attributes(Shader *shader, ShaderNode::attributes(shader, attributes); } +void PointDensityTextureNode::add_image() +{ + if(slot == -1) { + ImageMetaData metadata; + slot = image_manager->add_image(filename.string(), builtin_data, + false, 0, + interpolation, + EXTENSION_CLIP, + true, + metadata); + } +} + void PointDensityTextureNode::compile(SVMCompiler& compiler) { ShaderInput *vector_in = input("Vector"); @@ -1532,15 +1545,7 @@ void PointDensityTextureNode::compile(SVMCompiler& compiler) image_manager = compiler.image_manager; if(use_density || use_color) { - if(slot == -1) { - ImageMetaData metadata; - slot = image_manager->add_image(filename.string(), builtin_data, - false, 0, - interpolation, - EXTENSION_CLIP, - true, - metadata); - } + add_image(); if(slot != -1) { compiler.stack_assign(vector_in); @@ -1583,15 +1588,7 @@ void PointDensityTextureNode::compile(OSLCompiler& compiler) image_manager = compiler.image_manager; if(use_density || use_color) { - if(slot == -1) { - ImageMetaData metadata; - slot = image_manager->add_image(filename.string(), builtin_data, - false, 0, - interpolation, - EXTENSION_CLIP, - true, - metadata); - } + add_image(); if(slot != -1) { compiler.parameter("filename", string_printf("@i%d", slot).c_str()); |