| 
									
										
										
										
											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 | 
					
						
							| 
									
										
										
										
											2014-08-06 20:03:16 +02:00
										 |  |  | from bpy.types import Panel, Menu | 
					
						
							| 
									
										
										
										
											2010-01-08 08:54:41 +00:00
										 |  |  | from rna_prop_ui import PropertyPanel | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-20 18:29:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  | class ObjectButtonsPanel(): | 
					
						
							| 
									
										
										
										
											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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-12 06:57:00 +00:00
										 |  |  | class OBJECT_PT_context_object(ObjectButtonsPanel, Panel): | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |     bl_label = "" | 
					
						
							| 
									
										
										
										
											2010-08-26 01:05:37 +00:00
										 |  |  |     bl_options = {'HIDE_HEADER'} | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     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
										 |  |  | 
 | 
					
						
							| 
									
										
										
											
												* 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: | 
					
						
							| 
									
										
										
										
											2010-12-30 12:22:28 +00:00
										 |  |  |             layout.template_ID(space, "pin_id") | 
					
						
							| 
									
										
										
											
												* 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
										 |  |  |         else: | 
					
						
							| 
									
										
										
										
											2010-12-24 10:15:57 +00:00
										 |  |  |             row = layout.row() | 
					
						
							| 
									
										
										
										
											2011-04-08 16:56:44 +00:00
										 |  |  |             row.template_ID(context.scene.objects, "active") | 
					
						
							| 
									
										
										
										
											2009-07-09 16:09:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-12 06:57:00 +00:00
										 |  |  | class OBJECT_PT_transform(ObjectButtonsPanel, Panel): | 
					
						
							| 
									
										
										
										
											2011-09-15 13:20:18 +00:00
										 |  |  |     bl_label = "Transform" | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         row = layout.row() | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         row.column().prop(ob, "location") | 
					
						
							|  |  |  |         if ob.rotation_mode == 'QUATERNION': | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +00:00
										 |  |  |             row.column().prop(ob, "rotation_quaternion", text="Rotation") | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         elif ob.rotation_mode == 'AXIS_ANGLE': | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +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") | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         else: | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +00:00
										 |  |  |             row.column().prop(ob, "rotation_euler", text="Rotation") | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         row.column().prop(ob, "scale") | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         layout.prop(ob, "rotation_mode") | 
					
						
							| 
									
										
										
										
											2011-01-01 07:20:34 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-12 06:57:00 +00:00
										 |  |  | class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel): | 
					
						
							| 
									
										
										
										
											2011-09-15 13:20:18 +00:00
										 |  |  |     bl_label = "Delta Transform" | 
					
						
							| 
									
										
										
										
											2010-10-16 11:52:30 +00:00
										 |  |  |     bl_options = {'DEFAULT_CLOSED'} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row = layout.row() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         row.column().prop(ob, "delta_location") | 
					
						
							|  |  |  |         if ob.rotation_mode == 'QUATERNION': | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +00:00
										 |  |  |             row.column().prop(ob, "delta_rotation_quaternion", text="Rotation") | 
					
						
							| 
									
										
										
										
											2010-10-16 11:52:30 +00:00
										 |  |  |         elif ob.rotation_mode == 'AXIS_ANGLE': | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +00:00
										 |  |  |             #row.column().label(text="Rotation") | 
					
						
							|  |  |  |             #row.column().prop(pchan, "delta_rotation_angle", text="Angle") | 
					
						
							|  |  |  |             #row.column().prop(pchan, "delta_rotation_axis", text="Axis") | 
					
						
							|  |  |  |             #row.column().prop(ob, "delta_rotation_axis_angle", text="Rotation") | 
					
						
							|  |  |  |             row.column().label(text="Not for Axis-Angle") | 
					
						
							| 
									
										
										
										
											2010-10-16 11:52:30 +00:00
										 |  |  |         else: | 
					
						
							| 
									
										
										
										
											2012-03-19 07:57:35 +00:00
										 |  |  |             row.column().prop(ob, "delta_rotation_euler", text="Delta Rotation") | 
					
						
							| 
									
										
										
										
											2010-10-16 11:52:30 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         row.column().prop(ob, "delta_scale") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-12 06:57:00 +00:00
										 |  |  | class OBJECT_PT_transform_locks(ObjectButtonsPanel, Panel): | 
					
						
							| 
									
										
										
										
											2011-09-15 13:20:18 +00:00
										 |  |  |     bl_label = "Transform Locks" | 
					
						
							| 
									
										
										
										
											2010-08-26 01:05:37 +00:00
										 |  |  |     bl_options = {'DEFAULT_CLOSED'} | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-06 18:11:12 +00:00
										 |  |  |         split = layout.split(percentage=0.1) | 
					
						
							| 
									
										
										
										
											2012-06-19 22:17:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-06 18:11:12 +00:00
										 |  |  |         col = split.column(align=True) | 
					
						
							|  |  |  |         col.label(text="") | 
					
						
							|  |  |  |         col.label(text="X:") | 
					
						
							|  |  |  |         col.label(text="Y:") | 
					
						
							|  |  |  |         col.label(text="Z:") | 
					
						
							| 
									
										
										
										
											2012-06-19 22:17:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-08-23 20:41:21 +00:00
										 |  |  |         split.column().prop(ob, "lock_location", text="Location") | 
					
						
							|  |  |  |         split.column().prop(ob, "lock_rotation", text="Rotation") | 
					
						
							|  |  |  |         split.column().prop(ob, "lock_scale", text="Scale") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-07 13:23:45 +00:00
										 |  |  |         if ob.rotation_mode in {'QUATERNION', 'AXIS_ANGLE'}: | 
					
						
							| 
									
										
										
										
											2012-06-06 18:11:12 +00:00
										 |  |  |             row = layout.row() | 
					
						
							|  |  |  |             row.prop(ob, "lock_rotations_4d", text="Lock Rotation") | 
					
						
							| 
									
										
										
										
											2012-06-19 22:17:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-06-06 18:11:12 +00:00
										 |  |  |             sub = row.row() | 
					
						
							|  |  |  |             sub.active = ob.lock_rotations_4d | 
					
						
							|  |  |  |             sub.prop(ob, "lock_rotation_w", text="W") | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-12 06:57:00 +00:00
										 |  |  | class OBJECT_PT_relations(ObjectButtonsPanel, Panel): | 
					
						
							| 
									
										
										
										
											2011-09-15 13:20:18 +00:00
										 |  |  |     bl_label = "Relations" | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         col = split.column() | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +00:00
										 |  |  |         col.label(text="Parent:") | 
					
						
							| 
									
										
										
										
											2009-11-23 00:27:30 +00:00
										 |  |  |         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': | 
					
						
							| 
									
										
										
										
											2010-08-23 05:47:45 +00:00
										 |  |  |             sub.prop_search(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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-06 20:03:16 +02:00
										 |  |  | class GROUP_MT_specials(Menu): | 
					
						
							|  |  |  |     bl_label = "Group Specials" | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         layout.operator("object.group_unlink", icon='X') | 
					
						
							|  |  |  |         layout.operator("object.grouped_select") | 
					
						
							| 
									
										
										
										
											2014-08-07 04:36:56 +10:00
										 |  |  |         layout.operator("object.dupli_offset_from_cursor") | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-12 06:57:00 +00:00
										 |  |  | class OBJECT_PT_groups(ObjectButtonsPanel, Panel): | 
					
						
							| 
									
										
										
										
											2011-09-15 13:20:18 +00:00
										 |  |  |     bl_label = "Groups" | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-03 10:32:10 +00:00
										 |  |  |         obj = context.object | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-06-27 21:35:31 +00:00
										 |  |  |         row = layout.row(align=True) | 
					
						
							| 
									
										
										
										
											2013-03-20 01:41:33 +00:00
										 |  |  |         if bpy.data.groups: | 
					
						
							|  |  |  |             row.operator("object.group_link", text="Add to Group") | 
					
						
							|  |  |  |         else: | 
					
						
							|  |  |  |             row.operator("object.group_add", text="Add to Group") | 
					
						
							| 
									
										
										
										
											2010-06-27 21:35:31 +00:00
										 |  |  |         row.operator("object.group_add", text="", icon='ZOOMIN') | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-03 10:32:10 +00:00
										 |  |  |         obj_name = obj.name | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         for group in bpy.data.groups: | 
					
						
							| 
									
										
										
										
											2012-07-03 10:32:10 +00:00
										 |  |  |             # XXX this is slow and stupid!, we need 2 checks, one thats fast | 
					
						
							| 
									
										
										
										
											2014-01-13 14:53:41 +11:00
										 |  |  |             # and another that we can be sure its not a name collision | 
					
						
							| 
									
										
										
										
											2012-07-03 10:32:10 +00:00
										 |  |  |             # from linked library data | 
					
						
							|  |  |  |             group_objects = group.objects | 
					
						
							|  |  |  |             if obj_name in group.objects and obj in group_objects[:]: | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |                 col = layout.column(align=True) | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-09-03 07:25:37 +00:00
										 |  |  |                 col.context_pointer_set("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="") | 
					
						
							| 
									
										
										
										
											2010-06-26 21:40:11 +00:00
										 |  |  |                 row.operator("object.group_remove", text="", icon='X', emboss=False) | 
					
						
							| 
									
										
										
										
											2014-08-06 20:03:16 +02:00
										 |  |  |                 row.menu("GROUP_MT_specials", icon='DOWNARROW_HLT', text="") | 
					
						
							| 
									
										
										
										
											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() | 
					
						
							| 
									
										
										
										
											2012-09-29 04:07:50 +00:00
										 |  |  |                 col.prop(group, "layers", text="Dupli Visibility") | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-12 06:57:00 +00:00
										 |  |  | class OBJECT_PT_display(ObjectButtonsPanel, Panel): | 
					
						
							| 
									
										
										
										
											2011-09-15 13:20:18 +00:00
										 |  |  |     bl_label = "Display" | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							| 
									
										
										
										
											2013-07-28 22:12:19 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-03 05:16:15 +00:00
										 |  |  |         obj = context.object | 
					
						
							| 
									
										
										
										
											2013-07-28 11:43:11 +00:00
										 |  |  |         obj_type = obj.type | 
					
						
							|  |  |  |         is_geometry = (obj_type in {'MESH', 'CURVE', 'SURFACE', 'META', 'FONT'}) | 
					
						
							| 
									
										
										
										
											2014-05-13 08:52:51 +02:00
										 |  |  |         is_wire = (obj_type in {'CAMERA', 'EMPTY'}) | 
					
						
							| 
									
										
										
										
											2013-07-28 11:43:11 +00:00
										 |  |  |         is_empty_image = (obj_type == 'EMPTY' and obj.empty_draw_type == 'IMAGE') | 
					
						
							| 
									
										
										
										
											2014-03-14 02:13:31 +11:00
										 |  |  |         is_dupli = (obj.dupli_type != 'NONE') | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +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() | 
					
						
							| 
									
										
										
										
											2013-04-03 05:16:15 +00:00
										 |  |  |         col.prop(obj, "show_name", text="Name") | 
					
						
							|  |  |  |         col.prop(obj, "show_axis", text="Axis") | 
					
						
							| 
									
										
										
										
											2014-03-14 02:13:31 +11:00
										 |  |  |         # Makes no sense for cameras, armatures, etc.! | 
					
						
							|  |  |  |         # but these settings do apply to dupli instances | 
					
						
							|  |  |  |         if is_geometry or is_dupli: | 
					
						
							| 
									
										
										
										
											2013-04-03 05:16:15 +00:00
										 |  |  |             col.prop(obj, "show_wire", text="Wire") | 
					
						
							| 
									
										
										
										
											2014-03-14 02:13:31 +11:00
										 |  |  |         if obj_type == 'MESH' or is_dupli: | 
					
						
							| 
									
										
										
										
											2013-07-28 11:43:11 +00:00
										 |  |  |             col.prop(obj, "show_all_edges") | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         col = split.column() | 
					
						
							| 
									
										
										
										
											2013-07-28 22:12:19 +00:00
										 |  |  |         row = col.row() | 
					
						
							|  |  |  |         row.prop(obj, "show_bounds", text="Bounds") | 
					
						
							|  |  |  |         sub = row.row() | 
					
						
							|  |  |  |         sub.active = obj.show_bounds | 
					
						
							| 
									
										
										
										
											2013-07-28 11:43:11 +00:00
										 |  |  |         sub.prop(obj, "draw_bounds_type", text="") | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         if is_geometry: | 
					
						
							|  |  |  |             col.prop(obj, "show_texture_space", text="Texture Space") | 
					
						
							| 
									
										
										
										
											2013-04-03 05:16:15 +00:00
										 |  |  |         col.prop(obj, "show_x_ray", text="X-Ray") | 
					
						
							| 
									
										
										
										
											2013-07-28 11:43:11 +00:00
										 |  |  |         if obj_type == 'MESH' or is_empty_image: | 
					
						
							| 
									
										
										
										
											2013-04-03 05:16:15 +00:00
										 |  |  |             col.prop(obj, "show_transparent", text="Transparency") | 
					
						
							| 
									
										
										
										
											2013-07-28 11:43:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         split = layout.split() | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         col = split.column() | 
					
						
							| 
									
										
										
										
											2014-05-13 08:52:51 +02:00
										 |  |  |         if is_wire: | 
					
						
							|  |  |  |             # wire objects only use the max. draw type for duplis | 
					
						
							|  |  |  |             col.active = is_dupli | 
					
						
							|  |  |  |             col.label(text="Maximum Dupli Draw Type:") | 
					
						
							|  |  |  |         else: | 
					
						
							| 
									
										
										
										
											2013-11-16 02:50:01 -06:00
										 |  |  |             col.label(text="Maximum Draw Type:") | 
					
						
							| 
									
										
										
										
											2014-05-13 08:52:51 +02:00
										 |  |  |         col.prop(obj, "draw_type", text="") | 
					
						
							| 
									
										
										
										
											2013-07-28 11:43:11 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         col = split.column() | 
					
						
							|  |  |  |         if is_geometry or is_empty_image: | 
					
						
							|  |  |  |             # Only useful with object having faces/materials... | 
					
						
							|  |  |  |             col.label(text="Object Color:") | 
					
						
							|  |  |  |             col.prop(obj, "color", text="") | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 23:35:56 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-12 06:57:00 +00:00
										 |  |  | class OBJECT_PT_duplication(ObjectButtonsPanel, Panel): | 
					
						
							| 
									
										
										
										
											2011-09-15 13:20:18 +00:00
										 |  |  |     bl_label = "Duplication" | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |         layout.prop(ob, "dupli_type", expand=True) | 
					
						
							| 
									
										
										
										
											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) | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  |             col = split.column(align=True) | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +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
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +00:00
										 |  |  |             layout.prop(ob, "use_dupli_frames_speed", text="Speed") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         elif ob.dupli_type == 'VERTS': | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +00:00
										 |  |  |             layout.prop(ob, "use_dupli_vertices_rotation", text="Rotation") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         elif ob.dupli_type == 'FACES': | 
					
						
							| 
									
										
										
										
											2011-02-26 16:04:14 +00:00
										 |  |  |             row = layout.row() | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +00:00
										 |  |  |             row.prop(ob, "use_dupli_faces_scale", text="Scale") | 
					
						
							| 
									
										
										
										
											2013-12-23 16:27:43 +01:00
										 |  |  |             sub = row.row() | 
					
						
							|  |  |  |             sub.active = ob.use_dupli_faces_scale | 
					
						
							|  |  |  |             sub.prop(ob, "dupli_faces_scale", text="Inherit Scale") | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         elif ob.dupli_type == 'GROUP': | 
					
						
							| 
									
										
										
										
											2011-09-21 15:18:38 +00:00
										 |  |  |             layout.prop(ob, "dupli_group", text="Group") | 
					
						
							| 
									
										
										
										
											2010-08-06 15:17:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-06 05:46:45 +00:00
										 |  |  | class OBJECT_PT_relations_extras(ObjectButtonsPanel, Panel): | 
					
						
							|  |  |  |     bl_label = "Relations Extras" | 
					
						
							| 
									
										
										
										
											2010-08-26 01:05:37 +00:00
										 |  |  |     bl_options = {'DEFAULT_CLOSED'} | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         layout = self.layout | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							| 
									
										
										
										
											2009-11-14 13:35:44 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2009-10-31 19:31:45 +00:00
										 |  |  |         split = layout.split() | 
					
						
							| 
									
										
										
										
											2011-11-08 01:32:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-14 17:36:56 -07:00
										 |  |  |         if context.scene.render.engine != 'BLENDER_GAME': | 
					
						
							|  |  |  |             col = split.column() | 
					
						
							|  |  |  |             col.label(text="Tracking Axes:") | 
					
						
							|  |  |  |             col.prop(ob, "track_axis", text="Axis") | 
					
						
							|  |  |  |             col.prop(ob, "up_axis", text="Up Axis") | 
					
						
							| 
									
										
										
										
											2011-11-08 01:32:34 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-11-06 05:46:45 +00:00
										 |  |  |         col = split.column() | 
					
						
							|  |  |  |         col.prop(ob, "use_slow_parent") | 
					
						
							|  |  |  |         row = col.row() | 
					
						
							|  |  |  |         row.active = ((ob.parent is not None) and (ob.use_slow_parent)) | 
					
						
							|  |  |  |         row.prop(ob, "slow_parent_offset", text="Offset") | 
					
						
							| 
									
										
										
										
											2009-04-11 02:18:24 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-04-23 07:06:29 +00:00
										 |  |  |         layout.prop(ob, "use_extra_recalc_object") | 
					
						
							|  |  |  |         layout.prop(ob, "use_extra_recalc_data") | 
					
						
							| 
									
										
										
										
											2013-01-10 18:20:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-03-21 12:35:49 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-10-08 08:28:05 +00:00
										 |  |  | from bl_ui.properties_animviz import (MotionPathButtonsPanel, | 
					
						
							|  |  |  |                                       OnionSkinButtonsPanel) | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-12 06:57:00 +00:00
										 |  |  | class OBJECT_PT_motion_paths(MotionPathButtonsPanel, Panel): | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  |     #bl_label = "Object Motion Paths" | 
					
						
							|  |  |  |     bl_context = "object" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-09 01:37:09 +00:00
										 |  |  |     @classmethod | 
					
						
							|  |  |  |     def poll(cls, context): | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  |         return (context.object) | 
					
						
							| 
									
										
										
										
											2010-03-06 01:40:29 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  |     def draw(self, context): | 
					
						
							| 
									
										
										
										
											2014-04-25 05:31:20 +10:00
										 |  |  |         # layout = self.layout | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							| 
									
										
										
										
											2012-07-03 19:09:07 +00:00
										 |  |  |         avs = ob.animation_visualization | 
					
						
							| 
									
										
										
										
											2012-05-01 16:19:13 +00:00
										 |  |  |         mpath = ob.motion_path | 
					
						
							| 
									
										
										
										
											2012-05-15 18:50:51 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-05-01 16:19:13 +00:00
										 |  |  |         self.draw_settings(context, avs, mpath) | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-12 06:57:00 +00:00
										 |  |  | class OBJECT_PT_onion_skinning(OnionSkinButtonsPanel):  # , Panel): # inherit from panel when ready | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  |     #bl_label = "Object Onion Skinning" | 
					
						
							|  |  |  |     bl_context = "object" | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-09 01:37:09 +00:00
										 |  |  |     @classmethod | 
					
						
							|  |  |  |     def poll(cls, context): | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  |         return (context.object) | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     def draw(self, context): | 
					
						
							|  |  |  |         ob = context.object | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2012-07-03 19:09:07 +00:00
										 |  |  |         self.draw_settings(context, ob.animation_visualization) | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2010-08-09 01:37:09 +00:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2011-08-12 06:57:00 +00:00
										 |  |  | class OBJECT_PT_custom_props(ObjectButtonsPanel, PropertyPanel, Panel): | 
					
						
							| 
									
										
										
										
											2010-08-09 01:37:09 +00:00
										 |  |  |     COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_GAME'} | 
					
						
							| 
									
										
										
										
											2010-08-02 02:55:12 +00:00
										 |  |  |     _context_path = "object" | 
					
						
							| 
									
										
										
										
											2010-12-17 10:33:28 +00:00
										 |  |  |     _property_type = bpy.types.Object | 
					
						
							| 
									
										
										
										
											2011-04-04 10:13:04 +00:00
										 |  |  | 
 | 
					
						
							|  |  |  | if __name__ == "__main__":  # only for live edit. | 
					
						
							|  |  |  |     bpy.utils.register_module(__name__) |