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)
This commit is contained in:
@@ -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__)
|
||||
|
Reference in New Issue
Block a user