1
# ##### BEGIN GPL LICENSE BLOCK #####
3
# This program is free software; you can redistribute it and/or
4
# modify it under the terms of the GNU General Public License
5
# as published by the Free Software Foundation; either version 2
6
# of the License, or (at your option) any later version.
8
# This program is distributed in the hope that it will be useful,
9
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11
# GNU General Public License for more details.
13
# You should have received a copy of the GNU General Public License
14
# along with this program; if not, write to the Free Software Foundation,
15
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17
# ##### END GPL LICENSE BLOCK #####
21
from bpy.types import Panel
24
class DataButtonsPanel():
25
bl_space_type = 'PROPERTIES'
26
bl_region_type = 'WINDOW'
30
def poll(cls, context):
31
return (context.object and context.object.type == 'EMPTY')
34
class DATA_PT_empty(DataButtonsPanel, Panel):
37
def draw(self, context):
42
layout.prop(ob, "empty_draw_type", text="Display")
44
if ob.empty_draw_type == 'IMAGE':
45
layout.template_ID(ob, "data", open="image.open", unlink="image.unlink")
47
layout.prop(ob, "color", text="Transparency", index=3, slider=True)
48
row = layout.row(align=True)
49
row.prop(ob, "empty_image_offset", text="Offset X", index=0)
50
row.prop(ob, "empty_image_offset", text="Offset Y", index=1)
52
layout.prop(ob, "empty_draw_size", text="Size")
54
if __name__ == "__main__": # only for live edit.
55
bpy.utils.register_module(__name__)