forked from bartvdbraak/blender
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.
This commit is contained in:
parent
430bb75749
commit
e6879c7646
@ -90,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 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 @@ class TEXTURE_PT_context_texture(TextureButtonsPanel, bpy.types.Panel):
|
||||
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()
|
||||
|
Loading…
Reference in New Issue
Block a user