Fix #20549: selecting a texture node in a material node tree would

keep that texture locked as the current visible texture in the
texture buttons.
This commit is contained in:
Brecht Van Lommel
2010-01-29 16:32:06 +00:00
parent e803c03308
commit 812e5140b0
6 changed files with 46 additions and 13 deletions

View File

@@ -87,14 +87,13 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
def draw(self, context):
layout = self.layout
slot = context.texture_slot
node = context.texture_node
space = context.space_data
tex = context.texture
wide_ui = context.region.width > narrowui
idblock = context_tex_datablock(context)
tex_collection = space.pin_id == None and type(idblock) != bpy.types.Brush
tex_collection = space.pin_id == None and type(idblock) != bpy.types.Brush and not node
if tex_collection:
row = layout.row()
@@ -113,6 +112,8 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
if tex_collection:
col.template_ID(idblock, "active_texture", new="texture.new")
elif node:
col.template_ID(node, "texture", new="texture.new")
elif idblock:
col.template_ID(idblock, "texture", new="texture.new")
@@ -129,7 +130,6 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel):
split = layout.split(percentage=0.2)
if tex.use_nodes:
slot = context.texture_slot
if slot:
split.label(text="Output:")