[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [34897] trunk/blender/release/scripts/ui/ properties_texture.py: Correct texture pinning:

Janne Karhu jhkarh at gmail.com
Wed Feb 16 11:22:20 CET 2011


Revision: 34897
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=34897
Author:   jhk
Date:     2011-02-16 10:22:19 +0000 (Wed, 16 Feb 2011)
Log Message:
-----------
Correct texture pinning:
* Now texture pinning works consistently for all textures.
* The only problem is that there is no way to pin textures if there are
  no textures in the context path, so it's for example impossible to pin
  the texture of a displace modifier without adding a texture somewhere
  else and selecting that texture first. I my opinion this is quite
  counter productive so perhaps a dedicated "only textures" texture
  context option is needed after all.

Modified Paths:
--------------
    trunk/blender/release/scripts/ui/properties_texture.py

Modified: trunk/blender/release/scripts/ui/properties_texture.py
===================================================================
--- trunk/blender/release/scripts/ui/properties_texture.py	2011-02-16 10:19:14 UTC (rev 34896)
+++ trunk/blender/release/scripts/ui/properties_texture.py	2011-02-16 10:22:19 UTC (rev 34897)
@@ -90,7 +90,7 @@
         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 or context.particle_system)
+        return ((context.material or context.world or context.lamp or context.brush or context.texture or context.particle_system or isinstance(context.space_data.pin_id, bpy.types.ParticleSettings))
             and (engine in cls.COMPAT_ENGINES))
 
     def draw(self, context):
@@ -102,13 +102,14 @@
         idblock = context_tex_datablock(context)
         pin_id = space.pin_id
 
-        if not isinstance(pin_id, bpy.types.Material):
+        if space.use_pin_id and not isinstance(pin_id, bpy.types.Texture):
+            idblock = pin_id
             pin_id = None
 
         if not space.use_pin_id:
             layout.prop(space, "texture_context", expand=True)
 
-        tex_collection = (not space.use_pin_id) and (node is None) and (not isinstance(idblock, bpy.types.Brush))
+        tex_collection = (pin_id is None) and (node is None) and (not isinstance(idblock, bpy.types.Brush))
 
         if tex_collection:
             row = layout.row()




More information about the Bf-blender-cvs mailing list