diff options
author | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-09-04 22:49:07 +0400 |
---|---|---|
committer | Arystanbek Dyussenov <arystan.d@gmail.com> | 2010-09-04 22:49:07 +0400 |
commit | 90b464d3728d9ed8ec26fdf59058d236b99dbcd9 (patch) | |
tree | e88cab4fb1358e962b19f658064ca8c9f8d29f5b /release/scripts/ui/properties_physics_smoke.py | |
parent | 08d02dd04d836976b25793bb1d4c6a86b3f924c7 (diff) | |
parent | b0b787ef38f9947b3176642556f5282eb3518f69 (diff) |
COLLADA branch: merge from trunk -r 28015:31610.soc-2009-chingachgook
Diffstat (limited to 'release/scripts/ui/properties_physics_smoke.py')
-rw-r--r-- | release/scripts/ui/properties_physics_smoke.py | 186 |
1 files changed, 86 insertions, 100 deletions
diff --git a/release/scripts/ui/properties_physics_smoke.py b/release/scripts/ui/properties_physics_smoke.py index 1f91b761e1a..cf91705318e 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 = 180 - 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,10 +44,8 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel): md = context.smoke ob = context.object - wide_ui = context.region.width > narrowui split = layout.split() - split.operator_context = 'EXEC_DEFAULT' if md: # remove modifier + settings @@ -56,82 +53,85 @@ class PHYSICS_PT_smoke(PhysicButtonsPanel): split.operator("object.modifier_remove", text="Remove") row = split.row(align=True) - row.prop(md, "render", text="") - row.prop(md, "realtime", text="") + row.prop(md, "show_render", text="") + row.prop(md, "show_viewport", text="") 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="") - - if md.smoke_type == 'TYPE_DOMAIN': + layout.prop(md, "smoke_type", expand=True) + if md.smoke_type == 'DOMAIN': domain = md.domain_settings split = layout.split() col = split.column() col.label(text="Resolution:") - col.prop(domain, "maxres", text="Divisions") - col.label(text="Particle:") - col.prop(domain, "initial_velocity", text="Initial Velocity") + 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="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Behavior:") col.prop(domain, "alpha") col.prop(domain, "beta") - col.prop(domain, "dissolve_smoke", text="Dissolve") + col.prop(domain, "vorticity") + col.prop(domain, "use_dissolve_smoke", text="Dissolve") sub = col.column() - sub.active = domain.dissolve_smoke + sub.active = domain.use_dissolve_smoke sub.prop(domain, "dissolve_speed", text="Time") - sub.prop(domain, "dissolve_smoke_log", text="Slow") - - elif md.smoke_type == 'TYPE_FLOW': + sub.prop(domain, "use_dissolve_smoke_log", text="Slow") + elif md.smoke_type == 'FLOW': + flow = md.flow_settings split = layout.split() col = split.column() - col.prop(flow, "outflow") + col.prop(flow, "use_outflow") col.label(text="Particle System:") - col.prop_object(flow, "psys", ob, "particle_systems", text="") - - if md.flow_settings.outflow: - if wide_ui: - col = split.column() - else: - if wide_ui: - col = split.column() - col.label(text="Behavior:") - col.prop(flow, "temperature") - col.prop(flow, "density") - - #elif md.smoke_type == 'TYPE_COLL': + col.prop_search(flow, "particle_system", ob, "particle_systems", text="") + + sub = col.column() + sub.active = not md.flow_settings.use_outflow + + sub.prop(flow, "initial_velocity", text="Initial Velocity") + sub = sub.column() + sub.active = flow.initial_velocity + sub.prop(flow, "velocity_factor", text="Multiplier") + + + sub = split.column() + sub.active = not md.flow_settings.use_outflow + sub.label(text="Behavior:") + sub.prop(flow, "temperature") + sub.prop(flow, "density") + sub.prop(flow, "use_absolute") + + #elif md.smoke_type == 'COLLISION': # 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 + bl_options = {'DEFAULT_CLOSED'} - def poll(self, context): + @classmethod + def poll(cls, context): md = context.smoke - return md and (md.smoke_type == 'TYPE_DOMAIN') + return md and (md.smoke_type == 'DOMAIN') def draw(self, context): layout = self.layout group = context.smoke.domain_settings - wide_ui = context.region.width > narrowui split = layout.split() @@ -140,124 +140,110 @@ class PHYSICS_PT_smoke_groups(PhysicButtonsPanel): col.prop(group, "fluid_group", text="") #col.label(text="Effector Group:") - #col.prop(group, "eff_group", text="") + #col.prop(group, "effector_group", text="") - if wide_ui: - col = split.column() + col = split.column() col.label(text="Collision Group:") - col.prop(group, "coll_group", text="") + col.prop(group, "collision_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 + bl_options = {'DEFAULT_CLOSED'} - def poll(self, context): + @classmethod + def poll(cls, context): md = context.smoke - return md and (md.smoke_type == 'TYPE_DOMAIN') + return md and (md.smoke_type == 'DOMAIN') def draw(self, context): layout = self.layout - domain = context.smoke.domain_settings - - layout.label(text="Compression:") - layout.prop(domain, "smoke_cache_comp", expand=True) - md = context.smoke.domain_settings cache = md.point_cache_low - point_cache_ui(self, context, cache, (cache.baked is False), 0, 1) + layout.label(text="Compression:") + layout.prop(md, "point_cache_compress_type", expand=True) + + point_cache_ui(self, context, cache, (cache.is_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 + bl_options = {'DEFAULT_CLOSED'} - def poll(self, context): + @classmethod + def poll(cls, context): md = context.smoke - return md and (md.smoke_type == 'TYPE_DOMAIN') + return md and (md.smoke_type == 'DOMAIN') def draw_header(self, context): - high = context.smoke.domain_settings + md = context.smoke.domain_settings - self.layout.prop(high, "highres", text="") + self.layout.prop(md, "use_high_resolution", text="") def draw(self, context): layout = self.layout md = context.smoke.domain_settings - wide_ui = context.region.width > narrowui + + layout.active = md.use_high_resolution split = layout.split() col = split.column() col.label(text="Resolution:") col.prop(md, "amplify", text="Divisions") - col.prop(md, "viewhighres") + col.prop(md, "smooth_emitter") + col.prop(md, "show_high_resolution") - 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 + bl_options = {'DEFAULT_CLOSED'} - def poll(self, context): + @classmethod + def poll(cls, context): md = context.smoke - return md and (md.smoke_type == 'TYPE_DOMAIN') and md.domain_settings.highres + return md and (md.smoke_type == 'DOMAIN') and md.domain_settings.use_high_resolution def draw(self, context): layout = self.layout - domain = context.smoke.domain_settings - - layout.label(text="Compression:") - layout.prop(domain, "smoke_cache_high_comp", expand=True) - - md = context.smoke.domain_settings cache = md.point_cache_high - point_cache_ui(self, context, cache, (cache.baked is False), 0, 1) + layout.label(text="Compression:") + layout.prop(md, "point_cache_compress_high_type", expand=True) + point_cache_ui(self, context, cache, (cache.is_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 + bl_options = {'DEFAULT_CLOSED'} - def poll(self, context): + @classmethod + def poll(cls, context): smoke = context.smoke - return (smoke and smoke.smoke_type == 'TYPE_DOMAIN') + return (smoke and smoke.smoke_type == 'DOMAIN') def draw(self, context): domain = context.smoke.domain_settings 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() |