Cleanup: remove num argument prefix

This commit is contained in:
2018-07-01 09:23:51 +02:00
parent 1c0aa4e396
commit bc95c7a3ea
7 changed files with 24 additions and 24 deletions

View File

@@ -847,7 +847,7 @@ class CYCLES_CAMERA_PT_dof_aperture(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
cam = context.camera
ccam = cam.cycles
@@ -878,7 +878,7 @@ class CYCLES_CAMERA_PT_dof_viewport(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
cam = context.camera
dof_options = cam.gpu_dof
@@ -1539,7 +1539,7 @@ class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
layout.use_property_decorate = False # No animation.
layout.use_property_decorate = False # No animation.
scene = context.scene
cscene = scene.cycles
@@ -1568,7 +1568,7 @@ class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
if cscene.bake_type == 'NORMAL':
col.prop(cbk, "normal_space", text="Space")
sub = col.column(align=True)
sub = col.column(align=True)
sub.prop(cbk, "normal_r", text="Swizzle R")
sub.prop(cbk, "normal_g", text="G")
sub.prop(cbk, "normal_b", text="B")
@@ -1590,7 +1590,7 @@ class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
elif cscene.bake_type in {'DIFFUSE', 'GLOSSY', 'TRANSMISSION', 'SUBSURFACE'}:
row = col.row(align=True)
row.use_property_split = False
row.use_property_split = False
row.prop(cbk, "use_pass_direct", toggle=True)
row.prop(cbk, "use_pass_indirect", toggle=True)
row.prop(cbk, "use_pass_color", toggle=True)
@@ -1609,12 +1609,12 @@ class CYCLES_RENDER_PT_bake(CyclesButtonsPanel, Panel):
sub.prop(cbk, "use_cage", text="Cage")
if cbk.use_cage:
sub.prop(cbk, "cage_extrusion", text="Extrusion")
sub.prop_search(cbk, "cage_object", scene, "objects", text="Cage Object")
sub.prop_search(cbk, "cage_object", scene, "objects", text="Cage Object")
else:
sub.prop(cbk, "cage_extrusion", text="Ray Distance")
layout.separator()
layout.separator()
layout.operator("object.bake", icon='RENDER_STILL').type = cscene.bake_type

View File

@@ -242,7 +242,7 @@ class DATA_PT_camera_dof_aperture(CameraButtonsPanel, Panel):
cam = context.camera
dof_options = cam.gpu_dof
flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
if context.engine == 'BLENDER_EEVEE':
col = flow.column()

View File

@@ -50,7 +50,7 @@ class OBJECT_PT_transform(ObjectButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
ob = context.object
@@ -106,7 +106,7 @@ class OBJECT_PT_delta_transform(ObjectButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=True, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=True, align=False)
ob = context.object
@@ -136,7 +136,7 @@ class OBJECT_PT_relations(ObjectButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
ob = context.object
@@ -222,7 +222,7 @@ class OBJECT_PT_display(ObjectButtonsPanel, Panel):
def draw(self, context):
layout = self.layout
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
obj = context.object
obj_type = obj.type
@@ -285,7 +285,7 @@ class OBJECT_PT_duplication(ObjectButtonsPanel, Panel):
row.prop(ob, "dupli_type", expand=True)
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
if ob.dupli_type == 'FRAMES':

View File

@@ -212,7 +212,7 @@ class PHYSICS_PT_collision_particle(PhysicButtonsPanel, Panel):
md = context.collision
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
coll = md.settings
@@ -252,7 +252,7 @@ class PHYSICS_PT_collision_softbody(PhysicButtonsPanel, Panel):
layout = self.layout
layout.use_property_split = True
flow = layout.grid_flow(row_major=True, num_columns=0, even_columns=True, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=0, even_columns=True, even_rows=False, align=False)
md = context.collision
coll = md.settings

View File

@@ -120,7 +120,7 @@ class DopesheetFilterPopoverBase:
# datablock filters
layout.label("Include From Types:")
flow = layout.grid_flow(row_major=True, num_columns=2, even_rows=False, align=False)
flow = layout.grid_flow(row_major=True, columns=2, even_rows=False, align=False)
flow.prop(dopesheet, "show_scenes", text="Scenes")
flow.prop(dopesheet, "show_worlds", text="Worlds")

View File

@@ -186,7 +186,7 @@ typedef struct uiLayoutItemGridFlow {
/* If positive, absolute fixed number of columns.
* If 0, fully automatic (based on available width).
* If negative, automatic but only generates number of columns/rows multiple of given (absolute) value. */
int num_columns;
int columns_len;
/* Pure internal runtime storage. */
int tot_items, tot_columns, tot_rows;
@@ -3200,8 +3200,8 @@ static void ui_litem_estimate_grid_flow(uiLayout *litem)
/* Even in varying column width case, we fix our columns number from weighted average width of items,
* a proper solving of required width would be too costly, and this should give reasonably good results
* in all resonable cases... */
if (gflow->num_columns > 0) {
gflow->tot_columns = gflow->num_columns;
if (gflow->columns_len > 0) {
gflow->tot_columns = gflow->columns_len;
}
else {
if (avg_w == 0.0f) {
@@ -3218,7 +3218,7 @@ static void ui_litem_estimate_grid_flow(uiLayout *litem)
* Note that modulo does not prevent ending with fewer columns/rows than modulo, if mandatory
* to avoid empty column/row. */
{
const int modulo = (gflow->num_columns < -1) ? -gflow->num_columns : 0;
const int modulo = (gflow->columns_len < -1) ? -gflow->columns_len : 0;
const int step = modulo ? modulo : 1;
if (gflow->row_major) {
@@ -3580,7 +3580,7 @@ uiLayout *uiLayoutColumnFlow(uiLayout *layout, int number, int align)
}
uiLayout *uiLayoutGridFlow(
uiLayout *layout, int row_major, int num_columns, int even_columns, int even_rows, int align)
uiLayout *layout, int row_major, int columns_len, int even_columns, int even_rows, int align)
{
uiLayoutItemGridFlow *flow;
@@ -3590,7 +3590,7 @@ uiLayout *uiLayoutGridFlow(
flow->litem.space = (flow->litem.align) ? 0 : layout->root->style->columnspace;
flow->row_major = row_major;
flow->num_columns = num_columns;
flow->columns_len = columns_len;
flow->even_columns = even_columns;
flow->even_rows = even_rows;

View File

@@ -520,7 +520,7 @@ void RNA_api_ui_layout(StructRNA *srna)
func = RNA_def_function(srna, "grid_flow", "uiLayoutGridFlow");
RNA_def_boolean(func, "row_major", false, "", "Fill row by row, instead of column by column");
RNA_def_int(func, "num_columns", 0, INT_MIN, INT_MAX, "",
RNA_def_int(func, "columns", 0, INT_MIN, INT_MAX, "",
"Number of columns, positive are absolute fixed numbers, 0 is automatic, negative are "
"automatic multiple numbers along major axis (e.g. -2 will only produce 2, 4, 6 etc. "
"columns for row major layout, and 2, 4, 6 etc. rows for column major layout)",