[Bf-blender-cvs] [4183e62d1b4] blender2.8: UI: Texture Properties Layout and Cleanup
Vuk GardaÅ¡eviÄ
noreply at git.blender.org
Wed Jul 25 14:01:34 CEST 2018
Commit: 4183e62d1b4c39fe6f4ef75951b066249147e01a
Author: Vuk Gardašević
Date: Wed Jul 25 14:01:01 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB4183e62d1b4c39fe6f4ef75951b066249147e01a
UI: Texture Properties Layout and Cleanup
Initial work on single column layout, flow and organization of
the texture properties. More work needs to be done in the C templates
for image textures.
See D3557
===================================================================
M release/scripts/startup/bl_ui/properties_texture.py
===================================================================
diff --git a/release/scripts/startup/bl_ui/properties_texture.py b/release/scripts/startup/bl_ui/properties_texture.py
index d937f2470b8..a4f6f753669 100644
--- a/release/scripts/startup/bl_ui/properties_texture.py
+++ b/release/scripts/startup/bl_ui/properties_texture.py
@@ -17,19 +17,21 @@
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
-import bpy
-from bpy.types import Menu, Panel, UIList
+import bpy
+from bpy.types import (
+ Menu,
+ Panel,
+ UIList,
+)
from bpy.types import (
Brush,
FreestyleLineStyle,
- Object,
ParticleSettings,
Texture,
)
from rna_prop_ui import PropertyPanel
-
from .properties_paint_common import brush_texture_settings
@@ -47,9 +49,9 @@ class TEXTURE_MT_specials(Menu):
class TEXTURE_UL_texslots(UIList):
def draw_item(self, context, layout, data, item, icon, active_data, active_propname, index):
- ma = data
slot = item
tex = slot.texture if slot else None
+
if self.layout_type in {'DEFAULT', 'COMPACT'}:
if tex:
layout.prop(tex, "name", text="", emboss=False, icon_value=icon)
@@ -131,18 +133,18 @@ class TEXTURE_PT_context(TextureButtonsPanel, Panel):
if not pin_id:
col.template_texture_user()
- col.separator()
-
if user or pin_id:
+ col.separator()
+
if pin_id:
col.template_ID(space, "pin_id")
else:
propname = context.texture_user_property.identifier
col.template_ID(user, propname, new="texture.new")
- col.separator()
-
if tex:
+ col.separator()
+
split = col.split(percentage=0.2)
split.label(text="Type")
split.prop(tex, "type", text="")
@@ -179,25 +181,35 @@ class TEXTURE_PT_node_mapping(TextureButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
+ layout.use_property_split = True
+ layout.use_property_decorate = False # No animation.
+
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
node = context.texture_node
mapping = node.texture_mapping
- layout.prop(mapping, "vector_type", expand=True)
+ col = flow.column()
+ col.prop(mapping, "vector_type")
+
+ col.separator()
+
+ col = col.column(align=True)
+ col.prop(mapping, "mapping_x", text="Projection X")
+ col.prop(mapping, "mapping_y", text="Y")
+ col.prop(mapping, "mapping_z", text="Z")
- row = layout.row()
+ col.separator()
- row.column().prop(mapping, "translation")
- row.column().prop(mapping, "rotation")
- row.column().prop(mapping, "scale")
+ col = flow.column()
+ col.column().prop(mapping, "translation")
- layout.label(text="Projection:")
+ col = flow.column()
+ col.column().prop(mapping, "rotation")
- row = layout.row()
- row.prop(mapping, "mapping_x", text="")
- row.prop(mapping, "mapping_y", text="")
- row.prop(mapping, "mapping_z", text="")
+ col = flow.column()
+ col.column().prop(mapping, "scale")
class TextureTypePanel(TextureButtonsPanel):
@@ -216,21 +228,29 @@ class TEXTURE_PT_clouds(TextureTypePanel, Panel):
def draw(self, context):
layout = self.layout
+ layout.use_property_split = True
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
tex = context.texture
- layout.row().prop(tex, "cloud_type", expand=True)
- layout.label(text="Noise:")
- layout.row().prop(tex, "noise_type", text="Type", expand=True)
- layout.prop(tex, "noise_basis", text="Basis")
+ col = flow.column()
+ col.prop(tex, "noise_basis", text="Noise Basis")
+
+ col.separator()
+
+ col.prop(tex, "noise_type", text="Type")
+
+ col.separator()
- split = layout.split()
+ col = flow.column()
+ col.prop(tex, "cloud_type")
- col = split.column()
+ col.separator()
+
+ col = flow.column()
col.prop(tex, "noise_scale", text="Size")
col.prop(tex, "noise_depth", text="Depth")
-
- split.prop(tex, "nabla", text="Nabla")
+ col.prop(tex, "nabla", text="Nabla")
class TEXTURE_PT_wood(TextureTypePanel, Panel):
@@ -240,26 +260,34 @@ class TEXTURE_PT_wood(TextureTypePanel, Panel):
def draw(self, context):
layout = self.layout
+ layout.use_property_split = True
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=False)
tex = context.texture
- layout.row().prop(tex, "noise_basis_2", expand=True)
- layout.row().prop(tex, "wood_type", expand=True)
+ col = flow.column()
+ col.prop(tex, "noise_basis", text="Noise Basis")
- col = layout.column()
- col.active = tex.wood_type in {'RINGNOISE', 'BANDNOISE'}
- col.label(text="Noise:")
- col.row().prop(tex, "noise_type", text="Type", expand=True)
- layout.prop(tex, "noise_basis", text="Basis")
+ col.separator()
- split = layout.split()
- split.active = tex.wood_type in {'RINGNOISE', 'BANDNOISE'}
+ col.prop(tex, "wood_type")
- col = split.column()
- col.prop(tex, "noise_scale", text="Size")
- col.prop(tex, "turbulence")
+ col.separator()
- split.prop(tex, "nabla")
+ col = flow.column()
+ col.prop(tex, "noise_basis_2", text="Second Basis")
+
+ col = col.column()
+ col.active = tex.wood_type in {'RINGNOISE', 'BANDNOISE'}
+ col.prop(tex, "noise_type", text="Type")
+
+ col.separator()
+
+ sub = flow.column()
+ sub.active = tex.wood_type in {'RINGNOISE', 'BANDNOISE'}
+ sub.prop(tex, "noise_scale", text="Size")
+ sub.prop(tex, "turbulence")
+ sub.prop(tex, "nabla")
class TEXTURE_PT_marble(TextureTypePanel, Panel):
@@ -269,22 +297,29 @@ class TEXTURE_PT_marble(TextureTypePanel, Panel):
def draw(self, context):
layout = self.layout
+ layout.use_property_split = True
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
tex = context.texture
- layout.row().prop(tex, "marble_type", expand=True)
- layout.row().prop(tex, "noise_basis_2", expand=True)
- layout.label(text="Noise:")
- layout.row().prop(tex, "noise_type", text="Type", expand=True)
- layout.prop(tex, "noise_basis", text="Basis")
+ col = flow.column()
+ col.prop(tex, "noise_basis", text="Noise Basis")
+
+ col.separator()
+
+ col.prop(tex, "marble_type")
- split = layout.split()
+ col.separator()
- col = split.column()
+ col = flow.column()
+ col.prop(tex, "noise_basis_2", text="Second Basis")
+ col.prop(tex, "noise_type", text="Type")
+
+ col.separator()
+
+ col = flow.column()
col.prop(tex, "noise_scale", text="Size")
col.prop(tex, "noise_depth", text="Depth")
-
- col = split.column()
col.prop(tex, "turbulence")
col.prop(tex, "nabla")
@@ -296,12 +331,16 @@ class TEXTURE_PT_magic(TextureTypePanel, Panel):
def draw(self, context):
layout = self.layout
+ layout.use_property_split = True
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
tex = context.texture
- row = layout.row()
- row.prop(tex, "noise_depth", text="Depth")
- row.prop(tex, "turbulence")
+ col = flow.column()
+ col.prop(tex, "noise_depth", text="Depth")
+
+ col = flow.column()
+ col.prop(tex, "turbulence")
class TEXTURE_PT_blend(TextureTypePanel, Panel):
@@ -311,15 +350,19 @@ class TEXTURE_PT_blend(TextureTypePanel, Panel):
def draw(self, context):
layout = self.layout
+ layout.use_property_split = True
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
tex = context.texture
- layout.prop(tex, "progression")
+ col = flow.column()
+ col.prop(tex, "progression")
- sub = layout.row()
+ col.separator()
- sub.active = (tex.progression in {'LINEAR', 'QUADRATIC', 'EASING', 'RADIAL'})
- sub.prop(tex, "use_flip_axis", expand=True)
+ col = flow.column()
+ col.active = (tex.progression in {'LINEAR', 'QUADRATIC', 'EASING', 'RADIAL'})
+ col.prop(tex, "use_flip_axis", text="Orientation")
class TEXTURE_PT_stucci(TextureTypePanel, Panel):
@@ -329,17 +372,28 @@ class TEXTURE_PT_stucci(TextureTypePanel, Panel):
def draw(self, context):
layout = self.layout
+ layout.use_property_split = True
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
tex = context.texture
- layout.row().prop(tex, "stucci_type", expand=True)
- layout.label(text="Noise:")
- layout.row().prop(tex, "noise_type", text="Type", expand=True)
- layout.prop(tex, "noise_basis", text="Basis")
+ col = flow.column()
+ col.prop(tex, "noise_basis", text="Noise Basis")
+
+ col.separator()
- row = layout.row()
- row.prop(tex, "noise_scale", text="Size")
- row.prop(tex, "turbulence")
+ col.row().prop(tex, "stucci_type")
+
+ col.separator()
+
+ col = flow.column()
+ col.prop(tex, "noise_type", text="Type")
+
+ col.separator()
+
+ col = flow.column()
+ col.prop(tex, "noise_scale", text="Size")
+ col.prop(tex, "turbulence")
class TEXTURE_PT_image(TextureTypePanel, Panel):
@@ -347,6 +401,18 @@ class TEXTURE_PT_image(TextureTypePanel, Panel):
tex_type = 'IMAGE'
COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE', 'BLENDER_OPENGL'}
+ def draw(self, c
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list