diff options
author | Thomas Dinges <blender@dingto.org> | 2009-08-06 18:23:48 +0400 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2009-08-06 18:23:48 +0400 |
commit | f10647e203188ef0af57c646aa870b08d7e4d223 (patch) | |
tree | 0533a5771d2e48d709e55608a8d127b9cc675401 | |
parent | 07ed54218795bf14a3049f8e1a9ab1011e239656 (diff) |
2.5 Smoke:
Moved the Smoke Buttons into the Physic Tab.
-rw-r--r-- | release/ui/buttons_data_modifier.py | 24 | ||||
-rw-r--r-- | release/ui/buttons_physics_smoke.py | 65 | ||||
-rw-r--r-- | source/blender/editors/space_buttons/buttons_context.c | 13 |
3 files changed, 78 insertions, 24 deletions
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) diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index 614017cc4c6..59d6a0ec6be 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -558,7 +558,7 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r "world", "object", "mesh", "armature", "lattice", "curve", "meta_ball", "lamp", "camera", "material", "material_slot", "texture", "texture_slot", "bone", "edit_bone", "particle_system", - "cloth", "soft_body", "fluid", "collision", "brush", NULL}; + "cloth", "soft_body", "fluid", "smoke", "collision", "brush", NULL}; CTX_data_dir_set(result, dir); return 1; @@ -691,6 +691,17 @@ int buttons_context(const bContext *C, const char *member, bContextDataResult *r return 1; } } + + else if(CTX_data_equals(member, "smoke")) { + PointerRNA *ptr= get_pointer_type(path, &RNA_Object); + + if(ptr && ptr->data) { + Object *ob= ptr->data; + ModifierData *md= modifiers_findByType(ob, eModifierType_Smoke); + CTX_data_pointer_set(result, &ob->id, &RNA_SmokeModifier, md); + return 1; + } + } else if(CTX_data_equals(member, "collision")) { PointerRNA *ptr= get_pointer_type(path, &RNA_Object); |