2009-11-01 15:21:20 +00:00
|
|
|
# ##### BEGIN GPL LICENSE BLOCK #####
|
|
|
|
#
|
|
|
|
# This program is free software; you can redistribute it and/or
|
|
|
|
# modify it under the terms of the GNU General Public License
|
|
|
|
# as published by the Free Software Foundation; either version 2
|
|
|
|
# of the License, or (at your option) any later version.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# This program is distributed in the hope that it will be useful,
|
|
|
|
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
# GNU General Public License for more details.
|
2009-11-03 07:23:02 +00:00
|
|
|
#
|
2009-11-01 15:21:20 +00:00
|
|
|
# You should have received a copy of the GNU General Public License
|
|
|
|
# along with this program; if not, write to the Free Software Foundation,
|
2010-02-12 13:34:04 +00:00
|
|
|
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
2009-11-01 15:21:20 +00:00
|
|
|
#
|
|
|
|
# ##### END GPL LICENSE BLOCK #####
|
2009-10-31 20:16:59 +00:00
|
|
|
|
2009-10-31 23:35:56 +00:00
|
|
|
# <pep8 compliant>
|
2009-05-08 18:17:57 +00:00
|
|
|
import bpy
|
2011-08-12 06:57:00 +00:00
|
|
|
from bpy.types import Panel
|
2013-02-10 10:29:38 +00:00
|
|
|
from bpy.app.translations import pgettext_iface as iface_
|
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'
|
|
|
|
|
2009-10-31 19:31:45 +00:00
|
|
|
def draw(self, context):
|
|
|
|
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'
|
|
|
|
|
|
|
|
def draw(self, context):
|
|
|
|
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)
|