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

buttons_physics_smoke.py « ui « release - git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: a128fe3afb13a717550b9dee2106b05a990274c8 (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

import bpy

class PhysicButtonsPanel(bpy.types.Panel):
	__space_type__ = "BUTTONS_WINDOW"
	__region_type__ = "WINDOW"
	__context__ = "physics"

	def poll(self, context):
		ob = context.object
		rd = context.scene.render_data
		return (ob and ob.type == 'MESH') and (not rd.use_game_engine)
		
class PHYSICS_PT_smoke(PhysicButtonsPanel):
	__label__ = "Smoke"

	def draw(self, context):
		layout = self.layout
		
		md = context.smoke
		ob = context.object

		split = layout.split()
		split.operator_context = 'EXEC_DEFAULT'

		if md:
			# remove modifier + settings
			split.set_context_pointer("modifier", md)
			split.itemO("object.modifier_remove", text="Remove")

			row = split.row(align=True)
			row.itemR(md, "render", text="")
			row.itemR(md, "realtime", text="")
			
		else:
			# add modifier
			split.item_enumO("object.modifier_add", "type", 'SMOKE', text="Add")
			split.itemL()

		if md:
			layout.itemR(md, "smoke_type")
		
			if md.smoke_type == 'TYPE_DOMAIN':
				
				split = layout.split()
				
				col = split.column()
				col.itemL(text="Behavior:")
				col.itemR(md.domain_settings, "alpha")
				col.itemR(md.domain_settings, "beta")
				
				col.itemL(text="Resolution:")
				col.itemR(md.domain_settings, "maxres", text="Low")
				sub = col.column()
				sub.active = md.domain_settings.highres
				sub.itemR(md.domain_settings, "amplify", text="High")
				col.itemR(md.domain_settings, "highres", text="Use High Resolution")
				
				sub = split.column()
				sub.itemL(text="Display:")
				sub.itemR(md.domain_settings, "visibility")
				sub.itemR(md.domain_settings, "color")
				
				layout.itemL(text="Noise Type:")
				layout.itemR(md.domain_settings, "noise_type", expand=True)
				
				split = layout.split()
				
				col = split.column()
				col.itemL(text="Flow Group:")
				col.itemR(md.domain_settings, "fluid_group", text="")
				
				#col.itemL(text="Effector Group:")
				#col.itemR(md.domain_settings, "eff_group", text="")
				
				col = split.column()
				col.itemL(text="Collision Group:")
				col.itemR(md.domain_settings, "coll_group", text="")
				
			elif md.smoke_type == 'TYPE_FLOW':
				
				layout.itemR(md.flow_settings, "outflow")
				
				split = layout.split()
				
				if md.flow_settings.outflow:				
					col = split.column()
				else:
					col = split.column()
					col.itemL(text="Behavior:")
					col.itemR(md.flow_settings, "temperature")
					col.itemR(md.flow_settings, "density")
				
					sub = split.column()
					sub.itemL(text="particle System:")
					sub.item_pointerR(md.flow_settings, "psys", ob, "particle_systems", text="")
					
			elif md.smoke_type == 'TYPE_COLL':
				layout.itemS()

bpy.types.register(PHYSICS_PT_smoke)