[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [35578] trunk/blender: Fix for [#26520] Point Density turbulence not accessible in Texture Properties.

Janne Karhu jhkarh at gmail.com
Wed Mar 16 19:21:31 CET 2011


Revision: 35578
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=35578
Author:   jhk
Date:     2011-03-16 18:21:31 +0000 (Wed, 16 Mar 2011)
Log Message:
-----------
Fix for [#26520] Point Density turbulence not accessible in Texture Properties.
* Mistake in the ui file.
* Also found a possible memory leak.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_texture.py
    trunk/blender/source/blender/blenkernel/intern/texture.c
    trunk/blender/source/blender/render/intern/source/pointdensity.c

Modified: trunk/blender/release/scripts/ui/properties_texture.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_texture.py	2011-03-16 16:31:47 UTC (rev 35577)
+++ trunk/blender/release/scripts/ui/properties_texture.py	2011-03-16 18:21:31 UTC (rev 35578)
@@ -706,12 +706,13 @@
 
         col.separator()
 
-        col.label(text="Color Source:")
-        col.prop(pd, "color_source", text="")
-        if pd.color_source in {'PARTICLE_SPEED', 'PARTICLE_VELOCITY'}:
-            col.prop(pd, "speed_scale")
-        if pd.color_source in {'PARTICLE_SPEED', 'PARTICLE_AGE'}:
-            layout.template_color_ramp(pd, "color_ramp", expand=True)
+        if pd.point_source == 'PARTICLE_SYSTEM':
+            col.label(text="Color Source:")
+            col.prop(pd, "color_source", text="")
+            if pd.color_source in {'PARTICLE_SPEED', 'PARTICLE_VELOCITY'}:
+                col.prop(pd, "speed_scale")
+            if pd.color_source in {'PARTICLE_SPEED', 'PARTICLE_AGE'}:
+                layout.template_color_ramp(pd, "color_ramp", expand=True)
 
         col = split.column()
         col.label()
@@ -733,7 +734,7 @@
         return tex and (tex.type == 'POINT_DENSITY' and (engine in cls.COMPAT_ENGINES))
 
     def draw_header(self, context):
-        pd = tex.point_density
+        pd = context.texture.point_density
 
         self.layout.prop(pd, "use_turbulence", text="")
 

Modified: trunk/blender/source/blender/blenkernel/intern/texture.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/texture.c	2011-03-16 16:31:47 UTC (rev 35577)
+++ trunk/blender/source/blender/blenkernel/intern/texture.c	2011-03-16 18:21:31 UTC (rev 35578)
@@ -1379,7 +1379,10 @@
 		MEM_freeN(pd->point_data);
 		pd->point_data = NULL;
 	}
-	if(pd->coba) MEM_freeN(pd->coba);
+	if(pd->coba) {
+		MEM_freeN(pd->coba);
+		pd->coba = NULL;
+	}
 }
 
 void BKE_free_pointdensity(PointDensity *pd)

Modified: trunk/blender/source/blender/render/intern/source/pointdensity.c
===================================================================
--- trunk/blender/source/blender/render/intern/source/pointdensity.c	2011-03-16 16:31:47 UTC (rev 35577)
+++ trunk/blender/source/blender/render/intern/source/pointdensity.c	2011-03-16 18:21:31 UTC (rev 35578)
@@ -68,10 +68,12 @@
 {
 	int pd_bitflag = 0;
 	
-	if ((pd->noise_influence == TEX_PD_NOISE_VEL) || (pd->color_source == TEX_PD_COLOR_PARTVEL) || (pd->color_source == TEX_PD_COLOR_PARTSPEED))
-		pd_bitflag |= POINT_DATA_VEL;
-	if ((pd->noise_influence == TEX_PD_NOISE_AGE) || (pd->color_source == TEX_PD_COLOR_PARTAGE)) 
-		pd_bitflag |= POINT_DATA_LIFE;
+	if (pd->source == TEX_PD_PSYS) {
+		if ((pd->noise_influence == TEX_PD_NOISE_VEL) || (pd->color_source == TEX_PD_COLOR_PARTVEL) || (pd->color_source == TEX_PD_COLOR_PARTSPEED))
+			pd_bitflag |= POINT_DATA_VEL;
+		if ((pd->noise_influence == TEX_PD_NOISE_AGE) || (pd->color_source == TEX_PD_COLOR_PARTAGE)) 
+			pd_bitflag |= POINT_DATA_LIFE;
+	}
 		
 	return pd_bitflag;
 }




More information about the Bf-blender-cvs mailing list