Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVuk Gardašević <lijenstina>2018-07-17 13:17:42 +0300
committerPablo Vazquez <venomgfx@gmail.com>2018-07-17 13:17:42 +0300
commit84d4037363b325a279ef87b6b1c430be29984357 (patch)
treebf855b6c0f0bf0d66e0fc3e6c9a0d27641c2e10a /release/scripts/startup/bl_ui
parent273482749ef7e937de8a1a2c886576a9418c7f0e (diff)
UI: Single-column and flow layout for Scene properties
See D3532
Diffstat (limited to 'release/scripts/startup/bl_ui')
-rw-r--r--release/scripts/startup/bl_ui/properties_physics_common.py87
-rw-r--r--release/scripts/startup/bl_ui/properties_scene.py185
2 files changed, 186 insertions, 86 deletions
diff --git a/release/scripts/startup/bl_ui/properties_physics_common.py b/release/scripts/startup/bl_ui/properties_physics_common.py
index e071de0108b..c9bde32c53d 100644
--- a/release/scripts/startup/bl_ui/properties_physics_common.py
+++ b/release/scripts/startup/bl_ui/properties_physics_common.py
@@ -97,7 +97,7 @@ class PHYSICS_PT_add(PhysicButtonsPanel, Panel):
'CONSTRAINT') # RB_TODO needs better icon
-# cache-type can be 'PSYS' 'HAIR' 'SMOKE' etc
+# cache-type can be 'PSYS' 'HAIR' 'SMOKE' etc.
def point_cache_ui(self, context, cache, enabled, cachetype):
layout = self.layout
@@ -112,8 +112,8 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
col.operator("ptcache.add", icon='ZOOMIN', text="")
col.operator("ptcache.remove", icon='ZOOMOUT', text="")
- row = layout.row()
if cachetype in {'PSYS', 'HAIR', 'SMOKE'}:
+ row = layout.row()
row.prop(cache, "use_external")
if cachetype == 'SMOKE':
@@ -131,7 +131,9 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
cache_info = cache.info
if cache_info:
- layout.label(text=cache_info)
+ col = layout.column()
+ col.alignment = "RIGHT"
+ col.label(text=cache_info)
else:
if cachetype in {'SMOKE', 'DYNAMIC_PAINT'}:
if not bpy.data.is_saved:
@@ -147,45 +149,54 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
col.enabled = enabled
col.prop(cache, "frame_start", text="Simulation Start")
col.prop(cache, "frame_end")
+
if cachetype not in {'SMOKE', 'CLOTH', 'DYNAMIC_PAINT', 'RIGID_BODY'}:
col.prop(cache, "frame_step")
- if cachetype != 'SMOKE':
- layout.label(text=cache.info)
+ cache_info = cache.info
+ if cachetype != 'SMOKE' and cache_info: # avoid empty space.
+ col = layout.column(align=True)
+ col.alignment = "RIGHT"
+ col.label(text=cache_info)
can_bake = True
if cachetype not in {'SMOKE', 'DYNAMIC_PAINT', 'RIGID_BODY'}:
- split = layout.split()
- split.enabled = enabled and bpy.data.is_saved
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
+ flow.enabled = enabled and bpy.data.is_saved
- col = split.column()
- col.prop(cache, "use_disk_cache")
+ flow.use_property_split = True
- col = split.column()
- col.active = cache.use_disk_cache
- col.prop(cache, "use_library_path", "Use Lib Path")
+ # NOTE: TODO temporarly used until the animate properties are properly skipped.
+ flow.use_property_decorate = False # No animation (remove this later on)
- row = layout.row()
- row.enabled = enabled and bpy.data.is_saved
- row.active = cache.use_disk_cache
- row.label(text="Compression:")
- row.prop(cache, "compression", expand=True)
+ col = flow.column()
+ col.prop(cache, "use_disk_cache")
- layout.separator()
+ subcol = col.column()
+ subcol.active = cache.use_disk_cache
+ subcol.prop(cache, "use_library_path", "Use Lib Path")
+
+ col = flow.column()
+ col.enabled = enabled and bpy.data.is_saved
+ col.active = cache.use_disk_cache
+ col.prop(cache, "compression", text="Compression", expand=True)
if cache.id_data.library and not cache.use_disk_cache:
can_bake = False
col = layout.column(align=True)
- col.label(text="Linked object baking requires Disk Cache to be enabled", icon='INFO')
+ col.alignment = "RIGHT"
+
+ col.separator()
+
+ col.label(text="Linked object baking requires Disk Cache to be enabled")
else:
layout.separator()
- split = layout.split()
- split.active = can_bake
-
- col = split.column()
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
+ col = flow.column()
+ col.active = can_bake
if cache.is_baked is True:
col.operator("ptcache.free_bake", text="Free Bake")
@@ -200,7 +211,7 @@ def point_cache_ui(self, context, cache, enabled, cachetype):
sub.enabled = enabled
sub.operator("ptcache.bake_from_cache", text="Current Cache to Bake")
- col = split.column()
+ col = flow.column()
col.operator("ptcache.bake_all", text="Bake All Dynamics").bake = True
col.operator("ptcache.free_bake_all", text="Free All Bakes")
col.operator("ptcache.bake_all", text="Update All To Frame").bake = False
@@ -212,31 +223,31 @@ def effector_weights_ui(self, context, weights, weight_type):
layout.prop(weights, "group")
- layout.use_property_split = False
-
- split = layout.split()
-
- split.prop(weights, "gravity", slider=True)
- split.prop(weights, "all", slider=True)
+ # NOTE: TODO temporarly used until the animate properties are properly skipped
+ layout.use_property_decorate = False # No animation (remove this later on)
- layout.separator()
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
- split = layout.split()
-
- col = split.column()
+ col = flow.column()
+ col.prop(weights, "gravity", slider=True)
+ col.prop(weights, "all", slider=True)
col.prop(weights, "force", slider=True)
col.prop(weights, "vortex", slider=True)
+
+ col = flow.column()
col.prop(weights, "magnetic", slider=True)
+ col.prop(weights, "harmonic", slider=True)
+ col.prop(weights, "charge", slider=True)
+ col.prop(weights, "lennardjones", slider=True)
+
+ col = flow.column()
col.prop(weights, "wind", slider=True)
col.prop(weights, "curve_guide", slider=True)
col.prop(weights, "texture", slider=True)
if weight_type != 'SMOKE':
col.prop(weights, "smokeflow", slider=True)
- col = split.column()
- col.prop(weights, "harmonic", slider=True)
- col.prop(weights, "charge", slider=True)
- col.prop(weights, "lennardjones", slider=True)
+ col = flow.column()
col.prop(weights, "turbulence", slider=True)
col.prop(weights, "drag", slider=True)
col.prop(weights, "boid", slider=True)
diff --git a/release/scripts/startup/bl_ui/properties_scene.py b/release/scripts/startup/bl_ui/properties_scene.py
index d0fce0a2582..c0b8233a796 100644
--- a/release/scripts/startup/bl_ui/properties_scene.py
+++ b/release/scripts/startup/bl_ui/properties_scene.py
@@ -17,9 +17,9 @@
# ##### END GPL LICENSE BLOCK #####
# <pep8 compliant>
+
import bpy
from bpy.types import (
- Menu,
Panel,
UIList,
)
@@ -71,6 +71,7 @@ class SCENE_PT_scene(SceneButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
+
scene = context.scene
layout.prop(scene, "camera")
@@ -92,13 +93,13 @@ class SCENE_PT_unit(SceneButtonsPanel, Panel):
layout.use_property_split = True
- col = layout.column()
- col.prop(unit, "system")
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
- col = layout.column()
+ col = flow.column()
+ col.prop(unit, "system")
col.prop(unit, "system_rotation")
- col = layout.column()
+ col = flow.column()
col.enabled = unit.system != 'NONE'
col.prop(unit, "scale_length")
col.prop(unit, "use_separate")
@@ -147,15 +148,17 @@ class SceneKeyingSetsPanel:
propname = prop
row = layout.row(align=True)
- row.prop(item, toggle_prop, text="", icon='STYLUS_PRESSURE', toggle=True) # XXX: needs dedicated icon
- subrow = row.row()
+ subrow = row.row(align=True)
subrow.active = getattr(item, toggle_prop)
+
if subrow.active:
subrow.prop(item, prop, text=label)
else:
subrow.prop(owner, propname, text=label)
+ row.prop(item, toggle_prop, text="", icon='STYLUS_PRESSURE', toggle=True) # XXX: needs dedicated icon
+
class SCENE_PT_keying_sets(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
bl_label = "Keying Sets"
@@ -166,6 +169,7 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
layout = self.layout
scene = context.scene
+
row = layout.row()
col = row.column()
@@ -175,20 +179,56 @@ class SCENE_PT_keying_sets(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
col.operator("anim.keying_set_add", icon='ZOOMIN', text="")
col.operator("anim.keying_set_remove", icon='ZOOMOUT', text="")
+ layout.use_property_split = True
+ layout.use_property_decorate = False # No animation.
+
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=False, even_rows=False, align=False)
+
ks = scene.keying_sets.active
if ks and ks.is_path_absolute:
- row = layout.row()
-
- col = row.column()
+ col = flow.column()
col.prop(ks, "bl_description")
- subcol = col.column()
+ subcol = flow.column()
subcol.operator_context = 'INVOKE_DEFAULT'
subcol.operator("anim.keying_set_export", text="Export to File").filepath = "keyingset.py"
- col = row.column()
- col.label(text="Keyframing Settings:")
- self.draw_keyframing_settings(context, col, ks, None)
+
+class SCENE_PT_keyframing_settings(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
+ bl_label = "Keyframing Settings"
+ bl_parent_id = "SCENE_PT_keying_sets"
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
+
+ @classmethod
+ def poll(cls, context):
+ ks = context.scene.keying_sets.active
+ return (ks and ks.is_path_absolute)
+
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_split = True
+ layout.use_property_decorate = False # No animation.
+
+ scene = context.scene
+ ks = scene.keying_sets.active
+
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
+
+ col = flow.column(align=True)
+ col.alignment = "RIGHT"
+ col.label(text="General Override")
+
+ self.draw_keyframing_settings(context, col, ks, None)
+
+ ksp = ks.paths.active
+ if ksp:
+ col.separator()
+
+ col = flow.column(align=True)
+ col.alignment = "RIGHT"
+ col.label(text="Active Set Override")
+
+ self.draw_keyframing_settings(context, col, ks, ksp)
class SCENE_PT_keying_set_paths(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
@@ -219,34 +259,40 @@ class SCENE_PT_keying_set_paths(SceneButtonsPanel, SceneKeyingSetsPanel, Panel):
col.operator("anim.keying_set_path_add", icon='ZOOMIN', text="")
col.operator("anim.keying_set_path_remove", icon='ZOOMOUT', text="")
+ # TODO: 1) the template_any_ID needs to be fixed for the text alignment.
+ # 2) use_property_decorate has to properly skip the non animatable properties.
+ # Properties affected with needless draw:
+ # group_method, template_any_ID dropdown, use_entire_array
+
+ layout.use_property_split = True
+ layout.use_property_decorate = False # No animation (remove this later on).
+
+ flow = layout.grid_flow(row_major=False, columns=0, even_columns=False, even_rows=False, align=True)
+
ksp = ks.paths.active
if ksp:
- col = layout.column()
- col.label(text="Target:")
- col.template_any_ID(ksp, "id", "id_type")
- col.template_path_builder(ksp, "data_path", ksp.id)
-
- row = col.row(align=True)
- row.label(text="Array Target:")
- row.prop(ksp, "use_entire_array", text="All Items")
- if ksp.use_entire_array:
- row.label(text=" ") # padding
- else:
- row.prop(ksp, "array_index", text="Index")
+ col = flow.column(align=True)
+ col.alignment = "RIGHT"
+
+ col.template_any_ID(ksp, "id", "id_type", text="Target ID-Block")
+
+ col.separator()
- layout.separator()
+ col.template_path_builder(ksp, "data_path", ksp.id, text="Data Path")
- row = layout.row()
- col = row.column()
- col.label(text="F-Curve Grouping:")
- col.prop(ksp, "group_method", text="")
+ col = flow.column()
+
+ col.prop(ksp, "use_entire_array", text="Array All Items")
+
+ if not ksp.use_entire_array:
+ col.prop(ksp, "array_index", text="Index")
+
+ col.separator()
+
+ col.prop(ksp, "group_method", text="F-Curve Grouping")
if ksp.group_method == 'NAMED':
col.prop(ksp, "group")
- col = row.column()
- col.label(text="Keyframing Settings:")
- self.draw_keyframing_settings(context, col, ks, ksp)
-
class SCENE_PT_color_management(SceneButtonsPanel, Panel):
bl_label = "Color Management"
@@ -260,16 +306,19 @@ class SCENE_PT_color_management(SceneButtonsPanel, Panel):
scene = context.scene
view = scene.view_settings
- col = layout.column()
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
+
+ col = flow.column()
col.prop(scene.display_settings, "display_device")
col.separator()
- col = layout.column()
col.prop(view, "view_transform")
+ col.prop(view, "look")
+
+ col = flow.column()
col.prop(view, "exposure")
col.prop(view, "gamma")
- col.prop(view, "look")
col.separator()
@@ -314,21 +363,28 @@ class SCENE_PT_audio(SceneButtonsPanel, Panel):
rd = context.scene.render
ffmpeg = rd.ffmpeg
- layout.prop(scene, "audio_volume")
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
- col = layout.column()
- col.prop(scene, "audio_distance_model")
+ col = flow.column()
+ col.prop(scene, "audio_volume")
+ col.separator()
+
+ col.prop(scene, "audio_distance_model")
col.prop(ffmpeg, "audio_channels")
+
+ col.separator()
+
+ col = flow.column()
col.prop(ffmpeg, "audio_mixrate", text="Sample Rate")
- layout.separator()
+ col.separator()
- col = layout.column(align=True)
+ col = col.column(align=True)
col.prop(scene, "audio_doppler_speed", text="Doppler Speed")
col.prop(scene, "audio_doppler_factor", text="Doppler Factor")
- layout.separator()
+ col.separator()
layout.operator("sound.bake_animation")
@@ -372,7 +428,6 @@ class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel):
layout.use_property_split = True
scene = context.scene
-
rbw = scene.rigidbody_world
if rbw is None:
@@ -380,7 +435,28 @@ class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel):
else:
layout.operator("rigidbody.world_remove")
- col = layout.column()
+
+class SCENE_PT_rigid_body_world_settings(SceneButtonsPanel, Panel):
+ bl_label = "Settings"
+ bl_parent_id = "SCENE_PT_rigid_body_world"
+ COMPAT_ENGINES = {'BLENDER_RENDER', 'BLENDER_EEVEE'}
+
+ @classmethod
+ def poll(cls, context):
+ scene = context.scene
+ return scene and scene.rigidbody_world and (context.engine in cls.COMPAT_ENGINES)
+
+ def draw(self, context):
+ layout = self.layout
+ layout.use_property_split = True
+
+ scene = context.scene
+ rbw = scene.rigidbody_world
+
+ if rbw:
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=True)
+
+ col = flow.column()
col.active = rbw.enabled
col = col.column()
@@ -389,6 +465,9 @@ class SCENE_PT_rigid_body_world(SceneButtonsPanel, Panel):
col = col.column()
col.prop(rbw, "time_scale", text="Speed")
+
+ col = flow.column()
+ col.active = rbw.enabled
col.prop(rbw, "use_split_impulse")
col = col.column()
@@ -458,8 +537,12 @@ class SCENE_PT_simplify_viewport(SceneButtonsPanel, Panel):
layout.active = rd.use_simplify
- col = layout.column()
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
+
+ col = flow.column()
col.prop(rd, "simplify_subdivision", text="Max Subdivision")
+
+ col = flow.column()
col.prop(rd, "simplify_child_particles", text="Max Child Particles")
@@ -476,8 +559,12 @@ class SCENE_PT_simplify_render(SceneButtonsPanel, Panel):
layout.active = rd.use_simplify
- col = layout.column()
+ flow = layout.grid_flow(row_major=True, columns=0, even_columns=False, even_rows=False, align=True)
+
+ col = flow.column()
col.prop(rd, "simplify_subdivision_render", text="Max Subdivision")
+
+ col = flow.column()
col.prop(rd, "simplify_child_particles_render", text="Max Child Particles")
@@ -494,11 +581,13 @@ classes = (
SCENE_PT_unit,
SCENE_PT_keying_sets,
SCENE_PT_keying_set_paths,
+ SCENE_PT_keyframing_settings,
SCENE_PT_color_management,
SCENE_PT_color_management_curves,
SCENE_PT_audio,
SCENE_PT_physics,
SCENE_PT_rigid_body_world,
+ SCENE_PT_rigid_body_world_settings,
SCENE_PT_rigid_body_cache,
SCENE_PT_rigid_body_field_weights,
SCENE_PT_simplify,