From 62b2675147bab469e7c252265ab223b8bb9c3e39 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vuk=20Garda=C3=85=C2=A1evi=C3=84=C2=87?= Date: Fri, 17 Aug 2018 11:58:21 +0200 Subject: Physics Smoke: Use Single Column and Grid Flow layout See D3567 --- .../startup/bl_ui/properties_physics_smoke.py | 554 ++++++++++++++------- 1 file changed, 373 insertions(+), 181 deletions(-) (limited to 'release/scripts/startup') diff --git a/release/scripts/startup/bl_ui/properties_physics_smoke.py b/release/scripts/startup/bl_ui/properties_physics_smoke.py index 0a4f1c71126..01faa3496b4 100644 --- a/release/scripts/startup/bl_ui/properties_physics_smoke.py +++ b/release/scripts/startup/bl_ui/properties_physics_smoke.py @@ -17,9 +17,11 @@ # ##### END GPL LICENSE BLOCK ##### # -import bpy -from bpy.types import Panel +import bpy +from bpy.types import ( + Panel, +) from .properties_physics_common import ( point_cache_ui, effector_weights_ui, @@ -31,109 +33,241 @@ class PhysicButtonsPanel: bl_region_type = 'WINDOW' bl_context = "physics" - @classmethod - def poll(cls, context): + def poll_smoke(context): ob = context.object - return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.smoke) + if not ((ob and ob.type == 'MESH') and (context.smoke)): + return False + + md = context.smoke + return md and (context.smoke.smoke_type != 'NONE') and (bpy.app.build_options.mod_smoke) + + def poll_smoke_domain(context): + if not PhysicButtonsPanel.poll_smoke(context): + return False + + md = context.smoke + return md and (md.smoke_type == 'DOMAIN') class PHYSICS_PT_smoke(PhysicButtonsPanel, Panel): bl_label = "Smoke" COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'} + @classmethod + def poll(cls, context): + ob = context.object + return (ob and ob.type == 'MESH') and (context.engine in cls.COMPAT_ENGINES) and (context.smoke) + def draw(self, context): layout = self.layout + layout.use_property_split = True if not bpy.app.build_options.mod_smoke: - layout.label("Built without Smoke modifier") + col = layout.column(align=True) + col.alignment = 'RIGHT' + col.label("Built without Smoke modifier") return md = context.smoke - ob = context.object - layout.row().prop(md, "smoke_type", expand=True) + layout.prop(md, "smoke_type") + + +class PHYSICS_PT_smoke_settings(PhysicButtonsPanel, Panel): + bl_label = "Settings" + bl_parent_id = 'PHYSICS_PT_smoke' + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'} + + @classmethod + def poll(cls, context): + if not PhysicButtonsPanel.poll_smoke(context): + return False + + return (context.engine in cls.COMPAT_ENGINES) + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + + md = context.smoke + ob = context.object if md.smoke_type == 'DOMAIN': domain = md.domain_settings - split = layout.split() - - split.enabled = not domain.point_cache.is_baked - - col = split.column() - col.label(text="Resolution:") - col.prop(domain, "resolution_max", text="Divisions") - col.label(text="Time:") - col.prop(domain, "time_scale", text="Scale") - col.label(text="Border Collisions:") - col.prop(domain, "collision_extents", text="") - col.label(text="Empty Space:") - col.prop(domain, "clipping") - - col = split.column() - col.label(text="Behavior:") - col.prop(domain, "alpha") - col.prop(domain, "beta", text="Temp. Diff.") - col.prop(domain, "vorticity") - col.prop(domain, "use_dissolve_smoke", text="Dissolve") - sub = col.column() - sub.active = domain.use_dissolve_smoke - sub.prop(domain, "dissolve_speed", text="Time") - sub.prop(domain, "use_dissolve_smoke_log", text="Slow") + flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) + flow.enabled = (not domain.point_cache.is_baked) + + col = flow.column() + col.prop(domain, "resolution_max", text="Resolution Divisions") + col.prop(domain, "time_scale", text="Time Scale") + + col.separator() + + col = flow.column() + col.prop(domain, "collision_extents", text="Border Collisions") + col.prop(domain, "clipping", text="Empty Space") elif md.smoke_type == 'FLOW': + flow_smoke = md.flow_settings + + col = layout.column() + col.prop(flow_smoke, "smoke_flow_type", expand=False) + + col.separator() - flow = md.flow_settings - - layout.prop(flow, "smoke_flow_type", expand=False) - - if flow.smoke_flow_type != 'OUTFLOW': - split = layout.split() - col = split.column() - col.label(text="Flow Source:") - col.prop(flow, "smoke_flow_source", expand=False, text="") - if flow.smoke_flow_source == 'PARTICLES': - col.label(text="Particle System:") - col.prop_search(flow, "particle_system", ob, "particle_systems", text="") - col.prop(flow, "use_particle_size", text="Set Size") - sub = col.column() - sub.active = flow.use_particle_size - sub.prop(flow, "particle_size") + flow = layout.grid_flow(row_major=False, columns=0, even_columns=True, even_rows=False, align=True) + col = flow.column() + + if flow_smoke.smoke_flow_type != 'OUTFLOW': + col.prop(flow_smoke, "smoke_flow_source", expand=False, text="Flow Source") + + if flow_smoke.smoke_flow_source == 'PARTICLES': + # Note: TODO prop_search doesn't align on the right. + row = col.row(align=True) + row.prop_search( + flow_smoke, "particle_system", ob, "particle_systems", + text="Particle System" + ) + row.label(text="", icon='BLANK1') else: - col.prop(flow, "surface_distance") - col.prop(flow, "volume_density") - - sub = col.column(align=True) - sub.prop(flow, "use_initial_velocity") - - sub = sub.column() - sub.active = flow.use_initial_velocity - sub.prop(flow, "velocity_factor") - if flow.smoke_flow_source == 'MESH': - sub.prop(flow, "velocity_normal") - #sub.prop(flow, "velocity_random") - - sub = split.column() - sub.label(text="Initial Values:") - sub.prop(flow, "use_absolute") - if flow.smoke_flow_type in {'SMOKE', 'BOTH'}: - sub.prop(flow, "density") - sub.prop(flow, "temperature") - sub.prop(flow, "smoke_color") - if flow.smoke_flow_type in {'FIRE', 'BOTH'}: - sub.prop(flow, "fuel_amount") - sub.label(text="Sampling:") - sub.prop(flow, "subframes") + col.prop(flow_smoke, "surface_distance") + col.prop(flow_smoke, "volume_density") + + col = flow.column() + col.prop(flow_smoke, "use_absolute") + + if flow_smoke.smoke_flow_type in {'SMOKE', 'BOTH'}: + col.prop(flow_smoke, "density") + col.prop(flow_smoke, "temperature") + + col.separator() + + col = flow.column() + col.prop(flow_smoke, "smoke_color") + + if flow_smoke.smoke_flow_type in {'FIRE', 'BOTH'}: + col.prop(flow_smoke, "fuel_amount") + + col.prop(flow_smoke, "subframes", text="Sampling Subframes") elif md.smoke_type == 'COLLISION': coll = md.coll_settings - split = layout.split() - - col = split.column() + col = layout.column() col.prop(coll, "collision_type") +class PHYSICS_PT_smoke_settings_initial_velocity(PhysicButtonsPanel, Panel): + bl_label = "Initial Velocity" + bl_parent_id = 'PHYSICS_PT_smoke_settings' + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'} + + @classmethod + def poll(cls, context): + if not PhysicButtonsPanel.poll_smoke(context): + return False + + md = context.smoke + return (md and (md.smoke_type == 'FLOW') + and md.flow_settings and md.flow_settings.smoke_flow_type != 'OUTFLOW' + and context.engine in cls.COMPAT_ENGINES) + + def draw_header(self, context): + md = context.smoke + 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.smoke + flow_smoke = md.flow_settings + + flow.active = flow_smoke.use_initial_velocity + + col = flow.column(align=True) + col.prop(flow_smoke, "velocity_factor") + + if flow_smoke.smoke_flow_source == 'MESH': + col = flow.column() + col.prop(flow_smoke, "velocity_normal") + # sub.prop(flow_smoke, "velocity_random") + + +class PHYSICS_PT_smoke_settings_particle_size(PhysicButtonsPanel, Panel): + bl_label = "Particle Size" + bl_parent_id = 'PHYSICS_PT_smoke_settings' + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'} + + @classmethod + def poll(cls, context): + if not PhysicButtonsPanel.poll_smoke(context): + return False + + md = context.smoke + return (md and (md.smoke_type == 'FLOW') + and md.flow_settings and md.flow_settings.smoke_flow_type != 'OUTFLOW' + and md.flow_settings.smoke_flow_source == 'PARTICLES' + and context.engine in cls.COMPAT_ENGINES) + + def draw_header(self, context): + md = context.smoke + flow_smoke = md.flow_settings + + self.layout.prop(flow_smoke, "use_particle_size", text="") + + def draw(self, context): + layout = self.layout + layout.use_property_split = True + + md = context.smoke + flow_smoke = md.flow_settings + + layout.active = flow_smoke.use_particle_size + + layout.prop(flow_smoke, "particle_size") + + +class PHYSICS_PT_smoke_behavior(PhysicButtonsPanel, Panel): + bl_label = "Behavior" + bl_parent_id = 'PHYSICS_PT_smoke_settings' + COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'} + + @classmethod + def poll(cls, context): + if not PhysicButtonsPanel.poll_smoke_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.smoke + domain = md.domain_settings + + flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) + flow.enabled = (not domain.point_cache.is_baked) + + col = flow.column() + col.prop(domain, "alpha") + col.prop(domain, "beta", text="Temp. Diff.") + col.prop(domain, "vorticity") + + col = flow.column() + col.prop(domain, "use_dissolve_smoke", text="Dissolve") + + sub = col.column() + sub.active = domain.use_dissolve_smoke + sub.prop(domain, "dissolve_speed", text="Time") + sub.prop(domain, "use_dissolve_smoke_log", text="Slow") + + class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel): bl_label = "Advanced" bl_parent_id = 'PHYSICS_PT_smoke' @@ -142,32 +276,51 @@ class PHYSICS_PT_smoke_flow_advanced(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): + if not PhysicButtonsPanel.poll_smoke(context): + return False + md = context.smoke - return md and (md.smoke_type == 'FLOW') and (md.flow_settings.smoke_flow_source == 'MESH') + return (md and (md.smoke_type == 'FLOW') + and (md.flow_settings.smoke_flow_source == 'MESH') + and (context.engine in cls.COMPAT_ENGINES)) 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 = context.smoke.flow_settings + flow_smoke = context.smoke.flow_settings + + col = flow.column() + col.prop(flow_smoke, "use_texture") - split = layout.split() - col = split.column() + sub = col.column() + sub.active = flow_smoke.use_texture + sub.prop(flow_smoke, "noise_texture") + sub.prop(flow_smoke, "texture_map_type", text="Mapping") - col.prop(flow, "use_texture") + col = flow.column() sub = col.column() - sub.active = flow.use_texture - sub.prop(flow, "noise_texture", text="") - sub.label(text="Mapping:") - sub.prop(flow, "texture_map_type", expand=False, text="") - if flow.texture_map_type == 'UV': - sub.prop_search(flow, "uv_layer", ob.data, "uv_layers", text="") - if flow.texture_map_type == 'AUTO': - sub.prop(flow, "texture_size") - sub.prop(flow, "texture_offset") + sub.active = flow_smoke.use_texture + + if flow_smoke.texture_map_type == 'UV': + # Note: TODO prop_search doesn't align on the right. + row = sub.row(align=True) + row.prop_search(flow_smoke, "uv_layer", ob.data, "uv_layers") + row.label(text="", icon='BLANK1') + + if flow_smoke.texture_map_type == 'AUTO': + sub.prop(flow_smoke, "texture_size") - col = split.column() - col.label(text="Vertex Group:") - col.prop_search(flow, "density_vertex_group", ob, "vertex_groups", text="") + sub.prop(flow_smoke, "texture_offset") + + sub.separator() + + # Note: TODO prop_search doesn't align on the right. + row = col.row(align=True) + row.prop_search(flow_smoke, "density_vertex_group", ob, "vertex_groups", text="Vertex Group") + row.label(text="", icon='BLANK1') class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel): @@ -178,27 +331,35 @@ class PHYSICS_PT_smoke_fire(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): - md = context.smoke - return md and (md.smoke_type == 'DOMAIN') + if not PhysicButtonsPanel.poll_smoke_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.smoke.domain_settings - split = layout.split() - split.enabled = not domain.point_cache.is_baked + flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False) + flow.enabled = (not domain.point_cache.is_baked) - col = split.column(align=True) - col.label(text="Reaction:") - col.prop(domain, "burning_rate") + col = flow.column(align=True) + col.prop(domain, "burning_rate", text="Reaction Speed") col.prop(domain, "flame_smoke") col.prop(domain, "flame_vorticity") - col = split.column(align=True) - col.label(text="Temperatures:") - col.prop(domain, "flame_ignition") + col.separator() + + col = flow.column(align=True) + col.prop(domain, "flame_ignition", text="Temperature Ignition") col.prop(domain, "flame_max_temp") - col.prop(domain, "flame_smoke_color") + + col.separator() + + sub = col.column() + sub.prop(domain, "flame_smoke_color") class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel): @@ -209,8 +370,10 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): - md = context.smoke - return md and (md.smoke_type == 'DOMAIN') + if not PhysicButtonsPanel.poll_smoke_domain(context): + return False + + return (context.engine in cls.COMPAT_ENGINES) def draw_header(self, context): md = context.smoke.domain_settings @@ -219,21 +382,22 @@ class PHYSICS_PT_smoke_adaptive_domain(PhysicButtonsPanel, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True domain = context.smoke.domain_settings layout.active = domain.use_adaptive_domain - split = layout.split() - split.enabled = (not domain.point_cache.is_baked) + flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) + flow.enabled = (not domain.point_cache.is_baked) - col = split.column(align=True) - col.label(text="Resolution:") - col.prop(domain, "additional_res") + col = flow.column(align=True) + col.prop(domain, "additional_res", text="Add Resolution") col.prop(domain, "adapt_margin") - col = split.column(align=True) - col.label(text="Advanced:") - col.prop(domain, "adapt_threshold") + col.separator() + + col = flow.column() + col.prop(domain, "adapt_threshold", text="Threshold") class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel): @@ -244,8 +408,10 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): - md = context.smoke - return md and (md.smoke_type == 'DOMAIN') and (context.engine in cls.COMPAT_ENGINES) + if not PhysicButtonsPanel.poll_smoke_domain(context): + return False + + return (context.engine in cls.COMPAT_ENGINES) def draw_header(self, context): md = context.smoke.domain_settings @@ -254,23 +420,23 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, Panel): def draw(self, context): layout = self.layout + layout.use_property_split = True md = context.smoke.domain_settings - layout.active = md.use_high_resolution - split = layout.split() - split.enabled = not md.point_cache.is_baked + flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True) + + col = flow.column() + col.enabled = not md.point_cache.is_baked + col.prop(md, "amplify", text="Resolution Divisions") + col.prop(md, "highres_sampling", text="Flow Sampling") - col = split.column() - col.label(text="Resolution:") - col.prop(md, "amplify", text="Divisions") - col.label(text="Flow Sampling:") - col.row().prop(md, "highres_sampling", text="") + col.separator() - col = split.column() - col.label(text="Noise Method:") - col.row().prop(md, "noise_type", text="") + col = flow.column() + col.enabled = not md.point_cache.is_baked + col.prop(md, "noise_type", text="Noise Method") col.prop(md, "strength") layout.prop(md, "show_high_resolution") @@ -284,25 +450,23 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): - md = context.smoke - return md and (md.smoke_type == 'DOMAIN') and (context.engine in cls.COMPAT_ENGINES) + if not PhysicButtonsPanel.poll_smoke_domain(context): + return False + + return (context.engine in cls.COMPAT_ENGINES) def draw(self, context): layout = self.layout - domain = context.smoke.domain_settings + layout.use_property_split = True - split = layout.split() - - col = split.column() - col.label(text="Flow Group:") - col.prop(domain, "fluid_group", text="") + domain = context.smoke.domain_settings - #col.label(text="Effector Group:") - #col.prop(domain, "effector_group", text="") + col = layout.column() + col.prop(domain, "fluid_group", text="Flow") - col = split.column() - col.label(text="Collision Group:") - col.prop(domain, "collision_group", text="") + # col = layout.column() + # col.prop(domain, "effector_group", text="Effector") + col.prop(domain, "collision_group", text="Collision") class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel): @@ -313,30 +477,38 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): - md = context.smoke - return md and (md.smoke_type == 'DOMAIN') and (context.engine in cls.COMPAT_ENGINES) + if not PhysicButtonsPanel.poll_smoke_domain(context): + return False + + return (context.engine in cls.COMPAT_ENGINES) 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.smoke.domain_settings cache_file_format = domain.cache_file_format - layout.prop(domain, "cache_file_format") + col = flow.column() + col.prop(domain, "cache_file_format") if cache_file_format == 'POINTCACHE': - layout.label(text="Compression:") - layout.row().prop(domain, "point_cache_compress_type", expand=True) + col = flow.column() + col.prop(domain, "point_cache_compress_type", text="Compression") + col.separator() + elif cache_file_format == 'OPENVDB': if not bpy.app.build_options.openvdb: - layout.label("Built without OpenVDB support") + row = layout.row(align=True) + row.alignment = 'RIGHT' + row.label("Built without OpenVDB support") return - layout.label(text="Compression:") - layout.row().prop(domain, "openvdb_cache_compress_type", expand=True) - row = layout.row() - row.label("Data Depth:") - row.prop(domain, "data_depth", expand=True, text="Data Depth") + col = flow.column() + col.prop(domain, "openvdb_cache_compress_type", text="Compression") + col.prop(domain, "data_depth", text="Data Depth") + col.separator() cache = domain.point_cache point_cache_ui(self, context, cache, (cache.is_baked is False), 'SMOKE') @@ -350,8 +522,10 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): - md = context.smoke - return md and (md.smoke_type == 'DOMAIN') and (context.engine in cls.COMPAT_ENGINES) + if not PhysicButtonsPanel.poll_smoke_domain(context): + return False + + return (context.engine in cls.COMPAT_ENGINES) def draw(self, context): domain = context.smoke.domain_settings @@ -365,18 +539,21 @@ class PHYSICS_PT_smoke_viewport_display(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): - md = context.smoke - return md and (md.smoke_type == 'DOMAIN') + return (PhysicButtonsPanel.poll_smoke_domain(context)) def draw(self, context): - domain = context.smoke.domain_settings 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.smoke.domain_settings - layout.prop(domain, "display_thickness") + col = flow.column() + col.prop(domain, "display_thickness") - layout.separator() - layout.label(text="Slicing:") - layout.prop(domain, "slice_method") + col.separator() + + col.prop(domain, "slice_method", text="Slicing") slice_method = domain.slice_method axis_slice_method = domain.axis_slice_method @@ -384,18 +561,19 @@ class PHYSICS_PT_smoke_viewport_display(PhysicButtonsPanel, Panel): do_axis_slicing = (slice_method == 'AXIS_ALIGNED') do_full_slicing = (axis_slice_method == 'FULL') - row = layout.row() - row.enabled = do_axis_slicing - row.prop(domain, "axis_slice_method") + col = col.column() + col.enabled = do_axis_slicing + col.prop(domain, "axis_slice_method") - col = layout.column() - col.enabled = not do_full_slicing and do_axis_slicing - col.prop(domain, "slice_axis") - col.prop(domain, "slice_depth") + 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 = layout.row() - row.enabled = do_full_slicing or not do_axis_slicing - row.prop(domain, "slice_per_voxel") + col = col.row() + col.enabled = do_full_slicing or not do_axis_slicing + col.prop(domain, "slice_per_voxel") class PHYSICS_PT_smoke_viewport_display_color(PhysicButtonsPanel, Panel): @@ -405,8 +583,7 @@ class PHYSICS_PT_smoke_viewport_display_color(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): - md = context.smoke - return md and (md.smoke_type == 'DOMAIN') + return (PhysicButtonsPanel.poll_smoke_domain(context)) def draw_header(self, context): md = context.smoke.domain_settings @@ -414,12 +591,18 @@ class PHYSICS_PT_smoke_viewport_display_color(PhysicButtonsPanel, Panel): self.layout.prop(md, "use_color_ramp", text="") def draw(self, context): - domain = context.smoke.domain_settings layout = self.layout + layout.use_property_split = True + domain = context.smoke.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) @@ -430,15 +613,19 @@ class PHYSICS_PT_smoke_viewport_display_debug(PhysicButtonsPanel, Panel): @classmethod def poll(cls, context): - md = context.smoke - return md and (md.smoke_type == 'DOMAIN') + return (PhysicButtonsPanel.poll_smoke_domain(context)) def draw(self, context): - domain = context.smoke.domain_settings 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) - layout.prop(domain, "draw_velocity") - col = layout.column() + domain = context.smoke.domain_settings + + col = flow.column() + col.prop(domain, "draw_velocity") + + col = flow.column() col.enabled = domain.draw_velocity col.prop(domain, "vector_draw_type") col.prop(domain, "vector_scale") @@ -446,18 +633,23 @@ class PHYSICS_PT_smoke_viewport_display_debug(PhysicButtonsPanel, Panel): classes = ( PHYSICS_PT_smoke, - PHYSICS_PT_smoke_flow_advanced, - PHYSICS_PT_smoke_fire, + PHYSICS_PT_smoke_settings, + PHYSICS_PT_smoke_settings_initial_velocity, + PHYSICS_PT_smoke_settings_particle_size, + PHYSICS_PT_smoke_behavior, PHYSICS_PT_smoke_adaptive_domain, - PHYSICS_PT_smoke_highres, - PHYSICS_PT_smoke_groups, PHYSICS_PT_smoke_cache, PHYSICS_PT_smoke_field_weights, + PHYSICS_PT_smoke_fire, + PHYSICS_PT_smoke_flow_advanced, + PHYSICS_PT_smoke_groups, + PHYSICS_PT_smoke_highres, PHYSICS_PT_smoke_viewport_display, PHYSICS_PT_smoke_viewport_display_color, PHYSICS_PT_smoke_viewport_display_debug, ) + if __name__ == "__main__": # only for live edit. from bpy.utils import register_class for cls in classes: -- cgit v1.2.3