[Bf-blender-cvs] [d3a72033f68] blender2.8: RNA: UILayout.split(..) 'percentage' to 'factor'
Campbell Barton
noreply at git.blender.org
Tue Aug 28 04:44:51 CEST 2018
Commit: d3a72033f6804f2803502c133c40d5aa3891b4f9
Author: Campbell Barton
Date: Tue Aug 28 12:38:54 2018 +1000
Branches: blender2.8
https://developer.blender.org/rBd3a72033f6804f2803502c133c40d5aa3891b4f9
RNA: UILayout.split(..) 'percentage' to 'factor'
Misleading name since it's between 0..1.
Use as a keyword argument to prepare for keyword only args.
Also document that leaving unset has special behavior.
===================================================================
M intern/cycles/blender/addon/ui.py
M release/scripts/modules/bpyml.py
M release/scripts/modules/rna_keymap_ui.py
M release/scripts/modules/rna_prop_ui.py
M release/scripts/startup/bl_ui/properties_constraint.py
M release/scripts/startup/bl_ui/properties_data_curve.py
M release/scripts/startup/bl_ui/properties_data_lattice.py
M release/scripts/startup/bl_ui/properties_data_mesh.py
M release/scripts/startup/bl_ui/properties_data_modifier.py
M release/scripts/startup/bl_ui/properties_data_speaker.py
M release/scripts/startup/bl_ui/properties_grease_pencil_common.py
M release/scripts/startup/bl_ui/properties_particle.py
M release/scripts/startup/bl_ui/properties_render.py
M release/scripts/startup/bl_ui/properties_texture.py
M release/scripts/startup/bl_ui/space_clip.py
M release/scripts/startup/bl_ui/space_image.py
M release/scripts/startup/bl_ui/space_sequencer.py
M release/scripts/startup/bl_ui/space_userpref.py
M release/scripts/startup/bl_ui/space_view3d.py
M release/scripts/startup/bl_ui/space_view3d_toolbar.py
M source/blender/makesrna/intern/rna_ui_api.c
===================================================================
diff --git a/intern/cycles/blender/addon/ui.py b/intern/cycles/blender/addon/ui.py
index d4753455e84..096537331f1 100644
--- a/intern/cycles/blender/addon/ui.py
+++ b/intern/cycles/blender/addon/ui.py
@@ -802,28 +802,28 @@ class CYCLES_RENDER_PT_denoising(CyclesButtonsPanel, Panel):
layout.use_property_split = False
- split = layout.split(percentage=0.5)
+ split = layout.split(factor=0.5)
split.label(text="Diffuse")
col = split.column()
row = col.row(align=True)
row.prop(cycles_view_layer, "denoising_diffuse_direct", text="Direct", toggle=True)
row.prop(cycles_view_layer, "denoising_diffuse_indirect", text="Indirect", toggle=True)
- split = layout.split(percentage=0.5)
+ split = layout.split(factor=0.5)
split.label(text="Glossy")
col = split.column()
row = col.row(align=True)
row.prop(cycles_view_layer, "denoising_glossy_direct", text="Direct", toggle=True)
row.prop(cycles_view_layer, "denoising_glossy_indirect", text="Indirect", toggle=True)
- split = layout.split(percentage=0.5)
+ split = layout.split(factor=0.5)
split.label(text="Transmission")
col = split.column()
row = col.row(align=True)
row.prop(cycles_view_layer, "denoising_transmission_direct", text="Direct", toggle=True)
row.prop(cycles_view_layer, "denoising_transmission_indirect", text="Indirect", toggle=True)
- split = layout.split(percentage=0.5)
+ split = layout.split(factor=0.5)
split.label(text="Subsurface")
col = split.column()
row = col.row(align=True)
@@ -974,7 +974,7 @@ class CYCLES_PT_context_material(CyclesButtonsPanel, Panel):
row.operator("object.material_slot_select", text="Select")
row.operator("object.material_slot_deselect", text="Deselect")
- split = layout.split(percentage=0.65)
+ split = layout.split(factor=0.65)
if ob:
split.template_ID(ob, "active_material", new="material.new")
diff --git a/release/scripts/modules/bpyml.py b/release/scripts/modules/bpyml.py
index 3cdbf848a24..d7f03a3f0c1 100644
--- a/release/scripts/modules/bpyml.py
+++ b/release/scripts/modules/bpyml.py
@@ -182,7 +182,7 @@ if __name__ == "__main__":
prop(data='context.scene.render', property='stamp_font_size', text='Font Size')
]
],
- split(percentage=0.2)[
+ split(factor=0.2)[
prop(data='context.scene.render', property='use_stamp_note', text='Note'),
row()[
active(expr='context.scene.render.use_stamp_note'),
diff --git a/release/scripts/modules/rna_keymap_ui.py b/release/scripts/modules/rna_keymap_ui.py
index e151a81913b..776d2d81d98 100644
--- a/release/scripts/modules/rna_keymap_ui.py
+++ b/release/scripts/modules/rna_keymap_ui.py
@@ -39,7 +39,7 @@ def _indented_layout(layout, level):
level = 0.0001 # Tweak so that a percentage of 0 won't split by half
indent = level * indentpx / bpy.context.region.width
- split = layout.split(percentage=indent)
+ split = layout.split(factor=indent)
col = split.column()
col = split.column()
return col
@@ -103,7 +103,7 @@ def draw_km(display_keymaps, kc, km, children, layout, level):
# "Add New" at end of keymap item list
subcol = _indented_layout(col, kmi_level)
- subcol = subcol.split(percentage=0.2).column()
+ subcol = subcol.split(factor=0.2).column()
subcol.operator("wm.keyitem_add", text="Add New", text_ctxt=i18n_contexts.id_windowmanager,
icon='ZOOMIN')
@@ -167,7 +167,7 @@ def draw_kmi(display_keymaps, kc, km, kmi, layout, level):
if kmi.show_expanded:
box = col.box()
- split = box.split(percentage=0.4)
+ split = box.split(factor=0.4)
sub = split.row()
if km.is_modal:
@@ -349,7 +349,7 @@ def draw_filtered(display_keymaps, filter_type, filter_text, layout):
# "Add New" at end of keymap item list
col = _indented_layout(layout, 1)
- subcol = col.split(percentage=0.2).column()
+ subcol = col.split(factor=0.2).column()
subcol.operator("wm.keyitem_add", text="Add New", icon='ZOOMIN')
return True
@@ -386,7 +386,7 @@ def draw_keymaps(context, layout):
# layout.context_pointer_set("keyconfig", wm.keyconfigs.active)
# row.operator("wm.keyconfig_remove", text="", icon='X')
row.separator()
- rowsub = row.split(align=True, percentage=0.33)
+ rowsub = row.split(factor=0.33, align=True)
# postpone drawing into rowsub, so we can set alert!
col.separator()
diff --git a/release/scripts/modules/rna_prop_ui.py b/release/scripts/modules/rna_prop_ui.py
index a0c73a23454..c987609bafa 100644
--- a/release/scripts/modules/rna_prop_ui.py
+++ b/release/scripts/modules/rna_prop_ui.py
@@ -165,7 +165,7 @@ def draw(layout, context, context_member, property_type, use_edit=True):
box = row.box()
if use_edit:
- split = box.split(percentage=0.75)
+ split = box.split(factor=0.75)
row = split.row(align=True)
else:
row = box.row(align=True)
diff --git a/release/scripts/startup/bl_ui/properties_constraint.py b/release/scripts/startup/bl_ui/properties_constraint.py
index bf61a651bd0..2ed9a7d365e 100644
--- a/release/scripts/startup/bl_ui/properties_constraint.py
+++ b/release/scripts/startup/bl_ui/properties_constraint.py
@@ -42,7 +42,7 @@ class ConstraintButtonsPanel:
def space_template(layout, con, target=True, owner=True):
if target or owner:
- split = layout.split(percentage=0.2)
+ split = layout.split(factor=0.2)
split.label(text="Space:")
row = split.row()
@@ -85,7 +85,7 @@ class ConstraintButtonsPanel:
row.label()
row.prop(con, "pole_angle")
- split = layout.split(percentage=0.33)
+ split = layout.split(factor=0.33)
col = split.column()
col.prop(con, "use_tail")
col.prop(con, "use_stretch")
@@ -183,12 +183,12 @@ class ConstraintButtonsPanel:
row = layout.row()
row.label(text="Axis Ref:")
row.prop(con, "reference_axis", expand=True)
- split = layout.split(percentage=0.33)
+ split = layout.split(factor=0.33)
split.row().prop(con, "use_location")
row = split.row()
row.prop(con, "weight", text="Weight", slider=True)
row.active = con.use_location
- split = layout.split(percentage=0.33)
+ split = layout.split(factor=0.33)
row = split.row()
row.label(text="Lock:")
row = split.row()
@@ -197,12 +197,12 @@ class ConstraintButtonsPanel:
row.prop(con, "lock_location_z", text="Z")
split.active = con.use_location
- split = layout.split(percentage=0.33)
+ split = layout.split(factor=0.33)
split.row().prop(con, "use_rotation")
row = split.row()
row.prop(con, "orient_weight", text="Weight", slider=True)
row.active = con.use_rotation
- split = layout.split(percentage=0.33)
+ split = layout.split(factor=0.33)
row = split.row()
row.label(text="Lock:")
row = split.row()
@@ -751,7 +751,7 @@ class ConstraintButtonsPanel:
if con.shrinkwrap_type == 'PROJECT':
row = layout.row(align=True)
row.prop(con, "project_axis", expand=True)
- split = layout.split(percentage=0.4)
+ split = layout.split(factor=0.4)
split.label(text="Axis Space:")
rowsub = split.row()
rowsub.prop(con, "project_axis_space", text="")
diff --git a/release/scripts/startup/bl_ui/properties_data_curve.py b/release/scripts/startup/bl_ui/properties_data_curve.py
index 4002568fb7d..671cff4ebb4 100644
--- a/release/scripts/startup/bl_ui/properties_data_curve.py
+++ b/release/scripts/startup/bl_ui/properties_data_curve.py
@@ -328,16 +328,16 @@ class DATA_PT_font(CurveButtonsPanelText, Panel):
text = context.curve
char = context.curve.edit_format
- row = layout.split(percentage=0.25)
+ row = layout.split(factor=0.25)
row.label(text="Regular")
row.template_ID(text, "font", open="font.open", unlink="font.unlink")
- row = layout.split(percentage=0.25)
+ row = layout.split(factor=0.25)
row.label(text="Bold")
row.template_ID(text, "font_bold", open="font.open", unlink="font.unlink")
- row = layout.split(percentage=0.25)
+ row = layout.split(factor=0.25)
row.label(text="Italic")
row.template_ID(text, "font_italic", open="font.open", unlink="font.unlink")
- row = layout.split(percentage=0.25)
+ row = layout.split(factor=0.25)
row.label(text="Bold & Italic")
row.template_ID(text, "font_bold_italic", open="font.open", unlink="font.unlink")
diff --git a/release/scripts/startup/bl_ui/properties_data_lattice.py b/release/scripts/startup/bl_ui/properties_data_lattice.py
index 9aa8a4dee64..c18fd30b128 100644
--- a/release/scripts/startup/bl_ui/properties_data_lattice.py
+++ b/release/scripts/startup/bl_ui/properties_data_lattice.py
@@ -43,7 +43,7 @@ class DATA_PT_context_lattice(DataButtonsPanel, Panel):
lat = context.lattice
space = context.space_data
- split = layout.split(percentage=0.65)
+ split = layout.split(factor=0.65)
if ob:
split.template_ID(ob, "data")
split.separator()
diff --git a/release/scripts/startup/bl_ui/properties_data_mesh.py b/release/scripts/startup/bl_ui/properties_data_mesh.py
index f096ff83957..d455b56b3f4 100644
--- a/release/scripts/startup/bl_ui/properties_data_mesh.py
+++ b/release/scripts/startup/bl_ui/properties_data_mesh.py
@@ -92,7 +92,7 @@ class MESH_UL_shape_keys(UIList):
# key = data
key_block = item
if self.layout_type in {'DEFAULT', 'COMPACT'}:
-
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list