2022-02-11 09:07:11 +11: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 15:35:06 +11: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 21:06:08 +10: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 10:22:19 +02:00
|
|
|
@classmethod
|
|
|
|
|
def poll(cls, context):
|
|
|
|
|
ob = context.object
|
|
|
|
|
return ob and ob.type != 'GPENCIL'
|
|
|
|
|
|
2021-03-06 18:21:17 +11: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 10:41:03 -04:00
|
|
|
layout.template_modifiers()
|
2020-05-13 12:39:17 +02:00
|
|
|
|
2013-12-22 07:08:35 +11:00
|
|
|
|
2018-07-31 10:22:19 +02: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 18:21:17 +11:00
|
|
|
def draw(self, _context):
|
2018-07-31 10:22:19 +02:00
|
|
|
layout = self.layout
|
|
|
|
|
layout.operator_menu_enum("object.gpencil_modifier_add", "type")
|
2020-06-19 14:42:08 -04:00
|
|
|
layout.template_grease_pencil_modifiers()
|
2019-11-14 19:18:23 +01:00
|
|
|
|
2019-12-16 14:29:03 +11:00
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
classes = (
|
|
|
|
|
DATA_PT_modifiers,
|
2018-07-31 10:22:19 +02:00
|
|
|
DATA_PT_gpencil_modifiers,
|
2017-03-18 20:03:24 +11:00
|
|
|
)
|
|
|
|
|
|
2011-04-04 10:13:04 +00:00
|
|
|
if __name__ == "__main__": # only for live edit.
|
2017-03-18 20:03:24 +11:00
|
|
|
from bpy.utils import register_class
|
2020-03-09 16:27:24 +01:00
|
|
|
|
2017-03-18 20:03:24 +11:00
|
|
|
for cls in classes:
|
|
|
|
|
register_class(cls)
|