feat: filter by type for outliner
This commit is contained in:
@ -104,7 +104,7 @@ class ReplicatedDatablock(bpy.types.PropertyGroup):
|
|||||||
type_name: bpy.props.StringProperty()
|
type_name: bpy.props.StringProperty()
|
||||||
bl_delay_refresh: bpy.props.FloatProperty()
|
bl_delay_refresh: bpy.props.FloatProperty()
|
||||||
bl_delay_apply: bpy.props.FloatProperty()
|
bl_delay_apply: bpy.props.FloatProperty()
|
||||||
use_as_filter: bpy.props.BoolProperty(default=False)
|
use_as_filter: bpy.props.BoolProperty(default=True)
|
||||||
icon: bpy.props.StringProperty()
|
icon: bpy.props.StringProperty()
|
||||||
|
|
||||||
class SessionProps(bpy.types.PropertyGroup):
|
class SessionProps(bpy.types.PropertyGroup):
|
||||||
|
9
ui.py
9
ui.py
@ -286,14 +286,17 @@ class SESSION_PT_outliner(bpy.types.Panel):
|
|||||||
row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
|
row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
|
||||||
|
|
||||||
for item in settings.supported_datablock:
|
for item in settings.supported_datablock:
|
||||||
col = flow.column()
|
col = flow.column(align=True)
|
||||||
col.prop(item,"use_as_filter",text="", icon=item.icon)
|
col.prop(item,"use_as_filter",text="", icon=item.icon)
|
||||||
# row.prop(item, "is_replicated", text="")
|
# row.prop(item, "is_replicated", text="")
|
||||||
|
|
||||||
row = layout.row(align=True)
|
row = layout.row(align=True)
|
||||||
# Property area
|
# Property area
|
||||||
# area_msg = row.box()
|
# area_msg = row.box()
|
||||||
client_keys = operators.client.list()
|
|
||||||
|
types_filter = [t.type_name for t in settings.supported_datablock if t.use_as_filter]
|
||||||
|
client_keys = [key for key in operators.client.list() if operators.client.get(uuid=key).str_type in types_filter]
|
||||||
|
|
||||||
|
|
||||||
if client_keys and len(client_keys) > 0:
|
if client_keys and len(client_keys) > 0:
|
||||||
col = layout.column(align=True)
|
col = layout.column(align=True)
|
||||||
@ -301,7 +304,7 @@ class SESSION_PT_outliner(bpy.types.Panel):
|
|||||||
draw_property(context, col, key)
|
draw_property(context, col, key)
|
||||||
|
|
||||||
else:
|
else:
|
||||||
col.label(text="Empty")
|
row.label(text="Empty")
|
||||||
|
|
||||||
|
|
||||||
classes = (
|
classes = (
|
||||||
|
Reference in New Issue
Block a user