This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/release/scripts/startup/bl_ui/properties_data_empty.py
Campbell Barton d72d2d4133 DNA: clear / remove deprecated flags
- Clear deprecated flags for ID's:
  Scene, Sequence, World, Object & Mesh.
- Clear deprecated flags for Spaces: outliner, 3D view & image.
- Remove unused `Mesh.drawflag`
- Remove unused `USER_ALLWINCODECS`, `USER_MMB_PASTE`.
- Remove `V3D_SOLID_TEX` & `V3D_ZBUF_SELECT` - used in a few areas.
- Flip `Object.empty_image_visibility_flag`
  (avoids do-version on each new flag)
- Rename 'Backside' -> 'Back' in context of drawing - showing 'Back'
  makes sense.
2018-12-17 13:55:06 +11:00

72 lines
2.4 KiB
Python

# ##### 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.
#
# 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.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
from bpy.types import Panel
class DataButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "data"
@classmethod
def poll(cls, context):
return (context.object and context.object.type == 'EMPTY')
class DATA_PT_empty(DataButtonsPanel, Panel):
bl_label = "Empty"
def draw(self, context):
layout = self.layout
layout.use_property_split = True
ob = context.object
layout.prop(ob, "empty_display_type", text="Display As")
layout.prop(ob, "empty_display_size", text="Size")
if ob.empty_display_type == 'IMAGE':
layout.template_ID(ob, "data", open="image.open", unlink="object.unlink_data")
layout.template_image(ob, "data", ob.image_user, compact=True)
layout.row(align=True).row(align=True)
layout.prop(ob, "color", text="Transparency", index=3, slider=True)
col = layout.column(align=True)
col.prop(ob, "empty_image_offset", text="Offset X", index=0)
col.prop(ob, "empty_image_offset", text="Y", index=1)
col = layout.column()
col.row().prop(ob, "empty_image_depth", text="Depth", expand=True)
col.prop(ob, "show_empty_image_orthographic", text="Display Orthographic")
col.prop(ob, "show_empty_image_perspective", text="Display Perspective")
col.prop(ob, "show_empty_image_back", text="Display Back")
classes = (
DATA_PT_empty,
)
if __name__ == "__main__": # only for live edit.
from bpy.utils import register_class
for cls in classes:
register_class(cls)