Changeset View
Changeset View
Standalone View
Standalone View
release/scripts/startup/bl_ui/properties_data_curves.py
| Show All 29 Lines | def draw(self, context): | ||||
| space = context.space_data | space = context.space_data | ||||
| if ob: | if ob: | ||||
| layout.template_ID(ob, "data") | layout.template_ID(ob, "data") | ||||
| elif curves: | elif curves: | ||||
| layout.template_ID(space, "pin_id") | layout.template_ID(space, "pin_id") | ||||
| class DATA_PT_curves_surface(DataButtonsPanel, Panel): | |||||
| bl_label = "Surface" | |||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | |||||
| def draw(self, context): | |||||
| layout = self.layout | |||||
| ob = context.object | |||||
| layout.prop(ob.data, "surface") | |||||
| class CURVES_MT_add_attribute(Menu): | class CURVES_MT_add_attribute(Menu): | ||||
| bl_label = "Add Attribute" | bl_label = "Add Attribute" | ||||
| @staticmethod | @staticmethod | ||||
| def add_standard_attribute(layout, curves, name, data_type, domain): | def add_standard_attribute(layout, curves, name, data_type, domain): | ||||
| exists = curves.attributes.get(name) is not None | exists = curves.attributes.get(name) is not None | ||||
| col = layout.column() | col = layout.column() | ||||
| ▲ Show 20 Lines • Show All 63 Lines • ▼ Show 20 Lines | |||||
| class DATA_PT_custom_props_curves(DataButtonsPanel, PropertyPanel, Panel): | class DATA_PT_custom_props_curves(DataButtonsPanel, PropertyPanel, Panel): | ||||
| COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'} | ||||
| _context_path = "object.data" | _context_path = "object.data" | ||||
| _property_type = bpy.types.Curves if hasattr(bpy.types, "Curves") else None | _property_type = bpy.types.Curves if hasattr(bpy.types, "Curves") else None | ||||
| classes = ( | classes = ( | ||||
| DATA_PT_context_curves, | DATA_PT_context_curves, | ||||
| DATA_PT_curves_surface, | |||||
HooglyBoogly: I'd order this below the attributes panel, which is more important IMO. | |||||
| DATA_PT_CURVES_attributes, | DATA_PT_CURVES_attributes, | ||||
| DATA_PT_custom_props_curves, | DATA_PT_custom_props_curves, | ||||
| CURVES_MT_add_attribute, | CURVES_MT_add_attribute, | ||||
| CURVES_UL_attributes, | CURVES_UL_attributes, | ||||
| ) | ) | ||||
| 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) | ||||
I'd order this below the attributes panel, which is more important IMO.