[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [22264] branches/blender2.5/blender: 2. 5 Smoke:
Thomas Dinges
dingto at gmx.de
Thu Aug 6 16:23:48 CEST 2009
Revision: 22264
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=22264
Author: dingto
Date: 2009-08-06 16:23:48 +0200 (Thu, 06 Aug 2009)
Log Message:
-----------
2.5 Smoke:
Moved the Smoke Buttons into the Physic Tab.
Modified Paths:
--------------
branches/blender2.5/blender/release/ui/buttons_data_modifier.py
branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_context.c
Added Paths:
-----------
branches/blender2.5/blender/release/ui/buttons_physics_smoke.py
Modified: branches/blender2.5/blender/release/ui/buttons_data_modifier.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_data_modifier.py 2009-08-06 14:03:43 UTC (rev 22263)
+++ branches/blender2.5/blender/release/ui/buttons_data_modifier.py 2009-08-06 14:23:48 UTC (rev 22264)
@@ -303,29 +303,7 @@
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()
Added: branches/blender2.5/blender/release/ui/buttons_physics_smoke.py
===================================================================
--- branches/blender2.5/blender/release/ui/buttons_physics_smoke.py (rev 0)
+++ branches/blender2.5/blender/release/ui/buttons_physics_smoke.py 2009-08-06 14:23:48 UTC (rev 22264)
@@ -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)
Modified: branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_context.c
===================================================================
--- branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_context.c 2009-08-06 14:03:43 UTC (rev 22263)
+++ branches/blender2.5/blender/source/blender/editors/space_buttons/buttons_context.c 2009-08-06 14:23:48 UTC (rev 22264)
@@ -558,7 +558,7 @@
"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 @@
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);
More information about the Bf-blender-cvs
mailing list