From f10647e203188ef0af57c646aa870b08d7e4d223 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Thu, 6 Aug 2009 14:23:48 +0000 Subject: 2.5 Smoke: Moved the Smoke Buttons into the Physic Tab. --- release/ui/buttons_data_modifier.py | 24 +------------- release/ui/buttons_physics_smoke.py | 65 +++++++++++++++++++++++++++++++++++++ 2 files changed, 66 insertions(+), 23 deletions(-) create mode 100644 release/ui/buttons_physics_smoke.py (limited to 'release') diff --git a/release/ui/buttons_data_modifier.py b/release/ui/buttons_data_modifier.py index 03950c707d2..f92bbd1581e 100644 --- a/release/ui/buttons_data_modifier.py +++ b/release/ui/buttons_data_modifier.py @@ -303,29 +303,7 @@ class DATA_PT_modifiers(DataButtonsPanel): layout.itemR(md, "lock_y_axis") def SMOKE(self, layout, ob, md): - layout.itemR(md, "smoke_type") - - if md.smoke_type == 'TYPE_DOMAIN': - layout.itemS() - layout.itemR(md.domain_settings, "maxres") - layout.itemR(md.domain_settings, "color") - layout.itemR(md.domain_settings, "amplify") - layout.itemR(md.domain_settings, "highres") - layout.itemR(md.domain_settings, "noise_type") - layout.itemR(md.domain_settings, "visibility") - layout.itemR(md.domain_settings, "alpha") - layout.itemR(md.domain_settings, "beta") - layout.itemR(md.domain_settings, "fluid_group") - layout.itemR(md.domain_settings, "eff_group") - layout.itemR(md.domain_settings, "coll_group") - elif md.smoke_type == 'TYPE_FLOW': - layout.itemS() - layout.itemR(md.flow_settings, "outflow") - layout.itemR(md.flow_settings, "density") - layout.itemR(md.flow_settings, "temperature") - layout.item_pointerR(md.flow_settings, "psys", ob, "particle_systems") - elif md.smoke_type == 'TYPE_COLL': - layout.itemS() + layout.itemL(text="See Smoke panel.") def SMOOTH(self, layout, ob, md): split = layout.split() diff --git a/release/ui/buttons_physics_smoke.py b/release/ui/buttons_physics_smoke.py new file mode 100644 index 00000000000..82363d29e91 --- /dev/null +++ b/release/ui/buttons_physics_smoke.py @@ -0,0 +1,65 @@ + +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': + layout.itemS() + layout.itemR(md.domain_settings, "maxres") + layout.itemR(md.domain_settings, "color") + layout.itemR(md.domain_settings, "amplify") + layout.itemR(md.domain_settings, "highres") + layout.itemR(md.domain_settings, "noise_type") + layout.itemR(md.domain_settings, "visibility") + layout.itemR(md.domain_settings, "alpha") + layout.itemR(md.domain_settings, "beta") + layout.itemR(md.domain_settings, "fluid_group") + layout.itemR(md.domain_settings, "eff_group") + layout.itemR(md.domain_settings, "coll_group") + elif md.smoke_type == 'TYPE_FLOW': + layout.itemS() + layout.itemR(md.flow_settings, "outflow") + layout.itemR(md.flow_settings, "density") + layout.itemR(md.flow_settings, "temperature") + layout.item_pointerR(md.flow_settings, "psys", ob, "particle_systems") + elif md.smoke_type == 'TYPE_COLL': + layout.itemS() + +bpy.types.register(PHYSICS_PT_smoke) -- cgit v1.2.3