| 
									
										
										
										
											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-04-11 16:17:39 +00:00
										 |  |  | import bpy | 
					
						
							| 
									
										
										
										
											2010-01-08 08:54:41 +00:00
										 |  |  | from rna_prop_ui import PropertyPanel | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  | narrowui = 180 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-19 13:37:59 +00:00
										 |  |  | class ObjectButtonsPanel(bpy.types.Panel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_space_type = 'PROPERTIES' | 
					
						
							|  |  |  |     bl_region_type = 'WINDOW' | 
					
						
							|  |  |  |     bl_context = "object" | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-09 09:42:34 +00:00
										 |  |  | class OBJECT_PT_context_object(ObjectButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "" | 
					
						
							|  |  |  |     bl_show_header = False | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							| 
									
										
										
											
												* Multiply for panorama cameras
* Some cases of struct name being set where it shouldnt have been.
* Spelling: wich --> which
* Copy and initialize uv modifier scale, remove unneeded enum.
* Ability to pin any object into the context.
* Update uv window while transforming (useful when used with UVProject modifier)
* Patch by Wahooney, so new template's are internal text and dont get saved over
  by mistake.
* Fix for https://bugzilla.redhat.com/show_bug.cgi?id=572186
  Bug 572186 - [abrt] crash in blender-2.49b-5.fc12: Process
  /usr/bin/blender.bin was killed by signal 6 (SIGABRT). Original fix submitted
  by Jochen Schmitt.
* [#21816] bpy.data.add_image has stopped working on Windows. moved to
  bpy.data.images.load(), missed this call.
(commits 27726,27825,27828,27831,27832,27833,27834,27836,27837,27838,27839,27858 by Campbell from render25 branch)
											
										 
											2010-03-30 12:15:16 +00:00
										 |  |  |         space = context.space_data | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         ob = context.object | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row() | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |         row.label(text="", icon='OBJECT_DATA') | 
					
						
							| 
									
										
										
											
												* Multiply for panorama cameras
* Some cases of struct name being set where it shouldnt have been.
* Spelling: wich --> which
* Copy and initialize uv modifier scale, remove unneeded enum.
* Ability to pin any object into the context.
* Update uv window while transforming (useful when used with UVProject modifier)
* Patch by Wahooney, so new template's are internal text and dont get saved over
  by mistake.
* Fix for https://bugzilla.redhat.com/show_bug.cgi?id=572186
  Bug 572186 - [abrt] crash in blender-2.49b-5.fc12: Process
  /usr/bin/blender.bin was killed by signal 6 (SIGABRT). Original fix submitted
  by Jochen Schmitt.
* [#21816] bpy.data.add_image has stopped working on Windows. moved to
  bpy.data.images.load(), missed this call.
(commits 27726,27825,27828,27831,27832,27833,27834,27836,27837,27838,27839,27858 by Campbell from render25 branch)
											
										 
											2010-03-30 12:15:16 +00:00
										 |  |  |         if space.use_pin_id: | 
					
						
							|  |  |  |             row.template_ID(space, "pin_id") | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             row.prop(ob, "name", text="") | 
					
						
							| 
									
										
										
										
											2009-07-09 16:09:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-08 08:54:41 +00:00
										 |  |  | class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel): | 
					
						
							|  |  |  |     _context_path = "object" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-19 13:37:59 +00:00
										 |  |  | class OBJECT_PT_transform(ObjectButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Transform" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         wide_ui = context.region.width > narrowui | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             row = layout.row() | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             row.column().prop(ob, "location") | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             if ob.rotation_mode == 'QUATERNION': | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 row.column().prop(ob, "rotation_quaternion", text="Rotation") | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             elif ob.rotation_mode == 'AXIS_ANGLE': | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 #row.column().label(text="Rotation") | 
					
						
							|  |  |  |                 #row.column().prop(pchan, "rotation_angle", text="Angle") | 
					
						
							|  |  |  |                 #row.column().prop(pchan, "rotation_axis", text="Axis") | 
					
						
							|  |  |  |                 row.column().prop(ob, "rotation_axis_angle", text="Rotation") | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             else: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 row.column().prop(ob, "rotation_euler", text="Rotation") | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             row.column().prop(ob, "scale") | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             layout.prop(ob, "rotation_mode") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         else: | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             col = layout.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             col.prop(ob, "location") | 
					
						
							|  |  |  |             col.label(text="Rotation:") | 
					
						
							|  |  |  |             col.prop(ob, "rotation_mode", text="") | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             if ob.rotation_mode == 'QUATERNION': | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.prop(ob, "rotation_quaternion", text="") | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             elif ob.rotation_mode == 'AXIS_ANGLE': | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.prop(ob, "rotation_axis_angle", text="") | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             else: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.prop(ob, "rotation_euler", text="") | 
					
						
							|  |  |  |             col.prop(ob, "scale") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-09-28 10:19:20 +00:00
										 |  |  | class OBJECT_PT_transform_locks(ObjectButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Transform Locks" | 
					
						
							|  |  |  |     bl_default_closed = True | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         # wide_ui = context.region.width > narrowui | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = row.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.prop(ob, "lock_location", text="Location") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         col = row.column() | 
					
						
							|  |  |  |         if ob.rotation_mode in ('QUATERNION', 'AXIS_ANGLE'): | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             col.prop(ob, "lock_rotations_4d", text="Rotation") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |             if ob.lock_rotations_4d: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.prop(ob, "lock_rotation_w", text="W") | 
					
						
							|  |  |  |             col.prop(ob, "lock_rotation", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         else: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             col.prop(ob, "lock_rotation", text="Rotation") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         row.column().prop(ob, "lock_scale", text="Scale") | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-07-14 20:27:28 +00:00
										 |  |  | class OBJECT_PT_relations(ObjectButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Relations" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         wide_ui = context.region.width > narrowui | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.prop(ob, "layers") | 
					
						
							|  |  |  |         col.separator() | 
					
						
							|  |  |  |         col.prop(ob, "pass_index") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.label(text="Parent:") | 
					
						
							|  |  |  |         col.prop(ob, "parent", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         sub = col.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         sub.prop(ob, "parent_type", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         parent = ob.parent | 
					
						
							|  |  |  |         if parent and ob.parent_type == 'BONE' and parent.type == 'ARMATURE': | 
					
						
							| 
									
										
										
										
											2009-11-23 11:43:38 +00:00
										 |  |  |             sub.prop_object(ob, "parent_bone", parent.data, "bones", text="") | 
					
						
							| 
									
										
										
										
											2009-11-22 17:41:35 +00:00
										 |  |  |         sub.active = (parent is not None) | 
					
						
							| 
									
										
										
										
											2009-07-14 20:27:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-19 13:37:59 +00:00
										 |  |  | class OBJECT_PT_groups(ObjectButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Groups" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         ob = context.object | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         wide_ui = context.region.width > narrowui | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             split = layout.split() | 
					
						
							| 
									
										
										
										
											2010-01-03 08:38:42 +00:00
										 |  |  |             split.operator_menu_enum("object.group_add", "group") | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             split.label() | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |         else: | 
					
						
							| 
									
										
										
										
											2010-01-03 08:38:42 +00:00
										 |  |  |             layout.operator_menu_enum("object.group_add", "group") | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-04 15:37:22 +00:00
										 |  |  |         index = 0 | 
					
						
							|  |  |  |         value = str(tuple(context.scene.cursor_location)) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         for group in bpy.data.groups: | 
					
						
							|  |  |  |             if ob.name in group.objects: | 
					
						
							|  |  |  |                 col = layout.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |                 col.set_context_pointer("group", group) | 
					
						
							| 
									
										
										
										
											2009-07-14 20:27:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |                 row = col.box().row() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 row.prop(group, "name", text="") | 
					
						
							| 
									
										
										
										
											2009-12-10 10:23:53 +00:00
										 |  |  |                 row.operator("object.group_remove", text="", icon='X') | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |                 split = col.box().split() | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.prop(group, "layer", text="Dupli") | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |                 if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |                     col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 col.prop(group, "dupli_offset", text="") | 
					
						
							| 
									
										
										
										
											2010-01-31 14:46:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-04 15:37:22 +00:00
										 |  |  |                 prop = col.operator("wm.context_set_value", text="From Cursor") | 
					
						
							|  |  |  |                 prop.path = "object.group_users[%d].dupli_offset" % index | 
					
						
							|  |  |  |                 prop.value = value | 
					
						
							|  |  |  |                 index += 1 | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-19 13:37:59 +00:00
										 |  |  | class OBJECT_PT_display(ObjectButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Display" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         wide_ui = context.region.width > narrowui | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         split = layout.split() | 
					
						
							|  |  |  |         col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.prop(ob, "max_draw_type", text="Type") | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             col = split.column() | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         row = col.row() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         row.prop(ob, "draw_bounds", text="Bounds") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         sub = row.row() | 
					
						
							|  |  |  |         sub.active = ob.draw_bounds | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         sub.prop(ob, "draw_bounds_type", text="") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |         split = layout.split() | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |         col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.prop(ob, "draw_name", text="Name") | 
					
						
							|  |  |  |         col.prop(ob, "draw_axis", text="Axis") | 
					
						
							|  |  |  |         col.prop(ob, "draw_wire", text="Wire") | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.prop(ob, "draw_texture_space", text="Texture Space") | 
					
						
							|  |  |  |         col.prop(ob, "x_ray", text="X-Ray") | 
					
						
							|  |  |  |         col.prop(ob, "draw_transparent", text="Transparency") | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-19 13:37:59 +00:00
										 |  |  | class OBJECT_PT_duplication(ObjectButtonsPanel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "Duplication" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         wide_ui = context.region.width > narrowui | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             layout.prop(ob, "dupli_type", expand=True) | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |         else: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             layout.prop(ob, "dupli_type", text="") | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         if ob.dupli_type == 'FRAMES': | 
					
						
							|  |  |  |             split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             col = split.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             col.prop(ob, "dupli_frames_start", text="Start") | 
					
						
							|  |  |  |             col.prop(ob, "dupli_frames_end", text="End") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |             if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |                 col = split.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |             col.prop(ob, "dupli_frames_on", text="On") | 
					
						
							|  |  |  |             col.prop(ob, "dupli_frames_off", text="Off") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-01-04 17:27:23 +00:00
										 |  |  |             layout.prop(ob, "use_dupli_frames_speed", text="Speed") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         elif ob.dupli_type == 'VERTS': | 
					
						
							| 
									
										
										
										
											2010-01-04 17:27:23 +00:00
										 |  |  |             layout.prop(ob, "use_dupli_verts_rotation", text="Rotation") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         elif ob.dupli_type == 'FACES': | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |             col = split.column() | 
					
						
							| 
									
										
										
										
											2010-01-04 17:27:23 +00:00
										 |  |  |             col.prop(ob, "use_dupli_faces_scale", text="Scale") | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |             if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |                 col = split.column() | 
					
						
							| 
									
										
										
										
											2010-01-04 17:27:23 +00:00
										 |  |  |             col.prop(ob, "dupli_faces_scale", text="Inherit Scale") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         elif ob.dupli_type == 'GROUP': | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |             if wide_ui: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 layout.prop(ob, "dupli_group", text="Group") | 
					
						
							| 
									
										
										
										
											2009-11-12 12:35:37 +00:00
										 |  |  |             else: | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |                 layout.prop(ob, "dupli_group", text="") | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-26 02:57:49 +00:00
										 |  |  | # XXX: the following options are all quite buggy, ancient hacks that should be dropped | 
					
						
							| 
									
										
										
										
											2010-04-04 14:52:15 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-19 13:37:59 +00:00
										 |  |  | class OBJECT_PT_animation(ObjectButtonsPanel): | 
					
						
							| 
									
										
										
										
											2010-03-26 02:57:49 +00:00
										 |  |  |     bl_label = "Animation Hacks" | 
					
						
							|  |  |  |     bl_default_closed = True | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							| 
									
										
										
										
											2009-11-19 13:26:51 +00:00
										 |  |  |         wide_ui = context.region.width > narrowui | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = split.column() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.label(text="Time Offset:") | 
					
						
							|  |  |  |         col.prop(ob, "time_offset_edit", text="Edit") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         row = col.row() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         row.prop(ob, "time_offset_particle", text="Particle") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         row.active = len(ob.particle_systems) != 0 | 
					
						
							|  |  |  |         row = col.row() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         row.prop(ob, "time_offset_parent", text="Parent") | 
					
						
							| 
									
										
										
										
											2009-11-22 17:41:35 +00:00
										 |  |  |         row.active = (ob.parent is not None) | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         row = col.row() | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         row.prop(ob, "slow_parent") | 
					
						
							| 
									
										
										
										
											2009-11-22 17:41:35 +00:00
										 |  |  |         row.active = (ob.parent is not None) | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.prop(ob, "time_offset", text="Offset") | 
					
						
							| 
									
										
										
										
											2010-04-04 14:52:15 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-26 02:57:49 +00:00
										 |  |  |         # XXX: these are still used for a few curve-related tracking features | 
					
						
							| 
									
										
										
										
											2010-03-26 03:10:58 +00:00
										 |  |  |         if wide_ui: | 
					
						
							|  |  |  |             col = split.column() | 
					
						
							| 
									
										
										
										
											2010-03-26 02:57:49 +00:00
										 |  |  |         col.label(text="Tracking Axes:") | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         col.prop(ob, "track_axis", text="Axis") | 
					
						
							|  |  |  |         col.prop(ob, "up_axis", text="Up Axis") | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-03-06 01:40:29 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | # import generic panels from other files | 
					
						
							| 
									
										
										
										
											2010-02-25 12:01:43 +00:00
										 |  |  | from properties_animviz import OBJECT_PT_motion_paths, OBJECT_PT_onion_skinning | 
					
						
							| 
									
										
										
										
											2009-11-16 22:53:28 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-14 11:21:21 +00:00
										 |  |  | classes = [ | 
					
						
							|  |  |  |     OBJECT_PT_context_object, | 
					
						
							|  |  |  |     OBJECT_PT_transform, | 
					
						
							|  |  |  |     OBJECT_PT_transform_locks, | 
					
						
							|  |  |  |     OBJECT_PT_relations, | 
					
						
							|  |  |  |     OBJECT_PT_groups, | 
					
						
							|  |  |  |     OBJECT_PT_display, | 
					
						
							|  |  |  |     OBJECT_PT_duplication, | 
					
						
							| 
									
										
										
										
											2010-03-26 02:57:49 +00:00
										 |  |  |     OBJECT_PT_animation, # XXX: panel of old hacks pending to be removed... | 
					
						
							| 
									
										
										
										
											2010-03-06 01:40:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-25 12:01:43 +00:00
										 |  |  |     OBJECT_PT_motion_paths, | 
					
						
							|  |  |  |     #OBJECT_PT_onion_skinning, | 
					
						
							| 
									
										
										
										
											2010-02-14 11:21:21 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     OBJECT_PT_custom_props] | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | def register(): | 
					
						
							|  |  |  |     register = bpy.types.register | 
					
						
							|  |  |  |     for cls in classes: | 
					
						
							|  |  |  |         register(cls) | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-22 23:32:58 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-02-14 11:21:21 +00:00
										 |  |  | def unregister(): | 
					
						
							|  |  |  |     unregister = bpy.types.unregister | 
					
						
							|  |  |  |     for cls in classes: | 
					
						
							|  |  |  |         unregister(cls) | 
					
						
							| 
									
										
										
										
											2010-02-16 09:55:07 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | if __name__ == "__main__": | 
					
						
							|  |  |  |     register() |