diff options
Diffstat (limited to 'release/scripts/ui/properties_physics_smoke.py')
-rw-r--r-- | release/scripts/ui/properties_physics_smoke.py | 75 |
1 files changed, 28 insertions, 47 deletions
diff --git a/release/scripts/ui/properties_physics_smoke.py b/release/scripts/ui/properties_physics_smoke.py index 9bae4c5b63f..3538b88afcf 100644 --- a/release/scripts/ui/properties_physics_smoke.py +++ b/release/scripts/ui/properties_physics_smoke.py @@ -19,25 +19,24 @@ # <pep8 compliant> import bpy -narrowui = bpy.context.user_preferences.view.properties_width_check - from properties_physics_common import point_cache_ui from properties_physics_common import effector_weights_ui -class PhysicButtonsPanel(bpy.types.Panel): +class PhysicButtonsPanel(): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' bl_context = "physics" - def poll(self, context): + @classmethod + def poll(cls, context): ob = context.object rd = context.scene.render return (ob and ob.type == 'MESH') and (not rd.use_game_engine) -class PHYSICS_PT_smoke(PhysicButtonsPanel): +class PHYSICS_PT_smoke(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Smoke" def draw(self, context): @@ -45,7 +44,6 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel): md = context.smoke ob = context.object - wide_ui = context.region.width > narrowui split = layout.split() @@ -61,14 +59,10 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel): else: # add modifier split.operator("object.modifier_add", text="Add").type = 'SMOKE' - if wide_ui: - split.label() + split.label() if md: - if wide_ui: - layout.prop(md, "smoke_type", expand=True) - else: - layout.prop(md, "smoke_type", text="") + layout.prop(md, "smoke_type", expand=True) if md.smoke_type == 'DOMAIN': domain = md.domain_settings @@ -83,8 +77,7 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel): col.label(text="Border Collisions:") col.prop(domain, "smoke_domain_colli", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Behavior:") col.prop(domain, "alpha") col.prop(domain, "beta") @@ -114,8 +107,8 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel): sub.active = flow.initial_velocity sub.prop(flow, "velocity_multiplier", text="Multiplier") - if wide_ui: - sub = split.column() + + sub = split.column() sub.active = not md.flow_settings.outflow sub.label(text="Behavior:") sub.prop(flow, "temperature") @@ -126,11 +119,12 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel): # layout.separator() -class PHYSICS_PT_smoke_groups(PhysicButtonsPanel): +class PHYSICS_PT_smoke_groups(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Smoke Groups" bl_default_closed = True - def poll(self, context): + @classmethod + def poll(cls, context): md = context.smoke return md and (md.smoke_type == 'DOMAIN') @@ -138,7 +132,6 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel): layout = self.layout group = context.smoke.domain_settings - wide_ui = context.region.width > narrowui split = layout.split() @@ -149,17 +142,17 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel): #col.label(text="Effector Group:") #col.prop(group, "eff_group", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Collision Group:") col.prop(group, "coll_group", text="") -class PHYSICS_PT_smoke_cache(PhysicButtonsPanel): +class PHYSICS_PT_smoke_cache(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Smoke Cache" bl_default_closed = True - def poll(self, context): + @classmethod + def poll(cls, context): md = context.smoke return md and (md.smoke_type == 'DOMAIN') @@ -175,11 +168,12 @@ class PHYSICS_PT_smoke_cache(PhysicButtonsPanel): point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE') -class PHYSICS_PT_smoke_highres(PhysicButtonsPanel): +class PHYSICS_PT_smoke_highres(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Smoke High Resolution" bl_default_closed = True - def poll(self, context): + @classmethod + def poll(cls, context): md = context.smoke return md and (md.smoke_type == 'DOMAIN') @@ -192,7 +186,6 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel): layout = self.layout md = context.smoke.domain_settings - wide_ui = context.region.width > narrowui layout.active = md.highres @@ -204,18 +197,18 @@ class PHYSICS_PT_smoke_highres(PhysicButtonsPanel): col.prop(md, "smoothemitter") col.prop(md, "viewhighres") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Noise Method:") col.row().prop(md, "noise_type", text="") col.prop(md, "strength") -class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel): +class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Smoke High Resolution Cache" bl_default_closed = True - def poll(self, context): + @classmethod + def poll(cls, context): md = context.smoke return md and (md.smoke_type == 'DOMAIN') and md.domain_settings.highres @@ -231,11 +224,12 @@ class PHYSICS_PT_smoke_cache_highres(PhysicButtonsPanel): point_cache_ui(self, context, cache, (cache.baked is False), 'SMOKE') -class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel): +class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel, bpy.types.Panel): bl_label = "Smoke Field Weights" bl_default_closed = True - def poll(self, context): + @classmethod + def poll(cls, context): smoke = context.smoke return (smoke and smoke.smoke_type == 'DOMAIN') @@ -244,25 +238,12 @@ class PHYSICS_PT_smoke_field_weights(PhysicButtonsPanel): effector_weights_ui(self, context, domain.effector_weights) -classes = [ - PHYSICS_PT_smoke, - PHYSICS_PT_smoke_field_weights, - PHYSICS_PT_smoke_cache, - PHYSICS_PT_smoke_highres, - PHYSICS_PT_smoke_groups, - PHYSICS_PT_smoke_cache_highres] - - def register(): - register = bpy.types.register - for cls in classes: - register(cls) + pass def unregister(): - unregister = bpy.types.unregister - for cls in classes: - unregister(cls) + pass if __name__ == "__main__": register() |