Posts

Showing posts from October 5, 2019

Best way to store options for panels

Image
4 $begingroup$ lets say i have a panel and i want to collapse a part if a bool is False import bpy class HelloWorldPanel(bpy.types.Panel): """Creates a Panel in the Object properties window""" bl_label = "Hello World Panel" bl_idname = "OBJECT_PT_hello" bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "object" def draw(self, context): layout = self.layout # where should i define this bool ? layout.prop(place, "bool") if bool is True: obj = context.object row = layout.row() row.label(text="Hello world!", icon='WORLD_DATA') row = layout.row() row.label(text="