diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2012-06-21 11:32:06 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2012-06-21 11:32:06 +0400 |
commit | 19e81b12e774d800cff8e5de7b450f65d108a451 (patch) | |
tree | feee459e14da596fdbbb115aff332ac4b5f18579 | |
parent | 27aa2174b7544e97eae2a27e871609e74e0a5107 (diff) |
Fix [#31714] Pinning object context causes texture list to disappear
Problem was py code of main texture panel was not doing any check on the pinned id, assuming it managed the textures itself - but this is not the case of the Object datablock...
All work actually done by Sergey, was just missing the Lamp specific case. Checked both in code and with tests, quite sure all cases are now correctly handled!
-rw-r--r-- | release/scripts/startup/bl_ui/properties_texture.py | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py index 1d5e96cf701..5bde9538e54 100644 --- a/release/scripts/startup/bl_ui/properties_texture.py +++ b/release/scripts/startup/bl_ui/properties_texture.py @@ -23,6 +23,7 @@ from bpy.types import Menu, Panel from bpy.types import (Brush, Lamp, Material, + Object, ParticleSettings, Texture, World) @@ -80,6 +81,15 @@ def context_tex_datablock(context): return idblock +def id_tex_datablock(bid): + if isinstance(bid, Object): + if bid.type == 'LAMP': + return bid.data + return bid.active_material + + return bid + + class TextureButtonsPanel(): bl_space_type = 'PROPERTIES' bl_region_type = 'WINDOW' @@ -114,7 +124,7 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, Panel): pin_id = space.pin_id if space.use_pin_id and not isinstance(pin_id, Texture): - idblock = pin_id + idblock = id_tex_datablock(pin_id) pin_id = None if not space.use_pin_id: |