Particles todo item: particle textures
[blender-staging.git] / release / scripts / ui / properties_texture.py
index 05e130fac2d3ec4bbd9521a003f78c15210500cd..ac3fc2d0b1daef9dcc8e6911b1bd07c47c82659b 100644 (file)
@@ -60,6 +60,12 @@ def context_tex_datablock(context):
         return idblock
 
     idblock = context.brush
+    if idblock:
+        return idblock
+    
+    if context.particle_system:
+        idblock = context.particle_system.settings
+        
     return idblock
 
 
@@ -84,7 +90,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
         engine = context.scene.render.engine
         if not hasattr(context, "texture_slot"):
             return False
-        return ((context.material or context.world or context.lamp or context.brush or context.texture)
+        return ((context.material or context.world or context.lamp or context.brush or context.texture or context.particle_system)
             and (engine in cls.COMPAT_ENGINES))
 
     def draw(self, context):
@@ -983,20 +989,49 @@ class TEXTURE_PT_influence(TextureSlotPanel, bpy.types.Panel):
             col = split.column()
             factor_but(col, "use_map_zenith_up", "zenith_up_factor", "Zenith Up")
             factor_but(col, "use_map_zenith_down", "zenith_down_factor", "Zenith Down")
+        elif isinstance(idblock, bpy.types.ParticleSettings):
+            split = layout.split()
+            
+            col = split.column()
+            col.label(text="General:")
+            factor_but(col, "use_map_time", "time_factor", "Time")
+            factor_but(col, "use_map_life", "life_factor", "Lifetime")
+            factor_but(col, "use_map_density", "density_factor", "Density")
+            factor_but(col, "use_map_size", "size_factor", "Size")
 
-        layout.separator()
+            col = split.column()
+            col.label(text="Physics:")
+            factor_but(col, "use_map_velocity", "velocity_factor", "Velocity")
+            factor_but(col, "use_map_damp", "damp_factor", "Damp")
+            factor_but(col, "use_map_gravity", "gravity_factor", "Gravity")
+            factor_but(col, "use_map_field", "field_factor", "Force Fields")
+            
+            layout.label(text="Hair:")
+            
+            split = layout.split()
+            
+            col = split.column()
+            factor_but(col, "use_map_length", "length_factor", "Length")
+            factor_but(col, "use_map_clump", "clump_factor", "Clump")
+            
+            col = split.column()
+            factor_but(col, "use_map_kink", "kink_factor", "Kink")
+            factor_but(col, "use_map_rough", "rough_factor", "Rough")
 
-        split = layout.split()
+        layout.separator()
+        
+        if not isinstance(idblock, bpy.types.ParticleSettings):
+            split = layout.split()
 
-        col = split.column()
-        col.prop(tex, "blend_type", text="Blend")
-        col.prop(tex, "use_rgb_to_intensity")
-        # color is used on grayscale textures even when use_rgb_to_intensity is disabled.
-        col.prop(tex, "color", text="")
+            col = split.column()
+            col.prop(tex, "blend_type", text="Blend")
+            col.prop(tex, "use_rgb_to_intensity")
+            # color is used on grayscale textures even when use_rgb_to_intensity is disabled.
+            col.prop(tex, "color", text="")
 
-        col = split.column()
-        col.prop(tex, "invert", text="Negative")
-        col.prop(tex, "use_stencil")
+            col = split.column()
+            col.prop(tex, "invert", text="Negative")
+            col.prop(tex, "use_stencil")
 
         if isinstance(idblock, bpy.types.Material) or isinstance(idblock, bpy.types.World):
             col.prop(tex, "default_value", text="DVar", slider=True)