diff options
Diffstat (limited to 'intern/cycles/blender')
-rw-r--r-- | intern/cycles/blender/shader.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/intern/cycles/blender/shader.cpp b/intern/cycles/blender/shader.cpp index 0f17834906d..70acfce6891 100644 --- a/intern/cycles/blender/shader.cpp +++ b/intern/cycles/blender/shader.cpp @@ -378,10 +378,19 @@ static ShaderNode *add_node(Scene *scene, } else if (b_node.is_a(&RNA_ShaderNodeMapRange)) { BL::ShaderNodeMapRange b_map_range_node(b_node); - MapRangeNode *map_range_node = graph->create_node<MapRangeNode>(); - map_range_node->set_clamp(b_map_range_node.clamp()); - map_range_node->set_range_type((NodeMapRangeType)b_map_range_node.interpolation_type()); - node = map_range_node; + if (b_map_range_node.data_type() == BL::ShaderNodeMapRange::data_type_FLOAT_VECTOR) { + VectorMapRangeNode *vector_map_range_node = graph->create_node<VectorMapRangeNode>(); + vector_map_range_node->set_use_clamp(b_map_range_node.clamp()); + vector_map_range_node->set_range_type( + (NodeMapRangeType)b_map_range_node.interpolation_type()); + node = vector_map_range_node; + } + else { + MapRangeNode *map_range_node = graph->create_node<MapRangeNode>(); + map_range_node->set_clamp(b_map_range_node.clamp()); + map_range_node->set_range_type((NodeMapRangeType)b_map_range_node.interpolation_type()); + node = map_range_node; + } } else if (b_node.is_a(&RNA_ShaderNodeClamp)) { BL::ShaderNodeClamp b_clamp_node(b_node); |