Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Mon, 25 Jun 2018 05:43:51 +0000 (07:43 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 25 Jun 2018 05:43:51 +0000 (07:43 +0200)
1  2 
build_files/cmake/macros.cmake
intern/cycles/render/nodes.cpp
source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.c

index d6fde945173b6ef28ef3973a4d745a91ccc12647,5d5425a9fc6df012d8da7202e670170581473e11..ce2241a775dd8149c3ab9f8fc10230a95ef1a67c
@@@ -326,7 -326,7 +326,7 @@@ function(SETUP_LIBDIRS
                        link_directories(${JACK_LIBPATH})
                endif()
                if(WITH_CODEC_SNDFILE)
 -                      link_directories(${SNDFILE_LIBPATH})
 +                      link_directories(${LIBSNDFILE_LIBPATH})
                endif()
                if(WITH_FFTW3)
                        link_directories(${FFTW3_LIBPATH})
@@@ -412,7 -412,7 +412,7 @@@ function(setup_liblink
                target_link_libraries(${target} ${JACK_LIBRARIES})
        endif()
        if(WITH_CODEC_SNDFILE)
 -              target_link_libraries(${target} ${SNDFILE_LIBRARIES})
 +              target_link_libraries(${target} ${LIBSNDFILE_LIBRARIES})
        endif()
        if(WITH_SDL AND NOT WITH_SDL_DYNLOAD)
                target_link_libraries(${target} ${SDL_LIBRARY})
@@@ -560,12 -560,6 +560,12 @@@ function(SETUP_BLENDER_SORTED_LIBS
                endif()
        endif()
  
 +      if(WITH_AUDASPACE AND NOT WITH_SYSTEM_AUDASPACE)
 +              list(APPEND BLENDER_LINK_LIBS
 +                      audaspace
 +                      audaspace-py)
 +      endif()
 +
        # Sort libraries
        set(BLENDER_SORTED_LIBS
                bf_windowmanager
                bf_editor_space_outliner
                bf_editor_space_script
                bf_editor_space_sequencer
 +              bf_editor_space_statusbar
                bf_editor_space_text
                bf_editor_space_time
 +              bf_editor_space_topbar
                bf_editor_space_userpref
                bf_editor_space_view3d
                bf_editor_space_clip
                bf_editor_curve
                bf_editor_gpencil
                bf_editor_interface
 +              bf_editor_manipulator_library
                bf_editor_mesh
                bf_editor_metaball
                bf_editor_object
                bf_editor_armature
                bf_editor_physics
                bf_editor_render
 +              bf_editor_scene
                bf_editor_screen
                bf_editor_sculpt_paint
                bf_editor_sound
                bf_python
                bf_python_ext
                bf_python_mathutils
 +              bf_python_gawain
                bf_python_bmesh
                bf_freestyle
                bf_ikplugin
                bf_alembic
                bf_bmesh
                bf_gpu
 +              bf_draw
                bf_blenloader
                bf_blenkernel
                bf_physics
                bf_nodes
                bf_rna
 +              bf_editor_manipulator_library  # rna -> manipulator bad-level calls
 +              bf_python
                bf_imbuf
                bf_blenlib
                bf_depsgraph
                bf_blenfont
                bf_blentranslation
                bf_intern_audaspace
 +              audaspace
 +              audaspace-py
                bf_intern_mikktspace
                bf_intern_dualcon
                bf_intern_cycles
                cycles_util
                cycles_subd
                bf_intern_opencolorio
 +              bf_intern_gawain
                bf_intern_eigen
                extern_rangetree
                extern_wcwidth
                list_insert_after(BLENDER_SORTED_LIBS "ge_logic_ngnetwork" "extern_bullet")
        endif()
  
 -      if(WITH_GAMEENGINE_DECKLINK)
 -              list(APPEND BLENDER_SORTED_LIBS bf_intern_decklink)
 -      endif()
 -
        if(WIN32)
                list(APPEND BLENDER_SORTED_LIBS bf_intern_gpudirect)
        endif()
@@@ -1137,7 -1124,7 +1137,7 @@@ macro(remove_strict_c_flags_fil
        filenames)
        foreach(_SOURCE ${ARGV})
                if(CMAKE_COMPILER_IS_GNUCC OR
-                 (CMAKE_C_COMPILER_ID MATCHES "Clang"))
+                  (CMAKE_C_COMPILER_ID MATCHES "Clang"))
                        set_source_files_properties(${_SOURCE}
                                PROPERTIES
                                        COMPILE_FLAGS "${C_REMOVE_STRICT_FLAGS}"
@@@ -1155,10 -1142,10 +1155,10 @@@ macro(remove_strict_cxx_flags_fil
        remove_strict_c_flags_file(${filenames} ${ARHV})
        foreach(_SOURCE ${ARGV})
                if(CMAKE_COMPILER_IS_GNUCC OR
-                 (CMAKE_C_COMPILER_ID MATCHES "Clang"))
+                  (CMAKE_CXX_COMPILER_ID MATCHES "Clang"))
                        set_source_files_properties(${_SOURCE}
                                PROPERTIES
-                                       COMPILE_FLAGS "${C_REMOVE_STRICT_FLAGS}"
+                                       COMPILE_FLAGS "${CXX_REMOVE_STRICT_FLAGS}"
                        )
                endif()
                if(MSVC)
@@@ -1547,7 -1534,6 +1547,7 @@@ function(find_python_packag
                  NAMES
                    ${package}
                  HINTS
 +                  "${PYTHON_LIBPATH}/"
                    "${PYTHON_LIBPATH}/python${PYTHON_VERSION}/"
                    "${PYTHON_LIBPATH}/python${_PY_VER_MAJOR}/"
                  PATH_SUFFIXES
index 59ac625749904875c22b90f5ea85191eadf1ffb2,2464fcae0694336ba85aac9c69c15647f0631831..ea25056e9fdf139112f6b513b0b441541175a6d7
@@@ -1489,19 -1489,6 +1489,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);
@@@ -1557,7 -1552,15 +1557,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());
@@@ -2794,7 -2797,7 +2794,7 @@@ NODE_DEFINE(AmbientOcclusionNode
  
        SOCKET_INT(samples, "Samples", 8);
  
-       SOCKET_IN_COLOR(color, "Color", make_float3(0.8f, 0.8f, 0.8f));
+       SOCKET_IN_COLOR(color, "Color", make_float3(1.0f, 1.0f, 1.0f));
        SOCKET_IN_FLOAT(distance, "Distance", 1.0f);
        SOCKET_IN_NORMAL(normal, "Normal", make_float3(0.0f, 0.0f, 0.0f), SocketType::LINK_NORMAL);
  
index eae35b4cd22dad6d9f7039d052e25e255be1d23c,cac86ec967fd40c957f247d83752bebad752706e..0ccfb64a37d9c731823b45360d452c1d4a180cc0
  /* **************** OUTPUT ******************** */
  
  static bNodeSocketTemplate sh_node_ambient_occlusion_in[] = {
-       {       SOCK_RGBA, 1, N_("Color"),              0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
+       {       SOCK_RGBA, 1, N_("Color"),              1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f},
        {       SOCK_FLOAT, 0, N_("Distance"),  1.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1000.0f},
        {       SOCK_VECTOR, 1, N_("Normal"),   0.0f, 0.0f, 0.0f, 1.0f, -1.0f, 1.0f, PROP_NONE, SOCK_HIDE_VALUE},
        {       -1, 0, ""       }
  };
  
  static bNodeSocketTemplate sh_node_ambient_occlusion_out[] = {
-       {       SOCK_RGBA, 1, N_("Color"),      0.8f, 0.8f, 0.8f, 1.0f, 0.0f, 1.0f},
+       {       SOCK_RGBA, 1, N_("Color"),      1.0f, 1.0f, 1.0f, 1.0f, 0.0f, 1.0f},
        {       SOCK_FLOAT, 0, N_("AO"),        0.0f, 0.0f, 0.0f, 0.0f, 0.0f, 1.0f},
        {       -1, 0, ""       }
  };
  
 -static int node_shader_gpu_ambient_occlusion(GPUMaterial *mat, bNode *UNUSED(node), bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
 +static int node_shader_gpu_ambient_occlusion(GPUMaterial *mat, bNode *node, bNodeExecData *UNUSED(execdata), GPUNodeStack *in, GPUNodeStack *out)
  {
 -      return GPU_stack_link(mat, "node_ambient_occlusion", in, out, GPU_builtin(GPU_VIEW_NORMAL));
 +      if (!in[2].link)
 +              GPU_link(mat, "world_normals_get", &in[2].link);
 +
 +      return GPU_stack_link(mat, node, "node_ambient_occlusion", in, out);
  }
  
  static void node_shader_init_ambient_occlusion(bNodeTree *UNUSED(ntree), bNode *node)