From adf355849f5c68bf504ba435cc54872b2e2ee87a Mon Sep 17 00:00:00 2001 From: Dalai Felinto Date: Sun, 12 Feb 2017 20:43:06 +0100 Subject: Layers: Per-Collection edit mode settings I didn't manage to get the proper object context in the collection properties editor. That said I got it working for now in a temporary way since this will change once we get workspaces anyways (see changes in buttons_context.c and rna_scene.c::rna_LayerCollection_mode_settings_get) I still need to handle the merging of the settings. I will find a provisory solution while we wait for depsgraph. (also layer_collection_create_mode_settings_object and layer_collection_create_mode_settings_edit could probably be elsewhere - under draw/engines likely) --- .../scripts/startup/bl_ui/properties_collection.py | 36 ++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'release/scripts/startup/bl_ui/properties_collection.py') diff --git a/release/scripts/startup/bl_ui/properties_collection.py b/release/scripts/startup/bl_ui/properties_collection.py index 88d78f98ef2..71da89fa10c 100644 --- a/release/scripts/startup/bl_ui/properties_collection.py +++ b/release/scripts/startup/bl_ui/properties_collection.py @@ -124,5 +124,41 @@ class COLLECTION_PT_clay_settings(CollectionButtonsPanel, Panel): template_engine_settings(col, settings, "ssao_attenuation") +class COLLECTION_PT_object_mode_settings(CollectionButtonsPanel, Panel): + bl_label = "Object Mode Settings" + + @classmethod + def poll(cls, context): + ob = context.object + return ob and (ob.mode == 'OBJECT') + + def draw(self, context): + layout = self.layout + + collection = context.layer_collection + settings = collection.get_mode_settings('OBJECT') + + col = layout.column() + template_engine_settings(col, settings, "foo") + + +class COLLECTION_PT_edit_mode_settings(CollectionButtonsPanel, Panel): + bl_label = "Edit Mode Settings" + + @classmethod + def poll(cls, context): + ob = context.object + return ob and (ob.mode == 'EDIT') + + def draw(self, context): + layout = self.layout + + collection = context.layer_collection + settings = collection.get_mode_settings('EDIT') + + col = layout.column() + template_engine_settings(col, settings, "bar") + + if __name__ == "__main__": # only for live edit. bpy.utils.register_module(__name__) -- cgit v1.2.3