Merge branch 'master' into blender2.8
authorCampbell Barton <ideasman42@gmail.com>
Sat, 30 Jun 2018 07:29:38 +0000 (09:29 +0200)
committerCampbell Barton <ideasman42@gmail.com>
Sat, 30 Jun 2018 07:29:38 +0000 (09:29 +0200)
intern/cycles/kernel/shaders/node_ambient_occlusion.osl
intern/cycles/render/nodes.cpp
release/scripts/modules/bpy/utils/previews.py
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_layout.c
source/blender/nodes/shader/nodes/node_shader_ambient_occlusion.c

index 865ad4c9fb9b828660b67118d5432840fb2cafa3..825cccd59ce46338a48961b7e92acf449bc31a44 100644 (file)
 
 shader node_ambient_occlusion(
        color ColorIn = color(1.0, 1.0, 1.0),
-       int samples = 8,
+       int samples = 16,
        float Distance = 1.0,
        normal Normal = N,
        int inside = 0,
-       int only_local = 1,
+       int only_local = 0,
        output color ColorOut = color(1.0, 1.0, 1.0),
        output float AO = 1.0)
 {
index ea25056e9fdf139112f6b513b0b441541175a6d7..e7f13f3123f3360c096a4ddc208e2dce44b1dc3c 100644 (file)
@@ -2792,14 +2792,14 @@ NODE_DEFINE(AmbientOcclusionNode)
 {
        NodeType* type = NodeType::add("ambient_occlusion", create, NodeType::SHADER);
 
-       SOCKET_INT(samples, "Samples", 8);
+       SOCKET_INT(samples, "Samples", 16);
 
        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);
 
        SOCKET_BOOLEAN(inside, "Inside", false);
-       SOCKET_BOOLEAN(only_local, "Only Local", true);
+       SOCKET_BOOLEAN(only_local, "Only Local", false);
 
        SOCKET_OUT_COLOR(color, "Color");
        SOCKET_OUT_FLOAT(ao, "AO");
index 568116b027cc06141dd31b1bf516273e68111716..a3baf8f878c894060e68ef968f0749986f267771 100644 (file)
@@ -37,7 +37,7 @@ __all__ = (
     "new",
     "remove",
     "ImagePreviewCollection",
-    )
+)
 
 import _bpy
 _utils_previews = _bpy._utils_previews
@@ -76,9 +76,9 @@ class ImagePreviewCollection(dict):
             return
 
         raise ResourceWarning(
-                "<%s id=%s[%d]>: left open, remove with "
-                "'bpy.utils.previews.remove()'" %
-                (self.__class__.__name__, self._uuid, len(self)))
+            f"{self!r}: left open, remove with "
+            "'bpy.utils.previews.remove()'"
+        )
         self.close()
 
     def _gen_key(self, name):
@@ -86,17 +86,17 @@ class ImagePreviewCollection(dict):
 
     def new(self, name):
         if name in self:
-            raise KeyError("key %r already exists" % name)
+            raise KeyError(f"key {name!r} already exists")
         p = self[name] = _utils_previews.new(
-                self._gen_key(name))
+            self._gen_key(name))
         return p
     new.__doc__ = _utils_previews.new.__doc__
 
     def load(self, name, path, path_type, force_reload=False):
         if name in self:
-            raise KeyError("key %r already exists" % name)
+            raise KeyError("key {name!r} already exists")
         p = self[name] = _utils_previews.load(
-                self._gen_key(name), path, path_type, force_reload)
+            self._gen_key(name), path, path_type, force_reload)
         return p
     load.__doc__ = _utils_previews.load.__doc__
 
@@ -116,11 +116,7 @@ class ImagePreviewCollection(dict):
         super().__delitem__(key)
 
     def __repr__(self):
-        return "<%s id=%s[%d], %s>" % (
-                self.__class__.__name__,
-                self._uuid,
-                len(self),
-                super().__repr__())
+        return f"<{self.__class__.__name__:s} id={self._uuid:s}[{len(self):d}], {super()!r}>"
 
 
 def new():
@@ -149,5 +145,6 @@ import atexit
 def exit_clear_warning():
     del ImagePreviewCollection.__del__
 
+
 atexit.register(exit_clear_warning)
 del atexit, exit_clear_warning
index bb54f26131a4431d71ba4c9e371541fc1855600e..5edc66300ce6976fdf89778d94ea68b04b7318a9 100644 (file)
@@ -7122,10 +7122,7 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s
 
        /* highlight has timers for tooltips and auto open */
        if (state == BUTTON_STATE_HIGHLIGHT) {
-               /* for list-items (that are not drawn with regular emboss), don't change selection based on hovering */
-               if (((but->flag & UI_BUT_LIST_ITEM) == 0) && (but->dragflag & UI_EMBOSS_NONE)) {
-                       but->flag &= ~UI_SELECT;
-               }
+               but->flag &= ~UI_SELECT;
 
                button_tooltip_timer_reset(C, but);
 
index f4c0123567c29246eafa028b89ae3b3fef34afe5..0a794a18b2002fec1d9b31ed998f36aa4607dfee 100644 (file)
@@ -1710,7 +1710,7 @@ void uiItemFullR(uiLayout *layout, PointerRNA *ptr, PropertyRNA *prop, int index
        }
 
        /* Mark non-embossed textfields inside a listbox. */
-       if (but && (block->flag & UI_BLOCK_LIST_ITEM) && (but->dt & UI_EMBOSS_NONE)) {
+       if (but && (block->flag & UI_BLOCK_LIST_ITEM) && (but->type == UI_BTYPE_TEXT) && (but->dt & UI_EMBOSS_NONE)) {
                UI_but_flag_enable(but, UI_BUT_LIST_ITEM);
        }
 
index 673e6c61885310aae8986e1e319cce422d531abc..4c770984717b56e9f4822d10245612aace163920 100644 (file)
@@ -52,8 +52,8 @@ static int node_shader_gpu_ambient_occlusion(GPUMaterial *mat, bNode *node, bNod
 
 static void node_shader_init_ambient_occlusion(bNodeTree *UNUSED(ntree), bNode *node)
 {
-       node->custom1 = 8; /* samples */
-       node->custom2 = SHD_AO_LOCAL;
+       node->custom1 = 16; /* samples */
+       node->custom2 = 0;
 }
 
 /* node type definition */