Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2020-02-23 17:25:05 +0300
committerJacques Lucke <jacques@blender.org>2020-02-23 17:25:05 +0300
commitbeed795e5aa3451bdc248b2df640c14615f286f9 (patch)
tree2eff943462f659351143bcb3c43d5fe765b6f0f0 /release/scripts
parentfcfe9784cbc42df3ca000c4d11727c12cb2df5c9 (diff)
parent39d0bf90444ef42246f50c5346989780d01e20f4 (diff)
Merge branch 'master' into functions
Diffstat (limited to 'release/scripts')
-rw-r--r--release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py8
-rw-r--r--release/scripts/startup/bl_ui/properties_view_layer.py95
-rw-r--r--release/scripts/startup/bl_ui/space_toolsystem_common.py72
3 files changed, 130 insertions, 45 deletions
diff --git a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
index 20c5c869e83..0195232a59d 100644
--- a/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
+++ b/release/scripts/presets/keyconfig/keymap_data/industry_compatible_data.py
@@ -3404,7 +3404,8 @@ def km_object_non_modal(params):
)
items.extend([
-
+ ("object.mode_set",{"type": 'THREE', "value": 'PRESS'},
+ {"properties": [("mode", 'POSE')]}),
("object.mode_set_with_submode",{"type": 'ONE', "value": 'PRESS'},
{"properties": [("mode", 'EDIT'), ("mesh_select_mode", {'VERT'})]}),
("object.mode_set_with_submode",{"type": 'TWO', "value": 'PRESS'},
@@ -3423,7 +3424,6 @@ def km_object_non_modal(params):
{"properties": [("mode", 'WEIGHT_PAINT')]}),
("object.mode_set",{"type": 'EIGHT', "value": 'PRESS'},
{"properties": [("mode", 'TEXTURE_PAINT')]}),
-
("object.mode_set",{"type": 'TWO', "value": 'PRESS'},
{"properties": [("mode", 'EDIT_GPENCIL')]}),
("object.mode_set",{"type": 'THREE', "value": 'PRESS'},
@@ -3432,9 +3432,7 @@ def km_object_non_modal(params):
{"properties": [("mode", 'PAINT_GPENCIL')]}),
("object.mode_set",{"type": 'FIVE', "value": 'PRESS'},
{"properties": [("mode", 'WEIGHT_GPENCIL')]}),
-
- ("object.mode_set",{"type": 'THREE', "value": 'PRESS'},
- {"properties": [("mode", 'POSE')]})
+
])
return keymap
diff --git a/release/scripts/startup/bl_ui/properties_view_layer.py b/release/scripts/startup/bl_ui/properties_view_layer.py
index 121b8f2f401..25244b7f065 100644
--- a/release/scripts/startup/bl_ui/properties_view_layer.py
+++ b/release/scripts/startup/bl_ui/properties_view_layer.py
@@ -59,14 +59,25 @@ class VIEWLAYER_PT_eevee_layer_passes(ViewLayerButtonsPanel, Panel):
COMPAT_ENGINES = {'BLENDER_EEVEE'}
def draw(self, context):
- layout = self.layout
+ pass
- layout.use_property_split = True
- flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
+class VIEWLAYER_PT_eevee_layer_passes_data(ViewLayerButtonsPanel, Panel):
+ bl_label = "Data"
+ bl_parent_id = "VIEWLAYER_PT_eevee_layer_passes"
+ COMPAT_ENGINES = {'BLENDER_EEVEE'}
+
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_split = True
+ layout.use_property_decorate = False
+
+ scene = context.scene
+ rd = scene.render
view_layer = context.view_layer
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = flow.column()
col.prop(view_layer, "use_pass_combined")
col = flow.column()
@@ -75,17 +86,83 @@ class VIEWLAYER_PT_eevee_layer_passes(ViewLayerButtonsPanel, Panel):
col.prop(view_layer, "use_pass_mist")
col = flow.column()
col.prop(view_layer, "use_pass_normal")
- col = flow.column()
- col.prop(view_layer, "use_pass_ambient_occlusion")
- col = flow.column()
- col.prop(view_layer, "use_pass_subsurface_direct", text="Subsurface Direct")
- col = flow.column()
- col.prop(view_layer, "use_pass_subsurface_color", text="Subsurface Color")
+class VIEWLAYER_PT_eevee_layer_passes_light(ViewLayerButtonsPanel, Panel):
+ bl_label = "Light"
+ bl_parent_id = "VIEWLAYER_PT_eevee_layer_passes"
+ COMPAT_ENGINES = {'BLENDER_EEVEE'}
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.use_property_split = True
+ layout.use_property_decorate = False
+
+ view_layer = context.view_layer
+ view_layer_eevee = view_layer.eevee
+ scene = context.scene
+ scene_eevee = scene.eevee
+
+ split = layout.split(factor=0.35)
+ split.use_property_split = False
+ split.label(text="Diffuse")
+ row = split.row(align=True)
+ row.prop(view_layer, "use_pass_diffuse_direct", text="Light", toggle=True)
+ row.prop(view_layer, "use_pass_diffuse_color", text="Color", toggle=True)
+
+ split = layout.split(factor=0.35)
+ split.use_property_split = False
+ split.label(text="Specular")
+ row = split.row(align=True)
+ row.prop(view_layer, "use_pass_glossy_direct", text="Light", toggle=True)
+ row.prop(view_layer, "use_pass_glossy_color", text="Color", toggle=True)
+
+ split = layout.split(factor=0.35)
+ split.use_property_split = False
+ split.label(text="Volume")
+ row = split.row(align=True)
+ row.prop(view_layer_eevee, "use_pass_volume_transmittance", text="Transmittance", toggle=True)
+ row.prop(view_layer_eevee, "use_pass_volume_scatter", text="Scatter", toggle=True)
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
+
+ col = layout.column(align=True)
+ col.prop(view_layer, "use_pass_emit", text="Emission")
+ col.prop(view_layer, "use_pass_environment")
+ col.prop(view_layer, "use_pass_shadow")
+ row = col.row()
+ row.prop(view_layer, "use_pass_ambient_occlusion", text="Ambient Occlusion")
+ row.active = scene_eevee.use_gtao
+
+
+class VIEWLAYER_PT_eevee_layer_passes_effects(ViewLayerButtonsPanel, Panel):
+ bl_label = "Effects"
+ bl_parent_id = "VIEWLAYER_PT_eevee_layer_passes"
+ COMPAT_ENGINES = {'BLENDER_EEVEE'}
+
+ def draw(self, context):
+ layout = self.layout
+
+ layout.use_property_split = True
+ layout.use_property_decorate = False
+
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
+
+ view_layer = context.view_layer
+ view_layer_eevee = view_layer.eevee
+ scene = context.scene
+ scene_eevee = scene.eevee
+
+ col = flow.column()
+ col.prop(view_layer_eevee, "use_pass_bloom", text="Bloom")
+ col.active = scene_eevee.use_bloom
+
classes = (
VIEWLAYER_PT_layer,
VIEWLAYER_PT_eevee_layer_passes,
+ VIEWLAYER_PT_eevee_layer_passes_data,
+ VIEWLAYER_PT_eevee_layer_passes_light,
+ VIEWLAYER_PT_eevee_layer_passes_effects,
)
if __name__ == "__main__": # only for live edit.
diff --git a/release/scripts/startup/bl_ui/space_toolsystem_common.py b/release/scripts/startup/bl_ui/space_toolsystem_common.py
index 4dc724299f0..d2deb70d4a2 100644
--- a/release/scripts/startup/bl_ui/space_toolsystem_common.py
+++ b/release/scripts/startup/bl_ui/space_toolsystem_common.py
@@ -216,29 +216,52 @@ class ToolSelectPanelHelper:
else:
return 0
+ # tool flattening
+ #
+ # usually 'tools' is already expanded into ToolDef
+ # but when registering a tool, this can still be a function
+ # (_tools_flatten is usually called with cls.tools_from_context(context)
+ # [that already yields from the function])
+ # so if item is still a function (e.g._defs_XXX.generate_from_brushes)
+ # seems like we cannot expand here (have no context yet)
+ # if we yield None here, this will risk running into duplicate tool bl_idname [in register_tool()]
+ # but still better than erroring out
@staticmethod
def _tools_flatten(tools):
- for item in tools:
- if type(item) is tuple:
- yield from item
- else:
- # May be None.
- yield item
+ for item_parent in tools:
+ if item_parent is None:
+ yield None
+ for item in item_parent if (type(item_parent) is tuple) else (item_parent,):
+ if item is None or _item_is_fn(item):
+ yield None
+ else:
+ yield item
@staticmethod
def _tools_flatten_with_tool_index(tools):
- for item in tools:
- if type(item) is tuple:
- i = 0
- for sub_item in item:
- if sub_item is None:
- yield None, -1
- else:
- yield sub_item, i
- i += 1
- else:
- # May be None.
- yield item, -1
+ for item_parent in tools:
+ if item_parent is None:
+ yield None, -1
+ i = 0
+ for item in item_parent if (type(item_parent) is tuple) else (item_parent,):
+ if item is None or _item_is_fn(item):
+ yield None, -1
+ else:
+ yield item, i
+ i += 1
+
+ # Special internal function, gives use items that contain keymaps.
+ @staticmethod
+ def _tools_flatten_with_keymap(tools):
+ for item_parent in tools:
+ if item_parent is None:
+ continue
+ for item in item_parent if (type(item_parent) is tuple) else (item_parent,):
+ # skip None or generator function
+ if item is None or _item_is_fn(item):
+ continue
+ if item.keymap is not None:
+ yield item
@classmethod
def _tool_get_active(cls, context, space_type, mode, with_icon=False):
@@ -413,19 +436,6 @@ class ToolSelectPanelHelper:
keymap_fn[0](km)
keymap_fn[0] = km.name
- # Special internal function, gives use items that contain keymaps.
- @staticmethod
- def _tools_flatten_with_keymap(tools):
- for item_parent in tools:
- if item_parent is None:
- continue
- for item in item_parent if (type(item_parent) is tuple) else (item_parent,):
- # skip None or generator function
- if item is None or _item_is_fn(item):
- continue
- if item.keymap is not None:
- yield item
-
@classmethod
def register(cls):
wm = bpy.context.window_manager