Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_collection.py
| # SPDX-License-Identifier: GPL-2.0-or-later | # SPDX-License-Identifier: GPL-2.0-or-later | ||||
| from bpy.types import Panel | from bpy.types import Panel, Menu | ||||
| class CollectionButtonsPanel: | class CollectionButtonsPanel: | ||||
| bl_space_type = 'PROPERTIES' | bl_space_type = 'PROPERTIES' | ||||
| bl_region_type = 'WINDOW' | bl_region_type = 'WINDOW' | ||||
| bl_context = "collection" | bl_context = "collection" | ||||
| @classmethod | @classmethod | ||||
| Show All 26 Lines | def draw(self, context): | ||||
| col.prop(collection, "hide_select", text="Selectable", toggle=False, invert_checkbox=True) | col.prop(collection, "hide_select", text="Selectable", toggle=False, invert_checkbox=True) | ||||
| col.prop(collection, "hide_render", toggle=False) | col.prop(collection, "hide_render", toggle=False) | ||||
| col = layout.column(align=True) | col = layout.column(align=True) | ||||
| col.prop(vlc, "holdout", toggle=False) | col.prop(vlc, "holdout", toggle=False) | ||||
| col.prop(vlc, "indirect_only", toggle=False) | col.prop(vlc, "indirect_only", toggle=False) | ||||
| class COLLECTION_MT_context_menu_instance_offset(Menu): | |||||
| bl_label = "Instance Offset" | |||||
| def draw(self, _context): | |||||
| layout = self.layout | |||||
| layout.operator("object.instance_offset_from_cursor") | |||||
| layout.operator("object.instance_offset_from_object") | |||||
| layout.operator("object.instance_offset_to_cursor") | |||||
| class COLLECTION_PT_instancing(CollectionButtonsPanel, Panel): | class COLLECTION_PT_instancing(CollectionButtonsPanel, Panel): | ||||
| bl_label = "Instancing" | bl_label = "Instancing" | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| layout.use_property_split = True | layout.use_property_split = True | ||||
| layout.use_property_decorate = False | layout.use_property_decorate = False | ||||
| collection = context.collection | collection = context.collection | ||||
| row = layout.row() | row = layout.row(align=True) | ||||
| row.prop(collection, "instance_offset") | row.prop(collection, "instance_offset") | ||||
| row.menu("COLLECTION_MT_context_menu_instance_offset", icon='DOWNARROW_HLT', text="") | |||||
| class COLLECTION_PT_lineart_collection(CollectionButtonsPanel, Panel): | class COLLECTION_PT_lineart_collection(CollectionButtonsPanel, Panel): | ||||
| bl_label = "Line Art" | bl_label = "Line Art" | ||||
| bl_order = 10 | bl_order = 10 | ||||
| def draw(self, context): | def draw(self, context): | ||||
| layout = self.layout | layout = self.layout | ||||
| Show All 11 Lines | def draw(self, context): | ||||
| row = col.row(align=True, heading="Masks") | row = col.row(align=True, heading="Masks") | ||||
| for i in range(8): | for i in range(8): | ||||
| row.prop(collection, "lineart_intersection_mask", index=i, text=" ", toggle=True) | row.prop(collection, "lineart_intersection_mask", index=i, text=" ", toggle=True) | ||||
| if i == 3: | if i == 3: | ||||
| row = col.row(align=True) | row = col.row(align=True) | ||||
| classes = ( | classes = ( | ||||
| COLLECTION_MT_context_menu_instance_offset, | |||||
| COLLECTION_PT_collection_flags, | COLLECTION_PT_collection_flags, | ||||
| COLLECTION_PT_instancing, | COLLECTION_PT_instancing, | ||||
| COLLECTION_PT_lineart_collection, | COLLECTION_PT_lineart_collection, | ||||
| ) | ) | ||||
| if __name__ == "__main__": # only for live edit. | if __name__ == "__main__": # only for live edit. | ||||
| from bpy.utils import register_class | from bpy.utils import register_class | ||||
| for cls in classes: | for cls in classes: | ||||
| register_class(cls) | register_class(cls) | ||||