Merge branch 'master' into blender2.8
This commit is contained in:
commit
25b7bdb6a9
|
@ -18,11 +18,11 @@
|
|||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -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");
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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 */
|
||||
|
|
Loading…
Reference in New Issue