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
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
|
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software Foundation,
# Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
#
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
import bpy
from bpy.types import (
Panel,
Menu,
)
from .properties_physics_common import (
effector_weights_ui,
)
class FLUID_MT_presets(Menu):
bl_label = "Fluid Presets"
preset_subdir = "fluid"
preset_operator = "script.execute_preset"
draw = Menu.draw_preset
class PhysicButtonsPanel:
bl_space_type = 'PROPERTIES'
bl_region_type = 'WINDOW'
bl_context = "physics"
@staticmethod
def poll_fluid(context):
ob = context.object
if not ((ob and ob.type == 'MESH') and (context.fluid)):
return False
md = context.fluid
return md and (context.fluid.fluid_type != 'NONE')
@staticmethod
def poll_fluid_domain(context):
if not PhysicButtonsPanel.poll_fluid(context):
return False
md = context.fluid
return md and (md.fluid_type == 'DOMAIN')
@staticmethod
def poll_gas_domain(context):
if not PhysicButtonsPanel.poll_fluid(context):
return False
md = context.fluid
if md and (md.fluid_type == 'DOMAIN'):
domain = md.domain_settings
return domain.domain_type in {'GAS'}
return False
@staticmethod
def poll_liquid_domain(context):
if not PhysicButtonsPanel.poll_fluid(context):
return False
md = context.fluid
if md and (md.fluid_type == 'DOMAIN'):
domain = md.domain_settings
return domain.domain_type in {'LIQUID'}
return False
@staticmethod
def poll_fluid_flow(context):
if not PhysicButtonsPanel.poll_fluid(context):
return False
md = context.fluid
return md and (md.fluid_type == 'FLOW')
class PHYSICS_PT_fluid(PhysicButtonsPanel, Panel):
bl_label = "Fluid"
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
ob = context.object
return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.fluid)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
if not bpy.app.build_options.fluid:
col = layout.column(align=True)
col.alignment = 'RIGHT'
col.label(text="Built without Fluid modifier")
return
md = context.fluid
layout.prop(md, "fluid_type")
class PHYSICS_PT_settings(PhysicButtonsPanel, Panel):
bl_label = "Settings"
bl_parent_id = 'PHYSICS_PT_fluid'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_fluid(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
md = context.fluid
ob = context.object
scene = context.scene
if md.fluid_type == 'DOMAIN':
domain = md.domain_settings
# Deactivate UI if guiding is enabled but not baked yet
layout.active = not (domain.use_guiding and not domain.has_cache_baked_guiding and (domain.guiding_source == 'EFFECTOR' or (domain.guiding_source == 'DOMAIN' and not domain.guiding_parent)))
is_baking_any = domain.is_cache_baking_any
has_baked_data = domain.has_cache_baked_data
row = layout.row()
row.enabled = not is_baking_any and not has_baked_data
row.prop(domain, "domain_type", expand=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow.enabled = not is_baking_any and not has_baked_data
col = flow.column()
col.prop(domain, "resolution_max", text="Resolution Divisions")
col.prop(domain, "time_scale", text="Time Scale")
col.prop(domain, "cfl_condition", text="CFL Number")
col = flow.column()
col.prop(domain, "use_adaptive_stepping", text="Use Adaptive Stepping")
col1 = col.column(align=True)
col1.enabled = domain.use_adaptive_stepping
col1.prop(domain, "timesteps_maximum", text="Timesteps Maximum")
col1.prop(domain, "timesteps_minimum", text="Minimum")
col.separator()
col = flow.column()
if scene.use_gravity:
sub = col.column()
sub.enabled = False
sub.prop(domain, "gravity", text="Using Scene Gravity", icon='SCENE_DATA')
else:
col.prop(domain, "gravity", text="Gravity")
# TODO (sebbas): Clipping var useful for manta openvdb caching?
# col.prop(domain, "clipping", text="Empty Space")
if domain.cache_type == 'MODULAR':
col.separator()
split = layout.split()
bake_incomplete = (domain.cache_frame_pause_data < domain.cache_frame_end)
if domain.has_cache_baked_data and not domain.is_cache_baking_data and bake_incomplete:
col = split.column()
col.operator("fluid.bake_data", text="Resume")
col = split.column()
col.operator("fluid.free_data", text="Free")
elif domain.is_cache_baking_data and not domain.has_cache_baked_data:
split.enabled = False
split.operator("fluid.pause_bake", text="Baking Data - ESC to pause")
elif not domain.has_cache_baked_data and not domain.is_cache_baking_data:
split.operator("fluid.bake_data", text="Bake Data")
else:
split.operator("fluid.free_data", text="Free Data")
elif md.fluid_type == 'FLOW':
flow = md.flow_settings
row = layout.row()
row.prop(flow, "flow_type", expand=False)
grid = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = grid.column()
col.prop(flow, "flow_behavior", expand=False)
if flow.flow_behavior in {'INFLOW'}:
col.prop(flow, "use_inflow", text="Use Inflow")
col.prop(flow, "subframes", text="Sampling Substeps")
if not flow.flow_behavior == 'OUTFLOW' and flow.flow_type in {'SMOKE', 'BOTH', 'FIRE'}:
if flow.flow_type in {'SMOKE', 'BOTH'}:
col.prop(flow, "smoke_color", text="Smoke Color")
col = grid.column(align=True)
col.prop(flow, "use_absolute", text="Absolute Density")
if flow.flow_type in {'SMOKE', 'BOTH'}:
col.prop(flow, "temperature", text="Initial Temperature")
col.prop(flow, "density", text="Density")
if flow.flow_type in {'FIRE', 'BOTH'}:
col.prop(flow, "fuel_amount", text="Fuel")
col.separator()
col.prop_search(flow, "density_vertex_group", ob, "vertex_groups", text="Vertex Group")
elif md.fluid_type == 'EFFECTOR':
effec = md.effec_settings
row = layout.row()
row.prop(effec, "effec_type")
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = flow.column()
col.prop(effec, "use_plane_init", text="Is Planar")
col.prop(effec, "surface_distance", text="Surface Thickness")
if effec.effec_type == 'GUIDE':
col.prop(effec, "velocity_factor", text="Velocity Factor")
col = flow.column()
col.prop(effec, "guiding_mode", text="Guiding Mode")
class PHYSICS_PT_borders(PhysicButtonsPanel, Panel):
bl_label = "Border Collisions"
bl_parent_id = 'PHYSICS_PT_settings'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_fluid_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
md = context.fluid
domain = md.domain_settings
is_baking_any = domain.is_cache_baking_any
has_baked_data = domain.has_cache_baked_data
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow.enabled = not is_baking_any and not has_baked_data
col = flow.column()
col.prop(domain, "use_collision_border_front", text="Front")
col = flow.column()
col.prop(domain, "use_collision_border_back", text="Back")
col = flow.column()
col.prop(domain, "use_collision_border_right", text="Right")
col = flow.column()
col.prop(domain, "use_collision_border_left", text="Left")
col = flow.column()
col.prop(domain, "use_collision_border_top", text="Top")
col = flow.column()
col.prop(domain, "use_collision_border_bottom", text="Bottom")
class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel):
bl_label = "Smoke"
bl_parent_id = 'PHYSICS_PT_settings'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_gas_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
md = context.fluid
domain = md.domain_settings
is_baking_any = domain.is_cache_baking_any
has_baked_data = domain.has_cache_baked_data
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow.enabled = not is_baking_any and not has_baked_data
col = flow.column()
col.prop(domain, "alpha")
col.prop(domain, "beta", text="Temperature Diff.")
col = flow.column()
col.prop(domain, "vorticity")
class PHYSICS_PT_smoke_dissolve(PhysicButtonsPanel, Panel):
bl_label = "Dissolve"
bl_parent_id = 'PHYSICS_PT_smoke'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_gas_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
md = context.fluid
domain = md.domain_settings
self.layout.prop(domain, "use_dissolve_smoke", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
md = context.fluid
domain = md.domain_settings
is_baking_any = domain.is_cache_baking_any
has_baked_data = domain.has_cache_baked_data
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow.enabled = not is_baking_any and not has_baked_data
layout.active = domain.use_dissolve_smoke
col = flow.column()
col.prop(domain, "dissolve_speed", text="Time")
col = flow.column()
col.prop(domain, "use_dissolve_smoke_log", text="Slow")
class PHYSICS_PT_fire(PhysicButtonsPanel, Panel):
bl_label = "Fire"
bl_parent_id = 'PHYSICS_PT_settings'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_gas_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
md = context.fluid
domain = md.domain_settings
is_baking_any = domain.is_cache_baking_any
has_baked_data = domain.has_cache_baked_data
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow.enabled = not is_baking_any and not has_baked_data
col = flow.column()
col.prop(domain, "burning_rate", text="Reaction Speed")
col = flow.column()
col.prop(domain, "flame_smoke", text="Flame Smoke")
col = flow.column()
col.prop(domain, "flame_vorticity", text="Flame Vorticity")
col = flow.column()
col.prop(domain, "flame_ignition", text="Temperature Ignition")
col = flow.column()
col.prop(domain, "flame_max_temp", text="Maximum Temperature")
col = flow.column()
col.prop(domain, "flame_smoke_color", text="Flame Color")
class PHYSICS_PT_liquid(PhysicButtonsPanel, Panel):
bl_label = "Liquid"
bl_parent_id = 'PHYSICS_PT_settings'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_liquid_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
md = context.fluid.domain_settings
self.layout.prop(md, "use_flip_particles", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
md = context.fluid
domain = md.domain_settings
is_baking_any = domain.is_cache_baking_any
has_baked_data = domain.has_cache_baked_data
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = flow.column()
col0 = col.column()
col0.enabled = not is_baking_any and not has_baked_data
col0.prop(domain, "simulation_method", expand=False)
col0.prop(domain, "flip_ratio", text="FLIP Ratio")
col0.prop(domain, "particle_radius", text="Particle Radius")
col1 = flow.column(align=True)
col1.enabled = not is_baking_any and not has_baked_data
col1.prop(domain, "particle_maximum", text="Particles Maximum")
col1.prop(domain, "particle_minimum", text="Minimum")
col1 = flow.column()
col1.enabled = not is_baking_any and not has_baked_data
col1.prop(domain, "particle_number", text="Particle Sampling")
col1.prop(domain, "particle_band_width", text="Narrow Band Width")
col1.prop(domain, "particle_randomness", text="Particle Randomness")
col2 = flow.column()
col2.enabled = not is_baking_any and not has_baked_data
col2.prop(domain, "use_fractions", text="Fractional Obstacles")
col3 = col2.column()
col3.enabled = domain.use_fractions and col2.enabled
col3.prop(domain, "fractions_threshold", text="Obstacle-Fluid Threshold")
class PHYSICS_PT_flow_source(PhysicButtonsPanel, Panel):
bl_label = "Flow Source"
bl_parent_id = 'PHYSICS_PT_settings'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_fluid_flow(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
ob = context.object
flow = context.fluid.flow_settings
col = layout.column()
col.prop(flow, "flow_source", expand=False, text="Flow Source")
if flow.flow_source == 'PARTICLES':
col.prop_search(flow, "particle_system", ob, "particle_systems", text="Particle System")
grid = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = grid.column()
if flow.flow_source == 'MESH':
col.prop(flow, "use_plane_init", text="Is Planar")
col.prop(flow, "surface_distance", text="Surface Thickness")
if flow.flow_type in {'SMOKE', 'BOTH', 'FIRE'}:
col = grid.column()
col.prop(flow, "volume_density", text="Volume Density")
if flow.flow_source == 'PARTICLES':
col.prop(flow, "use_particle_size", text="Set Size")
sub = col.column()
sub.active = flow.use_particle_size
sub.prop(flow, "particle_size")
class PHYSICS_PT_flow_initial_velocity(PhysicButtonsPanel, Panel):
bl_label = "Initial Velocity"
bl_parent_id = 'PHYSICS_PT_settings'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_fluid_flow(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
md = context.fluid
flow_smoke = md.flow_settings
self.layout.prop(flow_smoke, "use_initial_velocity", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True)
md = context.fluid
flow_smoke = md.flow_settings
flow.active = flow_smoke.use_initial_velocity
col = flow.column()
col.prop(flow_smoke, "velocity_factor")
if flow_smoke.flow_source == 'MESH':
col.prop(flow_smoke, "velocity_normal")
# col.prop(flow_smoke, "velocity_random")
col = flow.column()
col.prop(flow_smoke, "velocity_coord")
class PHYSICS_PT_flow_texture(PhysicButtonsPanel, Panel):
bl_label = "Texture"
bl_parent_id = 'PHYSICS_PT_settings'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_fluid_flow(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
md = context.fluid
flow_smoke = md.flow_settings
self.layout.prop(flow_smoke, "use_texture", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
ob = context.object
flow_smoke = context.fluid.flow_settings
sub = flow.column()
sub.active = flow_smoke.use_texture
sub.prop(flow_smoke, "noise_texture")
sub.prop(flow_smoke, "texture_map_type", text="Mapping")
col = flow.column()
sub = col.column()
sub.active = flow_smoke.use_texture
if flow_smoke.texture_map_type == 'UV':
sub.prop_search(flow_smoke, "uv_layer", ob.data, "uv_layers")
if flow_smoke.texture_map_type == 'AUTO':
sub.prop(flow_smoke, "texture_size")
sub.prop(flow_smoke, "texture_offset")
class PHYSICS_PT_adaptive_domain(PhysicButtonsPanel, Panel):
bl_label = "Adaptive Domain"
bl_parent_id = 'PHYSICS_PT_fluid'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_gas_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
md = context.fluid.domain_settings
domain = context.fluid.domain_settings
is_baking_any = domain.is_cache_baking_any
has_baked_any = domain.has_cache_baked_any
self.layout.enabled = not is_baking_any and not has_baked_any
self.layout.prop(md, "use_adaptive_domain", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
domain = context.fluid.domain_settings
layout.active = domain.use_adaptive_domain
is_baking_any = domain.is_cache_baking_any
has_baked_any = domain.has_cache_baked_any
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
flow.enabled = not is_baking_any and not has_baked_any
col = flow.column()
col.prop(domain, "additional_res", text="Add Resolution")
col.prop(domain, "adapt_margin")
col.separator()
col = flow.column()
col.prop(domain, "adapt_threshold", text="Threshold")
class PHYSICS_PT_noise(PhysicButtonsPanel, Panel):
bl_label = "Noise"
bl_parent_id = 'PHYSICS_PT_fluid'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_gas_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
md = context.fluid.domain_settings
domain = context.fluid.domain_settings
is_baking_any = domain.is_cache_baking_any
self.layout.enabled = not is_baking_any
self.layout.prop(md, "use_noise", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
domain = context.fluid.domain_settings
# Deactivate UI if guiding is enabled but not baked yet
layout.active = domain.use_noise and not (domain.use_guiding and not domain.has_cache_baked_guiding and (domain.guiding_source == 'EFFECTOR' or (domain.guiding_source == 'DOMAIN' and not domain.guiding_parent)))
is_baking_any = domain.is_cache_baking_any
has_baked_noise = domain.has_cache_baked_noise
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow.enabled = not is_baking_any and not has_baked_noise
col = flow.column()
col.prop(domain, "noise_scale", text="Upres Factor")
# TODO (sebbas): Mantaflow only supports wavelet noise. Maybe get rid of noise type field.
col.prop(domain, "noise_type", text="Noise Method")
col = flow.column()
col.prop(domain, "noise_strength", text="Strength")
col.prop(domain, "noise_pos_scale", text="Scale")
col.prop(domain, "noise_time_anim", text="Time")
if domain.cache_type == 'MODULAR':
col.separator()
split = layout.split()
split.enabled = domain.has_cache_baked_data
bake_incomplete = (domain.cache_frame_pause_noise < domain.cache_frame_end)
if domain.has_cache_baked_noise and not domain.is_cache_baking_noise and bake_incomplete:
col = split.column()
col.operator("fluid.bake_noise", text="Resume")
col = split.column()
col.operator("fluid.free_noise", text="Free")
elif not domain.has_cache_baked_noise and domain.is_cache_baking_noise:
split.enabled = False
split.operator("fluid.pause_bake", text="Baking Noise - ESC to pause")
elif not domain.has_cache_baked_noise and not domain.is_cache_baking_noise:
split.operator("fluid.bake_noise", text="Bake Noise")
else:
split.operator("fluid.free_noise", text="Free Noise")
class PHYSICS_PT_mesh(PhysicButtonsPanel, Panel):
bl_label = "Mesh"
bl_parent_id = 'PHYSICS_PT_fluid'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_liquid_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
md = context.fluid.domain_settings
domain = context.fluid.domain_settings
is_baking_any = domain.is_cache_baking_any
self.layout.enabled = not is_baking_any
self.layout.prop(md, "use_mesh", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
domain = context.fluid.domain_settings
# Deactivate UI if guiding is enabled but not baked yet
layout.active = domain.use_mesh and not (domain.use_guiding and not domain.has_cache_baked_guiding and (domain.guiding_source == 'EFFECTOR' or (domain.guiding_source == 'DOMAIN' and not domain.guiding_parent)))
is_baking_any = domain.is_cache_baking_any
has_baked_mesh = domain.has_cache_baked_mesh
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow.enabled = not is_baking_any and not has_baked_mesh
col = flow.column()
col.prop(domain, "mesh_scale", text="Upres Factor")
col.prop(domain, "mesh_particle_radius", text="Particle Radius")
col = flow.column()
col.prop(domain, "use_speed_vectors", text="Use Speed Vectors")
col.separator()
col.prop(domain, "mesh_generator", text="Mesh Generator")
if domain.mesh_generator in {'IMPROVED'}:
col = flow.column(align=True)
col.prop(domain, "mesh_smoothen_pos", text="Smoothing Positive")
col.prop(domain, "mesh_smoothen_neg", text="Negative")
col = flow.column(align=True)
col.prop(domain, "mesh_concave_upper", text="Concavity Upper")
col.prop(domain, "mesh_concave_lower", text="Lower")
# TODO (sebbas): for now just interpolate any upres grids, ie not sampling highres grids
#col.prop(domain, "highres_sampling", text="Flow Sampling:")
if domain.cache_type == 'MODULAR':
col.separator()
split = layout.split()
split.enabled = domain.has_cache_baked_data
bake_incomplete = (domain.cache_frame_pause_mesh < domain.cache_frame_end)
if domain.has_cache_baked_mesh and not domain.is_cache_baking_mesh and bake_incomplete:
col = split.column()
col.operator("fluid.bake_mesh", text="Resume")
col = split.column()
col.operator("fluid.free_mesh", text="Free")
elif not domain.has_cache_baked_mesh and domain.is_cache_baking_mesh:
split.enabled = False
split.operator("fluid.pause_bake", text="Baking Mesh - ESC to pause")
elif not domain.has_cache_baked_mesh and not domain.is_cache_baking_mesh:
split.operator("fluid.bake_mesh", text="Bake Mesh")
else:
split.operator("fluid.free_mesh", text="Free Mesh")
class PHYSICS_PT_particles(PhysicButtonsPanel, Panel):
bl_label = "Particles"
bl_parent_id = 'PHYSICS_PT_fluid'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_liquid_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
domain = context.fluid.domain_settings
# Deactivate UI if guiding is enabled but not baked yet
layout.active = not (domain.use_guiding and not domain.has_cache_baked_guiding and (domain.guiding_source == 'EFFECTOR' or (domain.guiding_source == 'DOMAIN' and not domain.guiding_parent)))
is_baking_any = domain.is_cache_baking_any
has_baked_particles = domain.has_cache_baked_particles
using_particles = domain.use_spray_particles or domain.use_foam_particles or domain.use_bubble_particles
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow.enabled = not is_baking_any
subSpray = flow.column()
subSpray.enabled = (domain.sndparticle_combined_export == 'OFF') or (domain.sndparticle_combined_export == 'FOAM + BUBBLES')
subSpray.prop(domain, "use_spray_particles", text="Spray")
subFoam = flow.column()
subFoam.enabled = (domain.sndparticle_combined_export == 'OFF') or (domain.sndparticle_combined_export == 'SPRAY + BUBBLES')
subFoam.prop(domain, "use_foam_particles", text="Foam")
subBubbles = flow.column()
subBubbles.enabled = (domain.sndparticle_combined_export == 'OFF') or (domain.sndparticle_combined_export == 'SPRAY + FOAM')
subBubbles.prop(domain, "use_bubble_particles", text="Bubbles")
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow.enabled = not is_baking_any and not has_baked_particles and using_particles
col = flow.column()
col.prop(domain, "sndparticle_combined_export")
col.prop(domain, "particle_scale", text="Upres Factor")
col.separator()
col = flow.column(align=True)
col.prop(domain, "sndparticle_tau_max_wc", text="Wave Crest Potential Maximum")
col.prop(domain, "sndparticle_tau_min_wc", text="Minimum")
col.separator()
col = flow.column(align=True)
col.prop(domain, "sndparticle_tau_max_ta", text="Trapped Air Potential Maximum")
col.prop(domain, "sndparticle_tau_min_ta", text="Minimum")
col.separator()
col = flow.column(align=True)
col.prop(domain, "sndparticle_tau_max_k", text="Kinetic Energy Potential Maximum")
col.prop(domain, "sndparticle_tau_min_k", text="Minimum")
col.separator()
col = flow.column(align=True)
col.prop(domain, "sndparticle_potential_radius", text="Potential Radius")
col.prop(domain, "sndparticle_update_radius", text="Particle Update Radius")
col.separator()
col = flow.column(align=True)
col.prop(domain, "sndparticle_k_wc", text="Wave Crest Particle Sampling")
col.prop(domain, "sndparticle_k_ta", text="Trapped Air Particle Sampling")
col.separator()
col = flow.column(align=True)
col.prop(domain, "sndparticle_l_max", text="Particle Life Maximum")
col.prop(domain, "sndparticle_l_min", text="Minimum")
col.separator()
col = flow.column(align=True)
col.prop(domain, "sndparticle_k_b", text="Bubble Buoyancy")
col.prop(domain, "sndparticle_k_d", text="Bubble Drag")
col.separator()
col = flow.column()
col.prop(domain, "sndparticle_boundary", text="Particles in Boundary:")
if domain.cache_type == 'MODULAR':
col.separator()
split = layout.split()
split.enabled = domain.has_cache_baked_data and (domain.use_spray_particles or domain.use_bubble_particles or domain.use_foam_particles or domain.use_tracer_particles)
bake_incomplete = (domain.cache_frame_pause_particles < domain.cache_frame_end)
if domain.has_cache_baked_particles and not domain.is_cache_baking_particles and bake_incomplete:
col = split.column()
col.operator("fluid.bake_particles", text="Resume")
col = split.column()
col.operator("fluid.free_particles", text="Free")
elif not domain.has_cache_baked_particles and domain.is_cache_baking_particles:
split.enabled = False
split.operator("fluid.pause_bake", text="Baking Particles - ESC to pause")
elif not domain.has_cache_baked_particles and not domain.is_cache_baking_particles:
split.operator("fluid.bake_particles", text="Bake Particles")
else:
split.operator("fluid.free_particles", text="Free Particles")
class PHYSICS_PT_diffusion(PhysicButtonsPanel, Panel):
bl_label = "Diffusion"
bl_parent_id = 'PHYSICS_PT_fluid'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
# Fluid diffusion only enabled for liquids (surface tension and viscosity not relevant for smoke)
if not PhysicButtonsPanel.poll_liquid_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
domain = context.fluid.domain_settings
# Deactivate UI if guiding is enabled but not baked yet
layout.active = not (domain.use_guiding and not domain.has_cache_baked_guiding and (domain.guiding_source == 'EFFECTOR' or (domain.guiding_source == 'DOMAIN' and not domain.guiding_parent)))
is_baking_any = domain.is_cache_baking_any
has_baked_any = domain.has_cache_baked_any
has_baked_data = domain.has_cache_baked_data
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow.enabled = not is_baking_any and not has_baked_any and not has_baked_data
row = flow.row()
col = row.column()
col.label(text="Viscosity Presets:")
col.menu("FLUID_MT_presets", text=bpy.types.FLUID_MT_presets.bl_label)
col = row.column(align=True)
col.operator("fluid.preset_add", text="", icon='ADD')
col.operator("fluid.preset_add", text="", icon='REMOVE').remove_active = True
col = flow.column(align=True)
col.prop(domain, "viscosity_base", text="Base")
col.prop(domain, "viscosity_exponent", text="Exponent", slider=True)
col = flow.column()
col.prop(domain, "domain_size", text="Real World Size")
col.prop(domain, "surface_tension", text="Surface Tension")
class PHYSICS_PT_guiding(PhysicButtonsPanel, Panel):
bl_label = "Guiding"
bl_parent_id = 'PHYSICS_PT_fluid'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_fluid_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw_header(self, context):
md = context.fluid.domain_settings
domain = context.fluid.domain_settings
is_baking_any = domain.is_cache_baking_any
self.layout.enabled = not is_baking_any
self.layout.prop(md, "use_guiding", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
domain = context.fluid.domain_settings
layout.active = domain.use_guiding
is_baking_any = domain.is_cache_baking_any
has_baked_data = domain.has_cache_baked_data
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow.enabled = not is_baking_any and not has_baked_data
col = flow.column()
col.prop(domain, "guiding_alpha", text="Weight")
col.prop(domain, "guiding_beta", text="Size")
col.prop(domain, "guiding_vel_factor", text="Velocity Factor")
col = flow.column()
col.prop(domain, "guiding_source", text="Velocity Source")
if domain.guiding_source == 'DOMAIN':
col.prop(domain, "guiding_parent", text="Guiding Parent")
if domain.cache_type == 'MODULAR':
col.separator()
if domain.guiding_source == 'EFFECTOR':
split = layout.split()
bake_incomplete = (domain.cache_frame_pause_guiding < domain.cache_frame_end)
if domain.has_cache_baked_guiding and not domain.is_cache_baking_guiding and bake_incomplete:
col = split.column()
col.operator("fluid.bake_guiding", text="Resume")
col = split.column()
col.operator("fluid.free_guiding", text="Free")
elif not domain.has_cache_baked_guiding and domain.is_cache_baking_guiding:
split.operator("fluid.pause_bake", text="Pause Guiding")
elif not domain.has_cache_baked_guiding and not domain.is_cache_baking_guiding:
split.operator("fluid.bake_guiding", text="Bake Guiding")
else:
split.operator("fluid.free_guiding", text="Free Guiding")
class PHYSICS_PT_collections(PhysicButtonsPanel, Panel):
bl_label = "Collections"
bl_parent_id = 'PHYSICS_PT_fluid'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_fluid_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
domain = context.fluid.domain_settings
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = flow.column()
col.prop(domain, "fluid_group", text="Flow")
# col.prop(domain, "effector_group", text="Forces")
col.prop(domain, "effector_group", text="Effector")
class PHYSICS_PT_cache(PhysicButtonsPanel, Panel):
bl_label = "Cache"
bl_parent_id = 'PHYSICS_PT_fluid'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_fluid_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
md = context.fluid
domain = context.fluid.domain_settings
is_baking_any = domain.is_cache_baking_any
has_baked_any = domain.has_cache_baked_any
col = layout.column()
col.prop(domain, "cache_directory", text="")
col.enabled = not is_baking_any
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
col = flow.column()
col.prop(domain, "cache_type", expand=False)
col.enabled = not is_baking_any
col = flow.column(align=True)
col.separator()
col.prop(domain, "cache_frame_start", text="Frame Start")
col.prop(domain, "cache_frame_end", text="End")
col.enabled = not is_baking_any
col.separator()
col = flow.column()
col.enabled = not is_baking_any and not has_baked_any
col.prop(domain, "cache_data_format", text="Data File Format")
if md.domain_settings.domain_type in {'GAS'}:
if domain.use_noise:
col.prop(domain, "cache_noise_format", text="Noise File Format")
if md.domain_settings.domain_type in {'LIQUID'}:
# File format for all particle systemes (FLIP and secondary)
col.prop(domain, "cache_particle_format", text="Particle File Format")
if domain.use_mesh:
col.prop(domain, "cache_mesh_format", text="Mesh File Format")
if domain.cache_type == 'FINAL':
col.separator()
split = layout.split()
bake_incomplete = (domain.cache_frame_pause_data < domain.cache_frame_end)
if domain.has_cache_baked_data and not domain.is_cache_baking_data and bake_incomplete:
col = split.column()
col.operator("fluid.bake_all", text="Resume")
col = split.column()
col.operator("fluid.free_all", text="Free")
elif domain.is_cache_baking_data and not domain.has_cache_baked_data:
split.enabled = False
split.operator("fluid.pause_bake", text="Baking All - ESC to pause")
elif not domain.has_cache_baked_data and not domain.is_cache_baking_data:
split.operator("fluid.bake_all", text="Bake All")
else:
split.operator("fluid.free_all", text="Free All")
class PHYSICS_PT_export(PhysicButtonsPanel, Panel):
bl_label = "Advanced"
bl_parent_id = 'PHYSICS_PT_cache'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_fluid_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
layout = self.layout
layout.use_property_split = True
domain = context.fluid.domain_settings
is_baking_any = domain.is_cache_baking_any
has_baked_any = domain.has_cache_baked_any
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
flow.enabled = not is_baking_any and not has_baked_any
col = flow.column()
col.prop(domain, "export_manta_script", text="Export Mantaflow Script")
class PHYSICS_PT_field_weights(PhysicButtonsPanel, Panel):
bl_label = "Field Weights"
bl_parent_id = 'PHYSICS_PT_fluid'
bl_options = {'DEFAULT_CLOSED'}
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_WORKBENCH'}
@classmethod
def poll(cls, context):
if not PhysicButtonsPanel.poll_fluid_domain(context):
return False
return (context.engine in cls.COMPAT_ENGINES)
def draw(self, context):
domain = context.fluid.domain_settings
effector_weights_ui(self, domain.effector_weights, 'SMOKE')
class PHYSICS_PT_viewport_display(PhysicButtonsPanel, Panel):
bl_label = "Viewport Display"
bl_parent_id = 'PHYSICS_PT_fluid'
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return (PhysicButtonsPanel.poll_gas_domain(context))
def draw(self, context):
layout = self.layout
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
domain = context.fluid.domain_settings
col = flow.column()
col.prop(domain, "display_thickness")
col.separator()
col.prop(domain, "slice_method", text="Slicing")
slice_method = domain.slice_method
axis_slice_method = domain.axis_slice_method
do_axis_slicing = (slice_method == 'AXIS_ALIGNED')
do_full_slicing = (axis_slice_method == 'FULL')
col = col.column()
col.enabled = do_axis_slicing
col.prop(domain, "axis_slice_method")
col = flow.column()
sub = col.column()
sub.enabled = not do_full_slicing and do_axis_slicing
sub.prop(domain, "slice_axis")
sub.prop(domain, "slice_depth")
row = col.row()
row.enabled = do_full_slicing or not do_axis_slicing
row.prop(domain, "slice_per_voxel")
col.prop(domain, "display_interpolation")
class PHYSICS_PT_viewport_display_color(PhysicButtonsPanel, Panel):
bl_label = "Color Mapping"
bl_parent_id = 'PHYSICS_PT_viewport_display'
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return (PhysicButtonsPanel.poll_gas_domain(context))
def draw_header(self, context):
md = context.fluid.domain_settings
self.layout.prop(md, "use_color_ramp", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
domain = context.fluid.domain_settings
col = layout.column()
col.enabled = domain.use_color_ramp
col.prop(domain, "coba_field")
col.use_property_split = False
col = col.column()
col.template_color_ramp(domain, "color_ramp", expand=True)
class PHYSICS_PT_viewport_display_debug(PhysicButtonsPanel, Panel):
bl_label = "Debug Velocity"
bl_parent_id = 'PHYSICS_PT_viewport_display'
bl_options = {'DEFAULT_CLOSED'}
@classmethod
def poll(cls, context):
return (PhysicButtonsPanel.poll_gas_domain(context))
def draw_header(self, context):
md = context.fluid.domain_settings
self.layout.prop(md, "show_velocity", text="")
def draw(self, context):
layout = self.layout
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
domain = context.fluid.domain_settings
col = flow.column()
col.enabled = domain.show_velocity
col.prop(domain, "vector_display_type", text="Display As")
col.prop(domain, "vector_scale")
classes = (
FLUID_MT_presets,
PHYSICS_PT_fluid,
PHYSICS_PT_settings,
PHYSICS_PT_borders,
PHYSICS_PT_smoke,
PHYSICS_PT_smoke_dissolve,
PHYSICS_PT_fire,
PHYSICS_PT_liquid,
PHYSICS_PT_flow_source,
PHYSICS_PT_flow_initial_velocity,
PHYSICS_PT_flow_texture,
PHYSICS_PT_adaptive_domain,
PHYSICS_PT_noise,
PHYSICS_PT_mesh,
PHYSICS_PT_particles,
PHYSICS_PT_diffusion,
PHYSICS_PT_guiding,
PHYSICS_PT_collections,
PHYSICS_PT_cache,
PHYSICS_PT_export,
PHYSICS_PT_field_weights,
PHYSICS_PT_viewport_display,
PHYSICS_PT_viewport_display_color,
PHYSICS_PT_viewport_display_debug,
)
if __name__ == "__main__": # only for live edit.
from bpy.utils import register_class
for cls in classes:
register_class(cls)
|