[Bf-blender-cvs] [fbaf6e6fb3d] temp-dynamic-overrides: Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides

Dalai Felinto noreply at git.blender.org
Tue Jun 26 16:16:07 CEST 2018


Commit: fbaf6e6fb3d2eb2f0c737b7d4713a5ea171738e6
Author: Dalai Felinto
Date:   Tue Jun 26 16:07:39 2018 +0200
Branches: temp-dynamic-overrides
https://developer.blender.org/rBfbaf6e6fb3d2eb2f0c737b7d4713a5ea171738e6

Merge remote-tracking branch 'origin/blender2.8' into temp-dynamic-overrides

===================================================================



===================================================================

diff --cc release/scripts/startup/bl_ui/properties_view_layer.py
index 85fde8fb748,05dc15216a2..6ce53445299
--- a/release/scripts/startup/bl_ui/properties_view_layer.py
+++ b/release/scripts/startup/bl_ui/properties_view_layer.py
@@@ -66,169 -66,11 +66,164 @@@ class VIEWLAYER_PT_eevee_layer_passes(V
          col.prop(view_layer, "use_pass_z")
          col.prop(view_layer, "use_pass_mist")
          col.prop(view_layer, "use_pass_normal")
-         col.separator()
          col.prop(view_layer, "use_pass_ambient_occlusion")
- 
-         col = split.column()
-         col.label(text="Subsurface:")
-         row = col.row(align=True)
-         row.prop(view_layer, "use_pass_subsurface_direct", text="Direct", toggle=True)
-         row.prop(view_layer, "use_pass_subsurface_color", text="Color", toggle=True)
+         col.prop(view_layer, "use_pass_subsurface_direct", text="Subsurface Direct")
+         col.prop(view_layer, "use_pass_subsurface_color", text="Subsurface Color")
  
  
 +class VIEWLAYER_UL_override_sets(UIList):
 +    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
 +        row = layout.row(align=True)
 +        row.prop(item, "use", text="", index=index)
 +        row.prop(item, "name", text="", index=index, icon_value=icon, emboss=False)
 +
 +
 +class ViewLayerOverridesPanel():
 +    @classmethod
 +    def poll(cls, context):
 +        return context.view_layer.override_sets.active
 +
 +    @staticmethod
 +    def _icon_from_id_type(id_type):
 +        return id_type + '_DATA'
 +
 +    @staticmethod
 +    def _value_name_override_mode_get(data_type, data_subtype):
 +        """
 +        return Tuple: value name and whether the property supports override modes
 +        """
 +        # TODO: Finish this.
 +        proptype_map = {
 +            'BOOLEAN': {
 +                'NONE': ("value_boolean", False)},
 +            'INT': {
 +                'NONE': ("value_int", True)},
 +            'FLOAT': {
 +                'NONE': ("value_float", True),
 +                'COLOR': ("value_color", False)},
 +            'STRING': {
 +                'NONE': (None, False)},
 +            'ENUM': {
 +                'NONE': (None, False)},
 +            'POINTER': {
 +                'NONE': (None, False)},
 +            'COLLECTION': {
 +                'NONE': (None, False)},
 +        }
 +
 +        type_lookup = proptype_map[data_type]
 +        value_name = type_lookup.get(data_subtype)
 +
 +        if value_name is None:
 +            value_name = type_lookup['NONE']
 +
 +        return value_name
 +
 +    def _draw_property(self, layout, dyn_prop, index, property_type):
 +        box = layout.box()
 +        row = box.row()
 +        row.prop(dyn_prop, "use", text="")
 +        subrow = row.row()
 +        subrow.active = dyn_prop.use
 +
 +        subrow.label(text=dyn_prop.name, icon=self._icon_from_id_type(dyn_prop.id_type))
 +        value_propname, override_mode_support = self._value_name_override_mode_get(dyn_prop.data_type, dyn_prop.data_subtype)
 +
 +        if override_mode_support:
 +            subrow.prop(dyn_prop, "override_mode", text="")
 +            subrow.prop(dyn_prop, value_propname, text="")
 +        elif value_propname is not None:
 +            subrow.prop(dyn_prop, value_propname, text="")
 +
 +        ops = row.operator("scene.view_layer_override_remove", text="", icon='ZOOMOUT', emboss=False)
 +        ops.index = index
 +        ops.property_type = property_type
 +
 +
 +class VIEWLAYER_OT_overrides(ViewLayerButtonsPanel, Panel):
 +    bl_label = "Overrides"
 +    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
 +
 +    def draw(self, context):
 +        layout = self.layout
 +
 +        scene = context.scene
 +        view_layer = context.view_layer
 +
 +        row = layout.row(align=True)
 +        row.label(text="Override Sets")
 +
 +        row = layout.row()
 +        col = row.column()
 +
 +        col.template_list("VIEWLAYER_UL_override_sets", "name", view_layer, "override_sets", view_layer.override_sets, "active_index", rows=2)
 +
 +        col = row.column(align=True)
 +        col.operator("scene.view_layer_override_set_add", icon='ZOOMIN', text="")
 +        col.operator("scene.view_layer_override_set_remove", icon='ZOOMOUT', text="")
 +
 +        override_set = view_layer.override_sets.active
 +
 +
 +class VIEWLAYER_OT_overrides_scene_properties(ViewLayerOverridesPanel, ViewLayerButtonsPanel, Panel):
 +    bl_label = "Scene Properties"
 +    bl_parent_id = "VIEWLAYER_OT_overrides"
 +    bl_options = {'DEFAULT_CLOSED'}
 +    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
 +
 +    def draw(self, context):
 +        layout = self.layout
 +        override_set = context.view_layer.override_sets.active
 +
 +        if override_set.scene_properties:
 +            for i, dyn_prop in enumerate(override_set.scene_properties):
 +                self._draw_property(layout, dyn_prop, i, 'SCENE')
 +        else:
 +            layout.label(text="No scene property")
 +
 +
 +class VIEWLAYER_UL_override_set_collections(UIList):
 +    def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
 +        layout.row().label(text=item.name, icon_value=icon)
 +
 +
 +class VIEWLAYER_OT_overrides_affected_collections(ViewLayerOverridesPanel, ViewLayerButtonsPanel, Panel):
 +    bl_label = "Affected Collections"
 +    bl_parent_id = "VIEWLAYER_OT_overrides"
 +    bl_options = {'DEFAULT_CLOSED'}
 +    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
 +
 +    def draw(self, context):
 +        layout = self.layout
 +        override_set = context.view_layer.override_sets.active
 +
 +        row = layout.row()
 +        col = row.column()
 +
 +        col.template_list("VIEWLAYER_UL_override_set_collections", "", override_set, "affected_collections", override_set.affected_collections, "active_index", rows=1)
 +
 +        col = row.column(align=True)
 +        col.operator("scene.override_set_collection_link", icon='ZOOMIN', text="")
 +        col.operator("scene.override_set_collection_unlink", icon='ZOOMOUT', text="")
 +
 +
 +class VIEWLAYER_OT_overrides_collection_properties(ViewLayerOverridesPanel, ViewLayerButtonsPanel, Panel):
 +    bl_label = "Collection Properties"
 +    bl_parent_id = "VIEWLAYER_OT_overrides"
 +    bl_options = {'DEFAULT_CLOSED'}
 +    COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_CLAY', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
 +
 +    def draw(self, context):
 +        layout = self.layout
 +        override_set = context.view_layer.override_sets.active
 +
 +        if override_set.collection_properties:
 +            for i, dyn_prop in enumerate(override_set.collection_properties):
 +                self._draw_property(layout, dyn_prop, i, 'COLLECTION')
 +        else:
 +            layout.label(text="No collection property")
 +
 +
  classes = (
      VIEWLAYER_PT_layer,
      VIEWLAYER_PT_eevee_layer_passes,
diff --cc source/blender/blenloader/intern/readfile.c
index a87cad1dccd,138cd868db0..994a46929ca
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@@ -5612,15 -5597,7 +5614,16 @@@ static void direct_link_view_layer(File
  	BLI_listbase_clear(&view_layer->drawdata);
  	view_layer->object_bases_array = NULL;
  	view_layer->object_bases_hash = NULL;
+ 	view_layer->runtime_flag = 0;
 +
 +	link_list(fd, &(view_layer->override_sets));
 +	for (OverrideSet *override_set = view_layer->override_sets.first; override_set; override_set = override_set->next) {
 +		link_list(fd, &override_set->affected_collections);
 +		link_list(fd, &override_set->scene_properties);
 +		direct_link_dynamic_properties(fd, &override_set->scene_properties);
 +		link_list(fd, &override_set->collection_properties);
 +		direct_link_dynamic_properties(fd, &override_set->collection_properties);
 +	}
  }
  
  static void lib_link_layer_collection(FileData *fd, Library *lib, LayerCollection *layer_collection, bool master)
diff --cc source/blender/editors/interface/interface_context_menu.c
index 00000000000,f28d80bebe1..cda81ba79cf
mode 000000,100644..100644
--- a/source/blender/editors/interface/interface_context_menu.c
+++ b/source/blender/editors/interface/interface_context_menu.c
@@@ -1,0 -1,747 +1,756 @@@
+ /*
+  * ***** BEGIN GPL LICENSE BLOCK *****
+  *
+  * This program is free software; you can redistribute it and/or
+  * modify it under the terms of the GNU General Public License
+  * as published by the Free Software Foundation; either version 2
+  * of the License, or (at your option) any later version.
+  *
+  * This program is distributed in the hope that it will be useful,
+  * but WITHOUT ANY WARRANTY; without even the implied warranty of
+  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+  * GNU General Public License for more details.
+  *
+  * You should have received a copy of the GNU General Public License
+  * along with this program; if not, write to the Free Software Foundation,
+  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+  *
+  * ***** END GPL LICENSE BLOCK *****
+  */
+ 
+ /** \file blender/editors/interface/interface_context_menu.c
+  *  \ingroup edinterface
+  *
+  * Generic context popup menus.
+  */
+ 
+ #include <string.h>
+ 
+ #include "MEM_guardedalloc.h"
+ 
+ #include "DNA_scene_types.h"
+ #include "DNA_screen_types.h"
+ 
+ #include "BLI_path_util.h"
+ #include "BLI_string.h"
+ #include "BLI_utildefines.h"
+ 
+ #include "BLT_translation.h"
+ 
+ #include "BKE_addon.h"
+ #include "BKE_context.h"
+ #include "BKE_idprop.h"
+ #include "BKE_screen.h"
+ 
+ #include "ED_screen.h"
+ #include "ED_keyframing.h"
+ 
+ #include "UI_interface.h"
+ 
+ #include "interface_intern.h"
+ 
+ #include "RNA_access.h"
+ 
+ #include "WM_api.h"
+ #include "WM_types.h"
+ 
+ /* This hack is needed because we don't have a good way to re-reference keymap items once added: T42944 */
+ #define USE_KEYMAP_ADD_HACK
+ 
+ /* -------------------------------------------------------------------- */
+ /** \name Button Context Menu
+  * \{ */


@@ Diff output truncated at 10240 characters. @@



More information about the Bf-blender-cvs mailing list