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 2464fcae069..ea25056e9fd 100644 --- a/intern/cycles/render/nodes.cpp +++ b/intern/cycles/render/nodes.cpp @@ -1489,6 +1489,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"); @@ -1501,15 +1514,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); @@ -1552,15 +1557,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()); |