2022-02-10 22:07:11 +00:00
|
|
|
# SPDX-License-Identifier: GPL-2.0-or-later
|
2011-08-12 06:57:00 +00:00
|
|
|
from bpy.types import Panel
|
2013-02-10 09:09:26 +00:00
|
|
|
|
2011-09-20 18:29:19 +00:00
|
|
|
|
2015-01-29 04:35:06 +00:00
|
|
|
class ModifierButtonsPanel:
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_space_type = 'PROPERTIES'
|
|
|
|
bl_region_type = 'WINDOW'
|
|
|
|
bl_context = "modifier"
|
2012-03-10 20:08:25 +00:00
|
|
|
bl_options = {'HIDE_HEADER'}
|
2009-10-31 19:31:45 +00:00
|
|
|
|
2018-07-31 11:06:08 +00:00
|
|
|
|
2011-08-12 06:57:00 +00:00
|
|
|
class DATA_PT_modifiers(ModifierButtonsPanel, Panel):
|
2009-10-31 19:31:45 +00:00
|
|
|
bl_label = "Modifiers"
|
|
|
|
|
2018-07-31 08:22:19 +00:00
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
ob = context.object
|
|
|
|
return ob and ob.type != 'GPENCIL'
|
|
|
|
|
2021-03-06 07:21:17 +00:00
|
|
|
def draw(self, _context):
|
2009-10-31 19:31:45 +00:00
|
|
|
layout = self.layout
|
2010-01-30 08:45:31 +00:00
|
|
|
layout.operator_menu_enum("object.modifier_add", "type")
|
2020-06-05 14:41:03 +00:00
|
|
|
layout.template_modifiers()
|
2020-05-13 10:39:17 +00:00
|
|
|
|
2013-12-21 20:08:35 +00:00
|
|
|
|
2018-07-31 08:22:19 +00:00
|
|
|
class DATA_PT_gpencil_modifiers(ModifierButtonsPanel, Panel):
|
|
|
|
bl_label = "Modifiers"
|
|
|
|
|
|
|
|
@classmethod
|
|
|
|
def poll(cls, context):
|
|
|
|
ob = context.object
|
|
|
|
return ob and ob.type == 'GPENCIL'
|
|
|
|
|
2021-03-06 07:21:17 +00:00
|
|
|
def draw(self, _context):
|
2018-07-31 08:22:19 +00:00
|
|
|
layout = self.layout
|
|
|
|
layout.operator_menu_enum("object.gpencil_modifier_add", "type")
|
2020-06-19 18:42:08 +00:00
|
|
|
layout.template_grease_pencil_modifiers()
|
2019-11-14 18:18:23 +00:00
|
|
|
|
2019-12-16 03:29:03 +00:00
|
|
|
|
2017-03-18 09:03:24 +00:00
|
|
|
classes = (
|
|
|
|
DATA_PT_modifiers,
|
2018-07-31 08:22:19 +00:00
|
|
|
DATA_PT_gpencil_modifiers,
|
2017-03-18 09:03:24 +00:00
|
|
|
)
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
2017-03-18 09:03:24 +00:00
|
|
|
from bpy.utils import register_class
|
2020-03-09 15:27:24 +00:00
|
|
|
|
2017-03-18 09:03:24 +00:00
|
|
|
for cls in classes:
|
|
|
|
register_class(cls)
|