[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30199] trunk/blender: Adding COMPAT_ENGINE stuff to the particle panels so that they no longer show up when using the "Blender Game" render engine.

Mitchell Stokes mogurijin at gmail.com
Sun Jul 11 10:48:22 CEST 2010


Revision: 30199
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30199
Author:   moguri
Date:     2010-07-11 10:48:21 +0200 (Sun, 11 Jul 2010)

Log Message:
-----------
Adding COMPAT_ENGINE stuff to the particle panels so that they no longer show up when using the "Blender Game" render engine.

Also, "Maximize Gain" on the sound actuator was incorrectly labeled "Minimize Gain", so I fixed it.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_particle.py
    trunk/blender/source/blender/makesrna/intern/rna_actuator.c

Modified: trunk/blender/release/scripts/ui/properties_particle.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_particle.py	2010-07-11 03:33:14 UTC (rev 30198)
+++ trunk/blender/release/scripts/ui/properties_particle.py	2010-07-11 08:48:21 UTC (rev 30199)
@@ -32,13 +32,14 @@
     return (psys.point_cache.baked is False) and (not psys.edited) and (not context.particle_system_editable)
 
 
-def particle_panel_poll(context):
+def particle_panel_poll(panel, context):
     psys = context.particle_system
+    engine = context.scene.render.engine
     if psys is None:
         return False
     if psys.settings is None:
         return False
-    return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR')
+    return psys.settings.type in ('EMITTER', 'REACTOR', 'HAIR') and (engine in panel.COMPAT_ENGINES)
 
 
 class ParticleButtonsPanel(bpy.types.Panel):
@@ -47,15 +48,17 @@
     bl_context = "particle"
 
     def poll(self, context):
-        return particle_panel_poll(context)
+        return particle_panel_poll(self, context)
 
 
 class PARTICLE_PT_context_particles(ParticleButtonsPanel):
     bl_label = ""
     bl_show_header = False
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def poll(self, context):
-        return (context.particle_system or context.object)
+        engine = context.scene.render.engine
+        return (context.particle_system or context.object) and (engine in self.COMPAT_ENGINES)
 
     def draw(self, context):
         layout = self.layout
@@ -134,14 +137,16 @@
 
 
 class PARTICLE_PT_custom_props(ParticleButtonsPanel, PropertyPanel):
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
     _context_path = "particle_system.settings"
 
 
 class PARTICLE_PT_emission(ParticleButtonsPanel):
     bl_label = "Emission"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def poll(self, context):
-        if particle_panel_poll(context):
+        if particle_panel_poll(self, context):
             return not context.particle_system.point_cache.external
         else:
             return False
@@ -201,14 +206,16 @@
 class PARTICLE_PT_hair_dynamics(ParticleButtonsPanel):
     bl_label = "Hair dynamics"
     bl_default_closed = True
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def poll(self, context):
         psys = context.particle_system
+        engine = context.scene.render.engine
         if psys is None:
             return False
         if psys.settings is None:
             return False
-        return psys.settings.type == 'HAIR'
+        return psys.settings.type == 'HAIR' and (engine in self.COMPAT_ENGINES)
 
     def draw_header(self, context):
         #cloth = context.cloth.collision_settings
@@ -256,9 +263,11 @@
 class PARTICLE_PT_cache(ParticleButtonsPanel):
     bl_label = "Cache"
     bl_default_closed = True
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def poll(self, context):
         psys = context.particle_system
+        engine = context.scene.render.engine
         if psys is None:
             return False
         if psys.settings is None:
@@ -266,7 +275,7 @@
         phystype = psys.settings.physics_type
         if phystype == 'NO' or phystype == 'KEYED':
             return False
-        return psys.settings.type in ('EMITTER', 'REACTOR') or (psys.settings.type == 'HAIR' and psys.hair_dynamics)
+        return (psys.settings.type in ('EMITTER', 'REACTOR') or (psys.settings.type == 'HAIR' and psys.hair_dynamics)) and engine in self.COMPAT_ENGINES
 
     def draw(self, context):
         psys = context.particle_system
@@ -276,9 +285,10 @@
 
 class PARTICLE_PT_velocity(ParticleButtonsPanel):
     bl_label = "Velocity"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def poll(self, context):
-        if particle_panel_poll(context):
+        if particle_panel_poll(self, context):
             psys = context.particle_system
             return psys.settings.physics_type != 'BOIDS' and not psys.point_cache.external
         else:
@@ -322,9 +332,10 @@
 
 class PARTICLE_PT_rotation(ParticleButtonsPanel):
     bl_label = "Rotation"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def poll(self, context):
-        if particle_panel_poll(context):
+        if particle_panel_poll(self, context):
             psys = context.particle_system
             return psys.settings.physics_type != 'BOIDS' and not psys.point_cache.external
         else:
@@ -367,9 +378,10 @@
 
 class PARTICLE_PT_physics(ParticleButtonsPanel):
     bl_label = "Physics"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def poll(self, context):
-        if particle_panel_poll(context):
+        if particle_panel_poll(self, context):
             return not context.particle_system.point_cache.external
         else:
             return False
@@ -562,16 +574,18 @@
 
 class PARTICLE_PT_boidbrain(ParticleButtonsPanel):
     bl_label = "Boid Brain"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def poll(self, context):
         psys = context.particle_system
+        engine = context.scene.render.engine
         if psys is None:
             return False
         if psys.settings is None:
             return False
         if psys.point_cache.external:
             return False
-        return psys.settings.physics_type == 'BOIDS'
+        return psys.settings.physics_type == 'BOIDS' and engine in self.COMPAT_ENGINES
 
     def draw(self, context):
         layout = self.layout
@@ -660,14 +674,16 @@
 
 class PARTICLE_PT_render(ParticleButtonsPanel):
     bl_label = "Render"
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def poll(self, context):
         psys = context.particle_system
+        engine = context.scene.render.engine
         if psys is None:
             return False
         if psys.settings is None:
             return False
-        return True
+        return engine in self.COMPAT_ENGINES
 
     def draw(self, context):
         layout = self.layout
@@ -829,14 +845,16 @@
 class PARTICLE_PT_draw(ParticleButtonsPanel):
     bl_label = "Display"
     bl_default_closed = True
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def poll(self, context):
         psys = context.particle_system
+        engine = context.scene.render.engine
         if psys is None:
             return False
         if psys.settings is None:
             return False
-        return True
+        return engine in self.COMPAT_ENGINES
 
     def draw(self, context):
         layout = self.layout
@@ -886,6 +904,7 @@
 class PARTICLE_PT_children(ParticleButtonsPanel):
     bl_label = "Children"
     bl_default_closed = True
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         layout = self.layout
@@ -970,6 +989,7 @@
 class PARTICLE_PT_field_weights(ParticleButtonsPanel):
     bl_label = "Field Weights"
     bl_default_closed = True
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         part = context.particle_system.settings
@@ -982,6 +1002,7 @@
 class PARTICLE_PT_force_fields(ParticleButtonsPanel):
     bl_label = "Force Field Settings"
     bl_default_closed = True
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         layout = self.layout
@@ -1009,6 +1030,7 @@
 class PARTICLE_PT_vertexgroups(ParticleButtonsPanel):
     bl_label = "Vertexgroups"
     bl_default_closed = True
+    COMPAT_ENGINES = {'BLENDER_RENDER'}
 
     def draw(self, context):
         layout = self.layout

Modified: trunk/blender/source/blender/makesrna/intern/rna_actuator.c
===================================================================
--- trunk/blender/source/blender/makesrna/intern/rna_actuator.c	2010-07-11 03:33:14 UTC (rev 30198)
+++ trunk/blender/source/blender/makesrna/intern/rna_actuator.c	2010-07-11 08:48:21 UTC (rev 30199)
@@ -922,7 +922,7 @@
 	prop= RNA_def_property(srna, "maximum_gain_3d", PROP_FLOAT, PROP_NONE);
 	RNA_def_property_float_sdna(prop, NULL, "sound3D.max_gain");
 	RNA_def_property_ui_range(prop, 0.0, 1.0, 0.1, 0.01);
-	RNA_def_property_ui_text(prop, "Minimum Gain", "The maximum gain of the sound, no matter how near it is");
+	RNA_def_property_ui_text(prop, "Maximum Gain", "The maximum gain of the sound, no matter how near it is");
 	RNA_def_property_update(prop, NC_LOGIC, NULL);
 
 	prop= RNA_def_property(srna, "reference_distance_3d", PROP_FLOAT, PROP_NONE);





More information about the Bf-blender-cvs mailing list