Fix #136359: Add data-block selector to handle missing texture better

Instead of only showing a button to switch to the texture properties -
which don't actually allow creating a texture for linestyle - add a
data-block selector that allows creating a texture for linestyle. It
will also show a button to switch to the texture properties, if
available.

It seems like the previous UI didn't have any good way of assigning a
texture for linestyle, without going into the texture node editor.

Pull Request: https://projects.blender.org/blender/blender/pulls/141408
This commit is contained in:
Julian Eisel
2025-07-07 18:31:35 +02:00
committed by Julian Eisel
parent a7f6d80395
commit 72a484b503

View File

@@ -1247,12 +1247,11 @@ class VIEWLAYER_PT_freestyle_linestyle_texture(ViewLayerFreestyleLineStyle, Pane
layout.prop(linestyle, "texture_spacing", text="Spacing Along Stroke")
row = layout.row()
props = row.operator(
"wm.properties_context_change",
text="Go to Linestyle Textures Properties",
icon='TEXTURE',
)
props.context = 'TEXTURE'
if linestyle.active_texture:
slot = linestyle.texture_slots[linestyle.active_texture_index]
layout.template_ID(slot, "texture", new="texture.new")
else:
layout.template_ID(linestyle, "active_texture", new="texture.new")
class VIEWLAYER_PT_freestyle_animation(ViewLayerFreestyleButtonsPanel, PropertiesAnimationMixin, Panel):