Merge branch 'blender2.7'
authorCampbell Barton <ideasman42@gmail.com>
Tue, 15 Jan 2019 13:27:10 +0000 (00:27 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 15 Jan 2019 13:27:10 +0000 (00:27 +1100)
1  2 
intern/cycles/render/nodes.cpp

@@@ -1520,19 -1520,6 +1520,19 @@@ void PointDensityTextureNode::attribute
        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");
        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);
@@@ -1588,7 -1583,15 +1588,7 @@@ void PointDensityTextureNode::compile(O
        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());
@@@ -3732,7 -3735,7 +3732,7 @@@ void LightPathNode::compile(OSLCompiler
  
  NODE_DEFINE(LightFalloffNode)
  {
-       NodeType* type = NodeType::add("light_fallof", create, NodeType::SHADER);
+       NodeType* type = NodeType::add("light_falloff", create, NodeType::SHADER);
  
        SOCKET_IN_FLOAT(strength, "Strength", 100.0f);
        SOCKET_IN_FLOAT(smooth, "Smooth", 0.0f);
@@@ -5840,7 -5843,7 +5840,7 @@@ NODE_DEFINE(NormalMapNode
        space_enum.insert("world", NODE_NORMAL_MAP_WORLD);
        space_enum.insert("blender_object", NODE_NORMAL_MAP_BLENDER_OBJECT);
        space_enum.insert("blender_world", NODE_NORMAL_MAP_BLENDER_WORLD);
-       SOCKET_ENUM(space, "Space", space_enum, NODE_TANGENT_RADIAL);
+       SOCKET_ENUM(space, "Space", space_enum, NODE_NORMAL_MAP_TANGENT);
  
        SOCKET_STRING(attribute, "Attribute", ustring());
  
@@@ -6051,7 -6054,7 +6051,7 @@@ NODE_DEFINE(DisplacementNode
        space_enum.insert("object", NODE_NORMAL_MAP_OBJECT);
        space_enum.insert("world", NODE_NORMAL_MAP_WORLD);
  
-       SOCKET_ENUM(space, "Space", space_enum, NODE_NORMAL_MAP_TANGENT);
+       SOCKET_ENUM(space, "Space", space_enum, NODE_NORMAL_MAP_OBJECT);
  
        SOCKET_IN_FLOAT(height, "Height", 0.0f);
        SOCKET_IN_FLOAT(midlevel, "Midlevel", 0.5f);