diff options
author | Dalai Felinto <dfelinto@gmail.com> | 2017-02-12 22:43:06 +0300 |
---|---|---|
committer | Dalai Felinto <dfelinto@gmail.com> | 2017-02-12 22:47:34 +0300 |
commit | adf355849f5c68bf504ba435cc54872b2e2ee87a (patch) | |
tree | f625dea79bf5e5a04cd9f0b0cb1b035e10fa8167 /release/scripts/startup/bl_ui/properties_collection.py | |
parent | b104057d001d2472cc55c7fa51cff3275e331523 (diff) |
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)
Diffstat (limited to 'release/scripts/startup/bl_ui/properties_collection.py')
-rw-r--r-- | release/scripts/startup/bl_ui/properties_collection.py | 36 |
1 files changed, 36 insertions, 0 deletions
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__) |