forked from bartvdbraak/blender
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!
This commit is contained in:
parent
27aa2174b7
commit
19e81b12e7
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user