[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35874] trunk/blender/release/scripts/ startup/bl_ui/properties_particle.py: Fix for [#26664] Some particle panels disappear when pinned

Janne Karhu jhkarh at gmail.com
Tue Mar 29 15:01:00 CEST 2011


Revision: 35874
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35874
Author:   jhk
Date:     2011-03-29 13:00:59 +0000 (Tue, 29 Mar 2011)
Log Message:
-----------
Fix for [#26664] Some particle panels disappear when pinned
* Too strict poll functions for render & display panels.
* Like said in the report cache & vertex groups are a part of the particle system (not particle settings) they can't be shown when the settings are pinned.

Modified Paths:
--------------
    trunk/blender/release/scripts/startup/bl_ui/properties_particle.py

Modified: trunk/blender/release/scripts/startup/bl_ui/properties_particle.py
===================================================================
--- trunk/blender/release/scripts/startup/bl_ui/properties_particle.py	2011-03-29 13:00:03 UTC (rev 35873)
+++ trunk/blender/release/scripts/startup/bl_ui/properties_particle.py	2011-03-29 13:00:59 UTC (rev 35874)
@@ -750,23 +750,23 @@
 
     @classmethod
     def poll(cls, context):
-        psys = context.particle_system
+        settings = particle_get_settings(context)
         engine = context.scene.render.engine
-        if psys is None:
+        if settings is None:
             return False
-        if psys.settings is None:
-            return False
+
         return engine in cls.COMPAT_ENGINES
 
     def draw(self, context):
         layout = self.layout
 
         psys = context.particle_system
-        part = psys.settings
+        part = particle_get_settings(context)
 
         row = layout.row()
         row.prop(part, "material")
-        row.prop(psys, "parent")
+        if psys:
+            row.prop(psys, "parent")
 
         split = layout.split()
 
@@ -881,16 +881,19 @@
             col = row.column()
             col.prop(part, "billboard_offset")
 
-            col = layout.column()
-            col.prop_search(psys, "billboard_normal_uv", ob.data, "uv_textures")
-            col.prop_search(psys, "billboard_time_index_uv", ob.data, "uv_textures")
+            if psys:
+                col = layout.column()
+                col.prop_search(psys, "billboard_normal_uv", ob.data, "uv_textures")
+                col.prop_search(psys, "billboard_time_index_uv", ob.data, "uv_textures")
 
             split = layout.split(percentage=0.33)
             split.label(text="Split uv's:")
             split.prop(part, "billboard_uv_split", text="Number of splits")
-            col = layout.column()
-            col.active = part.billboard_uv_split > 1
-            col.prop_search(psys, "billboard_split_uv", ob.data, "uv_textures")
+            
+            if psys:
+                col = layout.column()
+                col.active = part.billboard_uv_split > 1
+                col.prop_search(psys, "billboard_split_uv", ob.data, "uv_textures")
 
             row = col.row()
             row.label(text="Animate:")
@@ -924,12 +927,10 @@
 
     @classmethod
     def poll(cls, context):
-        psys = context.particle_system
+        settings = particle_get_settings(context)
         engine = context.scene.render.engine
-        if psys is None:
+        if settings is None:
             return False
-        if psys.settings is None:
-            return False
         return engine in cls.COMPAT_ENGINES
 
     def draw(self, context):
@@ -953,7 +954,7 @@
         else:
             row.label(text="")
 
-        if part.draw_percentage != 100:
+        if part.draw_percentage != 100 and psys is not None:
             if part.type == 'HAIR':
                 if psys.use_hair_dynamics and psys.point_cache.is_baked == False:
                     layout.row().label(text="Display percentage makes dynamics inaccurate without baking!")




More information about the Bf-blender-cvs mailing list