Welcome to mirror list, hosted at ThFree Co, Russian Federation.

buttons_objects.py « ui « release - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8cf27fcf8c277684b61475f8381049264a41777d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
# import bpy

class OBJECT_PT_transform(bpy.types.Panel):
	__label__ = "Transform"
	__context__ = "object"

	def draw(self, context):
		ob = context.active_object
		layout = self.layout

		if not ob:
			return

		layout.template_column_flow(3)
		layout.itemR(ob, "location")
		layout.itemR(ob, "rotation")
		layout.itemR(ob, "scale")

class OBJECT_PT_groups(bpy.types.Panel):
	__label__ = "Groups"
	__context__ = "object"

	def draw(self, context):
		ob = context.active_object
		layout = self.layout

		if not ob:
			return

		layout.template_column_flow(2)
		layout.itemR(ob, "pass_index")
		layout.itemR(ob, "parent")

		# layout.template_left_right()
		# layout.itemO("OBJECT_OT_add_group");

		for group in bpy.data.groups:
			if ob in group.objects:
				sublayout = layout.template_stack()

				sublayout.template_left_right()
				sublayout.itemR(group, "name")
				# sublayout.itemO("OBJECT_OT_remove_group")

				sublayout.template_column_flow(2)
				sublayout.itemR(group, "layer")
				sublayout.itemR(group, "dupli_offset")

class OBJECT_PT_display(bpy.types.Panel):
	__label__ = "Display"
	__context__ = "object"

	def draw(self, context):
		ob = context.active_object
		layout = self.layout

		if not ob:
			return

		layout.template_column_flow(2)
		layout.itemR(ob, "max_draw_type", text="Type")
		layout.itemR(ob, "draw_bounds_type", text="Bounds")

		layout.template_column_flow(2)
		layout.itemR(ob, "draw_name", text="Name")
		layout.itemR(ob, "draw_axis", text="Axis")
		layout.itemR(ob, "draw_wire", text="Wire")
		layout.itemR(ob, "draw_texture_space", text="Texture Space")
		layout.itemR(ob, "x_ray", text="X-Ray")
		layout.itemR(ob, "draw_transparent", text="Transparency")

class OBJECT_PT_duplication(bpy.types.Panel):
	__label__ = "Duplication"
	__context__ = "object"

	def draw(self, context):
		ob = context.active_object
		layout = self.layout

		if not ob:
			return

		layout.template_column()
		layout.itemR(ob, "dupli_type", text="")

		if ob.dupli_type == "FRAMES":
			layout.template_column_flow(2)
			layout.itemR(ob, "dupli_frames_start", text="Start:")
			layout.itemR(ob, "dupli_frames_end", text="End:")
			layout.itemR(ob, "dupli_frames_on", text="On:")
			layout.itemR(ob, "dupli_frames_off", text="Off:")

class OBJECT_PT_animation(bpy.types.Panel):
	__label__ = "Animation"
	__context__ = "object"

	def draw(self, context):
		ob = context.active_object
		layout = self.layout

		if not ob:
			return

		layout.template_column()
		
		layout.template_slot("COLUMN_1")
		layout.itemL(text="Time Offset:")
		layout.itemR(ob, "time_offset_edit", text="Edit")
		layout.itemR(ob, "time_offset_particle", text="Particle")
		layout.itemR(ob, "time_offset_parent", text="Parent")
		layout.itemR(ob, "slow_parent")
		layout.itemR(ob, "time_offset", text="Offset:")
		
		layout.template_slot("COLUMN_2")
		layout.itemL(text="Tracking:")
		layout.itemR(ob, "track_axis", text="Axis")
		layout.itemR(ob, "up_axis", text="Up Axis")
		layout.itemR(ob, "track_rotation", text="Rotation")

bpy.ui.addPanel(OBJECT_PT_transform, "BUTTONS_WINDOW", "WINDOW")
bpy.ui.addPanel(OBJECT_PT_groups, "BUTTONS_WINDOW", "WINDOW")
bpy.ui.addPanel(OBJECT_PT_display, "BUTTONS_WINDOW", "WINDOW")
bpy.ui.addPanel(OBJECT_PT_duplication, "BUTTONS_WINDOW", "WINDOW")
bpy.ui.addPanel(OBJECT_PT_animation, "BUTTONS_WINDOW", "WINDOW")