Cleanup: make format

This commit is contained in:
Brecht Van Lommel 2024-01-11 14:54:41 +01:00
parent d3531eea10
commit e0bc6794cf
22 changed files with 45 additions and 58 deletions

View file

@ -54,6 +54,7 @@ def get_blender_git_root():
# Setup for precompiled libraries and tests from svn.
def get_effective_architecture(args):
if args.architecture:
return args.architecture

View file

@ -338,13 +338,13 @@ bool MetalDevice::compile_and_load(MetalPipelineType pso_type)
MTLCompileOptions *options = [[MTLCompileOptions alloc] init];
#if defined(MAC_OS_VERSION_13_0)
# if defined(MAC_OS_VERSION_13_0)
if (@available(macos 13.0, *)) {
if (device_vendor == METAL_GPU_INTEL) {
[options setOptimizationLevel:MTLLibraryOptimizationLevelSize];
}
}
#endif
# endif
options.fastMathEnabled = YES;
if (@available(macOS 12.0, *)) {

View file

@ -110,11 +110,11 @@ vector<id<MTLDevice>> const &MetalInfo::get_usable_devices()
usable |= (vendor == METAL_GPU_AMD);
}
#if defined(MAC_OS_VERSION_13_0)
# if defined(MAC_OS_VERSION_13_0)
if (@available(macos 13.0, *)) {
usable |= (vendor == METAL_GPU_INTEL);
}
#endif
# endif
if (usable) {
metal_printf("- %s\n", device_name.c_str());

View file

@ -472,7 +472,6 @@ ccl_device_noinline_cpu float noise_musgrave_hybrid_multi_fractal_3d(
float value = 0.0f;
float weight = 1.0f;
for (int i = 0; (weight > 0.001f) && (i < float_to_int(octaves)); i++) {
if (weight > 1.0f) {
weight = 1.0f;
@ -486,7 +485,7 @@ ccl_device_noinline_cpu float noise_musgrave_hybrid_multi_fractal_3d(
}
float rmd = octaves - floorf(octaves);
if ((rmd != 0.0f) && (weight > 0.001f)){
if ((rmd != 0.0f) && (weight > 0.001f)) {
if (weight > 1.0f) {
weight = 1.0f;
}

View file

@ -52,7 +52,7 @@
* github.com/FFmpeg/FFmpeg/commit/10c9a0874cb361336237557391d306d26d43f137
* for ffmpeg 6.0.
*/
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58,132,100)
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(58, 132, 100)
# define AV_CODEC_CAP_OTHER_THREADS AV_CODEC_CAP_AUTO_THREADS
#endif

@ -1 +1 @@
Subproject commit 8f1ff60fd3c56b9647bbddb3b2cc45d712003379
Subproject commit 16ff2985ba3fadb9ea31262dabd25c812b918b6e

@ -1 +1 @@
Subproject commit 74f3cd845c14dd0fdb2bd755ec6693628b340901
Subproject commit 95107484d076bc965239942e857c83433bfa86d7

View file

@ -3474,7 +3474,7 @@ def km_animation_channels(params):
# Selection.
*_template_items_select_actions(params, "anim.channels_select_all"),
("anim.channels_select_box", {"type": 'B', "value": 'PRESS'}, None),
("anim.channels_select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'},
("anim.channels_select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG'},
{"properties": [("extend", False)]}),
("anim.channels_select_box", {"type": 'LEFTMOUSE', "value": 'CLICK_DRAG', "shift": True},
{"properties": [("extend", True)]}),

View file

@ -1541,7 +1541,7 @@ class USERPREF_PT_input_touchpad(InputPanel, CenterAlignMixIn, Panel):
@classmethod
def poll(cls, context):
import sys
return sys.platform[:3] == "win" or sys.platform == "darwin"
return sys.platform[:3] == "win" or sys.platform == "darwin"
def draw_centered(self, context, layout):
prefs = context.preferences

View file

@ -468,9 +468,9 @@ static void setup_app_blend_file_data(bContext *C,
static void handle_subversion_warning(Main *main, BlendFileReadReport *reports)
{
if (main->versionfile > BLENDER_FILE_VERSION || (main->versionfile == BLENDER_FILE_VERSION &&
main->subversionfile > BLENDER_FILE_SUBVERSION))
{
if (main->versionfile > BLENDER_FILE_VERSION ||
(main->versionfile == BLENDER_FILE_VERSION &&
main->subversionfile > BLENDER_FILE_SUBVERSION)) {
BKE_reportf(reports->reports,
RPT_WARNING,
"File written by newer Blender binary (%d.%d), expect loss of data!",

View file

@ -1633,26 +1633,13 @@ static const LayerTypeInfo LAYERTYPEINFO[CD_NUMTYPES] = {
nullptr, layerMaxNum_tface},
/* 6: CD_MCOL */
/* 4 MCol structs per face */
{sizeof(MCol[4]),
"MCol",
4,
N_("Col"),
nullptr,
nullptr,
layerInterp_mcol,
layerSwap_mcol,
layerDefault_mcol,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr,
nullptr},
{sizeof(MCol[4]), "MCol", 4,
N_("Col"), nullptr, nullptr,
layerInterp_mcol, layerSwap_mcol, layerDefault_mcol,
nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
nullptr, nullptr, nullptr,
nullptr, nullptr},
/* 7: CD_ORIGINDEX */
{sizeof(int), "", 0, nullptr, nullptr, nullptr, nullptr, nullptr, layerDefault_origindex},
/* 8: CD_NORMAL */

View file

@ -228,4 +228,3 @@ void *blo_read_get_new_globaldata_address(struct FileData *fd, const void *adr);
/* Mark the Main data as invalid (.blend file reading should be aborted ASAP, and the already read
* data should be discarded). Also add an error report to `fd` including given `message`. */
void blo_readfile_invalidate(struct FileData *fd, struct Main *bmain, const char *message);

View file

@ -4491,7 +4491,8 @@ void GPENCIL_OT_stroke_sample(wmOperatorType *ot)
/* properties */
prop = RNA_def_float(ot->srna, "length", 0.1f, 0.0f, 100.0f, "Length", "", 0.0f, 100.0f);
prop = RNA_def_float(ot->srna, "sharp_threshold", 0.1f, 0.0f, M_PI, "Sharp Threshold", "", 0.0f, M_PI);
prop = RNA_def_float(
ot->srna, "sharp_threshold", 0.1f, 0.0f, M_PI, "Sharp Threshold", "", 0.0f, M_PI);
/* avoid re-using last var */
RNA_def_property_flag(prop, PROP_SKIP_SAVE);
}

View file

@ -2072,7 +2072,8 @@ static bool gpencil_generic_stroke_select(bContext *C,
bGPDspoint *pt_active = (pt->runtime.pt_orig) ? pt->runtime.pt_orig : pt;
/* Convert point coords to screen-space. */
const bool is_inside = is_inside_fn(gsc.region, gpstroke_iter.diff_mat, &pt_active->x, user_data);
const bool is_inside = is_inside_fn(
gsc.region, gpstroke_iter.diff_mat, &pt_active->x, user_data);
if (strokemode == false) {
const bool is_select = (pt_active->flag & GP_SPOINT_SELECT) != 0;
const int sel_op_result = ED_select_op_action_deselected(sel_op, is_select, is_inside);
@ -2441,11 +2442,11 @@ static int gpencil_select_exec(bContext *C, wmOperator *op)
/* if select mode is stroke, use whole stroke */
if ((ob) && (ob->mode == OB_MODE_SCULPT_GPENCIL)) {
whole |= (bool)(gpencil_select_mode_from_sculpt(ts->gpencil_selectmode_sculpt) ==
GP_SELECTMODE_STROKE);
GP_SELECTMODE_STROKE);
}
else if ((ob) && (ob->mode == OB_MODE_VERTEX_GPENCIL)) {
whole |= (bool)(gpencil_select_mode_from_vertex(ts->gpencil_selectmode_sculpt) ==
GP_SELECTMODE_STROKE);
GP_SELECTMODE_STROKE);
}
else {
whole |= (bool)(ts->gpencil_selectmode_edit == GP_SELECTMODE_STROKE);

View file

@ -1544,10 +1544,10 @@ uiButViewItem *ui_block_view_find_matching_view_item_but_in_old_block(
struct uiListType *UI_UL_cache_file_layers(void);
struct ID *ui_template_id_liboverride_hierarchy_make(struct bContext *C,
struct Main *bmain,
struct ID *owner_id,
struct ID *id,
const char **r_undo_push_label);
struct Main *bmain,
struct ID *owner_id,
struct ID *id,
const char **r_undo_push_label);
#ifdef __cplusplus
}

View file

@ -292,7 +292,7 @@ static int paint_mask_extract_exec(bContext *C, wmOperator *op)
* Note: A second push happens after the operator due to
* the OPTYPE_UNDO flag; having an initial undo step here
* is just needed to preserve the active object pointer.
*
*
* Fixes T103261.
*/
ED_undo_push_op(C, op);

View file

@ -42,11 +42,11 @@
#include "ED_armature.h"
#include "ED_gpencil.h"
#include "ED_outliner.h"
#include "ED_screen.h"
#include "ED_transform_snap_object_context.h"
#include "ED_undo.h"
#include "ED_view3d.h"
#include "ED_outliner.h"
#include "WM_toolsystem.h"

View file

@ -647,9 +647,7 @@ static bool node_object_drop_poll(bContext *C, wmDrag *drag, const wmEvent *UNUS
return WM_drag_is_ID_type(drag, ID_OB) && !UI_but_active_drop_name(C);
}
static bool node_collection_drop_poll(bContext *C,
wmDrag *drag,
const wmEvent *UNUSED(event))
static bool node_collection_drop_poll(bContext *C, wmDrag *drag, const wmEvent *UNUSED(event))
{
return WM_drag_is_ID_type(drag, ID_GR) && !UI_but_active_drop_name(C);
}

View file

@ -1315,8 +1315,7 @@ static void id_override_library_create_hierarchy_process(bContext *C,
}
if (id_iter->override_library->hierarchy_root != nullptr &&
!data.id_hierarchy_roots_uid.contains(
id_iter->override_library->hierarchy_root->session_uuid))
{
id_iter->override_library->hierarchy_root->session_uuid)) {
continue;
}
if (data.selected_id_uid.contains(id_iter->override_library->reference->session_uuid) ||

View file

@ -837,7 +837,7 @@ void drawPropCircle(const struct bContext *C, TransInfo *t)
const float fac_scale = xscale / yscale;
GPU_matrix_scale_2f(1.0f, fac_scale);
GPU_matrix_translate_2f(0.0f, (t->center_global[1] / fac_scale) - t->center_global[1]);
GPU_matrix_translate_2f(0.0f, (t->center_global[1] / fac_scale) - t->center_global[1]);
}
eGPUDepthTest depth_test_enabled = GPU_depth_test_get();

View file

@ -3574,7 +3574,8 @@ static LineartData *lineart_create_render_buffer(Scene *scene,
copy_v3db_v3fl(ld->conf.active_camera_pos, active_camera->obmat[3]);
}
copy_m4_m4(ld->conf.cam_obmat, camera->obmat);
/* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and lights. */
/* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and
* lights. */
normalize_v3(ld->conf.cam_obmat[0]);
normalize_v3(ld->conf.cam_obmat[1]);
normalize_v3(ld->conf.cam_obmat[2]);
@ -3606,7 +3607,8 @@ static LineartData *lineart_create_render_buffer(Scene *scene,
Object *light_obj = lmd->light_contour_object;
copy_v3db_v3fl(ld->conf.camera_pos_secondary, light_obj->obmat[3]);
copy_m4_m4(ld->conf.cam_obmat_secondary, light_obj->obmat);
/* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and lights. */
/* Make sure none of the scaling factor makes in, line art expects no scaling on cameras and
* lights. */
normalize_v3(ld->conf.cam_obmat_secondary[0]);
normalize_v3(ld->conf.cam_obmat_secondary[1]);
normalize_v3(ld->conf.cam_obmat_secondary[2]);

View file

@ -364,7 +364,7 @@ static const bool secure_opcodes[255] = {
OK_OP(KW_NAMES), /* Ok, because it's used for calling functions with keyword arguments. */
OK_OP(PRECALL), /* Ok, because it's used for calling. */
# else /* Python 3.10 and older. */
# else /* Python 3.10 and older. */
OK_OP(POP_TOP),
OK_OP(ROT_TWO),
@ -389,9 +389,9 @@ static const bool secure_opcodes[255] = {
OK_OP(BINARY_TRUE_DIVIDE),
OK_OP(INPLACE_FLOOR_DIVIDE),
OK_OP(INPLACE_TRUE_DIVIDE),
#if PY_VERSION_HEX >= 0x030a0000 /* Python3.9 doesn't support. */
# if PY_VERSION_HEX >= 0x030a0000 /* Python3.9 doesn't support. */
OK_OP(GET_LEN),
#endif
# endif
OK_OP(INPLACE_ADD),
OK_OP(INPLACE_SUBTRACT),
OK_OP(INPLACE_MULTIPLY),
@ -409,9 +409,9 @@ static const bool secure_opcodes[255] = {
OK_OP(INPLACE_OR),
OK_OP(LIST_TO_TUPLE),
OK_OP(RETURN_VALUE),
#if PY_VERSION_HEX >= 0x030a0000 /* Python3.9 doesn't support. */
# if PY_VERSION_HEX >= 0x030a0000 /* Python3.9 doesn't support. */
OK_OP(ROT_N),
#endif
# endif
OK_OP(BUILD_TUPLE),
OK_OP(BUILD_LIST),
OK_OP(BUILD_SET),