diff --git a/intern/clog/CLG_log.h b/intern/clog/CLG_log.h index c01c361d175..185cd9df38b 100644 --- a/intern/clog/CLG_log.h +++ b/intern/clog/CLG_log.h @@ -156,7 +156,8 @@ int CLG_color_support_get(CLG_LogRef *clg_ref); { \ CLG_LogType *_lg_ty = CLOG_ENSURE(clg_ref); \ if (((_lg_ty->flag & CLG_FLAG_USE) && (_lg_ty->level >= verbose_level)) || \ - (severity >= CLG_SEVERITY_WARN)) { \ + (severity >= CLG_SEVERITY_WARN)) \ + { \ CLG_logf(_lg_ty, severity, __FILE__ ":" STRINGIFY(__LINE__), __func__, __VA_ARGS__); \ } \ } \ @@ -166,7 +167,8 @@ int CLG_color_support_get(CLG_LogRef *clg_ref); { \ CLG_LogType *_lg_ty = CLOG_ENSURE(clg_ref); \ if (((_lg_ty->flag & CLG_FLAG_USE) && (_lg_ty->level >= verbose_level)) || \ - (severity >= CLG_SEVERITY_WARN)) { \ + (severity >= CLG_SEVERITY_WARN)) \ + { \ CLG_log_str(_lg_ty, severity, __FILE__ ":" STRINGIFY(__LINE__), __func__, str); \ } \ } \ @@ -176,7 +178,8 @@ int CLG_color_support_get(CLG_LogRef *clg_ref); { \ CLG_LogType *_lg_ty = CLOG_ENSURE(clg_ref); \ if (((_lg_ty->flag & CLG_FLAG_USE) && (_lg_ty->level >= verbose_level)) || \ - (severity >= CLG_SEVERITY_WARN)) { \ + (severity >= CLG_SEVERITY_WARN)) \ + { \ const char *_str = str; \ CLG_log_str(_lg_ty, severity, __FILE__ ":" STRINGIFY(__LINE__), __func__, _str); \ MEM_freeN((void *)_str); \ diff --git a/intern/clog/clog.c b/intern/clog/clog.c index 7e9a36c2b14..fb87a169043 100644 --- a/intern/clog/clog.c +++ b/intern/clog/clog.c @@ -316,7 +316,8 @@ static bool clg_ctx_filter_check(CLogContext *ctx, const char *identifier) } else if ((len >= 2) && (STREQLEN(".*", &flt->match[len - 2], 2))) { if (((identifier_len == len - 2) && STREQLEN(identifier, flt->match, len - 2)) || - ((identifier_len >= len - 1) && STREQLEN(identifier, flt->match, len - 1))) { + ((identifier_len >= len - 1) && STREQLEN(identifier, flt->match, len - 1))) + { return (bool)i; } } diff --git a/intern/cycles/app/cycles_standalone.cpp b/intern/cycles/app/cycles_standalone.cpp index 8b40adc8d92..8e1ba65458f 100644 --- a/intern/cycles/app/cycles_standalone.cpp +++ b/intern/cycles/app/cycles_standalone.cpp @@ -511,7 +511,8 @@ static void options_parse(int argc, const char **argv) exit(EXIT_FAILURE); } else if (options.scene_params.shadingsystem == SHADINGSYSTEM_OSL && - options.session_params.device.type != DEVICE_CPU) { + options.session_params.device.type != DEVICE_CPU) + { fprintf(stderr, "OSL shading system only works with CPU device\n"); exit(EXIT_FAILURE); } diff --git a/intern/cycles/app/oiio_output_driver.cpp b/intern/cycles/app/oiio_output_driver.cpp index 9bd164fb953..928313f3855 100644 --- a/intern/cycles/app/oiio_output_driver.cpp +++ b/intern/cycles/app/oiio_output_driver.cpp @@ -59,7 +59,8 @@ void OIIOOutputDriver::write_render_tile(const Tile &tile) /* Apply gamma correction for (some) non-linear file formats. * TODO: use OpenColorIO view transform if available. */ if (ColorSpaceManager::detect_known_colorspace( - u_colorspace_auto, "", image_output->format_name(), true) == u_colorspace_srgb) { + u_colorspace_auto, "", image_output->format_name(), true) == u_colorspace_srgb) + { const float g = 1.0f / 2.2f; ImageBufAlgo::pow(image_buffer, image_buffer, {g, g, g, 1.0f}); } diff --git a/intern/cycles/app/opengl/window.cpp b/intern/cycles/app/opengl/window.cpp index f3352decd08..9166d7140c0 100644 --- a/intern/cycles/app/opengl/window.cpp +++ b/intern/cycles/app/opengl/window.cpp @@ -314,7 +314,8 @@ void window_main_loop(const char *title, } else if (event.type == SDL_WINDOWEVENT) { if (event.window.event == SDL_WINDOWEVENT_RESIZED || - event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) { + event.window.event == SDL_WINDOWEVENT_SIZE_CHANGED) + { window_reshape(event.window.data1, event.window.data2); } } diff --git a/intern/cycles/blender/camera.cpp b/intern/cycles/blender/camera.cpp index d7def9fdb7c..0cdf395e12c 100644 --- a/intern/cycles/blender/camera.cpp +++ b/intern/cycles/blender/camera.cpp @@ -432,7 +432,8 @@ static void blender_camera_sync(Camera *cam, /* panorama sensor */ if (bcam->type == CAMERA_PANORAMA && (bcam->panorama_type == PANORAMA_FISHEYE_EQUISOLID || - bcam->panorama_type == PANORAMA_FISHEYE_LENS_POLYNOMIAL)) { + bcam->panorama_type == PANORAMA_FISHEYE_LENS_POLYNOMIAL)) + { float fit_xratio = (float)bcam->render_width * bcam->pixelaspect.x; float fit_yratio = (float)bcam->render_height * bcam->pixelaspect.y; bool horizontal_fit; diff --git a/intern/cycles/blender/curves.cpp b/intern/cycles/blender/curves.cpp index 411eb16cd9d..b9a76a4960a 100644 --- a/intern/cycles/blender/curves.cpp +++ b/intern/cycles/blender/curves.cpp @@ -55,13 +55,15 @@ static bool ObtainCacheParticleData( for (BL::Modifier &b_mod : b_ob->modifiers) { if ((b_mod.type() == b_mod.type_PARTICLE_SYSTEM) && - (background ? b_mod.show_render() : b_mod.show_viewport())) { + (background ? b_mod.show_render() : b_mod.show_viewport())) + { BL::ParticleSystemModifier psmd((const PointerRNA)b_mod.ptr); BL::ParticleSystem b_psys((const PointerRNA)psmd.particle_system().ptr); BL::ParticleSettings b_part((const PointerRNA)b_psys.settings().ptr); if ((b_part.render_type() == BL::ParticleSettings::render_type_PATH) && - (b_part.type() == BL::ParticleSettings::type_HAIR)) { + (b_part.type() == BL::ParticleSettings::type_HAIR)) + { int shader = clamp(b_part.material() - 1, 0, hair->get_used_shaders().size() - 1); int display_step = background ? b_part.render_step() : b_part.display_step(); int totparts = b_psys.particles.length(); @@ -150,13 +152,15 @@ static bool ObtainCacheParticleUV(Hair *hair, for (BL::Modifier &b_mod : b_ob->modifiers) { if ((b_mod.type() == b_mod.type_PARTICLE_SYSTEM) && - (background ? b_mod.show_render() : b_mod.show_viewport())) { + (background ? b_mod.show_render() : b_mod.show_viewport())) + { BL::ParticleSystemModifier psmd((const PointerRNA)b_mod.ptr); BL::ParticleSystem b_psys((const PointerRNA)psmd.particle_system().ptr); BL::ParticleSettings b_part((const PointerRNA)b_psys.settings().ptr); if ((b_part.render_type() == BL::ParticleSettings::render_type_PATH) && - (b_part.type() == BL::ParticleSettings::type_HAIR)) { + (b_part.type() == BL::ParticleSettings::type_HAIR)) + { int totparts = b_psys.particles.length(); int totchild = background ? b_psys.child_particles.length() : (int)((float)b_psys.child_particles.length() * @@ -212,13 +216,15 @@ static bool ObtainCacheParticleVcol(Hair *hair, for (BL::Modifier &b_mod : b_ob->modifiers) { if ((b_mod.type() == b_mod.type_PARTICLE_SYSTEM) && - (background ? b_mod.show_render() : b_mod.show_viewport())) { + (background ? b_mod.show_render() : b_mod.show_viewport())) + { BL::ParticleSystemModifier psmd((const PointerRNA)b_mod.ptr); BL::ParticleSystem b_psys((const PointerRNA)psmd.particle_system().ptr); BL::ParticleSettings b_part((const PointerRNA)b_psys.settings().ptr); if ((b_part.render_type() == BL::ParticleSettings::render_type_PATH) && - (b_part.type() == BL::ParticleSettings::type_HAIR)) { + (b_part.type() == BL::ParticleSettings::type_HAIR)) + { int totparts = b_psys.particles.length(); int totchild = background ? b_psys.child_particles.length() : (int)((float)b_psys.child_particles.length() * @@ -283,7 +289,8 @@ static void ExportCurveSegments(Scene *scene, Hair *hair, ParticleCurveData *CDa for (int sys = 0; sys < CData->psys_firstcurve.size(); sys++) { for (int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys]; - curve++) { + curve++) + { num_keys += CData->curve_keynum[curve]; num_curves++; } @@ -298,12 +305,14 @@ static void ExportCurveSegments(Scene *scene, Hair *hair, ParticleCurveData *CDa for (int sys = 0; sys < CData->psys_firstcurve.size(); sys++) { for (int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys]; - curve++) { + curve++) + { size_t num_curve_keys = 0; for (int curvekey = CData->curve_firstkey[curve]; curvekey < CData->curve_firstkey[curve] + CData->curve_keynum[curve]; - curvekey++) { + curvekey++) + { const float3 ickey_loc = CData->curvekey_co[curvekey]; const float curve_time = CData->curvekey_time[curvekey]; const float curve_length = CData->curve_length[curve]; @@ -311,7 +320,8 @@ static void ExportCurveSegments(Scene *scene, Hair *hair, ParticleCurveData *CDa float radius = shaperadius( CData->psys_shape[sys], CData->psys_rootradius[sys], CData->psys_tipradius[sys], time); if (CData->psys_closetip[sys] && - (curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1)) { + (curvekey == CData->curve_firstkey[curve] + CData->curve_keynum[curve] - 1)) + { radius = 0.0f; } hair->add_curve_key(ickey_loc, radius); @@ -433,7 +443,8 @@ static void ExportCurveSegmentsMotion(Hair *hair, ParticleCurveData *CData, int for (int sys = 0; sys < CData->psys_firstcurve.size(); sys++) { for (int curve = CData->psys_firstcurve[sys]; curve < CData->psys_firstcurve[sys] + CData->psys_curvenum[sys]; - curve++) { + curve++) + { /* Curve lengths may not match! Curves can be clipped. */ int curve_key_end = (num_curves + 1 < (int)hair->get_curve_first_key().size() ? hair->get_curve_first_key()[num_curves + 1] : @@ -444,7 +455,8 @@ static void ExportCurveSegmentsMotion(Hair *hair, ParticleCurveData *CData, int if (!is_num_keys_different) { for (int curvekey = CData->curve_firstkey[curve]; curvekey < CData->curve_firstkey[curve] + CData->curve_keynum[curve]; - curvekey++) { + curvekey++) + { if (i < hair->get_curve_keys().size()) { mP[i] = CurveSegmentMotionCV(CData, sys, curve, curvekey); if (!have_motion) { @@ -489,13 +501,15 @@ bool BlenderSync::object_has_particle_hair(BL::Object b_ob) /* Test if the object has a particle modifier with hair. */ for (BL::Modifier &b_mod : b_ob.modifiers) { if ((b_mod.type() == b_mod.type_PARTICLE_SYSTEM) && - (preview ? b_mod.show_viewport() : b_mod.show_render())) { + (preview ? b_mod.show_viewport() : b_mod.show_render())) + { BL::ParticleSystemModifier psmd((const PointerRNA)b_mod.ptr); BL::ParticleSystem b_psys((const PointerRNA)psmd.particle_system().ptr); BL::ParticleSettings b_part((const PointerRNA)b_psys.settings().ptr); if ((b_part.render_type() == BL::ParticleSettings::render_type_PATH) && - (b_part.type() == BL::ParticleSettings::type_HAIR)) { + (b_part.type() == BL::ParticleSettings::type_HAIR)) + { return true; } } @@ -677,7 +691,8 @@ static void fill_generic_attribute(const int num_curves, static void attr_create_motion(Hair *hair, BL::Attribute &b_attribute, const float motion_scale) { if (!(b_attribute.domain() == BL::Attribute::domain_POINT) && - (b_attribute.data_type() == BL::Attribute::data_type_FLOAT_VECTOR)) { + (b_attribute.data_type() == BL::Attribute::data_type_FLOAT_VECTOR)) + { return; } @@ -748,7 +763,8 @@ static void attr_create_generic(Scene *scene, /* Weak, use first float2 attribute as standard UV. */ if (need_uv && !have_uv && b_data_type == BL::Attribute::data_type_FLOAT2 && - b_domain == BL::Attribute::domain_CURVE) { + b_domain == BL::Attribute::domain_CURVE) + { attr_create_uv(attributes, num_curves, num_keys, b_attribute, name); have_uv = true; continue; @@ -1100,7 +1116,8 @@ void BlenderSync::sync_hair(BL::Depsgraph b_depsgraph, BObjectInfo &b_ob_info, H for (const SocketType &socket : new_hair.type->inputs) { /* Those sockets are updated in sync_object, so do not modify them. */ if (socket.name == "use_motion_blur" || socket.name == "motion_steps" || - socket.name == "used_shaders") { + socket.name == "used_shaders") + { continue; } hair->set_value(socket, new_hair, socket); diff --git a/intern/cycles/blender/device.cpp b/intern/cycles/blender/device.cpp index 4e1f77eb9cb..3059035f320 100644 --- a/intern/cycles/blender/device.cpp +++ b/intern/cycles/blender/device.cpp @@ -115,7 +115,8 @@ DeviceInfo blender_device_info(BL::Preferences &b_preferences, bool accumulated_use_hardware_raytracing = false; foreach ( DeviceInfo &info, - (device.multi_devices.size() != 0 ? device.multi_devices : vector({device}))) { + (device.multi_devices.size() != 0 ? device.multi_devices : vector({device}))) + { if (info.type == DEVICE_METAL && !get_boolean(cpreferences, "use_metalrt")) { info.use_hardware_raytracing = false; } diff --git a/intern/cycles/blender/display_driver.cpp b/intern/cycles/blender/display_driver.cpp index 2dbbefe43c5..918f52cbd29 100644 --- a/intern/cycles/blender/display_driver.cpp +++ b/intern/cycles/blender/display_driver.cpp @@ -312,7 +312,8 @@ class DisplayGPUPixelBuffer { /* Try to re-use the existing PBO if it has usable size. */ if (gpu_pixel_buffer) { if (new_width != width || new_height != height || - GPU_pixel_buffer_size(gpu_pixel_buffer) < required_size) { + GPU_pixel_buffer_size(gpu_pixel_buffer) < required_size) + { gpu_resources_destroy(); } } @@ -513,7 +514,8 @@ bool BlenderDisplayDriver::update_begin(const Params ¶ms, const int buffer_height = params.size.y; if (!current_tile_buffer_object.gpu_resources_ensure(buffer_width, buffer_height) || - !current_tile.texture.gpu_resources_ensure(texture_width, texture_height)) { + !current_tile.texture.gpu_resources_ensure(texture_width, texture_height)) + { tiles_->current_tile.gpu_resources_destroy(); gpu_context_disable(); return false; @@ -563,7 +565,8 @@ void BlenderDisplayDriver::update_end() * renders while Blender is drawing. As a workaround update texture during draw, under assumption * that there is no graphics interop on macOS and viewport render has a single tile. */ if (!background_ && - GPU_type_matches_ex(GPU_DEVICE_NVIDIA, GPU_OS_MAC, GPU_DRIVER_ANY, GPU_BACKEND_ANY)) { + GPU_type_matches_ex(GPU_DEVICE_NVIDIA, GPU_OS_MAC, GPU_DRIVER_ANY, GPU_BACKEND_ANY)) + { tiles_->current_tile.need_update_texture_pixels = true; } else { @@ -708,7 +711,8 @@ static void draw_tile(const float2 &zoom, GPU_texture_bind_ex(texture.gpu_texture, GPUSamplerState::default_sampler(), 0); } else if (zoomed_width - draw_tile.params.size.x > 0.5f || - zoomed_height - draw_tile.params.size.y > 0.5f) { + zoomed_height - draw_tile.params.size.y > 0.5f) + { GPU_texture_bind_ex(texture.gpu_texture, GPUSamplerState::default_sampler(), 0); } else { diff --git a/intern/cycles/blender/geometry.cpp b/intern/cycles/blender/geometry.cpp index fc03ca6e489..5a064a5cea7 100644 --- a/intern/cycles/blender/geometry.cpp +++ b/intern/cycles/blender/geometry.cpp @@ -28,7 +28,8 @@ static Geometry::Type determine_geom_type(BObjectInfo &b_ob_info, bool use_parti if (b_ob_info.object_data.is_a(&RNA_Volume) || (b_ob_info.object_data == b_ob_info.real_object.data() && - object_fluid_gas_domain_find(b_ob_info.real_object))) { + object_fluid_gas_domain_find(b_ob_info.real_object))) + { return Geometry::VOLUME; } @@ -192,7 +193,8 @@ void BlenderSync::sync_geometry_motion(BL::Depsgraph &b_depsgraph, Geometry *geom = object->get_geometry(); if (geometry_motion_synced.find(geom) != geometry_motion_synced.end() || - geometry_motion_attribute_synced.find(geom) != geometry_motion_attribute_synced.end()) { + geometry_motion_attribute_synced.find(geom) != geometry_motion_attribute_synced.end()) + { return; } @@ -218,7 +220,8 @@ void BlenderSync::sync_geometry_motion(BL::Depsgraph &b_depsgraph, sync_hair_motion(b_depsgraph, b_ob_info, hair, motion_step); } else if (b_ob_info.object_data.is_a(&RNA_Volume) || - object_fluid_gas_domain_find(b_ob_info.real_object)) { + object_fluid_gas_domain_find(b_ob_info.real_object)) + { /* No volume motion blur support yet. */ } else if (b_ob_info.object_data.is_a(&RNA_PointCloud)) { diff --git a/intern/cycles/blender/light.cpp b/intern/cycles/blender/light.cpp index 49545047d9e..19cde43115d 100644 --- a/intern/cycles/blender/light.cpp +++ b/intern/cycles/blender/light.cpp @@ -169,7 +169,8 @@ void BlenderSync::sync_background_light(BL::SpaceView3D &b_v3d, bool use_portal) ObjectKey key(b_world, 0, b_world, false); if (light_map.add_or_update(&light, b_world, b_world, key) || world_recalc || - b_world.ptr.data != world_map) { + b_world.ptr.data != world_map) + { light->set_light_type(LIGHT_BACKGROUND); if (sampling_method == SAMPLING_MANUAL) { light->set_map_resolution(get_int(cworld, "sample_map_resolution")); diff --git a/intern/cycles/blender/mesh.cpp b/intern/cycles/blender/mesh.cpp index 636ba94eaa8..b0302cbfeca 100644 --- a/intern/cycles/blender/mesh.cpp +++ b/intern/cycles/blender/mesh.cpp @@ -337,7 +337,8 @@ static void fill_generic_attribute(BL::Mesh &b_mesh, static void attr_create_motion(Mesh *mesh, BL::Attribute &b_attribute, const float motion_scale) { if (!(b_attribute.domain() == BL::Attribute::domain_POINT) && - (b_attribute.data_type() == BL::Attribute::data_type_FLOAT_VECTOR)) { + (b_attribute.data_type() == BL::Attribute::data_type_FLOAT_VECTOR)) + { return; } @@ -384,7 +385,8 @@ static void attr_create_generic(Scene *scene, } if (!(mesh->need_attribute(scene, name) || - (is_render_color && mesh->need_attribute(scene, ATTR_STD_VERTEX_COLOR)))) { + (is_render_color && mesh->need_attribute(scene, ATTR_STD_VERTEX_COLOR)))) + { continue; } if (attributes.find(name)) { @@ -741,13 +743,15 @@ static void attr_create_pointiness(Scene *scene, Mesh *mesh, BL::Mesh &b_mesh, b const float3 &vert_co = mesh->get_verts()[vert_index]; bool found = false; for (int other_sorted_vert_index = sorted_vert_index + 1; other_sorted_vert_index < num_verts; - ++other_sorted_vert_index) { + ++other_sorted_vert_index) + { const int other_vert_index = sorted_vert_indeices[other_sorted_vert_index]; const float3 &other_vert_co = mesh->get_verts()[other_vert_index]; /* We are too far away now, we wouldn't have duplicate. */ if ((other_vert_co.x + other_vert_co.y + other_vert_co.z) - (vert_co.x + vert_co.y + vert_co.z) > - 3 * FLT_EPSILON) { + 3 * FLT_EPSILON) + { break; } /* Found duplicate. */ @@ -1325,7 +1329,8 @@ void BlenderSync::sync_mesh(BL::Depsgraph b_depsgraph, BObjectInfo &b_ob_info, M for (const SocketType &socket : new_mesh.type->inputs) { /* Those sockets are updated in sync_object, so do not modify them. */ if (socket.name == "use_motion_blur" || socket.name == "motion_steps" || - socket.name == "used_shaders") { + socket.name == "used_shaders") + { continue; } mesh->set_value(socket, new_mesh, socket); diff --git a/intern/cycles/blender/object.cpp b/intern/cycles/blender/object.cpp index 5af1e18a597..815a8b37846 100644 --- a/intern/cycles/blender/object.cpp +++ b/intern/cycles/blender/object.cpp @@ -63,7 +63,8 @@ bool BlenderSync::object_is_geometry(BObjectInfo &b_ob_info) BL::Object::type_enum type = b_ob_info.iter_object.type(); if (type == BL::Object::type_VOLUME || type == BL::Object::type_CURVES || - type == BL::Object::type_POINTCLOUD) { + type == BL::Object::type_POINTCLOUD) + { /* Will be exported attached to mesh. */ return true; } @@ -325,7 +326,8 @@ Object *BlenderSync::sync_object(BL::Depsgraph &b_depsgraph, * transform comparison should not be needed, but duplis don't work perfect * in the depsgraph and may not signal changes, so this is a workaround */ if (object->is_modified() || object_updated || - (object->get_geometry() && object->get_geometry()->is_modified())) { + (object->get_geometry() && object->get_geometry()->is_modified())) + { object->name = b_ob.name().c_str(); object->set_pass_id(b_ob.pass_index()); const BL::Array object_color = b_ob.color(); @@ -408,7 +410,8 @@ bool BlenderSync::sync_object_attributes(BL::DepsgraphObjectInstance &b_instance BlenderAttributeType type = blender_attribute_name_split_type(name, &real_name); if (type == BL::ShaderNodeAttribute::attribute_type_OBJECT || - type == BL::ShaderNodeAttribute::attribute_type_INSTANCER) { + type == BL::ShaderNodeAttribute::attribute_type_INSTANCER) + { bool use_instancer = (type == BL::ShaderNodeAttribute::attribute_type_INSTANCER); float4 value = lookup_instance_property(b_instance, real_name, use_instancer); @@ -556,7 +559,8 @@ void BlenderSync::sync_objects(BL::Depsgraph &b_depsgraph, for (b_depsgraph.object_instances.begin(b_instance_iter); b_instance_iter != b_depsgraph.object_instances.end() && !cancel; - ++b_instance_iter) { + ++b_instance_iter) + { BL::DepsgraphObjectInstance b_instance = *b_instance_iter; BL::Object b_ob = b_instance.object(); @@ -667,7 +671,8 @@ void BlenderSync::sync_motion(BL::RenderSettings &b_render, float frame_center_delta = 0.0f; if (scene->need_motion() != Scene::MOTION_PASS && - scene->camera->get_motion_position() != MOTION_POSITION_CENTER) { + scene->camera->get_motion_position() != MOTION_POSITION_CENTER) + { float shuttertime = scene->camera->get_shuttertime(); if (scene->camera->get_motion_position() == MOTION_POSITION_END) { frame_center_delta = -shuttertime * 0.5f; diff --git a/intern/cycles/blender/pointcloud.cpp b/intern/cycles/blender/pointcloud.cpp index 32caebc0358..36c313642df 100644 --- a/intern/cycles/blender/pointcloud.cpp +++ b/intern/cycles/blender/pointcloud.cpp @@ -21,7 +21,8 @@ static void attr_create_motion(PointCloud *pointcloud, const float motion_scale) { if (!(b_attribute.domain() == BL::Attribute::domain_POINT) && - (b_attribute.data_type() == BL::Attribute::data_type_FLOAT_VECTOR)) { + (b_attribute.data_type() == BL::Attribute::data_type_FLOAT_VECTOR)) + { return; } @@ -313,7 +314,8 @@ void BlenderSync::sync_pointcloud(PointCloud *pointcloud, BObjectInfo &b_ob_info for (const SocketType &socket : new_pointcloud.type->inputs) { /* Those sockets are updated in sync_object, so do not modify them. */ if (socket.name == "use_motion_blur" || socket.name == "motion_steps" || - socket.name == "used_shaders") { + socket.name == "used_shaders") + { continue; } pointcloud->set_value(socket, new_pointcloud, socket); diff --git a/intern/cycles/blender/python.cpp b/intern/cycles/blender/python.cpp index 1afd1e9bd1c..8ca984078bb 100644 --- a/intern/cycles/blender/python.cpp +++ b/intern/cycles/blender/python.cpp @@ -163,7 +163,8 @@ static PyObject *create_func(PyObject * /*self*/, PyObject *args) &pyregion, &pyv3d, &pyrv3d, - &preview_osl)) { + &preview_osl)) + { return NULL; } @@ -522,7 +523,8 @@ static PyObject *osl_update_node_func(PyObject * /*self*/, PyObject *args) } else if (param->type.vecsemantics == TypeDesc::POINT || param->type.vecsemantics == TypeDesc::VECTOR || - param->type.vecsemantics == TypeDesc::NORMAL) { + param->type.vecsemantics == TypeDesc::NORMAL) + { socket_type = "NodeSocketVector"; data_type = BL::NodeSocket::type_VECTOR; @@ -738,7 +740,8 @@ static PyObject *denoise_func(PyObject * /*self*/, PyObject *args, PyObject *key &pyscene, &pyviewlayer, &pyinput, - &pyoutput)) { + &pyoutput)) + { return NULL; } diff --git a/intern/cycles/blender/session.cpp b/intern/cycles/blender/session.cpp index 6c865c2f9b0..417c0b54d00 100644 --- a/intern/cycles/blender/session.cpp +++ b/intern/cycles/blender/session.cpp @@ -202,7 +202,8 @@ void BlenderSession::reset_session(BL::BlendData &b_data, BL::Depsgraph &b_depsg b_scene, background, use_developer_ui); if (scene->params.modified(scene_params) || session->params.modified(session_params) || - !this->b_render.use_persistent_data()) { + !this->b_render.use_persistent_data()) + { /* if scene or session parameters changed, it's easier to simply re-create * them rather than trying to distinguish which settings need to be updated */ @@ -376,8 +377,8 @@ void BlenderSession::render(BL::Depsgraph &b_depsgraph_) } int view_index = 0; - for (b_rr.views.begin(b_view_iter); b_view_iter != b_rr.views.end(); - ++b_view_iter, ++view_index) { + for (b_rr.views.begin(b_view_iter); b_view_iter != b_rr.views.end(); ++b_view_iter, ++view_index) + { b_rview_name = b_view_iter->name(); buffer_params.layer = b_view_layer.name(); @@ -562,7 +563,8 @@ static bool bake_setup_pass(Scene *scene, const string &bake_type_str, const int /* Light component passes. */ else if (strcmp(bake_type, "DIFFUSE") == 0) { if ((bake_filter & BL::BakeSettings::pass_filter_DIRECT) && - bake_filter & BL::BakeSettings::pass_filter_INDIRECT) { + bake_filter & BL::BakeSettings::pass_filter_INDIRECT) + { type = PASS_DIFFUSE; use_direct_light = true; use_indirect_light = true; @@ -583,7 +585,8 @@ static bool bake_setup_pass(Scene *scene, const string &bake_type_str, const int } else if (strcmp(bake_type, "GLOSSY") == 0) { if ((bake_filter & BL::BakeSettings::pass_filter_DIRECT) && - bake_filter & BL::BakeSettings::pass_filter_INDIRECT) { + bake_filter & BL::BakeSettings::pass_filter_INDIRECT) + { type = PASS_GLOSSY; use_direct_light = true; use_indirect_light = true; @@ -604,7 +607,8 @@ static bool bake_setup_pass(Scene *scene, const string &bake_type_str, const int } else if (strcmp(bake_type, "TRANSMISSION") == 0) { if ((bake_filter & BL::BakeSettings::pass_filter_DIRECT) && - bake_filter & BL::BakeSettings::pass_filter_INDIRECT) { + bake_filter & BL::BakeSettings::pass_filter_INDIRECT) + { type = PASS_TRANSMISSION; use_direct_light = true; use_indirect_light = true; diff --git a/intern/cycles/blender/shader.cpp b/intern/cycles/blender/shader.cpp index 813d7a95964..ecf4384aee7 100644 --- a/intern/cycles/blender/shader.cpp +++ b/intern/cycles/blender/shader.cpp @@ -1246,7 +1246,8 @@ static void add_nodes(Scene *scene, } } else if (b_node.is_a(&RNA_ShaderNodeGroup) || b_node.is_a(&RNA_NodeCustomGroup) || - b_node.is_a(&RNA_ShaderNodeCustomGroup)) { + b_node.is_a(&RNA_ShaderNodeCustomGroup)) + { BL::ShaderNodeTree b_group_ntree(PointerRNA_NULL); if (b_node.is_a(&RNA_ShaderNodeGroup)) @@ -1382,7 +1383,8 @@ static void add_nodes(Scene *scene, /* Ignore invalid links to avoid unwanted cycles created in graph. * Also ignore links with unavailable sockets. */ if (!(b_link.is_valid() && b_link.from_socket().enabled() && b_link.to_socket().enabled()) || - b_link.is_muted()) { + b_link.is_muted()) + { continue; } /* get blender link data */ @@ -1531,7 +1533,8 @@ void BlenderSync::sync_materials(BL::Depsgraph &b_depsgraph, bool update_all) /* test if we need to sync */ if (shader_map.add_or_update(&shader, b_mat) || update_all || - scene_attr_needs_recalc(shader, b_depsgraph)) { + scene_attr_needs_recalc(shader, b_depsgraph)) + { ShaderGraph *graph = new ShaderGraph(); shader->name = b_mat.name().c_str(); @@ -1614,12 +1617,14 @@ void BlenderSync::sync_world(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d, if (world_recalc || update_all || b_world.ptr.data != world_map || viewport_parameters.shader_modified(new_viewport_parameters) || - scene_attr_needs_recalc(shader, b_depsgraph)) { + scene_attr_needs_recalc(shader, b_depsgraph)) + { ShaderGraph *graph = new ShaderGraph(); /* create nodes */ if (new_viewport_parameters.use_scene_world && b_world && b_world.use_nodes() && - b_world.node_tree()) { + b_world.node_tree()) + { BL::ShaderNodeTree b_ntree(b_world.node_tree()); add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree); @@ -1781,7 +1786,8 @@ void BlenderSync::sync_lights(BL::Depsgraph &b_depsgraph, bool update_all) /* test if we need to sync */ if (shader_map.add_or_update(&shader, b_light) || update_all || - scene_attr_needs_recalc(shader, b_depsgraph)) { + scene_attr_needs_recalc(shader, b_depsgraph)) + { ShaderGraph *graph = new ShaderGraph(); /* create nodes */ diff --git a/intern/cycles/blender/sync.cpp b/intern/cycles/blender/sync.cpp index 9ae886f8c9f..40979dfda0b 100644 --- a/intern/cycles/blender/sync.cpp +++ b/intern/cycles/blender/sync.cpp @@ -169,7 +169,8 @@ void BlenderSync::sync_recalc(BL::Depsgraph &b_depsgraph, BL::SpaceView3D &b_v3d } if (updated_geometry || - (object_subdivision_type(b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE)) { + (object_subdivision_type(b_ob, preview, experimental) != Mesh::SUBDIVISION_NONE)) + { BL::ID key = BKE_object_is_modified(b_ob) ? b_ob : b_ob.data(); geometry_map.set_recalc(key); @@ -277,7 +278,8 @@ void BlenderSync::sync_data(BL::RenderSettings &b_render, geometry_synced.clear(); /* use for objects and motion sync */ if (scene->need_motion() == Scene::MOTION_PASS || scene->need_motion() == Scene::MOTION_NONE || - scene->camera->get_motion_position() == MOTION_POSITION_CENTER) { + scene->camera->get_motion_position() == MOTION_POSITION_CENTER) + { sync_objects(b_depsgraph, b_v3d); } sync_motion(b_render, b_depsgraph, b_v3d, b_override, width, height, python_thread_state); @@ -445,7 +447,8 @@ void BlenderSync::sync_integrator(BL::ViewLayer &b_view_layer, bool background) /* No denoising support for vertex color baking, vertices packed into image * buffer have no relation to neighbors. */ if (scene->bake_manager->get_baking() && - b_scene.render().bake().target() != BL::BakeSettings::target_IMAGE_TEXTURES) { + b_scene.render().bake().target() != BL::BakeSettings::target_IMAGE_TEXTURES) + { denoise_params.use = false; } @@ -709,7 +712,8 @@ void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_v BL::ViewLayer::lightgroups_iterator b_lightgroup_iter; for (b_view_layer.lightgroups.begin(b_lightgroup_iter); b_lightgroup_iter != b_view_layer.lightgroups.end(); - ++b_lightgroup_iter) { + ++b_lightgroup_iter) + { BL::Lightgroup b_lightgroup(*b_lightgroup_iter); string name = string_printf("Combined_%s", b_lightgroup.name().c_str()); @@ -732,7 +736,8 @@ void BlenderSync::sync_render_passes(BL::RenderLayer &b_rlay, BL::ViewLayer &b_v } if (pass_type == PASS_MOTION && - (b_view_layer.use_motion_blur() && b_scene.render().use_motion_blur())) { + (b_view_layer.use_motion_blur() && b_scene.render().use_motion_blur())) + { continue; } diff --git a/intern/cycles/blender/util.h b/intern/cycles/blender/util.h index 7394fa5ba51..c2b94cece35 100644 --- a/intern/cycles/blender/util.h +++ b/intern/cycles/blender/util.h @@ -588,7 +588,8 @@ static inline BL::FluidDomainSettings object_fluid_gas_domain_find(BL::Object &b BL::FluidModifier b_mmd(b_mod); if (b_mmd.fluid_type() == BL::FluidModifier::fluid_type_DOMAIN && - b_mmd.domain_settings().domain_type() == BL::FluidDomainSettings::domain_type_GAS) { + b_mmd.domain_settings().domain_type() == BL::FluidDomainSettings::domain_type_GAS) + { return b_mmd.domain_settings(); } } @@ -637,7 +638,8 @@ static inline Mesh::SubdivisionType object_subdivision_type(BL::Object &b_ob, bool enabled = preview ? mod.show_viewport() : mod.show_render(); if (enabled && mod.type() == BL::Modifier::type_SUBSURF && - RNA_boolean_get(&cobj, "use_adaptive_subdivision")) { + RNA_boolean_get(&cobj, "use_adaptive_subdivision")) + { BL::SubsurfModifier subsurf(mod); if (subsurf.subdivision_type() == BL::SubsurfModifier::subdivision_type_CATMULL_CLARK) { diff --git a/intern/cycles/blender/volume.cpp b/intern/cycles/blender/volume.cpp index 61b2f9ee276..864ddd28c10 100644 --- a/intern/cycles/blender/volume.cpp +++ b/intern/cycles/blender/volume.cpp @@ -35,7 +35,8 @@ class BlenderSmokeLoader : public ImageLoader { } if (attribute == ATTR_STD_VOLUME_DENSITY || attribute == ATTR_STD_VOLUME_FLAME || - attribute == ATTR_STD_VOLUME_HEAT || attribute == ATTR_STD_VOLUME_TEMPERATURE) { + attribute == ATTR_STD_VOLUME_HEAT || attribute == ATTR_STD_VOLUME_TEMPERATURE) + { metadata.type = IMAGE_DATA_TYPE_FLOAT; metadata.channels = 1; } @@ -315,24 +316,29 @@ static void sync_volume_object(BL::BlendData &b_data, std = ATTR_STD_VOLUME_TEMPERATURE; } else if (name == Attribute::standard_name(ATTR_STD_VOLUME_VELOCITY) || - name == b_volume.velocity_grid()) { + name == b_volume.velocity_grid()) + { std = ATTR_STD_VOLUME_VELOCITY; } else if (name == Attribute::standard_name(ATTR_STD_VOLUME_VELOCITY_X) || - name == b_volume.velocity_x_grid()) { + name == b_volume.velocity_x_grid()) + { std = ATTR_STD_VOLUME_VELOCITY_X; } else if (name == Attribute::standard_name(ATTR_STD_VOLUME_VELOCITY_Y) || - name == b_volume.velocity_y_grid()) { + name == b_volume.velocity_y_grid()) + { std = ATTR_STD_VOLUME_VELOCITY_Y; } else if (name == Attribute::standard_name(ATTR_STD_VOLUME_VELOCITY_Z) || - name == b_volume.velocity_z_grid()) { + name == b_volume.velocity_z_grid()) + { std = ATTR_STD_VOLUME_VELOCITY_Z; } if ((std != ATTR_STD_NONE && volume->need_attribute(scene, std)) || - volume->need_attribute(scene, name)) { + volume->need_attribute(scene, name)) + { Attribute *attr = (std != ATTR_STD_NONE) ? volume->attributes.add(std) : volume->attributes.add(name, TypeDesc::TypeFloat, ATTR_ELEMENT_VOXEL); diff --git a/intern/cycles/bvh/build.cpp b/intern/cycles/bvh/build.cpp index dd3b7954e11..e4aaf19abef 100644 --- a/intern/cycles/bvh/build.cpp +++ b/intern/cycles/bvh/build.cpp @@ -689,7 +689,8 @@ BVHNode *BVHBuild::build_node(const BVHObjectBinning &range, int level) if (!(range.size() > 0 && params.top_level && level == 0)) { /* Make leaf node when threshold reached or SAH tells us. */ if ((params.small_enough_for_leaf(size, level)) || - (range_within_max_leaf_size(range, references) && leafSAH < splitSAH)) { + (range_within_max_leaf_size(range, references) && leafSAH < splitSAH)) + { return create_leaf_node(range, references); } } @@ -708,7 +709,8 @@ BVHNode *BVHBuild::build_node(const BVHObjectBinning &range, int level) unalignedLeafSAH = params.sah_primitive_cost * unaligned_range.leafSAH; if (!(range.size() > 0 && params.top_level && level == 0)) { if (unalignedLeafSAH < unalignedSplitSAH && unalignedSplitSAH < splitSAH && - range_within_max_leaf_size(range, references)) { + range_within_max_leaf_size(range, references)) + { return create_leaf_node(range, references); } } diff --git a/intern/cycles/bvh/bvh2.cpp b/intern/cycles/bvh/bvh2.cpp index 3737ab6db99..1580ed58dd1 100644 --- a/intern/cycles/bvh/bvh2.cpp +++ b/intern/cycles/bvh/bvh2.cpp @@ -516,7 +516,8 @@ void BVH2::pack_instances(size_t nodes_size, size_t leaf_nodes_size) pack.object_node.resize(objects.size()); if (params.num_motion_curve_steps > 0 || params.num_motion_triangle_steps > 0 || - params.num_motion_point_steps > 0) { + params.num_motion_point_steps > 0) + { pack.prim_time.resize(prim_index_size); } diff --git a/intern/cycles/device/cpu/device_impl.cpp b/intern/cycles/device/cpu/device_impl.cpp index 7ca27d2dd7e..8434dd52d2f 100644 --- a/intern/cycles/device/cpu/device_impl.cpp +++ b/intern/cycles/device/cpu/device_impl.cpp @@ -265,7 +265,8 @@ void CPUDevice::build_bvh(BVH *bvh, Progress &progress, bool refit) #ifdef WITH_EMBREE if (bvh->params.bvh_layout == BVH_LAYOUT_EMBREE || bvh->params.bvh_layout == BVH_LAYOUT_MULTI_OPTIX_EMBREE || - bvh->params.bvh_layout == BVH_LAYOUT_MULTI_METAL_EMBREE) { + bvh->params.bvh_layout == BVH_LAYOUT_MULTI_METAL_EMBREE) + { BVHEmbree *const bvh_embree = static_cast(bvh); if (refit) { bvh_embree->refit(progress); diff --git a/intern/cycles/device/cuda/device.cpp b/intern/cycles/device/cuda/device.cpp index 5a213c45b71..b49ee1f8205 100644 --- a/intern/cycles/device/cuda/device.cpp +++ b/intern/cycles/device/cuda/device.cpp @@ -75,10 +75,12 @@ Device *device_cuda_create(const DeviceInfo &info, Stats &stats, Profiler &profi static CUresult device_cuda_safe_init() { # ifdef _WIN32 - __try { + __try + { return cuInit(0); } - __except (EXCEPTION_EXECUTE_HANDLER) { + __except (EXCEPTION_EXECUTE_HANDLER) + { /* Ignore crashes inside the CUDA driver and hope we can * survive even with corrupted CUDA installs. */ fprintf(stderr, "Cycles CUDA: driver crashed, continuing without CUDA.\n"); diff --git a/intern/cycles/device/cuda/device_impl.cpp b/intern/cycles/device/cuda/device_impl.cpp index ed868481e35..ddc0c937d67 100644 --- a/intern/cycles/device/cuda/device_impl.cpp +++ b/intern/cycles/device/cuda/device_impl.cpp @@ -333,7 +333,8 @@ string CUDADevice::compile_kernel(const string &common_cflags, return string(); } else if (!(nvcc_cuda_version == 101 || nvcc_cuda_version == 102 || nvcc_cuda_version == 111 || - nvcc_cuda_version == 112 || nvcc_cuda_version == 113 || nvcc_cuda_version == 114)) { + nvcc_cuda_version == 112 || nvcc_cuda_version == 113 || nvcc_cuda_version == 114)) + { printf( "CUDA version %d.%d detected, build may succeed but only " "CUDA 10.1 to 11.4 are officially supported.\n", @@ -847,7 +848,8 @@ void CUDADevice::tex_alloc(device_texture &mem) if (mem.info.data_type != IMAGE_DATA_TYPE_NANOVDB_FLOAT && mem.info.data_type != IMAGE_DATA_TYPE_NANOVDB_FLOAT3 && mem.info.data_type != IMAGE_DATA_TYPE_NANOVDB_FPN && - mem.info.data_type != IMAGE_DATA_TYPE_NANOVDB_FP16) { + mem.info.data_type != IMAGE_DATA_TYPE_NANOVDB_FP16) + { CUDA_RESOURCE_DESC resDesc; memset(&resDesc, 0, sizeof(resDesc)); diff --git a/intern/cycles/device/device.cpp b/intern/cycles/device/device.cpp index f36bb7d2fda..d1fc5f78dce 100644 --- a/intern/cycles/device/device.cpp +++ b/intern/cycles/device/device.cpp @@ -694,7 +694,8 @@ GPUDevice::Mem *GPUDevice::generic_alloc(device_memory &mem, size_t pitch_paddin * since other devices might be using the memory. */ if (!move_texture_to_host && pitch_padding == 0 && mem.host_pointer && - mem.host_pointer != shared_pointer) { + mem.host_pointer != shared_pointer) + { memcpy(shared_pointer, mem.host_pointer, size); /* A Call to device_memory::host_free() should be preceded by diff --git a/intern/cycles/device/hip/device.cpp b/intern/cycles/device/hip/device.cpp index b982dd39ed3..7a4b6db88d6 100644 --- a/intern/cycles/device/hip/device.cpp +++ b/intern/cycles/device/hip/device.cpp @@ -91,10 +91,12 @@ Device *device_hip_create(const DeviceInfo &info, Stats &stats, Profiler &profil static hipError_t device_hip_safe_init() { # ifdef _WIN32 - __try { + __try + { return hipInit(0); } - __except (EXCEPTION_EXECUTE_HANDLER) { + __except (EXCEPTION_EXECUTE_HANDLER) + { /* Ignore crashes inside the HIP driver and hope we can * survive even with corrupted HIP installs. */ fprintf(stderr, "Cycles HIP: driver crashed, continuing without HIP.\n"); diff --git a/intern/cycles/device/hip/device_impl.cpp b/intern/cycles/device/hip/device_impl.cpp index 2a63500cb5b..897035f0330 100644 --- a/intern/cycles/device/hip/device_impl.cpp +++ b/intern/cycles/device/hip/device_impl.cpp @@ -812,7 +812,8 @@ void HIPDevice::tex_alloc(device_texture &mem) if (mem.info.data_type != IMAGE_DATA_TYPE_NANOVDB_FLOAT && mem.info.data_type != IMAGE_DATA_TYPE_NANOVDB_FLOAT3 && mem.info.data_type != IMAGE_DATA_TYPE_NANOVDB_FPN && - mem.info.data_type != IMAGE_DATA_TYPE_NANOVDB_FP16) { + mem.info.data_type != IMAGE_DATA_TYPE_NANOVDB_FP16) + { /* Bindless textures. */ hipResourceDesc resDesc; memset(&resDesc, 0, sizeof(resDesc)); diff --git a/intern/cycles/device/hiprt/device_impl.cpp b/intern/cycles/device/hiprt/device_impl.cpp index beb255deba4..5d5c2d6b2a2 100644 --- a/intern/cycles/device/hiprt/device_impl.cpp +++ b/intern/cycles/device/hiprt/device_impl.cpp @@ -387,7 +387,8 @@ hiprtGeometryBuildInput HIPRTDevice::prepare_triangle_blas(BVHHIPRT *bvh, Mesh * geom_input.geomType = Triangle; if (mesh->has_motion_blur() && - !(bvh->params.num_motion_triangle_steps == 0 || bvh->params.use_spatial_split)) { + !(bvh->params.num_motion_triangle_steps == 0 || bvh->params.use_spatial_split)) + { const Attribute *attr_mP = mesh->attributes.find(ATTR_STD_MOTION_VERTEX_POSITION); const size_t num_triangles = mesh->num_triangles(); diff --git a/intern/cycles/device/metal/device_impl.mm b/intern/cycles/device/metal/device_impl.mm index 65fab56ee7b..58ac5c378ab 100644 --- a/intern/cycles/device/metal/device_impl.mm +++ b/intern/cycles/device/metal/device_impl.mm @@ -1032,8 +1032,7 @@ void MetalDevice::const_copy_to(const char *name, void *host, size_t size) offsetof(KernelParamsMetal, integrator_state), host, size, pointer_block_size); } # define KERNEL_DATA_ARRAY(data_type, tex_name) \ - else if (strcmp(name, #tex_name) == 0) \ - { \ + else if (strcmp(name, #tex_name) == 0) { \ update_launch_pointers(offsetof(KernelParamsMetal, tex_name), host, size, size); \ } # include "kernel/data_arrays.h" @@ -1096,9 +1095,8 @@ void MetalDevice::tex_alloc(device_texture &mem) } MTLStorageMode storage_mode = MTLStorageModeManaged; if (@available(macos 10.15, *)) { - if ([mtlDevice hasUnifiedMemory] && - device_vendor != - METAL_GPU_INTEL) { /* Intel GPUs don't support MTLStorageModeShared for MTLTextures */ + if ([mtlDevice hasUnifiedMemory] && device_vendor != METAL_GPU_INTEL) + { /* Intel GPUs don't support MTLStorageModeShared for MTLTextures */ storage_mode = MTLStorageModeShared; } } diff --git a/intern/cycles/device/metal/kernel.mm b/intern/cycles/device/metal/kernel.mm index ea0fb6ef3f4..0e3ec43e38d 100644 --- a/intern/cycles/device/metal/kernel.mm +++ b/intern/cycles/device/metal/kernel.mm @@ -263,7 +263,8 @@ bool ShaderCache::should_load_kernel(DeviceKernel device_kernel, if (pso_type != PSO_GENERIC) { /* Only specialize kernels where it can make an impact. */ if (device_kernel < DEVICE_KERNEL_INTEGRATOR_INTERSECT_CLOSEST || - device_kernel > DEVICE_KERNEL_INTEGRATOR_MEGAKERNEL) { + device_kernel > DEVICE_KERNEL_INTEGRATOR_MEGAKERNEL) + { return false; } @@ -400,7 +401,8 @@ bool MetalKernelPipeline::should_use_binary_archive() const if ((device_kernel >= DEVICE_KERNEL_INTEGRATOR_SHADE_BACKGROUND && device_kernel <= DEVICE_KERNEL_INTEGRATOR_SHADE_SHADOW) || (device_kernel >= DEVICE_KERNEL_SHADER_EVAL_DISPLACE && - device_kernel <= DEVICE_KERNEL_SHADER_EVAL_CURVE_SHADOW_TRANSPARENCY)) { + device_kernel <= DEVICE_KERNEL_SHADER_EVAL_CURVE_SHADOW_TRANSPARENCY)) + { /* Archive all shade kernels - they take a long time to compile. */ return true; } @@ -704,7 +706,8 @@ void MetalKernelPipeline::compile() if (creating_new_archive && ShaderCache::running) { NSError *error; if (![archive addComputePipelineFunctionsWithDescriptor:computePipelineStateDescriptor - error:&error]) { + error:&error]) + { NSString *errStr = [error localizedDescription]; metal_printf("Failed to add PSO to archive:\n%s\n", errStr ? [errStr UTF8String] : "nil"); diff --git a/intern/cycles/device/metal/queue.mm b/intern/cycles/device/metal/queue.mm index 800639691dc..336a07e1cd9 100644 --- a/intern/cycles/device/metal/queue.mm +++ b/intern/cycles/device/metal/queue.mm @@ -892,7 +892,8 @@ id MetalDeviceQueue::get_compute_encoder(DeviceKernel if (mtlComputeEncoder_) { if (mtlComputeEncoder_.dispatchType == concurrent ? MTLDispatchTypeConcurrent : - MTLDispatchTypeSerial) { + MTLDispatchTypeSerial) + { /* declare usage of MTLBuffers etc */ prepare_resources(kernel); diff --git a/intern/cycles/device/metal/util.mm b/intern/cycles/device/metal/util.mm index df4e146f759..f559d298cff 100644 --- a/intern/cycles/device/metal/util.mm +++ b/intern/cycles/device/metal/util.mm @@ -35,7 +35,8 @@ int MetalInfo::get_apple_gpu_core_count(id device) io_service_t gpu_service = IOServiceGetMatchingService( kIOMainPortDefault, IORegistryEntryIDMatching(device.registryID)); if (CFNumberRef numberRef = (CFNumberRef)IORegistryEntryCreateCFProperty( - gpu_service, CFSTR("gpu-core-count"), 0, 0)) { + gpu_service, CFSTR("gpu-core-count"), 0, 0)) + { if (CFGetTypeID(numberRef) == CFNumberGetTypeID()) { CFNumberGetValue(numberRef, kCFNumberSInt32Type, &core_count); } @@ -170,7 +171,8 @@ id MetalBufferPool::get_buffer(id device, /* Check if buffer matches size and storage mode and is old enough to reuse */ if (bufferEntry.buffer.length == length && storageMode == bufferEntry.buffer.storageMode && - cpuCacheMode == bufferEntry.buffer.cpuCacheMode) { + cpuCacheMode == bufferEntry.buffer.cpuCacheMode) + { buffer = bufferEntry.buffer; buffer_free_list.erase(entry); bufferEntry.command_buffer = command_buffer; diff --git a/intern/cycles/device/multi/device.cpp b/intern/cycles/device/multi/device.cpp index fb5534ab9cc..9f7ee7636a9 100644 --- a/intern/cycles/device/multi/device.cpp +++ b/intern/cycles/device/multi/device.cpp @@ -72,7 +72,8 @@ class MultiDevice : public Device { foreach (SubDevice &peer_sub, devices) { if (peer_sub.peer_island_index < 0 && peer_sub.device->info.type == sub.device->info.type && - peer_sub.device->check_peer_access(sub.device)) { + peer_sub.device->check_peer_access(sub.device)) + { peer_sub.peer_island_index = sub.peer_island_index; peer_islands[sub.peer_island_index].push_back(&peer_sub); } @@ -205,7 +206,8 @@ class MultiDevice : public Device { /* Skip building a bottom level acceleration structure for non-instanced geometry on Embree * (since they are put into the top level directly, see bvh_embree.cpp) */ if (!params.top_level && params.bvh_layout == BVH_LAYOUT_EMBREE && - !bvh->geometry[0]->is_instanced()) { + !bvh->geometry[0]->is_instanced()) + { i++; continue; } @@ -251,8 +253,8 @@ class MultiDevice : public Device { SubDevice *owner_sub = ⊂ if (owner_sub->ptr_map.find(key) == owner_sub->ptr_map.end()) { foreach (SubDevice *island_sub, peer_islands[sub.peer_island_index]) { - if (island_sub != owner_sub && - island_sub->ptr_map.find(key) != island_sub->ptr_map.end()) { + if (island_sub != owner_sub && island_sub->ptr_map.find(key) != island_sub->ptr_map.end()) + { owner_sub = island_sub; } } @@ -268,7 +270,8 @@ class MultiDevice : public Device { SubDevice *owner_sub = island.front(); foreach (SubDevice *island_sub, island) { if (key ? (island_sub->ptr_map.find(key) != island_sub->ptr_map.end()) : - (island_sub->device->stats.mem_used < owner_sub->device->stats.mem_used)) { + (island_sub->device->stats.mem_used < owner_sub->device->stats.mem_used)) + { owner_sub = island_sub; } } diff --git a/intern/cycles/device/oneapi/device_impl.cpp b/intern/cycles/device/oneapi/device_impl.cpp index d15e895a254..5eea6073178 100644 --- a/intern/cycles/device/oneapi/device_impl.cpp +++ b/intern/cycles/device/oneapi/device_impl.cpp @@ -696,8 +696,7 @@ void OneapiDevice::set_global_memory(SyclQueue *queue_, /* This macro will change global ptr of KernelGlobals via name matching. */ # define KERNEL_DATA_ARRAY(type, name) \ - else if (#name == matched_name) \ - { \ + else if (#name == matched_name) { \ globals->__##name = (type *)memory_device_pointer; \ return; \ } @@ -709,8 +708,7 @@ void OneapiDevice::set_global_memory(SyclQueue *queue_, } KERNEL_DATA_ARRAY(KernelData, data) # include "kernel/data_arrays.h" - else - { + else { std::cerr << "Can't found global/constant memory with name \"" << matched_name << "\"!" << std::endl; assert(false); @@ -823,7 +821,8 @@ std::vector OneapiDevice::available_devices() int driver_build_version = parse_driver_build_version(device); if ((driver_build_version > 100000 && driver_build_version < lowest_supported_driver_version_win) || - driver_build_version < lowest_supported_driver_version_neo) { + driver_build_version < lowest_supported_driver_version_neo) + { filter_out = true; } } @@ -965,7 +964,8 @@ int OneapiDevice::get_max_num_threads_per_multiprocessor() { const sycl::device &device = reinterpret_cast(device_queue_)->get_device(); if (device.has(sycl::aspect::ext_intel_gpu_eu_simd_width) && - device.has(sycl::aspect::ext_intel_gpu_hw_threads_per_eu)) { + device.has(sycl::aspect::ext_intel_gpu_hw_threads_per_eu)) + { return device.get_info() * device.get_info(); } diff --git a/intern/cycles/device/optix/device_impl.cpp b/intern/cycles/device/optix/device_impl.cpp index fa365fe8bb5..e699508c023 100644 --- a/intern/cycles/device/optix/device_impl.cpp +++ b/intern/cycles/device/optix/device_impl.cpp @@ -715,7 +715,8 @@ bool OptiXDevice::load_osl_kernels() vector osl_kernels; for (ShaderType type = SHADER_TYPE_SURFACE; type <= SHADER_TYPE_BUMP; - type = static_cast(type + 1)) { + type = static_cast(type + 1)) + { const vector &groups = (type == SHADER_TYPE_SURFACE ? osl_globals.surface_state : type == SHADER_TYPE_VOLUME ? @@ -1015,7 +1016,8 @@ bool OptiXDevice::build_optix_bvh(BVHOptiX *bvh, if (use_fast_trace_bvh || /* The build flags have to match the ones used to query the built-in curve intersection * program (see optixBuiltinISModuleGet above) */ - build_input.type == OPTIX_BUILD_INPUT_TYPE_CURVES) { + build_input.type == OPTIX_BUILD_INPUT_TYPE_CURVES) + { VLOG_INFO << "Using fast to trace OptiX BVH"; options.buildFlags = OPTIX_BUILD_FLAG_PREFER_FAST_TRACE | OPTIX_BUILD_FLAG_ALLOW_COMPACTION; } @@ -1522,7 +1524,8 @@ void OptiXDevice::build_bvh(BVH *bvh, Progress &progress, bool refit) } if (ob->get_geometry()->geometry_type == Geometry::HAIR && - static_cast(ob->get_geometry())->curve_shape == CURVE_THICK) { + static_cast(ob->get_geometry())->curve_shape == CURVE_THICK) + { if (pipeline_options.usesMotionBlur && ob->get_geometry()->has_motion_blur()) { /* Select between motion blur and non-motion blur built-in intersection module. */ instance.sbtOffset = PG_HITD_MOTION - PG_HITD; diff --git a/intern/cycles/device/optix/queue.cpp b/intern/cycles/device/optix/queue.cpp index b45bb72c22b..4bafa3f9f34 100644 --- a/intern/cycles/device/optix/queue.cpp +++ b/intern/cycles/device/optix/queue.cpp @@ -80,7 +80,8 @@ bool OptiXDeviceQueue::enqueue(DeviceKernel kernel, } if (kernel == DEVICE_KERNEL_SHADER_EVAL_DISPLACE || kernel == DEVICE_KERNEL_SHADER_EVAL_BACKGROUND || - kernel == DEVICE_KERNEL_SHADER_EVAL_CURVE_SHADOW_TRANSPARENCY) { + kernel == DEVICE_KERNEL_SHADER_EVAL_CURVE_SHADOW_TRANSPARENCY) + { cuda_device_assert(cuda_device_, cuMemcpyHtoDAsync(launch_params_ptr + offsetof(KernelParamsOptiX, offset), args.values[2], // &d_offset diff --git a/intern/cycles/hydra/curves.cpp b/intern/cycles/hydra/curves.cpp index 771ec42c725..edb43200845 100644 --- a/intern/cycles/hydra/curves.cpp +++ b/intern/cycles/hydra/curves.cpp @@ -72,7 +72,8 @@ void HdCyclesCurves::PopulatePoints(HdSceneDelegate *sceneDelegate) VtValue value; for (const HdExtComputationPrimvarDescriptor &desc : - sceneDelegate->GetExtComputationPrimvarDescriptors(GetId(), HdInterpolationVertex)) { + sceneDelegate->GetExtComputationPrimvarDescriptors(GetId(), HdInterpolationVertex)) + { if (desc.name == HdTokens->points) { auto valueStore = HdExtComputationUtils::GetComputedPrimvarValues({desc}, sceneDelegate); const auto valueStoreIt = valueStore.find(desc.name); @@ -179,7 +180,8 @@ void HdCyclesCurves::PopulatePrimvars(HdSceneDelegate *sceneDelegate) // Skip attributes that are not needed if ((std != ATTR_STD_NONE && _geom->need_attribute(scene, std)) || - _geom->need_attribute(scene, name)) { + _geom->need_attribute(scene, name)) + { ApplyPrimvars(_geom->attributes, name, value, interpolation.second, std); } } diff --git a/intern/cycles/hydra/display_driver.cpp b/intern/cycles/hydra/display_driver.cpp index 484d6ce06ba..7fc6fdfdbec 100644 --- a/intern/cycles/hydra/display_driver.cpp +++ b/intern/cycles/hydra/display_driver.cpp @@ -226,7 +226,8 @@ void HdCyclesDisplayDriver::draw(const Params ¶ms) const auto renderBuffer = static_cast( _renderParam->GetDisplayAovBinding().renderBuffer); if (!renderBuffer || // Ensure this render buffer matches the texture dimensions - (renderBuffer->GetWidth() != params.size.x || renderBuffer->GetHeight() != params.size.y)) { + (renderBuffer->GetWidth() != params.size.x || renderBuffer->GetHeight() != params.size.y)) + { return; } diff --git a/intern/cycles/hydra/instancer.cpp b/intern/cycles/hydra/instancer.cpp index 6b25a298a95..7b1c8d1926f 100644 --- a/intern/cycles/hydra/instancer.cpp +++ b/intern/cycles/hydra/instancer.cpp @@ -48,7 +48,8 @@ void HdCyclesInstancer::SyncPrimvars() sceneDelegate->GetRenderIndex().GetChangeTracker().GetInstancerDirtyBits(GetId()); for (const HdPrimvarDescriptor &desc : - sceneDelegate->GetPrimvarDescriptors(GetId(), HdInterpolationInstance)) { + sceneDelegate->GetPrimvarDescriptors(GetId(), HdInterpolationInstance)) + { if (!HdChangeTracker::IsPrimvarDirty(dirtyBits, GetId(), desc.name)) { continue; } @@ -119,7 +120,8 @@ VtMatrix4dArray HdCyclesInstancer::ComputeInstanceTransforms(const SdfPath &prot VtMatrix4dArray resultTransforms; if (const auto instancer = static_cast( - GetDelegate()->GetRenderIndex().GetInstancer(GetParentId()))) { + GetDelegate()->GetRenderIndex().GetInstancer(GetParentId()))) + { for (const GfMatrix4d &parentTransform : instancer->ComputeInstanceTransforms(GetId())) { for (const GfMatrix4d &localTransform : transforms) { resultTransforms.push_back(parentTransform * localTransform); diff --git a/intern/cycles/hydra/light.cpp b/intern/cycles/hydra/light.cpp index 86a0962a6b4..a512baf3797 100644 --- a/intern/cycles/hydra/light.cpp +++ b/intern/cycles/hydra/light.cpp @@ -168,7 +168,8 @@ void HdCyclesLight::Sync(HdSceneDelegate *sceneDelegate, } // Need to update shader graph when transform changes in case transform was baked into it else if (_light->tfm_is_modified() && (_lightType == HdPrimTypeTokens->domeLight || - _light->get_shader()->has_surface_spatial_varying)) { + _light->get_shader()->has_surface_spatial_varying)) + { PopulateShaderGraph(sceneDelegate); } diff --git a/intern/cycles/hydra/material.cpp b/intern/cycles/hydra/material.cpp index 92d7d675c11..88ca601c364 100644 --- a/intern/cycles/hydra/material.cpp +++ b/intern/cycles/hydra/material.cpp @@ -71,7 +71,8 @@ class UsdToCyclesMapping { } // TODO: Is there a better mapping than 'color'? if (name == CyclesMaterialTokens->r || name == CyclesMaterialTokens->g || - name == CyclesMaterialTokens->b) { + name == CyclesMaterialTokens->b) + { return "color"; } @@ -168,7 +169,8 @@ class UsdToCycles { usdNodeType == CyclesMaterialTokens->UsdPrimvarReader_float2 || usdNodeType == CyclesMaterialTokens->UsdPrimvarReader_float3 || usdNodeType == CyclesMaterialTokens->UsdPrimvarReader_float4 || - usdNodeType == CyclesMaterialTokens->UsdPrimvarReader_int) { + usdNodeType == CyclesMaterialTokens->UsdPrimvarReader_int) + { return &UsdPrimvarReader; } @@ -492,7 +494,8 @@ void HdCyclesMaterial::PopulateShaderGraph(const HdMaterialNetwork2 &networkMap) const char *inputName = nullptr; const char *outputName = nullptr; if (terminalName == HdMaterialTerminalTokens->surface || - terminalName == CyclesMaterialTokens->cyclesSurface) { + terminalName == CyclesMaterialTokens->cyclesSurface) + { inputName = "Surface"; // Find default output name based on the node if none is provided if (node->type->name == "add_closure" || node->type->name == "mix_closure") { @@ -506,11 +509,13 @@ void HdCyclesMaterial::PopulateShaderGraph(const HdMaterialNetwork2 &networkMap) } } else if (terminalName == HdMaterialTerminalTokens->displacement || - terminalName == CyclesMaterialTokens->cyclesDisplacement) { + terminalName == CyclesMaterialTokens->cyclesDisplacement) + { inputName = outputName = "Displacement"; } else if (terminalName == HdMaterialTerminalTokens->volume || - terminalName == CyclesMaterialTokens->cyclesVolume) { + terminalName == CyclesMaterialTokens->cyclesVolume) + { inputName = outputName = "Volume"; } diff --git a/intern/cycles/hydra/mesh.cpp b/intern/cycles/hydra/mesh.cpp index aef0d16dcc6..8d888d34885 100644 --- a/intern/cycles/hydra/mesh.cpp +++ b/intern/cycles/hydra/mesh.cpp @@ -53,7 +53,8 @@ VtValue ComputeTriangulatedFaceVaryingPrimvar(VtValue value, HdMeshUtil &meshUtil) { if (meshUtil.ComputeTriangulatedFaceVaryingPrimvar( - HdGetValueData(value), value.GetArraySize(), valueType, &value)) { + HdGetValueData(value), value.GetArraySize(), valueType, &value)) + { return value; } @@ -113,7 +114,8 @@ HdDirtyBits HdCyclesMesh::_PropagateDirtyBits(HdDirtyBits bits) const } if (bits & (HdChangeTracker::DirtyTopology | HdChangeTracker::DirtyDisplayStyle | - HdChangeTracker::DirtySubdivTags)) { + HdChangeTracker::DirtySubdivTags)) + { // Do full topology update when display style or subdivision changes bits |= HdChangeTracker::DirtyTopology | HdChangeTracker::DirtyDisplayStyle | HdChangeTracker::DirtySubdivTags; @@ -159,7 +161,8 @@ void HdCyclesMesh::PopulatePoints(HdSceneDelegate *sceneDelegate) VtValue value; for (const HdExtComputationPrimvarDescriptor &desc : - sceneDelegate->GetExtComputationPrimvarDescriptors(GetId(), HdInterpolationVertex)) { + sceneDelegate->GetExtComputationPrimvarDescriptors(GetId(), HdInterpolationVertex)) + { if (desc.name == HdTokens->points) { auto valueStore = HdExtComputationUtils::GetComputedPrimvarValues({desc}, sceneDelegate); const auto valueStoreIt = valueStore.find(desc.name); @@ -208,7 +211,8 @@ void HdCyclesMesh::PopulateNormals(HdSceneDelegate *sceneDelegate) for (int i = 0; i < HdInterpolationCount && interpolation == HdInterpolationCount; ++i) { for (const HdExtComputationPrimvarDescriptor &desc : sceneDelegate->GetExtComputationPrimvarDescriptors(GetId(), - static_cast(i))) { + static_cast(i))) + { if (desc.name == HdTokens->normals) { auto valueStore = HdExtComputationUtils::GetComputedPrimvarValues({desc}, sceneDelegate); const auto valueStoreIt = valueStore.find(desc.name); @@ -270,7 +274,8 @@ void HdCyclesMesh::PopulateNormals(HdSceneDelegate *sceneDelegate) TF_VERIFY(normals.size() == static_cast(_topology.GetNumFaceVaryings())); if (!_util.ComputeTriangulatedFaceVaryingPrimvar( - normals.data(), normals.size(), HdTypeFloatVec3, &value)) { + normals.data(), normals.size(), HdTypeFloatVec3, &value)) + { return; } @@ -340,7 +345,8 @@ void HdCyclesMesh::PopulatePrimvars(HdSceneDelegate *sceneDelegate) // Skip attributes that are not needed if ((std != ATTR_STD_NONE && _geom->need_attribute(scene, std)) || - _geom->need_attribute(scene, name)) { + _geom->need_attribute(scene, name)) + { const HdType valueType = HdGetValueTupleType(value).type; if (!subdivision) { diff --git a/intern/cycles/hydra/output_driver.cpp b/intern/cycles/hydra/output_driver.cpp index 3bef8a011b9..163f813b72e 100644 --- a/intern/cycles/hydra/output_driver.cpp +++ b/intern/cycles/hydra/output_driver.cpp @@ -44,7 +44,8 @@ bool HdCyclesOutputDriver::update_render_tile(const Tile &tile) // Avoid extra copy by mapping render buffer directly when dimensions/format match the tile if (tile.offset.x == 0 && tile.offset.y == 0 && tile.size.x == renderBuffer->GetWidth() && tile.size.y == renderBuffer->GetHeight() && - (format >= HdFormatFloat32 && format <= HdFormatFloat32Vec4)) { + (format >= HdFormatFloat32 && format <= HdFormatFloat32Vec4)) + { float *const data = static_cast(renderBuffer->Map()); TF_VERIFY(tile.get_pass_pixels(aovBinding.aovName.GetString(), channels, data)); renderBuffer->Unmap(); diff --git a/intern/cycles/hydra/pointcloud.cpp b/intern/cycles/hydra/pointcloud.cpp index 2d274f190a2..ba964e2744d 100644 --- a/intern/cycles/hydra/pointcloud.cpp +++ b/intern/cycles/hydra/pointcloud.cpp @@ -74,7 +74,8 @@ void HdCyclesPoints::PopulatePoints(HdSceneDelegate *sceneDelegate) VtValue value; for (const HdExtComputationPrimvarDescriptor &desc : - sceneDelegate->GetExtComputationPrimvarDescriptors(GetId(), HdInterpolationVertex)) { + sceneDelegate->GetExtComputationPrimvarDescriptors(GetId(), HdInterpolationVertex)) + { if (desc.name == HdTokens->points) { auto valueStore = HdExtComputationUtils::GetComputedPrimvarValues({desc}, sceneDelegate); const auto valueStoreIt = valueStore.find(desc.name); @@ -187,7 +188,8 @@ void HdCyclesPoints::PopulatePrimvars(HdSceneDelegate *sceneDelegate) // Skip attributes that are not needed if ((std != ATTR_STD_NONE && _geom->need_attribute(scene, std)) || - _geom->need_attribute(scene, name)) { + _geom->need_attribute(scene, name)) + { ApplyPrimvars(_geom->attributes, name, value, interpolation.second, std); } } diff --git a/intern/cycles/hydra/render_delegate.cpp b/intern/cycles/hydra/render_delegate.cpp index 28c23e4f21b..6b22ac36e00 100644 --- a/intern/cycles/hydra/render_delegate.cpp +++ b/intern/cycles/hydra/render_delegate.cpp @@ -123,7 +123,8 @@ HdCyclesDelegate::HdCyclesDelegate(const HdRenderSettingsMap &settingsMap, for (const auto &setting : settingsMap) { // Skip over the settings known to be used for initialization only if (setting.first == HdCyclesRenderSettingsTokens->device || - setting.first == HdCyclesRenderSettingsTokens->threads) { + setting.first == HdCyclesRenderSettingsTokens->threads) + { continue; } @@ -284,7 +285,8 @@ HdSprim *HdCyclesDelegate::CreateSprim(const TfToken &typeId, const SdfPath &spr } if (typeId == HdPrimTypeTokens->diskLight || typeId == HdPrimTypeTokens->distantLight || typeId == HdPrimTypeTokens->domeLight || typeId == HdPrimTypeTokens->rectLight || - typeId == HdPrimTypeTokens->sphereLight) { + typeId == HdPrimTypeTokens->sphereLight) + { return new HdCyclesLight(sprimId, typeId); } if (typeId == HdPrimTypeTokens->extComputation) { @@ -400,7 +402,8 @@ HdAovDescriptor HdCyclesDelegate::GetDefaultAovDescriptor(const TfToken &name) c return HdAovDescriptor(HdFormatFloat32Vec3, false, VtValue(GfVec3f(0.0f))); } if (name == HdAovTokens->primId || name == HdAovTokens->instanceId || - name == HdAovTokens->elementId) { + name == HdAovTokens->elementId) + { return HdAovDescriptor(HdFormatInt32, false, VtValue(-1)); } diff --git a/intern/cycles/hydra/render_pass.cpp b/intern/cycles/hydra/render_pass.cpp index be787382158..e7d6712410f 100644 --- a/intern/cycles/hydra/render_pass.cpp +++ b/intern/cycles/hydra/render_pass.cpp @@ -90,8 +90,8 @@ void HdCyclesRenderPass::_Execute(const HdRenderPassStateSharedPtr &renderPassSt const HdRenderPassAovBindingVector &aovBindings = renderPassState->GetAovBindings(); if (_renderParam->GetAovBindings() != aovBindings || // Need to resync passes when denoising is enabled or disabled to update the pass mode - (settingsVersion != _lastSettingsVersion && - scene->integrator->use_denoise_is_modified())) { + (settingsVersion != _lastSettingsVersion && scene->integrator->use_denoise_is_modified())) + { _renderParam->SyncAovBindings(aovBindings); if (renderDelegate->IsDisplaySupported()) { diff --git a/intern/cycles/hydra/volume.cpp b/intern/cycles/hydra/volume.cpp index f2bac15d3b5..fe19195dd0a 100644 --- a/intern/cycles/hydra/volume.cpp +++ b/intern/cycles/hydra/volume.cpp @@ -44,10 +44,11 @@ void HdCyclesVolume::Populate(HdSceneDelegate *sceneDelegate, HdDirtyBits dirtyB Scene *const scene = (Scene *)_geom->get_owner(); if (dirtyBits & HdChangeTracker::DirtyVolumeField) { - for (const HdVolumeFieldDescriptor &field : - sceneDelegate->GetVolumeFieldDescriptors(GetId())) { + for (const HdVolumeFieldDescriptor &field : sceneDelegate->GetVolumeFieldDescriptors(GetId())) + { if (const auto openvdbAsset = static_cast( - sceneDelegate->GetRenderIndex().GetBprim(_tokens->openvdbAsset, field.fieldId))) { + sceneDelegate->GetRenderIndex().GetBprim(_tokens->openvdbAsset, field.fieldId))) + { const ustring name(field.fieldName.GetString()); AttributeStandard std = ATTR_STD_NONE; @@ -72,7 +73,8 @@ void HdCyclesVolume::Populate(HdSceneDelegate *sceneDelegate, HdDirtyBits dirtyB // Skip attributes that are not needed if ((std != ATTR_STD_NONE && _geom->need_attribute(scene, std)) || - _geom->need_attribute(scene, name)) { + _geom->need_attribute(scene, name)) + { Attribute *const attr = (std != ATTR_STD_NONE) ? _geom->attributes.add(std) : _geom->attributes.add( diff --git a/intern/cycles/integrator/denoiser.cpp b/intern/cycles/integrator/denoiser.cpp index ee0fd04f509..17f0d8b869b 100644 --- a/intern/cycles/integrator/denoiser.cpp +++ b/intern/cycles/integrator/denoiser.cpp @@ -109,8 +109,8 @@ static Device *find_best_device(Device *device, DenoiserType type) } else { /* Prefer a device that can use graphics interop for faster display update. */ - if (sub_device->should_use_graphics_interop() && - !best_device->should_use_graphics_interop()) { + if (sub_device->should_use_graphics_interop() && !best_device->should_use_graphics_interop()) + { best_device = sub_device; } diff --git a/intern/cycles/integrator/denoiser_oidn.cpp b/intern/cycles/integrator/denoiser_oidn.cpp index 04e659a15e2..f7c94203eb1 100644 --- a/intern/cycles/integrator/denoiser_oidn.cpp +++ b/intern/cycles/integrator/denoiser_oidn.cpp @@ -164,7 +164,8 @@ class OIDNDenoiseContext { oidn_filter.set("hdr", true); oidn_filter.set("srgb", false); if (denoise_params_.prefilter == DENOISER_PREFILTER_NONE || - denoise_params_.prefilter == DENOISER_PREFILTER_ACCURATE) { + denoise_params_.prefilter == DENOISER_PREFILTER_ACCURATE) + { oidn_filter.set("cleanAux", true); } oidn_filter.commit(); @@ -189,7 +190,8 @@ class OIDNDenoiseContext { void filter_guiding_pass_if_needed(oidn::DeviceRef &oidn_device, OIDNPass &oidn_pass) { if (denoise_params_.prefilter != DENOISER_PREFILTER_ACCURATE || !oidn_pass || - oidn_pass.is_filtered) { + oidn_pass.is_filtered) + { return; } diff --git a/intern/cycles/integrator/pass_accessor.cpp b/intern/cycles/integrator/pass_accessor.cpp index ab056e953c2..bce07232862 100644 --- a/intern/cycles/integrator/pass_accessor.cpp +++ b/intern/cycles/integrator/pass_accessor.cpp @@ -180,7 +180,8 @@ bool PassAccessor::get_render_tile_pixels(const RenderBuffers *render_buffers, } else if ((pass_info.divide_type != PASS_NONE || pass_info.direct_type != PASS_NONE || pass_info.indirect_type != PASS_NONE) && - mode != PassMode::DENOISED) { + mode != PassMode::DENOISED) + { /* RGB lighting passes that need to divide out color and/or sum direct and indirect. * These can also optionally write alpha like the combined pass. */ get_pass_light_path(render_buffers, buffer_params, destination); diff --git a/intern/cycles/integrator/path_trace.cpp b/intern/cycles/integrator/path_trace.cpp index 4812ff2614d..cbfab137833 100644 --- a/intern/cycles/integrator/path_trace.cpp +++ b/intern/cycles/integrator/path_trace.cpp @@ -348,7 +348,8 @@ void PathTrace::update_work_buffer_params_if_needed(const RenderWork &render_wor } if (render_state_.need_reset_params || - render_state_.resolution_divider != render_work.resolution_divider) { + render_state_.resolution_divider != render_work.resolution_divider) + { update_effective_work_buffer_params(render_work); } @@ -565,7 +566,8 @@ void PathTrace::denoise(const RenderWork &render_work) if (denoiser_->denoise_buffer(render_state_.effective_big_tile_params, buffer_to_denoise, get_num_samples_in_buffer(), - allow_inplace_modification)) { + allow_inplace_modification)) + { render_state_.has_denoised_result = true; } diff --git a/intern/cycles/integrator/path_trace_display.cpp b/intern/cycles/integrator/path_trace_display.cpp index 0bd68c80aae..d77906fef75 100644 --- a/intern/cycles/integrator/path_trace_display.cpp +++ b/intern/cycles/integrator/path_trace_display.cpp @@ -117,7 +117,8 @@ void PathTraceDisplay::copy_pixels_to_texture( const int texture_height = texture_state_.size.y; if (texture_x == 0 && texture_y == 0 && pixels_width == texture_width && - pixels_height == texture_height) { + pixels_height == texture_height) + { const size_t size_in_bytes = sizeof(half4) * texture_width * texture_height; memcpy(mapped_rgba_pixels, rgba_pixels, size_in_bytes); } diff --git a/intern/cycles/integrator/path_trace_work_cpu.cpp b/intern/cycles/integrator/path_trace_work_cpu.cpp index 6aaa31a1a65..0864740a86d 100644 --- a/intern/cycles/integrator/path_trace_work_cpu.cpp +++ b/intern/cycles/integrator/path_trace_work_cpu.cpp @@ -232,7 +232,8 @@ int PathTraceWorkCPU::adaptive_sampling_converge_filter_count_active(float thres uint num_row_pixels_active = 0; for (int x = 0; x < width; ++x) { if (!kernels_.adaptive_sampling_convergence_check( - kernel_globals, render_buffer, full_x + x, y, threshold, reset, offset, stride)) { + kernel_globals, render_buffer, full_x + x, y, threshold, reset, offset, stride)) + { ++num_row_pixels_active; row_converged = false; } diff --git a/intern/cycles/integrator/path_trace_work_gpu.cpp b/intern/cycles/integrator/path_trace_work_gpu.cpp index 9bba6ed5570..325cd30df10 100644 --- a/intern/cycles/integrator/path_trace_work_gpu.cpp +++ b/intern/cycles/integrator/path_trace_work_gpu.cpp @@ -22,7 +22,8 @@ static size_t estimate_single_state_size(const uint kernel_features) { size_t state_size = 0; -#define KERNEL_STRUCT_BEGIN(name) for (int array_index = 0;; array_index++) { +#define KERNEL_STRUCT_BEGIN(name) \ + for (int array_index = 0;; array_index++) { #define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) \ state_size += (kernel_features & (feature)) ? sizeof(type) : 0; #define KERNEL_STRUCT_ARRAY_MEMBER(parent_struct, type, name, feature) \ @@ -96,7 +97,8 @@ void PathTraceWorkGPU::alloc_integrator_soa() const int requested_volume_stack_size = device_scene_->data.volume_stack_size; const uint kernel_features = device_scene_->data.kernel_features; if ((integrator_state_soa_kernel_features_ & kernel_features) == kernel_features && - integrator_state_soa_volume_stack_size_ >= requested_volume_stack_size) { + integrator_state_soa_volume_stack_size_ >= requested_volume_stack_size) + { return; } integrator_state_soa_kernel_features_ = kernel_features; @@ -121,7 +123,8 @@ void PathTraceWorkGPU::alloc_integrator_soa() * write the pointers into a struct that resides in constant memory. * * TODO: store float3 in separate XYZ arrays. */ -#define KERNEL_STRUCT_BEGIN(name) for (int array_index = 0;; array_index++) { +#define KERNEL_STRUCT_BEGIN(name) \ + for (int array_index = 0;; array_index++) { #define KERNEL_STRUCT_MEMBER(parent_struct, type, name, feature) \ if ((kernel_features & (feature)) && (integrator_state_gpu_.parent_struct.name == nullptr)) { \ device_only_memory *array = new device_only_memory(device_, \ @@ -132,7 +135,8 @@ void PathTraceWorkGPU::alloc_integrator_soa() } #define KERNEL_STRUCT_ARRAY_MEMBER(parent_struct, type, name, feature) \ if ((kernel_features & (feature)) && \ - (integrator_state_gpu_.parent_struct[array_index].name == nullptr)) { \ + (integrator_state_gpu_.parent_struct[array_index].name == nullptr)) \ + { \ device_only_memory *array = new device_only_memory(device_, \ "integrator_state_" #name); \ array->alloc_to_device(max_num_paths_); \ @@ -611,7 +615,8 @@ void PathTraceWorkGPU::compact_main_paths(const int num_active_paths) const int min_compact_paths = 32; if (max_active_main_path_index_ == num_active_paths || - max_active_main_path_index_ < min_compact_paths) { + max_active_main_path_index_ < min_compact_paths) + { return; } @@ -647,7 +652,8 @@ void PathTraceWorkGPU::compact_shadow_paths() const float shadow_compact_ratio = 0.5f; const int min_compact_paths = 32; if (integrator_next_shadow_path_index_.data()[0] < num_active_paths * shadow_compact_ratio || - integrator_next_shadow_path_index_.data()[0] < min_compact_paths) { + integrator_next_shadow_path_index_.data()[0] < min_compact_paths) + { return; } diff --git a/intern/cycles/integrator/render_scheduler.cpp b/intern/cycles/integrator/render_scheduler.cpp index 8568fe93a52..f54f78413b3 100644 --- a/intern/cycles/integrator/render_scheduler.cpp +++ b/intern/cycles/integrator/render_scheduler.cpp @@ -465,7 +465,8 @@ void RenderScheduler::report_work_begin(const RenderWork &render_work) * because it might be wrongly 0. Check for whether path tracing is actually happening as it is * expected to happen in the first work. */ if (render_work.resolution_divider == pixel_size_ && render_work.path_trace.num_samples != 0 && - render_work.path_trace.start_sample == get_start_sample()) { + render_work.path_trace.start_sample == get_start_sample()) + { state_.start_render_time = time_dt(); } } diff --git a/intern/cycles/kernel/bvh/local.h b/intern/cycles/kernel/bvh/local.h index add61adc126..e5c28b4a27e 100644 --- a/intern/cycles/kernel/bvh/local.h +++ b/intern/cycles/kernel/bvh/local.h @@ -159,7 +159,8 @@ ccl_device_inline tmin, isect_t, lcg_state, - max_hits)) { + max_hits)) + { return true; } } @@ -196,7 +197,8 @@ ccl_device_inline tmin, isect_t, lcg_state, - max_hits)) { + max_hits)) + { return true; } } diff --git a/intern/cycles/kernel/bvh/traversal.h b/intern/cycles/kernel/bvh/traversal.h index f3744aca5c0..bc52f46b433 100644 --- a/intern/cycles/kernel/bvh/traversal.h +++ b/intern/cycles/kernel/bvh/traversal.h @@ -140,7 +140,8 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals kg, visibility, prim_object, prim, - prim_addr)) { + prim_addr)) + { /* shadow ray early termination */ if (visibility & PATH_RAY_SHADOW_OPAQUE) return true; @@ -159,7 +160,8 @@ ccl_device_noinline bool BVH_FUNCTION_FULL_NAME(BVH)(KernelGlobals kg, visibility, prim_object, prim, - prim_addr)) { + prim_addr)) + { /* shadow ray early termination */ if (visibility & PATH_RAY_SHADOW_OPAQUE) return true; diff --git a/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h b/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h index 32f6ae17d1c..f55ebefd987 100644 --- a/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h +++ b/intern/cycles/kernel/closure/bsdf_ashikhmin_shirley.h @@ -55,7 +55,8 @@ ccl_device_forceinline Spectrum bsdf_ashikhmin_shirley_eval(ccl_private const Sh float out = 0.0f; if ((cosNgO < 0.0f) || fmaxf(bsdf->alpha_x, bsdf->alpha_y) <= 1e-4f || - !(NdotI > 0.0f && NdotO > 0.0f)) { + !(NdotI > 0.0f && NdotO > 0.0f)) + { *pdf = 0.0f; return zero_spectrum(); } diff --git a/intern/cycles/kernel/closure/bsdf_microfacet.h b/intern/cycles/kernel/closure/bsdf_microfacet.h index 6bf463f9301..89fec29d43b 100644 --- a/intern/cycles/kernel/closure/bsdf_microfacet.h +++ b/intern/cycles/kernel/closure/bsdf_microfacet.h @@ -399,7 +399,8 @@ ccl_device Spectrum bsdf_microfacet_eval(ccl_private const ShaderClosure *sc, * - Purely refractive closures can't have reflection. */ if ((cos_NI <= 0) || (alpha_x * alpha_y <= 1e-7f) || ((cos_NgO < 0.0f) != is_refraction) || - (is_refraction && !m_refractive) || (!is_refraction && m_refractive && !m_glass)) { + (is_refraction && !m_refractive) || (!is_refraction && m_refractive && !m_glass)) + { *pdf = 0.0f; return zero_spectrum(); } diff --git a/intern/cycles/kernel/closure/bsdf_microfacet_multi_impl.h b/intern/cycles/kernel/closure/bsdf_microfacet_multi_impl.h index 8b595ebfa3b..af1a821b361 100644 --- a/intern/cycles/kernel/closure/bsdf_microfacet_multi_impl.h +++ b/intern/cycles/kernel/closure/bsdf_microfacet_multi_impl.h @@ -38,7 +38,8 @@ ccl_device_forceinline Spectrum MF_FUNCTION_FULL_NAME(mf_eval)(float3 wi, } else #endif - if (wo.z < wi.z) { + if (wo.z < wi.z) + { swapped = true; float3 tmp = wo; wo = wi; diff --git a/intern/cycles/kernel/device/cpu/bvh.h b/intern/cycles/kernel/device/cpu/bvh.h index 0870e7da2fb..bdf2a13db39 100644 --- a/intern/cycles/kernel/device/cpu/bvh.h +++ b/intern/cycles/kernel/device/cpu/bvh.h @@ -284,7 +284,8 @@ ccl_device_forceinline void kernel_embree_filter_intersection_func_impl( const Ray *cray = ctx->ray; if (kernel_embree_is_self_intersection( - kg, hit, cray, reinterpret_cast(args->geometryUserPtr))) { + kg, hit, cray, reinterpret_cast(args->geometryUserPtr))) + { *args->valid = 0; } } @@ -577,7 +578,8 @@ ccl_device void kernel_embree_filter_func_backface_cull(const RTCFilterFunctionN /* Always ignore back-facing intersections. */ if (dot(make_float3(ray->dir_x, ray->dir_y, ray->dir_z), - make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z)) > 0.0f) { + make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z)) > 0.0f) + { *args->valid = 0; return; } @@ -587,7 +589,8 @@ ccl_device void kernel_embree_filter_func_backface_cull(const RTCFilterFunctionN const Ray *cray = ctx->ray; if (kernel_embree_is_self_intersection( - kg, hit, cray, reinterpret_cast(args->geometryUserPtr))) { + kg, hit, cray, reinterpret_cast(args->geometryUserPtr))) + { *args->valid = 0; } } @@ -600,7 +603,8 @@ ccl_device void kernel_embree_filter_occluded_func_backface_cull( /* Always ignore back-facing intersections. */ if (dot(make_float3(ray->dir_x, ray->dir_y, ray->dir_z), - make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z)) > 0.0f) { + make_float3(hit->Ng_x, hit->Ng_y, hit->Ng_z)) > 0.0f) + { *args->valid = 0; return; } diff --git a/intern/cycles/kernel/device/cpu/kernel.cpp b/intern/cycles/kernel/device/cpu/kernel.cpp index 558431961ab..191da05337a 100644 --- a/intern/cycles/kernel/device/cpu/kernel.cpp +++ b/intern/cycles/kernel/device/cpu/kernel.cpp @@ -72,8 +72,7 @@ void kernel_global_memory_copy(KernelGlobalsCPU *kg, const char *name, void *mem } #define KERNEL_DATA_ARRAY(type, tname) \ - else if (strcmp(name, #tname) == 0) \ - { \ + else if (strcmp(name, #tname) == 0) { \ kg->tname.data = (type *)mem; \ kg->tname.width = size; \ } diff --git a/intern/cycles/kernel/device/gpu/image.h b/intern/cycles/kernel/device/gpu/image.h index 60bf1890072..8f2f4ccfef1 100644 --- a/intern/cycles/kernel/device/gpu/image.h +++ b/intern/cycles/kernel/device/gpu/image.h @@ -193,7 +193,8 @@ ccl_device float4 kernel_tex_image_interp(KernelGlobals kg, int id, float x, flo /* float4, byte4, ushort4 and half4 */ const int texture_type = info.data_type; if (texture_type == IMAGE_DATA_TYPE_FLOAT4 || texture_type == IMAGE_DATA_TYPE_BYTE4 || - texture_type == IMAGE_DATA_TYPE_HALF4 || texture_type == IMAGE_DATA_TYPE_USHORT4) { + texture_type == IMAGE_DATA_TYPE_HALF4 || texture_type == IMAGE_DATA_TYPE_USHORT4) + { if (info.interpolation == INTERPOLATION_CUBIC || info.interpolation == INTERPOLATION_SMART) { return kernel_tex_image_interp_bicubic(info, x, y); } @@ -256,7 +257,8 @@ ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals kg, } #endif if (texture_type == IMAGE_DATA_TYPE_FLOAT4 || texture_type == IMAGE_DATA_TYPE_BYTE4 || - texture_type == IMAGE_DATA_TYPE_HALF4 || texture_type == IMAGE_DATA_TYPE_USHORT4) { + texture_type == IMAGE_DATA_TYPE_HALF4 || texture_type == IMAGE_DATA_TYPE_USHORT4) + { if (interpolation == INTERPOLATION_CUBIC || interpolation == INTERPOLATION_SMART) { return kernel_tex_image_interp_tricubic(info, x, y, z); } diff --git a/intern/cycles/kernel/device/gpu/parallel_sorted_index.h b/intern/cycles/kernel/device/gpu/parallel_sorted_index.h index f5053587853..665a9ca8065 100644 --- a/intern/cycles/kernel/device/gpu/parallel_sorted_index.h +++ b/intern/cycles/kernel/device/gpu/parallel_sorted_index.h @@ -53,7 +53,8 @@ ccl_device_inline void gpu_parallel_sort_bucket_pass(const uint num_states, const uint partition_end = min(num_states, partition_start + partition_size); for (int state_index = partition_start + uint(local_id); state_index < partition_end; - state_index += uint(local_size)) { + state_index += uint(local_size)) + { ushort kernel_index = d_queued_kernel[state_index]; if (kernel_index == queued_kernel) { uint key = d_shader_sort_key[state_index] % max_shaders; @@ -115,7 +116,8 @@ ccl_device_inline void gpu_parallel_sort_write_pass(const uint num_states, ccl_global int *key_offsets = partition_key_offsets + (uint(grid_id) * max_shaders); for (int state_index = partition_start + uint(local_id); state_index < partition_end; - state_index += uint(local_size)) { + state_index += uint(local_size)) + { ushort kernel_index = d_queued_kernel[state_index]; if (kernel_index == queued_kernel) { uint key = d_shader_sort_key[state_index] % max_shaders; diff --git a/intern/cycles/kernel/device/hiprt/common.h b/intern/cycles/kernel/device/hiprt/common.h index 1017857d8f9..44e9846d42a 100644 --- a/intern/cycles/kernel/device/hiprt/common.h +++ b/intern/cycles/kernel/device/hiprt/common.h @@ -442,7 +442,8 @@ ccl_device_inline bool shadow_intersection_filter(const hiprtRay &ray, # else if (num_hits >= max_hits || - !(intersection_get_shader_flags(NULL, prim, type) & SD_HAS_TRANSPARENT_SHADOW)) { + !(intersection_get_shader_flags(NULL, prim, type) & SD_HAS_TRANSPARENT_SHADOW)) + { return false; } diff --git a/intern/cycles/kernel/device/oneapi/image.h b/intern/cycles/kernel/device/oneapi/image.h index bdb81bb8645..970b394024d 100644 --- a/intern/cycles/kernel/device/oneapi/image.h +++ b/intern/cycles/kernel/device/oneapi/image.h @@ -330,7 +330,8 @@ ccl_device float4 kernel_tex_image_interp_3d(KernelGlobals, int id, float3 P, in if (info.data_type == IMAGE_DATA_TYPE_NANOVDB_FLOAT || info.data_type == IMAGE_DATA_TYPE_NANOVDB_FLOAT3 || info.data_type == IMAGE_DATA_TYPE_NANOVDB_FPN || - info.data_type == IMAGE_DATA_TYPE_NANOVDB_FP16) { + info.data_type == IMAGE_DATA_TYPE_NANOVDB_FP16) + { return make_float4( TEX_IMAGE_MISSING_R, TEX_IMAGE_MISSING_G, TEX_IMAGE_MISSING_B, TEX_IMAGE_MISSING_A); } diff --git a/intern/cycles/kernel/device/oneapi/kernel.cpp b/intern/cycles/kernel/device/oneapi/kernel.cpp index e4e0f01add1..f57a2ee9255 100644 --- a/intern/cycles/kernel/device/oneapi/kernel.cpp +++ b/intern/cycles/kernel/device/oneapi/kernel.cpp @@ -217,7 +217,8 @@ bool oneapi_load_kernels(SyclQueue *queue_, const std::string &kernel_name = kernel_id.get_name(); if (!oneapi_kernel_is_required_for_features(kernel_name, kernel_features) || - !oneapi_kernel_is_using_embree(kernel_name)) { + !oneapi_kernel_is_using_embree(kernel_name)) + { continue; } @@ -259,7 +260,8 @@ bool oneapi_load_kernels(SyclQueue *queue_, /* In case HWRT is on, compilation of kernels using Embree is already handled in previous * block. */ if (!oneapi_kernel_is_required_for_features(kernel_name, kernel_features) || - (use_hardware_raytracing && oneapi_kernel_is_using_embree(kernel_name))) { + (use_hardware_raytracing && oneapi_kernel_is_using_embree(kernel_name))) + { continue; } @@ -323,7 +325,8 @@ bool oneapi_enqueue_kernel(KernelContext *kernel_context, device_kernel == DEVICE_KERNEL_INTEGRATOR_TERMINATED_PATHS_ARRAY || device_kernel == DEVICE_KERNEL_INTEGRATOR_TERMINATED_SHADOW_PATHS_ARRAY || device_kernel == DEVICE_KERNEL_INTEGRATOR_COMPACT_PATHS_ARRAY || - device_kernel == DEVICE_KERNEL_INTEGRATOR_COMPACT_SHADOW_PATHS_ARRAY) { + device_kernel == DEVICE_KERNEL_INTEGRATOR_COMPACT_SHADOW_PATHS_ARRAY) + { int num_states = *((int *)(args[0])); /* Round up to the next work-group. */ size_t groups_count = (num_states + local_size - 1) / local_size; diff --git a/intern/cycles/kernel/device/optix/bvh.h b/intern/cycles/kernel/device/optix/bvh.h index b3062e49931..a1c0acafd88 100644 --- a/intern/cycles/kernel/device/optix/bvh.h +++ b/intern/cycles/kernel/device/optix/bvh.h @@ -195,7 +195,8 @@ extern "C" __global__ void __anyhit__kernel_optix_shadow_all_hit() /* If no transparent shadows, all light is blocked and we can stop immediately. */ if (num_hits >= max_hits || - !(intersection_get_shader_flags(NULL, prim, type) & SD_HAS_TRANSPARENT_SHADOW)) { + !(intersection_get_shader_flags(NULL, prim, type) & SD_HAS_TRANSPARENT_SHADOW)) + { optixSetPayload_5(true); return optixTerminateRay(); } diff --git a/intern/cycles/kernel/film/data_passes.h b/intern/cycles/kernel/film/data_passes.h index 0ed5828ff30..d0035b107a4 100644 --- a/intern/cycles/kernel/film/data_passes.h +++ b/intern/cycles/kernel/film/data_passes.h @@ -68,7 +68,8 @@ ccl_device_inline void film_write_data_passes(KernelGlobals kg, } if (!(sd->flag & SD_TRANSPARENT) || kernel_data.film.pass_alpha_threshold == 0.0f || - average(surface_shader_alpha(kg, sd)) >= kernel_data.film.pass_alpha_threshold) { + average(surface_shader_alpha(kg, sd)) >= kernel_data.film.pass_alpha_threshold) + { if (flag & PASSMASK(NORMAL)) { const float3 normal = surface_shader_average_normal(kg, sd); film_write_pass_float3(buffer + kernel_data.film.pass_normal, normal); diff --git a/intern/cycles/kernel/film/light_passes.h b/intern/cycles/kernel/film/light_passes.h index 4cfd1aef43a..98b46997806 100644 --- a/intern/cycles/kernel/film/light_passes.h +++ b/intern/cycles/kernel/film/light_passes.h @@ -366,7 +366,8 @@ ccl_device_inline void film_write_emission_or_background_pass( const bool is_shadowcatcher = (path_flag & PATH_RAY_SHADOW_CATCHER_HIT) != 0; if (!is_shadowcatcher && lightgroup != LIGHTGROUP_NONE && - kernel_data.film.pass_lightgroup != PASS_UNUSED) { + kernel_data.film.pass_lightgroup != PASS_UNUSED) + { film_write_pass_spectrum(buffer + kernel_data.film.pass_lightgroup + 3 * lightgroup, contribution); } diff --git a/intern/cycles/kernel/film/read.h b/intern/cycles/kernel/film/read.h index 108f992e29d..ccea547b231 100644 --- a/intern/cycles/kernel/film/read.h +++ b/intern/cycles/kernel/film/read.h @@ -538,8 +538,8 @@ ccl_device_inline void film_apply_pass_pixel_overlays_rgba( ccl_global const float *ccl_restrict buffer, ccl_private float *ccl_restrict pixel) { - if (kfilm_convert->show_active_pixels && - kfilm_convert->pass_adaptive_aux_buffer != PASS_UNUSED) { + if (kfilm_convert->show_active_pixels && kfilm_convert->pass_adaptive_aux_buffer != PASS_UNUSED) + { if (buffer[kfilm_convert->pass_adaptive_aux_buffer + 3] == 0.0f) { const float3 active_rgb = make_float3(1.0f, 0.0f, 0.0f); const float3 mix_rgb = interp(make_float3(pixel[0], pixel[1], pixel[2]), active_rgb, 0.5f); diff --git a/intern/cycles/kernel/geom/attribute.h b/intern/cycles/kernel/geom/attribute.h index 3a0ee1b09d1..a5700b6d093 100644 --- a/intern/cycles/kernel/geom/attribute.h +++ b/intern/cycles/kernel/geom/attribute.h @@ -77,7 +77,8 @@ find_attribute(KernelGlobals kg, int object, int prim, int type, uint64_t id) desc.element = (AttributeElement)attr_map.element; if (prim == PRIM_NONE && desc.element != ATTR_ELEMENT_MESH && - desc.element != ATTR_ELEMENT_VOXEL && desc.element != ATTR_ELEMENT_OBJECT) { + desc.element != ATTR_ELEMENT_VOXEL && desc.element != ATTR_ELEMENT_OBJECT) + { return attribute_not_found(); } diff --git a/intern/cycles/kernel/geom/primitive.h b/intern/cycles/kernel/geom/primitive.h index 04b04ff5985..c1d27f9eb04 100644 --- a/intern/cycles/kernel/geom/primitive.h +++ b/intern/cycles/kernel/geom/primitive.h @@ -318,7 +318,8 @@ ccl_device_forceinline float4 primitive_motion_vector(KernelGlobals kg, } else #endif - if (sd->type & PRIMITIVE_TRIANGLE) { + if (sd->type & PRIMITIVE_TRIANGLE) + { /* Triangle */ if (subd_triangle_patch(kg, sd->prim) == ~0) { motion_pre = triangle_attribute_float3(kg, sd, desc, NULL, NULL); diff --git a/intern/cycles/kernel/geom/shader_data.h b/intern/cycles/kernel/geom/shader_data.h index eb05121b7cd..fbaa169b7ad 100644 --- a/intern/cycles/kernel/geom/shader_data.h +++ b/intern/cycles/kernel/geom/shader_data.h @@ -65,7 +65,8 @@ ccl_device_inline void shader_setup_from_ray(KernelGlobals kg, else #endif #ifdef __POINTCLOUD__ - if (sd->type & PRIMITIVE_POINT) { + if (sd->type & PRIMITIVE_POINT) + { /* point */ point_shader_setup(kg, sd, isect, ray); } diff --git a/intern/cycles/kernel/geom/subd_triangle.h b/intern/cycles/kernel/geom/subd_triangle.h index 8666408fe2b..08186b8c812 100644 --- a/intern/cycles/kernel/geom/subd_triangle.h +++ b/intern/cycles/kernel/geom/subd_triangle.h @@ -135,7 +135,8 @@ ccl_device_noinline float subd_triangle_attribute_float(KernelGlobals kg, } else #endif /* __PATCH_EVAL__ */ - if (desc.element == ATTR_ELEMENT_FACE) { + if (desc.element == ATTR_ELEMENT_FACE) + { if (dx) *dx = 0.0f; if (dy) @@ -275,7 +276,8 @@ ccl_device_noinline float2 subd_triangle_attribute_float2(KernelGlobals kg, } else #endif /* __PATCH_EVAL__ */ - if (desc.element == ATTR_ELEMENT_FACE) { + if (desc.element == ATTR_ELEMENT_FACE) + { if (dx) *dx = make_float2(0.0f, 0.0f); if (dy) @@ -416,7 +418,8 @@ ccl_device_noinline float3 subd_triangle_attribute_float3(KernelGlobals kg, } else #endif /* __PATCH_EVAL__ */ - if (desc.element == ATTR_ELEMENT_FACE) { + if (desc.element == ATTR_ELEMENT_FACE) + { if (dx) *dx = make_float3(0.0f, 0.0f, 0.0f); if (dy) @@ -562,7 +565,8 @@ ccl_device_noinline float4 subd_triangle_attribute_float4(KernelGlobals kg, } else #endif /* __PATCH_EVAL__ */ - if (desc.element == ATTR_ELEMENT_FACE) { + if (desc.element == ATTR_ELEMENT_FACE) + { if (dx) *dx = zero_float4(); if (dy) diff --git a/intern/cycles/kernel/geom/triangle.h b/intern/cycles/kernel/geom/triangle.h index 9198a9d9dd3..05af44c1535 100644 --- a/intern/cycles/kernel/geom/triangle.h +++ b/intern/cycles/kernel/geom/triangle.h @@ -307,7 +307,8 @@ ccl_device float4 triangle_attribute_float4(KernelGlobals kg, ccl_private float4 *dy) { if (desc.element & (ATTR_ELEMENT_VERTEX | ATTR_ELEMENT_VERTEX_MOTION | ATTR_ELEMENT_CORNER | - ATTR_ELEMENT_CORNER_BYTE)) { + ATTR_ELEMENT_CORNER_BYTE)) + { float4 f0, f1, f2; if (desc.element & (ATTR_ELEMENT_VERTEX | ATTR_ELEMENT_VERTEX_MOTION)) { diff --git a/intern/cycles/kernel/integrator/guiding.h b/intern/cycles/kernel/integrator/guiding.h index 1ad2469cfa0..d42848ce3c0 100644 --- a/intern/cycles/kernel/integrator/guiding.h +++ b/intern/cycles/kernel/integrator/guiding.h @@ -264,7 +264,8 @@ ccl_device_forceinline void guiding_record_volume_transmission(KernelGlobals kg, (transmittance_weight[1] < 0.f || !std::isfinite(transmittance_weight[1]) || std::isnan(transmittance_weight[1])) || (transmittance_weight[2] < 0.f || !std::isfinite(transmittance_weight[2]) || - std::isnan(transmittance_weight[2]))) { + std::isnan(transmittance_weight[2]))) + { } else { openpgl::cpp::SetTransmittanceWeight(state->guiding.path_segment, @@ -459,7 +460,8 @@ ccl_device_forceinline bool guiding_bsdf_init(KernelGlobals kg, kg->opgl_guiding_field, guiding_point3f(P), rand)) { # else if (kg->opgl_surface_sampling_distribution->Init( - kg->opgl_guiding_field, guiding_point3f(P), rand, true)) { + kg->opgl_guiding_field, guiding_point3f(P), rand, true)) + { # endif kg->opgl_surface_sampling_distribution->ApplyCosineProduct(guiding_point3f(N)); return true; @@ -516,7 +518,8 @@ ccl_device_forceinline bool guiding_phase_init(KernelGlobals kg, kg->opgl_guiding_field, guiding_point3f(P), rand)) { # else if (kg->opgl_volume_sampling_distribution->Init( - kg->opgl_guiding_field, guiding_point3f(P), rand, true)) { + kg->opgl_guiding_field, guiding_point3f(P), rand, true)) + { # endif kg->opgl_volume_sampling_distribution->ApplySingleLobeHenyeyGreensteinProduct(guiding_vec3f(D), g); diff --git a/intern/cycles/kernel/integrator/intersect_shadow.h b/intern/cycles/kernel/integrator/intersect_shadow.h index a5572f51dea..79e7c03bd92 100644 --- a/intern/cycles/kernel/integrator/intersect_shadow.h +++ b/intern/cycles/kernel/integrator/intersect_shadow.h @@ -77,7 +77,8 @@ ccl_device_inline void sort_shadow_intersections(IntegratorShadowState state, ui swapped = false; for (int j = 0; j < num_hits - 1; ++j) { if (INTEGRATOR_STATE_ARRAY(state, shadow_isect, j, t) > - INTEGRATOR_STATE_ARRAY(state, shadow_isect, j + 1, t)) { + INTEGRATOR_STATE_ARRAY(state, shadow_isect, j + 1, t)) + { struct Intersection tmp_j ccl_optional_struct_init; struct Intersection tmp_j_1 ccl_optional_struct_init; integrator_state_read_shadow_isect(state, &tmp_j, j); diff --git a/intern/cycles/kernel/integrator/intersect_volume_stack.h b/intern/cycles/kernel/integrator/intersect_volume_stack.h index 493d29f4f10..dc583cdce9f 100644 --- a/intern/cycles/kernel/integrator/intersect_volume_stack.h +++ b/intern/cycles/kernel/integrator/intersect_volume_stack.h @@ -153,7 +153,8 @@ ccl_device void integrator_volume_stack_init(KernelGlobals kg, IntegratorState s int step = 0; while (stack_index < volume_stack_size - 1 && enclosed_index < MAX_VOLUME_STACK_SIZE - 1 && - step < 2 * volume_stack_size) { + step < 2 * volume_stack_size) + { Intersection isect; if (!scene_intersect_volume(kg, &volume_ray, &isect, visibility)) { break; diff --git a/intern/cycles/kernel/integrator/shade_surface.h b/intern/cycles/kernel/integrator/shade_surface.h index d0012b0bfec..ed3ae781095 100644 --- a/intern/cycles/kernel/integrator/shade_surface.h +++ b/intern/cycles/kernel/integrator/shade_surface.h @@ -87,7 +87,8 @@ ccl_device_forceinline bool integrate_surface_holdout(KernelGlobals kg, const uint32_t path_flag = INTEGRATOR_STATE(state, path, flag); if (((sd->flag & SD_HOLDOUT) || (sd->object_flag & SD_OBJECT_HOLDOUT_MASK)) && - (path_flag & PATH_RAY_TRANSPARENT_BACKGROUND)) { + (path_flag & PATH_RAY_TRANSPARENT_BACKGROUND)) + { const Spectrum holdout_weight = surface_shader_apply_holdout(kg, sd); const Spectrum throughput = INTEGRATOR_STATE(state, path, throughput); const float transparent = average(holdout_weight * throughput); @@ -160,7 +161,8 @@ ccl_device_forceinline void integrate_surface_direct_light(KernelGlobals kg, sd->flag, bounce, path_flag, - &ls)) { + &ls)) + { return; } } diff --git a/intern/cycles/kernel/integrator/shade_volume.h b/intern/cycles/kernel/integrator/shade_volume.h index e1c87c5140a..e00f0ff6f67 100644 --- a/intern/cycles/kernel/integrator/shade_volume.h +++ b/intern/cycles/kernel/integrator/shade_volume.h @@ -441,7 +441,8 @@ ccl_device_forceinline void volume_integrate_step_scattering( /* Equiangular sampling for direct lighting. */ if (vstate.direct_sample_method == VOLUME_SAMPLE_EQUIANGULAR && !result.direct_scatter) { if (result.direct_t >= vstate.tmin && result.direct_t <= vstate.tmax && - vstate.equiangular_pdf > VOLUME_SAMPLE_PDF_CUTOFF) { + vstate.equiangular_pdf > VOLUME_SAMPLE_PDF_CUTOFF) + { const float new_dt = result.direct_t - vstate.tmin; const Spectrum new_transmittance = volume_color_transmittance(coeff.sigma_t, new_dt); @@ -720,7 +721,8 @@ ccl_device_forceinline bool integrate_volume_equiangular_sample_light( ray->tmax - ray->tmin, bounce, path_flag, - &ls)) { + &ls)) + { return false; } @@ -784,7 +786,8 @@ ccl_device_forceinline void integrate_volume_direct_light( SD_BSDF_HAS_TRANSMISSION, bounce, path_flag, - &ls)) { + &ls)) + { return; } } diff --git a/intern/cycles/kernel/integrator/surface_shader.h b/intern/cycles/kernel/integrator/surface_shader.h index 19e1845ce67..a0fa9255628 100644 --- a/intern/cycles/kernel/integrator/surface_shader.h +++ b/intern/cycles/kernel/integrator/surface_shader.h @@ -66,7 +66,8 @@ ccl_device_inline void surface_shader_prepare_guiding(KernelGlobals kg, /* Init guiding (diffuse BSDFs only for now). */ if (!(diffuse_sampling_fraction > 0.0f && - guiding_bsdf_init(kg, state, sd->P, sd->N, rand_bsdf_guiding))) { + guiding_bsdf_init(kg, state, sd->P, sd->N, rand_bsdf_guiding))) + { state->guiding.use_surface_guiding = false; return; } @@ -106,12 +107,14 @@ ccl_device_inline void surface_shader_prepare_closures(KernelGlobals kg, (CLOSURE_IS_BSDF_GLOSSY(sc->type) && (kernel_data.integrator.filter_closures & FILTER_CLOSURE_GLOSSY)) || (CLOSURE_IS_BSDF_TRANSMISSION(sc->type) && - (kernel_data.integrator.filter_closures & FILTER_CLOSURE_TRANSMISSION))) { + (kernel_data.integrator.filter_closures & FILTER_CLOSURE_TRANSMISSION))) + { sc->type = CLOSURE_NONE_ID; sc->sample_weight = 0.0f; } else if ((CLOSURE_IS_BSDF_TRANSPARENT(sc->type) && - (kernel_data.integrator.filter_closures & FILTER_CLOSURE_TRANSPARENT))) { + (kernel_data.integrator.filter_closures & FILTER_CLOSURE_TRANSPARENT))) + { sc->type = CLOSURE_HOLDOUT_ID; sc->sample_weight = 0.0f; sd->flag |= SD_HOLDOUT; @@ -127,7 +130,8 @@ ccl_device_inline void surface_shader_prepare_closures(KernelGlobals kg, * a good heuristic. */ if (INTEGRATOR_STATE(state, path, bounce) + INTEGRATOR_STATE(state, path, transparent_bounce) == 0 && - sd->num_closure > 1) { + sd->num_closure > 1) + { float sum = 0.0f; for (int i = 0; i < sd->num_closure; i++) { @@ -153,7 +157,8 @@ ccl_device_inline void surface_shader_prepare_closures(KernelGlobals kg, #ifdef __MNEE__ && !(INTEGRATOR_STATE(state, path, mnee) & PATH_MNEE_VALID) #endif - ) { + ) + { float blur_pdf = kernel_data.integrator.filter_glossy * INTEGRATOR_STATE(state, path, min_ray_pdf); diff --git a/intern/cycles/kernel/light/area.h b/intern/cycles/kernel/light/area.h index 9391cc49858..b2c853dc5c7 100644 --- a/intern/cycles/kernel/light/area.h +++ b/intern/cycles/kernel/light/area.h @@ -277,7 +277,8 @@ ccl_device_inline bool area_light_sample(const ccl_global KernelLight *klight, &sample_axis_v, &sample_len_v, klight->area.tan_half_spread, - &sample_rectangle)) { + &sample_rectangle)) + { return false; } } @@ -424,7 +425,8 @@ ccl_device_inline bool area_light_sample_from_intersection( &sample_axis_v, &sample_len_v, klight->area.tan_half_spread, - &sample_rectangle)) { + &sample_rectangle)) + { return false; } } diff --git a/intern/cycles/kernel/light/light.h b/intern/cycles/kernel/light/light.h index 301c3d7db9c..c451d70e365 100644 --- a/intern/cycles/kernel/light/light.h +++ b/intern/cycles/kernel/light/light.h @@ -140,7 +140,8 @@ ccl_device_noinline bool light_sample(KernelGlobals kg, /* Exclude synthetic meshes from shadow catcher pass. */ if ((path_flag & PATH_RAY_SHADOW_CATCHER_PASS) && - !(kernel_data_fetch(object_flag, object) & SD_OBJECT_SHADOW_CATCHER)) { + !(kernel_data_fetch(object_flag, object) & SD_OBJECT_SHADOW_CATCHER)) + { return false; } @@ -192,7 +193,8 @@ ccl_device bool lights_intersect(KernelGlobals kg, /* This path should have been resolved with mnee, it will * generate a firefly for small lights since it is improbable. */ if ((INTEGRATOR_STATE(state, path, mnee) & PATH_MNEE_CULL_LIGHT_CONNECTION) && - klight->use_caustics) { + klight->use_caustics) + { continue; } #endif @@ -227,7 +229,8 @@ ccl_device bool lights_intersect(KernelGlobals kg, } if (t < isect->t && - !(last_prim == lamp && last_object == OBJECT_NONE && last_type == PRIMITIVE_LAMP)) { + !(last_prim == lamp && last_object == OBJECT_NONE && last_type == PRIMITIVE_LAMP)) + { isect->t = t; isect->u = u; isect->v = v; diff --git a/intern/cycles/kernel/light/tree.h b/intern/cycles/kernel/light/tree.h index 9122f4f68f3..b160b4614b8 100644 --- a/intern/cycles/kernel/light/tree.h +++ b/intern/cycles/kernel/light/tree.h @@ -29,7 +29,8 @@ ccl_device float light_tree_cos_bounding_box_angle(const BoundingBox bbox, const float3 point_to_centroid) { if (P.x > bbox.min.x && P.y > bbox.min.y && P.z > bbox.min.z && P.x < bbox.max.x && - P.y < bbox.max.y && P.z < bbox.max.z) { + P.y < bbox.max.y && P.z < bbox.max.z) + { /* If P is inside the bbox, `theta_u` covers the whole sphere. */ return -1.0f; } @@ -189,7 +190,8 @@ ccl_device void light_tree_importance(const float3 N_or_D, cos_min_outgoing_angle = 1.0f; } else if ((bcone.theta_o + bcone.theta_e > M_PI_F) || - (cos_theta_minus_theta_u > cos(bcone.theta_o + bcone.theta_e))) { + (cos_theta_minus_theta_u > cos(bcone.theta_o + bcone.theta_e))) + { /* theta' = theta - theta_o - theta_u < theta_e */ kernel_assert( (fast_acosf(cos_theta) - bcone.theta_o - fast_acosf(cos_theta_u) - bcone.theta_e) < 5e-4f); @@ -218,7 +220,8 @@ ccl_device void light_tree_importance(const float3 N_or_D, float cos_max_outgoing_angle; const float cos_theta_plus_theta_u = cos_theta * cos_theta_u - sin_theta * sin_theta_u; if (bcone.theta_e - bcone.theta_o < 0 || cos_theta < 0 || cos_theta_u < 0 || - cos_theta_plus_theta_u < cos(bcone.theta_e - bcone.theta_o)) { + cos_theta_plus_theta_u < cos(bcone.theta_e - bcone.theta_o)) + { min_importance = 0.0f; } else { @@ -279,8 +282,8 @@ ccl_device bool compute_emitter_centroid_and_dir(KernelGlobals kg, dir = -dir; } const int object_flag = kernel_data_fetch(object_flag, object); - if ((object_flag & SD_OBJECT_TRANSFORM_APPLIED) && - (object_flag & SD_OBJECT_NEGATIVE_SCALE)) { + if ((object_flag & SD_OBJECT_TRANSFORM_APPLIED) && (object_flag & SD_OBJECT_NEGATIVE_SCALE)) + { dir = -dir; } } @@ -393,8 +396,8 @@ ccl_device void light_tree_emitter_importance(KernelGlobals kg, float2 distance; /* distance.x = max_distance, distance.y = mix_distance */ float3 centroid, point_to_centroid, P_c; - if (!compute_emitter_centroid_and_dir( - kg, kemitter, P, centroid, bcone.axis)) { + if (!compute_emitter_centroid_and_dir(kg, kemitter, P, centroid, bcone.axis)) + { return; } @@ -706,7 +709,8 @@ ccl_device_noinline bool light_tree_sample(KernelGlobals kg, float left_prob; if (!get_left_probability( - kg, local_P, N_or_D, t, has_transmission, left_index, right_index, left_prob)) { + kg, local_P, N_or_D, t, has_transmission, left_index, right_index, left_prob)) + { return false; /* Both child nodes have zero importance. */ } @@ -825,7 +829,8 @@ ccl_device float light_tree_pdf( float left_prob; if (!get_left_probability( - kg, P, N, 0, has_transmission, left_index, right_index, left_prob)) { + kg, P, N, 0, has_transmission, left_index, right_index, left_prob)) + { return 0.0f; } diff --git a/intern/cycles/kernel/light/triangle.h b/intern/cycles/kernel/light/triangle.h index 8cca66e5f20..5a69ac784bd 100644 --- a/intern/cycles/kernel/light/triangle.h +++ b/intern/cycles/kernel/light/triangle.h @@ -221,8 +221,8 @@ ccl_device_forceinline bool triangle_light_sample(KernelGlobals kg, ls->D = z * B + sin_from_cos(z) * safe_normalize(C_ - dot(C_, B) * B); /* calculate intersection with the planar triangle */ - if (!ray_triangle_intersect( - P, ls->D, 0.0f, FLT_MAX, V[0], V[1], V[2], &ls->u, &ls->v, &ls->t)) { + if (!ray_triangle_intersect(P, ls->D, 0.0f, FLT_MAX, V[0], V[1], V[2], &ls->u, &ls->v, &ls->t)) + { ls->pdf = 0.0f; return false; } diff --git a/intern/cycles/kernel/osl/closures_setup.h b/intern/cycles/kernel/osl/closures_setup.h index 462d1405064..549ab3b6b21 100644 --- a/intern/cycles/kernel/osl/closures_setup.h +++ b/intern/cycles/kernel/osl/closures_setup.h @@ -52,7 +52,8 @@ ccl_device_forceinline bool osl_closure_skip(KernelGlobals kg, /* caustic options */ if ((scattering & LABEL_GLOSSY) && (path_flag & PATH_RAY_DIFFUSE)) { if ((!kernel_data.integrator.caustics_reflective && (scattering & LABEL_REFLECT)) || - (!kernel_data.integrator.caustics_refractive && (scattering & LABEL_TRANSMIT))) { + (!kernel_data.integrator.caustics_refractive && (scattering & LABEL_TRANSMIT))) + { return true; } } @@ -215,7 +216,8 @@ ccl_device void osl_closure_dielectric_bsdf_setup(KernelGlobals kg, /* GGX */ if (closure->distribution == make_string("ggx", 11253504724482777663ull) || - closure->distribution == make_string("default", 4430693559278735917ull)) { + closure->distribution == make_string("default", 4430693559278735917ull)) + { if (has_reflection && has_transmission) { sd->flag |= bsdf_microfacet_ggx_glass_setup(bsdf); } @@ -274,7 +276,8 @@ ccl_device void osl_closure_conductor_bsdf_setup(KernelGlobals kg, /* GGX */ if (closure->distribution == make_string("ggx", 11253504724482777663ull) || - closure->distribution == make_string("default", 4430693559278735917ull)) { + closure->distribution == make_string("default", 4430693559278735917ull)) + { sd->flag |= bsdf_microfacet_ggx_setup(bsdf); } /* Beckmann */ @@ -324,7 +327,8 @@ ccl_device void osl_closure_generalized_schlick_bsdf_setup( /* GGX */ if (closure->distribution == make_string("ggx", 11253504724482777663ull) || - closure->distribution == make_string("default", 4430693559278735917ull)) { + closure->distribution == make_string("default", 4430693559278735917ull)) + { if (has_reflection && has_transmission) { sd->flag |= bsdf_microfacet_ggx_glass_setup(bsdf); } diff --git a/intern/cycles/kernel/osl/services.cpp b/intern/cycles/kernel/osl/services.cpp index 92708df3162..21da6997293 100644 --- a/intern/cycles/kernel/osl/services.cpp +++ b/intern/cycles/kernel/osl/services.cpp @@ -427,7 +427,8 @@ static bool set_attribute_float2(float2 f[3], TypeDesc type, bool derivatives, v return true; } else if (type == TypeDesc::TypePoint || type == TypeDesc::TypeVector || - type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) { + type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) + { float *fval = (float *)val; fval[0] = f[0].x; @@ -497,7 +498,8 @@ static bool set_attribute_float3(float3 f[3], TypeDesc type, bool derivatives, v return true; } else if (type == TypeDesc::TypePoint || type == TypeDesc::TypeVector || - type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) { + type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) + { float *fval = (float *)val; fval[0] = f[0].x; @@ -573,7 +575,8 @@ static bool set_attribute_float4(float4 f[3], TypeDesc type, bool derivatives, v return true; } else if (type == TypeDesc::TypePoint || type == TypeDesc::TypeVector || - type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) { + type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) + { fval[0] = f[0].x; fval[1] = f[0].y; fval[2] = f[0].z; @@ -637,7 +640,8 @@ static bool set_attribute_float(float f[3], TypeDesc type, bool derivatives, voi return true; } else if (type == TypeDesc::TypePoint || type == TypeDesc::TypeVector || - type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) { + type == TypeDesc::TypeNormal || type == TypeDesc::TypeColor) + { float *fval = (float *)val; fval[0] = f[0]; fval[1] = f[0]; @@ -928,7 +932,8 @@ bool OSLRenderServices::get_object_standard_attribute(const KernelGlobalsCPU *kg return set_attribute_int(3, type, derivatives, val); } else if ((name == u_geom_trianglevertices || name == u_geom_polyvertices) && - sd->type & PRIMITIVE_TRIANGLE) { + sd->type & PRIMITIVE_TRIANGLE) + { float3 P[3]; if (sd->type & PRIMITIVE_MOTION) { @@ -1068,7 +1073,8 @@ bool OSLRenderServices::get_background_attribute(const KernelGlobalsCPU *kg, float3 ndc[3]; if ((globals->raytype & PATH_RAY_CAMERA) && sd->object == OBJECT_NONE && - kernel_data.cam.type == CAMERA_ORTHOGRAPHIC) { + kernel_data.cam.type == CAMERA_ORTHOGRAPHIC) + { ndc[0] = camera_world_to_ndc(kg, sd, sd->ray_P); if (derivatives) { diff --git a/intern/cycles/kernel/osl/services_gpu.h b/intern/cycles/kernel/osl/services_gpu.h index 24547e4c766..30fad3244c9 100644 --- a/intern/cycles/kernel/osl/services_gpu.h +++ b/intern/cycles/kernel/osl/services_gpu.h @@ -810,16 +810,16 @@ ccl_device_inline bool set_attribute_float(ccl_private float fval[3], const int type_arraylen = type >> 32; if (type_basetype == 11 /* TypeDesc::FLOAT */) { - if ((type_aggregate == 2 /* TypeDesc::VEC2 */) || - (type_aggregate == 1 && type_arraylen == 2)) { + if ((type_aggregate == 2 /* TypeDesc::VEC2 */) || (type_aggregate == 1 && type_arraylen == 2)) + { for (int i = 0; i < (derivatives ? 3 : 1); ++i) { static_cast(val)[i * 2 + 0] = fval[i]; static_cast(val)[i * 2 + 1] = fval[i]; } return true; } - if ((type_aggregate == 3 /* TypeDesc::VEC3 */) || - (type_aggregate == 1 && type_arraylen == 3)) { + if ((type_aggregate == 3 /* TypeDesc::VEC3 */) || (type_aggregate == 1 && type_arraylen == 3)) + { for (int i = 0; i < (derivatives ? 3 : 1); ++i) { static_cast(val)[i * 3 + 0] = fval[i]; static_cast(val)[i * 3 + 1] = fval[i]; @@ -827,8 +827,8 @@ ccl_device_inline bool set_attribute_float(ccl_private float fval[3], } return true; } - if ((type_aggregate == 4 /* TypeDesc::VEC4 */) || - (type_aggregate == 1 && type_arraylen == 4)) { + if ((type_aggregate == 4 /* TypeDesc::VEC4 */) || (type_aggregate == 1 && type_arraylen == 4)) + { for (int i = 0; i < (derivatives ? 3 : 1); ++i) { static_cast(val)[i * 4 + 0] = fval[i]; static_cast(val)[i * 4 + 1] = fval[i]; @@ -870,16 +870,16 @@ ccl_device_inline bool set_attribute_float2(ccl_private float2 fval[3], const int type_arraylen = type >> 32; if (type_basetype == 11 /* TypeDesc::FLOAT */) { - if ((type_aggregate == 2 /* TypeDesc::VEC2 */) || - (type_aggregate == 1 && type_arraylen == 2)) { + if ((type_aggregate == 2 /* TypeDesc::VEC2 */) || (type_aggregate == 1 && type_arraylen == 2)) + { for (int i = 0; i < (derivatives ? 3 : 1); ++i) { static_cast(val)[i * 2 + 0] = fval[i].x; static_cast(val)[i * 2 + 1] = fval[i].y; } return true; } - if ((type_aggregate == 3 /* TypeDesc::VEC3 */) || - (type_aggregate == 1 && type_arraylen == 3)) { + if ((type_aggregate == 3 /* TypeDesc::VEC3 */) || (type_aggregate == 1 && type_arraylen == 3)) + { for (int i = 0; i < (derivatives ? 3 : 1); ++i) { static_cast(val)[i * 3 + 0] = fval[i].x; static_cast(val)[i * 3 + 1] = fval[i].y; @@ -887,8 +887,8 @@ ccl_device_inline bool set_attribute_float2(ccl_private float2 fval[3], } return true; } - if ((type_aggregate == 4 /* TypeDesc::VEC4 */) || - (type_aggregate == 1 && type_arraylen == 4)) { + if ((type_aggregate == 4 /* TypeDesc::VEC4 */) || (type_aggregate == 1 && type_arraylen == 4)) + { for (int i = 0; i < (derivatives ? 3 : 1); ++i) { static_cast(val)[i * 4 + 0] = fval[i].x; static_cast(val)[i * 4 + 1] = fval[i].y; @@ -917,8 +917,8 @@ ccl_device_inline bool set_attribute_float3(ccl_private float3 fval[3], const int type_arraylen = type >> 32; if (type_basetype == 11 /* TypeDesc::FLOAT */) { - if ((type_aggregate == 3 /* TypeDesc::VEC3 */) || - (type_aggregate == 1 && type_arraylen == 3)) { + if ((type_aggregate == 3 /* TypeDesc::VEC3 */) || (type_aggregate == 1 && type_arraylen == 3)) + { for (int i = 0; i < (derivatives ? 3 : 1); ++i) { static_cast(val)[i * 3 + 0] = fval[i].x; static_cast(val)[i * 3 + 1] = fval[i].y; @@ -926,8 +926,8 @@ ccl_device_inline bool set_attribute_float3(ccl_private float3 fval[3], } return true; } - if ((type_aggregate == 4 /* TypeDesc::VEC4 */) || - (type_aggregate == 1 && type_arraylen == 4)) { + if ((type_aggregate == 4 /* TypeDesc::VEC4 */) || (type_aggregate == 1 && type_arraylen == 4)) + { for (int i = 0; i < (derivatives ? 3 : 1); ++i) { static_cast(val)[i * 4 + 0] = fval[i].x; static_cast(val)[i * 4 + 1] = fval[i].y; @@ -969,8 +969,8 @@ ccl_device_inline bool set_attribute_float4(ccl_private float4 fval[3], const int type_arraylen = type >> 32; if (type_basetype == 11 /* TypeDesc::FLOAT */) { - if ((type_aggregate == 3 /* TypeDesc::VEC3 */) || - (type_aggregate == 1 && type_arraylen == 3)) { + if ((type_aggregate == 3 /* TypeDesc::VEC3 */) || (type_aggregate == 1 && type_arraylen == 3)) + { for (int i = 0; i < (derivatives ? 3 : 1); ++i) { static_cast(val)[i * 3 + 0] = fval[i].x; static_cast(val)[i * 3 + 1] = fval[i].y; @@ -978,8 +978,8 @@ ccl_device_inline bool set_attribute_float4(ccl_private float4 fval[3], } return true; } - if ((type_aggregate == 4 /* TypeDesc::VEC4 */) || - (type_aggregate == 1 && type_arraylen == 4)) { + if ((type_aggregate == 4 /* TypeDesc::VEC4 */) || (type_aggregate == 1 && type_arraylen == 4)) + { for (int i = 0; i < (derivatives ? 3 : 1); ++i) { static_cast(val)[i * 4 + 0] = fval[i].x; static_cast(val)[i * 4 + 1] = fval[i].y; diff --git a/intern/cycles/kernel/osl/shaders/node_normal_map.osl b/intern/cycles/kernel/osl/shaders/node_normal_map.osl index 7e41bbf1720..d5892da5bd1 100644 --- a/intern/cycles/kernel/osl/shaders/node_normal_map.osl +++ b/intern/cycles/kernel/osl/shaders/node_normal_map.osl @@ -31,7 +31,8 @@ shader node_normal_map(float Strength = 1.0, // get _unnormalized_ interpolated normal and tangent if (getattribute(attr_name, tangent) && getattribute(attr_sign_name, tangent_sign) && - (!is_smooth || getattribute("geom:normal_map_normal", ninterp))) { + (!is_smooth || getattribute("geom:normal_map_normal", ninterp))) + { // apply normal map vector B = tangent_sign * cross(ninterp, tangent); Normal = normalize(mcolor[0] * tangent + mcolor[1] * B + mcolor[2] * ninterp); diff --git a/intern/cycles/kernel/svm/closure.h b/intern/cycles/kernel/svm/closure.h index 803cf33c358..ea5cb305cb8 100644 --- a/intern/cycles/kernel/svm/closure.h +++ b/intern/cycles/kernel/svm/closure.h @@ -52,8 +52,7 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg, return svm_node_closure_bsdf_skip(kg, offset, type); } } - else - { + else { return svm_node_closure_bsdf_skip(kg, offset, type); } @@ -256,7 +255,8 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg, if (kernel_data.integrator.caustics_reflective || (path_flag & PATH_RAY_DIFFUSE) == 0) { #endif if (specular_weight > CLOSURE_WEIGHT_CUTOFF && - (specular > CLOSURE_WEIGHT_CUTOFF || metallic > CLOSURE_WEIGHT_CUTOFF)) { + (specular > CLOSURE_WEIGHT_CUTOFF || metallic > CLOSURE_WEIGHT_CUTOFF)) + { Spectrum spec_weight = weight * specular_weight; ccl_private MicrofacetBsdf *bsdf = (ccl_private MicrofacetBsdf *)bsdf_alloc( @@ -288,8 +288,8 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg, fresnel->color = rgb_to_spectrum(base_color); /* setup bsdf */ - if (distribution == CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID || - roughness <= 0.075f) { /* use single-scatter GGX */ + if (distribution == CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID || roughness <= 0.075f) + { /* use single-scatter GGX */ sd->flag |= bsdf_microfacet_ggx_setup(bsdf); bsdf_microfacet_setup_fresnel_principledv1(bsdf, sd, fresnel); } @@ -306,14 +306,15 @@ ccl_device_noinline int svm_node_closure_bsdf(KernelGlobals kg, /* BSDF */ #ifdef __CAUSTICS_TRICKS__ if (kernel_data.integrator.caustics_reflective || - kernel_data.integrator.caustics_refractive || (path_flag & PATH_RAY_DIFFUSE) == 0) { + kernel_data.integrator.caustics_refractive || (path_flag & PATH_RAY_DIFFUSE) == 0) + { #endif if (final_transmission > CLOSURE_WEIGHT_CUTOFF) { Spectrum glass_weight = weight * final_transmission; float3 cspec0 = base_color * specular_tint + make_float3(1.0f - specular_tint); - if (roughness <= 5e-2f || - distribution == CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID) { /* use single-scatter GGX */ + if (roughness <= 5e-2f || distribution == CLOSURE_BSDF_MICROFACET_GGX_GLASS_ID) + { /* use single-scatter GGX */ float refl_roughness = roughness; /* reflection */ diff --git a/intern/cycles/kernel/svm/displace.h b/intern/cycles/kernel/svm/displace.h index 844f7afa90b..29009266ac7 100644 --- a/intern/cycles/kernel/svm/displace.h +++ b/intern/cycles/kernel/svm/displace.h @@ -73,8 +73,7 @@ ccl_device_noinline void svm_node_set_bump(KernelGlobals kg, stack_store_float3(stack, node.w, normal_out); } - else - { + else { stack_store_float3(stack, node.w, zero_float3()); } #endif @@ -128,8 +127,7 @@ ccl_device_noinline void svm_node_displacement(KernelGlobals kg, stack_store_float3(stack, node.z, dP); } - else - { + else { stack_store_float3(stack, node.z, zero_float3()); } } @@ -183,8 +181,7 @@ ccl_device_noinline int svm_node_vector_displacement( stack_store_float3(stack, displacement_offset, dP); } - else - { + else { stack_store_float3(stack, displacement_offset, zero_float3()); (void)data_node; } diff --git a/intern/cycles/kernel/svm/math.h b/intern/cycles/kernel/svm/math.h index 50bf2fda145..673b7c678a4 100644 --- a/intern/cycles/kernel/svm/math.h +++ b/intern/cycles/kernel/svm/math.h @@ -47,7 +47,8 @@ ccl_device_noinline int svm_node_vector_math(KernelGlobals kg, /* 3 Vector Operators */ if (type == NODE_VECTOR_MATH_WRAP || type == NODE_VECTOR_MATH_FACEFORWARD || - type == NODE_VECTOR_MATH_MULTIPLY_ADD) { + type == NODE_VECTOR_MATH_MULTIPLY_ADD) + { uint4 extra_node = read_node(kg, &offset); c = stack_load_float3(stack, extra_node.x); } diff --git a/intern/cycles/kernel/svm/sky.h b/intern/cycles/kernel/svm/sky.h index a9838624066..41f1dcc2ce8 100644 --- a/intern/cycles/kernel/svm/sky.h +++ b/intern/cycles/kernel/svm/sky.h @@ -144,7 +144,8 @@ ccl_device float3 sky_radiance_nishita(KernelGlobals kg, /* If the ray is inside the sun disc, render it, otherwise render the sky. * Alternatively, ignore the sun if we're evaluating the background texture. */ if (sun_disc && sun_dir_angle < half_angular && - !((path_flag & PATH_RAY_IMPORTANCE_BAKE) && kernel_data.background.use_sun_guiding)) { + !((path_flag & PATH_RAY_IMPORTANCE_BAKE) && kernel_data.background.use_sun_guiding)) + { /* get 2 pixels data */ float y; diff --git a/intern/cycles/kernel/svm/vector_transform.h b/intern/cycles/kernel/svm/vector_transform.h index 9ee44f35329..2c69e6c7b63 100644 --- a/intern/cycles/kernel/svm/vector_transform.h +++ b/intern/cycles/kernel/svm/vector_transform.h @@ -49,7 +49,8 @@ ccl_device_noinline void svm_node_vector_transform(KernelGlobals kg, /* From camera */ else if (from == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) { if (to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD || - to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT) { + to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT) + { tfm = kernel_data.cam.cameratoworld; if (is_direction) in = transform_direction(&tfm, in); @@ -68,7 +69,8 @@ ccl_device_noinline void svm_node_vector_transform(KernelGlobals kg, else if (from == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_OBJECT) { if ((to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_WORLD || to == NODE_VECTOR_TRANSFORM_CONVERT_SPACE_CAMERA) && - is_object) { + is_object) + { if (is_direction) object_dir_transform(kg, sd, &in); else diff --git a/intern/cycles/scene/alembic.cpp b/intern/cycles/scene/alembic.cpp index 3b88cd58f30..152a520ea61 100644 --- a/intern/cycles/scene/alembic.cpp +++ b/intern/cycles/scene/alembic.cpp @@ -254,7 +254,8 @@ static M44d convert_yup_zup(const M44d &mtx, float scale_mult) rotation, translation, true, - IMATH_INTERNAL_NAMESPACE::Euler::XZY)) { + IMATH_INTERNAL_NAMESPACE::Euler::XZY)) + { return mtx; } @@ -806,7 +807,8 @@ void AlembicProcedural::generate(Scene *scene, Progress &progress) /* Check if the shaders were modified. */ if (object->used_shaders_is_modified() && object->get_object() && - object->get_object()->get_geometry()) { + object->get_object()->get_geometry()) + { Geometry *geometry = object->get_object()->get_geometry(); array used_shaders = object->get_used_shaders(); geometry->set_used_shaders(used_shaders); @@ -908,7 +910,8 @@ void AlembicProcedural::generate(Scene *scene, Progress &progress) /* skip constant objects */ if (object->is_constant() && !object->is_modified() && !object->need_shader_update && - !scale_is_modified()) { + !scale_is_modified()) + { continue; } @@ -994,7 +997,8 @@ void AlembicProcedural::load_objects(Progress &progress) geometry = scene_->create_node(); } else if (abc_object->schema_type == AlembicObject::POLY_MESH || - abc_object->schema_type == AlembicObject::SUBD) { + abc_object->schema_type == AlembicObject::SUBD) + { geometry = scene_->create_node(); } else { @@ -1469,7 +1473,8 @@ void AlembicProcedural::build_caches(Progress &progress) } else if (object->schema_type == AlembicObject::CURVES) { if (!object->has_data_loaded() || default_radius_is_modified() || - object->radius_scale_is_modified()) { + object->radius_scale_is_modified()) + { ICurves curves(object->iobject, Alembic::Abc::kWrapExisting); ICurvesSchema schema = curves.getSchema(); object->load_data_in_cache(object->get_cached_data(), this, schema, progress); @@ -1477,7 +1482,8 @@ void AlembicProcedural::build_caches(Progress &progress) } else if (object->schema_type == AlembicObject::POINTS) { if (!object->has_data_loaded() || default_radius_is_modified() || - object->radius_scale_is_modified()) { + object->radius_scale_is_modified()) + { IPoints points(object->iobject, Alembic::Abc::kWrapExisting); IPointsSchema schema = points.getSchema(); object->load_data_in_cache(object->get_cached_data(), this, schema, progress); diff --git a/intern/cycles/scene/alembic_read.cpp b/intern/cycles/scene/alembic_read.cpp index 26a4153a825..e6f8ed1d4c6 100644 --- a/intern/cycles/scene/alembic_read.cpp +++ b/intern/cycles/scene/alembic_read.cpp @@ -470,7 +470,8 @@ static void add_subd_edge_creases(CachedData &cached_data, chrono_t time) { if (!(data.crease_indices.valid() && data.crease_lengths.valid() && - data.crease_sharpnesses.valid())) { + data.crease_sharpnesses.valid())) + { return; } @@ -519,7 +520,8 @@ static void add_subd_vertex_creases(CachedData &cached_data, const FloatArraySamplePtr creases_sharpnesses = data.crease_sharpnesses.getValue(iss); if (!(creases_indices && creases_sharpnesses) || - creases_indices->size() != creases_sharpnesses->size()) { + creases_indices->size() != creases_sharpnesses->size()) + { return; } diff --git a/intern/cycles/scene/attribute.cpp b/intern/cycles/scene/attribute.cpp index 5a9bec6af46..42c3f7ea806 100644 --- a/intern/cycles/scene/attribute.cpp +++ b/intern/cycles/scene/attribute.cpp @@ -278,9 +278,11 @@ bool Attribute::same_storage(TypeDesc a, TypeDesc b) return true; if (a == TypeDesc::TypeColor || a == TypeDesc::TypePoint || a == TypeDesc::TypeVector || - a == TypeDesc::TypeNormal) { + a == TypeDesc::TypeNormal) + { if (b == TypeDesc::TypeColor || b == TypeDesc::TypePoint || b == TypeDesc::TypeVector || - b == TypeDesc::TypeNormal) { + b == TypeDesc::TypeNormal) + { return true; } } diff --git a/intern/cycles/scene/colorspace.cpp b/intern/cycles/scene/colorspace.cpp index a66fddbf7d4..14b35e2d8cf 100644 --- a/intern/cycles/scene/colorspace.cpp +++ b/intern/cycles/scene/colorspace.cpp @@ -72,7 +72,8 @@ ColorSpaceProcessor *ColorSpaceManager::get_processor(ustring colorspace) bool ColorSpaceManager::colorspace_is_data(ustring colorspace) { if (colorspace == u_colorspace_auto || colorspace == u_colorspace_raw || - colorspace == u_colorspace_srgb) { + colorspace == u_colorspace_srgb) + { return false; } @@ -200,14 +201,16 @@ void ColorSpaceManager::is_builtin_colorspace(ustring colorspace, /* Make sure that there is no channel crosstalk. */ if (fabsf(cR[1]) > 1e-5f || fabsf(cR[2]) > 1e-5f || fabsf(cG[0]) > 1e-5f || - fabsf(cG[2]) > 1e-5f || fabsf(cB[0]) > 1e-5f || fabsf(cB[1]) > 1e-5f) { + fabsf(cG[2]) > 1e-5f || fabsf(cB[0]) > 1e-5f || fabsf(cB[1]) > 1e-5f) + { is_scene_linear = false; is_srgb = false; break; } /* Make sure that the three primaries combine linearly. */ if (!compare_floats(cR[0], cW[0], 1e-6f, 64) || !compare_floats(cG[1], cW[1], 1e-6f, 64) || - !compare_floats(cB[2], cW[2], 1e-6f, 64)) { + !compare_floats(cB[2], cW[2], 1e-6f, 64)) + { is_scene_linear = false; is_srgb = false; break; diff --git a/intern/cycles/scene/constant_fold.cpp b/intern/cycles/scene/constant_fold.cpp index 224c8774cc6..21e28698edd 100644 --- a/intern/cycles/scene/constant_fold.cpp +++ b/intern/cycles/scene/constant_fold.cpp @@ -570,7 +570,8 @@ void ConstantFolder::fold_mapping(NodeMappingType type) const /* Check all use values are zero, note location is not used by vector and normal types. */ (is_zero(location_in) || type == NODE_MAPPING_TYPE_VECTOR || type == NODE_MAPPING_TYPE_NORMAL) && - is_zero(rotation_in) && is_one(scale_in)) { + is_zero(rotation_in) && is_one(scale_in)) + { try_bypass_or_make_constant(vector_in); } } diff --git a/intern/cycles/scene/film.cpp b/intern/cycles/scene/film.cpp index 1861dae2590..fcb34bcf5bb 100644 --- a/intern/cycles/scene/film.cpp +++ b/intern/cycles/scene/film.cpp @@ -471,7 +471,8 @@ void Film::update_passes(Scene *scene, bool add_sample_count_pass) Integrator *integrator = scene->integrator; if (!is_modified() && !object_manager->need_update() && !integrator->is_modified() && - !background->is_modified()) { + !background->is_modified()) + { return; } @@ -669,7 +670,8 @@ void Film::finalize_passes(Scene *scene, const bool use_denoise) /* If both passes have a name and the names are different, don't merge. * If either pass has a name, we'll use that name. */ if (!pass->get_name().empty() && !new_pass->get_name().empty() && - pass->get_name() != new_pass->get_name()) { + pass->get_name() != new_pass->get_name()) + { continue; } @@ -711,7 +713,8 @@ uint Film::get_kernel_features(const Scene *scene) const const PassMode pass_mode = pass->get_mode(); if (pass_mode == PassMode::DENOISED || pass_type == PASS_DENOISING_NORMAL || - pass_type == PASS_DENOISING_ALBEDO || pass_type == PASS_DENOISING_DEPTH) { + pass_type == PASS_DENOISING_ALBEDO || pass_type == PASS_DENOISING_DEPTH) + { kernel_features |= KERNEL_FEATURE_DENOISING; } diff --git a/intern/cycles/scene/geometry.cpp b/intern/cycles/scene/geometry.cpp index d268b5570f4..b26473697c4 100644 --- a/intern/cycles/scene/geometry.cpp +++ b/intern/cycles/scene/geometry.cpp @@ -500,7 +500,8 @@ void GeometryManager::device_update_preprocess(Device *device, Scene *scene, Pro DeviceScene *dscene = &scene->dscene; if (device_update_flags & (DEVICE_MESH_DATA_NEEDS_REALLOC | DEVICE_CURVE_DATA_NEEDS_REALLOC | - DEVICE_POINT_DATA_NEEDS_REALLOC)) { + DEVICE_POINT_DATA_NEEDS_REALLOC)) + { delete scene->bvh; scene->bvh = nullptr; diff --git a/intern/cycles/scene/geometry_mesh.cpp b/intern/cycles/scene/geometry_mesh.cpp index 954a79f9de7..9303bcc71a0 100644 --- a/intern/cycles/scene/geometry_mesh.cpp +++ b/intern/cycles/scene/geometry_mesh.cpp @@ -106,7 +106,8 @@ void GeometryManager::device_update_mesh(Device *, Mesh *mesh = static_cast(geom); if (mesh->shader_is_modified() || mesh->smooth_is_modified() || - mesh->triangles_is_modified() || copy_all_data) { + mesh->triangles_is_modified() || copy_all_data) + { mesh->pack_shaders(scene, &tri_shader[mesh->prim_offset]); } @@ -115,7 +116,8 @@ void GeometryManager::device_update_mesh(Device *, } if (mesh->verts_is_modified() || mesh->triangles_is_modified() || - mesh->vert_patch_uv_is_modified() || copy_all_data) { + mesh->vert_patch_uv_is_modified() || copy_all_data) + { mesh->pack_verts(&tri_verts[mesh->vert_offset], &tri_vindex[mesh->prim_offset], &tri_patch[mesh->prim_offset], diff --git a/intern/cycles/scene/image.cpp b/intern/cycles/scene/image.cpp index 3fbfcdd2c24..94626b402bd 100644 --- a/intern/cycles/scene/image.cpp +++ b/intern/cycles/scene/image.cpp @@ -799,7 +799,8 @@ void ImageManager::device_load_image(Device *device, Scene *scene, size_t slot, } #ifdef WITH_NANOVDB else if (type == IMAGE_DATA_TYPE_NANOVDB_FLOAT || type == IMAGE_DATA_TYPE_NANOVDB_FLOAT3 || - type == IMAGE_DATA_TYPE_NANOVDB_FPN || type == IMAGE_DATA_TYPE_NANOVDB_FP16) { + type == IMAGE_DATA_TYPE_NANOVDB_FPN || type == IMAGE_DATA_TYPE_NANOVDB_FP16) + { thread_scoped_lock device_lock(device_mutex); void *pixels = img->mem->alloc(img->metadata.byte_size, 0); diff --git a/intern/cycles/scene/integrator.cpp b/intern/cycles/scene/integrator.cpp index 27a17ffe0ac..502a6884272 100644 --- a/intern/cycles/scene/integrator.cpp +++ b/intern/cycles/scene/integrator.cpp @@ -189,7 +189,8 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene foreach (Shader *shader, scene->shaders) { /* keep this in sync with SD_HAS_TRANSPARENT_SHADOW in shader.cpp */ if ((shader->has_surface_transparent && shader->get_use_transparent_shadow()) || - shader->has_volume) { + shader->has_volume) + { kintegrator->transparent_shadows = true; break; } @@ -266,7 +267,8 @@ void Integrator::device_update(Device *device, DeviceScene *dscene, Scene *scene next_power_of_two(aa_samples - 1), MIN_TAB_SOBOL_SAMPLES, MAX_TAB_SOBOL_SAMPLES); if (kintegrator->sampling_pattern == SAMPLING_PATTERN_TABULATED_SOBOL && dscene->sample_pattern_lut.size() != - (sequence_size * NUM_TAB_SOBOL_PATTERNS * NUM_TAB_SOBOL_DIMENSIONS)) { + (sequence_size * NUM_TAB_SOBOL_PATTERNS * NUM_TAB_SOBOL_DIMENSIONS)) + { kintegrator->tabulated_sobol_sequence_size = sequence_size; if (dscene->sample_pattern_lut.size() != 0) { diff --git a/intern/cycles/scene/light.cpp b/intern/cycles/scene/light.cpp index 023d2d67f9a..4d93fb1721f 100644 --- a/intern/cycles/scene/light.cpp +++ b/intern/cycles/scene/light.cpp @@ -235,7 +235,8 @@ void LightManager::test_enabled_lights(Scene *scene) } if (last_background_enabled != background_enabled || - last_background_resolution != background_resolution) { + last_background_resolution != background_resolution) + { last_background_enabled = background_enabled; last_background_resolution = background_resolution; need_update_background = true; @@ -724,7 +725,8 @@ void LightManager::device_update_background(Device *device, if (vec_in && vec_in->link && vec_in->link->parent) { ShaderNode *vec_src = vec_in->link->parent; if ((vec_src->type != TextureCoordinateNode::get_node_type()) || - (vec_in->link != vec_src->output("Generated"))) { + (vec_in->link != vec_src->output("Generated"))) + { environment_res.x = max(environment_res.x, 4096); environment_res.y = max(environment_res.y, 2048); continue; diff --git a/intern/cycles/scene/light_tree.cpp b/intern/cycles/scene/light_tree.cpp index 385410d7e7a..c625d488a83 100644 --- a/intern/cycles/scene/light_tree.cpp +++ b/intern/cycles/scene/light_tree.cpp @@ -122,7 +122,8 @@ LightTreeEmitter::LightTreeEmitter(Scene *scene, measure.bcone.axis = -measure.bcone.axis; } if ((need_transformation || mesh->transform_applied) && - transform_negative_scale(object->get_tfm())) { + transform_negative_scale(object->get_tfm())) + { measure.bcone.axis = -measure.bcone.axis; } measure.bcone.theta_o = 0; diff --git a/intern/cycles/scene/mesh_displace.cpp b/intern/cycles/scene/mesh_displace.cpp index a9f97f31df5..16292a2d77b 100644 --- a/intern/cycles/scene/mesh_displace.cpp +++ b/intern/cycles/scene/mesh_displace.cpp @@ -183,7 +183,8 @@ bool GeometryManager::displace(Device *device, Scene *scene, Mesh *mesh, Progres num_verts, 3, function_bind(&fill_shader_input, scene, mesh, object_index, _1), - function_bind(&read_shader_output, scene, mesh, _1))) { + function_bind(&read_shader_output, scene, mesh, _1))) + { return false; } diff --git a/intern/cycles/scene/object.cpp b/intern/cycles/scene/object.cpp index 8d17b0803a7..33ef3289700 100644 --- a/intern/cycles/scene/object.cpp +++ b/intern/cycles/scene/object.cpp @@ -296,7 +296,8 @@ float Object::compute_volume_step_size() const Shader *shader = static_cast(node); if (shader->has_volume) { if ((shader->get_heterogeneous_volume() && shader->has_volume_spatial_varying) || - (shader->has_volume_attribute_dependency)) { + (shader->has_volume_attribute_dependency)) + { step_rate = fminf(shader->get_volume_step_rate(), step_rate); } } @@ -473,8 +474,8 @@ void ObjectManager::device_update_object_transform(UpdateObjectTransformState *s } else if (geom->is_volume()) { Volume *volume = static_cast(geom); - if (volume->attributes.find(ATTR_STD_VOLUME_VELOCITY) && - volume->get_velocity_scale() != 0.0f) { + if (volume->attributes.find(ATTR_STD_VOLUME_VELOCITY) && volume->get_velocity_scale() != 0.0f) + { flag |= SD_OBJECT_HAS_VOLUME_MOTION; kobject.velocity_scale = volume->get_velocity_scale(); } @@ -598,7 +599,8 @@ void ObjectManager::device_update_prim_offsets(Device *device, DeviceScene *dsce BVHLayoutMask layout_mask = device->get_bvh_layout_mask(dscene->data.kernel_features); if (layout_mask != BVH_LAYOUT_METAL && layout_mask != BVH_LAYOUT_MULTI_METAL && layout_mask != BVH_LAYOUT_MULTI_METAL_EMBREE && layout_mask != BVH_LAYOUT_HIPRT && - layout_mask != BVH_LAYOUT_MULTI_HIPRT && layout_mask != BVH_LAYOUT_MULTI_HIPRT_EMBREE) { + layout_mask != BVH_LAYOUT_MULTI_HIPRT && layout_mask != BVH_LAYOUT_MULTI_HIPRT_EMBREE) + { return; } } diff --git a/intern/cycles/scene/pass.cpp b/intern/cycles/scene/pass.cpp index 582e59c2889..8718a466c46 100644 --- a/intern/cycles/scene/pass.cpp +++ b/intern/cycles/scene/pass.cpp @@ -402,7 +402,8 @@ int Pass::get_offset(const vector &passes, const Pass *pass) /* Note that pass name is allowed to be empty. This is why we check for type and mode. */ if (current_pass->get_type() == pass->get_type() && current_pass->get_mode() == pass->get_mode() && - current_pass->get_name() == pass->get_name()) { + current_pass->get_name() == pass->get_name()) + { if (current_pass->is_written()) { return pass_offset; } diff --git a/intern/cycles/scene/scene.cpp b/intern/cycles/scene/scene.cpp index c9298aa775f..7734a225317 100644 --- a/intern/cycles/scene/scene.cpp +++ b/intern/cycles/scene/scene.cpp @@ -363,7 +363,8 @@ bool Scene::need_global_attribute(AttributeStandard std) else if (std == ATTR_STD_MOTION_VERTEX_NORMAL) return need_motion() == MOTION_BLUR; else if (std == ATTR_STD_VOLUME_VELOCITY || std == ATTR_STD_VOLUME_VELOCITY_X || - std == ATTR_STD_VOLUME_VELOCITY_Y || std == ATTR_STD_VOLUME_VELOCITY_Z) { + std == ATTR_STD_VOLUME_VELOCITY_Y || std == ATTR_STD_VOLUME_VELOCITY_Z) + { return need_motion() != MOTION_NONE; } diff --git a/intern/cycles/scene/shader.cpp b/intern/cycles/scene/shader.cpp index 6fb7de44547..1a37d87513c 100644 --- a/intern/cycles/scene/shader.cpp +++ b/intern/cycles/scene/shader.cpp @@ -131,7 +131,8 @@ static float3 output_estimate_emission(ShaderOutput *output, bool &is_constant) return zero_float3(); } else if (node->type == EmissionNode::get_node_type() || - node->type == BackgroundNode::get_node_type()) { + node->type == BackgroundNode::get_node_type()) + { /* Emission and Background node. */ ShaderInput *color_in = node->input("Color"); ShaderInput *strength_in = node->input("Strength"); @@ -166,7 +167,8 @@ static float3 output_estimate_emission(ShaderOutput *output, bool &is_constant) return estimate; } else if (node->type == LightFalloffNode::get_node_type() || - node->type == IESLightNode::get_node_type()) { + node->type == IESLightNode::get_node_type()) + { /* Get strength from Light Falloff and IES texture node. */ ShaderInput *strength_in = node->input("Strength"); is_constant = false; diff --git a/intern/cycles/scene/shader_nodes.cpp b/intern/cycles/scene/shader_nodes.cpp index 695588c6aa7..803dd4efac8 100644 --- a/intern/cycles/scene/shader_nodes.cpp +++ b/intern/cycles/scene/shader_nodes.cpp @@ -2182,7 +2182,8 @@ void ConvertNode::constant_fold(const ConstantFolder &folder) ShaderInput *prev_in = prev->inputs[0]; if (SocketType::is_float3(from) && (to == SocketType::FLOAT || SocketType::is_float3(to)) && - prev_in->link) { + prev_in->link) + { folder.bypass(prev_in->link); } } @@ -2841,7 +2842,8 @@ void PrincipledBsdfNode::expand(ShaderGraph *graph) ShaderInput *emission_in = input("Emission"); ShaderInput *emission_strength_in = input("Emission Strength"); if ((emission_in->link || emission != zero_float3()) && - (emission_strength_in->link || emission_strength != 0.0f)) { + (emission_strength_in->link || emission_strength != 0.0f)) + { /* Create add closure and emission, and relink inputs. */ AddClosureNode *add = graph->create_node(); EmissionNode *emission_node = graph->create_node(); @@ -5820,7 +5822,8 @@ void AttributeNode::attributes(Shader *shader, AttributeRequestSet *attributes) ShaderOutput *alpha_out = output("Alpha"); if (!color_out->links.empty() || !vector_out->links.empty() || !fac_out->links.empty() || - !alpha_out->links.empty()) { + !alpha_out->links.empty()) + { attributes->add_standard(attribute); } @@ -6619,7 +6622,8 @@ void VectorMathNode::compile(SVMCompiler &compiler) /* 3 Vector Operators */ if (math_type == NODE_VECTOR_MATH_WRAP || math_type == NODE_VECTOR_MATH_FACEFORWARD || - math_type == NODE_VECTOR_MATH_MULTIPLY_ADD) { + math_type == NODE_VECTOR_MATH_MULTIPLY_ADD) + { ShaderInput *vector3_in = input("Vector3"); int vector3_stack_offset = compiler.stack_assign(vector3_in); compiler.add_node( diff --git a/intern/cycles/scene/svm.cpp b/intern/cycles/scene/svm.cpp index 7b2f267b609..c43570bbf42 100644 --- a/intern/cycles/scene/svm.cpp +++ b/intern/cycles/scene/svm.cpp @@ -262,7 +262,8 @@ int SVMCompiler::stack_assign(ShaderInput *input) add_node(NODE_VALUE_F, node->get_int(input->socket_type), input->stack_offset); } else if (input->type() == SocketType::VECTOR || input->type() == SocketType::NORMAL || - input->type() == SocketType::POINT || input->type() == SocketType::COLOR) { + input->type() == SocketType::POINT || input->type() == SocketType::COLOR) + { add_node(NODE_VALUE_V, input->stack_offset); add_node(NODE_VALUE_V, node->get_float3(input->socket_type)); @@ -413,7 +414,8 @@ void SVMCompiler::find_dependencies(ShaderNodeSet &dependencies, { ShaderNode *node = (input->link) ? input->link->parent : NULL; if (node != NULL && done.find(node) == done.end() && node != skip_node && - dependencies.find(node) == dependencies.end()) { + dependencies.find(node) == dependencies.end()) + { foreach (ShaderInput *in, node->inputs) { find_dependencies(dependencies, done, in, skip_node); } diff --git a/intern/cycles/session/buffers.cpp b/intern/cycles/session/buffers.cpp index c447952754a..10362b63de6 100644 --- a/intern/cycles/session/buffers.cpp +++ b/intern/cycles/session/buffers.cpp @@ -230,12 +230,14 @@ bool BufferParams::modified(const BufferParams &other) const } if (full_x != other.full_x || full_y != other.full_y || full_width != other.full_width || - full_height != other.full_height) { + full_height != other.full_height) + { return true; } if (window_x != other.window_x || window_y != other.window_y || - window_width != other.window_width || window_height != other.window_height) { + window_width != other.window_width || window_height != other.window_height) + { return true; } @@ -249,7 +251,8 @@ bool BufferParams::modified(const BufferParams &other) const if (exposure != other.exposure || use_approximate_shadow_catcher != other.use_approximate_shadow_catcher || - use_transparent_background != other.use_transparent_background) { + use_transparent_background != other.use_transparent_background) + { return true; } @@ -352,7 +355,8 @@ void render_buffers_host_copy_denoised(RenderBuffers *dst, float *dst_pixel = dst->buffer.data(); for (int i = 0; i < dst_num_pixels; - ++i, src_pixel += src_pass_stride, dst_pixel += dst_pass_stride) { + ++i, src_pixel += src_pass_stride, dst_pixel += dst_pass_stride) + { for (int pass_offset_idx = 0; pass_offset_idx < num_passes; ++pass_offset_idx) { const int dst_pass_offset = pass_offsets[pass_offset_idx].dst_offset; const int src_pass_offset = pass_offsets[pass_offset_idx].src_offset; diff --git a/intern/cycles/session/merge.cpp b/intern/cycles/session/merge.cpp index d9d189ebd2b..4993e8b5495 100644 --- a/intern/cycles/session/merge.cpp +++ b/intern/cycles/session/merge.cpp @@ -77,12 +77,14 @@ struct MergeImage { static MergeChannelOp parse_channel_operation(const string &pass_name) { if (pass_name == "Depth" || pass_name == "IndexMA" || pass_name == "IndexOB" || - string_startswith(pass_name, "Crypto")) { + string_startswith(pass_name, "Crypto")) + { return MERGE_CHANNEL_COPY; } else if (string_startswith(pass_name, "Debug BVH") || string_startswith(pass_name, "Debug Ray") || - string_startswith(pass_name, "Debug Render Time")) { + string_startswith(pass_name, "Debug Render Time")) + { return MERGE_CHANNEL_SUM; } else if (string_startswith(pass_name, "Debug Sample Count")) { @@ -263,7 +265,8 @@ static bool open_images(const vector &filepaths, vector &ima if (base_spec.width != spec.width || base_spec.height != spec.height || base_spec.depth != spec.depth || base_spec.format != spec.format || - base_spec.deep != spec.deep) { + base_spec.deep != spec.deep) + { error = "Images do not have matching size and data layout."; return false; } @@ -436,7 +439,8 @@ static bool merge_pixels(const vector &images, const auto &samples = layer_samples.at(layer.name); for (size_t i = 0; offset < num_pixels; - offset += stride, sample_pass_offset += stride, out_offset += out_stride, i++) { + offset += stride, sample_pass_offset += stride, out_offset += out_stride, i++) + { const float total_samples = samples.per_pixel[i]; float layer_samples; diff --git a/intern/cycles/session/session.cpp b/intern/cycles/session/session.cpp index 39b7853cec2..8e2609936d7 100644 --- a/intern/cycles/session/session.cpp +++ b/intern/cycles/session/session.cpp @@ -490,7 +490,8 @@ int2 Session::get_effective_tile_size() const const int64_t actual_tile_area = static_cast(tile_size) * tile_size; if (actual_tile_area >= image_area && image_width <= TileManager::MAX_TILE_SIZE && - image_height <= TileManager::MAX_TILE_SIZE) { + image_height <= TileManager::MAX_TILE_SIZE) + { return make_int2(image_width, image_height); } diff --git a/intern/cycles/session/tile.cpp b/intern/cycles/session/tile.cpp index 5283f9883ae..15f570287bf 100644 --- a/intern/cycles/session/tile.cpp +++ b/intern/cycles/session/tile.cpp @@ -521,7 +521,8 @@ bool TileManager::write_tile(const RenderBuffers &tile_buffers) * Our task reference: #93008. */ if (tile_params.window_x || tile_params.window_y || tile_params.window_width != tile_params.width || - tile_params.window_height != tile_params.height) { + tile_params.window_height != tile_params.height) + { pixel_storage.resize(pass_stride * tile_params.window_width * tile_params.window_height); float *pixels_continuous = pixel_storage.data(); @@ -561,7 +562,8 @@ bool TileManager::write_tile(const RenderBuffers &tile_buffers) pixels, xstride, ystride, - zstride)) { + zstride)) + { LOG(ERROR) << "Error writing tile " << write_state_.tile_out->geterror(); return false; } @@ -586,7 +588,8 @@ void TileManager::finish_write_tiles() vector pixel_storage(tile_size_.x * tile_size_.y * buffer_params_.pass_stride); for (int tile_index = write_state_.num_tiles_written; tile_index < tile_state_.num_tiles; - ++tile_index) { + ++tile_index) + { const Tile tile = get_tile_for_index(tile_index); const int tile_x = tile.x + tile.window_x; diff --git a/intern/cycles/subd/patch_table.cpp b/intern/cycles/subd/patch_table.cpp index a2dff0d0889..3c78d51ea7a 100644 --- a/intern/cycles/subd/patch_table.cpp +++ b/intern/cycles/subd/patch_table.cpp @@ -95,8 +95,8 @@ static void build_patch_map(PackedPatchTable &table, for (int array = 0; array < table.num_arrays; array++) { Far::ConstPatchParamArray params = patch_table->GetPatchParams(array); - for (int i = 0; i < patch_table->GetNumPatches(array); - i++, handle_index += PATCH_HANDLE_SIZE) { + for (int i = 0; i < patch_table->GetNumPatches(array); i++, handle_index += PATCH_HANDLE_SIZE) + { const Far::PatchParam ¶m = params[i]; unsigned short depth = param.GetDepth(); diff --git a/intern/cycles/subd/split.cpp b/intern/cycles/subd/split.cpp index a9a5b4c990b..073ae3d0a49 100644 --- a/intern/cycles/subd/split.cpp +++ b/intern/cycles/subd/split.cpp @@ -692,7 +692,8 @@ void DiagSplit::post_split() /* Add to map */ if (params.mesh->vert_to_stitching_key_map.find(vert) == - params.mesh->vert_to_stitching_key_map.end()) { + params.mesh->vert_to_stitching_key_map.end()) + { params.mesh->vert_to_stitching_key_map[vert] = key; params.mesh->vert_stitching_map.insert({key, vert}); } diff --git a/intern/cycles/util/math_matrix.h b/intern/cycles/util/math_matrix.h index b10d9b3c938..39186798378 100644 --- a/intern/cycles/util/math_matrix.h +++ b/intern/cycles/util/math_matrix.h @@ -277,7 +277,8 @@ ccl_device void math_matrix_jacobi_eigendecomposition(ccl_private float *A, /* If we're in a later sweep and the element already is very small, * just set it to zero and skip the rotation. */ if (sweep > 3 && abs_element <= singular_epsilon * fabsf(MAT(A, n, row, row)) && - abs_element <= singular_epsilon * fabsf(MAT(A, n, col, col))) { + abs_element <= singular_epsilon * fabsf(MAT(A, n, col, col))) + { MAT(A, n, row, col) = 0.0f; continue; } diff --git a/intern/cycles/util/md5.cpp b/intern/cycles/util/md5.cpp index 62a9e62652d..0ff4ba67f24 100644 --- a/intern/cycles/util/md5.cpp +++ b/intern/cycles/util/md5.cpp @@ -95,8 +95,7 @@ void MD5Hash::process(const uint8_t *data /*[64]*/) */ static const int w = 1; - if (*((const uint8_t *)&w)) /* dynamic little-endian */ - { + if (*((const uint8_t *)&w)) /* dynamic little-endian */ { /* * On little-endian machines, we can process properly aligned * data without copying it. diff --git a/intern/cycles/util/path.cpp b/intern/cycles/util/path.cpp index 190a979af79..5cb72d875b7 100644 --- a/intern/cycles/util/path.cpp +++ b/intern/cycles/util/path.cpp @@ -236,7 +236,8 @@ class directory_iterator { bool skip_dots() { while (strcmp(name_list_[cur_entry_]->d_name, ".") == 0 || - strcmp(name_list_[cur_entry_]->d_name, "..") == 0) { + strcmp(name_list_[cur_entry_]->d_name, "..") == 0) + { if (!step()) { return false; } @@ -478,12 +479,14 @@ static string path_unc_to_short(const string &path) { size_t len = path.size(); if ((len > 3) && (path[0] == DIR_SEP) && (path[1] == DIR_SEP) && (path[2] == '?') && - ((path[3] == DIR_SEP) || (path[3] == DIR_SEP_ALT))) { + ((path[3] == DIR_SEP) || (path[3] == DIR_SEP_ALT))) + { if ((len > 5) && (path[5] == ':')) { return path.substr(4, len - 4); } else if ((len > 7) && (path.substr(4, 3) == "UNC") && - ((path[7] == DIR_SEP) || (path[7] == DIR_SEP_ALT))) { + ((path[7] == DIR_SEP) || (path[7] == DIR_SEP_ALT))) + { return "\\\\" + path.substr(8, len - 8); } } diff --git a/intern/cycles/util/transform.h b/intern/cycles/util/transform.h index 0c39901a63c..6ec867a8bff 100644 --- a/intern/cycles/util/transform.h +++ b/intern/cycles/util/transform.h @@ -339,7 +339,8 @@ ccl_device_inline bool transform_uniform_scale(const Transform &tfm, float &scal float stz = len_squared(transform_get_column(&tfm, 2)); if (fabsf(sx - sy) < eps && fabsf(sx - sz) < eps && fabsf(sx - stx) < eps && - fabsf(sx - sty) < eps && fabsf(sx - stz) < eps) { + fabsf(sx - sty) < eps && fabsf(sx - stz) < eps) + { scale = sx; return true; } diff --git a/intern/dualcon/intern/octree.cpp b/intern/dualcon/intern/octree.cpp index 03f143a0a94..4204de2f841 100644 --- a/intern/dualcon/intern/octree.cpp +++ b/intern/dualcon/intern/octree.cpp @@ -1258,7 +1258,8 @@ Node *Octree::connectFace( PathElement *newEleN; if (curEleN->pos[0] != stN[0] || curEleN->pos[1] != stN[1] || curEleN->pos[2] != stN[2]) { if (curEleN->next->pos[0] != stN[0] || curEleN->next->pos[1] != stN[1] || - curEleN->next->pos[2] != stN[2]) { + curEleN->next->pos[2] != stN[2]) + { newEleN = new PathElement; newEleN->next = curEleN->next; newEleN->pos[0] = stN[0]; @@ -2302,7 +2303,8 @@ void Octree::computeMinimizer(const LeafNode *leaf, int st[3], int len, float rv if (rvalue[0] < st[0] - nh1 || rvalue[1] < st[1] - nh1 || rvalue[2] < st[2] - nh1 || - rvalue[0] > st[0] + nh2 || rvalue[1] > st[1] + nh2 || rvalue[2] > st[2] + nh2) { + rvalue[0] > st[0] + nh2 || rvalue[1] > st[1] + nh2 || rvalue[2] > st[2] + nh2) + { // Use mass point instead rvalue[0] = mp[0]; rvalue[1] = mp[1]; diff --git a/intern/ffmpeg/ffmpeg_compat.h b/intern/ffmpeg/ffmpeg_compat.h index 5a81abb928f..53f28239760 100644 --- a/intern/ffmpeg/ffmpeg_compat.h +++ b/intern/ffmpeg/ffmpeg_compat.h @@ -282,7 +282,8 @@ int av_image_deinterlace( if (pix_fmt != AV_PIX_FMT_YUV420P && pix_fmt != AV_PIX_FMT_YUVJ420P && pix_fmt != AV_PIX_FMT_YUV422P && pix_fmt != AV_PIX_FMT_YUVJ422P && pix_fmt != AV_PIX_FMT_YUV444P && pix_fmt != AV_PIX_FMT_YUV411P && - pix_fmt != AV_PIX_FMT_GRAY8) { + pix_fmt != AV_PIX_FMT_GRAY8) + { return -1; } if ((width & 3) != 0 || (height & 3) != 0) { diff --git a/intern/ghost/intern/GHOST_ContextCGL.mm b/intern/ghost/intern/GHOST_ContextCGL.mm index 88674b0ec9c..e20e3c2b093 100644 --- a/intern/ghost/intern/GHOST_ContextCGL.mm +++ b/intern/ghost/intern/GHOST_ContextCGL.mm @@ -403,8 +403,8 @@ GHOST_TSuccess GHOST_ContextCGL::initializeDrawingContext() } } const int max_ctx_attempts = increasedSamplerLimit ? 2 : 1; - for (int ctx_create_attempt = 0; ctx_create_attempt < max_ctx_attempts; - ctx_create_attempt++) { + for (int ctx_create_attempt = 0; ctx_create_attempt < max_ctx_attempts; ctx_create_attempt++) + { attribs.clear(); attribs.reserve(40); @@ -756,7 +756,8 @@ void GHOST_ContextCGL::metalUpdateFramebuffer() /* NOTE(Metal): Metal API Path. */ if (m_defaultFramebufferMetalTexture[current_swapchain_index].texture && m_defaultFramebufferMetalTexture[current_swapchain_index].texture.width == width && - m_defaultFramebufferMetalTexture[current_swapchain_index].texture.height == height) { + m_defaultFramebufferMetalTexture[current_swapchain_index].texture.height == height) + { return; } diff --git a/intern/ghost/intern/GHOST_ContextEGL.cc b/intern/ghost/intern/GHOST_ContextEGL.cc index 2530827b6ae..5236898be06 100644 --- a/intern/ghost/intern/GHOST_ContextEGL.cc +++ b/intern/ghost/intern/GHOST_ContextEGL.cc @@ -342,7 +342,8 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext() } if (!EGL_CHK(::eglInitialize(m_display, &egl_major, &egl_minor)) || - (egl_major == 0 && egl_minor == 0)) { + (egl_major == 0 && egl_minor == 0)) + { /* We failed to create a regular render window, retry and see if we can create a headless * render context. */ ::eglTerminate(m_display); @@ -351,7 +352,8 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext() assert(egl_extension_st != nullptr); assert(strstr(egl_extension_st, "EGL_MESA_platform_surfaceless") != nullptr); if (egl_extension_st == nullptr || - strstr(egl_extension_st, "EGL_MESA_platform_surfaceless") == nullptr) { + strstr(egl_extension_st, "EGL_MESA_platform_surfaceless") == nullptr) + { goto error; } @@ -407,7 +409,8 @@ GHOST_TSuccess GHOST_ContextEGL::initializeDrawingContext() (m_contextMajorVersion == 2 && epoxy_egl_version(m_display) >= 13) || (m_contextMajorVersion == 3 && epoxy_has_egl_extension(m_display, "KHR_create_context")) || - (m_contextMajorVersion == 3 && epoxy_egl_version(m_display) >= 15))) { + (m_contextMajorVersion == 3 && epoxy_egl_version(m_display) >= 15))) + { fprintf(stderr, "Warning! May not be able to create a version %d.%d ES context with version %d.%d " "of EGL\n", diff --git a/intern/ghost/intern/GHOST_ContextGLX.cc b/intern/ghost/intern/GHOST_ContextGLX.cc index 04021d05cda..83510079587 100644 --- a/intern/ghost/intern/GHOST_ContextGLX.cc +++ b/intern/ghost/intern/GHOST_ContextGLX.cc @@ -113,7 +113,8 @@ GHOST_TSuccess GHOST_ContextGLX::initializeDrawingContext() (glXCreateContextAttribsARB = (PFNGLXCREATECONTEXTATTRIBSARBPROC)glXGetProcAddressARB( (const GLubyte *)"glXCreateContextAttribsARB")) == nullptr || (glXCreatePbuffer = (PFNGLXCREATEPBUFFERPROC)glXGetProcAddressARB( - (const GLubyte *)"glXCreatePbuffer")) == nullptr) { + (const GLubyte *)"glXCreatePbuffer")) == nullptr) + { extStart = (GLubyte *)""; } } diff --git a/intern/ghost/intern/GHOST_ContextVK.cc b/intern/ghost/intern/GHOST_ContextVK.cc index 74cc42e9176..85d90b15095 100644 --- a/intern/ghost/intern/GHOST_ContextVK.cc +++ b/intern/ghost/intern/GHOST_ContextVK.cc @@ -424,7 +424,8 @@ static void enableLayer(vector &layers_available, { #define PUSH_VKLAYER(name, name2) \ if (vklayer_config_exist("VkLayer_" #name ".json") && \ - checkLayerSupport(layers_available, "VK_LAYER_" #name2)) { \ + checkLayerSupport(layers_available, "VK_LAYER_" #name2)) \ + { \ layers_enabled.push_back("VK_LAYER_" #name2); \ enabled = true; \ } \ @@ -579,7 +580,8 @@ static GHOST_TSuccess getGraphicQueueFamily(VkPhysicalDevice device, uint32_t *r * and compute pipelines. We select this one; compute only queue family hints at async compute * implementations. */ if ((queue_family.queueFlags & VK_QUEUE_GRAPHICS_BIT) && - (queue_family.queueFlags & VK_QUEUE_COMPUTE_BIT)) { + (queue_family.queueFlags & VK_QUEUE_COMPUTE_BIT)) + { return GHOST_kSuccess; } (*r_queue_index)++; diff --git a/intern/ghost/intern/GHOST_DisplayManagerWin32.cc b/intern/ghost/intern/GHOST_DisplayManagerWin32.cc index 69624dcf8b2..12bc1ccb546 100644 --- a/intern/ghost/intern/GHOST_DisplayManagerWin32.cc +++ b/intern/ghost/intern/GHOST_DisplayManagerWin32.cc @@ -110,7 +110,8 @@ GHOST_TSuccess GHOST_DisplayManagerWin32::setCurrentDisplaySetting( int i = 0; while (::EnumDisplaySettings(display_device.DeviceName, i++, &dm)) { if ((dm.dmBitsPerPel == match.bpp) && (dm.dmPelsWidth == match.xPixels) && - (dm.dmPelsHeight == match.yPixels) && (dm.dmDisplayFrequency == match.frequency)) { + (dm.dmPelsHeight == match.yPixels) && (dm.dmDisplayFrequency == match.frequency)) + { break; } } diff --git a/intern/ghost/intern/GHOST_DisplayManagerX11.cc b/intern/ghost/intern/GHOST_DisplayManagerX11.cc index a6a632a1efb..53496bf3eba 100644 --- a/intern/ghost/intern/GHOST_DisplayManagerX11.cc +++ b/intern/ghost/intern/GHOST_DisplayManagerX11.cc @@ -171,13 +171,15 @@ GHOST_TSuccess GHOST_DisplayManagerX11::setCurrentDisplaySetting( if (best_fit == -1 || (vidmodes[i]->hdisplay < vidmodes[best_fit]->hdisplay) || (vidmodes[i]->hdisplay == vidmodes[best_fit]->hdisplay && - vidmodes[i]->vdisplay < vidmodes[best_fit]->vdisplay)) { + vidmodes[i]->vdisplay < vidmodes[best_fit]->vdisplay)) + { best_fit = i; continue; } if ((vidmodes[i]->hdisplay == vidmodes[best_fit]->hdisplay) && - (vidmodes[i]->vdisplay == vidmodes[best_fit]->vdisplay)) { + (vidmodes[i]->vdisplay == vidmodes[best_fit]->vdisplay)) + { if (!setting.frequency) { /* Higher is better, right? */ if (calculate_rate(vidmodes[i]) > calculate_rate(vidmodes[best_fit])) { @@ -186,7 +188,8 @@ GHOST_TSuccess GHOST_DisplayManagerX11::setCurrentDisplaySetting( } else { if (abs(calculate_rate(vidmodes[i]) - int(setting.frequency)) < - abs(calculate_rate(vidmodes[best_fit]) - int(setting.frequency))) { + abs(calculate_rate(vidmodes[best_fit]) - int(setting.frequency))) + { best_fit = i; } } diff --git a/intern/ghost/intern/GHOST_DropTargetWin32.cc b/intern/ghost/intern/GHOST_DropTargetWin32.cc index b21bd5fabad..41a630eb10f 100644 --- a/intern/ghost/intern/GHOST_DropTargetWin32.cc +++ b/intern/ghost/intern/GHOST_DropTargetWin32.cc @@ -338,7 +338,8 @@ void printLastError(void) 0, (LPTSTR)&s, 0, - NULL)) { + NULL)) + { printf("\nLastError: (%d) %s\n", int(err), s); LocalFree(s); } diff --git a/intern/ghost/intern/GHOST_DropTargetX11.cc b/intern/ghost/intern/GHOST_DropTargetX11.cc index f3b42a1da93..a721d9e8bdb 100644 --- a/intern/ghost/intern/GHOST_DropTargetX11.cc +++ b/intern/ghost/intern/GHOST_DropTargetX11.cc @@ -210,7 +210,8 @@ bool GHOST_DropTargetX11::GHOST_HandleClientMessage(XEvent *event) &dropBufferSize, &dropType, &dropX, - &dropY)) { + &dropY)) + { void *data = getGhostData(dropType, dropBuffer, dropBufferSize); if (data) { diff --git a/intern/ghost/intern/GHOST_ImeWin32.cc b/intern/ghost/intern/GHOST_ImeWin32.cc index 54171130ca3..92276ae7c00 100644 --- a/intern/ghost/intern/GHOST_ImeWin32.cc +++ b/intern/ghost/intern/GHOST_ImeWin32.cc @@ -325,7 +325,8 @@ void GHOST_ImeWin32::GetCaret(HIMC imm_context, LPARAM lparam, ImeComposition *c target_start = 0; } if (target_start != -1 && target_start < attribute_size && - attribute_data[target_start] == ATTR_TARGET_NOTCONVERTED) { + attribute_data[target_start] == ATTR_TARGET_NOTCONVERTED) + { composition->cursor_position = target_start; } } diff --git a/intern/ghost/intern/GHOST_SystemCocoa.mm b/intern/ghost/intern/GHOST_SystemCocoa.mm index 117d72225d6..c94c8dbc8a7 100644 --- a/intern/ghost/intern/GHOST_SystemCocoa.mm +++ b/intern/ghost/intern/GHOST_SystemCocoa.mm @@ -965,7 +965,8 @@ bool GHOST_SystemCocoa::processEvents(bool waitForEvent) // special hotkeys to switch between views, so override directly if ([event type] == NSEventTypeKeyDown && [event keyCode] == kVK_Tab && - ([event modifierFlags] & NSEventModifierFlagControl)) { + ([event modifierFlags] & NSEventModifierFlagControl)) + { handleKeyEvent(event); } else { @@ -1257,7 +1258,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleDraggingEvent(GHOST_TEventType eventType return GHOST_kFailure; if (([bitmapImage bitsPerPixel] == 32) && (([bitmapImage bitmapFormat] & 0x5) == 0) && - ![bitmapImage isPlanar]) { + ![bitmapImage isPlanar]) + { /* Try a fast copy if the image is a meshed RGBA 32bit bitmap. */ toIBuf = (uint8_t *)ibuf->rect; rasterRGB = (uint8_t *)[bitmapImage bitmapData]; @@ -1918,8 +1920,8 @@ GHOST_TSuccess GHOST_SystemCocoa::handleKeyEvent(void *eventPtr) GHOST_kKeyLeftControl, false)); } - if ((modifiers & NSEventModifierFlagOption) != - (m_modifierMask & NSEventModifierFlagOption)) { + if ((modifiers & NSEventModifierFlagOption) != (m_modifierMask & NSEventModifierFlagOption)) + { pushEvent(new GHOST_EventKey( [event timestamp] * 1000, (modifiers & NSEventModifierFlagOption) ? GHOST_kEventKeyDown : GHOST_kEventKeyUp, diff --git a/intern/ghost/intern/GHOST_SystemWayland.cc b/intern/ghost/intern/GHOST_SystemWayland.cc index 3a8786dd716..1919a9abcfd 100644 --- a/intern/ghost/intern/GHOST_SystemWayland.cc +++ b/intern/ghost/intern/GHOST_SystemWayland.cc @@ -1672,7 +1672,8 @@ static int ghost_wl_display_event_pump(struct wl_display *wl_display) if (wl_display_prepare_read(wl_display) == 0) { /* Use #GWL_IOR_NO_RETRY to ensure #SIGINT will break us out of our wait. */ if (file_descriptor_is_io_ready( - wl_display_get_fd(wl_display), GWL_IOR_READ | GWL_IOR_NO_RETRY, 0) > 0) { + wl_display_get_fd(wl_display), GWL_IOR_READ | GWL_IOR_NO_RETRY, 0) > 0) + { err = wl_display_read_events(wl_display); } else { @@ -2139,7 +2140,8 @@ static void data_source_handle_send(void *data, auto write_file_fn = [](GWL_Seat *seat, const int fd) { if (UNLIKELY(write(fd, seat->data_source->buffer_out.data, - seat->data_source->buffer_out.data_size) < 0)) { + seat->data_source->buffer_out.data_size) < 0)) + { CLOG_WARN(LOG, "error writing to clipboard: %s", std::strerror(errno)); } close(fd); @@ -3974,7 +3976,8 @@ static void keyboard_handle_key(void *data, if (key_repeat_payload == nullptr) { /* Start timer for repeating key, if applicable. */ if ((seat->key_repeat.rate > 0) && (etype == GHOST_kEventKeyDown) && - xkb_keymap_key_repeats(xkb_state_get_keymap(seat->xkb_state), key_code)) { + xkb_keymap_key_repeats(xkb_state_get_keymap(seat->xkb_state), key_code)) + { key_repeat_payload = new GWL_KeyRepeatPlayload(); key_repeat_payload->seat = seat; key_repeat_payload->key_code = key_code; @@ -4175,7 +4178,8 @@ static void primary_selection_source_send(void *data, auto write_file_fn = [](GWL_PrimarySelection *primary, const int fd) { if (UNLIKELY(write(fd, primary->data_source->buffer_out.data, - primary->data_source->buffer_out.data_size) < 0)) { + primary->data_source->buffer_out.data_size) < 0)) + { CLOG_WARN(LOG, "error writing to primary clipboard: %s", std::strerror(errno)); } close(fd); @@ -4468,7 +4472,8 @@ static void xdg_output_handle_logical_size(void *data, * done (we can't match exactly because fractional scaling can't be * detected otherwise), then override if necessary. */ if ((output->size_logical[0] == width) && - (output->scale_fractional == (1 * FRACTIONAL_DENOMINATOR))) { + (output->scale_fractional == (1 * FRACTIONAL_DENOMINATOR))) + { GHOST_PRINT("xdg_output scale did not match, overriding with wl_output scale\n"); #ifdef USE_GNOME_CONFINE_HACK @@ -5313,7 +5318,8 @@ static int gwl_registry_handler_interface_slot_max() static int gwl_registry_handler_interface_slot_from_string(const char *interface) { for (const GWL_RegistryHandler *handler = gwl_registry_handlers; handler->interface_p != nullptr; - handler++) { + handler++) + { if (STREQ(interface, *handler->interface_p)) { return int(handler - gwl_registry_handlers); } @@ -5438,7 +5444,8 @@ static void *gwl_display_event_thread_fn(void *display_voidp) while (display->events_pthread_is_active) { /* Wait for an event, this thread is dedicated to event handling. */ if (ghost_wl_display_event_pump_from_thread( - display->wl_display, fd, display->system->server_mutex) == -1) { + display->wl_display, fd, display->system->server_mutex) == -1) + { break; } } @@ -7317,7 +7324,8 @@ bool ghost_wl_dynload_libraries_init() if (wayland_dynload_client_init(verbose) && /* `libwayland-client`. */ wayland_dynload_cursor_init(verbose) && /* `libwayland-cursor`. */ wayland_dynload_egl_init(verbose) /* `libwayland-egl`. */ - ) { + ) + { # ifdef WITH_GHOST_WAYLAND_LIBDECOR has_libdecor = wayland_dynload_libdecor_init(verbose); /* `libdecor-0`. */ # endif diff --git a/intern/ghost/intern/GHOST_SystemWin32.cc b/intern/ghost/intern/GHOST_SystemWin32.cc index 60970cb263d..55efddbe7a5 100644 --- a/intern/ghost/intern/GHOST_SystemWin32.cc +++ b/intern/ghost/intern/GHOST_SystemWin32.cc @@ -958,7 +958,8 @@ void GHOST_SystemWin32::processWintabEvent(GHOST_WindowWin32 *window) * event queue. */ MSG msg; if (PeekMessage(&msg, window->getHWND(), message, message, PM_REMOVE | PM_NOYIELD) && - msg.message != WM_QUIT) { + msg.message != WM_QUIT) + { WINTAB_PRINTF(" ... associated to system button\n"); window->updateMouseCapture(MouseReleased); @@ -2311,7 +2312,8 @@ void GHOST_SystemWin32::putClipboard(const char *buffer, bool selection) const GHOST_TSuccess GHOST_SystemWin32::hasClipboardImage(void) const { if (IsClipboardFormatAvailable(CF_DIBV5) || - IsClipboardFormatAvailable(RegisterClipboardFormat("PNG"))) { + IsClipboardFormatAvailable(RegisterClipboardFormat("PNG"))) + { return GHOST_kSuccess; } diff --git a/intern/ghost/intern/GHOST_SystemX11.cc b/intern/ghost/intern/GHOST_SystemX11.cc index d960a049e98..9b2952d92a3 100644 --- a/intern/ghost/intern/GHOST_SystemX11.cc +++ b/intern/ghost/intern/GHOST_SystemX11.cc @@ -852,11 +852,8 @@ void GHOST_SystemX11::processEvent(XEvent *xe) if (xe->type == xi_presence) { XDevicePresenceNotifyEvent *notify_event = (XDevicePresenceNotifyEvent *)xe; - if (ELEM(notify_event->devchange, - DeviceEnabled, - DeviceDisabled, - DeviceAdded, - DeviceRemoved)) { + if (ELEM(notify_event->devchange, DeviceEnabled, DeviceDisabled, DeviceAdded, DeviceRemoved)) + { refreshXInputDevices(); /* update all window events */ @@ -1058,7 +1055,8 @@ void GHOST_SystemX11::processEvent(XEvent *xe) const uint mode_switch_mask = XkbKeysymToModifiers(xke->display, XK_Mode_switch); const uint number_hack_forbidden_kmods_mask = mode_switch_mask | ShiftMask; if ((xke->keycode >= 10 && xke->keycode < 20) && - ((xke->state & number_hack_forbidden_kmods_mask) == 0)) { + ((xke->state & number_hack_forbidden_kmods_mask) == 0)) + { key_sym = XLookupKeysym(xke, ShiftMask); if (!((key_sym >= XK_0) && (key_sym <= XK_9))) { key_sym = XLookupKeysym(xke, 0); @@ -1129,7 +1127,8 @@ void GHOST_SystemX11::processEvent(XEvent *xe) * The modified key is sent in the 'ascii's variable anyway. */ if ((xke->keycode >= 10 && xke->keycode < 20) && - ((key_sym = XLookupKeysym(xke, ShiftMask)) >= XK_0) && (key_sym <= XK_9)) { + ((key_sym = XLookupKeysym(xke, ShiftMask)) >= XK_0) && (key_sym <= XK_9)) + { /* Pass (keep shifted `key_sym`). */ } else { @@ -1640,7 +1639,8 @@ GHOST_TSuccess GHOST_SystemX11::getButtons(GHOST_Buttons &buttons) const &ry, &wx, &wy, - &mask_return) == True) { + &mask_return) == True) + { buttons.set(GHOST_kButtonMaskLeft, (mask_return & Button1Mask) != 0); buttons.set(GHOST_kButtonMaskMiddle, (mask_return & Button2Mask) != 0); buttons.set(GHOST_kButtonMaskRight, (mask_return & Button3Mask) != 0); @@ -1671,7 +1671,8 @@ static GHOST_TSuccess getCursorPosition_impl(Display *display, &ry, &wx, &wy, - &mask_return) == False) { + &mask_return) == False) + { return GHOST_kFailure; } diff --git a/intern/ghost/intern/GHOST_TrackpadWin32.cc b/intern/ghost/intern/GHOST_TrackpadWin32.cc index d19b0469123..2aa51a317ce 100644 --- a/intern/ghost/intern/GHOST_TrackpadWin32.cc +++ b/intern/ghost/intern/GHOST_TrackpadWin32.cc @@ -179,7 +179,8 @@ void GHOST_DirectManipulationHelper::onPointerHitTest(UINT32 pointerId) void GHOST_DirectManipulationHelper::update() { if (m_directManipulationEventHandler->dm_status == DIRECTMANIPULATION_RUNNING || - m_directManipulationEventHandler->dm_status == DIRECTMANIPULATION_INERTIA) { + m_directManipulationEventHandler->dm_status == DIRECTMANIPULATION_INERTIA) + { [[maybe_unused]] HRESULT hr = m_directManipulationUpdateManager->Update(nullptr); GHOST_ASSERT(SUCCEEDED(hr), "DirectManipulationUpdateManager update failed\n"); } @@ -257,7 +258,8 @@ HRESULT GHOST_DirectManipulationViewportEventHandler::OnViewportStatusChanged( } if (previous == DIRECTMANIPULATION_ENABLED || current == DIRECTMANIPULATION_READY || - (previous == DIRECTMANIPULATION_INERTIA && current != DIRECTMANIPULATION_INERTIA)) { + (previous == DIRECTMANIPULATION_INERTIA && current != DIRECTMANIPULATION_INERTIA)) + { resetViewport(viewport); } @@ -288,7 +290,8 @@ HRESULT GHOST_DirectManipulationViewportEventHandler::OnContentUpdated( /* Ignore repeating or incorrect input. */ if ((fabs(scale - last_scale) <= EPS && fabs(x - last_x) <= EPS && fabs(y - last_y) <= EPS) || - scale == 0.0f) { + scale == 0.0f) + { GHOST_PRINT("Ignoring touchpad input\n"); return hr; } diff --git a/intern/ghost/intern/GHOST_WindowCocoa.mm b/intern/ghost/intern/GHOST_WindowCocoa.mm index 4f90484d240..44284155734 100644 --- a/intern/ghost/intern/GHOST_WindowCocoa.mm +++ b/intern/ghost/intern/GHOST_WindowCocoa.mm @@ -484,10 +484,12 @@ void GHOST_WindowCocoa::setTitle(const char *title) associatedFileName = [windowTitle substringWithRange:fileStrRange]; [m_window setTitle:[associatedFileName lastPathComponent]]; - @try { + @try + { [m_window setRepresentedFilename:associatedFileName]; } - @catch (NSException *e) { + @catch (NSException *e) + { printf("\nInvalid file path given in window title"); } } diff --git a/intern/ghost/intern/GHOST_WindowViewCocoa.hh b/intern/ghost/intern/GHOST_WindowViewCocoa.hh index 29653bd5ea2..9e8479cb107 100644 --- a/intern/ghost/intern/GHOST_WindowViewCocoa.hh +++ b/intern/ghost/intern/GHOST_WindowViewCocoa.hh @@ -99,7 +99,8 @@ /* Start or continue composing? */ if ([[event characters] length] == 0 || [[event charactersIgnoringModifiers] length] == 0 || - composing || ime_process) { + composing || ime_process) + { composing = YES; // interpret event to call insertText diff --git a/intern/ghost/intern/GHOST_WindowWayland.cc b/intern/ghost/intern/GHOST_WindowWayland.cc index d4a113ee979..22e00823f8a 100644 --- a/intern/ghost/intern/GHOST_WindowWayland.cc +++ b/intern/ghost/intern/GHOST_WindowWayland.cc @@ -587,7 +587,8 @@ static void gwl_window_frame_pending_fractional_scale_set(GWL_Window *win, bool *r_surface_needs_buffer_scale) { if (win->frame_pending.fractional_scale == win->frame.fractional_scale && - win->frame_pending.buffer_scale == win->frame.buffer_scale) { + win->frame_pending.buffer_scale == win->frame.buffer_scale) + { return; } @@ -631,7 +632,8 @@ static void gwl_window_frame_pending_size_set(GWL_Window *win, win->frame.size[1] = win->frame_pending.size[1]; if (win->frame_pending.fractional_scale != win->frame.fractional_scale || - win->frame_pending.buffer_scale != win->frame.buffer_scale) { + win->frame_pending.buffer_scale != win->frame.buffer_scale) + { gwl_window_frame_pending_fractional_scale_set( win, r_surface_needs_commit, r_surface_needs_buffer_scale); } @@ -717,7 +719,8 @@ static void gwl_window_frame_update_from_pending_no_lock(GWL_Window *win) if (win->frame_pending.size[0] != 0 && win->frame_pending.size[1] != 0) { if ((win->frame.size[0] != win->frame_pending.size[0]) || - (win->frame.size[1] != win->frame_pending.size[1])) { + (win->frame.size[1] != win->frame_pending.size[1])) + { gwl_window_frame_pending_size_set( win, &surface_needs_commit, &surface_needs_egl_resize, &surface_needs_buffer_scale); } @@ -1460,7 +1463,8 @@ GHOST_TSuccess GHOST_WindowWayland::setWindowCursorGrab(GHOST_TGrabCursorMode mo bounds, m_cursorGrabAxis, window_->wl_surface, - this->scale_params())) { + this->scale_params())) + { return GHOST_kSuccess; } return GHOST_kFailure; @@ -2021,7 +2025,8 @@ bool GHOST_WindowWayland::outputs_changed_update_scale() if ((fractional_scale_prev != fractional_scale_next) || (window_->frame_pending.buffer_scale != window_->frame.buffer_scale) || - (force_frame_update == true)) { + (force_frame_update == true)) + { /* Resize the window failing to do so results in severe flickering with a * multi-monitor setup when multiple monitors have different scales. * diff --git a/intern/ghost/intern/GHOST_WindowWin32.cc b/intern/ghost/intern/GHOST_WindowWin32.cc index 1a17926f2a1..c0c26557f8b 100644 --- a/intern/ghost/intern/GHOST_WindowWin32.cc +++ b/intern/ghost/intern/GHOST_WindowWin32.cc @@ -561,7 +561,8 @@ GHOST_TSuccess GHOST_WindowWin32::setOrder(GHOST_TWindowOrder order) } if (hWndToRaise && - ::SetWindowPos(hWndToRaise, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) == FALSE) { + ::SetWindowPos(hWndToRaise, HWND_TOP, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE) == FALSE) + { return GHOST_kFailure; } return GHOST_kSuccess; @@ -1057,7 +1058,8 @@ void GHOST_WindowWin32::ThemeRefresh() RRF_RT_REG_DWORD, NULL, &lightMode, - &pcbData) == ERROR_SUCCESS) { + &pcbData) == ERROR_SUCCESS) + { BOOL DarkMode = !lightMode; /* `20 == DWMWA_USE_IMMERSIVE_DARK_MODE` in Windows 11 SDK. diff --git a/intern/ghost/intern/GHOST_WindowX11.cc b/intern/ghost/intern/GHOST_WindowX11.cc index 8a539f8a930..a5e501b7815 100644 --- a/intern/ghost/intern/GHOST_WindowX11.cc +++ b/intern/ghost/intern/GHOST_WindowX11.cc @@ -1453,8 +1453,8 @@ GHOST_TSuccess GHOST_WindowX11::setWindowCursorGrab(GHOST_TGrabCursorMode mode) * properly unless the user moves the mouse */ #if defined(WITH_X11_XINPUT) && defined(USE_X11_XINPUT_WARP) - if ((m_system->m_xinput_version.present) && - (m_system->m_xinput_version.major_version >= 2)) { + if ((m_system->m_xinput_version.present) && (m_system->m_xinput_version.major_version >= 2)) + { int device_id; if (XIGetClientPointer(m_display, None, &device_id) != False) { XIWarpPointer(m_display, device_id, None, None, 0, 0, 0, 0, 0, 0); diff --git a/intern/ghost/intern/GHOST_Wintab.cc b/intern/ghost/intern/GHOST_Wintab.cc index 784b71d21ef..1045debf279 100644 --- a/intern/ghost/intern/GHOST_Wintab.cc +++ b/intern/ghost/intern/GHOST_Wintab.cc @@ -404,7 +404,8 @@ GHOST_TButton GHOST_Wintab::mapWintabToGhostButton(uint cursor, WORD physicalBut BYTE systemButtons[numButtons] = {0}; if (!m_fpInfo(WTI_CURSORS + cursor, CSR_BUTTONMAP, &logicalButtons) || - !m_fpInfo(WTI_CURSORS + cursor, CSR_SYSBTNMAP, &systemButtons)) { + !m_fpInfo(WTI_CURSORS + cursor, CSR_SYSBTNMAP, &systemButtons)) + { return GHOST_kButtonMaskNone; } diff --git a/intern/ghost/intern/GHOST_XrContext.cc b/intern/ghost/intern/GHOST_XrContext.cc index 66ebb3c01c6..b5e71f7ec88 100644 --- a/intern/ghost/intern/GHOST_XrContext.cc +++ b/intern/ghost/intern/GHOST_XrContext.cc @@ -207,7 +207,8 @@ void GHOST_XrContext::initDebugMessenger() XR_FAILED(xrGetInstanceProcAddr( m_oxr->instance, "xrDestroyDebugUtilsMessengerEXT", - (PFN_xrVoidFunction *)&m_oxr->s_xrDestroyDebugUtilsMessengerEXT_fn))) { + (PFN_xrVoidFunction *)&m_oxr->s_xrDestroyDebugUtilsMessengerEXT_fn))) + { m_oxr->s_xrCreateDebugUtilsMessengerEXT_fn = nullptr; m_oxr->s_xrDestroyDebugUtilsMessengerEXT_fn = nullptr; @@ -227,7 +228,8 @@ void GHOST_XrContext::initDebugMessenger() create_info.userCallback = debug_messenger_func; if (XR_FAILED(m_oxr->s_xrCreateDebugUtilsMessengerEXT_fn( - m_oxr->instance, &create_info, &m_oxr->debug_messenger))) { + m_oxr->instance, &create_info, &m_oxr->debug_messenger))) + { fprintf(stderr, "Failed to create OpenXR debug messenger. Not a fatal error, continuing without the " "messenger.\n"); @@ -487,7 +489,8 @@ GHOST_TXrGraphicsBinding GHOST_XrContext::determineGraphicsBindingTypeToUse( /* The SteamVR OpenGL backend currently fails for NVIDIA GPU's. Disable it and allow falling * back to the DirectX one. */ if ((m_runtime_id == OPENXR_RUNTIME_STEAMVR) && (type == GHOST_kXrGraphicsOpenGL) && - ((create_info->context_flag & GHOST_kXrContextGpuNVIDIA) != 0)) { + ((create_info->context_flag & GHOST_kXrContextGpuNVIDIA) != 0)) + { continue; } #else diff --git a/intern/ghost/intern/GHOST_XrControllerModel.cc b/intern/ghost/intern/GHOST_XrControllerModel.cc index 55b76f51237..8e00d4ec32d 100644 --- a/intern/ghost/intern/GHOST_XrControllerModel.cc +++ b/intern/ghost/intern/GHOST_XrControllerModel.cc @@ -51,7 +51,8 @@ static void validate_accessor(const tinygltf::Accessor &accessor, { /* Make sure the accessor does not go out of range of the buffer view. */ if (accessor.byteOffset + (accessor.count - 1) * byte_stride + element_size > - buffer_view.byteLength) { + buffer_view.byteLength) + { throw GHOST_XrException("glTF: Accessor goes out of range of bufferview."); } @@ -141,9 +142,8 @@ static void read_indices(const tinygltf::Accessor &accessor, } constexpr size_t component_size_bytes = sizeof(TSrcIndex); - if (buffer_view.byteStride != 0 && - buffer_view.byteStride != - component_size_bytes) { /* Index buffer must be packed per glTF spec. */ + if (buffer_view.byteStride != 0 && buffer_view.byteStride != component_size_bytes) + { /* Index buffer must be packed per glTF spec. */ throw GHOST_XrException( "glTF: Accessor for indices uses bufferview with invalid 'byteStride'."); } @@ -302,7 +302,8 @@ static void load_node(const tinygltf::Model &gltf_model, for (size_t i = 0; i < node_properties.size(); ++i) { if ((node_state_indices[i] < 0) && (parent_name == node_properties[i].parentNodeName) && - (gltf_node.name == node_properties[i].nodeName)) { + (gltf_node.name == node_properties[i].nodeName)) + { node_state_indices[i] = node_idx; break; } diff --git a/intern/ghost/intern/GHOST_XrGraphicsBinding.cc b/intern/ghost/intern/GHOST_XrGraphicsBinding.cc index 70099ac4dcc..0cbd70756ee 100644 --- a/intern/ghost/intern/GHOST_XrGraphicsBinding.cc +++ b/intern/ghost/intern/GHOST_XrGraphicsBinding.cc @@ -94,10 +94,11 @@ class GHOST_XrGraphicsBindingOpenGL : public GHOST_IXrGraphicsBinding { s_xrGetOpenGLGraphicsRequirementsKHR_fn = nullptr; //} if (!s_xrGetOpenGLGraphicsRequirementsKHR_fn && - XR_FAILED(xrGetInstanceProcAddr( - instance, - "xrGetOpenGLGraphicsRequirementsKHR", - (PFN_xrVoidFunction *)&s_xrGetOpenGLGraphicsRequirementsKHR_fn))) { + XR_FAILED( + xrGetInstanceProcAddr(instance, + "xrGetOpenGLGraphicsRequirementsKHR", + (PFN_xrVoidFunction *)&s_xrGetOpenGLGraphicsRequirementsKHR_fn))) + { s_xrGetOpenGLGraphicsRequirementsKHR_fn = nullptr; return false; } @@ -352,10 +353,11 @@ class GHOST_XrGraphicsBindingD3D : public GHOST_IXrGraphicsBinding { s_xrGetD3D11GraphicsRequirementsKHR_fn = nullptr; //} if (!s_xrGetD3D11GraphicsRequirementsKHR_fn && - XR_FAILED(xrGetInstanceProcAddr( - instance, - "xrGetD3D11GraphicsRequirementsKHR", - (PFN_xrVoidFunction *)&s_xrGetD3D11GraphicsRequirementsKHR_fn))) { + XR_FAILED( + xrGetInstanceProcAddr(instance, + "xrGetD3D11GraphicsRequirementsKHR", + (PFN_xrVoidFunction *)&s_xrGetD3D11GraphicsRequirementsKHR_fn))) + { s_xrGetD3D11GraphicsRequirementsKHR_fn = nullptr; return false; } diff --git a/intern/ghost/intern/GHOST_XrSession.cc b/intern/ghost/intern/GHOST_XrSession.cc index 6a874a7f2c0..9a80094bfbb 100644 --- a/intern/ghost/intern/GHOST_XrSession.cc +++ b/intern/ghost/intern/GHOST_XrSession.cc @@ -225,7 +225,8 @@ void GHOST_XrSession::start(const GHOST_XrSessionBeginInfo *begin_info) m_gpu_binding = GHOST_XrGraphicsBindingCreateFromType(m_context->getGraphicsBindingType(), *m_gpu_ctx); if (!m_gpu_binding->checkVersionRequirements( - *m_gpu_ctx, m_context->getInstance(), m_oxr->system_id, &requirement_str)) { + *m_gpu_ctx, m_context->getInstance(), m_oxr->system_id, &requirement_str)) + { std::ostringstream strstream; strstream << "Available graphics context version does not meet the following requirements: " << requirement_str; diff --git a/intern/locale/boost_locale_wrapper.cpp b/intern/locale/boost_locale_wrapper.cpp index 8800fa7ac86..be213f2f4d8 100644 --- a/intern/locale/boost_locale_wrapper.cpp +++ b/intern/locale/boost_locale_wrapper.cpp @@ -33,8 +33,8 @@ static void bl_locale_global_cache() locale_global = std::locale(); facet_global = &std::use_facet(locale_global); } - catch (const std::bad_cast - &e) { /* if std::has_facet(l) == false, LC_ALL = "C" case */ + catch (const std::bad_cast &e) + { /* if std::has_facet(l) == false, LC_ALL = "C" case */ #ifndef NDEBUG std::cout << "bl_locale_global_cache:" << e.what() << " \n"; #endif diff --git a/intern/mikktspace/mikktspace.hh b/intern/mikktspace/mikktspace.hh index 14f7b26a311..136d8055f59 100644 --- a/intern/mikktspace/mikktspace.hh +++ b/intern/mikktspace/mikktspace.hh @@ -701,7 +701,8 @@ template class Mikktspace { // determines its orientation. // This is the only existing order dependency in the code!! if (triangle.group[0] == UNSET_ENTRY && triangle.group[1] == UNSET_ENTRY && - triangle.group[2] == UNSET_ENTRY) { + triangle.group[2] == UNSET_ENTRY) + { triangle.orientPreserving = group.orientPreserving; } } diff --git a/intern/opencolorio/ocio_impl.cc b/intern/opencolorio/ocio_impl.cc index 20ef6ebaaf1..7af21d0a6dc 100644 --- a/intern/opencolorio/ocio_impl.cc +++ b/intern/opencolorio/ocio_impl.cc @@ -477,14 +477,16 @@ void OCIOImpl::colorSpaceIsBuiltin(OCIO_ConstConfigRcPtr *config_, /* Make sure that there is no channel crosstalk. */ if (fabsf(cR[1]) > 1e-5f || fabsf(cR[2]) > 1e-5f || fabsf(cG[0]) > 1e-5f || - fabsf(cG[2]) > 1e-5f || fabsf(cB[0]) > 1e-5f || fabsf(cB[1]) > 1e-5f) { + fabsf(cG[2]) > 1e-5f || fabsf(cB[0]) > 1e-5f || fabsf(cB[1]) > 1e-5f) + { is_scene_linear = false; is_srgb = false; break; } /* Make sure that the three primaries combine linearly. */ if (!compare_floats(cR[0], cW[0], 1e-6f, 64) || !compare_floats(cG[1], cW[1], 1e-6f, 64) || - !compare_floats(cB[2], cW[2], 1e-6f, 64)) { + !compare_floats(cB[2], cW[2], 1e-6f, 64)) + { is_scene_linear = false; is_srgb = false; break; diff --git a/intern/opencolorio/ocio_impl_glsl.cc b/intern/opencolorio/ocio_impl_glsl.cc index d1716eeb6d8..2ecef115194 100644 --- a/intern/opencolorio/ocio_impl_glsl.cc +++ b/intern/opencolorio/ocio_impl_glsl.cc @@ -325,7 +325,8 @@ static bool addGPULut1D2D(OCIO_GPUTextures &textures, const float *values; shader_desc->getTextureValues(index, values); if (texture_name == nullptr || sampler_name == nullptr || width == 0 || height == 0 || - values == nullptr) { + values == nullptr) + { return false; } @@ -569,9 +570,11 @@ static OCIO_GPUDisplayShader &getGPUDisplayShader( const bool use_curve_mapping = (curve_mapping_settings != nullptr); for (std::list::iterator it = SHADER_CACHE.begin(); it != SHADER_CACHE.end(); - it++) { + it++) + { if (it->input == input && it->view == view && it->display == display && it->look == look && - it->use_curve_mapping == use_curve_mapping) { + it->use_curve_mapping == use_curve_mapping) + { /* Move to front of the cache to mark as most recently used. */ if (it != SHADER_CACHE.begin()) { SHADER_CACHE.splice(SHADER_CACHE.begin(), SHADER_CACHE, it); @@ -642,7 +645,8 @@ static OCIO_GPUDisplayShader &getGPUDisplayShader( display_shader.textures, shaderdesc_to_scene_linear, shaderdesc_to_display, - use_curve_mapping)) { + use_curve_mapping)) + { display_shader.valid = true; } } diff --git a/intern/opensubdiv/internal/base/util.cc b/intern/opensubdiv/internal/base/util.cc index 6b19954e274..f5e315ef21c 100644 --- a/intern/opensubdiv/internal/base/util.cc +++ b/intern/opensubdiv/internal/base/util.cc @@ -44,7 +44,8 @@ void stringSplit(vector *tokens, } // Append token which might be at the end of the string. if ((token_length != 0) || - (!skip_empty && token_start > 0 && separators.find(str[token_start - 1]) != string::npos)) { + (!skip_empty && token_start > 0 && separators.find(str[token_start - 1]) != string::npos)) + { string token = str.substr(token_start, token_length); tokens->push_back(token); } diff --git a/intern/opensubdiv/internal/evaluator/evaluator_impl.cc b/intern/opensubdiv/internal/evaluator/evaluator_impl.cc index 18c3890bbf2..d1e518dd1ac 100644 --- a/intern/opensubdiv/internal/evaluator/evaluator_impl.cc +++ b/intern/opensubdiv/internal/evaluator/evaluator_impl.cc @@ -495,7 +495,8 @@ OpenSubdiv_EvaluatorImpl *openSubdiv_createEvaluatorInternal( vector all_face_varying_stencils; all_face_varying_stencils.reserve(num_face_varying_channels); for (int face_varying_channel = 0; face_varying_channel < num_face_varying_channels; - ++face_varying_channel) { + ++face_varying_channel) + { StencilTableFactory::Options face_varying_stencil_options; face_varying_stencil_options.generateOffsets = stencil_generate_offsets; face_varying_stencil_options.generateIntermediateLevels = stencil_generate_intermediate_levels; @@ -532,7 +533,8 @@ OpenSubdiv_EvaluatorImpl *openSubdiv_createEvaluatorInternal( } } for (int face_varying_channel = 0; face_varying_channel < num_face_varying_channels; - ++face_varying_channel) { + ++face_varying_channel) + { const StencilTable *table = StencilTableFactory::AppendLocalPointStencilTableFaceVarying( *refiner, all_face_varying_stencils[face_varying_channel], diff --git a/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.cc b/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.cc index 76b03843952..c44c12814c0 100644 --- a/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.cc +++ b/intern/opensubdiv/internal/evaluator/gl_compute_evaluator.cc @@ -243,13 +243,15 @@ bool GLComputeEvaluator::Compile(BufferDescriptor const &srcDesc, // create a stencil kernel if (!_stencilKernel.Compile( - srcDesc, dstDesc, duDesc, dvDesc, duuDesc, duvDesc, dvvDesc, _workGroupSize)) { + srcDesc, dstDesc, duDesc, dvDesc, duuDesc, duvDesc, dvvDesc, _workGroupSize)) + { return false; } // create a patch kernel if (!_patchKernel.Compile( - srcDesc, dstDesc, duDesc, dvDesc, duuDesc, duvDesc, dvvDesc, _workGroupSize)) { + srcDesc, dstDesc, duDesc, dvDesc, duuDesc, duvDesc, dvvDesc, _workGroupSize)) + { return false; } diff --git a/intern/opensubdiv/internal/topology/mesh_topology_compare.cc b/intern/opensubdiv/internal/topology/mesh_topology_compare.cc index f83d1088faf..3b8c56a66d3 100644 --- a/intern/opensubdiv/internal/topology/mesh_topology_compare.cc +++ b/intern/opensubdiv/internal/topology/mesh_topology_compare.cc @@ -133,7 +133,8 @@ bool isEqualGeometry(const MeshTopology &mesh_topology, const OpenSubdiv_Convert float getEffectiveVertexSharpness(const OpenSubdiv_Converter *converter, const int vertex_index) { if (converter->isInfiniteSharpVertex != nullptr && - converter->isInfiniteSharpVertex(converter, vertex_index)) { + converter->isInfiniteSharpVertex(converter, vertex_index)) + { return OpenSubdiv::Sdc::Crease::SHARPNESS_INFINITE; } diff --git a/intern/rigidbody/rb_convex_hull_api.cpp b/intern/rigidbody/rb_convex_hull_api.cpp index 5d72984470d..7196ce483b7 100644 --- a/intern/rigidbody/rb_convex_hull_api.cpp +++ b/intern/rigidbody/rb_convex_hull_api.cpp @@ -70,7 +70,8 @@ int plConvexHullGetFaceSize(plConvexHull hull, int n) for (e_orig = &computer->edges[computer->faces[n]], e = e_orig, count = 0; count == 0 || e != e_orig; - e = e->getNextEdgeOfFace(), count++) { + e = e->getNextEdgeOfFace(), count++) + { ; } return count; @@ -84,7 +85,8 @@ void plConvexHullGetFaceLoops(plConvexHull hull, int n, int *loops) for (e_orig = &computer->edges[computer->faces[n]], e = e_orig, count = 0; count == 0 || e != e_orig; - e = e->getNextEdgeOfFace(), count++) { + e = e->getNextEdgeOfFace(), count++) + { loops[count] = e - &computer->edges[0]; } } @@ -97,7 +99,8 @@ void plConvexHullGetFaceVertices(plConvexHull hull, int n, int *vertices) for (e_orig = &computer->edges[computer->faces[n]], e = e_orig, count = 0; count == 0 || e != e_orig; - e = e->getNextEdgeOfFace(), count++) { + e = e->getNextEdgeOfFace(), count++) + { vertices[count] = e->getTargetVertex(); } } diff --git a/source/blender/asset_system/intern/asset_catalog_path.cc b/source/blender/asset_system/intern/asset_catalog_path.cc index 5b972b55634..fca4bea094b 100644 --- a/source/blender/asset_system/intern/asset_catalog_path.cc +++ b/source/blender/asset_system/intern/asset_catalog_path.cc @@ -174,7 +174,8 @@ void AssetCatalogPath::iterate_components(ComponentIteratorFn callback) const for (const char *path_component = this->path_.data(); path_component && path_component[0]; /* Jump to one after the next slash if there is any. */ - path_component = next_slash_ptr ? next_slash_ptr + 1 : nullptr) { + path_component = next_slash_ptr ? next_slash_ptr + 1 : nullptr) + { /* Note that this also treats backslashes as component separators, which * helps in cleaning up backslash-separated paths. */ next_slash_ptr = BLI_path_slash_find(path_component); diff --git a/source/blender/asset_system/intern/asset_library.cc b/source/blender/asset_system/intern/asset_library.cc index 7455c924598..d0dd8964c15 100644 --- a/source/blender/asset_system/intern/asset_library.cc +++ b/source/blender/asset_system/intern/asset_library.cc @@ -75,7 +75,8 @@ std::string AS_asset_library_find_suitable_root_path_from_path( const blender::StringRefNull input_path) { if (bUserAssetLibrary *preferences_lib = BKE_preferences_asset_library_containing_path( - &U, input_path.c_str())) { + &U, input_path.c_str())) + { return preferences_lib->path; } diff --git a/source/blender/asset_system/tests/asset_library_service_test.cc b/source/blender/asset_system/tests/asset_library_service_test.cc index fbf05f00600..56955c5fb95 100644 --- a/source/blender/asset_system/tests/asset_library_service_test.cc +++ b/source/blender/asset_system/tests/asset_library_service_test.cc @@ -141,7 +141,8 @@ TEST_F(AssetLibraryServiceTest, library_path_trailing_slashes) /* Ensure #asset_lib_no_slash has no trailing slash, regardless of what was passed on the CLI to * the unit test. */ while (strlen(asset_lib_no_slash) && - ELEM(asset_lib_no_slash[strlen(asset_lib_no_slash) - 1], SEP, ALTSEP)) { + ELEM(asset_lib_no_slash[strlen(asset_lib_no_slash) - 1], SEP, ALTSEP)) + { asset_lib_no_slash[strlen(asset_lib_no_slash) - 1] = '\0'; } diff --git a/source/blender/blenfont/intern/blf_font.c b/source/blender/blenfont/intern/blf_font.c index b69599b0a53..caafeb59418 100644 --- a/source/blender/blenfont/intern/blf_font.c +++ b/source/blender/blenfont/intern/blf_font.c @@ -518,7 +518,8 @@ static void blf_glyph_draw_buffer(FontBufInfoBLF *buf_info, chx >= buf_info->dims[0] || /* Out of bounds: right. */ (ft_pix_to_int(pen_y) + g->dims[1]) < 0 || /* Out of bounds: bottom. */ ft_pix_to_int(pen_y) >= buf_info->dims[1] /* Out of bounds: top. */ - ) { + ) + { return; } @@ -692,7 +693,8 @@ size_t blf_font_width_to_strlen( const int width_i = (int)width; for (i_prev = i = 0, width_new = pen_x = 0, g_prev = NULL; (i < str_len) && str[i]; - i_prev = i, width_new = pen_x, g_prev = g) { + i_prev = i, width_new = pen_x, g_prev = g) + { g = blf_glyph_from_utf8_and_step(font, gc, str, str_len, &i); if (blf_font_width_to_strlen_glyph_process(font, g_prev, g, &pen_x, width_i)) { @@ -727,7 +729,8 @@ size_t blf_font_width_to_rstrlen( i_tmp = i; g = blf_glyph_from_utf8_and_step(font, gc, str, str_len, &i_tmp); for (width_new = pen_x = 0; (s != NULL); - i = i_prev, s = s_prev, g = g_prev, g_prev = NULL, width_new = pen_x) { + i = i_prev, s = s_prev, g = g_prev, g_prev = NULL, width_new = pen_x) + { s_prev = BLI_str_find_prev_char_utf8(s, str); i_prev = (size_t)(s_prev - str); @@ -1562,7 +1565,8 @@ FontBLF *blf_font_new_ex(const char *name, /* Detect "Last resort" fonts. They have everything. Usually except last 5 bits. */ if (font->unicode_ranges[0] == 0xffffffffU && font->unicode_ranges[1] == 0xffffffffU && - font->unicode_ranges[2] == 0xffffffffU && font->unicode_ranges[3] >= 0x7FFFFFFU) { + font->unicode_ranges[2] == 0xffffffffU && font->unicode_ranges[3] >= 0x7FFFFFFU) + { font->flags |= BLF_LAST_RESORT; } diff --git a/source/blender/blenfont/intern/blf_glyph.c b/source/blender/blenfont/intern/blf_glyph.c index 7a9d4075ca0..02711b062b4 100644 --- a/source/blender/blenfont/intern/blf_glyph.c +++ b/source/blender/blenfont/intern/blf_glyph.c @@ -70,7 +70,8 @@ static GlyphCacheBLF *blf_glyph_cache_find(const FontBLF *font, const float size if (gc->size == size && (gc->bold == ((font->flags & BLF_BOLD) != 0)) && (gc->italic == ((font->flags & BLF_ITALIC) != 0)) && (gc->char_weight == font->char_weight) && (gc->char_slant == font->char_slant) && - (gc->char_width == font->char_width) && (gc->char_spacing == font->char_spacing)) { + (gc->char_width == font->char_width) && (gc->char_spacing == font->char_spacing)) + { return gc; } gc = gc->next; @@ -637,7 +638,8 @@ static FT_UInt blf_glyph_index_from_charcode(FontBLF **font, const uint charcode FontBLF *f = global_font[i]; if (!f || f == *font || !(f->face) || !(f->flags & BLF_DEFAULT) || (!((*font)->flags & BLF_MONOSPACED) && (f->flags & BLF_MONOSPACED)) || - f->flags & BLF_LAST_RESORT) { + f->flags & BLF_LAST_RESORT) + { continue; } if (coverage_bit < 0 || blf_font_has_coverage_bit(f, coverage_bit)) { @@ -654,7 +656,8 @@ static FT_UInt blf_glyph_index_from_charcode(FontBLF **font, const uint charcode FontBLF *f = global_font[i]; if (!f || f == *font || (f->face) || !(f->flags & BLF_DEFAULT) || (!((*font)->flags & BLF_MONOSPACED) && (f->flags & BLF_MONOSPACED)) || - f->flags & BLF_LAST_RESORT) { + f->flags & BLF_LAST_RESORT) + { continue; } if (coverage_bit < 0 || blf_font_has_coverage_bit(f, coverage_bit)) { diff --git a/source/blender/blenfont/intern/blf_thumbs.c b/source/blender/blenfont/intern/blf_thumbs.c index 417fd815284..98f0fcde559 100644 --- a/source/blender/blenfont/intern/blf_thumbs.c +++ b/source/blender/blenfont/intern/blf_thumbs.c @@ -248,7 +248,8 @@ static const char32_t *blf_get_sample_text(FT_Face face) /* Detect "Last resort" fonts. They have everything, except the last 5 bits. */ if (os2_table->ulUnicodeRange1 == 0xffffffffU && os2_table->ulUnicodeRange2 == 0xffffffffU && - os2_table->ulUnicodeRange3 == 0xffffffffU && os2_table->ulUnicodeRange4 >= 0x7FFFFFFU) { + os2_table->ulUnicodeRange3 == 0xffffffffU && os2_table->ulUnicodeRange4 >= 0x7FFFFFFU) + { return U"\xE000\xFFFF"; } @@ -386,13 +387,14 @@ bool BLF_thumb_preview(const char *filename, uchar *buf, int w, int h, int UNUSE int glyph_count = 0; /* How many are successfully loaded and rendered. */ for (int i = 0; i < BLF_SAMPLE_LEN && glyph_ids[i]; i++) { - if (FT_Load_Glyph(face, glyph_ids[i], FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING) != - FT_Err_Ok) { + if (FT_Load_Glyph(face, glyph_ids[i], FT_LOAD_TARGET_NORMAL | FT_LOAD_NO_HINTING) != FT_Err_Ok) + { break; } if (FT_Render_Glyph(face->glyph, FT_RENDER_MODE_NORMAL) != FT_Err_Ok || - face->glyph->format != FT_GLYPH_FORMAT_BITMAP) { + face->glyph->format != FT_GLYPH_FORMAT_BITMAP) + { break; } diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h index eff05e471aa..e97fa51ec11 100644 --- a/source/blender/blenkernel/BKE_armature.h +++ b/source/blender/blenkernel/BKE_armature.h @@ -560,7 +560,8 @@ void BKE_pchan_bbone_deform_segment_index(const struct bPoseChannel *pchan, #define FOREACH_PCHAN_SELECTED_IN_OBJECT_BEGIN(_ob, _pchan) \ for (bPoseChannel *_pchan = (_ob)->pose->chanbase.first; _pchan; _pchan = _pchan->next) { \ if (PBONE_VISIBLE(((bArmature *)(_ob)->data), (_pchan)->bone) && \ - ((_pchan)->bone->flag & BONE_SELECTED)) { + ((_pchan)->bone->flag & BONE_SELECTED)) \ + { #define FOREACH_PCHAN_SELECTED_IN_OBJECT_END \ } \ } \ diff --git a/source/blender/blenkernel/BKE_collection.h b/source/blender/blenkernel/BKE_collection.h index cf376883d55..77fec1d4504 100644 --- a/source/blender/blenkernel/BKE_collection.h +++ b/source/blender/blenkernel/BKE_collection.h @@ -335,7 +335,8 @@ typedef void (*BKE_scene_collections_Cb)(struct Collection *ob, void *data); OB_HIDE_RENDER; \ int _base_id = 0; \ for (Base *_base = (Base *)BKE_collection_object_cache_get(_collection).first; _base; \ - _base = _base->next, _base_id++) { \ + _base = _base->next, _base_id++) \ + { \ Object *_object = _base->object; \ if ((_base->flag & _base_flag) && \ (_object->visibility_flag & _object_visibility_flag) == 0) { @@ -348,7 +349,8 @@ typedef void (*BKE_scene_collections_Cb)(struct Collection *ob, void *data); #define FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN(_collection, _object) \ for (Base *_base = (Base *)BKE_collection_object_cache_get(_collection).first; _base; \ - _base = _base->next) { \ + _base = _base->next) \ + { \ Object *_object = _base->object; \ BLI_assert(_object != NULL); diff --git a/source/blender/blenkernel/BKE_layer.h b/source/blender/blenkernel/BKE_layer.h index 27b454d4d75..b7723c958c6 100644 --- a/source/blender/blenkernel/BKE_layer.h +++ b/source/blender/blenkernel/BKE_layer.h @@ -447,7 +447,8 @@ void BKE_view_layer_visible_bases_iterator_end(BLI_Iterator *iter); Base *_base; \ BKE_view_layer_synced_ensure(scene, view_layer); \ for (_base = (Base *)BKE_view_layer_object_bases_get(view_layer)->first; _base; \ - _base = _base->next) { \ + _base = _base->next) \ + { \ _instance = _base->object; #define FOREACH_OBJECT_END \ diff --git a/source/blender/blenkernel/BKE_node.h b/source/blender/blenkernel/BKE_node.h index 8553f2fd0fe..49529d2513d 100644 --- a/source/blender/blenkernel/BKE_node.h +++ b/source/blender/blenkernel/BKE_node.h @@ -474,7 +474,8 @@ struct GHashIterator *ntreeTypeGetIterator(void); { \ GHashIterator *__node_tree_type_iter__ = ntreeTypeGetIterator(); \ for (; !BLI_ghashIterator_done(__node_tree_type_iter__); \ - BLI_ghashIterator_step(__node_tree_type_iter__)) { \ + BLI_ghashIterator_step(__node_tree_type_iter__)) \ + { \ bNodeTreeType *ntype = (bNodeTreeType *)BLI_ghashIterator_getValue(__node_tree_type_iter__); #define NODE_TREE_TYPES_END \ @@ -649,7 +650,8 @@ const char *nodeSocketSubTypeLabel(int subtype); { \ GHashIterator *__node_socket_type_iter__ = nodeSocketTypeGetIterator(); \ for (; !BLI_ghashIterator_done(__node_socket_type_iter__); \ - BLI_ghashIterator_step(__node_socket_type_iter__)) { \ + BLI_ghashIterator_step(__node_socket_type_iter__)) \ + { \ bNodeSocketType *stype = (bNodeSocketType *)BLI_ghashIterator_getValue( \ __node_socket_type_iter__); diff --git a/source/blender/blenkernel/BKE_pbvh_pixels.hh b/source/blender/blenkernel/BKE_pbvh_pixels.hh index 2963b27f81c..b079f9f2c02 100644 --- a/source/blender/blenkernel/BKE_pbvh_pixels.hh +++ b/source/blender/blenkernel/BKE_pbvh_pixels.hh @@ -376,7 +376,8 @@ struct CopyPixelTile { const CopyPixelGroup &group = groups[group_index]; CopyPixelCommand copy_command(group); for (const DeltaCopyPixelCommand &item : Span( - &command_deltas[group.start_delta_index], group.num_deltas)) { + &command_deltas[group.start_delta_index], group.num_deltas)) + { copy_command.apply(item); copy_command.mix_source_and_write_destination(image_buffer); } diff --git a/source/blender/blenkernel/intern/CCGSubSurf.c b/source/blender/blenkernel/intern/CCGSubSurf.c index f5d46236c39..58d2d3d206e 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf.c +++ b/source/blender/blenkernel/intern/CCGSubSurf.c @@ -394,7 +394,8 @@ CCGError ccgSubSurf_setUseAgeCounts( if (useAgeCounts) { if ((vertUserOffset + 4 > ss->meshIFC.vertUserSize) || (edgeUserOffset + 4 > ss->meshIFC.edgeUserSize) || - (faceUserOffset + 4 > ss->meshIFC.faceUserSize)) { + (faceUserOffset + 4 > ss->meshIFC.faceUserSize)) + { return eCCGError_InvalidValue; } ss->useAgeCounts = 1; @@ -553,7 +554,8 @@ CCGError ccgSubSurf_syncVert( v->flags = Vert_eEffected | seamflag; } else if (!VertDataEqual(vertData, ccg_vert_getCo(v, 0, ss->meshIFC.vertDataSize), ss) || - ((v->flags & Vert_eSeam) != seamflag)) { + ((v->flags & Vert_eSeam) != seamflag)) + { int i, j; VertDataCopy(ccg_vert_getCo(v, 0, ss->meshIFC.vertDataSize), vertData, ss); @@ -585,7 +587,8 @@ CCGError ccgSubSurf_syncVert( v->flags = Vert_eEffected | seamflag; } else if (!VertDataEqual(vertData, ccg_vert_getCo(v, 0, ss->meshIFC.vertDataSize), ss) || - ((v->flags & Vert_eSeam) != seamflag)) { + ((v->flags & Vert_eSeam) != seamflag)) + { *prevp = v->next; ccg_ehash_insert(ss->vMap, (EHEntry *)v); VertDataCopy(ccg_vert_getCo(v, 0, ss->meshIFC.vertDataSize), vertData, ss); @@ -696,7 +699,8 @@ CCGError ccgSubSurf_syncFace( if (f) { if (f->numVerts != numVerts || memcmp(FACE_getVerts(f), ss->tempVerts, sizeof(*ss->tempVerts) * numVerts) != 0 || - memcmp(FACE_getEdges(f), ss->tempEdges, sizeof(*ss->tempEdges) * numVerts) != 0) { + memcmp(FACE_getEdges(f), ss->tempEdges, sizeof(*ss->tempEdges) * numVerts) != 0) + { topologyChanged = 1; } } @@ -767,7 +771,8 @@ CCGError ccgSubSurf_syncFace( if (f) { if (f->numVerts != numVerts || memcmp(FACE_getVerts(f), ss->tempVerts, sizeof(*ss->tempVerts) * numVerts) != 0 || - memcmp(FACE_getEdges(f), ss->tempEdges, sizeof(*ss->tempEdges) * numVerts) != 0) { + memcmp(FACE_getEdges(f), ss->tempEdges, sizeof(*ss->tempEdges) * numVerts) != 0) + { topologyChanged = 1; } } diff --git a/source/blender/blenkernel/intern/CCGSubSurf_legacy.c b/source/blender/blenkernel/intern/CCGSubSurf_legacy.c index ff58819a442..35da8edd3b7 100644 --- a/source/blender/blenkernel/intern/CCGSubSurf_legacy.c +++ b/source/blender/blenkernel/intern/CCGSubSurf_legacy.c @@ -174,8 +174,8 @@ static void ccgSubSurf__calcVertNormals_faces_accumulate_cb( NormAdd(FACE_getIFNo(f, lvl, S, x + 0, y + 1), no); } if (xPlusOk && yPlusOk) { - if (x < gridSize - 2 || y < gridSize - 2 || - FACE_getVerts(f)[S]->flags & Vert_eEffected) { + if (x < gridSize - 2 || y < gridSize - 2 || FACE_getVerts(f)[S]->flags & Vert_eEffected) + { NormAdd(FACE_getIFNo(f, lvl, S, x + 1, y + 1), no); } } diff --git a/source/blender/blenkernel/intern/DerivedMesh.cc b/source/blender/blenkernel/intern/DerivedMesh.cc index c17e0d79118..13f43b43a74 100644 --- a/source/blender/blenkernel/intern/DerivedMesh.cc +++ b/source/blender/blenkernel/intern/DerivedMesh.cc @@ -1667,7 +1667,8 @@ Mesh *mesh_get_eval_final(struct Depsgraph *depsgraph, Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob); if ((mesh_eval == nullptr) || !CustomData_MeshMasks_are_matching(&(ob->runtime.last_data_mask), &cddata_masks) || - (need_mapping && !ob->runtime.last_need_mapping)) { + (need_mapping && !ob->runtime.last_need_mapping)) + { CustomData_MeshMasks_update(&cddata_masks, &ob->runtime.last_data_mask); makeDerivedMesh(depsgraph, scene, ob, dataMask); @@ -1709,7 +1710,8 @@ Mesh *mesh_get_eval_deform(struct Depsgraph *depsgraph, if (!ob->runtime.mesh_deform_eval || !CustomData_MeshMasks_are_matching(&(ob->runtime.last_data_mask), &cddata_masks) || - (need_mapping && !ob->runtime.last_need_mapping)) { + (need_mapping && !ob->runtime.last_need_mapping)) + { CustomData_MeshMasks_update(&cddata_masks, &ob->runtime.last_data_mask); mesh_build_data( depsgraph, scene, ob, &cddata_masks, need_mapping || ob->runtime.last_need_mapping); @@ -1767,7 +1769,8 @@ Mesh *editbmesh_get_eval_cage(struct Depsgraph *depsgraph, object_get_datamask(depsgraph, obedit, &cddata_masks, nullptr); if (!obedit->runtime.editmesh_eval_cage || - !CustomData_MeshMasks_are_matching(&(obedit->runtime.last_data_mask), &cddata_masks)) { + !CustomData_MeshMasks_are_matching(&(obedit->runtime.last_data_mask), &cddata_masks)) + { editbmesh_build_data(depsgraph, scene, obedit, em, &cddata_masks); } diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c index dea3319ac68..7c6c97db73b 100644 --- a/source/blender/blenkernel/intern/action.c +++ b/source/blender/blenkernel/intern/action.c @@ -116,7 +116,8 @@ static void action_copy_data(Main *UNUSED(bmain), ID *id_dst, const ID *id_src, /* Fix group links (kind of bad list-in-list search, but this is the most reliable way). */ for (group_dst = action_dst->groups.first, group_src = action_src->groups.first; group_dst && group_src; - group_dst = group_dst->next, group_src = group_src->next) { + group_dst = group_dst->next, group_src = group_src->next) + { if (fcurve_src->grp == group_src) { fcurve_dst->grp = group_dst; diff --git a/source/blender/blenkernel/intern/anim_data.c b/source/blender/blenkernel/intern/anim_data.c index e84e0874484..18d26c02e53 100644 --- a/source/blender/blenkernel/intern/anim_data.c +++ b/source/blender/blenkernel/intern/anim_data.c @@ -816,7 +816,8 @@ static bool drivers_path_rename_fix(ID *owner_id, if (strstr(prefix, "bones")) { if (((dtar->id) && (GS(dtar->id->name) == ID_OB) && (!ref_id || ((Object *)(dtar->id))->data == ref_id)) && - (dtar->pchan_name[0]) && STREQ(oldName, dtar->pchan_name)) { + (dtar->pchan_name[0]) && STREQ(oldName, dtar->pchan_name)) + { is_changed = true; BLI_strncpy(dtar->pchan_name, newName, sizeof(dtar->pchan_name)); } @@ -992,13 +993,15 @@ void BKE_animdata_fix_paths_rename(ID *owner_id, /* Active action and temp action. */ if (adt->action != NULL) { if (fcurves_path_rename_fix( - owner_id, prefix, oldName, newName, oldN, newN, &adt->action->curves, verify_paths)) { + owner_id, prefix, oldName, newName, oldN, newN, &adt->action->curves, verify_paths)) + { DEG_id_tag_update(&adt->action->id, ID_RECALC_COPY_ON_WRITE); } } if (adt->tmpact) { if (fcurves_path_rename_fix( - owner_id, prefix, oldName, newName, oldN, newN, &adt->tmpact->curves, verify_paths)) { + owner_id, prefix, oldName, newName, oldN, newN, &adt->tmpact->curves, verify_paths)) + { DEG_id_tag_update(&adt->tmpact->id, ID_RECALC_COPY_ON_WRITE); } } diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index e81fa183e4b..9d6d034fabe 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -2053,7 +2053,8 @@ static void nlaevalchan_blend_value(NlaEvalChannelSnapshot *lower_necs, { nlaevalchan_assert_blendOrcombine_compatible(lower_necs, upper_necs, r_blended_necs); if (nlaevalchan_blendOrcombine_try_copy_from_lower( - lower_necs, upper_necs, upper_influence, r_blended_necs)) { + lower_necs, upper_necs, upper_influence, r_blended_necs)) + { return; } @@ -2082,7 +2083,8 @@ static void nlaevalchan_combine_value(NlaEvalChannelSnapshot *lower_necs, { nlaevalchan_assert_blendOrcombine_compatible(lower_necs, upper_necs, r_blended_necs); if (nlaevalchan_blendOrcombine_try_copy_from_lower( - lower_necs, upper_necs, upper_influence, r_blended_necs)) { + lower_necs, upper_necs, upper_influence, r_blended_necs)) + { return; } @@ -2115,7 +2117,8 @@ static void nlaevalchan_combine_quaternion(NlaEvalChannelSnapshot *lower_necs, { nlaevalchan_assert_blendOrcombine_compatible_quaternion(lower_necs, upper_necs, r_blended_necs); if (nlaevalchan_blendOrcombine_try_copy_from_lower( - lower_necs, upper_necs, upper_influence, r_blended_necs)) { + lower_necs, upper_necs, upper_influence, r_blended_necs)) + { return; } @@ -2347,7 +2350,8 @@ static void nlaevalchan_blend_value_get_inverted_lower_evalchan( nlaevalchan_assert_blendOrcombine_compatible(r_lower_necs, upper_necs, blended_necs); if (nlaevalchan_blendOrcombine_try_copy_to_lower( - blended_necs, upper_necs, upper_influence, r_lower_necs)) { + blended_necs, upper_necs, upper_influence, r_lower_necs)) + { return; } @@ -2386,7 +2390,8 @@ static void nlaevalchan_combine_value_get_inverted_lower_evalchan( nlaevalchan_assert_blendOrcombine_compatible(r_lower_necs, upper_necs, blended_necs); if (nlaevalchan_blendOrcombine_try_copy_to_lower( - blended_necs, upper_necs, upper_influence, r_lower_necs)) { + blended_necs, upper_necs, upper_influence, r_lower_necs)) + { return; } @@ -2432,7 +2437,8 @@ static void nlaevalchan_combine_quaternion_get_inverted_lower_evalchan( } if (nlaevalchan_blendOrcombine_try_copy_to_lower( - blended_necs, upper_necs, upper_influence, r_lower_necs)) { + blended_necs, upper_necs, upper_influence, r_lower_necs)) + { return; } @@ -3493,7 +3499,8 @@ static void animsys_evaluate_nla_for_keyframing(PointerRNA *ptr, /* If tweak strip is full REPLACE, then lower strips not needed. */ if (r_context->strip.blendmode == NLASTRIP_MODE_REPLACE && - IS_EQF(r_context->strip.influence, 1.0f)) { + IS_EQF(r_context->strip.influence, 1.0f)) + { BLI_freelistN(&lower_estrips); return; } @@ -3659,7 +3666,8 @@ NlaKeyframingContext *BKE_animsys_get_nla_keyframing_context( { /* No remapping needed if NLA is off or no action. */ if ((adt == NULL) || (adt->action == NULL) || (adt->nla_tracks.first == NULL) || - (adt->flag & ADT_NLA_EVAL_OFF)) { + (adt->flag & ADT_NLA_EVAL_OFF)) + { return NULL; } @@ -3667,7 +3675,8 @@ NlaKeyframingContext *BKE_animsys_get_nla_keyframing_context( * evaluated. */ if (!(adt->flag & ADT_NLA_EDIT_ON) && (adt->act_blendmode == NLASTRIP_MODE_REPLACE && adt->act_influence == 1.0f) && - (adt->flag & ADT_NLA_EVAL_UPPER_TRACKS) == 0) { + (adt->flag & ADT_NLA_EVAL_UPPER_TRACKS) == 0) + { return NULL; } @@ -3733,7 +3742,8 @@ void BKE_animsys_nla_remap_keyframe_values(struct NlaKeyframingContext *context, float influence = context->strip.influence; if (blend_mode == NLASTRIP_MODE_REPLACE && influence == 1.0f && - BLI_listbase_is_empty(&context->upper_estrips)) { + BLI_listbase_is_empty(&context->upper_estrips)) + { BLI_bitmap_copy_all(r_successful_remaps, remap_domain, count); MEM_freeN(remap_domain); return; @@ -3772,7 +3782,8 @@ void BKE_animsys_nla_remap_keyframe_values(struct NlaKeyframingContext *context, */ const bool can_force_all = r_force_all != NULL; if (blended_necs->channel->mix_mode == NEC_MIX_QUATERNION && - ELEM(blend_mode, NLASTRIP_MODE_COMBINE, NLASTRIP_MODE_REPLACE) && can_force_all) { + ELEM(blend_mode, NLASTRIP_MODE_COMBINE, NLASTRIP_MODE_REPLACE) && can_force_all) + { *r_force_all = true; index = -1; diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c index ea1a179b3b0..972b2eb6b46 100644 --- a/source/blender/blenkernel/intern/appdir.c +++ b/source/blender/blenkernel/intern/appdir.c @@ -749,7 +749,8 @@ const char *BKE_appdir_folder_id_create(const int folder_id, const char *subfold BLENDER_USER_DATAFILES, BLENDER_USER_CONFIG, BLENDER_USER_SCRIPTS, - BLENDER_USER_AUTOSAVE)) { + BLENDER_USER_AUTOSAVE)) + { BLI_assert_unreachable(); return NULL; } @@ -963,7 +964,8 @@ bool BKE_appdir_program_python_search(char *fullpath, #else BLI_exists(fullpath) #endif - ) { + ) + { is_found = true; break; } @@ -1013,7 +1015,8 @@ bool BKE_appdir_app_template_any(void) if (BKE_appdir_folder_id_ex(app_template_directory_id[i], app_template_directory_search[i], temp_dir, - sizeof(temp_dir))) { + sizeof(temp_dir))) + { return true; } } @@ -1060,7 +1063,8 @@ void BKE_appdir_app_templates(ListBase *templates) if (!BKE_appdir_folder_id_ex(app_template_directory_id[i], app_template_directory_search[i], subdir, - sizeof(subdir))) { + sizeof(subdir))) + { continue; } diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c index e433c26cc54..fe2d8af8da7 100644 --- a/source/blender/blenkernel/intern/armature.c +++ b/source/blender/blenkernel/intern/armature.c @@ -404,7 +404,8 @@ static void copy_bonechildren(Bone *bone_dst, /* For each child in the list, update its children */ for (bone_src_child = bone_src->childbase.first, bone_dst_child = bone_dst->childbase.first; bone_src_child; - bone_src_child = bone_src_child->next, bone_dst_child = bone_dst_child->next) { + bone_src_child = bone_src_child->next, bone_dst_child = bone_dst_child->next) + { bone_dst_child->parent = bone_dst; copy_bonechildren(bone_dst_child, bone_src_child, bone_src_act, r_bone_dst_act, flag); } @@ -422,7 +423,8 @@ static void copy_bonechildren_custom_handles(Bone *bone_dst, bArmature *arm_dst) } for (bone_dst_child = bone_dst->childbase.first; bone_dst_child; - bone_dst_child = bone_dst_child->next) { + bone_dst_child = bone_dst_child->next) + { copy_bonechildren_custom_handles(bone_dst_child, arm_dst); } } @@ -2299,7 +2301,8 @@ static int rebuild_pose_bone( bPoseChannel *pchan_prev = pchan->prev; const Bone *last_visited_bone = *r_last_visited_bone_p; if ((pchan_prev == NULL && last_visited_bone != NULL) || - (pchan_prev != NULL && pchan_prev->bone != last_visited_bone)) { + (pchan_prev != NULL && pchan_prev->bone != last_visited_bone)) + { pchan_prev = last_visited_bone != NULL ? BKE_pose_channel_find_name(pose, last_visited_bone->name) : NULL; @@ -2676,7 +2679,8 @@ void BKE_pchan_minmax(const Object *ob, if (ob_custom) { float min[3], max[3]; if (use_empty_drawtype && (ob_custom->type == OB_EMPTY) && - BKE_object_minmax_empty_drawtype(ob_custom, min, max)) { + BKE_object_minmax_empty_drawtype(ob_custom, min, max)) + { memset(&bb_custom_buf, 0x0, sizeof(bb_custom_buf)); BKE_boundbox_init_from_minmax(&bb_custom_buf, min, max); bb_custom = &bb_custom_buf; @@ -2720,7 +2724,8 @@ bool BKE_pose_minmax(Object *ob, float r_min[3], float r_max[3], bool use_hidden /* XXX pchan->bone may be NULL for duplicated bones, see duplicateEditBoneObjects() comment * (editarmature.c:2592)... Skip in this case too! */ if (pchan->bone && (!((use_hidden == false) && (PBONE_VISIBLE(arm, pchan->bone) == false)) && - !((use_select == true) && ((pchan->bone->flag & BONE_SELECTED) == 0)))) { + !((use_select == true) && ((pchan->bone->flag & BONE_SELECTED) == 0)))) + { BKE_pchan_minmax(ob, pchan, false, r_min, r_max); changed = true; diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c index c1e1e63375d..1b1f97cd9d8 100644 --- a/source/blender/blenkernel/intern/armature_update.c +++ b/source/blender/blenkernel/intern/armature_update.c @@ -594,7 +594,8 @@ static void splineik_evaluate_bone( if (ik_data->xzScaleMode != CONSTRAINT_SPLINEIK_XZS_NONE) { /* First, apply the original scale if enabled. */ if (ik_data->xzScaleMode == CONSTRAINT_SPLINEIK_XZS_ORIGINAL || - (ik_data->flag & CONSTRAINT_SPLINEIK_USE_ORIGINAL_SCALE) != 0) { + (ik_data->flag & CONSTRAINT_SPLINEIK_USE_ORIGINAL_SCALE) != 0) + { float scale; /* X-axis scale. */ diff --git a/source/blender/blenkernel/intern/attribute.cc b/source/blender/blenkernel/intern/attribute.cc index 919f413b98f..82ea3b1cf6c 100644 --- a/source/blender/blenkernel/intern/attribute.cc +++ b/source/blender/blenkernel/intern/attribute.cc @@ -539,7 +539,8 @@ CustomDataLayer *BKE_id_attribute_search(ID *id, get_domains(id, info); for (eAttrDomain domain = ATTR_DOMAIN_POINT; domain < ATTR_DOMAIN_NUM; - domain = static_cast(int(domain) + 1)) { + domain = static_cast(int(domain) + 1)) + { if (!(domain_mask & ATTR_DOMAIN_AS_MASK(domain))) { continue; } @@ -752,7 +753,8 @@ CustomDataLayer *BKE_id_attribute_from_index(ID *id, for (int i = 0; i < customdata->totlayer; i++) { if (!(layer_mask & CD_TYPE_AS_MASK(customdata->layers[i].type)) || - (customdata->layers[i].flag & CD_FLAG_TEMPORARY)) { + (customdata->layers[i].flag & CD_FLAG_TEMPORARY)) + { continue; } @@ -873,16 +875,18 @@ CustomDataLayer *BKE_id_attributes_color_find(const ID *id, const char *name) if (CustomDataLayer *layer = BKE_id_attribute_find(id, name, CD_PROP_COLOR, ATTR_DOMAIN_POINT)) { return layer; } - if (CustomDataLayer *layer = BKE_id_attribute_find( - id, name, CD_PROP_COLOR, ATTR_DOMAIN_CORNER)) { + if (CustomDataLayer *layer = BKE_id_attribute_find(id, name, CD_PROP_COLOR, ATTR_DOMAIN_CORNER)) + { return layer; } if (CustomDataLayer *layer = BKE_id_attribute_find( - id, name, CD_PROP_BYTE_COLOR, ATTR_DOMAIN_POINT)) { + id, name, CD_PROP_BYTE_COLOR, ATTR_DOMAIN_POINT)) + { return layer; } if (CustomDataLayer *layer = BKE_id_attribute_find( - id, name, CD_PROP_BYTE_COLOR, ATTR_DOMAIN_CORNER)) { + id, name, CD_PROP_BYTE_COLOR, ATTR_DOMAIN_CORNER)) + { return layer; } return nullptr; diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc index 2b85178feca..a09ae77e81b 100644 --- a/source/blender/blenkernel/intern/attribute_access.cc +++ b/source/blender/blenkernel/intern/attribute_access.cc @@ -532,7 +532,8 @@ bool CustomDataAttributeProvider::try_delete(void *owner, const AttributeIDRef & for (const int i : IndexRange(custom_data->totlayer)) { const CustomDataLayer &layer = custom_data->layers[i]; if (this->type_is_supported((eCustomDataType)layer.type) && - custom_data_layer_matches_attribute_id(layer, attribute_id)) { + custom_data_layer_matches_attribute_id(layer, attribute_id)) + { CustomData_free_layer(custom_data, eCustomDataType(layer.type), element_num, i); return true; } @@ -932,7 +933,8 @@ bool MutableAttributeAccessor::rename(const AttributeIDRef &old_attribute_id, old_attribute.domain, type, AttributeInitShared{old_attribute.varray.get_internal_span().data(), - *old_attribute.sharing_info})) { + *old_attribute.sharing_info})) + { return false; } } @@ -940,7 +942,8 @@ bool MutableAttributeAccessor::rename(const AttributeIDRef &old_attribute_id, if (!this->add(new_attribute_id, old_attribute.domain, type, - AttributeInitVArray{old_attribute.varray})) { + AttributeInitVArray{old_attribute.varray})) + { return false; } } diff --git a/source/blender/blenkernel/intern/attribute_access_intern.hh b/source/blender/blenkernel/intern/attribute_access_intern.hh index 7d750773a50..e685272de6b 100644 --- a/source/blender/blenkernel/intern/attribute_access_intern.hh +++ b/source/blender/blenkernel/intern/attribute_access_intern.hh @@ -278,7 +278,8 @@ inline GAttributeReader lookup(const void *owner, const AttributeIDRef &attribut if (!attribute_id.is_anonymous()) { const StringRef name = attribute_id.name(); if (const BuiltinAttributeProvider *provider = - providers.builtin_attribute_providers().lookup_default_as(name, nullptr)) { + providers.builtin_attribute_providers().lookup_default_as(name, nullptr)) + { return provider->try_get_for_read(owner); } } @@ -296,8 +297,8 @@ inline bool for_all(const void *owner, FunctionRef fn) { Set handled_attribute_ids; - for (const BuiltinAttributeProvider *provider : - providers.builtin_attribute_providers().values()) { + for (const BuiltinAttributeProvider *provider : providers.builtin_attribute_providers().values()) + { if (provider->exists(owner)) { AttributeMetaData meta_data{provider->domain(), provider->data_type()}; if (!fn(provider->name(), meta_data)) { @@ -375,7 +376,8 @@ inline GAttributeWriter lookup_for_write(void *owner, const AttributeIDRef &attr if (!attribute_id.is_anonymous()) { const StringRef name = attribute_id.name(); if (const BuiltinAttributeProvider *provider = - providers.builtin_attribute_providers().lookup_default_as(name, nullptr)) { + providers.builtin_attribute_providers().lookup_default_as(name, nullptr)) + { return provider->try_get_for_write(owner); } } @@ -394,7 +396,8 @@ inline bool remove(void *owner, const AttributeIDRef &attribute_id) if (!attribute_id.is_anonymous()) { const StringRef name = attribute_id.name(); if (const BuiltinAttributeProvider *provider = - providers.builtin_attribute_providers().lookup_default_as(name, nullptr)) { + providers.builtin_attribute_providers().lookup_default_as(name, nullptr)) + { return provider->try_delete(owner); } } @@ -419,7 +422,8 @@ inline bool add(void *owner, if (!attribute_id.is_anonymous()) { const StringRef name = attribute_id.name(); if (const BuiltinAttributeProvider *provider = - providers.builtin_attribute_providers().lookup_default_as(name, nullptr)) { + providers.builtin_attribute_providers().lookup_default_as(name, nullptr)) + { if (provider->domain() != domain) { return false; } diff --git a/source/blender/blenkernel/intern/blender.c b/source/blender/blenkernel/intern/blender.c index 305ac5f62cc..8d294d859d8 100644 --- a/source/blender/blenkernel/intern/blender.c +++ b/source/blender/blenkernel/intern/blender.c @@ -250,8 +250,8 @@ static void userdef_free_keymaps(UserDef *userdef) static void userdef_free_keyconfig_prefs(UserDef *userdef) { - for (wmKeyConfigPref *kpt = userdef->user_keyconfig_prefs.first, *kpt_next; kpt; - kpt = kpt_next) { + for (wmKeyConfigPref *kpt = userdef->user_keyconfig_prefs.first, *kpt_next; kpt; kpt = kpt_next) + { kpt_next = kpt->next; IDP_FreeProperty(kpt->prop); MEM_freeN(kpt); diff --git a/source/blender/blenkernel/intern/blendfile.cc b/source/blender/blenkernel/intern/blendfile.cc index 0d12ddf152e..7876d94b505 100644 --- a/source/blender/blenkernel/intern/blendfile.cc +++ b/source/blender/blenkernel/intern/blendfile.cc @@ -535,7 +535,8 @@ static void handle_subversion_warning(Main *main, BlendFileReadReport *reports) { if (main->minversionfile > BLENDER_FILE_VERSION || (main->minversionfile == BLENDER_FILE_VERSION && - main->minsubversionfile > BLENDER_FILE_SUBVERSION)) { + main->minsubversionfile > BLENDER_FILE_SUBVERSION)) + { BKE_reportf(reports->reports, RPT_WARNING, "File written by newer Blender binary (%d.%d), expect loss of data!", @@ -939,12 +940,13 @@ bool BKE_blendfile_workspace_config_write(Main *bmain, const char *filepath, Rep BKE_blendfile_write_partial_begin(bmain); for (WorkSpace *workspace = static_cast(bmain->workspaces.first); workspace; - workspace = static_cast(workspace->id.next)) { + workspace = static_cast(workspace->id.next)) + { BKE_blendfile_write_partial_tag_ID(&workspace->id, true); } - if (BKE_blendfile_write_partial( - bmain, filepath, fileflags, BLO_WRITE_PATH_REMAP_NONE, reports)) { + if (BKE_blendfile_write_partial(bmain, filepath, fileflags, BLO_WRITE_PATH_REMAP_NONE, reports)) + { retval = true; } diff --git a/source/blender/blenkernel/intern/blendfile_link_append.c b/source/blender/blenkernel/intern/blendfile_link_append.c index 7fe9f514e2a..8b5a3131cfb 100644 --- a/source/blender/blenkernel/intern/blendfile_link_append.c +++ b/source/blender/blenkernel/intern/blendfile_link_append.c @@ -194,8 +194,8 @@ void BKE_blendfile_link_append_context_free(BlendfileLinkAppendContext *lapp_con BLI_ghash_free(lapp_context->new_id_to_item, NULL, NULL); } - for (LinkNode *liblink = lapp_context->libraries.list; liblink != NULL; - liblink = liblink->next) { + for (LinkNode *liblink = lapp_context->libraries.list; liblink != NULL; liblink = liblink->next) + { BlendfileLinkAppendContextLibrary *lib_context = liblink->link; link_append_context_library_blohandle_release(lapp_context, lib_context); } @@ -303,8 +303,8 @@ int BKE_blendfile_link_append_context_item_idtypes_from_library_add( while ((id_code = BKE_idtype_idcode_iter_step(&id_code_iter))) { if (!BKE_idtype_idcode_is_linkable(id_code) || - (id_types_filter != 0 && - (BKE_idtype_idcode_to_idfilter(id_code) & id_types_filter) == 0)) { + (id_types_filter != 0 && (BKE_idtype_idcode_to_idfilter(id_code) & id_types_filter) == 0)) + { continue; } @@ -379,11 +379,13 @@ void BKE_blendfile_link_append_context_item_foreach( BlendfileLinkAppendContextItem *item = itemlink->link; if ((flag & BKE_BLENDFILE_LINK_APPEND_FOREACH_ITEM_FLAG_DO_DIRECT) == 0 && - (item->tag & LINK_APPEND_TAG_INDIRECT) == 0) { + (item->tag & LINK_APPEND_TAG_INDIRECT) == 0) + { continue; } if ((flag & BKE_BLENDFILE_LINK_APPEND_FOREACH_ITEM_FLAG_DO_INDIRECT) == 0 && - (item->tag & LINK_APPEND_TAG_INDIRECT) != 0) { + (item->tag & LINK_APPEND_TAG_INDIRECT) != 0) + { continue; } @@ -587,7 +589,8 @@ static bool loose_data_instantiate_collection_parents_check_recursive(Collection { for (CollectionParent *parent_collection = collection->runtime.parents.first; parent_collection != NULL; - parent_collection = parent_collection->next) { + parent_collection = parent_collection->next) + { if ((parent_collection->collection->id.tag & LIB_TAG_DOIT) != 0) { return true; } @@ -677,7 +680,8 @@ static void loose_data_instantiate_collection_process( /* When instantiated into view-layer, do not add collections if one of their parents is also * instantiated. */ if (!do_instantiate_as_empty && - loose_data_instantiate_collection_parents_check_recursive(collection)) { + loose_data_instantiate_collection_parents_check_recursive(collection)) + { continue; } /* When instantiated as empty, do not add indirectly linked (i.e. non-user-selected) @@ -924,7 +928,8 @@ static int foreach_libblock_link_append_callback(LibraryIDLinkCallbackData *cb_d /* NOTE: It is important to also skip liboverride references here, as those should never be made * local. */ if (cb_data->cb_flag & (IDWALK_CB_EMBEDDED | IDWALK_CB_EMBEDDED_NOT_OWNING | IDWALK_CB_INTERNAL | - IDWALK_CB_LOOPBACK | IDWALK_CB_OVERRIDE_LIBRARY_REFERENCE)) { + IDWALK_CB_LOOPBACK | IDWALK_CB_OVERRIDE_LIBRARY_REFERENCE)) + { return IDWALK_RET_NOP; } @@ -1007,7 +1012,8 @@ static void blendfile_link_append_proxies_convert(Main *bmain, ReportList *repor BKE_lib_override_library_main_proxy_convert(bmain, &bf_reports); if (bf_reports.count.proxies_to_lib_overrides_success != 0 || - bf_reports.count.proxies_to_lib_overrides_failures != 0) { + bf_reports.count.proxies_to_lib_overrides_failures != 0) + { BKE_reportf(bf_reports.reports, RPT_WARNING, "Proxies have been removed from Blender (%d proxies were automatically converted " @@ -1091,7 +1097,8 @@ void BKE_blendfile_append(BlendfileLinkAppendContext *lapp_context, ReportList * /* If we found a matching existing local id but are not re-using it, we need to properly clear * its weak reference to linked data. */ if (existing_local_id != NULL && - !ELEM(item->action, LINK_APPEND_ACT_KEEP_LINKED, LINK_APPEND_ACT_REUSE_LOCAL)) { + !ELEM(item->action, LINK_APPEND_ACT_KEEP_LINKED, LINK_APPEND_ACT_REUSE_LOCAL)) + { BKE_main_library_weak_reference_remove_item(lapp_context->library_weak_reference_mapping, id->lib->filepath, id->name, @@ -1238,7 +1245,8 @@ void BKE_blendfile_link(BlendfileLinkAppendContext *lapp_context, ReportList *re int lib_idx, item_idx; for (lib_idx = 0, liblink = lapp_context->libraries.list; liblink; - lib_idx++, liblink = liblink->next) { + lib_idx++, liblink = liblink->next) + { BlendfileLinkAppendContextLibrary *lib_context = liblink->link; char *libname = lib_context->path; BlendHandle *blo_handle = link_append_context_library_blohandle_ensure( @@ -1271,7 +1279,8 @@ void BKE_blendfile_link(BlendfileLinkAppendContext *lapp_context, ReportList *re /* For each lib file, we try to link all items belonging to that lib, * and tag those successful to not try to load them again with the other libraries. */ for (item_idx = 0, itemlink = lapp_context->items.list; itemlink; - item_idx++, itemlink = itemlink->next) { + item_idx++, itemlink = itemlink->next) + { BlendfileLinkAppendContextItem *item = itemlink->link; ID *new_id; @@ -1297,8 +1306,8 @@ void BKE_blendfile_link(BlendfileLinkAppendContext *lapp_context, ReportList *re (void)item_idx; /* Quiet set-but-unused warning (may be removed). */ /* Instantiate newly linked IDs as needed, if no append is scheduled. */ - if ((lapp_context->params->flag & FILE_LINK) != 0 && - lapp_context->params->context.scene != NULL) { + if ((lapp_context->params->flag & FILE_LINK) != 0 && lapp_context->params->context.scene != NULL) + { new_id_to_item_mapping_create(lapp_context); /* NOTE: Since we append items for IDs not already listed (i.e. implicitly linked indirect * dependencies), this list will grow and we will process those IDs later, leading to a flatten @@ -1364,7 +1373,8 @@ void BKE_blendfile_override(BlendfileLinkAppendContext *lapp_context, } /* Do not consider regular liboverrides if runtime ones are requested, and vice-versa. */ if ((set_runtime && (id_iter->tag & LIB_TAG_RUNTIME) == 0) || - (!set_runtime && (id_iter->tag & LIB_TAG_RUNTIME) != 0)) { + (!set_runtime && (id_iter->tag & LIB_TAG_RUNTIME) != 0)) + { continue; } @@ -1372,7 +1382,8 @@ void BKE_blendfile_override(BlendfileLinkAppendContext *lapp_context, ID **id_ptr; if (BLI_ghash_ensure_p(linked_ids_to_local_liboverrides, id_iter->override_library->reference, - (void ***)&id_ptr)) { + (void ***)&id_ptr)) + { continue; } *id_ptr = id_iter; @@ -1574,7 +1585,8 @@ void BKE_blendfile_library_relocate(BlendfileLinkAppendContext *lapp_context, * We need to do this in a first, separated loop, otherwise some of those may not be handled by * ID remapping, which means they would still reference old data to be deleted... */ for (item_idx = 0, itemlink = lapp_context->items.list; itemlink; - item_idx++, itemlink = itemlink->next) { + item_idx++, itemlink = itemlink->next) + { BlendfileLinkAppendContextItem *item = itemlink->link; ID *old_id = item->userdata; @@ -1597,7 +1609,8 @@ void BKE_blendfile_library_relocate(BlendfileLinkAppendContext *lapp_context, const int remap_flags = ID_REMAP_SKIP_NEVER_NULL_USAGE | (do_reload ? 0 : ID_REMAP_SKIP_INDIRECT_USAGE); for (item_idx = 0, itemlink = lapp_context->items.list; itemlink; - item_idx++, itemlink = itemlink->next) { + item_idx++, itemlink = itemlink->next) + { BlendfileLinkAppendContextItem *item = itemlink->link; ID *old_id = item->userdata; ID *new_id = item->new_id; @@ -1641,7 +1654,8 @@ void BKE_blendfile_library_relocate(BlendfileLinkAppendContext *lapp_context, BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); for (item_idx = 0, itemlink = lapp_context->items.list; itemlink; - item_idx++, itemlink = itemlink->next) { + item_idx++, itemlink = itemlink->next) + { BlendfileLinkAppendContextItem *item = itemlink->link; ID *old_id = item->userdata; diff --git a/source/blender/blenkernel/intern/boids.c b/source/blender/blenkernel/intern/boids.c index 6a4e4ae8a9a..40b81e7d667 100644 --- a/source/blender/blenkernel/intern/boids.c +++ b/source/blender/blenkernel/intern/boids.c @@ -112,7 +112,8 @@ static bool rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, /* skip current object */ } else if (pd->forcefield == PFIELD_BOID && mul * pd->f_strength > 0.0f && - get_effector_data(cur, &cur_efd, &epoint, 0)) { + get_effector_data(cur, &cur_efd, &epoint, 0)) + { float temp = mul * pd->f_strength * effector_falloff(cur, &cur_efd, &epoint, bbd->part->effector_weights); @@ -147,9 +148,8 @@ static bool rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, } /* then use that effector */ - if (priority > (rule->type == eBoidRuleType_Avoid ? - gabr->fear_factor : - 0.0f)) { /* with avoid, factor is "fear factor" */ + if (priority > (rule->type == eBoidRuleType_Avoid ? gabr->fear_factor : 0.0f)) + { /* with avoid, factor is "fear factor" */ Object *eob = eff->ob; PartDeflect *pd = eff->pd; float surface = (pd && pd->shape == PFIELD_SHAPE_SURFACE) ? 1.0f : 0.0f; @@ -172,7 +172,8 @@ static bool rule_goal_avoid(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, } } else if ((rule->type == eBoidRuleType_Avoid) && (bpa->data.mode == eBoidMode_Climbing) && - (priority > 2.0f * gabr->fear_factor)) { + (priority > 2.0f * gabr->fear_factor)) + { /* detach from surface and try to fly away from danger */ negate_v3_v3(efd.vec_to_point, bpa->gravity); } @@ -759,7 +760,8 @@ static bool rule_fight(BoidRule *rule, BoidBrainData *bbd, BoidValues *val, Part /* check if boid doesn't want to fight */ bpa = pa->boid; if (bpa->data.health / bbd->part->boids->health * bbd->part->boids->aggression < - e_strength / f_strength) { + e_strength / f_strength) + { /* decide to flee */ if (closest_dist < fbr->flee_distance * fbr->distance) { negate_v3(bbd->wanted_co); @@ -938,8 +940,8 @@ static bool boid_rule_applies(ParticleData *pa, BoidSettings *UNUSED(boids), Boi return false; } - if (ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing) && - rule->flag & BOIDRULE_ON_LAND) { + if (ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing) && rule->flag & BOIDRULE_ON_LAND) + { return true; } @@ -1015,7 +1017,8 @@ static bool apply_boid_rule( if (fuzziness < 0.0f || compare_len_v3v3(bbd->wanted_co, pa->prev_state.vel, - fuzziness * len_v3(pa->prev_state.vel)) == 0) { + fuzziness * len_v3(pa->prev_state.vel)) == 0) + { return true; } return false; @@ -1231,7 +1234,8 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) /* if boids can't fly they fall to the ground */ if ((boids->options & BOID_ALLOW_FLIGHT) == 0 && ELEM(bpa->data.mode, eBoidMode_OnLand, eBoidMode_Climbing) == 0 && - psys_uses_gravity(bbd->sim)) { + psys_uses_gravity(bbd->sim)) + { bpa->data.mode = eBoidMode_Falling; } @@ -1419,7 +1423,8 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) /* stick boid on goal when close enough */ if (bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= - pa->size * boids->height) { + pa->size * boids->height) + { bpa->data.mode = eBoidMode_Climbing; bpa->ground = bbd->goal_ob; boid_find_ground(bbd, pa, ground_co, ground_nor); @@ -1454,7 +1459,8 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) if (boids->options & BOID_ALLOW_LAND) { /* stick boid on goal when close enough */ if (bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= - pa->size * boids->height) { + pa->size * boids->height) + { bpa->data.mode = eBoidMode_Climbing; bpa->ground = bbd->goal_ob; boid_find_ground(bbd, pa, ground_co, ground_nor); @@ -1499,7 +1505,8 @@ void boid_body(BoidBrainData *bbd, ParticleData *pa) case eBoidMode_OnLand: { /* stick boid on goal when close enough */ if (bbd->goal_ob && boid_goal_signed_dist(pa->state.co, bbd->goal_co, bbd->goal_nor) <= - pa->size * boids->height) { + pa->size * boids->height) + { bpa->data.mode = eBoidMode_Climbing; bpa->ground = bbd->goal_ob; boid_find_ground(bbd, pa, ground_co, ground_nor); diff --git a/source/blender/blenkernel/intern/bpath.c b/source/blender/blenkernel/intern/bpath.c index 67f30f39dba..7e789867675 100644 --- a/source/blender/blenkernel/intern/bpath.c +++ b/source/blender/blenkernel/intern/bpath.c @@ -93,8 +93,8 @@ void BKE_bpath_foreach_path_id(BPathForeachPathData *bpath_data, ID *id) return; } - if (id->library_weak_reference != NULL && - (flag & BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES) == 0) { + if (id->library_weak_reference != NULL && (flag & BKE_BPATH_TRAVERSE_SKIP_WEAK_REFERENCES) == 0) + { BKE_bpath_foreach_path_fixed_process(bpath_data, id->library_weak_reference->library_filepath); } diff --git a/source/blender/blenkernel/intern/brush.cc b/source/blender/blenkernel/intern/brush.cc index 7159c7a6633..d704fa7672c 100644 --- a/source/blender/blenkernel/intern/brush.cc +++ b/source/blender/blenkernel/intern/brush.cc @@ -614,7 +614,8 @@ bool BKE_brush_delete(Main *bmain, Brush *brush) return false; } if (ID_REAL_USERS(brush) <= 1 && ID_EXTRA_USERS(brush) == 0 && - BKE_library_ID_is_indirectly_used(bmain, brush)) { + BKE_library_ID_is_indirectly_used(bmain, brush)) + { return false; } @@ -2649,7 +2650,8 @@ bool BKE_brush_has_cube_tip(const Brush *brush, ePaintMode paint_mode) } if (ELEM(brush->sculpt_tool, SCULPT_TOOL_CLAY_STRIPS, SCULPT_TOOL_PAINT) && - brush->tip_roundness < 1.0f) { + brush->tip_roundness < 1.0f) + { return true; } diff --git a/source/blender/blenkernel/intern/cachefile.c b/source/blender/blenkernel/intern/cachefile.c index e0a1e98f164..d93e2007626 100644 --- a/source/blender/blenkernel/intern/cachefile.c +++ b/source/blender/blenkernel/intern/cachefile.c @@ -422,7 +422,8 @@ bool BKE_cache_file_uses_render_procedural(const CacheFile *cache_file, Scene *s RenderEngineType *render_engine_type = RE_engines_find(scene->r.engine); if (cache_file->type != CACHEFILE_TYPE_ALEMBIC || - !RE_engine_supports_alembic_procedural(render_engine_type, scene)) { + !RE_engine_supports_alembic_procedural(render_engine_type, scene)) + { return false; } diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c index 0ad00591d6d..297344f4627 100644 --- a/source/blender/blenkernel/intern/camera.c +++ b/source/blender/blenkernel/intern/camera.c @@ -710,7 +710,8 @@ static bool camera_frame_fit_calc_from_data(CameraParams *params, } if (!isect_plane_plane_v3(plane_tx[Y_MIN], plane_tx[Y_MAX], plane_isect_1, plane_isect_1_no) || - !isect_plane_plane_v3(plane_tx[Z_MIN], plane_tx[Z_MAX], plane_isect_2, plane_isect_2_no)) { + !isect_plane_plane_v3(plane_tx[Z_MIN], plane_tx[Z_MAX], plane_isect_2, plane_isect_2_no)) + { return false; } @@ -722,7 +723,8 @@ static bool camera_frame_fit_calc_from_data(CameraParams *params, plane_isect_2, plane_isect_2_other, plane_isect_pt_1, - plane_isect_pt_2)) { + plane_isect_pt_2)) + { return false; } @@ -1006,7 +1008,8 @@ bool BKE_camera_multiview_spherical_stereo(const RenderData *rd, const Object *c cam = camera->data; if ((rd->views_format == SCE_VIEWS_FORMAT_STEREO_3D) && ELEM(cam->type, CAM_PANO, CAM_PERSP) && - ((cam->stereo.flag & CAM_S3D_SPHERICAL) != 0)) { + ((cam->stereo.flag & CAM_S3D_SPHERICAL) != 0)) + { return true; } diff --git a/source/blender/blenkernel/intern/cloth.cc b/source/blender/blenkernel/intern/cloth.cc index 7e9aea008c4..ef4bd54f97c 100644 --- a/source/blender/blenkernel/intern/cloth.cc +++ b/source/blender/blenkernel/intern/cloth.cc @@ -233,7 +233,8 @@ static bool do_init_cloth(Object *ob, ClothModifierData *clmd, Mesh *result, int ClothSimSettings *parms = clmd->sim_parms; if (parms->flags & CLOTH_SIMSETTINGS_FLAG_PRESSURE && - !(parms->flags & CLOTH_SIMSETTINGS_FLAG_PRESSURE_VOL)) { + !(parms->flags & CLOTH_SIMSETTINGS_FLAG_PRESSURE_VOL)) + { SIM_cloth_solver_set_volume(clmd); } @@ -288,7 +289,8 @@ static int do_step_cloth( cloth_apply_vgroup(clmd, result); if ((clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_DYNAMIC_BASEMESH) || - (clmd->sim_parms->vgroup_shrink > 0) || (clmd->sim_parms->shrink_min != 0.0f)) { + (clmd->sim_parms->vgroup_shrink > 0) || (clmd->sim_parms->shrink_min != 0.0f)) + { cloth_update_spring_lengths(clmd, result); } @@ -372,7 +374,8 @@ void clothModifier_do(ClothModifierData *clmd, cache_result = BKE_ptcache_read(&pid, float(framenr) + scene->r.subframe, can_simulate); if (cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED || - (!can_simulate && cache_result == PTCACHE_READ_OLD)) { + (!can_simulate && cache_result == PTCACHE_READ_OLD)) + { SIM_cloth_solver_set_positions(clmd); cloth_to_object(ob, clmd, vertexCos); @@ -391,15 +394,16 @@ void clothModifier_do(ClothModifierData *clmd, } else if ( /* 2.4x disabled lib, but this can be used in some cases, testing further - campbell */ - /*ob->id.lib ||*/ (cache->flag & PTCACHE_BAKED)) { + /*ob->id.lib ||*/ (cache->flag & PTCACHE_BAKED)) + { /* if baked and nothing in cache, do nothing */ BKE_ptcache_invalidate(cache); return; } /* if on second frame, write cache for first frame */ - if (cache->simframe == startframe && - (cache->flag & PTCACHE_OUTDATED || cache->last_exact == 0)) { + if (cache->simframe == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact == 0)) + { BKE_ptcache_write(&pid, startframe); } @@ -754,7 +758,8 @@ static bool cloth_from_object( clmd->clothObject->sew_edge_graph = nullptr; if (clmd->sim_parms->shapekey_rest && - !(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_DYNAMIC_BASEMESH)) { + !(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_DYNAMIC_BASEMESH)) + { shapekey_rest = static_cast( CustomData_get_layer(&mesh->vdata, CD_CLOTH_ORCO)); } @@ -1143,7 +1148,8 @@ static void cloth_update_springs(ClothModifierData *clmd) /* Activate / Deactivate existing springs */ if (!(cloth->verts[spring->ij].flags & CLOTH_VERT_FLAG_PINNED) && - (cloth->verts[spring->ij].goal > ALMOST_ZERO)) { + (cloth->verts[spring->ij].goal > ALMOST_ZERO)) + { spring->flags &= ~CLOTH_SPRING_FLAG_DEACTIVATE; } else { @@ -1210,7 +1216,8 @@ static void cloth_update_spring_lengths(ClothModifierData *clmd, Mesh *mesh) if (spring->type != CLOTH_SPRING_TYPE_SEWING) { if (spring->type & (CLOTH_SPRING_TYPE_STRUCTURAL | CLOTH_SPRING_TYPE_SHEAR | - CLOTH_SPRING_TYPE_BENDING | CLOTH_SPRING_TYPE_INTERNAL)) { + CLOTH_SPRING_TYPE_BENDING | CLOTH_SPRING_TYPE_INTERNAL)) + { shrink_factor = cloth_shrink_factor(clmd, cloth->verts, spring->ij, spring->kl); } else { @@ -1523,7 +1530,8 @@ static bool cloth_build_springs(ClothModifierData *clmd, Mesh *mesh) /* If using the rest shape key, it's necessary to make a copy of the mesh. */ if (clmd->sim_parms->shapekey_rest && - !(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_DYNAMIC_BASEMESH)) { + !(clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_DYNAMIC_BASEMESH)) + { tmp_mesh = cloth_make_rest_mesh(clmd, mesh); } @@ -1543,7 +1551,8 @@ static bool cloth_build_springs(ClothModifierData *clmd, Mesh *mesh) clmd->sim_parms->internal_spring_max_length, clmd->sim_parms->internal_spring_max_diversion, (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_INTERNAL_SPRINGS_NORMAL), - &tar_v_idx)) { + &tar_v_idx)) + { if (BLI_edgeset_haskey(existing_vert_pairs, i, tar_v_idx)) { /* We have already created a spring between these verts! */ continue; @@ -1611,7 +1620,8 @@ static bool cloth_build_springs(ClothModifierData *clmd, Mesh *mesh) if (spring) { spring_verts_ordered_set(spring, edges[i][0], edges[i][1]); if (clmd->sim_parms->flags & CLOTH_SIMSETTINGS_FLAG_SEW && loose_edges.count > 0 && - loose_edges.is_loose_bits[i]) { + loose_edges.is_loose_bits[i]) + { /* handle sewing (loose edges will be pulled together) */ spring->restlen = 0.0f; spring->lin_stiffness = 1.0f; @@ -1725,7 +1735,8 @@ static bool cloth_build_springs(ClothModifierData *clmd, Mesh *mesh) if (!cloth_bend_set_poly_vert_array( &spring->pa, spring->la, &corner_verts[polys[curr_ref->index].start()]) || !cloth_bend_set_poly_vert_array( - &spring->pb, spring->lb, &corner_verts[polys[i].start()])) { + &spring->pb, spring->lb, &corner_verts[polys[i].start()])) + { cloth_free_errorsprings(cloth, edgelist, spring_ref); return false; } diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c index 270f1583cb7..ac945f0491f 100644 --- a/source/blender/blenkernel/intern/collection.c +++ b/source/blender/blenkernel/intern/collection.c @@ -497,7 +497,8 @@ void BKE_collection_add_from_object(Main *bmain, FOREACH_SCENE_COLLECTION_BEGIN (scene, collection) { if (!ID_IS_LINKED(collection) && !ID_IS_OVERRIDABLE_LIBRARY(collection) && - BKE_collection_has_object(collection, ob_src)) { + BKE_collection_has_object(collection, ob_src)) + { collection_child_add(collection, collection_dst, 0, true); is_instantiated = true; } @@ -520,7 +521,8 @@ void BKE_collection_add_from_collection(Main *bmain, FOREACH_SCENE_COLLECTION_BEGIN (scene, collection) { if (!ID_IS_LINKED(collection) && !ID_IS_OVERRIDABLE_LIBRARY(collection) && - collection_find_child(collection, collection_src)) { + collection_find_child(collection, collection_src)) + { collection_child_add(collection, collection_dst, 0, true); is_instantiated = true; } @@ -921,7 +923,8 @@ void BKE_main_collections_object_cache_free(const Main *bmain) } for (Collection *collection = bmain->collections.first; collection != NULL; - collection = collection->id.next) { + collection = collection->id.next) + { collection_object_cache_free(collection); } } @@ -1271,7 +1274,8 @@ static Collection *collection_parent_editable_find_recursive(const ViewLayer *vi Collection *collection) { if (!ID_IS_LINKED(collection) && !ID_IS_OVERRIDE_LIBRARY(collection) && - (view_layer == NULL || BKE_view_layer_has_collection(view_layer, collection))) { + (view_layer == NULL || BKE_view_layer_has_collection(view_layer, collection))) + { return collection; } @@ -1281,9 +1285,11 @@ static Collection *collection_parent_editable_find_recursive(const ViewLayer *vi LISTBASE_FOREACH (CollectionParent *, collection_parent, &collection->runtime.parents) { if (!ID_IS_LINKED(collection_parent->collection) && - !ID_IS_OVERRIDE_LIBRARY(collection_parent->collection)) { + !ID_IS_OVERRIDE_LIBRARY(collection_parent->collection)) + { if (view_layer != NULL && - !BKE_view_layer_has_collection(view_layer, collection_parent->collection)) { + !BKE_view_layer_has_collection(view_layer, collection_parent->collection)) + { /* In case this parent collection is not in given view_layer, there is no point in * searching in its ancestors either, we can skip that whole parenting branch. */ continue; @@ -1306,7 +1312,8 @@ static bool collection_object_add( if (ob->instance_collection) { /* Cyclic dependency check. */ if ((ob->instance_collection == collection) || - collection_find_child_recursive(ob->instance_collection, collection)) { + collection_find_child_recursive(ob->instance_collection, collection)) + { return false; } } @@ -1431,7 +1438,8 @@ void BKE_collection_object_add_from(Main *bmain, Scene *scene, Object *ob_src, O FOREACH_SCENE_COLLECTION_BEGIN (scene, collection) { if (!ID_IS_LINKED(collection) && !ID_IS_OVERRIDE_LIBRARY(collection) && - BKE_collection_has_object(collection, ob_src)) { + BKE_collection_has_object(collection, ob_src)) + { collection_object_add(bmain, collection, ob_dst, 0, true); is_instantiated = true; } @@ -1663,14 +1671,16 @@ static bool collection_instance_find_recursive(Collection *collection, LISTBASE_FOREACH (CollectionObject *, collection_object, &collection->gobject) { if (collection_object->ob != NULL && /* Object from a given collection should never instantiate that collection either. */ - ELEM(collection_object->ob->instance_collection, instance_collection, collection)) { + ELEM(collection_object->ob->instance_collection, instance_collection, collection)) + { return true; } } LISTBASE_FOREACH (CollectionChild *, collection_child, &collection->children) { if (collection_child->collection != NULL && - collection_instance_find_recursive(collection_child->collection, instance_collection)) { + collection_instance_find_recursive(collection_child->collection, instance_collection)) + { return true; } } @@ -1705,8 +1715,8 @@ static bool collection_instance_fix_recursive(Collection *parent_collection, bool cycles_found = false; LISTBASE_FOREACH (CollectionObject *, collection_object, &parent_collection->gobject) { - if (collection_object->ob != NULL && - collection_object->ob->instance_collection == collection) { + if (collection_object->ob != NULL && collection_object->ob->instance_collection == collection) + { id_us_min(&collection->id); collection_object->ob->instance_collection = NULL; cycles_found = true; diff --git a/source/blender/blenkernel/intern/collision.cc b/source/blender/blenkernel/intern/collision.cc index 82536cc1b29..1e28d3e737a 100644 --- a/source/blender/blenkernel/intern/collision.cc +++ b/source/blender/blenkernel/intern/collision.cc @@ -289,7 +289,8 @@ static float compute_collision_point_tri_tri(const float a1[3], for (int j = 0; j < 3; j++) { if (isect_line_plane_v3(tmp_co1, a[j], a[next_ind(j)], b[i], dir) && point_in_slice_seg(tmp_co1, a[j], a[next_ind(j)]) && - point_in_slice_seg(tmp_co1, b[i], b[next_ind(i)])) { + point_in_slice_seg(tmp_co1, b[i], b[next_ind(i)])) + { closest_to_line_v3(tmp_co2, tmp_co1, b[i], b[next_ind(i)]); sub_v3_v3v3(tmp_vec, tmp_co1, tmp_co2); tmp = len_v3(tmp_vec); @@ -476,7 +477,8 @@ static float compute_collision_point_edge_tri(const float a1[3], if (isect_line_plane_v3(tmp_co1, a[0], a[1], b[i], dir) && point_in_slice_seg(tmp_co1, a[0], a[1]) && - point_in_slice_seg(tmp_co1, b[i], b[next_ind(i)])) { + point_in_slice_seg(tmp_co1, b[i], b[next_ind(i)])) + { closest_to_line_v3(tmp_co2, tmp_co1, b[i], b[next_ind(i)]); sub_v3_v3v3(tmp_vec, tmp_co1, tmp_co2); tmp = len_v3(tmp_vec); @@ -1685,8 +1687,8 @@ int cloth_bvh_collision( collisions = (CollPair *)MEM_mallocN(sizeof(CollPair) * coll_count_self, "collision array"); - if (cloth_bvh_selfcollisions_nearcheck( - clmd, collisions, coll_count_self, overlap_self)) { + if (cloth_bvh_selfcollisions_nearcheck(clmd, collisions, coll_count_self, overlap_self)) + { ret += cloth_bvh_selfcollisions_resolve(clmd, collisions, coll_count_self, dt); ret2 += ret; } diff --git a/source/blender/blenkernel/intern/colorband.c b/source/blender/blenkernel/intern/colorband.c index 99236ed81ea..0a66e2febf9 100644 --- a/source/blender/blenkernel/intern/colorband.c +++ b/source/blender/blenkernel/intern/colorband.c @@ -189,7 +189,8 @@ static void colorband_init_from_table_rgba_resample(ColorBand *coba, } while ((carr_len > 1 && !BLI_heap_is_empty(heap)) && - ((carr_len >= MAXCOLORBAND) || (BLI_heap_top_value(heap) <= eps_2x))) { + ((carr_len >= MAXCOLORBAND) || (BLI_heap_top_value(heap) <= eps_2x))) + { c = BLI_heap_pop_min(heap); struct ColorResampleElem *c_next = c->next, *c_prev = c->prev; c_prev->next = c_next; @@ -416,7 +417,8 @@ bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4]) out[3] = cbd1->a; } else if ((in <= cbd1->pos) && - ELEM(ipotype, COLBAND_INTERP_LINEAR, COLBAND_INTERP_EASE, COLBAND_INTERP_CONSTANT)) { + ELEM(ipotype, COLBAND_INTERP_LINEAR, COLBAND_INTERP_EASE, COLBAND_INTERP_CONSTANT)) + { /* We are before first color stop. */ out[0] = cbd1->r; out[1] = cbd1->g; @@ -449,7 +451,8 @@ bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4]) } if ((a == coba->tot) && - ELEM(ipotype, COLBAND_INTERP_LINEAR, COLBAND_INTERP_EASE, COLBAND_INTERP_CONSTANT)) { + ELEM(ipotype, COLBAND_INTERP_LINEAR, COLBAND_INTERP_EASE, COLBAND_INTERP_CONSTANT)) + { /* We are after last color stop. */ out[0] = cbd2->r; out[1] = cbd2->g; diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c index 630e8a9bf20..75af451d7b6 100644 --- a/source/blender/blenkernel/intern/constraint.c +++ b/source/blender/blenkernel/intern/constraint.c @@ -354,10 +354,8 @@ void BKE_constraint_mat_convertspace(Object *ob, } /* use pose-space as stepping stone for other spaces */ - if (ELEM(to, - CONSTRAINT_SPACE_WORLD, - CONSTRAINT_SPACE_PARLOCAL, - CONSTRAINT_SPACE_CUSTOM)) { + if (ELEM(to, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_PARLOCAL, CONSTRAINT_SPACE_CUSTOM)) + { /* call self with slightly different values */ BKE_constraint_mat_convertspace( ob, pchan, cob, mat, CONSTRAINT_SPACE_POSE, to, keep_scale); @@ -399,7 +397,8 @@ void BKE_constraint_mat_convertspace(Object *ob, CONSTRAINT_SPACE_WORLD, CONSTRAINT_SPACE_LOCAL, CONSTRAINT_SPACE_OWNLOCAL, - CONSTRAINT_SPACE_CUSTOM)) { + CONSTRAINT_SPACE_CUSTOM)) + { /* call self with slightly different values */ BKE_constraint_mat_convertspace( ob, pchan, cob, mat, CONSTRAINT_SPACE_POSE, to, keep_scale); @@ -1509,7 +1508,8 @@ static void followpath_get_tarmat(struct Depsgraph *UNUSED(depsgraph), NULL, (data->followflag & FOLLOWPATH_FOLLOW) ? quat : NULL, &radius, - NULL)) { + NULL)) + { float totmat[4][4]; unit_m4(totmat); @@ -4230,7 +4230,8 @@ static void shrinkwrap_get_tarmat(struct Depsgraph *UNUSED(depsgraph), ShrinkwrapTreeData tree; if (BKE_shrinkwrap_init_tree( - &tree, target_eval, scon->shrinkType, scon->shrinkMode, do_track_normal)) { + &tree, target_eval, scon->shrinkType, scon->shrinkMode, do_track_normal)) + { BLI_space_transform_from_matrices(&transform, cob->matrix, ct->tar->object_to_world); switch (scon->shrinkType) { diff --git a/source/blender/blenkernel/intern/context.cc b/source/blender/blenkernel/intern/context.cc index 36eec388622..13aae983dd1 100644 --- a/source/blender/blenkernel/intern/context.cc +++ b/source/blender/blenkernel/intern/context.cc @@ -410,7 +410,8 @@ static int ctx_data_base_collection_get(const bContext *C, const char *member, L { ListBase ctx_object_list; if ((ctx_data_collection_get(C, member, &ctx_object_list) == false) || - BLI_listbase_is_empty(&ctx_object_list)) { + BLI_listbase_is_empty(&ctx_object_list)) + { BLI_listbase_clear(list); return 0; } @@ -426,7 +427,8 @@ static int ctx_data_base_collection_get(const bContext *C, const char *member, L CollectionPointerLink *ctx_object; for (ctx_object = static_cast(ctx_object_list.first); ctx_object; - ctx_object = ctx_object->next) { + ctx_object = ctx_object->next) + { Object *ob = static_cast(ctx_object->ptr.data); Base *base = BKE_view_layer_base_find(view_layer, ob); if (base != nullptr) { diff --git a/source/blender/blenkernel/intern/crazyspace.cc b/source/blender/blenkernel/intern/crazyspace.cc index 7202066b563..2b38713cc78 100644 --- a/source/blender/blenkernel/intern/crazyspace.cc +++ b/source/blender/blenkernel/intern/crazyspace.cc @@ -142,7 +142,8 @@ void BKE_crazyspace_set_quats_editmesh(BMEditMesh *em, do { if (BM_elem_flag_test(l_iter->v, BM_ELEM_HIDDEN) || BM_elem_flag_test(l_iter->v, BM_ELEM_TAG) || - (use_select && !BM_elem_flag_test(l_iter->v, BM_ELEM_SELECT))) { + (use_select && !BM_elem_flag_test(l_iter->v, BM_ELEM_SELECT))) + { continue; } @@ -291,7 +292,8 @@ int BKE_crazyspace_get_first_deform_matrices_editbmesh(struct Depsgraph *depsgra for (; md && i <= cageIndex; md = md->next, i++) { if (editbmesh_modifier_is_enabled(scene, ob, md, me != nullptr) && - BKE_modifier_is_correctable_deformed(md)) { + BKE_modifier_is_correctable_deformed(md)) + { modifiers_left_num++; } } @@ -522,7 +524,8 @@ void BKE_crazyspace_api_eval(Depsgraph *depsgraph, struct ReportList *reports) { if (object->runtime.crazyspace_deform_imats != nullptr || - object->runtime.crazyspace_deform_cos != nullptr) { + object->runtime.crazyspace_deform_cos != nullptr) + { return; } diff --git a/source/blender/blenkernel/intern/cryptomatte.cc b/source/blender/blenkernel/intern/cryptomatte.cc index 8e441681d2c..94dad4ee60e 100644 --- a/source/blender/blenkernel/intern/cryptomatte.cc +++ b/source/blender/blenkernel/intern/cryptomatte.cc @@ -262,7 +262,8 @@ void BKE_cryptomatte_matte_id_to_entries(NodeCryptomatte *node_storage, const ch /* Update the matte_id so the files can be opened in versions that don't * use `CryptomatteEntry`. */ if (matte_id != node_storage->matte_id && node_storage->matte_id && - STREQ(node_storage->matte_id, matte_id)) { + STREQ(node_storage->matte_id, matte_id)) + { MEM_SAFE_FREE(node_storage->matte_id); node_storage->matte_id = static_cast(MEM_dupallocN(matte_id)); } @@ -330,7 +331,8 @@ void BKE_cryptomatte_store_metadata(const struct CryptomatteSession *session, const ViewLayer *view_layer) { for (const blender::MapItem item : - session->layers.items()) { + session->layers.items()) + { const blender::StringRefNull layer_name(item.key); const blender::bke::cryptomatte::CryptomatteLayer &layer = item.value; diff --git a/source/blender/blenkernel/intern/curve.cc b/source/blender/blenkernel/intern/curve.cc index 7981de7e6eb..d3a7f6eb95a 100644 --- a/source/blender/blenkernel/intern/curve.cc +++ b/source/blender/blenkernel/intern/curve.cc @@ -558,7 +558,8 @@ void BKE_curve_texspace_calc(Curve *cu) void BKE_curve_texspace_ensure(Curve *cu) { if ((cu->texspace_flag & CU_TEXSPACE_FLAG_AUTO) && - (cu->texspace_flag & CU_TEXSPACE_FLAG_AUTO_EVALUATED) == 0) { + (cu->texspace_flag & CU_TEXSPACE_FLAG_AUTO_EVALUATED) == 0) + { BKE_curve_texspace_calc(cu); } } @@ -3290,7 +3291,8 @@ static void calchandleNurb_intern(BezTriple *bezt, /* When one handle is free, aligning makes no sense, see: #35952 */ ELEM(HD_FREE, bezt->h1, bezt->h2) || /* Also when no handles are aligned, skip this step. */ - (!ELEM(HD_ALIGN, bezt->h1, bezt->h2) && !ELEM(HD_ALIGN_DOUBLESIDE, bezt->h1, bezt->h2))) { + (!ELEM(HD_ALIGN, bezt->h1, bezt->h2) && !ELEM(HD_ALIGN_DOUBLESIDE, bezt->h1, bezt->h2))) + { /* Handles need to be updated during animation and applying stuff like hooks, * but in such situations it's quite difficult to distinguish in which order * align handles should be aligned so skip them for now. */ diff --git a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc index 2e50a906c17..fc3829b422c 100644 --- a/source/blender/blenkernel/intern/curve_to_mesh_convert.cc +++ b/source/blender/blenkernel/intern/curve_to_mesh_convert.cc @@ -656,7 +656,8 @@ static void write_sharp_bezier_edges(const CurvesInfo &curves_info, const VArraySpan handle_types_left{profile.handle_types_left()}; const VArraySpan handle_types_right{profile.handle_types_right()}; if (!handle_types_left.contains(BEZIER_HANDLE_VECTOR) && - !handle_types_right.contains(BEZIER_HANDLE_VECTOR)) { + !handle_types_right.contains(BEZIER_HANDLE_VECTOR)) + { return; } @@ -801,7 +802,8 @@ Mesh *curve_to_mesh_sweep(const CurvesGeometry &main, main_attributes.for_all([&](const AttributeIDRef &id, const AttributeMetaData meta_data) { if (!should_add_attribute_to_mesh( - main_attributes, mesh_attributes, id, meta_data, propagation_info)) { + main_attributes, mesh_attributes, id, meta_data, propagation_info)) + { return true; } main_attributes_set.add_new(id); @@ -839,7 +841,8 @@ Mesh *curve_to_mesh_sweep(const CurvesGeometry &main, return true; } if (!should_add_attribute_to_mesh( - profile_attributes, mesh_attributes, id, meta_data, propagation_info)) { + profile_attributes, mesh_attributes, id, meta_data, propagation_info)) + { return true; } const eAttrDomain src_domain = meta_data.domain; diff --git a/source/blender/blenkernel/intern/curves_geometry.cc b/source/blender/blenkernel/intern/curves_geometry.cc index 828018fe633..93bc61f3647 100644 --- a/source/blender/blenkernel/intern/curves_geometry.cc +++ b/source/blender/blenkernel/intern/curves_geometry.cc @@ -737,7 +737,8 @@ Span CurvesGeometry::evaluated_tangents() const const float epsilon = 1e-6f; if (!math::almost_equal_relative( - handles_right[points.first()], positions[points.first()], epsilon)) { + handles_right[points.first()], positions[points.first()], epsilon)) + { tangents[evaluated_points.first()] = math::normalize(handles_right[points.first()] - positions[points.first()]); } @@ -1442,7 +1443,8 @@ void CurvesGeometry::reverse_curves(const IndexMask curves_to_reverse) * the left does, but there's no need to count on it, so check for both attributes. */ if (attributes.contains(ATTR_HANDLE_POSITION_LEFT) && - attributes.contains(ATTR_HANDLE_POSITION_RIGHT)) { + attributes.contains(ATTR_HANDLE_POSITION_RIGHT)) + { reverse_swap_curve_point_data(*this, curves_to_reverse, this->handle_positions_left_for_write(), diff --git a/source/blender/blenkernel/intern/customdata.cc b/source/blender/blenkernel/intern/customdata.cc index d489b79047b..4db2bf0b39e 100644 --- a/source/blender/blenkernel/intern/customdata.cc +++ b/source/blender/blenkernel/intern/customdata.cc @@ -2258,7 +2258,8 @@ static bool customdata_merge_internal(const CustomData *source, continue; } if ((max_current_type_layer_count != -1) && - (current_type_layer_count >= max_current_type_layer_count)) { + (current_type_layer_count >= max_current_type_layer_count)) + { /* Don't merge this layer because the maximum amount of layers of this type is reached. */ continue; } @@ -3945,7 +3946,8 @@ void CustomData_bmesh_copy_data_exclude_by_type(const CustomData *source, /* if we found a matching layer, copy the data */ if (dest->layers[dest_i].type == source->layers[src_i].type && - STREQ(dest->layers[dest_i].name, source->layers[src_i].name)) { + STREQ(dest->layers[dest_i].name, source->layers[src_i].name)) + { if (no_mask || ((CD_TYPE_AS_MASK(dest->layers[dest_i].type) & mask_exclude) == 0)) { const void *src_data = POINTER_OFFSET(src_block, source->layers[src_i].offset); void *dest_data = POINTER_OFFSET(*dest_block, dest->layers[dest_i].offset); @@ -4018,7 +4020,8 @@ bool CustomData_layer_has_math(const CustomData *data, const int layer_n) const LayerTypeInfo *typeInfo = layerType_getInfo(eCustomDataType(data->layers[layer_n].type)); if (typeInfo->equal && typeInfo->add && typeInfo->multiply && typeInfo->initminmax && - typeInfo->dominmax) { + typeInfo->dominmax) + { return true; } @@ -4385,7 +4388,8 @@ int CustomData_name_max_length_calc(const blender::StringRef name) return MAX_CUSTOMDATA_LAYER_NAME_NO_PREFIX; } for (const blender::StringRef prefix : - {"." UV_VERTSEL_NAME, UV_EDGESEL_NAME ".", UV_PINNED_NAME "."}) { + {"." UV_VERTSEL_NAME, UV_EDGESEL_NAME ".", UV_PINNED_NAME "."}) + { if (name.startswith(prefix)) { return MAX_CUSTOMDATA_LAYER_NAME; } @@ -4469,7 +4473,8 @@ bool CustomData_verify_versions(CustomData *data, const int index) CD_FACEMAP, CD_MTEXPOLY, CD_SCULPT_FACE_SETS, - CD_CREASE)) { + CD_CREASE)) + { keeplayer = false; CLOG_WARN(&LOG, ".blend file read: removing a data layer that should not have been written"); } @@ -4969,7 +4974,8 @@ static void customdata_data_transfer_interp_generic(const CustomDataTransferLaye (mix_mode == CDT_MIX_REPLACE_ABOVE_THRESHOLD && check_bit_flag(data_dst, data_size, data_flag)) || (mix_mode == CDT_MIX_REPLACE_BELOW_THRESHOLD && - !check_bit_flag(data_dst, data_size, data_flag)))) { + !check_bit_flag(data_dst, data_size, data_flag)))) + { copy_bit_flag(data_dst, tmp_dst, data_size, data_flag); } } @@ -5327,7 +5333,8 @@ void CustomData_blend_read(BlendDataReader *reader, CustomData *data, const int void CustomData_debug_info_from_layers(const CustomData *data, const char *indent, DynStr *dynstr) { for (eCustomDataType type = eCustomDataType(0); type < CD_NUMTYPES; - type = eCustomDataType(type + 1)) { + type = eCustomDataType(type + 1)) + { if (CustomData_has_layer(data, type)) { /* NOTE: doesn't account for multiple layers. */ const char *name = CustomData_layertype_name(type); diff --git a/source/blender/blenkernel/intern/data_transfer.cc b/source/blender/blenkernel/intern/data_transfer.cc index 6836524c38f..3e19f1f550d 100644 --- a/source/blender/blenkernel/intern/data_transfer.cc +++ b/source/blender/blenkernel/intern/data_transfer.cc @@ -267,25 +267,29 @@ static void data_transfer_mesh_attributes_transfer_active_color_string( if ((data_type == CD_PROP_COLOR) && !BKE_id_attribute_search(&const_cast(mesh_src->id), active_color_src, CD_MASK_PROP_COLOR, - ATTR_DOMAIN_MASK_COLOR)) { + ATTR_DOMAIN_MASK_COLOR)) + { return; } else if ((data_type == CD_PROP_BYTE_COLOR) && !BKE_id_attribute_search(&const_cast(mesh_src->id), active_color_src, CD_MASK_PROP_BYTE_COLOR, - ATTR_DOMAIN_MASK_COLOR)) { + ATTR_DOMAIN_MASK_COLOR)) + { return; } if ((data_type == CD_PROP_COLOR) && BKE_id_attribute_search( - &mesh_dst->id, active_color_src, CD_MASK_PROP_COLOR, ATTR_DOMAIN_MASK_COLOR)) { + &mesh_dst->id, active_color_src, CD_MASK_PROP_COLOR, ATTR_DOMAIN_MASK_COLOR)) + { mesh_dst->active_color_attribute = BLI_strdup(active_color_src); } else if ((data_type == CD_PROP_BYTE_COLOR) && BKE_id_attribute_search( - &mesh_dst->id, active_color_src, CD_MASK_PROP_BYTE_COLOR, ATTR_DOMAIN_MASK_COLOR)) { + &mesh_dst->id, active_color_src, CD_MASK_PROP_BYTE_COLOR, ATTR_DOMAIN_MASK_COLOR)) + { mesh_dst->active_color_attribute = BLI_strdup(active_color_src); } else { @@ -314,26 +318,29 @@ static void data_transfer_mesh_attributes_transfer_default_color_string( if ((data_type == CD_PROP_COLOR) && !BKE_id_attribute_search(&const_cast(mesh_src->id), default_color_src, CD_MASK_PROP_COLOR, - ATTR_DOMAIN_MASK_COLOR)) { + ATTR_DOMAIN_MASK_COLOR)) + { return; } else if ((data_type == CD_PROP_BYTE_COLOR) && !BKE_id_attribute_search(&const_cast(mesh_src->id), default_color_src, CD_MASK_PROP_BYTE_COLOR, - ATTR_DOMAIN_MASK_COLOR)) { + ATTR_DOMAIN_MASK_COLOR)) + { return; } if ((data_type == CD_PROP_COLOR) && BKE_id_attribute_search( - &mesh_dst->id, default_color_src, CD_MASK_PROP_COLOR, ATTR_DOMAIN_MASK_COLOR)) { + &mesh_dst->id, default_color_src, CD_MASK_PROP_COLOR, ATTR_DOMAIN_MASK_COLOR)) + { mesh_dst->default_color_attribute = BLI_strdup(default_color_src); } - else if ((data_type == CD_PROP_BYTE_COLOR) && BKE_id_attribute_search(&mesh_dst->id, - default_color_src, - CD_MASK_PROP_BYTE_COLOR, - ATTR_DOMAIN_MASK_COLOR)) { + else if ((data_type == CD_PROP_BYTE_COLOR) && + BKE_id_attribute_search( + &mesh_dst->id, default_color_src, CD_MASK_PROP_BYTE_COLOR, ATTR_DOMAIN_MASK_COLOR)) + { mesh_dst->default_color_attribute = BLI_strdup(default_color_src); } else { @@ -465,7 +472,8 @@ float data_transfer_interp_float_do(const int mix_mode, float val_ret; if ((mix_mode == CDT_MIX_REPLACE_ABOVE_THRESHOLD && (val_dst < mix_factor)) || - (mix_mode == CDT_MIX_REPLACE_BELOW_THRESHOLD && (val_dst > mix_factor))) { + (mix_mode == CDT_MIX_REPLACE_BELOW_THRESHOLD && (val_dst > mix_factor))) + { return val_dst; /* Do not affect destination. */ } @@ -935,7 +943,8 @@ static bool data_transfer_layersmapping_generate(ListBase *r_map, fromlayers, tolayers, interp, - interp_data)) { + interp_data)) + { /* We handle specific source selection cases here. */ return false; } @@ -987,7 +996,8 @@ static bool data_transfer_layersmapping_generate(ListBase *r_map, fromlayers, tolayers, interp, - interp_data)) { + interp_data)) + { /* We handle specific source selection cases here. */ return false; } @@ -1060,7 +1070,8 @@ static bool data_transfer_layersmapping_generate(ListBase *r_map, fromlayers, tolayers, interp, - interp_data)) { + interp_data)) + { /* We handle specific source selection cases here. */ return false; } @@ -1091,7 +1102,8 @@ static bool data_transfer_layersmapping_generate(ListBase *r_map, fromlayers, tolayers, interp, - interp_data)) { + interp_data)) + { /* We handle specific source selection cases here. */ return false; } @@ -1348,7 +1360,8 @@ bool BKE_object_data_transfer_ex(struct Depsgraph *depsgraph, me_src = BKE_modifier_get_evaluated_mesh_from_evaluated_object(ob_src); if (me_src == nullptr || - !CustomData_MeshMasks_are_matching(&ob_src->runtime.last_data_mask, &me_src_mask)) { + !CustomData_MeshMasks_are_matching(&ob_src->runtime.last_data_mask, &me_src_mask)) + { CLOG_WARN(&LOG, "Data Transfer: source mesh data is not ready - dependency cycle?"); return changed; } @@ -1465,13 +1478,15 @@ bool BKE_object_data_transfer_ex(struct Depsgraph *depsgraph, use_delete, fromlayers, tolayers, - space_transform)) { + space_transform)) + { CustomDataTransferLayerMap *lay_mapit; changed |= (lay_map.first != nullptr); for (lay_mapit = static_cast(lay_map.first); lay_mapit; - lay_mapit = lay_mapit->next) { + lay_mapit = lay_mapit->next) + { CustomData_data_transfer(&geom_map[VDATA], lay_mapit); } @@ -1550,13 +1565,15 @@ bool BKE_object_data_transfer_ex(struct Depsgraph *depsgraph, use_delete, fromlayers, tolayers, - space_transform)) { + space_transform)) + { CustomDataTransferLayerMap *lay_mapit; changed |= (lay_map.first != nullptr); for (lay_mapit = static_cast(lay_map.first); lay_mapit; - lay_mapit = lay_mapit->next) { + lay_mapit = lay_mapit->next) + { CustomData_data_transfer(&geom_map[EDATA], lay_mapit); } @@ -1577,8 +1594,8 @@ bool BKE_object_data_transfer_ex(struct Depsgraph *depsgraph, if (!geom_map_init[LDATA]) { const int num_loops_src = me_src->totloop; - if ((map_loop_mode == MREMAP_MODE_TOPOLOGY) && - (corner_verts_dst.size() != num_loops_src)) { + if ((map_loop_mode == MREMAP_MODE_TOPOLOGY) && (corner_verts_dst.size() != num_loops_src)) + { BKE_report(reports, RPT_ERROR, "Source and destination meshes do not have the same amount of face corners, " @@ -1651,13 +1668,15 @@ bool BKE_object_data_transfer_ex(struct Depsgraph *depsgraph, use_delete, fromlayers, tolayers, - space_transform)) { + space_transform)) + { CustomDataTransferLayerMap *lay_mapit; changed |= (lay_map.first != nullptr); for (lay_mapit = static_cast(lay_map.first); lay_mapit; - lay_mapit = lay_mapit->next) { + lay_mapit = lay_mapit->next) + { CustomData_data_transfer(&geom_map[LDATA], lay_mapit); } @@ -1737,13 +1756,15 @@ bool BKE_object_data_transfer_ex(struct Depsgraph *depsgraph, use_delete, fromlayers, tolayers, - space_transform)) { + space_transform)) + { CustomDataTransferLayerMap *lay_mapit; changed |= (lay_map.first != nullptr); for (lay_mapit = static_cast(lay_map.first); lay_mapit; - lay_mapit = lay_mapit->next) { + lay_mapit = lay_mapit->next) + { CustomData_data_transfer(&geom_map[PDATA], lay_mapit); } diff --git a/source/blender/blenkernel/intern/deform.cc b/source/blender/blenkernel/intern/deform.cc index e9f27430985..b191866a4a5 100644 --- a/source/blender/blenkernel/intern/deform.cc +++ b/source/blender/blenkernel/intern/deform.cc @@ -1301,7 +1301,8 @@ static bool data_transfer_layersmapping_vgroups_multisrc_to_dst(ListBase *r_map, for (idx_src = 0, dg_src = static_cast(src_list->first); idx_src < num_layers_src; - idx_src++, dg_src = dg_src->next) { + idx_src++, dg_src = dg_src->next) + { if (!use_layers_src[idx_src]) { continue; } @@ -1610,7 +1611,8 @@ void BKE_defvert_blend_read(BlendDataReader *reader, int count, MDeformVert *mdv /* Convert to vertex group allocation system. */ MDeformWeight *dw; if (mdverts->dw && - (dw = static_cast(BLO_read_get_new_data_address(reader, mdverts->dw)))) { + (dw = static_cast(BLO_read_get_new_data_address(reader, mdverts->dw)))) + { const size_t dw_len = sizeof(MDeformWeight) * mdverts->totweight; void *dw_tmp = MEM_mallocN(dw_len, __func__); memcpy(dw_tmp, dw, dw_len); diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc index 45e8abe2a53..3e6cd9e86b0 100644 --- a/source/blender/blenkernel/intern/displist.cc +++ b/source/blender/blenkernel/intern/displist.cc @@ -603,7 +603,8 @@ void BKE_curve_calc_modifiers_pre(Depsgraph *depsgraph, if (pretessellatePoint) { VirtualModifierData virtualModifierData; for (ModifierData *md = BKE_modifiers_get_virtual_modifierlist(ob, &virtualModifierData); md; - md = md->next) { + md = md->next) + { const ModifierTypeInfo *mti = BKE_modifier_get_info((ModifierType)md->type); if (!BKE_modifier_is_enabled(scene, md, required_mode)) { @@ -1039,13 +1040,15 @@ static void calc_bevfac_mapping(const Curve *cu, if ((BKE_nurb_check_valid_u(nu) == false) || /* not essential, but skips unnecessary calculation */ - (min_ff(cu->bevfac1, cu->bevfac2) == 0.0f && max_ff(cu->bevfac1, cu->bevfac2) == 1.0f)) { + (min_ff(cu->bevfac1, cu->bevfac2) == 0.0f && max_ff(cu->bevfac1, cu->bevfac2) == 1.0f)) + { calc_bevfac_mapping_default(bl, r_start, r_firstblend, r_steps, r_lastblend); return; } if (ELEM(cu->bevfac1_mapping, CU_BEVFAC_MAP_SEGMENT, CU_BEVFAC_MAP_SPLINE) || - ELEM(cu->bevfac2_mapping, CU_BEVFAC_MAP_SEGMENT, CU_BEVFAC_MAP_SPLINE)) { + ELEM(cu->bevfac2_mapping, CU_BEVFAC_MAP_SEGMENT, CU_BEVFAC_MAP_SPLINE)) + { for (i = 0; i < SEGMENTSU(nu); i++) { total_length += bl->seglen[i]; } @@ -1128,7 +1131,8 @@ static GeometrySet evaluate_curve_type_object(Depsgraph *depsgraph, BKE_curve_bevelList_make(ob, deformed_nurbs, for_render); if ((cu->flag & CU_PATH) || - DEG_get_eval_flags_for_id(depsgraph, &ob->id) & DAG_EVAL_NEED_CURVE_PATH) { + DEG_get_eval_flags_for_id(depsgraph, &ob->id) & DAG_EVAL_NEED_CURVE_PATH) + { BKE_anim_path_calc_data(ob); } diff --git a/source/blender/blenkernel/intern/dynamicpaint.cc b/source/blender/blenkernel/intern/dynamicpaint.cc index 3b107c04118..5a5f95d0d07 100644 --- a/source/blender/blenkernel/intern/dynamicpaint.cc +++ b/source/blender/blenkernel/intern/dynamicpaint.cc @@ -354,9 +354,11 @@ static bool surface_duplicateOutputExists(void *arg, const char *name) for (; surface; surface = surface->next) { if (surface != t_surface && surface->type == t_surface->type && - surface->format == t_surface->format) { + surface->format == t_surface->format) + { if ((surface->output_name[0] != '\0' && !BLI_path_cmp(name, surface->output_name)) || - (surface->output_name2[0] != '\0' && !BLI_path_cmp(name, surface->output_name2))) { + (surface->output_name2[0] != '\0' && !BLI_path_cmp(name, surface->output_name2))) + { return true; } } @@ -447,7 +449,8 @@ static int surface_totalSamples(DynamicPaintSurface *surface) return (surface->data->total_points * 5); } if (surface->format == MOD_DPAINT_SURFACE_F_VERTEX && surface->flags & MOD_DPAINT_ANTIALIAS && - surface->data->adj_data) { + surface->data->adj_data) + { return (surface->data->total_points + surface->data->adj_data->total_targets); } @@ -794,7 +797,8 @@ static void surfaceGenerateGrid(DynamicPaintSurface *surface) /* in case of an allocation failure abort here */ if (!grid->bounds || !grid->s_pos || !grid->s_num || !grid->t_index || !temp_s_num || - !temp_t_index) { + !temp_t_index) + { error = 1; } @@ -930,7 +934,8 @@ static void surface_freeUnusedData(DynamicPaintSurface *surface) /* Free bake-data if not active or surface is baked. */ if (!(surface->flags & MOD_DPAINT_ACTIVE) || - (surface->pointcache && surface->pointcache->flag & PTCACHE_BAKED)) { + (surface->pointcache && surface->pointcache->flag & PTCACHE_BAKED)) + { free_bakeData(surface->data); } } @@ -1210,7 +1215,8 @@ void dynamicPaint_Modifier_copy(const DynamicPaintModifierData *pmd, /* copy existing surfaces */ for (surface = static_cast(pmd->canvas->surfaces.first); surface; - surface = surface->next) { + surface = surface->next) + { DynamicPaintSurface *t_surface = dynamicPaint_createNewSurface(tpmd->canvas, nullptr); if (flag & LIB_ID_COPY_SET_COPIED_ON_WRITE) { /* TODO(sergey): Consider passing some tips to the surface @@ -1775,8 +1781,8 @@ bool dynamicPaint_resetSurface(const Scene *scene, DynamicPaintSurface *surface) /* make sure allocated surface size matches current requirements */ static bool dynamicPaint_checkSurfaceData(const Scene *scene, DynamicPaintSurface *surface) { - if (!surface->data || - (dynamicPaint_surfaceNumOfPoints(surface) != surface->data->total_points)) { + if (!surface->data || (dynamicPaint_surfaceNumOfPoints(surface) != surface->data->total_points)) + { return dynamicPaint_resetSurface(scene, surface); } return true; @@ -1907,13 +1913,15 @@ static Mesh *dynamicPaint_Modifier_apply(DynamicPaintModifierData *pmd, Object * Mesh *result = BKE_mesh_copy_for_eval(mesh); if (pmd->canvas && !(pmd->canvas->flags & MOD_DPAINT_BAKING) && - pmd->type == MOD_DYNAMICPAINT_TYPE_CANVAS) { + pmd->type == MOD_DYNAMICPAINT_TYPE_CANVAS) + { DynamicPaintSurface *surface; /* loop through surfaces */ for (surface = static_cast(pmd->canvas->surfaces.first); surface; - surface = surface->next) { + surface = surface->next) + { PaintSurfaceData *sData = surface->data; if (surface->format != MOD_DPAINT_SURFACE_F_IMAGESEQ && sData) { @@ -2115,7 +2123,8 @@ static void dynamicPaint_frameUpdate( CLAMP(current_frame, surface->start_frame, surface->end_frame); if (no_surface_data || current_frame != surface->current_frame || - int(scene->r.cfra) == surface->start_frame) { + int(scene->r.cfra) == surface->start_frame) + { PointCache *cache = surface->pointcache; PTCacheID pid; surface->current_frame = current_frame; @@ -2149,7 +2158,8 @@ static void dynamicPaint_frameUpdate( /* restore canvas mesh if required */ if (surface->type == MOD_DPAINT_SURFACE_T_DISPLACE && - surface->flags & MOD_DPAINT_DISP_INCREMENTAL && surface->next) { + surface->flags & MOD_DPAINT_DISP_INCREMENTAL && surface->next) + { canvas_copyMesh(canvas, mesh); } @@ -2255,7 +2265,8 @@ static void dynamic_paint_create_uv_surface_direct_cb(void *__restrict userdata, for (const int i : looptris.index_range()) { /* Check uv bb */ if ((faceBB[i].min[0] > point[sample][0]) || (faceBB[i].min[1] > point[sample][1]) || - (faceBB[i].max[0] < point[sample][0]) || (faceBB[i].max[1] < point[sample][1])) { + (faceBB[i].max[0] < point[sample][0]) || (faceBB[i].max[1] < point[sample][1])) + { continue; } @@ -3634,7 +3645,8 @@ static void dynamicPaint_updatePointData(const DynamicPaintSurface *surface, /* Sample velocity colorband if required */ if (brush->flags & - (MOD_DPAINT_VELOCITY_ALPHA | MOD_DPAINT_VELOCITY_COLOR | MOD_DPAINT_VELOCITY_DEPTH)) { + (MOD_DPAINT_VELOCITY_ALPHA | MOD_DPAINT_VELOCITY_COLOR | MOD_DPAINT_VELOCITY_DEPTH)) + { float coba_res[4]; vel_factor /= brush->max_velocity; CLAMP(vel_factor, 0.0f, 1.0f); @@ -4054,7 +4066,8 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(void *__restrict userdata, /* Check proximity collision */ if (ELEM(brush->collision, MOD_DPAINT_COL_DIST, MOD_DPAINT_COL_VOLDIST) && - (!hit_found || (brush->flags & MOD_DPAINT_INVERSE_PROX))) { + (!hit_found || (brush->flags & MOD_DPAINT_INVERSE_PROX))) + { float proxDist = -1.0f; float hitCo[3] = {0.0f, 0.0f, 0.0f}; int tri = 0; @@ -4138,7 +4151,8 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(void *__restrict userdata, else if (hit_found == HIT_PROXIMITY) { /* apply falloff curve to the proximity_factor */ if (brush->proximity_falloff == MOD_DPAINT_PRFALL_RAMP && - BKE_colorband_evaluate(brush->paint_ramp, (1.0f - proximity_factor), prox_colorband)) { + BKE_colorband_evaluate(brush->paint_ramp, (1.0f - proximity_factor), prox_colorband)) + { proximity_factor = prox_colorband[3]; } else if (brush->proximity_falloff == MOD_DPAINT_PRFALL_CONSTANT) { @@ -4189,7 +4203,8 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(void *__restrict userdata, /* if brush has smudge enabled store brush velocity */ if (surface->type == MOD_DPAINT_SURFACE_T_PAINT && brush->flags & MOD_DPAINT_DO_SMUDGE && - bData->brush_velocity) { + bData->brush_velocity) + { copy_v3_v3(&bData->brush_velocity[index * 4], velocity); bData->brush_velocity[index * 4 + 3] = velocity_val; } @@ -4326,7 +4341,8 @@ static bool dynamicPaint_paintMesh(Depsgraph *depsgraph, for (c_index = 0; c_index < total_cells; c_index++) { /* check grid cell bounding box */ if (!grid->s_num[c_index] || - !meshBrush_boundsIntersect(&grid->bounds[c_index], &mesh_bb, brush, brush_radius)) { + !meshBrush_boundsIntersect(&grid->bounds[c_index], &mesh_bb, brush, brush_radius)) + { continue; } @@ -4481,7 +4497,8 @@ static void dynamic_paint_paint_particle_cell_point_cb_ex( /* If inside solid range and no disp depth required, no need to seek further */ if ((s_range < 0.0f) && - !ELEM(surface->type, MOD_DPAINT_SURFACE_T_DISPLACE, MOD_DPAINT_SURFACE_T_WAVE)) { + !ELEM(surface->type, MOD_DPAINT_SURFACE_T_DISPLACE, MOD_DPAINT_SURFACE_T_WAVE)) + { break; } } @@ -4529,7 +4546,8 @@ static void dynamic_paint_paint_particle_cell_point_cb_ex( /* store brush velocity for smudge */ if ((surface->type == MOD_DPAINT_SURFACE_T_PAINT) && - (brush->flags & MOD_DPAINT_DO_SMUDGE && bData->brush_velocity)) { + (brush->flags & MOD_DPAINT_DO_SMUDGE && bData->brush_velocity)) + { copy_v3_v3(&bData->brush_velocity[index * 4], velocity); bData->brush_velocity[index * 4 + 3] = velocity_val; } @@ -4587,7 +4605,8 @@ static bool dynamicPaint_paintParticles(DynamicPaintSurface *surface, for (ParticleData *pa = psys->particles; p < psys->totpart; p++, pa++) { /* Proceed only if particle is active */ if ((pa->alive == PARS_UNBORN && (part->flag & PART_UNBORN) == 0) || - (pa->alive == PARS_DEAD && (part->flag & PART_DIED) == 0) || (pa->flag & PARS_UNEXIST)) { + (pa->alive == PARS_DEAD && (part->flag & PART_DIED) == 0) || (pa->flag & PARS_UNEXIST)) + { continue; } @@ -4704,7 +4723,8 @@ static void dynamic_paint_paint_single_point_cb_ex(void *__restrict userdata, /* color ramp */ if (brush->proximity_falloff == MOD_DPAINT_PRFALL_RAMP && - BKE_colorband_evaluate(brush->paint_ramp, (1.0f - strength), colorband)) { + BKE_colorband_evaluate(brush->paint_ramp, (1.0f - strength), colorband)) + { strength = colorband[3]; } @@ -4722,7 +4742,8 @@ static void dynamic_paint_paint_single_point_cb_ex(void *__restrict userdata, /* store brush velocity for smudge */ if (surface->type == MOD_DPAINT_SURFACE_T_PAINT && brush->flags & MOD_DPAINT_DO_SMUDGE && - bData->brush_velocity) { + bData->brush_velocity) + { mul_v3_v3fl(&bData->brush_velocity[index * 4], velocity, 1.0f / velocity_val); bData->brush_velocity[index * 4 + 3] = velocity_val; } @@ -5363,7 +5384,8 @@ static void dynamic_paint_effect_drip_cb(void *__restrict userdata, const uint epointlock_idx = n_trgt / 8; const uint8_t epointlock_bitmask = 1 << (n_trgt & 7); /* 7 == 0b111 */ while (atomic_fetch_and_or_uint8(&point_locks[epointlock_idx], epointlock_bitmask) & - epointlock_bitmask) { + epointlock_bitmask) + { /* pass */ } @@ -5410,7 +5432,8 @@ static void dynamic_paint_effect_drip_cb(void *__restrict userdata, const uint ppointlock_idx = index / 8; const uint8_t ppointlock_bitmask = 1 << (index & 7); /* 7 == 0b111 */ while (atomic_fetch_and_or_uint8(&point_locks[ppointlock_idx], ppointlock_bitmask) & - ppointlock_bitmask) { + ppointlock_bitmask) + { /* pass */ } @@ -5865,7 +5888,8 @@ static void dynamic_paint_surface_pre_step_cb(void *__restrict userdata, } /* dissolve for float types */ else if (surface->flags & MOD_DPAINT_DISSOLVE && - ELEM(surface->type, MOD_DPAINT_SURFACE_T_DISPLACE, MOD_DPAINT_SURFACE_T_WEIGHT)) { + ELEM(surface->type, MOD_DPAINT_SURFACE_T_DISPLACE, MOD_DPAINT_SURFACE_T_WEIGHT)) + { float *point = &((float *)sData->type_data)[index]; /* log or linear */ value_dissolve( @@ -6266,7 +6290,8 @@ static int dynamicPaint_doStep(Depsgraph *depsgraph, PART_FLUID_SPRAYBUBBLE, PART_FLUID_FOAMBUBBLE, PART_FLUID_SPRAYFOAMBUBBLE) && - psys_check_enabled(brushObj, brush->psys, for_render)) { + psys_check_enabled(brushObj, brush->psys, for_render)) + { /* Paint a particle system */ dynamicPaint_paintParticles(surface, brush->psys, brush, timescale); } @@ -6295,8 +6320,8 @@ static int dynamicPaint_doStep(Depsgraph *depsgraph, /* process special brush effects, like smudge */ if (bData->brush_velocity) { - if (surface->type == MOD_DPAINT_SURFACE_T_PAINT && - brush->flags & MOD_DPAINT_DO_SMUDGE) { + if (surface->type == MOD_DPAINT_SURFACE_T_PAINT && brush->flags & MOD_DPAINT_DO_SMUDGE) + { dynamicPaint_doSmudge(surface, brush, timescale); } MEM_freeN(bData->brush_velocity); diff --git a/source/blender/blenkernel/intern/editmesh.cc b/source/blender/blenkernel/intern/editmesh.cc index 25531786aab..4ad882d3343 100644 --- a/source/blender/blenkernel/intern/editmesh.cc +++ b/source/blender/blenkernel/intern/editmesh.cc @@ -89,8 +89,8 @@ static void editmesh_tessface_calc_intern(BMEditMesh *em, if ((em->looptris != nullptr) && // (*em->tottri >= looptris_tot)) /* Check against allocated size in case we over allocated a little. */ - ((looptris_tot_prev_alloc >= looptris_tot) && - (looptris_tot_prev_alloc <= looptris_tot * 2))) { + ((looptris_tot_prev_alloc >= looptris_tot) && (looptris_tot_prev_alloc <= looptris_tot * 2))) + { looptris = em->looptris; } else { @@ -234,7 +234,8 @@ const float (*BKE_editmesh_vert_coords_when_deformed(Depsgraph *depsgraph, coords = me->runtime->edit_data->vertexCos; } else if ((editmesh_eval_final != nullptr) && - (editmesh_eval_final->runtime->wrapper_type == ME_WRAPPER_TYPE_BMESH)) { + (editmesh_eval_final->runtime->wrapper_type == ME_WRAPPER_TYPE_BMESH)) + { /* If this is an edit-mesh type, leave nullptr as we can use the vertex coords. */ } else { diff --git a/source/blender/blenkernel/intern/editmesh_tangent.cc b/source/blender/blenkernel/intern/editmesh_tangent.cc index ff57653d334..cb552b26b08 100644 --- a/source/blender/blenkernel/intern/editmesh_tangent.cc +++ b/source/blender/blenkernel/intern/editmesh_tangent.cc @@ -192,7 +192,8 @@ void BKE_editmesh_loop_tangent_calc(BMEditMesh *em, } } if ((tangent_mask & DM_TANGENT_MASK_ORCO) && - CustomData_get_named_layer_index(loopdata_out, CD_TANGENT, "") == -1) { + CustomData_get_named_layer_index(loopdata_out, CD_TANGENT, "") == -1) + { CustomData_add_layer_named( loopdata_out, CD_TANGENT, CD_SET_DEFAULT, int(loopdata_out_len), ""); } diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c index 64b305accdd..0db431764ba 100644 --- a/source/blender/blenkernel/intern/effect.c +++ b/source/blender/blenkernel/intern/effect.c @@ -147,7 +147,8 @@ static void precalculate_effector(struct Depsgraph *depsgraph, EffectorCache *ef Curve *cu = eff->ob->data; if (cu->flag & CU_PATH) { if (eff->ob->runtime.curve_cache == NULL || - eff->ob->runtime.curve_cache->anim_path_accum_length == NULL) { + eff->ob->runtime.curve_cache->anim_path_accum_length == NULL) + { BKE_displist_make_curveTypes(depsgraph, eff->scene, eff->ob, false); } @@ -511,7 +512,8 @@ static float eff_calc_visibility(ListBase *colliders, &hit, eff_tri_ray_hit, NULL, - raycast_flag) != -1) { + raycast_flag) != -1) + { absorption = col->ob->pd->absorption; /* visibility is only between 0 and 1, calculated from 1-absorption */ diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c index b0b926b877f..9749d6d71b4 100644 --- a/source/blender/blenkernel/intern/fcurve.c +++ b/source/blender/blenkernel/intern/fcurve.c @@ -251,7 +251,8 @@ FCurve *BKE_fcurve_find(ListBase *list, const char rna_path[], const int array_i /* Check indices first, much cheaper than a string comparison. */ /* Simple string-compare (this assumes that they have the same root...) */ if (UNLIKELY(fcu->array_index == array_index && fcu->rna_path && - fcu->rna_path[0] == rna_path[0] && STREQ(fcu->rna_path, rna_path))) { + fcu->rna_path[0] == rna_path[0] && STREQ(fcu->rna_path, rna_path))) + { return fcu; } } @@ -1143,7 +1144,8 @@ void fcurve_samples_to_keyframes(FCurve *fcu, const int start, const int end) /* Copy actual sample points. */ for (; keyframes_to_insert && sample_points; - cur_pos++, bezt++, keyframes_to_insert--, fpt++, sample_points--) { + cur_pos++, bezt++, keyframes_to_insert--, fpt++, sample_points--) + { init_unbaked_bezt_data(bezt); copy_v2_v2(bezt->vec[1], fpt->vec); } @@ -1186,13 +1188,14 @@ eFCU_Cycle_Type BKE_fcurve_get_cycle_type(const FCurve *fcu) FMod_Cycles *data = (FMod_Cycles *)fcm->data; if (data && data->after_cycles == 0 && data->before_cycles == 0) { - if (data->before_mode == FCM_EXTRAPOLATE_CYCLIC && - data->after_mode == FCM_EXTRAPOLATE_CYCLIC) { + if (data->before_mode == FCM_EXTRAPOLATE_CYCLIC && data->after_mode == FCM_EXTRAPOLATE_CYCLIC) + { return FCU_CYCLE_PERFECT; } if (ELEM(data->before_mode, FCM_EXTRAPOLATE_CYCLIC, FCM_EXTRAPOLATE_CYCLIC_OFFSET) && - ELEM(data->after_mode, FCM_EXTRAPOLATE_CYCLIC, FCM_EXTRAPOLATE_CYCLIC_OFFSET)) { + ELEM(data->after_mode, FCM_EXTRAPOLATE_CYCLIC, FCM_EXTRAPOLATE_CYCLIC_OFFSET)) + { return FCU_CYCLE_OFFSET; } } @@ -1298,7 +1301,8 @@ void BKE_fcurve_handles_recalc_ex(FCurve *fcu, eBezTriple_Flag handle_sel_flag) /* If cyclic extrapolation and Auto Clamp has triggered, ensure it is symmetric. */ if (cycle && (first->auto_handle_type != HD_AUTOTYPE_NORMAL || - last->auto_handle_type != HD_AUTOTYPE_NORMAL)) { + last->auto_handle_type != HD_AUTOTYPE_NORMAL)) + { first->vec[0][1] = first->vec[2][1] = first->vec[1][1]; last->vec[0][1] = last->vec[2][1] = last->vec[1][1]; first->auto_handle_type = last->auto_handle_type = HD_AUTOTYPE_LOCKED_FINAL; @@ -1634,7 +1638,8 @@ bool BKE_fcurve_bezt_subdivide_handles(struct BezTriple *bezt, prev_handle_right[0], next_handle_left[0], next_coords[0], - roots)) { + roots)) + { return false; } @@ -1935,7 +1940,8 @@ static float fcurve_eval_keyframes_extrapolate( direction_to_neighbor; /* The second (to last) keyframe. */ if (endpoint_bezt->ipo == BEZT_IPO_CONST || fcu->extend == FCURVE_EXTRAPOLATE_CONSTANT || - (fcu->flag & FCURVE_DISCRETE_VALUES) != 0) { + (fcu->flag & FCURVE_DISCRETE_VALUES) != 0) + { /* Constant (BEZT_IPO_HORIZ) extrapolation or constant interpolation, so just extend the * endpoint's value. */ return endpoint_bezt->vec[1][1]; @@ -2035,8 +2041,8 @@ static float fcurve_eval_keyframes_interpolate(const FCurve *fcu, const float period = prevbezt->period; /* Value depends on interpolation mode. */ - if ((prevbezt->ipo == BEZT_IPO_CONST) || (fcu->flag & FCURVE_DISCRETE_VALUES) || - (duration == 0)) { + if ((prevbezt->ipo == BEZT_IPO_CONST) || (fcu->flag & FCURVE_DISCRETE_VALUES) || (duration == 0)) + { /* Constant (evaltime not relevant, so no interpolation needed). */ return prevbezt->vec[1][1]; } @@ -2059,7 +2065,8 @@ static float fcurve_eval_keyframes_interpolate(const FCurve *fcu, v4[1] = bezt->vec[1][1]; if (fabsf(v1[1] - v4[1]) < FLT_EPSILON && fabsf(v2[1] - v3[1]) < FLT_EPSILON && - fabsf(v3[1] - v4[1]) < FLT_EPSILON) { + fabsf(v3[1] - v4[1]) < FLT_EPSILON) + { /* Optimization: If all the handles are flat/at the same values, * the value is simply the shared value (see #40372 -> F91346). */ @@ -2372,7 +2379,8 @@ float evaluate_fcurve_driver(PathResolvedRNA *anim_rna, LISTBASE_FOREACH (FModifier *, fcm, &fcu->modifiers) { /* If there are range-restrictions, we must definitely block #36950. */ if ((fcm->flag & FMODIFIER_FLAG_RANGERESTRICT) == 0 || - (fcm->sfra <= evaltime && fcm->efra >= evaltime)) { + (fcm->sfra <= evaltime && fcm->efra >= evaltime)) + { /* Within range: here it probably doesn't matter, * though we'd want to check on additive. */ } diff --git a/source/blender/blenkernel/intern/fcurve_driver.c b/source/blender/blenkernel/intern/fcurve_driver.c index eba37751072..d7705dc7e81 100644 --- a/source/blender/blenkernel/intern/fcurve_driver.c +++ b/source/blender/blenkernel/intern/fcurve_driver.c @@ -177,7 +177,8 @@ static float dtar_get_prop_val(const AnimationEvalContext *anim_eval_context, int index = -1; float value = 0.0f; if (!RNA_path_resolve_property_full( - &property_ptr, dtar->rna_path, &value_ptr, &value_prop, &index)) { + &property_ptr, dtar->rna_path, &value_ptr, &value_prop, &index)) + { /* Path couldn't be resolved. */ if (G.debug & G_DEBUG) { CLOG_ERROR(&LOG, @@ -704,7 +705,8 @@ void BKE_driver_target_matrix_to_rot_channels( } } else if (rotation_mode >= DTAR_ROTMODE_SWING_TWIST_X && - rotation_mode <= DTAR_ROTMODE_SWING_TWIST_Z) { + rotation_mode <= DTAR_ROTMODE_SWING_TWIST_Z) + { int axis = rotation_mode - DTAR_ROTMODE_SWING_TWIST_X; float raw_quat[4], twist; @@ -1323,7 +1325,8 @@ static void evaluate_driver_python(PathResolvedRNA *anim_rna, driver, driver_orig, &driver->curval, - anim_eval_context->eval_time)) { + anim_eval_context->eval_time)) + { #ifdef WITH_PYTHON /* This evaluates the expression using Python, and returns its result: * - on errors it reports, then returns 0.0f. */ diff --git a/source/blender/blenkernel/intern/fluid.cc b/source/blender/blenkernel/intern/fluid.cc index a45bf709b31..61871020ad5 100644 --- a/source/blender/blenkernel/intern/fluid.cc +++ b/source/blender/blenkernel/intern/fluid.cc @@ -432,7 +432,8 @@ static void manta_set_domain_from_mesh(FluidDomainSettings *fds, /* Prevent crash when initializing a plane as domain. */ if (!init_resolution || (size[0] < FLT_EPSILON) || (size[1] < FLT_EPSILON) || - (size[2] < FLT_EPSILON)) { + (size[2] < FLT_EPSILON)) + { return; } @@ -498,7 +499,8 @@ static bool fluid_modifier_init( /* Set resolutions. */ if (fmd->domain->type == FLUID_DOMAIN_TYPE_GAS && - fmd->domain->flags & FLUID_DOMAIN_USE_ADAPTIVE_DOMAIN) { + fmd->domain->flags & FLUID_DOMAIN_USE_ADAPTIVE_DOMAIN) + { res[0] = res[1] = res[2] = 1; /* Use minimum res for adaptive init. */ } else { @@ -615,7 +617,8 @@ static bool is_static_object(Object *ob) eModifierType_Ocean, eModifierType_ShapeKey, eModifierType_Softbody, - eModifierType_Nodes)) { + eModifierType_Nodes)) + { return false; } } @@ -751,7 +754,8 @@ static void bb_combineMaps(FluidObjectBB *output, /* Initialize with first input if in range. */ if (x >= bb1.min[0] && x < bb1.max[0] && y >= bb1.min[1] && y < bb1.max[1] && - z >= bb1.min[2] && z < bb1.max[2]) { + z >= bb1.min[2] && z < bb1.max[2]) + { int index_in = manta_get_index( x - bb1.min[0], bb1.res[0], y - bb1.min[1], bb1.res[1], z - bb1.min[2]); @@ -768,7 +772,8 @@ static void bb_combineMaps(FluidObjectBB *output, /* Apply second input if in range. */ if (x >= bb2->min[0] && x < bb2->max[0] && y >= bb2->min[1] && y < bb2->max[1] && - z >= bb2->min[2] && z < bb2->max[2]) { + z >= bb2->min[2] && z < bb2->max[2]) + { int index_in = manta_get_index( x - bb2->min[0], bb2->res[0], y - bb2->min[1], bb2->res[1], z - bb2->min[2]); @@ -861,7 +866,8 @@ static void update_velocities(FluidEffectorSettings *fes, /* Find the nearest point on the mesh. */ if (has_velocity && BLI_bvhtree_find_nearest( - tree_data->tree, ray_start, &nearest, tree_data->nearest_callback, tree_data) != -1) { + tree_data->tree, ray_start, &nearest, tree_data->nearest_callback, tree_data) != -1) + { float weights[3]; int v1, v2, v3, f_index = nearest.index; @@ -1707,7 +1713,8 @@ static void update_distances(int index, } if (BLI_bvhtree_find_nearest( - tree_data->tree, ray_start, &nearest, tree_data->nearest_callback, tree_data) != -1) { + tree_data->tree, ray_start, &nearest, tree_data->nearest_callback, tree_data) != -1) + { float ray[3] = {0}; sub_v3_v3v3(ray, ray_start, nearest.co); min_dist = len_v3(ray); @@ -1837,7 +1844,8 @@ static void sample_mesh(FluidFlowSettings *ffs, 0.0f, &hit, tree_data->raycast_callback, - tree_data) != -1) { + tree_data) != -1) + { float dot = ray_dir[0] * hit.no[0] + ray_dir[1] * hit.no[1] + ray_dir[2] * hit.no[2]; /* If ray and hit face normal are facing same direction hit point is inside a closed mesh. */ if (dot >= 0) { @@ -1863,7 +1871,8 @@ static void sample_mesh(FluidFlowSettings *ffs, /* Find the nearest point on the mesh. */ if (BLI_bvhtree_find_nearest( - tree_data->tree, ray_start, &nearest, tree_data->nearest_callback, tree_data) != -1) { + tree_data->tree, ray_start, &nearest, tree_data->nearest_callback, tree_data) != -1) + { float weights[3]; int v1, v2, v3, f_index = nearest.index; float hit_normal[3]; @@ -2553,10 +2562,10 @@ static void ensure_flowsfields(FluidDomainSettings *fds) /* Initialize all smoke with "active_color". */ manta_smoke_ensure_colors(fds->fluid, fds->fmd); } - if (fds->type == FLUID_DOMAIN_TYPE_LIQUID && - (fds->particle_type & FLUID_DOMAIN_PARTICLE_SPRAY || - fds->particle_type & FLUID_DOMAIN_PARTICLE_FOAM || - fds->particle_type & FLUID_DOMAIN_PARTICLE_TRACER)) { + if (fds->type == FLUID_DOMAIN_TYPE_LIQUID && (fds->particle_type & FLUID_DOMAIN_PARTICLE_SPRAY || + fds->particle_type & FLUID_DOMAIN_PARTICLE_FOAM || + fds->particle_type & FLUID_DOMAIN_PARTICLE_TRACER)) + { manta_liquid_ensure_sndparts(fds->fluid, fds->fmd); } manta_update_pointers(fds->fluid, fds->fmd, false); @@ -2610,12 +2619,13 @@ static void update_flowsflags(FluidDomainSettings *fds, Object **flowobjs, int n } /* Activate fuel field if a flow object is of fire type. */ if (ffs->fuel_amount != 0.0 || ffs->type == FLUID_FLOW_TYPE_FIRE || - ffs->type == FLUID_FLOW_TYPE_SMOKEFIRE) { + ffs->type == FLUID_FLOW_TYPE_SMOKEFIRE) + { active_fields |= FLUID_DOMAIN_ACTIVE_FIRE; } /* Activate color field if flows add smoke with varying colors. */ - if (ffs->density != 0.0 && - ELEM(ffs->type, FLUID_FLOW_TYPE_SMOKE, FLUID_FLOW_TYPE_SMOKEFIRE)) { + if (ffs->density != 0.0 && ELEM(ffs->type, FLUID_FLOW_TYPE_SMOKE, FLUID_FLOW_TYPE_SMOKEFIRE)) + { if (!(active_fields & FLUID_DOMAIN_ACTIVE_COLOR_SET)) { copy_v3_v3(fds->active_color, ffs->color); active_fields |= FLUID_DOMAIN_ACTIVE_COLOR_SET; @@ -3654,13 +3664,15 @@ static void fluid_modifier_processDomain(FluidModifierData *fmd, case FLUID_DOMAIN_CACHE_MODULAR: if (fds->cache_frame_offset > 0) { if (scene_framenr < fds->cache_frame_start || - scene_framenr > fds->cache_frame_end + fds->cache_frame_offset) { + scene_framenr > fds->cache_frame_end + fds->cache_frame_offset) + { escape = true; } } else { if (scene_framenr < fds->cache_frame_start + fds->cache_frame_offset || - scene_framenr > fds->cache_frame_end) { + scene_framenr > fds->cache_frame_end) + { escape = true; } } @@ -4097,7 +4109,8 @@ Mesh *BKE_fluid_modifier_do( baking_guide = fds->cache_flag & FLUID_DOMAIN_BAKING_GUIDE; if (with_mesh && !baking_data && !baking_noise && !baking_mesh && !baking_particles && - !baking_guide) { + !baking_guide) + { needs_viewport_update = true; } } @@ -4613,7 +4626,8 @@ void BKE_fluid_fields_sanitize(FluidDomainSettings *settings) FLUID_DOMAIN_FIELD_PHI, FLUID_DOMAIN_FIELD_PHI_IN, FLUID_DOMAIN_FIELD_PHI_OUT, - FLUID_DOMAIN_FIELD_PHI_OBSTACLE)) { + FLUID_DOMAIN_FIELD_PHI_OBSTACLE)) + { /* Defaulted to density for gas domain. */ settings->coba_field = FLUID_DOMAIN_FIELD_DENSITY; } @@ -4631,7 +4645,8 @@ void BKE_fluid_fields_sanitize(FluidDomainSettings *settings) FLUID_DOMAIN_FIELD_DENSITY, FLUID_DOMAIN_FIELD_FLAME, FLUID_DOMAIN_FIELD_FUEL, - FLUID_DOMAIN_FIELD_HEAT)) { + FLUID_DOMAIN_FIELD_HEAT)) + { /* Defaulted to phi for liquid domain. */ settings->coba_field = FLUID_DOMAIN_FIELD_PHI; } diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c index ae9b0f5e558..486eba9c274 100644 --- a/source/blender/blenkernel/intern/fmodifier.c +++ b/source/blender/blenkernel/intern/fmodifier.c @@ -1426,7 +1426,8 @@ float evaluate_time_fmodifiers(FModifiersStackStorage *storage, * (whatever scale it is on, it won't affect the results) * hence we shouldn't bother seeing what it would do given the chance. */ if ((fcm->flag & FMODIFIER_FLAG_RANGERESTRICT) == 0 || - ((fcm->sfra <= evaltime) && (fcm->efra >= evaltime))) { + ((fcm->sfra <= evaltime) && (fcm->efra >= evaltime))) + { /* only evaluate if there's a callback for this */ if (fmi->evaluate_modifier_time) { if ((fcm->flag & (FMODIFIER_FLAG_DISABLED | FMODIFIER_FLAG_MUTED)) == 0) { @@ -1475,7 +1476,8 @@ void evaluate_value_fmodifiers(FModifiersStackStorage *storage, /* Only evaluate if there's a callback for this, * and if F-Modifier can be evaluated on this frame. */ if ((fcm->flag & FMODIFIER_FLAG_RANGERESTRICT) == 0 || - ((fcm->sfra <= evaltime) && (fcm->efra >= evaltime))) { + ((fcm->sfra <= evaltime) && (fcm->efra >= evaltime))) + { if (fmi->evaluate_modifier) { if ((fcm->flag & (FMODIFIER_FLAG_DISABLED | FMODIFIER_FLAG_MUTED)) == 0) { void *storage_ptr = POINTER_OFFSET(storage->buffer, diff --git a/source/blender/blenkernel/intern/freestyle.c b/source/blender/blenkernel/intern/freestyle.c index db14d5069d6..afb32c4b50c 100644 --- a/source/blender/blenkernel/intern/freestyle.c +++ b/source/blender/blenkernel/intern/freestyle.c @@ -228,7 +228,8 @@ short BKE_freestyle_lineset_get_active_index(FreestyleConfig *config) short i; for (lineset = (FreestyleLineSet *)config->linesets.first, i = 0; lineset; - lineset = lineset->next, i++) { + lineset = lineset->next, i++) + { if (lineset->flags & FREESTYLE_LINESET_CURRENT) { return i; } @@ -242,7 +243,8 @@ void BKE_freestyle_lineset_set_active_index(FreestyleConfig *config, short index short i; for (lineset = (FreestyleLineSet *)config->linesets.first, i = 0; lineset; - lineset = lineset->next, i++) { + lineset = lineset->next, i++) + { if (i == index) { lineset->flags |= FREESTYLE_LINESET_CURRENT; } diff --git a/source/blender/blenkernel/intern/geometry_fields.cc b/source/blender/blenkernel/intern/geometry_fields.cc index ee86d2d0792..9eafdbf9177 100644 --- a/source/blender/blenkernel/intern/geometry_fields.cc +++ b/source/blender/blenkernel/intern/geometry_fields.cc @@ -138,22 +138,25 @@ GVArray GeometryFieldInput::get_varray_for_context(const fn::FieldContext &conte ResourceScope & /*scope*/) const { if (const GeometryFieldContext *geometry_context = dynamic_cast( - &context)) { + &context)) + { return this->get_varray_for_context(*geometry_context, mask); } if (const MeshFieldContext *mesh_context = dynamic_cast(&context)) { return this->get_varray_for_context({mesh_context->mesh(), mesh_context->domain()}, mask); } - if (const CurvesFieldContext *curve_context = dynamic_cast( - &context)) { + if (const CurvesFieldContext *curve_context = dynamic_cast(&context)) + { return this->get_varray_for_context({curve_context->curves(), curve_context->domain()}, mask); } if (const PointCloudFieldContext *point_context = dynamic_cast( - &context)) { + &context)) + { return this->get_varray_for_context({point_context->pointcloud()}, mask); } if (const InstancesFieldContext *instances_context = dynamic_cast( - &context)) { + &context)) + { return this->get_varray_for_context({instances_context->instances()}, mask); } return {}; @@ -170,7 +173,8 @@ GVArray MeshFieldInput::get_varray_for_context(const fn::FieldContext &context, ResourceScope & /*scope*/) const { if (const GeometryFieldContext *geometry_context = dynamic_cast( - &context)) { + &context)) + { if (const Mesh *mesh = geometry_context->mesh()) { return this->get_varray_for_context(*mesh, geometry_context->domain(), mask); } @@ -191,7 +195,8 @@ GVArray CurvesFieldInput::get_varray_for_context(const fn::FieldContext &context ResourceScope & /*scope*/) const { if (const GeometryFieldContext *geometry_context = dynamic_cast( - &context)) { + &context)) + { if (const CurvesGeometry *curves = geometry_context->curves()) { return this->get_varray_for_context(*curves, geometry_context->domain(), mask); } @@ -214,13 +219,15 @@ GVArray PointCloudFieldInput::get_varray_for_context(const fn::FieldContext &con ResourceScope & /*scope*/) const { if (const GeometryFieldContext *geometry_context = dynamic_cast( - &context)) { + &context)) + { if (const PointCloud *pointcloud = geometry_context->pointcloud()) { return this->get_varray_for_context(*pointcloud, mask); } } if (const PointCloudFieldContext *point_context = dynamic_cast( - &context)) { + &context)) + { return this->get_varray_for_context(point_context->pointcloud(), mask); } return {}; @@ -231,13 +238,15 @@ GVArray InstancesFieldInput::get_varray_for_context(const fn::FieldContext &cont ResourceScope & /*scope*/) const { if (const GeometryFieldContext *geometry_context = dynamic_cast( - &context)) { + &context)) + { if (const Instances *instances = geometry_context->instances()) { return this->get_varray_for_context(*instances, mask); } } if (const InstancesFieldContext *instances_context = dynamic_cast( - &context)) { + &context)) + { return this->get_varray_for_context(instances_context->instances(), mask); } return {}; @@ -352,7 +361,8 @@ uint64_t AnonymousAttributeFieldInput::hash() const bool AnonymousAttributeFieldInput::is_equal_to(const fn::FieldNode &other) const { if (const AnonymousAttributeFieldInput *other_typed = - dynamic_cast(&other)) { + dynamic_cast(&other)) + { return anonymous_id_.get() == other_typed->anonymous_id_.get() && type_ == other_typed->type_; } return false; diff --git a/source/blender/blenkernel/intern/gpencil_curve_legacy.c b/source/blender/blenkernel/intern/gpencil_curve_legacy.c index c6a1cb1474a..be6ca7e4ec4 100644 --- a/source/blender/blenkernel/intern/gpencil_curve_legacy.c +++ b/source/blender/blenkernel/intern/gpencil_curve_legacy.c @@ -157,7 +157,8 @@ static Material *gpencil_add_from_curve_material(Main *bmain, /* Check at least one is enabled. */ if (((gp_style->flag & GP_MATERIAL_STROKE_SHOW) == 0) && - ((gp_style->flag & GP_MATERIAL_FILL_SHOW) == 0)) { + ((gp_style->flag & GP_MATERIAL_FILL_SHOW) == 0)) + { gp_style->flag |= GP_MATERIAL_STROKE_SHOW; } @@ -1123,7 +1124,8 @@ void BKE_gpencil_editcurve_recalculate_handles(bGPDstroke *gps) bGPDcurve_point *gpc_pt_next = &gpc->curve_points[i + 1]; /* update handle if point or neighbor is selected */ if (gpc_pt->flag & GP_CURVE_POINT_SELECT || gpc_pt_prev->flag & GP_CURVE_POINT_SELECT || - gpc_pt_next->flag & GP_CURVE_POINT_SELECT) { + gpc_pt_next->flag & GP_CURVE_POINT_SELECT) + { BezTriple *bezt = &gpc_pt->bezt; BezTriple *bezt_prev = &gpc_pt_prev->bezt; BezTriple *bezt_next = &gpc_pt_next->bezt; diff --git a/source/blender/blenkernel/intern/gpencil_geom_legacy.cc b/source/blender/blenkernel/intern/gpencil_geom_legacy.cc index 86caad72296..9b65e6b00be 100644 --- a/source/blender/blenkernel/intern/gpencil_geom_legacy.cc +++ b/source/blender/blenkernel/intern/gpencil_geom_legacy.cc @@ -315,7 +315,8 @@ static int stroke_march_next_point_no_interp(const bGPDstroke *gps, if (next_point_index < gps->totpoints - 1 && angle_v3v3v3(&gps->points[next_point_index - 1].x, &gps->points[next_point_index].x, - &gps->points[next_point_index + 1].x) < sharp_threshold) { + &gps->points[next_point_index + 1].x) < sharp_threshold) + { copy_v3_v3(result, &pt->x); pt->flag |= GP_SPOINT_TEMP_TAG; next_point_index++; @@ -367,7 +368,8 @@ static int stroke_march_count(const bGPDstroke *gps, const float dist, const flo } while ((next_point_index = stroke_march_next_point_no_interp( - gps, next_point_index, point, dist, sharp_threshold, point)) > -1) { + gps, next_point_index, point, dist, sharp_threshold, point)) > -1) + { point_count++; if (next_point_index == 0) { break; /* last point finished */ @@ -523,7 +525,8 @@ bool BKE_gpencil_stroke_sample(bGPdata *gpd, &uv_rot, &ratio_result, &index_from, - &index_to)) > -1) { + &index_to)) > -1) + { if (is_cyclic && next_point_index == 0) { break; /* last point finished */ } @@ -2306,7 +2309,8 @@ void BKE_gpencil_stroke_subdivide(bGPdata *gpd, bGPDstroke *gps, int level, int float mid[3]; /* extreme points are not changed */ for (int i = cyclic ? 0 : 2, j = cyclic ? gps->totpoints - 2 : 0; i < gps->totpoints - 2; - j = i, i += 2) { + j = i, i += 2) + { bGPDspoint *prev = &gps->points[j + 1]; bGPDspoint *pt = &gps->points[i]; bGPDspoint *next = &gps->points[i + 1]; @@ -2655,7 +2659,8 @@ static Material *gpencil_add_material(Main *bmain, /* Check at least one is enabled. */ if (((gp_style->flag & GP_MATERIAL_STROKE_SHOW) == 0) && - ((gp_style->flag & GP_MATERIAL_FILL_SHOW) == 0)) { + ((gp_style->flag & GP_MATERIAL_FILL_SHOW) == 0)) + { gp_style->flag |= GP_MATERIAL_STROKE_SHOW; } @@ -2705,7 +2710,8 @@ bool BKE_gpencil_convert_mesh(Main *bmain, using namespace blender; using namespace blender::bke; if (ELEM(nullptr, ob_gp, ob_mesh) || (ob_gp->type != OB_GPENCIL_LEGACY) || - (ob_gp->data == nullptr)) { + (ob_gp->data == nullptr)) + { return false; } diff --git a/source/blender/blenkernel/intern/gpencil_legacy.c b/source/blender/blenkernel/intern/gpencil_legacy.c index 26528558f4a..6a889cc20f3 100644 --- a/source/blender/blenkernel/intern/gpencil_legacy.c +++ b/source/blender/blenkernel/intern/gpencil_legacy.c @@ -1383,7 +1383,8 @@ bGPDframe *BKE_gpencil_layer_frame_get(bGPDlayer *gpl, int cframe, eGP_GetFrame_ /* Don't select first frame if greater than current frame. */ if ((gpl->actframe != NULL) && (gpl->actframe == gpl->frames.first) && - (gpl->actframe->framenum > cframe)) { + (gpl->actframe->framenum > cframe)) + { gpl->actframe = NULL; } @@ -1673,7 +1674,8 @@ Material *BKE_gpencil_brush_material_get(Brush *brush) Material *ma = NULL; if ((brush != NULL) && (brush->gpencil_settings != NULL) && - (brush->gpencil_settings->material != NULL)) { + (brush->gpencil_settings->material != NULL)) + { ma = brush->gpencil_settings->material; } @@ -1744,7 +1746,8 @@ Material *BKE_gpencil_object_material_new(Main *bmain, Object *ob, const char *n Material *BKE_gpencil_object_material_from_brush_get(Object *ob, Brush *brush) { if ((brush) && (brush->gpencil_settings) && - (brush->gpencil_settings->flag & GP_BRUSH_MATERIAL_PINNED)) { + (brush->gpencil_settings->flag & GP_BRUSH_MATERIAL_PINNED)) + { Material *ma = BKE_gpencil_brush_material_get(brush); return ma; } @@ -1878,7 +1881,8 @@ void BKE_gpencil_vgroup_remove(Object *ob, bDeformGroup *defgroup) } /* Keep a valid active index if we still have some vertex groups. */ if (!BLI_listbase_is_empty(&gpd->vertex_group_names) && - BKE_object_defgroup_active_index_get(ob) < 1) { + BKE_object_defgroup_active_index_get(ob) < 1) + { BKE_object_defgroup_active_index_set(ob, 1); } @@ -2022,7 +2026,8 @@ bool BKE_gpencil_merge_materials_table_get(Object *ob, } for (int idx_secondary = 0; idx_secondary < *totcol; idx_secondary++) { if ((idx_secondary == idx_primary) || - BLI_ghash_haskey(r_mat_table, POINTER_FROM_INT(idx_secondary))) { + BLI_ghash_haskey(r_mat_table, POINTER_FROM_INT(idx_secondary))) + { continue; } if (BLI_ghash_haskey(mat_used, POINTER_FROM_INT(idx_secondary))) { @@ -2031,15 +2036,16 @@ bool BKE_gpencil_merge_materials_table_get(Object *ob, /* Read secondary material to compare with primary material. */ ma_secondary = BKE_gpencil_material(ob, idx_secondary + 1); - if ((ma_secondary == NULL) || - BLI_ghash_haskey(r_mat_table, POINTER_FROM_INT(idx_secondary))) { + if ((ma_secondary == NULL) || BLI_ghash_haskey(r_mat_table, POINTER_FROM_INT(idx_secondary))) + { continue; } gp_style_primary = ma_primary->gp_style; gp_style_secondary = ma_secondary->gp_style; if ((gp_style_primary == NULL) || (gp_style_secondary == NULL) || - (gp_style_secondary->flag & GP_MATERIAL_LOCKED)) { + (gp_style_secondary->flag & GP_MATERIAL_LOCKED)) + { continue; } @@ -2050,18 +2056,21 @@ bool BKE_gpencil_merge_materials_table_get(Object *ob, /* Check materials have same stroke and fill attributes. */ if ((gp_style_primary->flag & GP_MATERIAL_STROKE_SHOW) != - (gp_style_secondary->flag & GP_MATERIAL_STROKE_SHOW)) { + (gp_style_secondary->flag & GP_MATERIAL_STROKE_SHOW)) + { continue; } if ((gp_style_primary->flag & GP_MATERIAL_FILL_SHOW) != - (gp_style_secondary->flag & GP_MATERIAL_FILL_SHOW)) { + (gp_style_secondary->flag & GP_MATERIAL_FILL_SHOW)) + { continue; } /* Check materials have the same type. */ if ((gp_style_primary->stroke_style != gp_style_secondary->stroke_style) || - (gp_style_primary->fill_style != gp_style_secondary->fill_style)) { + (gp_style_primary->fill_style != gp_style_secondary->fill_style)) + { continue; } @@ -2092,7 +2101,8 @@ bool BKE_gpencil_merge_materials_table_get(Object *ob, gp_style_secondary->stroke_rgba[3], val_threshold) || !compare_ff( - gp_style_primary->fill_rgba[3], gp_style_secondary->fill_rgba[3], val_threshold)) { + gp_style_primary->fill_rgba[3], gp_style_secondary->fill_rgba[3], val_threshold)) + { continue; } @@ -2463,7 +2473,8 @@ void BKE_gpencil_visible_stroke_advanced_iter(ViewLayer *view_layer, * generate renders, putting only selected GP layers for each View Layer. * This is used only in final render and never in Viewport. */ if ((view_layer != NULL) && (gpl->viewlayername[0] != '\0') && - !STREQ(view_layer->name, gpl->viewlayername)) { + !STREQ(view_layer->name, gpl->viewlayername)) + { /* Do not skip masks when rendering the view-layer so that it can still be used to clip * other layers. Instead set their opacity to zero. */ if (gpencil_is_layer_mask(view_layer, gpd, gpl)) { @@ -2843,7 +2854,8 @@ int BKE_gpencil_material_find_index_by_name_prefix(Object *ob, const char *name_ for (int i = 0; i < ob->totcol; i++) { Material *ma = BKE_object_material_get(ob, i + 1); if ((ma != NULL) && (ma->gp_style != NULL) && - STREQLEN(ma->id.name + 2, name_prefix, name_prefix_len)) { + STREQLEN(ma->id.name + 2, name_prefix, name_prefix_len)) + { return i; } } @@ -2863,7 +2875,8 @@ void BKE_gpencil_frame_selected_hash(bGPdata *gpd, struct GHash *r_list) LISTBASE_FOREACH (bGPDframe *, gpf, &gpl_iter->frames) { if (((gpf == gpl->actframe) && (!is_multiedit)) || - ((gpf->flag & GP_FRAME_SELECT) && (is_multiedit))) { + ((gpf->flag & GP_FRAME_SELECT) && (is_multiedit))) + { if (!BLI_ghash_lookup(r_list, POINTER_FROM_INT(gpf->framenum))) { BLI_ghash_insert(r_list, POINTER_FROM_INT(gpf->framenum), gpf); } diff --git a/source/blender/blenkernel/intern/gpencil_modifier_legacy.c b/source/blender/blenkernel/intern/gpencil_modifier_legacy.c index 0fe854a7c3b..af6954d4cd1 100644 --- a/source/blender/blenkernel/intern/gpencil_modifier_legacy.c +++ b/source/blender/blenkernel/intern/gpencil_modifier_legacy.c @@ -201,7 +201,8 @@ bool BKE_gpencil_has_transform_modifiers(Object *ob) eGpencilModifierType_Armature, eGpencilModifierType_Hook, eGpencilModifierType_Lattice, - eGpencilModifierType_Offset)) { + eGpencilModifierType_Offset)) + { return true; } } @@ -435,7 +436,8 @@ const GpencilModifierTypeInfo *BKE_gpencil_modifier_get_info(GpencilModifierType { /* type unsigned, no need to check < 0 */ if (type < NUM_GREASEPENCIL_MODIFIER_TYPES && type > 0 && - modifier_gpencil_types[type]->name[0] != '\0') { + modifier_gpencil_types[type]->name[0] != '\0') + { return modifier_gpencil_types[type]; } diff --git a/source/blender/blenkernel/intern/icons.cc b/source/blender/blenkernel/intern/icons.cc index ec8111a0359..9a32d713f20 100644 --- a/source/blender/blenkernel/intern/icons.cc +++ b/source/blender/blenkernel/intern/icons.cc @@ -221,7 +221,8 @@ void BKE_icons_deferred_free() for (DeferredIconDeleteNode *node = (DeferredIconDeleteNode *)BLI_linklist_lockfree_begin(&g_icon_delete_queue); node != nullptr; - node = node->next) { + node = node->next) + { BLI_ghash_remove(gIcons, POINTER_FROM_INT(node->icon_id), nullptr, icon_free); } BLI_linklist_lockfree_clear(&g_icon_delete_queue, MEM_freeN); diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c index 38e8e111fa0..5578fbfd106 100644 --- a/source/blender/blenkernel/intern/idprop.c +++ b/source/blender/blenkernel/intern/idprop.c @@ -529,7 +529,8 @@ void IDP_SyncGroupTypes(IDProperty *dest, const IDProperty *src, const bool do_a /* check of we should replace? */ if ((prop_dst->type != prop_src->type || prop_dst->subtype != prop_src->subtype) || (do_arraylen && ELEM(prop_dst->type, IDP_ARRAY, IDP_IDPARRAY) && - (prop_src->len != prop_dst->len))) { + (prop_src->len != prop_dst->len))) + { BLI_insertlinkreplace(&dest->data.group, prop_dst, IDP_CopyProperty(prop_src)); IDP_FreeProperty(prop_dst); } @@ -1556,7 +1557,8 @@ eIDPropertyUIDataType IDP_ui_data_type(const IDProperty *prop) return IDP_UI_DATA_TYPE_INT; } if (ELEM(prop->type, IDP_FLOAT, IDP_DOUBLE) || - (prop->type == IDP_ARRAY && ELEM(prop->subtype, IDP_FLOAT, IDP_DOUBLE))) { + (prop->type == IDP_ARRAY && ELEM(prop->subtype, IDP_FLOAT, IDP_DOUBLE))) + { return IDP_UI_DATA_TYPE_FLOAT; } if (prop->type == IDP_BOOLEAN || (prop->type == IDP_ARRAY && prop->subtype == IDP_BOOLEAN)) { diff --git a/source/blender/blenkernel/intern/idtype.c b/source/blender/blenkernel/intern/idtype.c index 030bf9cb604..501588fc55e 100644 --- a/source/blender/blenkernel/intern/idtype.c +++ b/source/blender/blenkernel/intern/idtype.c @@ -114,7 +114,8 @@ const IDTypeInfo *BKE_idtype_get_info_from_idcode(const short id_code) int id_index = BKE_idtype_idcode_to_index(id_code); if (id_index >= 0 && id_index < ARRAY_SIZE(id_types) && id_types[id_index] != NULL && - id_types[id_index]->name[0] != '\0') { + id_types[id_index]->name[0] != '\0') + { return id_types[id_index]; } diff --git a/source/blender/blenkernel/intern/image.cc b/source/blender/blenkernel/intern/image.cc index d6a5000405c..34432c8db80 100644 --- a/source/blender/blenkernel/intern/image.cc +++ b/source/blender/blenkernel/intern/image.cc @@ -280,7 +280,8 @@ static void image_foreach_path(ID *id, BPathForeachPathData *bpath_data) * once to give it a meaningful value. */ /* TODO re-assess whether this behavior is desired in the new generic code context. */ if (!ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_MOVIE, IMA_SRC_SEQUENCE, IMA_SRC_TILED) || - ima->filepath[0] == '\0') { + ima->filepath[0] == '\0') + { return; } @@ -314,7 +315,8 @@ static void image_foreach_path(ID *id, BPathForeachPathData *bpath_data) if (flag & BKE_BPATH_FOREACH_PATH_RELOAD_EDITED) { if (!BKE_image_has_packedfile(ima) && /* Image may have been painted onto (and not saved, #44543). */ - !BKE_image_is_dirty(ima)) { + !BKE_image_is_dirty(ima)) + { BKE_image_signal(bpath_data->bmain, ima, nullptr, IMA_SIGNAL_RELOAD); } } @@ -361,8 +363,8 @@ static void image_blend_write(BlendWriter *writer, ID *id, const void *id_addres BLO_write_id_struct(writer, Image, id_address, &ima->id); BKE_id_blend_write(writer, &ima->id); - for (imapf = static_cast(ima->packedfiles.first); imapf; - imapf = imapf->next) { + for (imapf = static_cast(ima->packedfiles.first); imapf; imapf = imapf->next) + { BLO_write_struct(writer, ImagePackedFile, imapf); BKE_packedfile_blend_write(writer, imapf->packedfile); } @@ -726,7 +728,8 @@ static void copy_image_packedfiles(ListBase *lb_dst, const ListBase *lb_src) BLI_listbase_clear(lb_dst); for (imapf_src = static_cast(lb_src->first); imapf_src; - imapf_src = imapf_src->next) { + imapf_src = imapf_src->next) + { ImagePackedFile *imapf_dst = static_cast( MEM_mallocN(sizeof(ImagePackedFile), "Image Packed Files (copy)")); @@ -1054,7 +1057,8 @@ Image *BKE_image_load_exists_ex(Main *bmain, const char *filepath, bool *r_exist /* first search an identical filepath */ for (ima = static_cast(bmain->images.first); ima; - ima = static_cast(ima->id.next)) { + ima = static_cast(ima->id.next)) + { if (!ELEM(ima->source, IMA_SRC_VIEWER, IMA_SRC_GENERATED)) { STRNCPY(strtest, ima->filepath); BLI_path_abs(strtest, ID_BLEND_PATH(bmain, &ima->id)); @@ -1536,14 +1540,16 @@ void BKE_image_print_memlist(Main *bmain) uintptr_t size, totsize = 0; for (ima = static_cast(bmain->images.first); ima; - ima = static_cast(ima->id.next)) { + ima = static_cast(ima->id.next)) + { totsize += image_mem_size(ima); } printf("\ntotal image memory len: %.3f MB\n", double(totsize) / double(1024 * 1024)); for (ima = static_cast(bmain->images.first); ima; - ima = static_cast(ima->id.next)) { + ima = static_cast(ima->id.next)) + { size = image_mem_size(ima); if (size) { @@ -1571,7 +1577,8 @@ void BKE_image_free_all_textures(Main *bmain) #endif for (ima = static_cast(bmain->images.first); ima; - ima = static_cast(ima->id.next)) { + ima = static_cast(ima->id.next)) + { ima->id.tag &= ~LIB_TAG_DOIT; } @@ -1583,7 +1590,8 @@ void BKE_image_free_all_textures(Main *bmain) } for (ima = static_cast(bmain->images.first); ima; - ima = static_cast(ima->id.next)) { + ima = static_cast(ima->id.next)) + { if (ima->cache && (ima->id.tag & LIB_TAG_DOIT)) { #ifdef CHECK_FREED_SIZE uintptr_t old_size = image_mem_size(ima); @@ -1625,7 +1633,8 @@ void BKE_image_all_free_anim_ibufs(Main *bmain, int cfra) Image *ima; for (ima = static_cast(bmain->images.first); ima; - ima = static_cast(ima->id.next)) { + ima = static_cast(ima->id.next)) + { if (BKE_image_is_animated(ima)) { BKE_image_free_anim_ibufs(ima, cfra); } @@ -2656,7 +2665,8 @@ Image *BKE_image_ensure_viewer(Main *bmain, int type, const char *name) Image *ima; for (ima = static_cast(bmain->images.first); ima; - ima = static_cast(ima->id.next)) { + ima = static_cast(ima->id.next)) + { if (ima->source == IMA_SRC_VIEWER) { if (ima->type == type) { break; @@ -2893,47 +2903,56 @@ void BKE_image_walk_all_users( void callback(Image *ima, ID *iuser_id, ImageUser *iuser, void *customdata)) { for (Scene *scene = static_cast(mainp->scenes.first); scene; - scene = static_cast(scene->id.next)) { + scene = static_cast(scene->id.next)) + { image_walk_id_all_users(&scene->id, false, customdata, callback); } for (Object *ob = static_cast(mainp->objects.first); ob; - ob = static_cast(ob->id.next)) { + ob = static_cast(ob->id.next)) + { image_walk_id_all_users(&ob->id, false, customdata, callback); } for (bNodeTree *ntree = static_cast(mainp->nodetrees.first); ntree; - ntree = static_cast(ntree->id.next)) { + ntree = static_cast(ntree->id.next)) + { image_walk_id_all_users(&ntree->id, false, customdata, callback); } for (Material *ma = static_cast(mainp->materials.first); ma; - ma = static_cast(ma->id.next)) { + ma = static_cast(ma->id.next)) + { image_walk_id_all_users(&ma->id, false, customdata, callback); } for (Light *light = static_cast(mainp->materials.first); light; - light = static_cast(light->id.next)) { + light = static_cast(light->id.next)) + { image_walk_id_all_users(&light->id, false, customdata, callback); } for (World *world = static_cast(mainp->materials.first); world; - world = static_cast(world->id.next)) { + world = static_cast(world->id.next)) + { image_walk_id_all_users(&world->id, false, customdata, callback); } for (Tex *tex = static_cast(mainp->textures.first); tex; - tex = static_cast(tex->id.next)) { + tex = static_cast(tex->id.next)) + { image_walk_id_all_users(&tex->id, false, customdata, callback); } for (Camera *cam = static_cast(mainp->cameras.first); cam; - cam = static_cast(cam->id.next)) { + cam = static_cast(cam->id.next)) + { image_walk_id_all_users(&cam->id, false, customdata, callback); } for (wmWindowManager *wm = static_cast(mainp->wm.first); wm; - wm = static_cast(wm->id.next)) { /* only 1 wm */ + wm = static_cast(wm->id.next)) + { /* only 1 wm */ image_walk_id_all_users(&wm->id, false, customdata, callback); } } @@ -3251,8 +3270,8 @@ static RenderPass *image_render_pass_get(RenderLayer *rl, int rp_index = 0; const char *rp_name = ""; - for (rpass = static_cast(rl->passes.first); rpass; - rpass = rpass->next, rp_index++) { + for (rpass = static_cast(rl->passes.first); rpass; rpass = rpass->next, rp_index++) + { if (rp_index == pass) { rpass_ret = rpass; if (view == 0) { @@ -3321,8 +3340,8 @@ bool BKE_image_get_tile_info(char *filepath, ListBase *tiles, int *r_tile_start, continue; } - if (!BKE_image_get_tile_number_from_filepath( - dirs[i].relname, udim_pattern, tile_format, &id)) { + if (!BKE_image_get_tile_number_from_filepath(dirs[i].relname, udim_pattern, tile_format, &id)) + { continue; } @@ -3362,7 +3381,8 @@ ImageTile *BKE_image_add_tile(struct Image *ima, int tile_number, const char *la * We then insert before that to keep the list sorted. */ ImageTile *next_tile; for (next_tile = static_cast(ima->tiles.first); next_tile; - next_tile = next_tile->next) { + next_tile = next_tile->next) + { if (next_tile->tile_number == tile_number) { /* Tile already exists. */ return nullptr; @@ -4242,7 +4262,8 @@ static ImBuf *image_load_image_file( /* multi-views/multi-layers OpenEXR files directly populate ima, and return null ibuf... */ if (BKE_image_is_stereo(ima) && ima->views_format == R_IMF_VIEWS_STEREO_3D && ibuf_arr[0] && - tot_viewfiles == 1 && totviews >= 2) { + tot_viewfiles == 1 && totviews >= 2) + { IMB_ImBufFromStereo3d(ima->stereo3d_format, ibuf_arr[0], ibuf_arr.data(), &ibuf_arr[1]); } @@ -4842,7 +4863,8 @@ void BKE_image_pool_free(ImagePool *pool) BLI_mutex_lock(&pool->mutex); for (ImagePoolItem *item = static_cast(pool->image_buffers.first); item != nullptr; - item = item->next) { + item = item->next) + { if (item->ibuf != nullptr) { BLI_mutex_lock(static_cast(item->image->runtime.cache_mutex)); IMB_freeImBuf(item->ibuf); @@ -5090,7 +5112,8 @@ static void image_user_id_eval_animation(Image *ima, Depsgraph *depsgraph = (Depsgraph *)customdata; if ((iuser->flag & IMA_ANIM_ALWAYS) || (iuser->flag & IMA_NEED_FRAME_RECALC) || - (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER)) { + (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER)) + { float cfra = DEG_get_ctime(depsgraph); BKE_image_user_frame_calc(ima, iuser, cfra); @@ -5185,7 +5208,8 @@ void BKE_image_get_size(Image *image, ImageUser *iuser, int *r_width, int *r_hei *r_height = ibuf->y; } else if (image != nullptr && image->type == IMA_TYPE_R_RESULT && iuser != nullptr && - iuser->scene != nullptr) { + iuser->scene != nullptr) + { BKE_render_resolution(&iuser->scene->r, true, r_width, r_height); } else { diff --git a/source/blender/blenkernel/intern/image_format.cc b/source/blender/blenkernel/intern/image_format.cc index 9d134129c06..91f9c5cb457 100644 --- a/source/blender/blenkernel/intern/image_format.cc +++ b/source/blender/blenkernel/intern/image_format.cc @@ -415,7 +415,8 @@ static bool do_add_image_extension(char *string, R_IMF_IMTYPE_H264, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_XVID, - R_IMF_IMTYPE_AV1)) { + R_IMF_IMTYPE_AV1)) + { if (!BLI_path_extension_check(string, extension_test = ".png")) { extension = extension_test; } @@ -602,7 +603,8 @@ void BKE_image_format_to_imbuf(ImBuf *ibuf, const ImageFormatData *imf) R_IMF_IMTYPE_H264, R_IMF_IMTYPE_THEORA, R_IMF_IMTYPE_XVID, - R_IMF_IMTYPE_AV1)) { + R_IMF_IMTYPE_AV1)) + { ibuf->ftype = IMB_FTYPE_PNG; if (imtype == R_IMF_IMTYPE_PNG) { diff --git a/source/blender/blenkernel/intern/image_gen.c b/source/blender/blenkernel/intern/image_gen.c index aef64247346..9b05a7326d4 100644 --- a/source/blender/blenkernel/intern/image_gen.c +++ b/source/blender/blenkernel/intern/image_gen.c @@ -147,9 +147,11 @@ static void image_buf_fill_checker_slice( float h = 0.125f * floorf(x / checkerwidth); if ((abs((x % checkerwidth) - (checkerwidth / 2)) < 4) && - (abs((y % checkerwidth) - (checkerwidth / 2)) < 4)) { + (abs((y % checkerwidth) - (checkerwidth / 2)) < 4)) + { if ((abs((x % checkerwidth) - (checkerwidth / 2)) < 1) || - (abs((y % checkerwidth) - (checkerwidth / 2)) < 1)) { + (abs((y % checkerwidth) - (checkerwidth / 2)) < 1)) + { hsv[0] = fmodf(fabsf(h - hoffs), 1.0f); hsv_to_rgb_v(hsv, rgb); diff --git a/source/blender/blenkernel/intern/image_gpu.cc b/source/blender/blenkernel/intern/image_gpu.cc index 0dd1cd1f18f..9ac513f310b 100644 --- a/source/blender/blenkernel/intern/image_gpu.cc +++ b/source/blender/blenkernel/intern/image_gpu.cc @@ -345,7 +345,8 @@ void BKE_image_ensure_gpu_texture(Image *image, ImageUser *image_user) /* Note that the image can cache both stereo views, so we only invalidate the cache if the view * index is more than 2. */ if (image->gpu_pass != image_user->pass || image->gpu_layer != image_user->layer || - (image->gpu_view != image_user->multi_index && image_user->multi_index >= 2)) { + (image->gpu_view != image_user->multi_index && image_user->multi_index >= 2)) + { BKE_image_partial_update_mark_full_update(image); } } @@ -375,7 +376,8 @@ static GPUTexture *image_get_gpu_texture(Image *ima, requested_view = 0; } if (ima->gpu_pass != requested_pass || ima->gpu_layer != requested_layer || - ima->gpu_view != requested_view) { + ima->gpu_view != requested_view) + { ima->gpu_pass = requested_pass; ima->gpu_layer = requested_layer; ima->gpu_view = requested_view; @@ -769,7 +771,8 @@ static void gpu_texture_update_from_ibuf( /* Non-color data, just store buffer as is. */ } else if (IMB_colormanagement_space_is_srgb(ibuf->rect_colorspace) || - IMB_colormanagement_space_is_scene_linear(ibuf->rect_colorspace)) { + IMB_colormanagement_space_is_scene_linear(ibuf->rect_colorspace)) + { /* sRGB or scene linear, store as byte texture that the GPU can decode directly. */ rect = (uchar *)MEM_mallocN(sizeof(uchar[4]) * w * h, __func__); if (rect == nullptr) { @@ -881,7 +884,8 @@ void BKE_image_update_gputexture_delayed(struct Image *ima, { /* Check for full refresh. */ if (ibuf != nullptr && ima->source != IMA_SRC_TILED && x == 0 && y == 0 && w == ibuf->x && - h == ibuf->y) { + h == ibuf->y) + { BKE_image_partial_update_mark_full_update(ima); } else { diff --git a/source/blender/blenkernel/intern/image_partial_update_test.cc b/source/blender/blenkernel/intern/image_partial_update_test.cc index 29a13e28f71..04d6b288ef2 100644 --- a/source/blender/blenkernel/intern/image_partial_update_test.cc +++ b/source/blender/blenkernel/intern/image_partial_update_test.cc @@ -340,7 +340,8 @@ TEST_F(ImagePartialUpdateTest, mark_multiple_chunks) PartialUpdateRegion changed_region; int num_chunks_found = 0; while (BKE_image_partial_update_get_next_change(partial_update_user, &changed_region) == - ePartialUpdateIterResult::ChangeAvailable) { + ePartialUpdateIterResult::ChangeAvailable) + { BLI_rcti_isect(&changed_region.region, ®ion, nullptr); num_chunks_found++; } diff --git a/source/blender/blenkernel/intern/image_save.cc b/source/blender/blenkernel/intern/image_save.cc index 99fc6ff5923..c9e870bbecd 100644 --- a/source/blender/blenkernel/intern/image_save.cc +++ b/source/blender/blenkernel/intern/image_save.cc @@ -217,7 +217,8 @@ void BKE_image_save_options_update(ImageSaveOptions *opts, const Image *image) } else if (opts->im_format.imtype != opts->prev_imtype && !IMB_colormanagement_space_name_is_data( - opts->im_format.linear_colorspace_settings.name)) { + opts->im_format.linear_colorspace_settings.name)) + { const bool linear_float_output = BKE_imtype_requires_linear_float(opts->im_format.imtype); /* TODO: detect if the colorspace is linear, not just equal to scene linear. */ @@ -321,8 +322,9 @@ static void image_save_post(ReportList *reports, if (!opts->save_as_render || linear_float_output) { if (opts->im_format.linear_colorspace_settings.name[0] && - !BKE_color_managed_colorspace_settings_equals( - &ima->colorspace_settings, &opts->im_format.linear_colorspace_settings)) { + !BKE_color_managed_colorspace_settings_equals(&ima->colorspace_settings, + &opts->im_format.linear_colorspace_settings)) + { BKE_color_managed_colorspace_settings_copy(&ima->colorspace_settings, &opts->im_format.linear_colorspace_settings); *r_colorspace_changed = true; @@ -384,7 +386,8 @@ static bool image_save_single(ReportList *reports, /* TODO: better solution, if a 24bit image is painted onto it may contain alpha. */ if ((opts->im_format.planes == R_IMF_PLANES_RGBA) && /* it has been painted onto */ - (ibuf->userflags & IB_BITMAPDIRTY)) { + (ibuf->userflags & IB_BITMAPDIRTY)) + { /* checks each pixel, not ideal */ ibuf->planes = BKE_imbuf_alpha_test(ibuf) ? R_IMF_PLANES_RGBA : R_IMF_PLANES_RGB; } @@ -422,7 +425,8 @@ static bool image_save_single(ReportList *reports, /* It shouldn't ever happen. */ if ((BLI_findstring(&rr->views, STEREO_LEFT_NAME, offsetof(RenderView, name)) == nullptr) || - (BLI_findstring(&rr->views, STEREO_RIGHT_NAME, offsetof(RenderView, name)) == nullptr)) { + (BLI_findstring(&rr->views, STEREO_RIGHT_NAME, offsetof(RenderView, name)) == nullptr)) + { BKE_reportf(reports, RPT_ERROR, R"(Did not write, the image doesn't have a "%s" and "%s" views)", @@ -802,7 +806,8 @@ bool BKE_image_render_write_exr(ReportList *reports, LISTBASE_FOREACH (RenderPass *, rp, &rl->passes) { /* Skip non-RGBA and Z passes if not using multi layer. */ if (!multi_layer && !(STREQ(rp->name, RE_PASSNAME_COMBINED) || STREQ(rp->name, "") || - (STREQ(rp->name, RE_PASSNAME_Z) && write_z))) { + (STREQ(rp->name, RE_PASSNAME_Z) && write_z))) + { continue; } @@ -945,8 +950,8 @@ bool BKE_image_render_write(ReportList *reports, /* mono, legacy code */ else if (is_mono || (image_format.views_format == R_IMF_VIEWS_INDIVIDUAL)) { int view_id = 0; - for (const RenderView *rv = (const RenderView *)rr->views.first; rv; - rv = rv->next, view_id++) { + for (const RenderView *rv = (const RenderView *)rr->views.first; rv; rv = rv->next, view_id++) + { char filepath[FILE_MAX]; if (is_mono) { STRNCPY(filepath, filepath_basis); diff --git a/source/blender/blenkernel/intern/image_test.cc b/source/blender/blenkernel/intern/image_test.cc index d2c41854c46..5219552cc9b 100644 --- a/source/blender/blenkernel/intern/image_test.cc +++ b/source/blender/blenkernel/intern/image_test.cc @@ -66,7 +66,8 @@ TEST(udim, image_ensure_tile_token) "test.u_v2.png", "test.u2v3.png", "test.u123_v1.png", - "test.u1_v12345.png"}) { + "test.u1_v12345.png"}) + { /* These should not result in modifications happening. */ verify(incorrect, incorrect); } diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c index e7009bbdb06..30cbf3caff8 100644 --- a/source/blender/blenkernel/intern/ipo.c +++ b/source/blender/blenkernel/intern/ipo.c @@ -1614,7 +1614,8 @@ static void icu_to_fcurves(ID *id, * - we need radians for RNA to do the right thing */ if (((icu->blocktype == ID_OB) && ELEM(icu->adrcode, OB_ROT_X, OB_ROT_Y, OB_ROT_Z)) || - ((icu->blocktype == ID_PO) && ELEM(icu->adrcode, AC_EUL_X, AC_EUL_Y, AC_EUL_Z))) { + ((icu->blocktype == ID_PO) && ELEM(icu->adrcode, AC_EUL_X, AC_EUL_Y, AC_EUL_Z))) + { const float fac = (float)M_PI / 18.0f; /* 10.0f * M_PI/180.0f; */ dst->vec[0][1] *= fac; @@ -1627,7 +1628,8 @@ static void icu_to_fcurves(ID *id, * - we now need as 'frames' */ if ((id) && (icu->blocktype == GS(id->name)) && - (fcu->rna_path && STREQ(fcu->rna_path, "eval_time"))) { + (fcu->rna_path && STREQ(fcu->rna_path, "eval_time"))) + { Curve *cu = (Curve *)id; dst->vec[0][1] *= cu->pathlen; @@ -1644,10 +1646,8 @@ static void icu_to_fcurves(ID *id, DriverVar *dvar = fcu->driver->variables.first; DriverTarget *dtar = &dvar->targets[0]; - if (ELEM(dtar->transChan, - DTAR_TRANSCHAN_ROTX, - DTAR_TRANSCHAN_ROTY, - DTAR_TRANSCHAN_ROTZ)) { + if (ELEM(dtar->transChan, DTAR_TRANSCHAN_ROTX, DTAR_TRANSCHAN_ROTY, DTAR_TRANSCHAN_ROTZ)) + { const float fac = (float)M_PI / 18.0f; dst->vec[0][0] *= fac; diff --git a/source/blender/blenkernel/intern/key.cc b/source/blender/blenkernel/intern/key.cc index 21348c5de52..3dcddffc166 100644 --- a/source/blender/blenkernel/intern/key.cc +++ b/source/blender/blenkernel/intern/key.cc @@ -61,7 +61,8 @@ static void shapekey_copy_data(Main * /*bmain*/, ID *id_dst, const ID *id_src, c for (kb_src = static_cast(key_src->block.first), kb_dst = static_cast(key_dst->block.first); kb_dst; - kb_src = kb_src->next, kb_dst = kb_dst->next) { + kb_src = kb_src->next, kb_dst = kb_dst->next) + { if (kb_dst->data) { kb_dst->data = MEM_dupallocN(kb_dst->data); } @@ -901,7 +902,8 @@ static void key_evaluate_relative(const int start, /* step 2: do it */ for (kb = static_cast(key->block.first), keyblock_index = 0; kb; - kb = kb->next, keyblock_index++) { + kb = kb->next, keyblock_index++) + { if (kb != key->refkey) { float icuval = kb->curval; @@ -1348,7 +1350,8 @@ static float **keyblock_get_per_block_weights(Object *ob, Key *key, WeightsArray MEM_mallocN(sizeof(*per_keyblock_weights) * key->totkey, "per keyblock weights")); for (keyblock = static_cast(key->block.first), keyblock_index = 0; keyblock; - keyblock = keyblock->next, keyblock_index++) { + keyblock = keyblock->next, keyblock_index++) + { per_keyblock_weights[keyblock_index] = get_weights_array(ob, keyblock->vgroup, cache); } @@ -1645,7 +1648,8 @@ int BKE_keyblock_element_count_from_shape(const Key *key, const int shape_index) int result = 0; int index = 0; for (const KeyBlock *kb = static_cast(key->block.first); kb; - kb = kb->next, index++) { + kb = kb->next, index++) + { if (ELEM(shape_index, -1, index)) { result += kb->totelem; } @@ -1680,7 +1684,8 @@ void BKE_keyblock_data_get_from_shape(const Key *key, float (*arr)[3], const int uint8_t *elements = (uint8_t *)arr; int index = 0; for (const KeyBlock *kb = static_cast(key->block.first); kb; - kb = kb->next, index++) { + kb = kb->next, index++) + { if (ELEM(shape_index, -1, index)) { const int block_elem_len = kb->totelem * key->elemsize; memcpy(elements, kb->data, block_elem_len); @@ -2154,7 +2159,8 @@ static void keyblock_data_convert_to_curve(const float *fp, ListBase *nurb, int if (nu->bezt != nullptr) { BezTriple *bezt = nu->bezt; for (int i = nu->pntsu; i && (totpoint -= KEYELEM_ELEM_LEN_BEZTRIPLE) >= 0; - i--, bezt++, fp += KEYELEM_FLOAT_LEN_BEZTRIPLE) { + i--, bezt++, fp += KEYELEM_FLOAT_LEN_BEZTRIPLE) + { for (int j = 0; j < 3; j++) { copy_v3_v3(bezt->vec[j], &fp[j * 3]); } @@ -2165,7 +2171,8 @@ static void keyblock_data_convert_to_curve(const float *fp, ListBase *nurb, int else { BPoint *bp = nu->bp; for (int i = nu->pntsu * nu->pntsv; i && (totpoint -= KEYELEM_ELEM_LEN_BPOINT) >= 0; - i--, bp++, fp += KEYELEM_FLOAT_LEN_BPOINT) { + i--, bp++, fp += KEYELEM_FLOAT_LEN_BPOINT) + { copy_v3_v3(bp->vec, fp); bp->tilt = fp[3]; bp->radius = fp[4]; @@ -2524,7 +2531,8 @@ bool BKE_keyblock_move(Object *ob, int org_index, int new_index) for (kb = static_cast(rev ? key->block.last : key->block.first), i = (rev ? totkey - 1 : 0); kb; - kb = (rev ? kb->prev : kb->next), rev ? i-- : i++) { + kb = (rev ? kb->prev : kb->next), rev ? i-- : i++) + { if (i == org_index) { in_range = true; /* Start list items swapping... */ } diff --git a/source/blender/blenkernel/intern/layer.cc b/source/blender/blenkernel/intern/layer.cc index 69b4997c6e9..bcb52a9ddc9 100644 --- a/source/blender/blenkernel/intern/layer.cc +++ b/source/blender/blenkernel/intern/layer.cc @@ -900,7 +900,8 @@ static LayerCollectionResync *layer_collection_resync_find(LayerCollectionResync if (current_layer_resync->collection == child_collection && (current_layer_resync->parent_layer_resync == layer_resync || - (!current_layer_resync->is_used && !current_layer_resync->is_valid_as_child))) { + (!current_layer_resync->is_used && !current_layer_resync->is_valid_as_child))) + { /* This layer is a valid candidate, because its collection matches the seeked one, AND: * - It is a direct child of the initial given parent ('unchanged hierarchy' case), OR * - It is not currently used, and not part of a valid hierarchy (sub-)chain. @@ -909,9 +910,9 @@ static LayerCollectionResync *layer_collection_resync_find(LayerCollectionResync } /* Else, add all its direct children for further searching. */ - LISTBASE_FOREACH (LayerCollectionResync *, - child_layer_resync, - ¤t_layer_resync->children_layer_resync) { + LISTBASE_FOREACH ( + LayerCollectionResync *, child_layer_resync, ¤t_layer_resync->children_layer_resync) + { /* Add to tail of the queue. */ queue_tail->queue_next = child_layer_resync; child_layer_resync->queue_next = nullptr; @@ -926,7 +927,8 @@ static LayerCollectionResync *layer_collection_resync_find(LayerCollectionResync if (queue_head == nullptr && root_layer_resync->parent_layer_resync != nullptr) { LISTBASE_FOREACH (LayerCollectionResync *, sibling_layer_resync, - &root_layer_resync->parent_layer_resync->children_layer_resync) { + &root_layer_resync->parent_layer_resync->children_layer_resync) + { if (sibling_layer_resync == root_layer_resync) { continue; } @@ -951,7 +953,8 @@ static void layer_collection_resync_unused_layers_free(ViewLayer *view_layer, LayerCollectionResync *layer_resync) { LISTBASE_FOREACH ( - LayerCollectionResync *, child_layer_resync, &layer_resync->children_layer_resync) { + LayerCollectionResync *, child_layer_resync, &layer_resync->children_layer_resync) + { layer_collection_resync_unused_layers_free(view_layer, child_layer_resync); } @@ -998,7 +1001,8 @@ void BKE_scene_view_layers_synced_ensure(const Scene *scene) void BKE_main_view_layers_synced_ensure(const Main *bmain) { for (const Scene *scene = static_cast(bmain->scenes.first); scene; - scene = static_cast(scene->id.next)) { + scene = static_cast(scene->id.next)) + { BKE_scene_view_layers_synced_ensure(scene); } @@ -1205,7 +1209,8 @@ static void layer_collection_sync(ViewLayer *view_layer, } if (((child_layer->runtime_flag & LAYER_COLLECTION_HIDE_VIEWPORT) == 0) && - ((child_layer_restrict & LAYER_COLLECTION_HIDE) == 0)) { + ((child_layer_restrict & LAYER_COLLECTION_HIDE) == 0)) + { child_layer->runtime_flag |= LAYER_COLLECTION_VISIBLE_VIEW_LAYER; } } @@ -1276,7 +1281,8 @@ void BKE_layer_collection_doversion_2_80(const Scene *scene, ViewLayer *view_lay LayerCollection *first_layer_collection = static_cast( view_layer->layer_collections.first); if (BLI_listbase_count_at_most(&view_layer->layer_collections, 2) > 1 || - first_layer_collection->collection != scene->master_collection) { + first_layer_collection->collection != scene->master_collection) + { /* In some cases (from older files) we do have a master collection, but no matching layer, * instead all the children of the master collection have their layer collections in the * viewlayer's list. This is not a valid situation, add a layer for the master collection and @@ -1420,7 +1426,8 @@ void BKE_main_collection_sync(const Main *bmain) /* TODO: optimize for file load so only linked collections get checked? */ for (const Scene *scene = static_cast(bmain->scenes.first); scene; - scene = static_cast(scene->id.next)) { + scene = static_cast(scene->id.next)) + { BKE_scene_collection_sync(scene); } @@ -1439,7 +1446,8 @@ void BKE_main_collection_sync_remap(const Main *bmain) BKE_main_collections_object_cache_free(bmain); for (Scene *scene = static_cast(bmain->scenes.first); scene; - scene = static_cast(scene->id.next)) { + scene = static_cast(scene->id.next)) + { LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) { MEM_SAFE_FREE(view_layer->object_bases_array); @@ -1459,7 +1467,8 @@ void BKE_main_collection_sync_remap(const Main *bmain) } for (Collection *collection = static_cast(bmain->collections.first); collection; - collection = static_cast(collection->id.next)) { + collection = static_cast(collection->id.next)) + { DEG_id_tag_update_ex((Main *)bmain, &collection->id, ID_RECALC_COPY_ON_WRITE); } @@ -1526,7 +1535,8 @@ bool BKE_layer_collection_has_selected_objects(const Scene *scene, Base *base = BKE_view_layer_base_find(view_layer, cob->ob); if (base && (base->flag & BASE_SELECTED) && - (base->flag & BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT)) { + (base->flag & BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT)) + { return true; } } @@ -1623,7 +1633,8 @@ bool BKE_object_is_visible_in_viewport(const View3D *v3d, const Object *ob) } if ((v3d->flag & V3D_LOCAL_COLLECTIONS) && - ((v3d->local_collections_uuid & ob->runtime.local_collections_bits) == 0)) { + ((v3d->local_collections_uuid & ob->runtime.local_collections_bits) == 0)) + { return false; } @@ -2264,7 +2275,8 @@ void BKE_view_layer_bases_in_mode_iterator_next(BLI_Iterator *iter) while (base) { if ((base != data->base_active) && base_is_in_mode(data, base) && - BKE_base_is_visible(data->v3d, base)) { + BKE_base_is_visible(data->v3d, base)) + { iter->current = base; return; } diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c index 996eaa39c5f..036a1bb07f7 100644 --- a/source/blender/blenkernel/intern/lib_id.c +++ b/source/blender/blenkernel/intern/lib_id.c @@ -422,7 +422,8 @@ static int lib_id_expand_local_cb(LibraryIDLinkCallbackData *cb_data) * Just skip it, shape key can only be either indirectly linked, or fully local, period. * And let's curse one more time that stupid useless shape-key ID type! */ if (*id_pointer && *id_pointer != id_self && - BKE_idtype_idcode_is_linkable(GS((*id_pointer)->name))) { + BKE_idtype_idcode_is_linkable(GS((*id_pointer)->name))) + { id_lib_extern(*id_pointer); } @@ -1487,7 +1488,8 @@ void id_sort_by_name(ListBase *lb, ID *id, ID *id_sorting_hint) ID *id_sorting_hint_next = id_sorting_hint->next; if (BLI_strcasecmp(id_sorting_hint->name, id->name) < 0 && (id_sorting_hint_next == NULL || id_sorting_hint_next->lib != id->lib || - BLI_strcasecmp(id_sorting_hint_next->name, id->name) > 0)) { + BLI_strcasecmp(id_sorting_hint_next->name, id->name) > 0)) + { BLI_insertlinkafter(lb, id_sorting_hint, id); return; } @@ -1495,7 +1497,8 @@ void id_sort_by_name(ListBase *lb, ID *id, ID *id_sorting_hint) ID *id_sorting_hint_prev = id_sorting_hint->prev; if (BLI_strcasecmp(id_sorting_hint->name, id->name) > 0 && (id_sorting_hint_prev == NULL || id_sorting_hint_prev->lib != id->lib || - BLI_strcasecmp(id_sorting_hint_prev->name, id->name) < 0)) { + BLI_strcasecmp(id_sorting_hint_prev->name, id->name) < 0)) + { BLI_insertlinkbefore(lb, id_sorting_hint, id); return; } @@ -1687,7 +1690,8 @@ static void library_make_local_copying_check(ID *id, MainIDRelationsEntry *entry = BLI_ghash_lookup(id_relations->relations_from_pointers, id); BLI_gset_insert(loop_tags, id); for (MainIDRelationsEntryItem *from_id_entry = entry->from_ids; from_id_entry != NULL; - from_id_entry = from_id_entry->next) { + from_id_entry = from_id_entry->next) + { /* Our oh-so-beloved 'from' pointers... Those should always be ignored here, since the actual * relation we want to check is in the other way around. */ if (from_id_entry->usage_flag & IDWALK_CB_LOOPBACK) { @@ -1789,7 +1793,8 @@ void BKE_library_make_local(Main *bmain, id->flag &= ~LIB_INDIRECT_WEAK_LINK; if (ID_IS_OVERRIDE_LIBRARY_REAL(id) && ELEM(lib, NULL, id->override_library->reference->lib) && - ((untagged_only == false) || !(id->tag & LIB_TAG_PRE_EXISTING))) { + ((untagged_only == false) || !(id->tag & LIB_TAG_PRE_EXISTING))) + { BKE_lib_override_library_make_local(id); } } @@ -1807,7 +1812,8 @@ void BKE_library_make_local(Main *bmain, * but complicates slightly the pre-processing of relations between IDs at step 2... */ else if (!do_skip && id->tag & (LIB_TAG_EXTERN | LIB_TAG_INDIRECT | LIB_TAG_NEW) && ELEM(lib, NULL, id->lib) && - ((untagged_only == false) || !(id->tag & LIB_TAG_PRE_EXISTING))) { + ((untagged_only == false) || !(id->tag & LIB_TAG_PRE_EXISTING))) + { BLI_linklist_prepend_arena(&todo_ids, id, linklist_mem); id->tag |= LIB_TAG_DOIT; @@ -1942,7 +1948,8 @@ void BKE_library_make_local(Main *bmain, * Try "make all local" in 04_01_H.lighting.blend from Agent327 without this, e.g. */ for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { if (ob->data != NULL && ob->type == OB_ARMATURE && ob->pose != NULL && - ob->pose->flag & POSE_RECALC) { + ob->pose->flag & POSE_RECALC) + { BKE_pose_rebuild(bmain, ob, ob->data, true); } } diff --git a/source/blender/blenkernel/intern/lib_id_delete.c b/source/blender/blenkernel/intern/lib_id_delete.c index c7643c56212..c4200938cb9 100644 --- a/source/blender/blenkernel/intern/lib_id_delete.c +++ b/source/blender/blenkernel/intern/lib_id_delete.c @@ -353,7 +353,8 @@ static size_t id_delete(Main *bmain, const bool do_tagged_deletion) id_next = id->next; if (id->tag & tag) { if (((id->tag & LIB_TAG_EXTRAUSER_SET) == 0 && ID_REAL_USERS(id) != 0) || - ((id->tag & LIB_TAG_EXTRAUSER_SET) != 0 && ID_REAL_USERS(id) != 1)) { + ((id->tag & LIB_TAG_EXTRAUSER_SET) != 0 && ID_REAL_USERS(id) != 1)) + { CLOG_ERROR(&LOG, "Deleting %s which still has %d users (including %d 'extra' shallow users)\n", id->name, diff --git a/source/blender/blenkernel/intern/lib_override.cc b/source/blender/blenkernel/intern/lib_override.cc index 0d67b2d97e0..16b95dba90d 100644 --- a/source/blender/blenkernel/intern/lib_override.cc +++ b/source/blender/blenkernel/intern/lib_override.cc @@ -138,7 +138,8 @@ IDOverrideLibrary *BKE_lib_override_library_init(ID *local_id, ID *reference_id) for (ancestor_id = reference_id; ancestor_id != nullptr && ancestor_id->override_library != nullptr && ancestor_id->override_library->reference != nullptr; - ancestor_id = ancestor_id->override_library->reference) { + ancestor_id = ancestor_id->override_library->reference) + { /* pass */ } @@ -203,7 +204,8 @@ void BKE_lib_override_library_copy(ID *dst_id, const ID *src_id, const bool do_f *op_src = static_cast( src_id->override_library->properties.first); op_dst; - op_dst = op_dst->next, op_src = op_src->next) { + op_dst = op_dst->next, op_src = op_src->next) + { lib_override_library_property_copy(op_dst, op_src); } } @@ -367,7 +369,8 @@ static int foreachid_is_hierarchy_leaf_fn(LibraryIDLinkCallbackData *cb_data) } if (id != nullptr && ID_IS_OVERRIDE_LIBRARY_REAL(id) && - id->override_library->hierarchy_root == id_owner->override_library->hierarchy_root) { + id->override_library->hierarchy_root == id_owner->override_library->hierarchy_root) + { *is_leaf = false; return IDWALK_RET_STOP_ITER; } @@ -523,7 +526,8 @@ bool BKE_lib_override_library_create_from_tag(Main *bmain, /* Get all IDs we want to override. */ FOREACH_MAIN_ID_BEGIN (bmain, reference_id) { if ((reference_id->tag & LIB_TAG_DOIT) != 0 && reference_id->lib == reference_library && - BKE_idtype_idcode_is_linkable(GS(reference_id->name))) { + BKE_idtype_idcode_is_linkable(GS(reference_id->name))) + { todo_id_iter = MEM_cnew(__func__); todo_id_iter->data = reference_id; BLI_addtail(&todo_ids, todo_id_iter); @@ -533,7 +537,8 @@ bool BKE_lib_override_library_create_from_tag(Main *bmain, /* Override the IDs. */ for (todo_id_iter = static_cast(todo_ids.first); todo_id_iter != nullptr; - todo_id_iter = todo_id_iter->next) { + todo_id_iter = todo_id_iter->next) + { reference_id = static_cast(todo_id_iter->data); /* If `newid` is already set, assume it has been handled by calling code. @@ -575,7 +580,8 @@ bool BKE_lib_override_library_create_from_tag(Main *bmain, } else if (id_root_reference->newid != nullptr && (id_hierarchy_root == nullptr || - id_hierarchy_root->override_library->reference == id_root_reference)) { + id_hierarchy_root->override_library->reference == id_root_reference)) + { id_hierarchy_root = id_root_reference->newid; } BLI_assert(id_hierarchy_root != nullptr); @@ -607,7 +613,8 @@ bool BKE_lib_override_library_create_from_tag(Main *bmain, if ((other_id->tag & LIB_TAG_DOIT) != 0 && other_id->lib != id_root_reference->lib) { BLI_linklist_prepend(&relinked_ids, other_id); if (ID_IS_OVERRIDE_LIBRARY_REAL(other_id) && - other_id->override_library->hierarchy_root == id_hierarchy_root) { + other_id->override_library->hierarchy_root == id_hierarchy_root) + { reference_id = other_id->override_library->reference; ID *local_id = reference_id->newid; if (other_id == local_id) { @@ -622,7 +629,8 @@ bool BKE_lib_override_library_create_from_tag(Main *bmain, FOREACH_MAIN_ID_END; for (todo_id_iter = static_cast(todo_ids.first); todo_id_iter != nullptr; - todo_id_iter = todo_id_iter->next) { + todo_id_iter = todo_id_iter->next) + { reference_id = static_cast(todo_id_iter->data); ID *local_id = reference_id->newid; @@ -647,7 +655,8 @@ bool BKE_lib_override_library_create_from_tag(Main *bmain, else { /* We need to cleanup potentially already created data. */ for (todo_id_iter = static_cast(todo_ids.first); todo_id_iter != nullptr; - todo_id_iter = todo_id_iter->next) { + todo_id_iter = todo_id_iter->next) + { reference_id = static_cast(todo_id_iter->data); BKE_id_delete(bmain, reference_id->newid); reference_id->newid = nullptr; @@ -689,7 +698,8 @@ static void lib_override_group_tag_data_object_to_collection_init_collection_pro LinkNodePair **collections_linkedlist_p; if (!BLI_ghash_ensure_p(data->linked_object_to_instantiating_collections, ob, - reinterpret_cast(&collections_linkedlist_p))) { + reinterpret_cast(&collections_linkedlist_p))) + { *collections_linkedlist_p = static_cast( BLI_memarena_calloc(data->mem_arena, sizeof(**collections_linkedlist_p))); } @@ -748,7 +758,8 @@ static void lib_override_hierarchy_dependencies_recursive_tag_from(LibOverrideGr entry->tags |= MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_FROM; for (MainIDRelationsEntryItem *from_id_entry = entry->from_ids; from_id_entry != nullptr; - from_id_entry = from_id_entry->next) { + from_id_entry = from_id_entry->next) + { if ((from_id_entry->usage_flag & IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE) != 0) { /* Never consider non-overridable relationships ('from', 'parents', 'owner' etc. pointers) * as actual dependencies. */ @@ -757,7 +768,8 @@ static void lib_override_hierarchy_dependencies_recursive_tag_from(LibOverrideGr /* We only consider IDs from the same library. */ ID *from_id = from_id_entry->id_pointer.from; if (from_id == nullptr || from_id->lib != id->lib || - (is_override && !ID_IS_OVERRIDE_LIBRARY(from_id))) { + (is_override && !ID_IS_OVERRIDE_LIBRARY(from_id))) + { /* IDs from different libraries, or non-override IDs in case we are processing overrides, * are both barriers of dependency. */ continue; @@ -795,7 +807,8 @@ static bool lib_override_hierarchy_dependencies_recursive_tag(LibOverrideGroupTa entry->tags |= MAINIDRELATIONS_ENTRY_TAGS_PROCESSED_TO; for (MainIDRelationsEntryItem *to_id_entry = entry->to_ids; to_id_entry != nullptr; - to_id_entry = to_id_entry->next) { + to_id_entry = to_id_entry->next) + { if ((to_id_entry->usage_flag & IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE) != 0) { /* Never consider non-overridable relationships ('from', 'parents', 'owner' etc. pointers) as * actual dependencies. */ @@ -850,7 +863,8 @@ static void lib_override_linked_group_tag_recursive(LibOverrideGroupTagData *dat entry->tags |= MAINIDRELATIONS_ENTRY_TAGS_PROCESSED; for (MainIDRelationsEntryItem *to_id_entry = entry->to_ids; to_id_entry != nullptr; - to_id_entry = to_id_entry->next) { + to_id_entry = to_id_entry->next) + { if ((to_id_entry->usage_flag & IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE) != 0) { /* Never consider non-overridable relationships as actual dependencies. */ continue; @@ -895,7 +909,8 @@ static bool lib_override_linked_group_tag_collections_keep_tagged_check_recursiv for (CollectionObject *collection_object = static_cast(collection->gobject.first); collection_object != nullptr; - collection_object = collection_object->next) { + collection_object = collection_object->next) + { Object *object = collection_object->ob; if (object == nullptr) { continue; @@ -908,9 +923,11 @@ static bool lib_override_linked_group_tag_collections_keep_tagged_check_recursiv for (CollectionChild *collection_child = static_cast(collection->children.first); collection_child != nullptr; - collection_child = collection_child->next) { + collection_child = collection_child->next) + { if (lib_override_linked_group_tag_collections_keep_tagged_check_recursive( - data, collection_child->collection)) { + data, collection_child->collection)) + { return true; } } @@ -929,7 +946,8 @@ static void lib_override_linked_group_tag_clear_boneshapes_objects(LibOverrideGr if (ob->type == OB_ARMATURE && ob->pose != nullptr && (ob->id.tag & data->tag)) { for (bPoseChannel *pchan = static_cast(ob->pose->chanbase.first); pchan != nullptr; - pchan = pchan->next) { + pchan = pchan->next) + { if (pchan->custom != nullptr && &pchan->custom->id != id_root) { pchan->custom->id.tag &= ~data->tag; } @@ -1011,7 +1029,8 @@ static void lib_override_linked_group_tag(LibOverrideGroupTagData *data) if (instantiating_collection_linklist != nullptr) { for (LinkNode *instantiating_collection_linknode = instantiating_collection_linklist->list; instantiating_collection_linknode != nullptr; - instantiating_collection_linknode = instantiating_collection_linknode->next) { + instantiating_collection_linknode = instantiating_collection_linknode->next) + { instantiating_collection = static_cast( instantiating_collection_linknode->link); if (!ID_IS_LINKED(instantiating_collection)) { @@ -1052,7 +1071,8 @@ static void lib_override_overrides_group_tag_recursive(LibOverrideGroupTagData * ID *id_hierarchy_root = data->hierarchy_root_id; if (ID_IS_OVERRIDE_LIBRARY_REAL(id_owner) && - (id_owner->override_library->flag & IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY) != 0) { + (id_owner->override_library->flag & IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY) != 0) + { return; } @@ -1072,7 +1092,8 @@ static void lib_override_overrides_group_tag_recursive(LibOverrideGroupTagData * entry->tags |= MAINIDRELATIONS_ENTRY_TAGS_PROCESSED; for (MainIDRelationsEntryItem *to_id_entry = entry->to_ids; to_id_entry != nullptr; - to_id_entry = to_id_entry->next) { + to_id_entry = to_id_entry->next) + { if ((to_id_entry->usage_flag & IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE) != 0) { /* Never consider non-overridable relationships as actual dependencies. */ continue; @@ -1088,7 +1109,8 @@ static void lib_override_overrides_group_tag_recursive(LibOverrideGroupTagData * continue; } if (ID_IS_OVERRIDE_LIBRARY_REAL(to_id) && - to_id->override_library->hierarchy_root != id_hierarchy_root) { + to_id->override_library->hierarchy_root != id_hierarchy_root) + { continue; } @@ -1231,7 +1253,8 @@ static void lib_override_library_create_post_process(Main *bmain, /* Instantiating the root collection or object should never be needed in resync case, since the * old override would be remapped to the new one. */ if (!is_resync && id_root != nullptr && id_root->newid != nullptr && - (!ID_IS_LINKED(id_root->newid) || id_root->newid->lib == owner_library)) { + (!ID_IS_LINKED(id_root->newid) || id_root->newid->lib == owner_library)) + { switch (GS(id_root->name)) { case ID_GR: { Object *ob_reference = id_instance_hint != nullptr && GS(id_instance_hint->name) == ID_OB ? @@ -1331,7 +1354,8 @@ static void lib_override_library_create_post_process(Main *bmain, (view_layer != nullptr ? BKE_view_layer_has_collection(view_layer, collection) : BKE_collection_has_collection(scene->master_collection, collection)) && - !ID_IS_LINKED(collection) && !ID_IS_OVERRIDE_LIBRARY(collection)) { + !ID_IS_LINKED(collection) && !ID_IS_OVERRIDE_LIBRARY(collection)) + { default_instantiating_collection = collection; } } @@ -1351,7 +1375,8 @@ static void lib_override_library_create_post_process(Main *bmain, } if (id_root != nullptr && - !ELEM(default_instantiating_collection, nullptr, scene->master_collection)) { + !ELEM(default_instantiating_collection, nullptr, scene->master_collection)) + { ID *id_ref = id_root->newid != nullptr ? id_root->newid : id_root; switch (GS(id_ref->name)) { case ID_GR: @@ -1485,7 +1510,8 @@ static ID *lib_override_root_find(Main *bmain, ID *id, const int curr_level, int ID *best_root_id_candidate = id; for (MainIDRelationsEntryItem *from_id_entry = entry->from_ids; from_id_entry != nullptr; - from_id_entry = from_id_entry->next) { + from_id_entry = from_id_entry->next) + { if ((from_id_entry->usage_flag & IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE) != 0) { /* Never consider non-overridable relationships as actual dependencies. */ continue; @@ -1562,7 +1588,8 @@ static void lib_override_root_hierarchy_set(Main *bmain, ID *id_root, ID *id, ID bool do_replace_root = false; for (MainIDRelationsEntryItem *from_id_entry = entry->from_ids; from_id_entry != nullptr; - from_id_entry = from_id_entry->next) { + from_id_entry = from_id_entry->next) + { if ((from_id_entry->usage_flag & IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE) != 0) { /* Never consider non-overridable relationships as actual dependencies. */ continue; @@ -1603,7 +1630,8 @@ static void lib_override_root_hierarchy_set(Main *bmain, ID *id_root, ID *id, ID BLI_assert(entry != nullptr); for (MainIDRelationsEntryItem *to_id_entry = entry->to_ids; to_id_entry != nullptr; - to_id_entry = to_id_entry->next) { + to_id_entry = to_id_entry->next) + { if ((to_id_entry->usage_flag & IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE) != 0) { /* Never consider non-overridable relationships as actual dependencies. */ continue; @@ -1634,7 +1662,8 @@ void BKE_lib_override_library_main_hierarchy_root_ensure(Main *bmain) } if (id->override_library->hierarchy_root != nullptr) { if (!ID_IS_OVERRIDE_LIBRARY_REAL(id->override_library->hierarchy_root) || - id->override_library->hierarchy_root->lib != id->lib) { + id->override_library->hierarchy_root->lib != id->lib) + { CLOG_ERROR( &LOG, "Existing override hierarchy root ('%s') for ID '%s' is invalid, will try to find a " @@ -1765,7 +1794,8 @@ static bool lib_override_library_resync(Main *bmain, /* Only tag linked IDs from related linked reference hierarchy that are actually part of * the sub-trees of each detected sub-roots needing resync. */ for (LinkNode *resync_root_link = id_resync_roots; resync_root_link != nullptr; - resync_root_link = resync_root_link->next) { + resync_root_link = resync_root_link->next) + { ID *id_resync_root = static_cast(resync_root_link->link); BLI_assert(ID_IS_OVERRIDE_LIBRARY_REAL(id_resync_root)); @@ -1828,7 +1858,8 @@ static bool lib_override_library_resync(Main *bmain, /* Unfortunately deleting obdata means deleting their objects too. Since there is no * guarantee that a valid override object using an obsolete override obdata gets properly * updated, we ignore those here for now. In practice this should not be a big issue. */ - !OB_DATA_SUPPORT_ID(GS(id->name))) { + !OB_DATA_SUPPORT_ID(GS(id->name))) + { id->tag |= LIB_TAG_MISSING; } @@ -2008,8 +2039,8 @@ static bool lib_override_library_resync(Main *bmain, * remapped, and all new local override IDs have gotten their proper original names, otherwise * override operations based on those ID names would fail. */ FOREACH_MAIN_ID_BEGIN (bmain, id) { - if ((id->tag & LIB_TAG_DOIT) == 0 || id->newid == nullptr || - id->lib != id_root_reference->lib) { + if ((id->tag & LIB_TAG_DOIT) == 0 || id->newid == nullptr || id->lib != id_root_reference->lib) + { continue; } @@ -2036,7 +2067,8 @@ static bool lib_override_library_resync(Main *bmain, * too (typical case: assigning new ID to some usage, while old one remains used elsewhere * in the override hierarchy). */ LISTBASE_FOREACH_MUTABLE ( - IDOverrideLibraryProperty *, op, &id_override_new->override_library->properties) { + IDOverrideLibraryProperty *, op, &id_override_new->override_library->properties) + { LISTBASE_FOREACH_MUTABLE (IDOverrideLibraryPropertyOperation *, opop, &op->operations) { if (opop->flag & IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE) { lib_override_library_property_operation_clear(opop); @@ -2118,7 +2150,8 @@ static bool lib_override_library_resync(Main *bmain, do_delete = false; } else if (hierarchy_root != nullptr && - hierarchy_root->override_library->reference->tag & LIB_TAG_MISSING) { + hierarchy_root->override_library->reference->tag & LIB_TAG_MISSING) + { /* Do not delete overrides which root hierarchy reference is missing. This would typically * cause more harm than good. */ do_delete = false; @@ -2280,8 +2313,8 @@ static bool lib_override_resync_tagging_finalize_recurse( { BLI_assert(ID_IS_OVERRIDE_LIBRARY_REAL(id)); - if (!lib_override_resync_id_lib_level_is_valid(id, library_indirect_level, false) && - !check_only) { + if (!lib_override_resync_id_lib_level_is_valid(id, library_indirect_level, false) && !check_only) + { CLOG_ERROR( &LOG, "While processing indirect level %d, ID %s from lib %s of indirect level %d detected " @@ -2331,9 +2364,10 @@ static bool lib_override_resync_tagging_finalize_recurse( bool is_ancestor_tagged_for_resync = false; for (MainIDRelationsEntryItem *entry_item = entry->from_ids; entry_item != nullptr; - entry_item = entry_item->next) { - if (entry_item->usage_flag & - (IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE | IDWALK_CB_LOOPBACK)) { + entry_item = entry_item->next) + { + if (entry_item->usage_flag & (IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE | IDWALK_CB_LOOPBACK)) + { continue; } @@ -2341,7 +2375,8 @@ static bool lib_override_resync_tagging_finalize_recurse( /* Check if this ID has an override hierarchy ancestor already tagged for resync. */ if (id_from != id && ID_IS_OVERRIDE_LIBRARY_REAL(id_from) && id_from->lib == id->lib && - id_from->override_library->hierarchy_root == id->override_library->hierarchy_root) { + id_from->override_library->hierarchy_root == id->override_library->hierarchy_root) + { const bool is_ancestor_tagged_for_resync_prev = is_ancestor_tagged_for_resync; is_ancestor_tagged_for_resync |= lib_override_resync_tagging_finalize_recurse( bmain, id_from, id_roots, library_indirect_level, check_only); @@ -2429,7 +2464,8 @@ static bool lib_override_library_main_resync_id_skip_check(ID *id, ID *hierarchy_root = id->override_library->hierarchy_root; if (hierarchy_root == nullptr || ((hierarchy_root->tag | hierarchy_root->override_library->reference->tag) & - LIB_TAG_MISSING) != 0) { + LIB_TAG_MISSING) != 0) + { return true; } @@ -2512,7 +2548,8 @@ static void lib_override_library_main_resync_on_library_indirect_level( BLI_assert(entry != nullptr); for (MainIDRelationsEntryItem *entry_item = entry->to_ids; entry_item != nullptr; - entry_item = entry_item->next) { + entry_item = entry_item->next) + { if (entry_item->usage_flag & IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE) { continue; } @@ -2550,7 +2587,8 @@ static void lib_override_library_main_resync_on_library_indirect_level( CLOG_INFO( &LOG, 2, "Checking validity of computed TODO data for root '%s'... \n", id_root->name); for (LinkNode *id_resync_root_iter = id_resync_roots->list; id_resync_root_iter != nullptr; - id_resync_root_iter = id_resync_root_iter->next) { + id_resync_root_iter = id_resync_root_iter->next) + { ID *id_resync_root = static_cast(id_resync_root_iter->link); BLI_assert(id_resync_root == id_root || !BLI_ghash_haskey(id_roots, id_resync_root)); if (id_resync_root == id_root) { @@ -2558,7 +2596,8 @@ static void lib_override_library_main_resync_on_library_indirect_level( id_resync_root_iter == id_resync_roots->last_node); } if (lib_override_resync_tagging_finalize_recurse( - bmain, id_resync_root, id_roots, library_indirect_level, true)) { + bmain, id_resync_root, id_roots, library_indirect_level, true)) + { CLOG_WARN(&LOG, "Resync root ID still has ancestors tagged for resync, this should not happen " "at this point." @@ -2610,7 +2649,8 @@ static void lib_override_library_main_resync_on_library_indirect_level( if (success) { reports->count.resynced_lib_overrides++; if (library_indirect_level > 0 && reports->do_resynced_lib_overrides_libraries_list && - BLI_linklist_index(reports->resynced_lib_overrides_libraries, library) < 0) { + BLI_linklist_index(reports->resynced_lib_overrides_libraries, library) < 0) + { BLI_linklist_prepend(&reports->resynced_lib_overrides_libraries, library); reports->resynced_lib_overrides_libraries_count++; } @@ -2634,7 +2674,8 @@ static void lib_override_library_main_resync_on_library_indirect_level( } /* Do not attempt to resync to/from missing data. */ if (((id->tag | (ID_IS_OVERRIDE_LIBRARY_REAL(id) ? id->override_library->reference->tag : 0)) & - LIB_TAG_MISSING) != 0) { + LIB_TAG_MISSING) != 0) + { continue; } @@ -2900,7 +2941,8 @@ BLI_INLINE GHash *override_library_rna_path_mapping_ensure(IDOverrideLibrary *ov for (IDOverrideLibraryProperty *op = static_cast(override->properties.first); op != nullptr; - op = op->next) { + op = op->next) + { BLI_ghash_insert(override_runtime->rna_path_to_override_properties, op->rna_path, op); } } @@ -2961,7 +3003,8 @@ void lib_override_library_property_copy(IDOverrideLibraryProperty *op_dst, opop_dst = static_cast(op_dst->operations.first), *opop_src = static_cast(op_src->operations.first); opop_dst; - opop_dst = opop_dst->next, opop_src = opop_src->next) { + opop_dst = opop_dst->next, opop_src = opop_src->next) + { lib_override_library_property_operation_copy(opop_dst, opop_src); } } @@ -3049,7 +3092,8 @@ IDOverrideLibraryPropertyOperation *BKE_lib_override_library_property_operation_ &override_property->operations, &subitem_locindex, sizeof(subitem_locindex), - offsetof(IDOverrideLibraryPropertyOperation, subitem_local_index))))) { + offsetof(IDOverrideLibraryPropertyOperation, subitem_local_index))))) + { return ELEM(subitem_refindex, -1, opop->subitem_reference_index) ? opop : nullptr; } @@ -3057,7 +3101,8 @@ IDOverrideLibraryPropertyOperation *BKE_lib_override_library_property_operation_ &override_property->operations, &subitem_refindex, sizeof(subitem_refindex), - offsetof(IDOverrideLibraryPropertyOperation, subitem_reference_index))))) { + offsetof(IDOverrideLibraryPropertyOperation, subitem_reference_index))))) + { return ELEM(subitem_locindex, -1, opop->subitem_local_index) ? opop : nullptr; } @@ -3068,7 +3113,8 @@ IDOverrideLibraryPropertyOperation *BKE_lib_override_library_property_operation_ &override_property->operations, &subitem_defindex, sizeof(subitem_defindex), - offsetof(IDOverrideLibraryPropertyOperation, subitem_local_index))))) { + offsetof(IDOverrideLibraryPropertyOperation, subitem_local_index))))) + { if (r_strict) { *r_strict = false; } @@ -3180,7 +3226,8 @@ bool BKE_lib_override_library_property_operation_operands_validate( ATTR_FALLTHROUGH; case IDOVERRIDE_LIBRARY_OP_REPLACE: if ((ptr_dst == nullptr || ptr_dst->data == nullptr || prop_dst == nullptr) || - (ptr_src == nullptr || ptr_src->data == nullptr || prop_src == nullptr)) { + (ptr_src == nullptr || ptr_src->data == nullptr || prop_src == nullptr)) + { BLI_assert_msg(0, "Missing data to apply override operation."); return false; } @@ -3276,7 +3323,8 @@ bool BKE_lib_override_library_status_check_local(Main *bmain, ID *local) local->override_library, (eRNAOverrideMatch)(RNA_OVERRIDE_COMPARE_IGNORE_NON_OVERRIDABLE | RNA_OVERRIDE_COMPARE_IGNORE_OVERRIDDEN), - nullptr)) { + nullptr)) + { local->tag &= ~LIB_TAG_OVERRIDE_LIBRARY_REFOK; return false; } @@ -3332,7 +3380,8 @@ bool BKE_lib_override_library_status_check_reference(Main *bmain, ID *local) 0, local->override_library, RNA_OVERRIDE_COMPARE_IGNORE_OVERRIDDEN, - nullptr)) { + nullptr)) + { local->tag &= ~LIB_TAG_OVERRIDE_LIBRARY_REFOK; return false; } @@ -3417,8 +3466,9 @@ void BKE_lib_override_library_operations_create(Main *bmain, ID *local, int *r_r void BKE_lib_override_library_operations_restore(Main *bmain, ID *local, int *r_report_flags) { - if (!ID_IS_OVERRIDE_LIBRARY_REAL(local) || (local->override_library->runtime->tag & - IDOVERRIDE_LIBRARY_RUNTIME_TAG_NEEDS_RESTORE) == 0) { + if (!ID_IS_OVERRIDE_LIBRARY_REAL(local) || + (local->override_library->runtime->tag & IDOVERRIDE_LIBRARY_RUNTIME_TAG_NEEDS_RESTORE) == 0) + { return; } @@ -3434,8 +3484,8 @@ void BKE_lib_override_library_operations_restore(Main *bmain, ID *local, int *r_ static_cast(RNA_OVERRIDE_APPLY_FLAG_SKIP_RESYNC_CHECK | RNA_OVERRIDE_APPLY_FLAG_RESTORE_ONLY)); - LISTBASE_FOREACH_MUTABLE ( - IDOverrideLibraryProperty *, op, &local->override_library->properties) { + LISTBASE_FOREACH_MUTABLE (IDOverrideLibraryProperty *, op, &local->override_library->properties) + { if (op->tag & IDOVERRIDE_LIBRARY_PROPERTY_TAG_NEEDS_RETORE) { LISTBASE_FOREACH_MUTABLE (IDOverrideLibraryPropertyOperation *, opop, &op->operations) { if (opop->tag & IDOVERRIDE_LIBRARY_PROPERTY_TAG_NEEDS_RETORE) { @@ -3514,7 +3564,8 @@ void BKE_lib_override_library_main_operations_create(Main *bmain, FOREACH_MAIN_ID_BEGIN (bmain, id) { if (!ID_IS_LINKED(id) && ID_IS_OVERRIDE_LIBRARY_REAL(id) && - (force_auto || (id->tag & LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH))) { + (force_auto || (id->tag & LIB_TAG_OVERRIDE_LIBRARY_AUTOREFRESH))) + { /* Usual issue with pose, it's quiet rare but sometimes they may not be up to date when this * function is called. */ if (GS(id->name) == ID_OB) { @@ -3576,7 +3627,8 @@ void BKE_lib_override_library_main_operations_restore(Main *bmain, int *r_report FOREACH_MAIN_ID_BEGIN (bmain, id) { if (!(!ID_IS_LINKED(id) && ID_IS_OVERRIDE_LIBRARY_REAL(id) && (id->override_library->runtime->tag & IDOVERRIDE_LIBRARY_RUNTIME_TAG_NEEDS_RESTORE) != - 0)) { + 0)) + { continue; } @@ -3667,7 +3719,8 @@ void BKE_lib_override_library_id_reset(Main *bmain, if (lib_override_library_id_reset_do(bmain, id_root, do_reset_system_override)) { if (id_root->override_library->runtime != nullptr && (id_root->override_library->runtime->tag & IDOVERRIDE_LIBRARY_RUNTIME_TAG_NEEDS_RELOAD) != - 0) { + 0) + { BKE_lib_override_library_update(bmain, id_root); id_root->override_library->runtime->tag &= ~IDOVERRIDE_LIBRARY_RUNTIME_TAG_NEEDS_RELOAD; } @@ -3702,7 +3755,8 @@ static void lib_override_library_id_hierarchy_recursive_reset(Main *bmain, entry->tags |= MAINIDRELATIONS_ENTRY_TAGS_PROCESSED; for (MainIDRelationsEntryItem *to_id_entry = entry->to_ids; to_id_entry != nullptr; - to_id_entry = to_id_entry->next) { + to_id_entry = to_id_entry->next) + { if ((to_id_entry->usage_flag & IDWALK_CB_OVERRIDE_LIBRARY_NOT_OVERRIDABLE) != 0) { /* Never consider non-overridable relationships ('from', 'parents', 'owner' etc. pointers) as * actual dependencies. */ @@ -3731,7 +3785,8 @@ void BKE_lib_override_library_id_hierarchy_reset(Main *bmain, ID *id; FOREACH_MAIN_ID_BEGIN (bmain, id) { if (!ID_IS_OVERRIDE_LIBRARY_REAL(id) || id->override_library->runtime == nullptr || - (id->override_library->runtime->tag & IDOVERRIDE_LIBRARY_RUNTIME_TAG_NEEDS_RELOAD) == 0) { + (id->override_library->runtime->tag & IDOVERRIDE_LIBRARY_RUNTIME_TAG_NEEDS_RELOAD) == 0) + { continue; } BKE_lib_override_library_update(bmain, id); @@ -3840,7 +3895,8 @@ void BKE_lib_override_library_update(Main *bmain, ID *local) /* Recursively do 'ancestor' overrides first, if any. */ if (local->override_library->reference->override_library && - (local->override_library->reference->tag & LIB_TAG_OVERRIDE_LIBRARY_REFOK) == 0) { + (local->override_library->reference->tag & LIB_TAG_OVERRIDE_LIBRARY_REFOK) == 0) + { BKE_lib_override_library_update(bmain, local->override_library->reference); } diff --git a/source/blender/blenkernel/intern/lib_override_proxy_conversion.c b/source/blender/blenkernel/intern/lib_override_proxy_conversion.c index 00afadc23a2..3b53109ac17 100644 --- a/source/blender/blenkernel/intern/lib_override_proxy_conversion.c +++ b/source/blender/blenkernel/intern/lib_override_proxy_conversion.c @@ -130,7 +130,8 @@ void BKE_lib_override_library_main_proxy_convert(Main *bmain, BlendFileReadRepor FOREACH_SCENE_OBJECT_END; for (LinkNode *proxy_object_iter = proxy_objects.list; proxy_object_iter != NULL; - proxy_object_iter = proxy_object_iter->next) { + proxy_object_iter = proxy_object_iter->next) + { Object *proxy_object = proxy_object_iter->link; lib_override_library_proxy_convert_do(bmain, scene, proxy_object, reports); } diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c index 30c25e3be93..3f0a1ceba24 100644 --- a/source/blender/blenkernel/intern/lib_query.c +++ b/source/blender/blenkernel/intern/lib_query.c @@ -174,7 +174,8 @@ void BKE_library_foreach_ID_embedded(LibraryForeachIDData *data, ID **id_pp) } else { if (!library_foreach_ID_link( - data->bmain, data->owner_id, id, data->callback, data->user_data, data->flag, data)) { + data->bmain, data->owner_id, id, data->callback, data->user_data, data->flag, data)) + { data->status |= IDWALK_STOP; return; } @@ -280,7 +281,8 @@ static bool library_foreach_ID_link(Main *bmain, if (bmain != NULL && bmain->relations != NULL && (flag & IDWALK_READONLY) && (flag & (IDWALK_DO_INTERNAL_RUNTIME_POINTERS | IDWALK_DO_LIBRARY_POINTER)) == 0 && (((bmain->relations->flag & MAINIDRELATIONS_INCLUDE_UI) == 0) == - ((data.flag & IDWALK_INCLUDE_UI) == 0))) { + ((data.flag & IDWALK_INCLUDE_UI) == 0))) + { /* Note that this is minor optimization, even in worst cases (like id being an object with * lots of drivers and constraints and modifiers, or material etc. with huge node tree), * but we might as well use it (Main->relations is always assumed valid, @@ -289,7 +291,8 @@ static bool library_foreach_ID_link(Main *bmain, MainIDRelationsEntry *entry = BLI_ghash_lookup(bmain->relations->relations_from_pointers, id); for (MainIDRelationsEntryItem *to_id_entry = entry->to_ids; to_id_entry != NULL; - to_id_entry = to_id_entry->next) { + to_id_entry = to_id_entry->next) + { BKE_lib_query_foreachid_process( &data, to_id_entry->id_pointer.to, to_id_entry->usage_flag); if (BKE_lib_query_foreachid_iter_stop(&data)) { @@ -718,9 +721,11 @@ static void lib_query_unused_ids_tag_recurse(Main *bmain, * ID reaching this point of the function can be tagged. */ id->tag |= tag; for (MainIDRelationsEntryItem *id_from_item = id_relations->from_ids; id_from_item != NULL; - id_from_item = id_from_item->next) { + id_from_item = id_from_item->next) + { if ((id_from_item->usage_flag & ignored_usages) != 0 || - (id_from_item->usage_flag & required_usages) == 0) { + (id_from_item->usage_flag & required_usages) == 0) + { continue; } diff --git a/source/blender/blenkernel/intern/lib_remap.c b/source/blender/blenkernel/intern/lib_remap.c index fe41803cc43..2f791aa484b 100644 --- a/source/blender/blenkernel/intern/lib_remap.c +++ b/source/blender/blenkernel/intern/lib_remap.c @@ -214,7 +214,8 @@ static int foreach_libblock_remap_callback(LibraryIDLinkCallbackData *cb_data) /* Exit, when no modifications will be done; ensuring id->runtime counters won't changed. */ if (ELEM(expected_mapping_result, ID_REMAP_RESULT_SOURCE_UNAVAILABLE, - ID_REMAP_RESULT_SOURCE_NOT_MAPPABLE)) { + ID_REMAP_RESULT_SOURCE_NOT_MAPPABLE)) + { BLI_assert_msg(id_remap_data->type == ID_REMAP_TYPE_REMAP, "Cleanup should always do unassign."); return IDWALK_RET_NOP; @@ -260,7 +261,8 @@ static int foreach_libblock_remap_callback(LibraryIDLinkCallbackData *cb_data) if ((violates_never_null && skip_never_null) || (is_obj_editmode && (((Object *)id_owner)->data == *id_p) && (expected_mapping_result == ID_REMAP_RESULT_SOURCE_REMAPPED)) || - (skip_indirect && is_indirect) || (is_reference && skip_reference)) { + (skip_indirect && is_indirect) || (is_reference && skip_reference)) + { foreach_libblock_remap_callback_skip(id_owner, id_p, cb_flag, @@ -432,7 +434,8 @@ static void libblock_remap_data_update_tags(ID *old_id, ID *new_id, void *user_d } if (new_id != NULL && (new_id->tag & LIB_TAG_INDIRECT) && - (new_id->runtime.remap.status & ID_REMAP_IS_LINKED_DIRECT)) { + (new_id->runtime.remap.status & ID_REMAP_IS_LINKED_DIRECT)) + { new_id->tag &= ~LIB_TAG_INDIRECT; new_id->flag &= ~LIB_INDIRECT_WEAK_LINK; new_id->tag |= LIB_TAG_EXTERN; @@ -562,7 +565,8 @@ static void libblock_remap_foreach_idpair_cb(ID *old_id, ID *new_id, void *user_ * count has actually been incremented for that, we have to decrease once more its user * count... unless we had to skip some 'user_one' cases. */ if ((old_id->tag & LIB_TAG_EXTRAUSER_SET) && - !(old_id->runtime.remap.status & ID_REMAP_IS_USER_ONE_SKIPPED)) { + !(old_id->runtime.remap.status & ID_REMAP_IS_USER_ONE_SKIPPED)) + { id_us_clear_real(old_id); } } diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c index 7cb28f14f9e..c883f8747e1 100644 --- a/source/blender/blenkernel/intern/library.c +++ b/source/blender/blenkernel/intern/library.c @@ -62,8 +62,8 @@ static void library_foreach_path(ID *id, BPathForeachPathData *bpath_data) /* FIXME: Find if we should respect #BKE_BPATH_FOREACH_PATH_SKIP_PACKED here, and if not, explain * why. */ - if (lib->packedfile != - NULL /*&& (bpath_data->flag & BKE_BPATH_FOREACH_PATH_SKIP_PACKED) != 0 */) { + if (lib->packedfile != NULL /*&& (bpath_data->flag & BKE_BPATH_FOREACH_PATH_SKIP_PACKED) != 0 */) + { return; } diff --git a/source/blender/blenkernel/intern/lightprobe.cc b/source/blender/blenkernel/intern/lightprobe.cc index 48e8449dd7d..f3e9f4a2118 100644 --- a/source/blender/blenkernel/intern/lightprobe.cc +++ b/source/blender/blenkernel/intern/lightprobe.cc @@ -156,9 +156,9 @@ static void lightprobe_grid_cache_frame_blend_write(BlendWriter *writer, static void lightprobe_grid_cache_frame_blend_read(BlendDataReader *reader, LightProbeGridCacheFrame *cache) { - if (!ELEM(cache->data_layout, - LIGHTPROBE_CACHE_ADAPTIVE_RESOLUTION, - LIGHTPROBE_CACHE_UNIFORM_GRID)) { + if (!ELEM( + cache->data_layout, LIGHTPROBE_CACHE_ADAPTIVE_RESOLUTION, LIGHTPROBE_CACHE_UNIFORM_GRID)) + { /* Do not try to read data from incompatible layout. Clear all pointers. */ memset(cache, 0, sizeof(*cache)); return; diff --git a/source/blender/blenkernel/intern/linestyle.cc b/source/blender/blenkernel/intern/linestyle.cc index de5cd553928..2b29d44e3c4 100644 --- a/source/blender/blenkernel/intern/linestyle.cc +++ b/source/blender/blenkernel/intern/linestyle.cc @@ -79,28 +79,32 @@ static void linestyle_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const BLI_listbase_clear(&linestyle_dst->color_modifiers); for (linestyle_modifier = (LineStyleModifier *)linestyle_src->color_modifiers.first; linestyle_modifier; - linestyle_modifier = linestyle_modifier->next) { + linestyle_modifier = linestyle_modifier->next) + { BKE_linestyle_color_modifier_copy(linestyle_dst, linestyle_modifier, flag_subdata); } BLI_listbase_clear(&linestyle_dst->alpha_modifiers); for (linestyle_modifier = (LineStyleModifier *)linestyle_src->alpha_modifiers.first; linestyle_modifier; - linestyle_modifier = linestyle_modifier->next) { + linestyle_modifier = linestyle_modifier->next) + { BKE_linestyle_alpha_modifier_copy(linestyle_dst, linestyle_modifier, flag_subdata); } BLI_listbase_clear(&linestyle_dst->thickness_modifiers); for (linestyle_modifier = (LineStyleModifier *)linestyle_src->thickness_modifiers.first; linestyle_modifier; - linestyle_modifier = linestyle_modifier->next) { + linestyle_modifier = linestyle_modifier->next) + { BKE_linestyle_thickness_modifier_copy(linestyle_dst, linestyle_modifier, flag_subdata); } BLI_listbase_clear(&linestyle_dst->geometry_modifiers); for (linestyle_modifier = (LineStyleModifier *)linestyle_src->geometry_modifiers.first; linestyle_modifier; - linestyle_modifier = linestyle_modifier->next) { + linestyle_modifier = linestyle_modifier->next) + { BKE_linestyle_geometry_modifier_copy(linestyle_dst, linestyle_modifier, flag_subdata); } } @@ -2010,8 +2014,8 @@ bool BKE_linestyle_use_textures(FreestyleLineStyle *linestyle, const bool use_sh if (linestyle && linestyle->use_nodes && linestyle->nodetree) { bNode *node; - for (node = static_cast(linestyle->nodetree->nodes.first); node; - node = node->next) { + for (node = static_cast(linestyle->nodetree->nodes.first); node; node = node->next) + { if (node->typeinfo->nclass == NODE_CLASS_TEXTURE) { return true; } diff --git a/source/blender/blenkernel/intern/main.c b/source/blender/blenkernel/intern/main.c index 6c5afa683fa..ab01dd36566 100644 --- a/source/blender/blenkernel/intern/main.c +++ b/source/blender/blenkernel/intern/main.c @@ -333,7 +333,8 @@ void BKE_main_relations_tag_set(struct Main *bmain, GHashIterator *gh_iter; for (gh_iter = BLI_ghashIterator_new(bmain->relations->relations_from_pointers); !BLI_ghashIterator_done(gh_iter); - BLI_ghashIterator_step(gh_iter)) { + BLI_ghashIterator_step(gh_iter)) + { MainIDRelationsEntry *entry = BLI_ghashIterator_getValue(gh_iter); if (value) { entry->tags |= tag; diff --git a/source/blender/blenkernel/intern/main_namemap.cc b/source/blender/blenkernel/intern/main_namemap.cc index 85f4c813dc7..bd8e94e3686 100644 --- a/source/blender/blenkernel/intern/main_namemap.cc +++ b/source/blender/blenkernel/intern/main_namemap.cc @@ -203,7 +203,8 @@ void BKE_main_namemap_clear(Main *bmain) } for (Library *lib_iter = static_cast(bmain_iter->libraries.first); lib_iter != nullptr; - lib_iter = static_cast(lib_iter->id.next)) { + lib_iter = static_cast(lib_iter->id.next)) + { if (lib_iter->runtime.name_map != nullptr) { BKE_main_namemap_destroy(&lib_iter->runtime.name_map); } @@ -460,7 +461,8 @@ static bool main_namemap_validate_and_fix(Main *bmain, const bool do_fix) if (name_map != nullptr) { int i = 0; for (short idcode = BKE_idtype_idcode_iter_step(&i); idcode != 0; - idcode = BKE_idtype_idcode_iter_step(&i)) { + idcode = BKE_idtype_idcode_iter_step(&i)) + { UniqueName_TypeMap *type_map = name_map->find_by_type(idcode); if (type_map != nullptr) { for (const UniqueName_Key &id_name : type_map->full_names) { diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c index 5a7975faad8..0179ef016fa 100644 --- a/source/blender/blenkernel/intern/mask.c +++ b/source/blender/blenkernel/intern/mask.c @@ -129,7 +129,8 @@ static void mask_blend_write(BlendWriter *writer, ID *id, const void *id_address } for (masklay_shape = masklay->splines_shapes.first; masklay_shape; - masklay_shape = masklay_shape->next) { + masklay_shape = masklay_shape->next) + { BLO_write_struct(writer, MaskLayerShape, masklay_shape); BLO_write_float_array( writer, masklay_shape->tot_vert * MASK_OBJECT_SHAPE_ELEM_SIZE, masklay_shape->data); @@ -165,7 +166,8 @@ static void mask_blend_read_data(BlendDataReader *reader, ID *id) /* detect active point */ if ((act_point_search == NULL) && (masklay->act_point >= points_old) && - (masklay->act_point < points_old + spline->tot_point)) { + (masklay->act_point < points_old + spline->tot_point)) + { act_point_search = &spline->points[masklay->act_point - points_old]; } } @@ -330,7 +332,8 @@ MaskSplinePoint *BKE_mask_spline_point_array_from_point(MaskSpline *spline, } if ((point_ref >= spline->points_deform) && - (point_ref < &spline->points_deform[spline->tot_point])) { + (point_ref < &spline->points_deform[spline->tot_point])) + { return spline->points_deform; } @@ -432,7 +435,8 @@ MaskLayer *BKE_mask_layer_copy(const MaskLayer *masklay) } if (masklay->act_point >= spline->points && - masklay->act_point < spline->points + spline->tot_point) { + masklay->act_point < spline->points + spline->tot_point) + { const size_t point_index = masklay->act_point - spline->points; masklay_new->act_point = spline_new->points + point_index; } @@ -444,7 +448,8 @@ MaskLayer *BKE_mask_layer_copy(const MaskLayer *masklay) MaskLayerShape *masklay_shape_new; for (masklay_shape = masklay->splines_shapes.first; masklay_shape; - masklay_shape = masklay_shape->next) { + masklay_shape = masklay_shape->next) + { masklay_shape_new = MEM_callocN(sizeof(MaskLayerShape), "new mask layer shape"); masklay_shape_new->data = MEM_dupallocN(masklay_shape->data); @@ -574,7 +579,8 @@ void BKE_mask_spline_direction_switch(MaskLayer *masklay, MaskSpline *spline) const int spline_index = BKE_mask_layer_shape_spline_to_index(masklay, spline); for (masklay_shape = masklay->splines_shapes.first; masklay_shape; - masklay_shape = masklay_shape->next) { + masklay_shape = masklay_shape->next) + { MaskLayerShapeElem *fp_arr = (MaskLayerShapeElem *)masklay_shape->data; for (i = 0; i < tot_point_half; i++) { @@ -611,7 +617,8 @@ float BKE_mask_spline_project_co(MaskSpline *spline, sub_v2_v2v2(v1, co, co1); if ((sign == MASK_PROJ_ANY) || ((sign == MASK_PROJ_NEG) && (dot_v2v2(v1, n1) <= 0.0f)) || - ((sign == MASK_PROJ_POS) && (dot_v2v2(v1, n1) >= 0.0f))) { + ((sign == MASK_PROJ_POS) && (dot_v2v2(v1, n1) >= 0.0f))) + { if (len_squared_v2(v1) > proj_eps_sq) { ang1 = angle_v2v2(v1, n1); @@ -637,7 +644,8 @@ float BKE_mask_spline_project_co(MaskSpline *spline, sub_v2_v2v2(v2, co, co2); if ((sign == MASK_PROJ_ANY) || ((sign == MASK_PROJ_NEG) && (dot_v2v2(v2, n2) <= 0.0f)) || - ((sign == MASK_PROJ_POS) && (dot_v2v2(v2, n2) >= 0.0f))) { + ((sign == MASK_PROJ_POS) && (dot_v2v2(v2, n2) >= 0.0f))) + { if (len_squared_v2(v2) > proj_eps_sq) { ang2 = angle_v2v2(v2, n2); @@ -1723,7 +1731,8 @@ MaskLayerShape *BKE_mask_layer_shape_find_frame(MaskLayer *masklay, const int fr MaskLayerShape *masklay_shape; for (masklay_shape = masklay->splines_shapes.first; masklay_shape; - masklay_shape = masklay_shape->next) { + masklay_shape = masklay_shape->next) + { if (frame == masklay_shape->frame) { return masklay_shape; } @@ -1743,7 +1752,8 @@ int BKE_mask_layer_shape_find_frame_range(MaskLayer *masklay, MaskLayerShape *masklay_shape; for (masklay_shape = masklay->splines_shapes.first; masklay_shape; - masklay_shape = masklay_shape->next) { + masklay_shape = masklay_shape->next) + { if (frame == masklay_shape->frame) { *r_masklay_shape_a = masklay_shape; *r_masklay_shape_b = NULL; @@ -1854,7 +1864,8 @@ int BKE_mask_layer_shape_spline_to_index(MaskLayer *masklay, MaskSpline *spline) MaskSpline *spline_iter; int i_abs = 0; for (spline_iter = masklay->splines.first; spline_iter && spline_iter != spline; - i_abs += spline_iter->tot_point, spline_iter = spline_iter->next) { + i_abs += spline_iter->tot_point, spline_iter = spline_iter->next) + { /* pass */ } @@ -1936,7 +1947,8 @@ void BKE_mask_layer_shape_changed_add(MaskLayer *masklay, } for (masklay_shape = masklay->splines_shapes.first; masklay_shape; - masklay_shape = masklay_shape->next) { + masklay_shape = masklay_shape->next) + { if (tot == masklay_shape->tot_vert) { float *data_resized; @@ -1999,7 +2011,8 @@ void BKE_mask_layer_shape_changed_remove(MaskLayer *masklay, int index, int coun int tot = BKE_mask_layer_shape_totvert(masklay); for (masklay_shape = masklay->splines_shapes.first; masklay_shape; - masklay_shape = masklay_shape->next) { + masklay_shape = masklay_shape->next) + { if (tot == masklay_shape->tot_vert - count) { float *data_resized; diff --git a/source/blender/blenkernel/intern/mask_evaluate.c b/source/blender/blenkernel/intern/mask_evaluate.c index f71a0fe1d00..5adab377a13 100644 --- a/source/blender/blenkernel/intern/mask_evaluate.c +++ b/source/blender/blenkernel/intern/mask_evaluate.c @@ -844,7 +844,8 @@ void BKE_mask_layer_evaluate_animation(MaskLayer *masklay, const float ctime) MaskLayerShape *masklay_shape_b; int found; if ((found = BKE_mask_layer_shape_find_frame_range( - masklay, ctime, &masklay_shape_a, &masklay_shape_b))) { + masklay, ctime, &masklay_shape_a, &masklay_shape_b))) + { if (found == 1) { #if 0 printf("%s: exact %d %d (%d)\n", @@ -912,7 +913,8 @@ void BKE_mask_eval_animation(struct Depsgraph *depsgraph, Mask *mask) float ctime = DEG_get_ctime(depsgraph); DEG_debug_print_eval(depsgraph, __func__, mask->id.name, mask); for (MaskLayer *mask_layer = mask->masklayers.first; mask_layer != NULL; - mask_layer = mask_layer->next) { + mask_layer = mask_layer->next) + { BKE_mask_layer_evaluate_animation(mask_layer, ctime); } } @@ -923,7 +925,8 @@ void BKE_mask_eval_update(struct Depsgraph *depsgraph, Mask *mask) float ctime = DEG_get_ctime(depsgraph); DEG_debug_print_eval(depsgraph, __func__, mask->id.name, mask); for (MaskLayer *mask_layer = mask->masklayers.first; mask_layer != NULL; - mask_layer = mask_layer->next) { + mask_layer = mask_layer->next) + { BKE_mask_layer_evaluate_deform(mask_layer, ctime); } @@ -932,11 +935,13 @@ void BKE_mask_eval_update(struct Depsgraph *depsgraph, Mask *mask) for (MaskLayer *masklay_orig = mask_orig->masklayers.first, *masklay_eval = mask->masklayers.first; masklay_orig != NULL; - masklay_orig = masklay_orig->next, masklay_eval = masklay_eval->next) { + masklay_orig = masklay_orig->next, masklay_eval = masklay_eval->next) + { for (MaskSpline *spline_orig = masklay_orig->splines.first, *spline_eval = masklay_eval->splines.first; spline_orig != NULL; - spline_orig = spline_orig->next, spline_eval = spline_eval->next) { + spline_orig = spline_orig->next, spline_eval = spline_eval->next) + { for (int i = 0; i < spline_eval->tot_point; i++) { MaskSplinePoint *point_eval = &spline_eval->points[i]; MaskSplinePoint *point_orig = &spline_orig->points[i]; diff --git a/source/blender/blenkernel/intern/mask_rasterize.c b/source/blender/blenkernel/intern/mask_rasterize.c index 97d51a0874e..ab022b2619c 100644 --- a/source/blender/blenkernel/intern/mask_rasterize.c +++ b/source/blender/blenkernel/intern/mask_rasterize.c @@ -346,7 +346,8 @@ static bool layer_bucket_isect_test(const MaskRasterLayer *layer, if ((dist_squared_to_line_segment_v2(cent, v1, v2) < bucket_max_rad_squared) || (dist_squared_to_line_segment_v2(cent, v2, v3) < bucket_max_rad_squared) || - (dist_squared_to_line_segment_v2(cent, v3, v1) < bucket_max_rad_squared)) { + (dist_squared_to_line_segment_v2(cent, v3, v1) < bucket_max_rad_squared)) + { return true; } @@ -369,7 +370,8 @@ static bool layer_bucket_isect_test(const MaskRasterLayer *layer, if ((dist_squared_to_line_segment_v2(cent, v1, v2) < bucket_max_rad_squared) || (dist_squared_to_line_segment_v2(cent, v2, v3) < bucket_max_rad_squared) || (dist_squared_to_line_segment_v2(cent, v3, v4) < bucket_max_rad_squared) || - (dist_squared_to_line_segment_v2(cent, v4, v1) < bucket_max_rad_squared)) { + (dist_squared_to_line_segment_v2(cent, v4, v1) < bucket_max_rad_squared)) + { return true; } @@ -510,7 +512,8 @@ static void layer_bucket_init(MaskRasterLayer *layer, const float pixel_size) yi, bucket_size_x, bucket_size_y, - bucket_max_rad_squared)) { + bucket_max_rad_squared)) + { BLI_linklist_prepend_arena(&bucketstore[bucket_index], face_index_void, arena); bucketstore_tot[bucket_index]++; } @@ -581,7 +584,8 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, sf_arena = BLI_memarena_new(BLI_SCANFILL_ARENA_SIZE, __func__); for (masklay = mask->masklayers.first, masklay_index = 0; masklay; - masklay = masklay->next, masklay_index++) { + masklay = masklay->next, masklay_index++) + { /* we need to store vertex ranges for open splines for filling */ uint tot_splines; @@ -937,7 +941,8 @@ void BKE_maskrasterize_handle_init(MaskRasterHandle *mr_handle, */ if ((masklay->flag & MASK_LAYERFLAG_FILL_OVERLAP) && (is_isect = BLI_scanfill_calc_self_isect( - &sf_ctx, &isect_remvertbase, &isect_remedgebase))) { + &sf_ctx, &isect_remvertbase, &isect_remedgebase))) + { uint sf_vert_tot_isect = (uint)BLI_listbase_count(&sf_ctx.fillvertbase); uint i = sf_vert_tot; @@ -1249,14 +1254,16 @@ static float maskrasterize_layer_isect(const uint *face, /* not essential but avoids unneeded extra lookups */ if ((cos[0][2] < dist_orig) || (cos[1][2] < dist_orig) || (cos[2][2] < dist_orig) || - (cos[3][2] < dist_orig)) { + (cos[3][2] < dist_orig)) + { /* needs work */ #if 1 /* quad check fails for bow-tie, so keep using 2 tri checks */ // if (isect_point_quad_v2(xy, cos[face[0]], cos[face[1]], cos[face[2]], cos[face[3]])) if (isect_point_tri_v2(xy, cos[face[0]], cos[face[1]], cos[face[2]]) || - isect_point_tri_v2(xy, cos[face[0]], cos[face[2]], cos[face[3]])) { + isect_point_tri_v2(xy, cos[face[0]], cos[face[2]], cos[face[3]])) + { return maskrasterize_layer_z_depth_quad( xy, cos[face[0]], cos[face[1]], cos[face[2]], cos[face[3]]); } diff --git a/source/blender/blenkernel/intern/material.cc b/source/blender/blenkernel/intern/material.cc index fde5a40f765..6bcd3ad1313 100644 --- a/source/blender/blenkernel/intern/material.cc +++ b/source/blender/blenkernel/intern/material.cc @@ -1316,7 +1316,8 @@ bool BKE_object_material_slot_remove(Main *bmain, Object *ob) const int actcol = ob->actcol; for (Object *obt = static_cast(bmain->objects.first); obt; - obt = static_cast(obt->id.next)) { + obt = static_cast(obt->id.next)) + { if (obt->data == ob->data) { /* Can happen when object material lists are used, see: #52953 */ if (actcol > obt->totcol) { @@ -1397,7 +1398,8 @@ static bool ntree_foreach_texnode_recursive(bNodeTree *nodetree, const bool do_color_attributes = (slot_filter & PAINT_SLOT_COLOR_ATTRIBUTE) != 0; for (bNode *node : nodetree->all_nodes()) { if (do_image_nodes && node->typeinfo->nclass == NODE_CLASS_TEXTURE && - node->typeinfo->type == SH_NODE_TEX_IMAGE && node->id) { + node->typeinfo->type == SH_NODE_TEX_IMAGE && node->id) + { if (!callback(node, userdata)) { return false; } @@ -1409,8 +1411,8 @@ static bool ntree_foreach_texnode_recursive(bNodeTree *nodetree, } else if (ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP) && node->id) { /* recurse into the node group and see if it contains any textures */ - if (!ntree_foreach_texnode_recursive( - (bNodeTree *)node->id, callback, userdata, slot_filter)) { + if (!ntree_foreach_texnode_recursive((bNodeTree *)node->id, callback, userdata, slot_filter)) + { return false; } } @@ -1576,7 +1578,8 @@ void BKE_texpaint_slot_refresh_cache(Scene *scene, Material *ma, const struct Ob ma->paint_clone_slot != prev_paint_clone_slot || (ma->texpaintslot && prev_texpaintslot && memcmp(ma->texpaintslot, prev_texpaintslot, sizeof(*ma->texpaintslot) * ma->tot_slots) != - 0)) { + 0)) + { DEG_id_tag_update(&ma->id, ID_RECALC_SHADING | ID_RECALC_COPY_ON_WRITE); } diff --git a/source/blender/blenkernel/intern/mball.cc b/source/blender/blenkernel/intern/mball.cc index f6222973a21..4a4144bc2b5 100644 --- a/source/blender/blenkernel/intern/mball.cc +++ b/source/blender/blenkernel/intern/mball.cc @@ -377,7 +377,8 @@ void BKE_mball_properties_copy(Main *bmain, MetaBall *metaball_src) * think it would be worth it. */ for (Object *ob_src = static_cast(bmain->objects.first); - ob_src != nullptr && !ID_IS_LINKED(ob_src);) { + ob_src != nullptr && !ID_IS_LINKED(ob_src);) + { if (ob_src->data != metaball_src) { ob_src = static_cast(ob_src->id.next); continue; @@ -398,7 +399,8 @@ void BKE_mball_properties_copy(Main *bmain, MetaBall *metaball_src) BLI_split_name_num(obactive_name, &obactive_nr, ob_src->id.name + 2, '.'); for (ob_iter = static_cast(ob_src->id.prev); ob_iter != nullptr; - ob_iter = static_cast(ob_iter->id.prev)) { + ob_iter = static_cast(ob_iter->id.prev)) + { if (ob_iter->id.name[2] != obactive_name[0]) { break; } @@ -414,7 +416,8 @@ void BKE_mball_properties_copy(Main *bmain, MetaBall *metaball_src) } for (ob_iter = static_cast(ob_src->id.next); ob_iter != nullptr; - ob_iter = static_cast(ob_iter->id.next)) { + ob_iter = static_cast(ob_iter->id.next)) + { if (ob_iter->id.name[2] != obactive_name[0] || ID_IS_LINKED(ob_iter)) { break; } diff --git a/source/blender/blenkernel/intern/mball_tessellate.cc b/source/blender/blenkernel/intern/mball_tessellate.cc index 96cb2cc7e52..dcc74d57bc2 100644 --- a/source/blender/blenkernel/intern/mball_tessellate.cc +++ b/source/blender/blenkernel/intern/mball_tessellate.cc @@ -417,7 +417,8 @@ static float metaball(PROCESS *process, float x, float y, float z) for (int i = 0; i < 2; i++) { if ((node->bb[i].min[0] <= x) && (node->bb[i].max[0] >= x) && (node->bb[i].min[1] <= y) && - (node->bb[i].max[1] >= y) && (node->bb[i].min[2] <= z) && (node->bb[i].max[2] >= z)) { + (node->bb[i].max[1] >= y) && (node->bb[i].min[2] <= z) && (node->bb[i].max[2] >= z)) + { if (node->child[i]) { process->bvh_queue[front++] = node->child[i]; } @@ -1194,7 +1195,8 @@ static void init_meta(Depsgraph *depsgraph, PROCESS *process, Scene *scene, Obje * the instancer is visible too. */ if ((base->flag_legacy & OB_FROMDUPLI) == 0 && ob->parent != nullptr && (ob->parent->transflag & parenting_dupli_transflag) != 0 && - (BKE_object_visibility(ob->parent, deg_eval_mode) & OB_VISIBLE_SELF) == 0) { + (BKE_object_visibility(ob->parent, deg_eval_mode) & OB_VISIBLE_SELF) == 0) + { continue; } @@ -1438,7 +1440,8 @@ Mesh *BKE_mball_polygonize(Depsgraph *depsgraph, Scene *scene, Object *ob) * the open movie "Sintel", using 0.00001f. */ if (ob->scale[0] < 0.00001f * (process.allbb.max[0] - process.allbb.min[0]) || ob->scale[1] < 0.00001f * (process.allbb.max[1] - process.allbb.min[1]) || - ob->scale[2] < 0.00001f * (process.allbb.max[2] - process.allbb.min[2])) { + ob->scale[2] < 0.00001f * (process.allbb.max[2] - process.allbb.min[2])) + { freepolygonize(&process); return nullptr; } diff --git a/source/blender/blenkernel/intern/mesh.cc b/source/blender/blenkernel/intern/mesh.cc index 286c152ffe8..b4866067015 100644 --- a/source/blender/blenkernel/intern/mesh.cc +++ b/source/blender/blenkernel/intern/mesh.cc @@ -565,7 +565,8 @@ static int customdata_compare( for (int i = 0; i < c1->totlayer; i++) { l1 = &c1->layers[i]; if ((CD_TYPE_AS_MASK(l1->type) & cd_mask_all_attr) && l1->anonymous_id == nullptr && - !is_uv_bool_sublayer(*l1)) { + !is_uv_bool_sublayer(*l1)) + { layer_count1++; } } @@ -573,7 +574,8 @@ static int customdata_compare( for (int i = 0; i < c2->totlayer; i++) { l2 = &c2->layers[i]; if ((CD_TYPE_AS_MASK(l2->type) & cd_mask_all_attr) && l2->anonymous_id == nullptr && - !is_uv_bool_sublayer(*l2)) { + !is_uv_bool_sublayer(*l2)) + { layer_count2++; } } @@ -800,7 +802,8 @@ const char *BKE_mesh_cmp(Mesh *me1, Mesh *me2, float thresh) } if (!std::equal( - me1->poly_offsets().begin(), me1->poly_offsets().end(), me2->poly_offsets().begin())) { + me1->poly_offsets().begin(), me1->poly_offsets().end(), me2->poly_offsets().begin())) + { return "Face sizes don't match"; } @@ -1316,7 +1319,8 @@ void BKE_mesh_texspace_calc(Mesh *me) void BKE_mesh_texspace_ensure(Mesh *me) { if ((me->texspace_flag & ME_TEXSPACE_FLAG_AUTO) && - !(me->texspace_flag & ME_TEXSPACE_FLAG_AUTO_EVALUATED)) { + !(me->texspace_flag & ME_TEXSPACE_FLAG_AUTO_EVALUATED)) + { BKE_mesh_texspace_calc(me); } } diff --git a/source/blender/blenkernel/intern/mesh_evaluate.cc b/source/blender/blenkernel/intern/mesh_evaluate.cc index f7fba92f2a2..ef3ec26ac78 100644 --- a/source/blender/blenkernel/intern/mesh_evaluate.cc +++ b/source/blender/blenkernel/intern/mesh_evaluate.cc @@ -454,7 +454,8 @@ void BKE_mesh_calc_volume(const float (*vert_positions)[3], } if (!mesh_calc_center_centroid_ex( - vert_positions, mverts_num, looptri, looptri_num, corner_verts, center)) { + vert_positions, mverts_num, looptri, looptri_num, corner_verts, center)) + { return; } diff --git a/source/blender/blenkernel/intern/mesh_legacy_convert.cc b/source/blender/blenkernel/intern/mesh_legacy_convert.cc index 40155d4fb3b..2da4be71ddc 100644 --- a/source/blender/blenkernel/intern/mesh_legacy_convert.cc +++ b/source/blender/blenkernel/intern/mesh_legacy_convert.cc @@ -825,7 +825,8 @@ static void mesh_loops_to_tessdata(CustomData *fdata, CustomData_get_layer_n(ldata, CD_PROP_FLOAT2, i)); for (findex = 0, pidx = polyindices, lidx = loopindices; findex < num_faces; - pidx++, lidx++, findex++, texface++) { + pidx++, lidx++, findex++, texface++) + { for (j = (mface ? mface[findex].v4 : (*lidx)[3]) ? 4 : 3; j--;) { copy_v2_v2(texface->uv[j], uv[(*lidx)[j]]); } @@ -884,7 +885,8 @@ static void mesh_loops_to_tessdata(CustomData *fdata, const float(*ltangents)[4] = (const float(*)[4])CustomData_get_layer(ldata, CD_TANGENT); for (findex = 0, pidx = polyindices, lidx = loopindices; findex < num_faces; - pidx++, lidx++, findex++) { + pidx++, lidx++, findex++) + { int nverts = (mface ? mface[findex].v4 : (*lidx)[3]) ? 4 : 3; for (j = nverts; j--;) { copy_v4_v4(ftangents[findex * 4 + j], ltangents[(*lidx)[j]]); @@ -917,7 +919,8 @@ int BKE_mesh_mface_index_validate(MFace *mface, CustomData *fdata, int mfindex, if (nr == 3) { if ( /* real edges */ - mface->v1 == mface->v2 || mface->v2 == mface->v3 || mface->v3 == mface->v1) { + mface->v1 == mface->v2 || mface->v2 == mface->v3 || mface->v3 == mface->v1) + { return 0; } } @@ -927,7 +930,8 @@ int BKE_mesh_mface_index_validate(MFace *mface, CustomData *fdata, int mfindex, mface->v1 == mface->v2 || mface->v2 == mface->v3 || mface->v3 == mface->v4 || mface->v4 == mface->v1 || /* across the face */ - mface->v1 == mface->v3 || mface->v2 == mface->v4) { + mface->v1 == mface->v3 || mface->v2 == mface->v4) + { return 0; } } @@ -1236,7 +1240,8 @@ void BKE_mesh_legacy_sharp_faces_to_flags(Mesh *mesh, blender::MutableSpan( - CustomData_get_layer_named(&mesh->pdata, CD_PROP_BOOL, "sharp_face"))) { + CustomData_get_layer_named(&mesh->pdata, CD_PROP_BOOL, "sharp_face"))) + { threading::parallel_for(legacy_polys.index_range(), 4096, [&](const IndexRange range) { for (const int i : range) { SET_FLAG_FROM_TEST(legacy_polys[i].flag_legacy, !sharp_faces[i], ME_SMOOTH); @@ -1262,7 +1267,8 @@ void BKE_mesh_legacy_sharp_faces_from_flags(Mesh *mesh) mesh->totpoly); if (std::any_of(polys.begin(), polys.end(), [](const MPoly &poly) { return !(poly.flag_legacy & ME_SMOOTH); - })) { + })) + { SpanAttributeWriter sharp_faces = attributes.lookup_or_add_for_write_only_span( "sharp_face", ATTR_DOMAIN_FACE); threading::parallel_for(polys.index_range(), 4096, [&](const IndexRange range) { @@ -1348,7 +1354,8 @@ void BKE_mesh_legacy_bevel_weight_from_layers(Mesh *mesh) using namespace blender; MutableSpan verts(mesh->mvert, mesh->totvert); if (const float *weights = static_cast( - CustomData_get_layer(&mesh->vdata, CD_BWEIGHT))) { + CustomData_get_layer(&mesh->vdata, CD_BWEIGHT))) + { mesh->cd_flag |= ME_CDFLAG_VERT_BWEIGHT; for (const int i : verts.index_range()) { verts[i].bweight_legacy = std::clamp(weights[i], 0.0f, 1.0f) * 255.0f; @@ -1362,7 +1369,8 @@ void BKE_mesh_legacy_bevel_weight_from_layers(Mesh *mesh) } MutableSpan edges(mesh->medge, mesh->totedge); if (const float *weights = static_cast( - CustomData_get_layer(&mesh->edata, CD_BWEIGHT))) { + CustomData_get_layer(&mesh->edata, CD_BWEIGHT))) + { mesh->cd_flag |= ME_CDFLAG_EDGE_BWEIGHT; for (const int i : edges.index_range()) { edges[i].bweight_legacy = std::clamp(weights[i], 0.0f, 1.0f) * 255.0f; @@ -1413,7 +1421,8 @@ void BKE_mesh_legacy_edge_crease_from_layers(Mesh *mesh) using namespace blender; MutableSpan edges(mesh->medge, mesh->totedge); if (const float *creases = static_cast( - CustomData_get_layer(&mesh->edata, CD_CREASE))) { + CustomData_get_layer(&mesh->edata, CD_CREASE))) + { mesh->cd_flag |= ME_CDFLAG_EDGE_CREASE; for (const int i : edges.index_range()) { edges[i].crease_legacy = std::clamp(creases[i], 0.0f, 1.0f) * 255.0f; @@ -1454,7 +1463,8 @@ void BKE_mesh_legacy_sharp_edges_to_flags(Mesh *mesh) using namespace blender; MutableSpan edges(mesh->medge, mesh->totedge); if (const bool *sharp_edges = static_cast( - CustomData_get_layer_named(&mesh->edata, CD_PROP_BOOL, "sharp_edge"))) { + CustomData_get_layer_named(&mesh->edata, CD_PROP_BOOL, "sharp_edge"))) + { threading::parallel_for(edges.index_range(), 4096, [&](const IndexRange range) { for (const int i : range) { SET_FLAG_FROM_TEST(edges[i].flag_legacy, sharp_edges[i], ME_SHARP); @@ -1482,7 +1492,8 @@ void BKE_mesh_legacy_sharp_edges_from_flags(Mesh *mesh) } if (std::any_of(edges.begin(), edges.end(), [](const MEdge &edge) { return edge.flag_legacy & ME_SHARP; - })) { + })) + { SpanAttributeWriter sharp_edges = attributes.lookup_or_add_for_write_only_span( "sharp_edge", ATTR_DOMAIN_EDGE); threading::parallel_for(edges.index_range(), 4096, [&](const IndexRange range) { @@ -1505,7 +1516,8 @@ void BKE_mesh_legacy_uv_seam_to_flags(Mesh *mesh) using namespace blender; MutableSpan edges(mesh->medge, mesh->totedge); if (const bool *uv_seams = static_cast( - CustomData_get_layer_named(&mesh->edata, CD_PROP_BOOL, ".uv_seam"))) { + CustomData_get_layer_named(&mesh->edata, CD_PROP_BOOL, ".uv_seam"))) + { threading::parallel_for(edges.index_range(), 4096, [&](const IndexRange range) { for (const int i : range) { SET_FLAG_FROM_TEST(edges[i].flag_legacy, uv_seams[i], ME_SEAM); @@ -1533,7 +1545,8 @@ void BKE_mesh_legacy_uv_seam_from_flags(Mesh *mesh) } if (std::any_of(edges.begin(), edges.end(), [](const MEdge &edge) { return edge.flag_legacy & ME_SEAM; - })) { + })) + { SpanAttributeWriter uv_seams = attributes.lookup_or_add_for_write_only_span( ".uv_seam", ATTR_DOMAIN_EDGE); threading::parallel_for(edges.index_range(), 4096, [&](const IndexRange range) { @@ -1591,13 +1604,15 @@ void BKE_mesh_legacy_convert_flags_to_hide_layers(Mesh *mesh) using namespace blender::bke; MutableAttributeAccessor attributes = mesh->attributes_for_write(); if (!mesh->mvert || attributes.contains(".hide_vert") || attributes.contains(".hide_edge") || - attributes.contains(".hide_poly")) { + attributes.contains(".hide_poly")) + { return; } const Span verts(mesh->mvert, mesh->totvert); if (std::any_of(verts.begin(), verts.end(), [](const MVert &vert) { return vert.flag_legacy & ME_HIDE; - })) { + })) + { SpanAttributeWriter hide_vert = attributes.lookup_or_add_for_write_only_span( ".hide_vert", ATTR_DOMAIN_POINT); threading::parallel_for(verts.index_range(), 4096, [&](IndexRange range) { @@ -1612,7 +1627,8 @@ void BKE_mesh_legacy_convert_flags_to_hide_layers(Mesh *mesh) const Span edges(mesh->medge, mesh->totedge); if (std::any_of(edges.begin(), edges.end(), [](const MEdge &edge) { return edge.flag_legacy & ME_HIDE; - })) { + })) + { SpanAttributeWriter hide_edge = attributes.lookup_or_add_for_write_only_span( ".hide_edge", ATTR_DOMAIN_EDGE); threading::parallel_for(edges.index_range(), 4096, [&](IndexRange range) { @@ -1628,7 +1644,8 @@ void BKE_mesh_legacy_convert_flags_to_hide_layers(Mesh *mesh) mesh->totpoly); if (std::any_of(polys.begin(), polys.end(), [](const MPoly &poly) { return poly.flag_legacy & ME_HIDE; - })) { + })) + { SpanAttributeWriter hide_poly = attributes.lookup_or_add_for_write_only_span( ".hide_poly", ATTR_DOMAIN_FACE); threading::parallel_for(polys.index_range(), 4096, [&](IndexRange range) { @@ -1672,7 +1689,8 @@ void BKE_mesh_legacy_convert_mpoly_to_material_indices(Mesh *mesh) const Span polys(static_cast(CustomData_get_layer(&mesh->pdata, CD_MPOLY)), mesh->totpoly); if (std::any_of( - polys.begin(), polys.end(), [](const MPoly &poly) { return poly.mat_nr_legacy != 0; })) { + polys.begin(), polys.end(), [](const MPoly &poly) { return poly.mat_nr_legacy != 0; })) + { SpanAttributeWriter material_indices = attributes.lookup_or_add_for_write_only_span( "material_index", ATTR_DOMAIN_FACE); threading::parallel_for(polys.index_range(), 4096, [&](IndexRange range) { @@ -1940,14 +1958,15 @@ void BKE_mesh_legacy_convert_flags_to_selection_layers(Mesh *mesh) using namespace blender::bke; MutableAttributeAccessor attributes = mesh->attributes_for_write(); if (!mesh->mvert || attributes.contains(".select_vert") || attributes.contains(".select_edge") || - attributes.contains(".select_poly")) { + attributes.contains(".select_poly")) + { return; } const Span verts(mesh->mvert, mesh->totvert); - if (std::any_of(verts.begin(), verts.end(), [](const MVert &vert) { - return vert.flag_legacy & SELECT; - })) { + if (std::any_of( + verts.begin(), verts.end(), [](const MVert &vert) { return vert.flag_legacy & SELECT; })) + { SpanAttributeWriter select_vert = attributes.lookup_or_add_for_write_only_span( ".select_vert", ATTR_DOMAIN_POINT); threading::parallel_for(verts.index_range(), 4096, [&](IndexRange range) { @@ -1962,7 +1981,8 @@ void BKE_mesh_legacy_convert_flags_to_selection_layers(Mesh *mesh) const Span edges(mesh->medge, mesh->totedge); if (std::any_of(edges.begin(), edges.end(), [](const MEdge &edge) { return edge.flag_legacy & SELECT; - })) { + })) + { SpanAttributeWriter select_edge = attributes.lookup_or_add_for_write_only_span( ".select_edge", ATTR_DOMAIN_EDGE); threading::parallel_for(edges.index_range(), 4096, [&](IndexRange range) { @@ -1978,7 +1998,8 @@ void BKE_mesh_legacy_convert_flags_to_selection_layers(Mesh *mesh) mesh->totpoly); if (std::any_of(polys.begin(), polys.end(), [](const MPoly &poly) { return poly.flag_legacy & ME_FACE_SEL; - })) { + })) + { SpanAttributeWriter select_poly = attributes.lookup_or_add_for_write_only_span( ".select_poly", ATTR_DOMAIN_FACE); threading::parallel_for(polys.index_range(), 4096, [&](IndexRange range) { @@ -2284,7 +2305,8 @@ void BKE_mesh_legacy_convert_loops_to_corners(Mesh *mesh) { using namespace blender; if (CustomData_get_layer_named(&mesh->ldata, CD_PROP_INT32, ".corner_vert") && - CustomData_get_layer_named(&mesh->ldata, CD_PROP_INT32, ".corner_edge")) { + CustomData_get_layer_named(&mesh->ldata, CD_PROP_INT32, ".corner_edge")) + { return; } const Span loops(static_cast(CustomData_get_layer(&mesh->ldata, CD_MLOOP)), diff --git a/source/blender/blenkernel/intern/mesh_mapping.cc b/source/blender/blenkernel/intern/mesh_mapping.cc index 020c561a926..c62d8e1a2ce 100644 --- a/source/blender/blenkernel/intern/mesh_mapping.cc +++ b/source/blender/blenkernel/intern/mesh_mapping.cc @@ -132,7 +132,8 @@ UvVertMap *BKE_mesh_uv_vert_map_create(const blender::OffsetIndices polys, sub_v2_v2v2(uvdiff, uv2, uv); if (fabsf(uv[0] - uv2[0]) < limit[0] && fabsf(uv[1] - uv2[1]) < limit[1] && - (!use_winding || winding[iterv->poly_index] == winding[v->poly_index])) { + (!use_winding || winding[iterv->poly_index] == winding[v->poly_index])) + { if (lastv) { lastv->next = next; } @@ -825,7 +826,8 @@ int *BKE_mesh_calc_smoothgroups(const int totedge, /* Edge is sharp if one of its polys is flat, or edge itself is sharp, * or edge is not used by exactly two polygons. */ if ((poly_is_smooth(poly_index)) && !(sharp_edges && sharp_edges[edge_index]) && - (edge_user_count == 2)) { + (edge_user_count == 2)) + { /* In that case, edge appears to be smooth, but we need to check its other poly too. */ const int other_poly_index = (poly_index == edge_poly_map_elem.indices[0]) ? edge_poly_map_elem.indices[1] : @@ -1033,7 +1035,8 @@ static bool mesh_calc_islands_loop_poly_uv(const int totedge, for (int i = 2; i < edge_to_loops.count; i += 2) { if (corner_verts[edge_to_loops.indices[i]] == v1) { if (!equals_v2v2(uvco_v1, luvs[edge_to_loops.indices[i]]) || - !equals_v2v2(uvco_v2, luvs[edge_to_loops.indices[i + 1]])) { + !equals_v2v2(uvco_v2, luvs[edge_to_loops.indices[i + 1]])) + { return true; } } @@ -1041,7 +1044,8 @@ static bool mesh_calc_islands_loop_poly_uv(const int totedge, BLI_assert(corner_verts[edge_to_loops.indices[i]] == v2); UNUSED_VARS_NDEBUG(v2); if (!equals_v2v2(uvco_v2, luvs[edge_to_loops.indices[i]]) || - !equals_v2v2(uvco_v1, luvs[edge_to_loops.indices[i + 1]])) { + !equals_v2v2(uvco_v1, luvs[edge_to_loops.indices[i + 1]])) + { return true; } } diff --git a/source/blender/blenkernel/intern/mesh_merge_customdata.cc b/source/blender/blenkernel/intern/mesh_merge_customdata.cc index a4d9524b612..a135a7e7d55 100644 --- a/source/blender/blenkernel/intern/mesh_merge_customdata.cc +++ b/source/blender/blenkernel/intern/mesh_merge_customdata.cc @@ -52,7 +52,8 @@ static int compare_v2_classify(const float uv_a[2], const float uv_b[2]) const int diff_ulp = 12; if (compare_ff_relative(uv_a[0], uv_b[0], diff_abs, diff_ulp) && - compare_ff_relative(uv_a[1], uv_b[1], diff_abs, diff_ulp)) { + compare_ff_relative(uv_a[1], uv_b[1], diff_abs, diff_ulp)) + { return CMP_CLOSE; } return CMP_APART; diff --git a/source/blender/blenkernel/intern/mesh_mirror.cc b/source/blender/blenkernel/intern/mesh_mirror.cc index 70a0429de4e..dbcef51eb8d 100644 --- a/source/blender/blenkernel/intern/mesh_mirror.cc +++ b/source/blender/blenkernel/intern/mesh_mirror.cc @@ -343,7 +343,8 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd, /* handle uvs, * let tessface recalc handle updating the MTFace data */ if (mmd->flag & (MOD_MIR_MIRROR_U | MOD_MIR_MIRROR_V) || - (is_zero_v2(mmd->uv_offset_copy) == false)) { + (is_zero_v2(mmd->uv_offset_copy) == false)) + { const bool do_mirr_u = (mmd->flag & MOD_MIR_MIRROR_U) != 0; const bool do_mirr_v = (mmd->flag & MOD_MIR_MIRROR_V) != 0; /* If set, flip around center of each tile. */ @@ -383,7 +384,8 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd, /* handle custom split normals */ if (ob->type == OB_MESH && (((Mesh *)ob->data)->flag & ME_AUTOSMOOTH) && - CustomData_has_layer(&result->ldata, CD_CUSTOMLOOPNORMAL) && result->totpoly > 0) { + CustomData_has_layer(&result->ldata, CD_CUSTOMLOOPNORMAL) && result->totpoly > 0) + { blender::Array loop_normals(result_corner_verts.size()); CustomData *ldata = &result->ldata; blender::short2 *clnors = static_cast( @@ -451,8 +453,8 @@ Mesh *BKE_mesh_mirror_apply_mirror_on_axis_for_modifier(MirrorModifierData *mmd, ((*r_vert_merge_map)[i + src_verts_num] != -1)) { BKE_defvert_flip_merged(dvert - src_verts_num, flip_map, flip_map_len); } - else if (!use_correct_order_on_merge && do_vtargetmap && - ((*r_vert_merge_map)[i] != -1)) { + else if (!use_correct_order_on_merge && do_vtargetmap && ((*r_vert_merge_map)[i] != -1)) + { BKE_defvert_flip_merged(dvert, flip_map, flip_map_len); } else { diff --git a/source/blender/blenkernel/intern/mesh_normals.cc b/source/blender/blenkernel/intern/mesh_normals.cc index 733db6c6591..0d62e666e73 100644 --- a/source/blender/blenkernel/intern/mesh_normals.cc +++ b/source/blender/blenkernel/intern/mesh_normals.cc @@ -479,7 +479,8 @@ void BKE_lnor_space_define(MLoopNorSpace *lnor_space, const float dtp_other = dot_v3v3(vec_other, lnor); if (UNLIKELY(fabsf(dtp_ref) >= LNOR_SPACE_TRIGO_THRESHOLD || - fabsf(dtp_other) >= LNOR_SPACE_TRIGO_THRESHOLD)) { + fabsf(dtp_other) >= LNOR_SPACE_TRIGO_THRESHOLD)) + { /* If vec_ref or vec_other are too much aligned with lnor, we can't build lnor space, * tag it as invalid and abort. */ lnor_space->ref_alpha = lnor_space->ref_beta = 0.0f; @@ -723,7 +724,8 @@ static void mesh_edges_sharp_tag(const OffsetIndices polys, * same vertex, or angle between both its polys' normals is above split_angle value. */ if (!poly_is_smooth(poly_i) || (!sharp_edges.is_empty() && sharp_edges[edge_i]) || - vert_i == corner_verts[e2l[0]] || is_angle_sharp) { + vert_i == corner_verts[e2l[0]] || is_angle_sharp) + { /* NOTE: we are sure that loop != 0 here ;). */ e2l[1] = INDEX_INVALID; @@ -812,7 +814,8 @@ static void loop_manifold_fan_around_vert_next(const Span corner_verts, const int vert_fan_next = corner_verts[*r_mlfan_curr_index]; const IndexRange poly_fan_next = polys[*r_mpfan_curr_index]; if ((vert_fan_orig == vert_fan_next && vert_fan_orig == vert_pivot) || - !ELEM(vert_fan_orig, vert_fan_next, vert_pivot)) { + !ELEM(vert_fan_orig, vert_fan_next, vert_pivot)) + { /* We need the previous loop, but current one is our vertex's loop. */ *r_mlfan_vert_index = *r_mlfan_curr_index; if (--(*r_mlfan_curr_index) < poly_fan_next.start()) { @@ -1175,12 +1178,14 @@ static void loop_split_generator(LoopSplitTaskDataCommon *common_data, skip_loops, ml_curr_index, ml_prev_index, - poly_index))) { + poly_index))) + { // printf("SKIPPING!\n"); } else { if (IS_EDGE_SHARP(edge_to_loops[corner_edges[ml_curr_index]]) && - IS_EDGE_SHARP(edge_to_loops[corner_edges[ml_prev_index]])) { + IS_EDGE_SHARP(edge_to_loops[corner_edges[ml_prev_index]])) + { /* Simple case (both edges around that vertex are sharp in current polygon), * this corner just takes its poly normal. */ r_single_corners.append(ml_curr_index); diff --git a/source/blender/blenkernel/intern/mesh_remap.cc b/source/blender/blenkernel/intern/mesh_remap.cc index ef2c39af8f9..36f348d5a10 100644 --- a/source/blender/blenkernel/intern/mesh_remap.cc +++ b/source/blender/blenkernel/intern/mesh_remap.cc @@ -500,8 +500,8 @@ void BKE_mesh_remap_calc_verts_from_mesh(const int mode, BLI_space_transform_apply(space_transform, tmp_co); } - if (mesh_remap_bvhtree_query_nearest( - &treedata, &nearest, tmp_co, max_dist_sq, &hit_dist)) { + if (mesh_remap_bvhtree_query_nearest(&treedata, &nearest, tmp_co, max_dist_sq, &hit_dist)) + { mesh_remap_item_define(r_map, i, hit_dist, 0, 1, &nearest.index, &full_weight); } else { @@ -525,8 +525,8 @@ void BKE_mesh_remap_calc_verts_from_mesh(const int mode, BLI_space_transform_apply(space_transform, tmp_co); } - if (mesh_remap_bvhtree_query_nearest( - &treedata, &nearest, tmp_co, max_dist_sq, &hit_dist)) { + if (mesh_remap_bvhtree_query_nearest(&treedata, &nearest, tmp_co, max_dist_sq, &hit_dist)) + { const blender::int2 &edge = edges_src[nearest.index]; const float *v1cos = positions_src[edge[0]]; const float *v2cos = positions_src[edge[1]]; @@ -561,7 +561,8 @@ void BKE_mesh_remap_calc_verts_from_mesh(const int mode, else if (ELEM(mode, MREMAP_MODE_VERT_POLY_NEAREST, MREMAP_MODE_VERT_POLYINTERP_NEAREST, - MREMAP_MODE_VERT_POLYINTERP_VNORPROJ)) { + MREMAP_MODE_VERT_POLYINTERP_VNORPROJ)) + { const blender::OffsetIndices polys_src = me_src->polys(); const blender::Span corner_verts_src = me_src->corner_verts(); const blender::Span positions_src = me_src->vert_positions(); @@ -588,7 +589,8 @@ void BKE_mesh_remap_calc_verts_from_mesh(const int mode, } if (mesh_remap_bvhtree_query_raycast( - &treedata, &rayhit, tmp_co, tmp_no, ray_radius, max_dist, &hit_dist)) { + &treedata, &rayhit, tmp_co, tmp_no, ray_radius, max_dist, &hit_dist)) + { const MLoopTri *lt = &treedata.looptri[rayhit.index]; const int sources_num = mesh_remap_interp_poly_data_get(polys_src[lt->poly], corner_verts_src, @@ -853,8 +855,8 @@ void BKE_mesh_remap_calc_edges_from_mesh(const int mode, BLI_space_transform_apply(space_transform, tmp_co); } - if (mesh_remap_bvhtree_query_nearest( - &treedata, &nearest, tmp_co, max_dist_sq, &hit_dist)) { + if (mesh_remap_bvhtree_query_nearest(&treedata, &nearest, tmp_co, max_dist_sq, &hit_dist)) + { mesh_remap_item_define(r_map, i, hit_dist, 0, 1, &nearest.index, &full_weight); } else { @@ -882,8 +884,8 @@ void BKE_mesh_remap_calc_edges_from_mesh(const int mode, BLI_space_transform_apply(space_transform, tmp_co); } - if (mesh_remap_bvhtree_query_nearest( - &treedata, &nearest, tmp_co, max_dist_sq, &hit_dist)) { + if (mesh_remap_bvhtree_query_nearest(&treedata, &nearest, tmp_co, max_dist_sq, &hit_dist)) + { const MLoopTri *lt = &treedata.looptri[nearest.index]; const blender::IndexRange poly_src = polys_src[lt->poly]; const int *corner_edge_src = &corner_edges_src[poly_src.start()]; @@ -984,7 +986,8 @@ void BKE_mesh_remap_calc_edges_from_mesh(const int mode, while (n--) { if (mesh_remap_bvhtree_query_raycast( - &treedata, &rayhit, tmp_co, tmp_no, ray_radius / w, max_dist, &hit_dist)) { + &treedata, &rayhit, tmp_co, tmp_no, ray_radius / w, max_dist, &hit_dist)) + { weights[rayhit.index] += w; totweights += w; hit_dist_accum += hit_dist; @@ -1585,8 +1588,8 @@ void BKE_mesh_remap_calc_loops_from_mesh(const int mode, BLI_space_transform_apply(space_transform, tmp_co); } - if (mesh_remap_bvhtree_query_nearest( - tdata, &nearest, tmp_co, max_dist_sq, &hit_dist)) { + if (mesh_remap_bvhtree_query_nearest(tdata, &nearest, tmp_co, max_dist_sq, &hit_dist)) + { float(*nor_dst)[3]; blender::Span nors_src; float best_nor_dot = -2.0f; @@ -1696,7 +1699,8 @@ void BKE_mesh_remap_calc_loops_from_mesh(const int mode, while (n--) { if (mesh_remap_bvhtree_query_raycast( - tdata, &rayhit, tmp_co, tmp_no, ray_radius / w, max_dist, &hit_dist)) { + tdata, &rayhit, tmp_co, tmp_no, ray_radius / w, max_dist, &hit_dist)) + { islands_res[tindex][plidx_dst].factor = (hit_dist ? (1.0f / hit_dist) : 1e18f) * w; islands_res[tindex][plidx_dst].hit_dist = hit_dist; islands_res[tindex][plidx_dst].index_src = int(tdata->looptri[rayhit.index].poly); @@ -1747,8 +1751,8 @@ void BKE_mesh_remap_calc_loops_from_mesh(const int mode, BLI_space_transform_apply(space_transform, tmp_co); } - if (mesh_remap_bvhtree_query_nearest( - tdata, &nearest, tmp_co, max_dist_sq, &hit_dist)) { + if (mesh_remap_bvhtree_query_nearest(tdata, &nearest, tmp_co, max_dist_sq, &hit_dist)) + { islands_res[tindex][plidx_dst].factor = hit_dist ? (1.0f / hit_dist) : 1e18f; islands_res[tindex][plidx_dst].hit_dist = hit_dist; islands_res[tindex][plidx_dst].index_src = int(tdata->looptri[nearest.index].poly); @@ -2165,8 +2169,8 @@ void BKE_mesh_remap_calc_polys_from_mesh(const int mode, BLI_space_transform_apply(space_transform, tmp_co); } - if (mesh_remap_bvhtree_query_nearest( - &treedata, &nearest, tmp_co, max_dist_sq, &hit_dist)) { + if (mesh_remap_bvhtree_query_nearest(&treedata, &nearest, tmp_co, max_dist_sq, &hit_dist)) + { const MLoopTri *lt = &treedata.looptri[nearest.index]; const int poly_index = int(lt->poly); mesh_remap_item_define(r_map, int(i), hit_dist, 0, 1, &poly_index, &full_weight); @@ -2193,7 +2197,8 @@ void BKE_mesh_remap_calc_polys_from_mesh(const int mode, } if (mesh_remap_bvhtree_query_raycast( - &treedata, &rayhit, tmp_co, tmp_no, ray_radius, max_dist, &hit_dist)) { + &treedata, &rayhit, tmp_co, tmp_no, ray_radius, max_dist, &hit_dist)) + { const MLoopTri *lt = &treedata.looptri[rayhit.index]; const int poly_index = int(lt->poly); @@ -2348,7 +2353,8 @@ void BKE_mesh_remap_calc_polys_from_mesh(const int mode, /* At this point, tmp_co is a point on our poly surface, in mesh_src space! */ while (n--) { if (mesh_remap_bvhtree_query_raycast( - &treedata, &rayhit, tmp_co, tmp_no, ray_radius / w, max_dist, &hit_dist)) { + &treedata, &rayhit, tmp_co, tmp_no, ray_radius / w, max_dist, &hit_dist)) + { const MLoopTri *lt = &treedata.looptri[rayhit.index]; weights[lt->poly] += w; diff --git a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc index be66df2e7e0..8b3808b5034 100644 --- a/source/blender/blenkernel/intern/mesh_remesh_voxel.cc +++ b/source/blender/blenkernel/intern/mesh_remesh_voxel.cc @@ -369,7 +369,8 @@ void BKE_remesh_reproject_vertex_paint(Mesh *target, const Mesh *source) int *target_lmap_mem = nullptr; while ((layer = BKE_id_attribute_from_index( - const_cast(&source->id), i++, ATTR_DOMAIN_MASK_COLOR, CD_MASK_COLOR_ALL))) { + const_cast(&source->id), i++, ATTR_DOMAIN_MASK_COLOR, CD_MASK_COLOR_ALL))) + { eAttrDomain domain = BKE_id_attribute_domain(&source->id, layer); const eCustomDataType type = eCustomDataType(layer->type); diff --git a/source/blender/blenkernel/intern/mesh_tangent.cc b/source/blender/blenkernel/intern/mesh_tangent.cc index 885410258af..b60eadf4e09 100644 --- a/source/blender/blenkernel/intern/mesh_tangent.cc +++ b/source/blender/blenkernel/intern/mesh_tangent.cc @@ -306,7 +306,8 @@ void BKE_mesh_add_loop_tangent_named_layer_for_uv(CustomData *uv_data, const char *layer_name) { if (CustomData_get_named_layer_index(tan_data, CD_TANGENT, layer_name) == -1 && - CustomData_get_named_layer_index(uv_data, CD_PROP_FLOAT2, layer_name) != -1) { + CustomData_get_named_layer_index(uv_data, CD_PROP_FLOAT2, layer_name) != -1) + { CustomData_add_layer_named(tan_data, CD_TANGENT, CD_SET_DEFAULT, numLoopData, layer_name); } } @@ -371,7 +372,8 @@ void BKE_mesh_calc_loop_tangent_step_0(const CustomData *loopData, } } if (!add && ((*rcalc_act && ract_uv_name[0] && STREQ(ract_uv_name, name)) || - (*rcalc_ren && rren_uv_name[0] && STREQ(rren_uv_name, name)))) { + (*rcalc_ren && rren_uv_name[0] && STREQ(rren_uv_name, name)))) + { add = true; } if (add) { @@ -434,7 +436,8 @@ void BKE_mesh_calc_loop_tangent_ex(const float (*vert_positions)[3], } } if ((tangent_mask & DM_TANGENT_MASK_ORCO) && - CustomData_get_named_layer_index(loopdata, CD_TANGENT, "") == -1) { + CustomData_get_named_layer_index(loopdata, CD_TANGENT, "") == -1) + { CustomData_add_layer_named( loopdata_out, CD_TANGENT, CD_SET_DEFAULT, int(loopdata_out_len), ""); } diff --git a/source/blender/blenkernel/intern/mesh_tessellate.cc b/source/blender/blenkernel/intern/mesh_tessellate.cc index fca2de49c8e..2f82196d149 100644 --- a/source/blender/blenkernel/intern/mesh_tessellate.cc +++ b/source/blender/blenkernel/intern/mesh_tessellate.cc @@ -66,7 +66,8 @@ BLI_INLINE void mesh_calc_tessellation_for_face_impl(const Span corner_vert if (UNLIKELY(is_quad_flip_v3_first_third_fast(positions[corner_verts[mlt_a->tri[0]]], positions[corner_verts[mlt_a->tri[1]]], positions[corner_verts[mlt_a->tri[2]]], - positions[corner_verts[mlt_b->tri[2]]]))) { + positions[corner_verts[mlt_b->tri[2]]]))) + { /* Flip out of degenerate 0-2 state. */ mlt_a->tri[2] = mlt_b->tri[2]; mlt_b->tri[0] = mlt_a->tri[1]; diff --git a/source/blender/blenkernel/intern/mesh_validate.cc b/source/blender/blenkernel/intern/mesh_validate.cc index 80dc04c4c70..32e0d6176ae 100644 --- a/source/blender/blenkernel/intern/mesh_validate.cc +++ b/source/blender/blenkernel/intern/mesh_validate.cc @@ -642,7 +642,8 @@ bool BKE_mesh_validate_arrays(Mesh *mesh, else { const blender::int2 &edge = edges[edge_i]; if (IS_REMOVED_EDGE(edge) || - !((edge[0] == v1 && edge[1] == v2) || (edge[0] == v2 && edge[1] == v1))) { + !((edge[0] == v1 && edge[1] == v2) || (edge[0] == v2 && edge[1] == v1))) + { /* The pointed edge is invalid (tagged as removed, or vert idx mismatch), * and we already know from previous test that a valid one exists, * use it (if allowed)! */ @@ -1354,7 +1355,8 @@ void BKE_mesh_calc_edges_tessface(Mesh *mesh) EdgeSetIterator *ehi = BLI_edgesetIterator_new(eh); for (int i = 0; BLI_edgesetIterator_isDone(ehi) == false; - BLI_edgesetIterator_step(ehi), i++, ege++, index++) { + BLI_edgesetIterator_step(ehi), i++, ege++, index++) + { BLI_edgesetIterator_getKey(ehi, &(*ege)[0], &(*ege)[1]); *index = ORIGINDEX_NONE; } diff --git a/source/blender/blenkernel/intern/modifier.cc b/source/blender/blenkernel/intern/modifier.cc index c329b2d14a5..66ecd97e90c 100644 --- a/source/blender/blenkernel/intern/modifier.cc +++ b/source/blender/blenkernel/intern/modifier.cc @@ -256,7 +256,8 @@ bool BKE_modifier_is_preview(ModifierData *md) /* Constructive modifiers are highly likely to also modify data like vgroups or vertex-colors! */ if (!((mti->flags & eModifierTypeFlag_UsesPreview) || - (mti->type == eModifierTypeType_Constructive))) { + (mti->type == eModifierTypeType_Constructive))) + { return false; } @@ -584,7 +585,8 @@ bool BKE_modifier_is_enabled(const struct Scene *scene, ModifierData *md, int re return false; } if (scene != nullptr && mti->isDisabled && - mti->isDisabled(scene, md, required_mode == eModifierMode_Render)) { + mti->isDisabled(scene, md, required_mode == eModifierMode_Render)) + { return false; } if (md->mode & eModifierMode_DisableTemporary) { diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c index 52957dcc790..284d529afce 100644 --- a/source/blender/blenkernel/intern/movieclip.c +++ b/source/blender/blenkernel/intern/movieclip.c @@ -1382,7 +1382,8 @@ static ImBuf *movieclip_get_postprocessed_ibuf( /* Fallback render in case proxies are not enabled or built */ if (!ibuf && user->render_flag & MCLIP_PROXY_RENDER_USE_FALLBACK_RENDER && - user->render_size != MCLIP_PROXY_RENDER_SIZE_FULL) { + user->render_size != MCLIP_PROXY_RENDER_SIZE_FULL) + { MovieClipUser user_fallback = *user; user_fallback.render_size = MCLIP_PROXY_RENDER_SIZE_FULL; @@ -1466,7 +1467,8 @@ static ImBuf *get_stable_cached_frame(MovieClip *clip, /* check for stabilization parameters */ if (tscale != cache->stabilized.scale || tangle != cache->stabilized.angle || - !equals_v2v2(tloc, cache->stabilized.loc)) { + !equals_v2v2(tloc, cache->stabilized.loc)) + { return NULL; } diff --git a/source/blender/blenkernel/intern/multires.cc b/source/blender/blenkernel/intern/multires.cc index 0cd8cf5079c..1c8ce0e60ae 100644 --- a/source/blender/blenkernel/intern/multires.cc +++ b/source/blender/blenkernel/intern/multires.cc @@ -412,7 +412,8 @@ void multires_flush_sculpt_updates(Object *object) SculptSession *sculpt_session = object->sculpt; if (BKE_pbvh_type(sculpt_session->pbvh) != PBVH_GRIDS || !sculpt_session->multires.active || - sculpt_session->multires.modifier == nullptr) { + sculpt_session->multires.modifier == nullptr) + { return; } diff --git a/source/blender/blenkernel/intern/multires_reshape.cc b/source/blender/blenkernel/intern/multires_reshape.cc index ae27c6cf0cd..75f28972727 100644 --- a/source/blender/blenkernel/intern/multires_reshape.cc +++ b/source/blender/blenkernel/intern/multires_reshape.cc @@ -43,7 +43,8 @@ bool multiresModifier_reshapeFromVertcos(Depsgraph *depsgraph, multires_reshape_store_original_grids(&reshape_context); multires_reshape_ensure_grids(static_cast(object->data), reshape_context.top.level); if (!multires_reshape_assign_final_coords_from_vertcos( - &reshape_context, vert_coords, num_vert_coords)) { + &reshape_context, vert_coords, num_vert_coords)) + { multires_reshape_context_free(&reshape_context); return false; } @@ -125,7 +126,8 @@ bool multiresModifier_reshapeFromCCG(const int tot_level, Mesh *coarse_mesh, Sub { MultiresReshapeContext reshape_context; if (!multires_reshape_context_create_from_ccg( - &reshape_context, subdiv_ccg, coarse_mesh, tot_level)) { + &reshape_context, subdiv_ccg, coarse_mesh, tot_level)) + { return false; } diff --git a/source/blender/blenkernel/intern/multires_reshape_smooth.cc b/source/blender/blenkernel/intern/multires_reshape_smooth.cc index c889f68911a..8eef74fab3b 100644 --- a/source/blender/blenkernel/intern/multires_reshape_smooth.cc +++ b/source/blender/blenkernel/intern/multires_reshape_smooth.cc @@ -825,12 +825,14 @@ static void foreach_edge(const SubdivForeachContext *foreach_context, /* Ignore all inner face edges as they have sharpness of zero when using Catmull-Clark mode. In * simple mode, all edges have maximum sharpness, so they can't be skipped. */ if (coarse_edge_index == ORIGINDEX_NONE && - reshape_smooth_context->smoothing_type != MULTIRES_SUBDIVIDE_SIMPLE) { + reshape_smooth_context->smoothing_type != MULTIRES_SUBDIVIDE_SIMPLE) + { return; } /* Ignore all loose edges as well, as they are not communicated to the OpenSubdiv. */ if (!reshape_smooth_context->loose_base_edges.is_empty() && - reshape_smooth_context->loose_base_edges[coarse_edge_index]) { + reshape_smooth_context->loose_base_edges[coarse_edge_index]) + { return; } /* Edges without crease are to be ignored as well. */ diff --git a/source/blender/blenkernel/intern/multires_reshape_subdivide.cc b/source/blender/blenkernel/intern/multires_reshape_subdivide.cc index beac99e0a7c..3870da509f2 100644 --- a/source/blender/blenkernel/intern/multires_reshape_subdivide.cc +++ b/source/blender/blenkernel/intern/multires_reshape_subdivide.cc @@ -85,8 +85,8 @@ void multires_subdivide_create_tangent_displacement_linear_grids(Object *object, /* Convert the new grids to tangent displacement. */ multires_set_tot_level(object, mmd, new_top_level); - if (!multires_reshape_context_create_from_modifier( - &reshape_context, object, mmd, new_top_level)) { + if (!multires_reshape_context_create_from_modifier(&reshape_context, object, mmd, new_top_level)) + { return; } diff --git a/source/blender/blenkernel/intern/multires_reshape_util.cc b/source/blender/blenkernel/intern/multires_reshape_util.cc index 697b6a4e063..c43372f882a 100644 --- a/source/blender/blenkernel/intern/multires_reshape_util.cc +++ b/source/blender/blenkernel/intern/multires_reshape_util.cc @@ -52,7 +52,8 @@ Subdiv *multires_reshape_create_subdiv(Depsgraph *depsgraph, BKE_multires_subdiv_settings_init(&subdiv_settings, mmd); Subdiv *subdiv = BKE_subdiv_new_from_mesh(&subdiv_settings, base_mesh); if (!BKE_subdiv_eval_begin_from_mesh( - subdiv, base_mesh, nullptr, SUBDIV_EVALUATOR_TYPE_CPU, nullptr)) { + subdiv, base_mesh, nullptr, SUBDIV_EVALUATOR_TYPE_CPU, nullptr)) + { BKE_subdiv_free(subdiv); return nullptr; } diff --git a/source/blender/blenkernel/intern/multires_unsubdivide.cc b/source/blender/blenkernel/intern/multires_unsubdivide.cc index 61b40cf503c..6b2cb748ad0 100644 --- a/source/blender/blenkernel/intern/multires_unsubdivide.cc +++ b/source/blender/blenkernel/intern/multires_unsubdivide.cc @@ -214,7 +214,8 @@ static void unsubdivide_face_center_vertex_tag(BMesh *bm, BMVert *initial_vertex BM_ITER_ELEM (neighbor_v, &iter_a, f, BM_VERTS_OF_FACE) { int neighbor_vertex_index = BM_elem_index_get(neighbor_v); if (!visited_verts[neighbor_vertex_index] && neighbor_v != diagonal_v && - is_vertex_diagonal(neighbor_v, diagonal_v)) { + is_vertex_diagonal(neighbor_v, diagonal_v)) + { BLI_gsqueue_push(queue, &neighbor_v); visited_verts[neighbor_vertex_index] = true; BM_elem_flag_set(neighbor_v, BM_ELEM_TAG, true); @@ -1063,8 +1064,8 @@ static void multires_unsubdivide_extract_grids(MultiresUnsubdivideContext *conte BMVert *base_corner_y = BM_vert_at_index(bm_base_mesh, corner_y_index); /* If this is the correct loop in the base mesh, the original vertex and the two corners * should be in the loop's face. */ - if (BM_vert_in_face(base_corner_x, base_face) && - BM_vert_in_face(base_corner_y, base_face)) { + if (BM_vert_in_face(base_corner_x, base_face) && BM_vert_in_face(base_corner_y, base_face)) + { /* Get the index of the loop. */ const int base_mesh_loop_index = BM_ELEM_CD_GET_INT(lb, base_l_offset); const int base_mesh_face_index = BM_elem_index_get(base_face); diff --git a/source/blender/blenkernel/intern/multires_versioning.cc b/source/blender/blenkernel/intern/multires_versioning.cc index b2ad187db85..4de3a6d3b79 100644 --- a/source/blender/blenkernel/intern/multires_versioning.cc +++ b/source/blender/blenkernel/intern/multires_versioning.cc @@ -46,7 +46,8 @@ static Subdiv *subdiv_for_simple_to_catmull_clark(Object *object, MultiresModifi BKE_subdiv_converter_free(&converter); if (!BKE_subdiv_eval_begin_from_mesh( - subdiv, base_mesh, nullptr, SUBDIV_EVALUATOR_TYPE_CPU, nullptr)) { + subdiv, base_mesh, nullptr, SUBDIV_EVALUATOR_TYPE_CPU, nullptr)) + { BKE_subdiv_free(subdiv); return nullptr; } @@ -66,7 +67,8 @@ void multires_do_versions_simple_to_catmull_clark(Object *object, MultiresModifi Subdiv *subdiv = subdiv_for_simple_to_catmull_clark(object, mmd); MultiresReshapeContext reshape_context; if (!multires_reshape_context_create_from_subdiv( - &reshape_context, object, mmd, subdiv, mmd->totlvl)) { + &reshape_context, object, mmd, subdiv, mmd->totlvl)) + { BKE_subdiv_free(subdiv); return; } @@ -81,8 +83,8 @@ void multires_do_versions_simple_to_catmull_clark(Object *object, MultiresModifi /* Calculate the new tangent displacement against the new Catmull-Clark limit surface. */ { MultiresReshapeContext reshape_context; - if (!multires_reshape_context_create_from_modifier( - &reshape_context, object, mmd, mmd->totlvl)) { + if (!multires_reshape_context_create_from_modifier(&reshape_context, object, mmd, mmd->totlvl)) + { return; } multires_reshape_object_grids_to_tangent_displacement(&reshape_context); diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c index 0178e7c379d..0a4d5e43d18 100644 --- a/source/blender/blenkernel/intern/nla.c +++ b/source/blender/blenkernel/intern/nla.c @@ -398,7 +398,8 @@ void BKE_nlatrack_insert_after(ListBase *nla_tracks, if (is_liboverride && prev != NULL && (prev->flag & NLATRACK_OVERRIDELIBRARY_LOCAL) == 0) { NlaTrack *first_local = prev->next; for (; first_local != NULL && (first_local->flag & NLATRACK_OVERRIDELIBRARY_LOCAL) == 0; - first_local = first_local->next) { + first_local = first_local->next) + { } prev = first_local != NULL ? first_local->prev : NULL; } @@ -1250,7 +1251,8 @@ bool BKE_nlatrack_add_strip(NlaTrack *nlt, NlaStrip *strip, const bool is_libove * Do not allow adding strips if this track is locked, or not a local one in liboverride case. */ if (nlt->flag & NLATRACK_PROTECTED || - (is_liboverride && (nlt->flag & NLATRACK_OVERRIDELIBRARY_LOCAL) == 0)) { + (is_liboverride && (nlt->flag & NLATRACK_OVERRIDELIBRARY_LOCAL) == 0)) + { return false; } @@ -1442,11 +1444,13 @@ bool BKE_nlastrip_within_bounds(NlaStrip *strip, float min, float max) * - second 2 cases cover when the strip length is greater than the bounding area */ if ((stripLen < boundsLen) && - !(IN_RANGE(strip->start, min, max) || IN_RANGE(strip->end, min, max))) { + !(IN_RANGE(strip->start, min, max) || IN_RANGE(strip->end, min, max))) + { return false; } if ((stripLen > boundsLen) && - !(IN_RANGE(min, strip->start, strip->end) || IN_RANGE(max, strip->start, strip->end))) { + !(IN_RANGE(min, strip->start, strip->end) || IN_RANGE(max, strip->start, strip->end))) + { return false; } @@ -2317,7 +2321,8 @@ void BKE_nla_tweakmode_exit(AnimData *adt) for (strip = nlt->strips.first; strip; strip = strip->next) { /* sync strip extents if this strip uses the same action */ if ((adt->actstrip) && (adt->actstrip->act == strip->act) && - (strip->flag & NLASTRIP_FLAG_SYNC_LENGTH)) { + (strip->flag & NLASTRIP_FLAG_SYNC_LENGTH)) + { BKE_nlastrip_recalculate_bounds_sync_action(strip); } diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc index 364b6635b0d..07957a35953 100644 --- a/source/blender/blenkernel/intern/node.cc +++ b/source/blender/blenkernel/intern/node.cc @@ -522,7 +522,8 @@ void ntreeBlendWrite(BlendWriter *writer, bNodeTree *ntree) if (node->storage) { if (ELEM(ntree->type, NTREE_SHADER, NTREE_GEOMETRY) && - ELEM(node->type, SH_NODE_CURVE_VEC, SH_NODE_CURVE_RGB, SH_NODE_CURVE_FLOAT)) { + ELEM(node->type, SH_NODE_CURVE_VEC, SH_NODE_CURVE_RGB, SH_NODE_CURVE_FLOAT)) + { BKE_curvemapping_blend_write(writer, static_cast(node->storage)); } else if (ntree->type == NTREE_SHADER && (node->type == SH_NODE_SCRIPT)) { @@ -536,11 +537,13 @@ void ntreeBlendWrite(BlendWriter *writer, bNodeTree *ntree) CMP_NODE_TIME, CMP_NODE_CURVE_VEC, CMP_NODE_CURVE_RGB, - CMP_NODE_HUECORRECT)) { + CMP_NODE_HUECORRECT)) + { BKE_curvemapping_blend_write(writer, static_cast(node->storage)); } else if ((ntree->type == NTREE_TEXTURE) && - ELEM(node->type, TEX_NODE_CURVE_RGB, TEX_NODE_CURVE_TIME)) { + ELEM(node->type, TEX_NODE_CURVE_RGB, TEX_NODE_CURVE_TIME)) + { BKE_curvemapping_blend_write(writer, static_cast(node->storage)); } else if ((ntree->type == NTREE_COMPOSIT) && (node->type == CMP_NODE_MOVIEDISTORTION)) { @@ -566,7 +569,8 @@ void ntreeBlendWrite(BlendWriter *writer, bNodeTree *ntree) BLO_write_struct_by_name(writer, node->typeinfo->storagename, node->storage); } else if ((ntree->type == NTREE_COMPOSIT) && - ELEM(node->type, CMP_NODE_CRYPTOMATTE, CMP_NODE_CRYPTOMATTE_LEGACY)) { + ELEM(node->type, CMP_NODE_CRYPTOMATTE, CMP_NODE_CRYPTOMATTE_LEGACY)) + { NodeCryptomatte *nc = static_cast(node->storage); BLO_write_string(writer, nc->matte_id); LISTBASE_FOREACH (CryptomatteEntry *, entry, &nc->entries) { @@ -1000,7 +1004,8 @@ void ntreeBlendReadExpand(BlendExpander *expander, bNodeTree *ntree) LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { if (node->id && !(node->type == CMP_NODE_R_LAYERS) && - !(node->type == CMP_NODE_CRYPTOMATTE && node->custom1 == CMP_CRYPTOMATTE_SRC_RENDER)) { + !(node->type == CMP_NODE_CRYPTOMATTE && node->custom1 == CMP_CRYPTOMATTE_SRC_RENDER)) + { BLO_expand(expander, node->id); } @@ -2534,7 +2539,8 @@ bNodeLink *nodeAddLink( link->tosock = tosock; } else if (eNodeSocketInOut(fromsock->in_out) == SOCK_IN && - eNodeSocketInOut(tosock->in_out) == SOCK_OUT) { + eNodeSocketInOut(tosock->in_out) == SOCK_OUT) + { /* OK but flip */ link = MEM_cnew("link"); if (ntree) { diff --git a/source/blender/blenkernel/intern/node_runtime.cc b/source/blender/blenkernel/intern/node_runtime.cc index dc24e5ddbc4..b496348db73 100644 --- a/source/blender/blenkernel/intern/node_runtime.cc +++ b/source/blender/blenkernel/intern/node_runtime.cc @@ -342,7 +342,8 @@ static void update_toposort(const bNodeTree &ntree, } if ((direction == ToposortDirection::LeftToRight) ? node->runtime->has_available_linked_outputs : - node->runtime->has_available_linked_inputs) { + node->runtime->has_available_linked_inputs) + { /* Ignore non-start nodes. */ continue; } diff --git a/source/blender/blenkernel/intern/node_tree_anonymous_attributes.cc b/source/blender/blenkernel/intern/node_tree_anonymous_attributes.cc index a3b2465428d..b3ff255602b 100644 --- a/source/blender/blenkernel/intern/node_tree_anonymous_attributes.cc +++ b/source/blender/blenkernel/intern/node_tree_anonymous_attributes.cc @@ -135,7 +135,8 @@ static void infer_propagate_relations(const bNodeTree &tree, tree, *group_output_socket, [&](const bNodeSocket &output_socket) { Vector indices; for (const aal::PropagateRelation &relation : - relations_by_node[output_socket.owner_node().index()]->propagate_relations) { + relations_by_node[output_socket.owner_node().index()]->propagate_relations) + { if (relation.to_geometry_output == output_socket.index()) { indices.append(relation.from_geometry_input); } @@ -164,7 +165,8 @@ static void infer_reference_relations(const bNodeTree &tree, tree, *group_output_socket, [&](const bNodeSocket &output_socket) { Vector indices; for (const aal::ReferenceRelation &relation : - relations_by_node[output_socket.owner_node().index()]->reference_relations) { + relations_by_node[output_socket.owner_node().index()]->reference_relations) + { if (relation.to_field_output == output_socket.index()) { indices.append(relation.from_field_input); } @@ -173,7 +175,8 @@ static void infer_reference_relations(const bNodeTree &tree, }); for (const int input_index : input_indices) { if (tree.runtime->field_inferencing_interface->inputs[input_index] != - nodes::InputSocketFieldType::None) { + nodes::InputSocketFieldType::None) + { aal::ReferenceRelation relation; relation.from_field_input = input_index; relation.to_field_output = group_output_socket->index(); @@ -434,7 +437,8 @@ static void infer_eval_relations(const bNodeTree &tree, { for (const int input_index : tree.interface_inputs().index_range()) { if (tree.runtime->field_inferencing_interface->inputs[input_index] == - nodes::InputSocketFieldType::None) { + nodes::InputSocketFieldType::None) + { continue; } const Vector geometry_input_indices = find_eval_on_inputs( diff --git a/source/blender/blenkernel/intern/node_tree_field_inferencing.cc b/source/blender/blenkernel/intern/node_tree_field_inferencing.cc index 067745e0ad6..309c1c50b81 100644 --- a/source/blender/blenkernel/intern/node_tree_field_inferencing.cc +++ b/source/blender/blenkernel/intern/node_tree_field_inferencing.cc @@ -212,7 +212,8 @@ static OutputFieldDependency find_group_output_dependencies( const bNodeSocket *input_socket = sockets_to_check.pop(); if (!input_socket->is_directly_linked() && - !field_state_by_socket_id[input_socket->index_in_tree()].is_single) { + !field_state_by_socket_id[input_socket->index_in_tree()].is_single) + { /* This socket uses a field as input by default. */ return OutputFieldDependency::ForFieldSource(); } @@ -240,7 +241,8 @@ static OutputFieldDependency find_group_output_dependencies( /* Propagate search further to the left. */ for (const bNodeSocket *origin_input_socket : - gather_input_socket_dependencies(field_dependency, origin_node)) { + gather_input_socket_dependencies(field_dependency, origin_node)) + { if (!origin_input_socket->is_available()) { continue; } @@ -398,8 +400,8 @@ static void propagate_field_status_from_left_to_right( } state.is_single = true; if (!input_socket->is_directly_linked()) { - if (inferencing_interface.inputs[input_socket->index()] == - InputSocketFieldType::Implicit) { + if (inferencing_interface.inputs[input_socket->index()] == InputSocketFieldType::Implicit) + { state.is_single = false; } } diff --git a/source/blender/blenkernel/intern/node_tree_update.cc b/source/blender/blenkernel/intern/node_tree_update.cc index c4e25a8e97d..0da51c56564 100644 --- a/source/blender/blenkernel/intern/node_tree_update.cc +++ b/source/blender/blenkernel/intern/node_tree_update.cc @@ -487,7 +487,8 @@ class NodeTreeMainUpdater { } if (ntree.runtime->changed_flag & NTREE_CHANGED_INTERFACE || - ntree.runtime->changed_flag & NTREE_CHANGED_ANY) { + ntree.runtime->changed_flag & NTREE_CHANGED_ANY) + { result.interface_changed = true; } @@ -722,7 +723,8 @@ class NodeTreeMainUpdater { for (const StringRefNull idname : {"ShaderNodeOutputMaterial", "ShaderNodeOutputLight", "ShaderNodeOutputWorld", - "ShaderNodeOutputAOV"}) { + "ShaderNodeOutputAOV"}) + { const Span nodes = ntree.nodes_by_type(idname); if (!nodes.is_empty()) { ntree.runtime->runtime_flag |= NTREE_RUNTIME_FLAG_HAS_MATERIAL_OUTPUT; @@ -806,7 +808,8 @@ class NodeTreeMainUpdater { /* The topology hash can only be used when only topology-changing operations have been done. */ if (tree.runtime->changed_flag == - (tree.runtime->changed_flag & (NTREE_CHANGED_LINK | NTREE_CHANGED_REMOVED_NODE))) { + (tree.runtime->changed_flag & (NTREE_CHANGED_LINK | NTREE_CHANGED_REMOVED_NODE))) + { if (old_topology_hash == new_topology_hash) { return false; } @@ -847,7 +850,8 @@ class NodeTreeMainUpdater { if (node.type == NODE_GROUP) { const bNodeTree *node_group = reinterpret_cast(node.id); if (node_group != nullptr && - node_group->runtime->runtime_flag & NTREE_RUNTIME_FLAG_HAS_MATERIAL_OUTPUT) { + node_group->runtime->runtime_flag & NTREE_RUNTIME_FLAG_HAS_MATERIAL_OUTPUT) + { return true; } } diff --git a/source/blender/blenkernel/intern/object.cc b/source/blender/blenkernel/intern/object.cc index 11fbdd5add7..d4bb1112971 100644 --- a/source/blender/blenkernel/intern/object.cc +++ b/source/blender/blenkernel/intern/object.cc @@ -1177,14 +1177,16 @@ static void object_lib_override_apply_post(ID *id_dst, ID *id_src) PTCacheID *pid_src, *pid_dst; for (pid_dst = (PTCacheID *)pidlist_dst.first, pid_src = (PTCacheID *)pidlist_src.first; pid_dst != nullptr; - pid_dst = pid_dst->next, pid_src = (pid_src != nullptr) ? pid_src->next : nullptr) { + pid_dst = pid_dst->next, pid_src = (pid_src != nullptr) ? pid_src->next : nullptr) + { /* If pid's do not match, just tag info of caches in dst as dirty and continue. */ if (pid_src == nullptr) { continue; } if (pid_dst->type != pid_src->type || pid_dst->file_type != pid_src->file_type || pid_dst->default_step != pid_src->default_step || pid_dst->max_step != pid_src->max_step || - pid_dst->data_types != pid_src->data_types || pid_dst->info_types != pid_src->info_types) { + pid_dst->data_types != pid_src->data_types || pid_dst->info_types != pid_src->info_types) + { LISTBASE_FOREACH (PointCache *, point_cache_src, pid_src->ptcaches) { point_cache_src->flag |= PTCACHE_FLAG_INFO_DIRTY; } @@ -1196,7 +1198,8 @@ static void object_lib_override_apply_post(ID *id_dst, ID *id_src) point_cache_src = (PointCache *)pid_src->ptcaches->first; point_cache_dst != nullptr; point_cache_dst = point_cache_dst->next, - point_cache_src = (point_cache_src != nullptr) ? point_cache_src->next : nullptr) { + point_cache_src = (point_cache_src != nullptr) ? point_cache_src->next : nullptr) + { /* Always force updating info about caches of applied lib-overrides. */ point_cache_dst->flag |= PTCACHE_FLAG_INFO_DIRTY; if (point_cache_src == nullptr || !STREQ(point_cache_dst->name, point_cache_src->name)) { @@ -1461,7 +1464,8 @@ bool BKE_object_support_modifier_type_check(const Object *ob, int modifier_type) } if (!((mti->flags & eModifierTypeFlag_AcceptsCVs) || - (ob->type == OB_MESH && (mti->flags & eModifierTypeFlag_AcceptsMesh)))) { + (ob->type == OB_MESH && (mti->flags & eModifierTypeFlag_AcceptsMesh)))) + { return false; } @@ -1638,7 +1642,8 @@ bool BKE_object_modifier_stack_copy(Object *ob_dst, } if (!BLI_listbase_is_empty(&ob_dst->modifiers) || - !BLI_listbase_is_empty(&ob_dst->greasepencil_modifiers)) { + !BLI_listbase_is_empty(&ob_dst->greasepencil_modifiers)) + { BLI_assert( !"Trying to copy a modifier stack into an object having a non-empty modifier stack."); return false; @@ -1812,7 +1817,8 @@ void BKE_object_free_derived_caches(Object *ob) object_update_from_subsurf_ccg(ob); if (ob->runtime.editmesh_eval_cage && - ob->runtime.editmesh_eval_cage != reinterpret_cast(ob->runtime.data_eval)) { + ob->runtime.editmesh_eval_cage != reinterpret_cast(ob->runtime.data_eval)) + { BKE_mesh_eval_delete(ob->runtime.editmesh_eval_cage); } ob->runtime.editmesh_eval_cage = nullptr; @@ -3211,7 +3217,8 @@ static bool ob_parcurve(Object *ob, Object *par, float r_mat[4][4]) /* vec: 4 items! */ if (BKE_where_on_path( - par, ctime, vec, nullptr, (cu->flag & CU_FOLLOW) ? quat : nullptr, &radius, nullptr)) { + par, ctime, vec, nullptr, (cu->flag & CU_FOLLOW) ? quat : nullptr, &radius, nullptr)) + { if (cu->flag & CU_FOLLOW) { quat_apply_track(quat, ob->trackflag, ob->upflag); normalize_qt(quat); @@ -4938,14 +4945,16 @@ int BKE_object_is_modified(Scene *scene, Object *ob) /* cloth */ for (md = BKE_modifiers_get_virtual_modifierlist(ob, &virtualModifierData); md && (flag != (eModifierMode_Render | eModifierMode_Realtime)); - md = md->next) { + md = md->next) + { if ((flag & eModifierMode_Render) == 0 && BKE_modifier_is_enabled(scene, md, eModifierMode_Render)) { flag |= eModifierMode_Render; } if ((flag & eModifierMode_Realtime) == 0 && - BKE_modifier_is_enabled(scene, md, eModifierMode_Realtime)) { + BKE_modifier_is_enabled(scene, md, eModifierMode_Realtime)) + { flag |= eModifierMode_Realtime; } } @@ -5074,7 +5083,8 @@ int BKE_object_is_deform_modified(Scene *scene, Object *ob) /* cloth */ for (md = BKE_modifiers_get_virtual_modifierlist(ob, &virtualModifierData); md && (flag != (eModifierMode_Render | eModifierMode_Realtime)); - md = md->next) { + md = md->next) + { const ModifierTypeInfo *mti = BKE_modifier_get_info((const ModifierType)md->type); bool can_deform = mti->type == eModifierTypeType_OnlyDeform || is_modifier_animated; @@ -5247,7 +5257,8 @@ LinkNode *BKE_object_relational_superset(const Scene *scene, } else { if ((objectSet == OB_SET_SELECTED && BASE_SELECTED_EDITABLE(((View3D *)nullptr), base)) || - (objectSet == OB_SET_VISIBLE && BASE_EDITABLE(((View3D *)nullptr), base))) { + (objectSet == OB_SET_VISIBLE && BASE_EDITABLE(((View3D *)nullptr), base))) + { Object *ob = base->object; if (obrel_list_test(ob)) { @@ -5282,7 +5293,8 @@ LinkNode *BKE_object_relational_superset(const Scene *scene, if (obrel_list_test(child)) { if ((includeFilter & OB_REL_CHILDREN_RECURSIVE && BKE_object_is_child_recursive(ob, child)) || - (includeFilter & OB_REL_CHILDREN && child->parent && child->parent == ob)) { + (includeFilter & OB_REL_CHILDREN && child->parent && child->parent == ob)) + { obrel_list_add(&links, child); } } diff --git a/source/blender/blenkernel/intern/object_deform.c b/source/blender/blenkernel/intern/object_deform.c index 07db35b49e7..7fce89617d3 100644 --- a/source/blender/blenkernel/intern/object_deform.c +++ b/source/blender/blenkernel/intern/object_deform.c @@ -568,7 +568,8 @@ bool *BKE_object_defgroup_validmap_get(Object *ob, const int defbase_tot) /* now loop through the armature modifiers and identify deform bones */ for (md = ob->modifiers.first; md; md = !md->next && step1 ? (step1 = 0), BKE_modifiers_get_virtual_modifierlist(ob, &virtualModifierData) : - md->next) { + md->next) + { if (!(md->mode & (eModifierMode_Realtime | eModifierMode_Virtual))) { continue; } diff --git a/source/blender/blenkernel/intern/object_dupli.cc b/source/blender/blenkernel/intern/object_dupli.cc index 87363380294..1c826d0ab9b 100644 --- a/source/blender/blenkernel/intern/object_dupli.cc +++ b/source/blender/blenkernel/intern/object_dupli.cc @@ -981,7 +981,8 @@ static void make_duplis_geometry_set_impl(const DupliContext *ctx, nullptr, id, &geometry_set, - i)) { + i)) + { break; } @@ -1012,7 +1013,8 @@ static void make_duplis_geometry_set_impl(const DupliContext *ctx, nullptr, id, &geometry_set, - i)) { + i)) + { make_duplis_geometry_set_impl( &sub_ctx, reference.geometry_set(), new_transform, true, false); } @@ -1383,7 +1385,8 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem totchild = psys->totchild; if ((for_render || part->draw_as == PART_DRAW_REND) && - ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) { + ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR)) + { ParticleSimulationData sim = {nullptr}; sim.depsgraph = ctx->depsgraph; sim.scene = scene; @@ -1454,8 +1457,8 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem } } else { - FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN ( - part->instance_collection, object, mode) { + FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN (part->instance_collection, object, mode) + { (void)object; totcollection++; } @@ -1482,8 +1485,8 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem } else { a = 0; - FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN ( - part->instance_collection, object, mode) { + FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN (part->instance_collection, object, mode) + { oblist[a] = object; a++; } @@ -1526,7 +1529,8 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem /* Some hair paths might be non-existent so they can't be used for duplication. */ if (hair && psys->pathcache && ((a < totpart && psys->pathcache[a]->segments < 0) || - (a >= totpart && psys->childcache[a - totpart]->segments < 0))) { + (a >= totpart && psys->childcache[a - totpart]->segments < 0))) + { continue; } @@ -1577,8 +1581,8 @@ static void make_duplis_particle_system(const DupliContext *ctx, ParticleSystem if (part->ren_as == PART_DRAW_GR && psys->part->draw & PART_DRAW_WHOLE_GR) { b = 0; - FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN ( - part->instance_collection, object, mode) { + FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN (part->instance_collection, object, mode) + { copy_m4_m4(tmat, oblist[b]->object_to_world); /* Apply collection instance offset. */ @@ -1705,7 +1709,8 @@ static const DupliGenerator *get_dupli_generator(const DupliContext *ctx) /* Should the dupli's be generated for this object? - Respect restrict flags. */ if (DEG_get_mode(ctx->depsgraph) == DAG_EVAL_RENDER ? (visibility_flag & OB_HIDE_RENDER) : - (visibility_flag & OB_HIDE_VIEWPORT)) { + (visibility_flag & OB_HIDE_VIEWPORT)) + { return nullptr; } @@ -1789,7 +1794,8 @@ ListBase *object_duplilist_preview(Depsgraph *depsgraph, continue; } if (const geo_log::ViewerNodeLog *viewer_log = - geo_log::GeoModifierLog::find_viewer_node_log_for_path(*viewer_path)) { + geo_log::GeoModifierLog::find_viewer_node_log_for_path(*viewer_path)) + { ctx.preview_base_geometry = &viewer_log->geometry; make_duplis_geometry_set_impl( &ctx, viewer_log->geometry, ob_eval->object_to_world, true, ob_eval->type == OB_CURVES); diff --git a/source/blender/blenkernel/intern/object_facemap.c b/source/blender/blenkernel/intern/object_facemap.c index dff87469084..31404afe07c 100644 --- a/source/blender/blenkernel/intern/object_facemap.c +++ b/source/blender/blenkernel/intern/object_facemap.c @@ -150,8 +150,8 @@ static void object_fmap_remove_edit_mode(Object *ob, bFaceMap *fmap, bool do_sel BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { map = BM_ELEM_CD_GET_VOID_P(efa, cd_fmap_offset); - if (map && *map == fmap_nr && - (!do_selected || BM_elem_flag_test(efa, BM_ELEM_SELECT))) { + if (map && *map == fmap_nr && (!do_selected || BM_elem_flag_test(efa, BM_ELEM_SELECT))) + { *map = -1; } } diff --git a/source/blender/blenkernel/intern/object_update.cc b/source/blender/blenkernel/intern/object_update.cc index be2e93d7a48..61cb6aa5cff 100644 --- a/source/blender/blenkernel/intern/object_update.cc +++ b/source/blender/blenkernel/intern/object_update.cc @@ -209,7 +209,8 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *o /* check use of dupli objects here */ if (psys->part && (psys->part->draw_as == PART_DRAW_REND || use_render_params) && ((psys->part->ren_as == PART_DRAW_OB && psys->part->instance_object) || - (psys->part->ren_as == PART_DRAW_GR && psys->part->instance_collection))) { + (psys->part->ren_as == PART_DRAW_GR && psys->part->instance_collection))) + { ob->transflag |= OB_DUPLIPARTS; } @@ -265,7 +266,8 @@ void BKE_object_sync_to_original(Depsgraph *depsgraph, Object *object) for (ModifierData *md = static_cast(object->modifiers.first), *md_orig = static_cast(object_orig->modifiers.first); md != nullptr && md_orig != nullptr; - md = md->next, md_orig = md_orig->next) { + md = md->next, md_orig = md_orig->next) + { BLI_assert(md->type == md_orig->type && STREQ(md->name, md_orig->name)); MEM_SAFE_FREE(md_orig->error); if (md->error != nullptr) { @@ -425,7 +427,8 @@ void BKE_object_eval_eval_base_flags(Depsgraph *depsgraph, if (object->mode == OB_MODE_PARTICLE_EDIT) { for (ParticleSystem *psys = static_cast(object->particlesystem.first); psys != nullptr; - psys = psys->next) { + psys = psys->next) + { BKE_particle_batch_cache_dirty_tag(psys, BKE_PARTICLE_BATCH_DIRTY_ALL); } } diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c index 73619facd93..65dab0c9984 100644 --- a/source/blender/blenkernel/intern/ocean.c +++ b/source/blender/blenkernel/intern/ocean.c @@ -852,7 +852,8 @@ bool BKE_ocean_init(struct Ocean *o, (o->_h0_minus = (fftw_complex *)MEM_mallocN(sizeof(fftw_complex) * (size_t)M * N, "ocean_h0_minus")) && (o->_kx = (float *)MEM_mallocN(sizeof(float) * o->_M, "ocean_kx")) && - (o->_kz = (float *)MEM_mallocN(sizeof(float) * o->_N, "ocean_kz"))) { + (o->_kz = (float *)MEM_mallocN(sizeof(float) * o->_N, "ocean_kz"))) + { /* Success. */ } else { diff --git a/source/blender/blenkernel/intern/packedFile.c b/source/blender/blenkernel/intern/packedFile.c index 53405c2f2ea..5f02713e52c 100644 --- a/source/blender/blenkernel/intern/packedFile.c +++ b/source/blender/blenkernel/intern/packedFile.c @@ -251,8 +251,8 @@ void BKE_packedfile_pack_all(Main *bmain, ReportList *reports, bool verbose) } for (vfont = bmain->fonts.first; vfont; vfont = vfont->id.next) { - if (vfont->packedfile == NULL && !ID_IS_LINKED(vfont) && - BKE_vfont_is_builtin(vfont) == false) { + if (vfont->packedfile == NULL && !ID_IS_LINKED(vfont) && BKE_vfont_is_builtin(vfont) == false) + { vfont->packedfile = BKE_packedfile_new( reports, vfont->filepath, BKE_main_blendfile_path(bmain)); tot++; diff --git a/source/blender/blenkernel/intern/paint.cc b/source/blender/blenkernel/intern/paint.cc index 14be0979940..4b448cfe778 100644 --- a/source/blender/blenkernel/intern/paint.cc +++ b/source/blender/blenkernel/intern/paint.cc @@ -750,8 +750,8 @@ void BKE_paint_curve_clamp_endpoint_add_index(PaintCurve *pc, const int add_inde void BKE_palette_color_remove(Palette *palette, PaletteColor *color) { - if (BLI_listbase_count_at_most(&palette->colors, palette->active_color) == - palette->active_color) { + if (BLI_listbase_count_at_most(&palette->colors, palette->active_color) == palette->active_color) + { palette->active_color--; } @@ -1787,7 +1787,8 @@ static void sculpt_update_object( * that simply recompute vertex weights (which can even include Geometry Nodes). */ if (me_eval_deform->totpoly == me_eval->totpoly && me_eval_deform->totloop == me_eval->totloop && - me_eval_deform->totvert == me_eval->totvert) { + me_eval_deform->totvert == me_eval->totvert) + { BKE_sculptsession_free_deformMats(ss); BLI_assert(me_eval_deform->totvert == me->totvert); @@ -1929,7 +1930,8 @@ void BKE_sculpt_color_layer_create_if_needed(Object *object) char unique_name[MAX_CUSTOMDATA_LAYER_NAME]; BKE_id_attribute_calc_unique_name(&orig_me->id, "Color", unique_name); if (!orig_me->attributes_for_write().add( - unique_name, ATTR_DOMAIN_POINT, CD_PROP_COLOR, AttributeInitDefaultValue())) { + unique_name, ATTR_DOMAIN_POINT, CD_PROP_COLOR, AttributeInitDefaultValue())) + { return; } @@ -2857,7 +2859,8 @@ bool BKE_sculpt_attribute_destroy(Object *ob, SculptAttribute *attr) SculptAttribute *attr2 = ss->temp_attributes + i; if (STREQ(attr2->name, attr->name) && attr2->domain == attr->domain && - attr2->proptype == attr->proptype) { + attr2->proptype == attr->proptype) + { attr2->used = false; } diff --git a/source/blender/blenkernel/intern/paint_toolslots.c b/source/blender/blenkernel/intern/paint_toolslots.c index f35755021d2..c1b0d3d8431 100644 --- a/source/blender/blenkernel/intern/paint_toolslots.c +++ b/source/blender/blenkernel/intern/paint_toolslots.c @@ -139,8 +139,8 @@ void BKE_paint_toolslots_brush_validate(Main *bmain, Paint *paint) for (int i = 0; i < paint->tool_slots_len; i++) { PaintToolSlot *tslot = &paint->tool_slots[i]; if (tslot->brush) { - if ((i != BKE_brush_tool_get(tslot->brush, paint)) || - (tslot->brush->ob_mode & ob_mode) == 0) { + if ((i != BKE_brush_tool_get(tslot->brush, paint)) || (tslot->brush->ob_mode & ob_mode) == 0) + { id_us_min(&tslot->brush->id); tslot->brush = NULL; } diff --git a/source/blender/blenkernel/intern/particle.cc b/source/blender/blenkernel/intern/particle.cc index fbc7e34f759..0320f98e349 100644 --- a/source/blender/blenkernel/intern/particle.cc +++ b/source/blender/blenkernel/intern/particle.cc @@ -662,7 +662,8 @@ short psys_get_current_num(Object *ob) } for (psys = static_cast(ob->particlesystem.first), i = 0; psys; - psys = psys->next, i++) { + psys = psys->next, i++) + { if (psys->flag & PSYS_CURRENT) { return i; } @@ -680,7 +681,8 @@ void psys_set_current_num(Object *ob, int index) } for (psys = static_cast(ob->particlesystem.first), i = 0; psys; - psys = psys->next, i++) { + psys = psys->next, i++) + { if (i == index) { psys->flag |= PSYS_CURRENT; } @@ -2137,8 +2139,8 @@ void psys_particle_on_dm(Mesh *mesh_final, const float(*orcodata)[3]; int mapindex; - if (!psys_map_index_on_dm( - mesh_final, from, index, index_dmcache, fw, foffset, &mapindex, mapfw)) { + if (!psys_map_index_on_dm(mesh_final, from, index, index_dmcache, fw, foffset, &mapindex, mapfw)) + { if (vec) { vec[0] = vec[1] = vec[2] = 0.0; } @@ -2246,7 +2248,8 @@ float psys_particle_value_from_verts(Mesh *mesh, short from, ParticleData *pa, f int mapindex; if (!psys_map_index_on_dm( - mesh, from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, &mapindex, mapfw)) { + mesh, from, pa->num, pa->num_dmcache, pa->fuv, pa->foffset, &mapindex, mapfw)) + { return 0.0f; } @@ -2487,7 +2490,8 @@ bool do_guides(Depsgraph *depsgraph, guidedir, nullptr, &radius, - &weight) == 0) { + &weight) == 0) + { return 0; } } @@ -2782,7 +2786,8 @@ static bool psys_thread_context_init_path(ParticleThreadContext *ctx, ParticleEditSettings *pset = &scene->toolsettings->particle; if ((use_render_params == 0) && - (psys_orig_edit_get(psys) == nullptr || pset->flag & PE_DRAW_PART) == 0) { + (psys_orig_edit_get(psys) == nullptr || pset->flag & PE_DRAW_PART) == 0) + { totchild = 0; } @@ -3905,7 +3910,8 @@ static void psys_face_mat(Object *ob, Mesh *mesh, ParticleData *pa, float mat[4] CustomData_get_for_write(&mesh->fdata, i, CD_ORIGSPACE, mesh->totface)); if (orco && - (orcodata = static_cast(CustomData_get_layer(&mesh->vdata, CD_ORCO)))) { + (orcodata = static_cast(CustomData_get_layer(&mesh->vdata, CD_ORCO)))) + { copy_v3_v3(v[0], orcodata[mface->v1]); copy_v3_v3(v[1], orcodata[mface->v2]); copy_v3_v3(v[2], orcodata[mface->v3]); @@ -4078,21 +4084,24 @@ void object_remove_particle_system(Main *bmain, PART_FLUID_SPRAY, PART_FLUID_SPRAYFOAM, PART_FLUID_SPRAYBUBBLE, - PART_FLUID_SPRAYFOAMBUBBLE)) { + PART_FLUID_SPRAYFOAMBUBBLE)) + { fmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_SPRAY; } if (ELEM(psys->part->type, PART_FLUID_FOAM, PART_FLUID_SPRAYFOAM, PART_FLUID_FOAMBUBBLE, - PART_FLUID_SPRAYFOAMBUBBLE)) { + PART_FLUID_SPRAYFOAMBUBBLE)) + { fmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_FOAM; } if (ELEM(psys->part->type, PART_FLUID_BUBBLE, PART_FLUID_FOAMBUBBLE, PART_FLUID_SPRAYBUBBLE, - PART_FLUID_SPRAYFOAMBUBBLE)) { + PART_FLUID_SPRAYFOAMBUBBLE)) + { fmd->domain->particle_type &= ~FLUID_DOMAIN_PARTICLE_BUBBLE; } if (psys->part->type == PART_FLUID_TRACER) { @@ -4104,7 +4113,8 @@ void object_remove_particle_system(Main *bmain, PART_FLUID_SPRAYFOAM, PART_FLUID_SPRAYBUBBLE, PART_FLUID_FOAMBUBBLE, - PART_FLUID_SPRAYFOAMBUBBLE)) { + PART_FLUID_SPRAYFOAMBUBBLE)) + { fmd->domain->sndparticle_combined_export = SNDPARTICLE_COMBINED_EXPORT_OFF; } } @@ -4326,7 +4336,8 @@ static void get_cpa_texture(Mesh *mesh, if (ELEM(texco, TEXCO_UV, TEXCO_ORCO) && (ELEM(part->from, PART_FROM_FACE, PART_FROM_VOLUME) == 0 || - part->distr == PART_DISTR_GRID)) { + part->distr == PART_DISTR_GRID)) + { texco = TEXCO_GLOB; } @@ -4347,7 +4358,8 @@ static void get_cpa_texture(Mesh *mesh, fw, mtex->uvname, texvec, - (part->from == PART_FROM_VERT))) { + (part->from == PART_FROM_VERT))) + { break; } /* no break, failed to get uv's, so let's try orco's */ @@ -4414,7 +4426,8 @@ void psys_get_texture( short texco = mtex->texco; if (texco == TEXCO_UV && (ELEM(part->from, PART_FROM_FACE, PART_FROM_VOLUME) == 0 || - part->distr == PART_DISTR_GRID)) { + part->distr == PART_DISTR_GRID)) + { texco = TEXCO_GLOB; } @@ -4435,7 +4448,8 @@ void psys_get_texture( pa->fuv, mtex->uvname, texvec, - (part->from == PART_FROM_VERT))) { + (part->from == PART_FROM_VERT))) + { break; } /* no break, failed to get uv's, so let's try orco's */ @@ -4946,7 +4960,8 @@ bool psys_get_particle_state(ParticleSimulationData *sim, if (!always) { if ((state->time < 0.0f && !(part->flag & PART_UNBORN)) || - (state->time > 1.0f && !(part->flag & PART_DIED))) { + (state->time > 1.0f && !(part->flag & PART_DIED))) + { return false; } } @@ -4968,7 +4983,8 @@ bool psys_get_particle_state(ParticleSimulationData *sim, if (pa) { if (!always) { if ((cfra < pa->time && (part->flag & PART_UNBORN) == 0) || - (cfra >= pa->dietime && (part->flag & PART_DIED) == 0)) { + (cfra >= pa->dietime && (part->flag & PART_DIED) == 0)) + { return false; } } @@ -5343,7 +5359,8 @@ void BKE_particle_system_blend_write(BlendWriter *writer, ListBase *particles) } if (psys->part->fluid && (psys->part->phystype == PART_PHYS_FLUID) && - (psys->part->fluid->flag & SPH_VISCOELASTIC_SPRINGS)) { + (psys->part->fluid->flag & SPH_VISCOELASTIC_SPRINGS)) + { BLO_write_struct_array( writer, ParticleSpring, psys->tot_fluidsprings, psys->fluid_springs); } diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c index cac20c039ab..4d0770226b8 100644 --- a/source/blender/blenkernel/intern/particle_distribute.c +++ b/source/blender/blenkernel/intern/particle_distribute.c @@ -900,7 +900,8 @@ static int psys_thread_context_init_distribute(ParticleThreadContext *ctx, } if (!BKE_mesh_is_deformed_only(final_mesh) && - !CustomData_get_layer(&final_mesh->fdata, CD_ORIGINDEX)) { + !CustomData_get_layer(&final_mesh->fdata, CD_ORIGINDEX)) + { printf( "Can't create particles with the current modifier stack, disable destructive modifiers\n"); // XXX error("Can't paint with the current modifier stack, disable destructive modifiers"); diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c index 6e5b343c3b3..e7178d36d54 100644 --- a/source/blender/blenkernel/intern/particle_system.c +++ b/source/blender/blenkernel/intern/particle_system.c @@ -1077,7 +1077,8 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, bpa->gravity[0] = bpa->gravity[1] = 0.0f; bpa->gravity[2] = -1.0f; if ((sim->scene->physics_settings.flag & PHYS_GLOBAL_GRAVITY) && - (sim->scene->physics_settings.gravity[2] != 0.0f)) { + (sim->scene->physics_settings.gravity[2] != 0.0f)) + { bpa->gravity[2] = sim->scene->physics_settings.gravity[2]; } @@ -1110,7 +1111,8 @@ void reset_particle(ParticleSimulationData *sim, ParticleData *pa, float dtime, pa->dietime = pa->time + pa->lifetime; if ((sim->psys->pointcache) && (sim->psys->pointcache->flag & PTCACHE_BAKED) && - (sim->psys->pointcache->mem_cache.first)) { + (sim->psys->pointcache->mem_cache.first)) + { float dietime = psys_get_dietime_from_cache(sim->psys->pointcache, p); pa->dietime = MIN2(pa->dietime, dietime); } @@ -1584,7 +1586,8 @@ static void sph_spring_delete(ParticleSystem *psys, int j) psys->tot_fluidsprings--; if (psys->tot_fluidsprings < psys->alloc_fluidsprings / 2 && - psys->alloc_fluidsprings > PSYS_FLUID_SPRINGS_INITIAL_SIZE) { + psys->alloc_fluidsprings > PSYS_FLUID_SPRINGS_INITIAL_SIZE) + { psys->alloc_fluidsprings /= 2; psys->fluid_springs = (ParticleSpring *)MEM_reallocN( psys->fluid_springs, psys->alloc_fluidsprings * sizeof(ParticleSpring)); @@ -2279,7 +2282,8 @@ static void basic_integrate(ParticleSimulationData *sim, int p, float dfra, floa /* add global acceleration (gravitation) */ if (psys_uses_gravity(sim) && /* normal gravity is too strong for hair so it's disabled by default */ - (part->type != PART_HAIR || part->effector_weights->flag & EFF_WEIGHT_DO_HAIR)) { + (part->type != PART_HAIR || part->effector_weights->flag & EFF_WEIGHT_DO_HAIR)) + { zero_v3(gr); madd_v3_v3fl(gr, sim->scene->physics_settings.gravity, @@ -2334,7 +2338,8 @@ static void basic_rotate(ParticleSettings *part, ParticleData *pa, float dfra, f } if ((part->flag & PART_ROT_DYN) && - ELEM(part->avemode, PART_AVE_VELOCITY, PART_AVE_HORIZONTAL, PART_AVE_VERTICAL)) { + ELEM(part->avemode, PART_AVE_VELOCITY, PART_AVE_HORIZONTAL, PART_AVE_VERTICAL)) + { float angle; float len1 = len_v3(pa->prev_state.vel); float len2 = len_v3(pa->state.vel); @@ -3010,7 +3015,8 @@ static int collision_response(ParticleSimulationData *sim, /* calculate normal particle velocity */ /* special case for object hitting the particle from behind */ if (through == 0 && ((vc_dot > 0.0f && v0_dot > 0.0f && vc_dot > v0_dot) || - (vc_dot < 0.0f && v0_dot < 0.0f && vc_dot < v0_dot))) { + (vc_dot < 0.0f && v0_dot < 0.0f && vc_dot < v0_dot))) + { mul_v3_v3fl(v0_nor, pce->nor, vc_dot); } else if (v0_dot > 0.0f) { @@ -3153,7 +3159,8 @@ static void collision_check(ParticleSimulationData *sim, int p, float dfra, floa } else if (collision_response( sim, pa, &col, &hit, part->flag & PART_DIE_ON_COL, part->flag & PART_ROT_DYN) == - 0) { + 0) + { return; } } @@ -3181,12 +3188,14 @@ static void psys_update_path_cache(ParticleSimulationData *sim, if ((psys->part->childtype && psys->totchild != psys_get_tot_child(sim->scene, psys, use_render_params)) || - psys->recalc & ID_RECALC_PSYS_RESET) { + psys->recalc & ID_RECALC_PSYS_RESET) + { alloc = 1; } if (alloc || psys->recalc & ID_RECALC_PSYS_CHILD || - (psys->vgroup[PSYS_VG_DENSITY] && (sim->ob && sim->ob->mode & OB_MODE_WEIGHT_PAINT))) { + (psys->vgroup[PSYS_VG_DENSITY] && (sim->ob && sim->ob->mode & OB_MODE_WEIGHT_PAINT))) + { distr = 1; } @@ -3211,11 +3220,13 @@ static void psys_update_path_cache(ParticleSimulationData *sim, } if ((part->type == PART_HAIR || psys->flag & PSYS_KEYED || - psys->pointcache->flag & PTCACHE_BAKED) == 0) { + psys->pointcache->flag & PTCACHE_BAKED) == 0) + { skip = 1; /* only hair, keyed and baked stuff can have paths */ } else if (part->ren_as != PART_DRAW_PATH && - !(part->type == PART_HAIR && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR))) { + !(part->type == PART_HAIR && ELEM(part->ren_as, PART_DRAW_OB, PART_DRAW_GR))) + { skip = 1; /* particle visualization must be set as path */ } else if (DEG_get_mode(sim->depsgraph) != DAG_EVAL_RENDER) { @@ -3230,7 +3241,8 @@ static void psys_update_path_cache(ParticleSimulationData *sim, skip = 1; } else if (part->childtype == 0 && - (psys->flag & PSYS_HAIR_DYNAMICS && psys->pointcache->flag & PTCACHE_BAKED) == 0) { + (psys->flag & PSYS_HAIR_DYNAMICS && psys->pointcache->flag & PTCACHE_BAKED) == 0) + { skip = 1; /* in edit mode paths are needed for child particles and dynamic hair */ } } @@ -3878,8 +3890,8 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) ParticleTarget *pt = psys->targets.first; psys_update_particle_bvhtree(psys, cfra); - for (; pt; - pt = pt->next) { /* Updating others systems particle tree for fluid-fluid interaction */ + for (; pt; pt = pt->next) + { /* Updating others systems particle tree for fluid-fluid interaction */ if (pt->ob) { psys_update_particle_bvhtree(BLI_findlink(&pt->ob->particlesystem, pt->psys - 1), cfra); } @@ -3922,15 +3934,16 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra) /* Only reset unborn particles if they're shown or if the particle is born soon. */ if (pa->alive == PARS_UNBORN && - (part->flag & PART_UNBORN || (cfra + psys->pointcache->step > pa->time))) { + (part->flag & PART_UNBORN || (cfra + psys->pointcache->step > pa->time))) + { reset_particle(sim, pa, dtime, cfra); } else if (part->phystype == PART_PHYS_NO) { reset_particle(sim, pa, dtime, cfra); } - if (ELEM(pa->alive, PARS_ALIVE, PARS_DYING) == 0 || - (pa->flag & (PARS_UNEXIST | PARS_NO_DISP))) { + if (ELEM(pa->alive, PARS_ALIVE, PARS_DYING) == 0 || (pa->flag & (PARS_UNEXIST | PARS_NO_DISP))) + { pa->state.time = -1.0f; } } @@ -4209,7 +4222,8 @@ static void particles_fluid_step(ParticleSimulationData *sim, (particles_has_foam(part->type) && (fds->particle_type & FLUID_DOMAIN_PARTICLE_FOAM) == 0) || (particles_has_tracer(part->type) && - (fds->particle_type & FLUID_DOMAIN_PARTICLE_TRACER) == 0)) { + (fds->particle_type & FLUID_DOMAIN_PARTICLE_TRACER) == 0)) + { BLI_snprintf(debugStrBuffer, sizeof(debugStrBuffer), "particles_fluid_step::error - found particle system that is not enabled in " @@ -4222,7 +4236,8 @@ static void particles_fluid_step(ParticleSimulationData *sim, tottypepart = totpart = manta_liquid_get_num_flip_particles(fds->fluid); } if (particles_has_spray(part->type) || particles_has_bubble(part->type) || - particles_has_foam(part->type) || particles_has_tracer(part->type)) { + particles_has_foam(part->type) || particles_has_tracer(part->type)) + { totpart = manta_liquid_get_num_snd_particles(fds->fluid); /* tottypepart is the amount of particles of a snd particle type. */ @@ -4289,7 +4304,8 @@ static void particles_fluid_step(ParticleSimulationData *sim, velZ = manta_liquid_get_flip_particle_velocity_z_at(fds->fluid, p); } else if (particles_has_spray(part->type) || particles_has_bubble(part->type) || - particles_has_foam(part->type) || particles_has_tracer(part->type)) { + particles_has_foam(part->type) || particles_has_tracer(part->type)) + { flagActivePart = manta_liquid_get_snd_particle_flag_at(fds->fluid, p); resX = (float)manta_liquid_get_particle_res_x(fds->fluid); @@ -4726,7 +4742,8 @@ static int hair_needs_recalc(ParticleSystem *psys) { if (!(psys->flag & PSYS_EDITED) && (!psys->edit || !psys->edit->edited) && ((psys->flag & PSYS_HAIR_DONE) == 0 || psys->recalc & ID_RECALC_PSYS_RESET || - (psys->part->flag & PART_HAIR_REGROW && !psys->edit))) { + (psys->part->flag & PART_HAIR_REGROW && !psys->edit))) + { return 1; } @@ -4865,7 +4882,8 @@ void particle_system_update(struct Depsgraph *depsgraph, } else if (particles_has_flip(part->type) || particles_has_spray(part->type) || particles_has_bubble(part->type) || particles_has_foam(part->type) || - particles_has_tracer(part->type)) { + particles_has_tracer(part->type)) + { particles_fluid_step(&sim, (int)cfra, use_render_params); } else { diff --git a/source/blender/blenkernel/intern/pbvh.cc b/source/blender/blenkernel/intern/pbvh.cc index f4c26dcf7a8..cd9a96601a3 100644 --- a/source/blender/blenkernel/intern/pbvh.cc +++ b/source/blender/blenkernel/intern/pbvh.cc @@ -2411,7 +2411,8 @@ bool ray_face_intersection_quad(const float ray_start[3], if ((isect_ray_tri_watertight_v3(ray_start, isect_precalc, t0, t1, t2, &depth_test, nullptr) && (depth_test < *depth)) || (isect_ray_tri_watertight_v3(ray_start, isect_precalc, t0, t2, t3, &depth_test, nullptr) && - (depth_test < *depth))) { + (depth_test < *depth))) + { *depth = depth_test; return true; } @@ -2428,7 +2429,8 @@ bool ray_face_intersection_tri(const float ray_start[3], { float depth_test; if (isect_ray_tri_watertight_v3(ray_start, isect_precalc, t0, t1, t2, &depth_test, nullptr) && - (depth_test < *depth)) { + (depth_test < *depth)) + { *depth = depth_test; return true; } @@ -2474,11 +2476,13 @@ bool ray_face_nearest_quad(const float ray_start[3], float co[3], depth_test; if ((dist_sq_test = dist_squared_ray_to_tri_v3_fast( - ray_start, ray_normal, t0, t1, t2, co, &depth_test)) < *dist_sq) { + ray_start, ray_normal, t0, t1, t2, co, &depth_test)) < *dist_sq) + { *dist_sq = dist_sq_test; *depth = depth_test; if ((dist_sq_test = dist_squared_ray_to_tri_v3_fast( - ray_start, ray_normal, t0, t2, t3, co, &depth_test)) < *dist_sq) { + ray_start, ray_normal, t0, t2, t3, co, &depth_test)) < *dist_sq) + { *dist_sq = dist_sq_test; *depth = depth_test; } @@ -2500,7 +2504,8 @@ bool ray_face_nearest_tri(const float ray_start[3], float co[3], depth_test; if ((dist_sq_test = dist_squared_ray_to_tri_v3_fast( - ray_start, ray_normal, t0, t1, t2, co, &depth_test)) < *dist_sq) { + ray_start, ray_normal, t0, t1, t2, co, &depth_test)) < *dist_sq) + { *dist_sq = dist_sq_test; *depth = depth_test; return true; @@ -3795,7 +3800,8 @@ void BKE_pbvh_sync_visibility_from_verts(PBVH *pbvh, Mesh *mesh) int grid_index = poly[loop_index]; if (pbvh->grid_hidden[grid_index] && - BLI_BITMAP_TEST(pbvh->grid_hidden[grid_index], key.grid_area - 1)) { + BLI_BITMAP_TEST(pbvh->grid_hidden[grid_index], key.grid_area - 1)) + { hidden = true; break; diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.cc b/source/blender/blenkernel/intern/pbvh_bmesh.cc index 50c15164f5d..a428ac63dc5 100644 --- a/source/blender/blenkernel/intern/pbvh_bmesh.cc +++ b/source/blender/blenkernel/intern/pbvh_bmesh.cc @@ -828,7 +828,8 @@ static void edge_queue_insert(EdgeQueueContext *eq_ctx, BMEdge *e, float priorit if (((eq_ctx->cd_vert_mask_offset == -1) || (check_mask(eq_ctx, e->v1) || check_mask(eq_ctx, e->v2))) && !(BM_elem_flag_test_bool(e->v1, BM_ELEM_HIDDEN) || - BM_elem_flag_test_bool(e->v2, BM_ELEM_HIDDEN))) { + BM_elem_flag_test_bool(e->v2, BM_ELEM_HIDDEN))) + { BMVert **pair = static_cast(BLI_mempool_alloc(eq_ctx->pool)); pair[0] = e->v1; pair[1] = e->v2; @@ -1024,7 +1025,8 @@ static void long_edge_queue_create(EdgeQueueContext *eq_ctx, /* Check leaf nodes marked for topology update */ if ((node->flag & PBVH_Leaf) && (node->flag & PBVH_UpdateTopology) && - !(node->flag & PBVH_FullyHidden)) { + !(node->flag & PBVH_FullyHidden)) + { GSetIterator gs_iter; /* Check each face */ @@ -1083,7 +1085,8 @@ static void short_edge_queue_create(EdgeQueueContext *eq_ctx, /* Check leaf nodes marked for topology update */ if ((node->flag & PBVH_Leaf) && (node->flag & PBVH_UpdateTopology) && - !(node->flag & PBVH_FullyHidden)) { + !(node->flag & PBVH_FullyHidden)) + { GSetIterator gs_iter; /* Check each face */ @@ -1253,7 +1256,8 @@ static bool pbvh_bmesh_subdivide_long_edges(EdgeQueueContext *eq_ctx, * and the node has been split, thus leaving wire edges and * associated vertices. */ if ((BM_ELEM_CD_GET_INT(e->v1, eq_ctx->cd_vert_node_offset) == DYNTOPO_NODE_NONE) || - (BM_ELEM_CD_GET_INT(e->v2, eq_ctx->cd_vert_node_offset) == DYNTOPO_NODE_NONE)) { + (BM_ELEM_CD_GET_INT(e->v2, eq_ctx->cd_vert_node_offset) == DYNTOPO_NODE_NONE)) + { continue; } @@ -1281,7 +1285,8 @@ static void pbvh_bmesh_collapse_edge(PBVH *pbvh, /* one of the two vertices may be masked, select the correct one for deletion */ if (BM_ELEM_CD_GET_FLOAT(v1, eq_ctx->cd_vert_mask_offset) < - BM_ELEM_CD_GET_FLOAT(v2, eq_ctx->cd_vert_mask_offset)) { + BM_ELEM_CD_GET_FLOAT(v2, eq_ctx->cd_vert_mask_offset)) + { v_del = v1; v_conn = v2; } @@ -1343,8 +1348,7 @@ static void pbvh_bmesh_collapse_edge(PBVH *pbvh, { BLI_buffer_append(deleted_faces, BMFace *, existing_face); } - else - { + else { BMVert *v_tri[3] = {v_conn, l->next->v, l->prev->v}; BLI_assert(!BM_face_exists(v_tri, 3)); @@ -1453,7 +1457,8 @@ static bool pbvh_bmesh_collapse_short_edges(EdgeQueueContext *eq_ctx, /* Check the verts still exist */ if (!(v1 = bm_vert_hash_lookup_chain(deleted_verts, v1)) || - !(v2 = bm_vert_hash_lookup_chain(deleted_verts, v2)) || (v1 == v2)) { + !(v2 = bm_vert_hash_lookup_chain(deleted_verts, v2)) || (v1 == v2)) + { continue; } @@ -1475,7 +1480,8 @@ static bool pbvh_bmesh_collapse_short_edges(EdgeQueueContext *eq_ctx, * and the node has been split, thus leaving wire edges and * associated vertices. */ if ((BM_ELEM_CD_GET_INT(e->v1, eq_ctx->cd_vert_node_offset) == DYNTOPO_NODE_NONE) || - (BM_ELEM_CD_GET_INT(e->v2, eq_ctx->cd_vert_node_offset) == DYNTOPO_NODE_NONE)) { + (BM_ELEM_CD_GET_INT(e->v2, eq_ctx->cd_vert_node_offset) == DYNTOPO_NODE_NONE)) + { continue; } @@ -1549,7 +1555,8 @@ bool pbvh_bmesh_node_raycast(PBVHNode *node, BM_face_as_array_vert_tri(f, v_tri); if (ray_face_intersection_tri( - ray_start, isect_precalc, v_tri[0]->co, v_tri[1]->co, v_tri[2]->co, depth)) { + ray_start, isect_precalc, v_tri[0]->co, v_tri[1]->co, v_tri[2]->co, depth)) + { hit = true; if (r_face_normal) { @@ -1561,7 +1568,8 @@ bool pbvh_bmesh_node_raycast(PBVHNode *node, madd_v3_v3v3fl(location, ray_start, ray_normal, *depth); for (int j = 0; j < 3; j++) { if (j == 0 || len_squared_v3v3(location, v_tri[j]->co) < - len_squared_v3v3(location, nearest_vertex_co)) { + len_squared_v3v3(location, nearest_vertex_co)) + { copy_v3_v3(nearest_vertex_co, v_tri[j]->co); r_active_vertex->i = intptr_t(v_tri[j]); } diff --git a/source/blender/blenkernel/intern/pbvh_pixels_copy.cc b/source/blender/blenkernel/intern/pbvh_pixels_copy.cc index 1834aab06ad..4f472ddd199 100644 --- a/source/blender/blenkernel/intern/pbvh_pixels_copy.cc +++ b/source/blender/blenkernel/intern/pbvh_pixels_copy.cc @@ -296,7 +296,8 @@ struct Rows { tile_pixels.pixel_rows, [&](const PackedPixelRow &encoded_pixels) { for (int x = encoded_pixels.start_image_coordinate.x; x < encoded_pixels.start_image_coordinate.x + encoded_pixels.num_pixels; - x++) { + x++) + { int64_t index = encoded_pixels.start_image_coordinate.y * resolution.x + x; pixels[index].type = PixelType::Brush; pixels[index].distance = 0.0f; diff --git a/source/blender/blenkernel/intern/pbvh_uv_islands.cc b/source/blender/blenkernel/intern/pbvh_uv_islands.cc index 389cef21306..d3f0b35f1ed 100644 --- a/source/blender/blenkernel/intern/pbvh_uv_islands.cc +++ b/source/blender/blenkernel/intern/pbvh_uv_islands.cc @@ -160,7 +160,8 @@ static void extract_uv_neighbors(const MeshData &mesh_data, if (primitive_has_shared_uv_edge(mesh_data.uv_map, mesh_data.looptris[primitive_i], - mesh_data.looptris[other_primitive_i])) { + mesh_data.looptris[other_primitive_i])) + { prims_to_add.append(other_primitive_i); } } @@ -1374,8 +1375,8 @@ UVEdge *UVPrimitive::get_uv_edge(const int v1, const int v2) const bool UVPrimitive::contains_uv_vertex(const UVVertex *uv_vertex) const { for (UVEdge *edge : edges) { - if (std::find(edge->vertices.begin(), edge->vertices.end(), uv_vertex) != - edge->vertices.end()) { + if (std::find(edge->vertices.begin(), edge->vertices.end(), uv_vertex) != edge->vertices.end()) + { return true; } } @@ -1611,7 +1612,8 @@ static bool dilate_y(UVIslandsMask::Tile &islands_mask) changed = true; } else if (y < islands_mask.mask_resolution.y - 1 && - prev_mask[offset + islands_mask.mask_resolution.x] != 0xffff) { + prev_mask[offset + islands_mask.mask_resolution.x] != 0xffff) + { islands_mask.mask[offset] = prev_mask[offset + islands_mask.mask_resolution.x]; changed = true; } diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c index a211d76c9b0..3109c30e459 100644 --- a/source/blender/blenkernel/intern/pointcache.c +++ b/source/blender/blenkernel/intern/pointcache.c @@ -506,7 +506,8 @@ static void ptcache_particle_extra_write(void *psys_v, PTCacheMem *pm, int UNUSE if (psys->part->phystype == PART_PHYS_FLUID && psys->part->fluid && psys->part->fluid->flag & SPH_VISCOELASTIC_SPRINGS && psys->tot_fluidsprings && - psys->fluid_springs) { + psys->fluid_springs) + { ptcache_add_extra_data( pm, BPHYS_EXTRA_FLUID_SPRINGS, psys->tot_fluidsprings, psys->fluid_springs); } @@ -934,7 +935,8 @@ void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *p (1 << BPHYS_DATA_BOIDS); } else if (psys->part->phystype == PART_PHYS_FLUID && psys->part->fluid && - psys->part->fluid->flag & SPH_VISCOELASTIC_SPRINGS) { + psys->part->fluid->flag & SPH_VISCOELASTIC_SPRINGS) + { pid->write_extra_data = ptcache_particle_extra_write; pid->read_extra_data = ptcache_particle_extra_read; } @@ -943,7 +945,8 @@ void BKE_ptcache_id_from_particles(PTCacheID *pid, Object *ob, ParticleSystem *p pid->data_types |= (1 << BPHYS_DATA_ROTATION); if (psys->part->rotmode != PART_ROT_VEL || psys->part->avemode == PART_AVE_RAND || - psys->part->avefac != 0.0f) { + psys->part->avefac != 0.0f) + { pid->data_types |= (1 << BPHYS_DATA_AVELOCITY); } } @@ -1220,7 +1223,8 @@ static bool foreach_object_ptcache( /* Rigid body. */ if (scene != NULL && (object == NULL || object->rigidbody_object != NULL) && - scene->rigidbody_world != NULL) { + scene->rigidbody_world != NULL) + { BKE_ptcache_id_from_rigidbody(&pid, object, scene->rigidbody_world); if (!callback(&pid, callback_user_data)) { return false; @@ -1632,8 +1636,8 @@ static int ptcache_file_data_read(PTCacheFile *pf) int i; for (i = 0; i < BPHYS_TOT_DATA; i++) { - if ((pf->data_types & (1 << i)) && - !ptcache_file_read(pf, pf->cur[i], 1, ptcache_data_size[i])) { + if ((pf->data_types & (1 << i)) && !ptcache_file_read(pf, pf->cur[i], 1, ptcache_data_size[i])) + { return 0; } } @@ -2652,7 +2656,8 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, uint cfra) if (frame != -1) { if ((mode == PTCACHE_CLEAR_BEFORE && frame < cfra) || - (mode == PTCACHE_CLEAR_AFTER && frame > cfra)) { + (mode == PTCACHE_CLEAR_AFTER && frame > cfra)) + { BLI_path_join(path_full, sizeof(path_full), path, de->d_name); BLI_delete(path_full, false, false); if (pid->cache->cached_frames && frame >= sta && frame <= end) { @@ -2689,7 +2694,8 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, uint cfra) else { while (pm) { if ((mode == PTCACHE_CLEAR_BEFORE && pm->frame < cfra) || - (mode == PTCACHE_CLEAR_AFTER && pm->frame > cfra)) { + (mode == PTCACHE_CLEAR_AFTER && pm->frame > cfra)) + { link = pm; if (pid->cache->cached_frames && pm->frame >= sta && pm->frame <= end) { pid->cache->cached_frames[pm->frame - sta] = 0; @@ -2946,7 +2952,8 @@ int BKE_ptcache_object_reset(Scene *scene, Object *ob, int mode) else if (psys->clmd) { BKE_ptcache_id_from_cloth(&pid, ob, psys->clmd); if (mode == PSYS_RESET_ALL || - !(psys->part->type == PART_HAIR && (pid.cache->flag & PTCACHE_BAKED))) { + !(psys->part->type == PART_HAIR && (pid.cache->flag & PTCACHE_BAKED))) + { reset |= BKE_ptcache_id_reset(scene, &pid, mode); } else { @@ -3241,7 +3248,8 @@ void BKE_ptcache_bake(PTCacheBaker *baker) if (pid->type == PTCACHE_TYPE_RIGIDBODY) { if ((cache->flag & PTCACHE_REDO_NEEDED || (cache->flag & PTCACHE_SIMULATION_VALID) == 0) && - (render || bake)) { + (render || bake)) + { BKE_ptcache_id_clear(pid, PTCACHE_CLEAR_ALL, 0); } } @@ -3348,7 +3356,8 @@ void BKE_ptcache_bake(PTCacheBaker *baker) for (pid = pidlist.first; pid; pid = pid->next) { /* skip hair particles */ if (pid->type == PTCACHE_TYPE_PARTICLES && - ((ParticleSystem *)pid->calldata)->part->type == PART_HAIR) { + ((ParticleSystem *)pid->calldata)->part->type == PART_HAIR) + { continue; } diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c index b5509b1bfe2..69bd701bcf8 100644 --- a/source/blender/blenkernel/intern/rigidbody.c +++ b/source/blender/blenkernel/intern/rigidbody.c @@ -208,7 +208,8 @@ bool BKE_rigidbody_is_affected_by_simulation(Object *ob) RigidBodyOb *rbo = ob->rigidbody_object; if (rbo == NULL || rbo->flag & RBO_FLAG_KINEMATIC || rbo->type == RBO_TYPE_PASSIVE || - obCompoundParent) { + obCompoundParent) + { return false; } @@ -587,7 +588,8 @@ static void rigidbody_validate_sim_shape(RigidBodyWorld *rbw, Object *ob, bool r /* Also don't create a shape if this object is parent of a compound shape */ if (ob->parent != NULL && ob->parent->rigidbody_object != NULL && - ob->parent->rigidbody_object->shape == RB_SHAPE_COMPOUND) { + ob->parent->rigidbody_object->shape == RB_SHAPE_COMPOUND) + { return; } @@ -794,7 +796,8 @@ static void rigidbody_validate_sim_object(RigidBodyWorld *rbw, Object *ob, bool } /* Don't create rigid body object if the parent is a compound shape */ if (ob->parent != NULL && ob->parent->rigidbody_object != NULL && - ob->parent->rigidbody_object->shape == RB_SHAPE_COMPOUND) { + ob->parent->rigidbody_object->shape == RB_SHAPE_COMPOUND) + { return; } @@ -1602,7 +1605,8 @@ static void rigidbody_update_ob_array(RigidBodyWorld *rbw) (void)object; /* Ignore if this object is the direct child of an object with a compound shape */ if (object->parent == NULL || object->parent->rigidbody_object == NULL || - object->parent->rigidbody_object->shape != RB_SHAPE_COMPOUND) { + object->parent->rigidbody_object->shape != RB_SHAPE_COMPOUND) + { n++; } } @@ -1617,7 +1621,8 @@ static void rigidbody_update_ob_array(RigidBodyWorld *rbw) FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (rbw->group, object) { /* Ignore if this object is the direct child of an object with a compound shape */ if (object->parent == NULL || object->parent->rigidbody_object == NULL || - object->parent->rigidbody_object->shape != RB_SHAPE_COMPOUND) { + object->parent->rigidbody_object->shape != RB_SHAPE_COMPOUND) + { rbw->objects[i] = object; i++; } @@ -1938,8 +1943,8 @@ static void rigidbody_update_external_forces(Depsgraph *depsgraph, /* update influence of effectors - but don't do it on an effector */ /* only dynamic bodies need effector update */ - if (rbo->type == RBO_TYPE_ACTIVE && - ((ob->pd == NULL) || (ob->pd->forcefield == PFIELD_NULL))) { + if (rbo->type == RBO_TYPE_ACTIVE && ((ob->pd == NULL) || (ob->pd->forcefield == PFIELD_NULL))) + { EffectorWeights *effector_weights = rbw->effector_weights; EffectedPoint epoint; ListBase *effectors; @@ -2008,7 +2013,8 @@ static void rigidbody_update_simulation_post_step(Depsgraph *depsgraph, RigidBod RigidBodyOb *rbo = ob->rigidbody_object; /* Reset kinematic state for transformed objects. */ if (rbo && base && (base->flag & BASE_SELECTED) && (G.moving & G_TRANSFORM_OBJ) && - rbo->shared->physics_object) { + rbo->shared->physics_object) + { RB_body_set_kinematic_state(rbo->shared->physics_object, rbo->flag & RBO_FLAG_KINEMATIC || rbo->flag & RBO_FLAG_DISABLED); RB_body_set_mass(rbo->shared->physics_object, RBO_GET_MASS(rbo)); @@ -2037,7 +2043,8 @@ void BKE_rigidbody_sync_transforms(RigidBodyWorld *rbw, Object *ob, float ctime) /* use rigid body transform after cache start frame if objects is not being transformed */ if (BKE_rigidbody_check_sim_running(rbw, ctime) && - !(ob->base_flag & BASE_SELECTED && G.moving & G_TRANSFORM_OBJ)) { + !(ob->base_flag & BASE_SELECTED && G.moving & G_TRANSFORM_OBJ)) + { float mat[4][4], size_mat[4][4], size[3]; normalize_qt(rbo->orn); /* RB_TODO investigate why quaternion isn't normalized at this point */ @@ -2152,7 +2159,8 @@ void BKE_rigidbody_rebuild_world(Depsgraph *depsgraph, Scene *scene, float ctime (void)object; /* Ignore if this object is the direct child of an object with a compound shape */ if (object->parent == NULL || object->parent->rigidbody_object == NULL || - object->parent->rigidbody_object->shape != RB_SHAPE_COMPOUND) { + object->parent->rigidbody_object->shape != RB_SHAPE_COMPOUND) + { n++; } } diff --git a/source/blender/blenkernel/intern/scene.cc b/source/blender/blenkernel/intern/scene.cc index a84b34e32a4..225136ebcbe 100644 --- a/source/blender/blenkernel/intern/scene.cc +++ b/source/blender/blenkernel/intern/scene.cc @@ -290,7 +290,8 @@ static void scene_copy_data(Main *bmain, ID *id_dst, const ID *id_src, const int for (ViewLayer *view_layer_src = static_cast(scene_src->view_layers.first), *view_layer_dst = static_cast(scene_dst->view_layers.first); view_layer_src; - view_layer_src = view_layer_src->next, view_layer_dst = view_layer_dst->next) { + view_layer_src = view_layer_src->next, view_layer_dst = view_layer_dst->next) + { BKE_view_layer_copy_data(scene_dst, scene_src, view_layer_dst, view_layer_src, flag_subdata); } @@ -1474,7 +1475,8 @@ static void composite_patch(bNodeTree *ntree, Scene *scene) for (bNode *node : ntree->all_nodes()) { if (node->id == nullptr && ((node->type == CMP_NODE_R_LAYERS) || - (node->type == CMP_NODE_CRYPTOMATTE && node->custom1 == CMP_CRYPTOMATTE_SRC_RENDER))) { + (node->type == CMP_NODE_CRYPTOMATTE && node->custom1 == CMP_CRYPTOMATTE_SRC_RENDER))) + { node->id = &scene->id; } } @@ -2419,7 +2421,8 @@ const char *BKE_scene_find_marker_name(const Scene *scene, int frame) for (m1 = static_cast(markers->first), m2 = static_cast(markers->last); m1 && m2; - m1 = m1->next, m2 = m2->prev) { + m1 = m1->next, m2 = m2->prev) + { if (m1->frame == frame) { return m1->name; } @@ -2628,7 +2631,8 @@ static void prepare_mesh_for_viewport_render(Main *bmain, if (obedit) { Mesh *mesh = static_cast(obedit->data); if ((obedit->type == OB_MESH) && - ((obedit->id.recalc & ID_RECALC_ALL) || (mesh->id.recalc & ID_RECALC_ALL))) { + ((obedit->id.recalc & ID_RECALC_ALL) || (mesh->id.recalc & ID_RECALC_ALL))) + { if (check_rendered_viewport_visible(bmain)) { BMesh *bm = mesh->edit_mesh->bm; BMeshToMeshParams params{}; @@ -3358,7 +3362,8 @@ void BKE_scene_multiview_view_prefix_get(Scene *scene, if (BKE_scene_multiview_is_render_view_active(&scene->r, srv)) { const size_t suffix_len = strlen(srv->suffix); if (basename_len >= suffix_len && - STREQLEN(name + basename_len - suffix_len, srv->suffix, suffix_len)) { + STREQLEN(name + basename_len - suffix_len, srv->suffix, suffix_len)) + { BLI_strncpy(r_prefix, name, basename_len - suffix_len + 1); break; } @@ -3502,7 +3507,8 @@ static Depsgraph **scene_get_depsgraph_p(Scene *scene, DepsgraphKey **key_ptr; if (BLI_ghash_ensure_p_ex( - scene->depsgraph_hash, &key, (void ***)&key_ptr, (void ***)&depsgraph_ptr)) { + scene->depsgraph_hash, &key, (void ***)&key_ptr, (void ***)&depsgraph_ptr)) + { return depsgraph_ptr; } diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c index 8ccc4c57af8..5b4ffa2ef8a 100644 --- a/source/blender/blenkernel/intern/screen.c +++ b/source/blender/blenkernel/intern/screen.c @@ -1066,7 +1066,8 @@ ScrArea *BKE_screen_area_map_find_area_xy(const ScrAreaMap *areamap, LISTBASE_FOREACH (ScrArea *, area, &areamap->areabase) { /* Test area's outer screen verts, not inner `area->totrct`. */ if (xy[0] >= area->v1->vec.x && xy[0] <= area->v4->vec.x && xy[1] >= area->v1->vec.y && - xy[1] <= area->v2->vec.y) { + xy[1] <= area->v2->vec.y) + { if (ELEM(spacetype, SPACE_TYPE_ANY, area->spacetype)) { return area; } diff --git a/source/blender/blenkernel/intern/shrinkwrap.cc b/source/blender/blenkernel/intern/shrinkwrap.cc index b7a2ddf725f..74d6f44d052 100644 --- a/source/blender/blenkernel/intern/shrinkwrap.cc +++ b/source/blender/blenkernel/intern/shrinkwrap.cc @@ -473,7 +473,8 @@ bool BKE_shrinkwrap_project_normal(char options, /* Apply back-face. */ const float dot = dot_v3v3(dir, hit_tmp.no); if (((options & MOD_SHRINKWRAP_CULL_TARGET_FRONTFACE) && dot <= 0.0f) || - ((options & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && dot >= 0.0f)) { + ((options & MOD_SHRINKWRAP_CULL_TARGET_BACKFACE) && dot >= 0.0f)) + { return false; /* Ignore hit */ } } @@ -522,8 +523,8 @@ static void shrinkwrap_calc_normal_projection_cb_ex(void *__restrict userdata, return; } - if (calc->vert_positions != nullptr && - calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) { + if (calc->vert_positions != nullptr && calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) + { /* calc->vert_positions contains verts from evaluated mesh. */ /* These coordinates are deformed by vertexCos only for normal projection * (to get correct normals) for other cases calc->verts contains undeformed coordinates and @@ -552,7 +553,8 @@ static void shrinkwrap_calc_normal_projection_cb_ex(void *__restrict userdata, } if (BKE_shrinkwrap_project_normal( - calc->smd->shrinkOpts, tmp_co, tmp_no, 0.0, &calc->local2target, tree, hit)) { + calc->smd->shrinkOpts, tmp_co, tmp_no, 0.0, &calc->local2target, tree, hit)) + { is_aux = false; } } @@ -638,7 +640,8 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) /* If the user doesn't allows to project in any direction of projection axis * then there's nothing todo. */ if ((calc->smd->shrinkOpts & - (MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR | MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR)) == 0) { + (MOD_SHRINKWRAP_PROJECT_ALLOW_POS_DIR | MOD_SHRINKWRAP_PROJECT_ALLOW_NEG_DIR)) == 0) + { return; } @@ -678,7 +681,8 @@ static void shrinkwrap_calc_normal_projection(ShrinkwrapCalcData *calc) } if (BKE_shrinkwrap_init_tree( - &aux_tree_stack, auxMesh, calc->smd->shrinkType, calc->smd->shrinkMode, false)) { + &aux_tree_stack, auxMesh, calc->smd->shrinkType, calc->smd->shrinkMode, false)) + { aux_tree = &aux_tree_stack; } diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c index 091f89d3873..f2b394a021a 100644 --- a/source/blender/blenkernel/intern/softbody.c +++ b/source/blender/blenkernel/intern/softbody.c @@ -1003,7 +1003,8 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]), if (ccdm) { if ((aabbmax[0] < ccdm->bbmin[0]) || (aabbmax[1] < ccdm->bbmin[1]) || (aabbmax[2] < ccdm->bbmin[2]) || (aabbmin[0] > ccdm->bbmax[0]) || - (aabbmin[1] > ccdm->bbmax[1]) || (aabbmin[2] > ccdm->bbmax[2])) { + (aabbmin[1] > ccdm->bbmax[1]) || (aabbmin[2] > ccdm->bbmax[2])) + { /* boxes don't intersect */ BLI_ghashIterator_step(ihash); continue; @@ -1075,7 +1076,8 @@ static int sb_detect_face_pointCached(const float face_v1[3], outerfacethickness = ob->pd->pdef_sboft; if ((aabbmax[0] < ccdm->bbmin[0]) || (aabbmax[1] < ccdm->bbmin[1]) || (aabbmax[2] < ccdm->bbmin[2]) || (aabbmin[0] > ccdm->bbmax[0]) || - (aabbmin[1] > ccdm->bbmax[1]) || (aabbmin[2] > ccdm->bbmax[2])) { + (aabbmin[1] > ccdm->bbmax[1]) || (aabbmin[2] > ccdm->bbmax[2])) + { /* boxes don't intersect */ BLI_ghashIterator_step(ihash); continue; @@ -1172,7 +1174,8 @@ static int sb_detect_face_collisionCached(const float face_v1[3], if ((aabbmax[0] < ccdm->bbmin[0]) || (aabbmax[1] < ccdm->bbmin[1]) || (aabbmax[2] < ccdm->bbmin[2]) || (aabbmin[0] > ccdm->bbmax[0]) || - (aabbmin[1] > ccdm->bbmax[1]) || (aabbmin[2] > ccdm->bbmax[2])) { + (aabbmin[1] > ccdm->bbmax[1]) || (aabbmin[2] > ccdm->bbmax[2])) + { /* boxes don't intersect */ BLI_ghashIterator_step(ihash); continue; @@ -1189,7 +1192,8 @@ static int sb_detect_face_collisionCached(const float face_v1[3], while (a--) { if ((aabbmax[0] < mima->minx) || (aabbmin[0] > mima->maxx) || (aabbmax[1] < mima->miny) || (aabbmin[1] > mima->maxy) || - (aabbmax[2] < mima->minz) || (aabbmin[2] > mima->maxz)) { + (aabbmax[2] < mima->minz) || (aabbmin[2] > mima->maxz)) + { mima++; vt++; continue; @@ -1220,7 +1224,8 @@ static int sb_detect_face_collisionCached(const float face_v1[3], normalize_v3(d_nvect); if (isect_line_segment_tri_v3(nv1, nv2, face_v1, face_v2, face_v3, &t, NULL) || isect_line_segment_tri_v3(nv2, nv3, face_v1, face_v2, face_v3, &t, NULL) || - isect_line_segment_tri_v3(nv3, nv1, face_v1, face_v2, face_v3, &t, NULL)) { + isect_line_segment_tri_v3(nv3, nv1, face_v1, face_v2, face_v3, &t, NULL)) + { madd_v3_v3fl(force, d_nvect, -0.5f); *damp = tune * ob->pd->pdef_sbdamp; deflected = 2; @@ -1259,7 +1264,8 @@ static void scan_for_ext_face_forces(Object *ob, float timenow) &damp, feedback, ob, - timenow)) { + timenow)) + { madd_v3_v3fl(sb->bpoint[bf->v1].force, feedback, tune); madd_v3_v3fl(sb->bpoint[bf->v2].force, feedback, tune); madd_v3_v3fl(sb->bpoint[bf->v3].force, feedback, tune); @@ -1280,7 +1286,8 @@ static void scan_for_ext_face_forces(Object *ob, float timenow) &damp, feedback, ob, - timenow)) { + timenow)) + { madd_v3_v3fl(sb->bpoint[bf->v1].force, feedback, tune); madd_v3_v3fl(sb->bpoint[bf->v2].force, feedback, tune); madd_v3_v3fl(sb->bpoint[bf->v3].force, feedback, tune); @@ -1348,7 +1355,8 @@ static int sb_detect_edge_collisionCached(const float edge_v1[3], if ((aabbmax[0] < ccdm->bbmin[0]) || (aabbmax[1] < ccdm->bbmin[1]) || (aabbmax[2] < ccdm->bbmin[2]) || (aabbmin[0] > ccdm->bbmax[0]) || - (aabbmin[1] > ccdm->bbmax[1]) || (aabbmin[2] > ccdm->bbmax[2])) { + (aabbmin[1] > ccdm->bbmax[1]) || (aabbmin[2] > ccdm->bbmax[2])) + { /* boxes don't intersect */ BLI_ghashIterator_step(ihash); continue; @@ -1365,7 +1373,8 @@ static int sb_detect_edge_collisionCached(const float edge_v1[3], while (a--) { if ((aabbmax[0] < mima->minx) || (aabbmin[0] > mima->maxx) || (aabbmax[1] < mima->miny) || (aabbmin[1] > mima->maxy) || - (aabbmax[2] < mima->minz) || (aabbmin[2] > mima->maxz)) { + (aabbmax[2] < mima->minz) || (aabbmin[2] > mima->maxz)) + { mima++; vt++; continue; @@ -1438,7 +1447,8 @@ static void _scan_for_ext_spring_forces( /* +++ springs colliding */ if (ob->softflag & OB_SB_EDGECOLL) { if (sb_detect_edge_collisionCached( - sb->bpoint[bs->v1].pos, sb->bpoint[bs->v2].pos, &damp, feedback, ob, timenow)) { + sb->bpoint[bs->v1].pos, sb->bpoint[bs->v2].pos, &damp, feedback, ob, timenow)) + { add_v3_v3(bs->ext_force, feedback); bs->flag |= BSF_INTERSECT; // bs->cf=damp; @@ -1653,7 +1663,8 @@ static int sb_detect_vertex_collisionCached(float opco[3], maxz = ccdm->bbmax[2]; if ((opco[0] < minx) || (opco[1] < miny) || (opco[2] < minz) || (opco[0] > maxx) || - (opco[1] > maxy) || (opco[2] > maxz)) { + (opco[1] > maxy) || (opco[2] > maxz)) + { /* Outside the padded bound-box -> collision object is too far away. */ BLI_ghashIterator_step(ihash); continue; @@ -1677,7 +1688,8 @@ static int sb_detect_vertex_collisionCached(float opco[3], /* Use mesh. */ while (a--) { if ((opco[0] < mima->minx) || (opco[0] > mima->maxx) || (opco[1] < mima->miny) || - (opco[1] > mima->maxy) || (opco[2] < mima->minz) || (opco[2] > mima->maxz)) { + (opco[1] > mima->maxy) || (opco[2] < mima->minz) || (opco[2] > mima->maxz)) + { mima++; vt++; continue; @@ -2050,8 +2062,8 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene, kd = sb->goalfrict * sb_fric_force_scale(ob); add_v3_v3v3(auxvect, velgoal, bp->vec); - if (forcetime > - 0.0f) { /* make sure friction does not become rocket motor on time reversal */ + if (forcetime > 0.0f) + { /* make sure friction does not become rocket motor on time reversal */ bp->force[0] -= kd * (auxvect[0]); bp->force[1] -= kd * (auxvect[1]); bp->force[2] -= kd * (auxvect[2]); @@ -3533,7 +3545,8 @@ void sbObjectStep(struct Depsgraph *depsgraph, /* verify if we need to create the softbody data */ if (sb->bpoint == NULL || - ((ob->softflag & OB_SB_EDGES) && !ob->soft->bspring && object_has_edges(ob))) { + ((ob->softflag & OB_SB_EDGES) && !ob->soft->bspring && object_has_edges(ob))) + { switch (ob->type) { case OB_MESH: @@ -3581,13 +3594,15 @@ void sbObjectStep(struct Depsgraph *depsgraph, cache_result = BKE_ptcache_read(&pid, (float)framenr + scene->r.subframe, can_simulate); if (cache_result == PTCACHE_READ_EXACT || cache_result == PTCACHE_READ_INTERPOLATED || - (!can_simulate && cache_result == PTCACHE_READ_OLD)) { + (!can_simulate && cache_result == PTCACHE_READ_OLD)) + { softbody_to_object(ob, vertexCos, numVerts, sb->local); BKE_ptcache_validate(cache, framenr); if (cache_result == PTCACHE_READ_INTERPOLATED && cache->flag & PTCACHE_REDO_NEEDED && - can_write_cache) { + can_write_cache) + { BKE_ptcache_write(&pid, framenr); } @@ -3600,7 +3615,8 @@ void sbObjectStep(struct Depsgraph *depsgraph, } else if (/*ob->id.lib || */ /* "library linking & point-caches" has to be solved properly at some point. */ - (cache->flag & PTCACHE_BAKED)) { + (cache->flag & PTCACHE_BAKED)) + { /* If baked and nothing in cache, do nothing. */ if (can_write_cache) { BKE_ptcache_invalidate(cache); @@ -3613,8 +3629,8 @@ void sbObjectStep(struct Depsgraph *depsgraph, } /* if on second frame, write cache for first frame */ - if (cache->simframe == startframe && - (cache->flag & PTCACHE_OUTDATED || cache->last_exact == 0)) { + if (cache->simframe == startframe && (cache->flag & PTCACHE_OUTDATED || cache->last_exact == 0)) + { BKE_ptcache_write(&pid, startframe); } diff --git a/source/blender/blenkernel/intern/sound.c b/source/blender/blenkernel/intern/sound.c index 73330c25179..af957824bce 100644 --- a/source/blender/blenkernel/intern/sound.c +++ b/source/blender/blenkernel/intern/sound.c @@ -953,7 +953,8 @@ void BKE_sound_seek_scene(Main *bmain, Scene *scene) } AUD_Handle_resume(scene->playback_handle); if (scene->sound_scrub_handle && - AUD_Handle_getStatus(scene->sound_scrub_handle) != AUD_STATUS_INVALID) { + AUD_Handle_getStatus(scene->sound_scrub_handle) != AUD_STATUS_INVALID) + { AUD_Handle_setPosition(scene->sound_scrub_handle, 0); } else { diff --git a/source/blender/blenkernel/intern/studiolight.c b/source/blender/blenkernel/intern/studiolight.c index 7183fb74550..53a42eee116 100644 --- a/source/blender/blenkernel/intern/studiolight.c +++ b/source/blender/blenkernel/intern/studiolight.c @@ -570,7 +570,8 @@ static void studiolight_calculate_radiance_buffer(ImBuf *ibuf, const float zsign) { ITER_PIXELS ( - float, colbuf, 4, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) { + float, colbuf, 4, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) + { float direction[3]; direction[index_x] = xsign * (x - 0.5f); direction[index_y] = ysign * (y - 0.5f); @@ -683,7 +684,8 @@ static void studiolight_spherical_harmonics_calculate_coefficients(StudioLight * sl->radiance_cubemap_buffers[face]->rect_float, 4, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, - STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) { + STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) + { float color[3], cubevec[3], weight; studiolight_calculate_cubemap_vector_weight(cubevec, &weight, face, x, y); mul_v3_v3fl(color, pixel, weight); @@ -977,7 +979,8 @@ BLI_INLINE void studiolight_evaluate_specular_radiance_buffer(ImBuf *radiance_bu radiance_buffer->rect_float, 4, STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE, - STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) { + STUDIOLIGHT_RADIANCE_CUBEMAP_SIZE) + { float direction[3]; direction[zoffset] = zsign * 0.5f; direction[xoffset] = x - 0.5f; @@ -1130,7 +1133,8 @@ static void studiolight_calculate_irradiance_equirect_image(StudioLight *sl) colbuf, 4, STUDIOLIGHT_IRRADIANCE_EQUIRECT_WIDTH, - STUDIOLIGHT_IRRADIANCE_EQUIRECT_HEIGHT) { + STUDIOLIGHT_IRRADIANCE_EQUIRECT_HEIGHT) + { float dir[3]; equirect_to_direction(dir, x, y); studiolight_spherical_harmonics_eval(sl, pixel, dir); @@ -1153,7 +1157,8 @@ static StudioLight *studiolight_add_file(const char *path, int flag) BLI_split_file_part(path, filename, FILE_MAXFILE); if ((((flag & STUDIOLIGHT_TYPE_STUDIO) != 0) && BLI_path_extension_check(filename, ".sl")) || - BLI_path_extension_check_array(filename, imb_ext_image)) { + BLI_path_extension_check_array(filename, imb_ext_image)) + { StudioLight *sl = studiolight_create(STUDIOLIGHT_EXTERNAL_FILE | flag); BLI_strncpy(sl->name, filename, FILE_MAXFILE); BLI_strncpy(sl->path, path, FILE_MAXFILE); diff --git a/source/blender/blenkernel/intern/subdiv_ccg.cc b/source/blender/blenkernel/intern/subdiv_ccg.cc index b5fba4658ac..051c1f03df4 100644 --- a/source/blender/blenkernel/intern/subdiv_ccg.cc +++ b/source/blender/blenkernel/intern/subdiv_ccg.cc @@ -595,7 +595,8 @@ Mesh *BKE_subdiv_to_ccg_mesh(Subdiv *subdiv, /* Make sure evaluator is ready. */ BKE_subdiv_stats_begin(&subdiv->stats, SUBDIV_STATS_SUBDIV_TO_CCG); if (!BKE_subdiv_eval_begin_from_mesh( - subdiv, coarse_mesh, nullptr, SUBDIV_EVALUATOR_TYPE_CPU, nullptr)) { + subdiv, coarse_mesh, nullptr, SUBDIV_EVALUATOR_TYPE_CPU, nullptr)) + { if (coarse_mesh->totpoly) { return nullptr; } diff --git a/source/blender/blenkernel/intern/subdiv_deform.cc b/source/blender/blenkernel/intern/subdiv_deform.cc index d6ea887c568..e052e68118c 100644 --- a/source/blender/blenkernel/intern/subdiv_deform.cc +++ b/source/blender/blenkernel/intern/subdiv_deform.cc @@ -189,7 +189,8 @@ void BKE_subdiv_deform_coarse_vertices(Subdiv *subdiv, /* Make sure evaluator is up to date with possible new topology, and that * is refined for the new positions of coarse vertices. */ if (!BKE_subdiv_eval_begin_from_mesh( - subdiv, coarse_mesh, vertex_cos, SUBDIV_EVALUATOR_TYPE_CPU, nullptr)) { + subdiv, coarse_mesh, vertex_cos, SUBDIV_EVALUATOR_TYPE_CPU, nullptr)) + { /* This could happen in two situations: * - OpenSubdiv is disabled. * - Something totally bad happened, and OpenSubdiv rejected our diff --git a/source/blender/blenkernel/intern/subdiv_foreach.cc b/source/blender/blenkernel/intern/subdiv_foreach.cc index 95c8ff6ea7c..72939e12cff 100644 --- a/source/blender/blenkernel/intern/subdiv_foreach.cc +++ b/source/blender/blenkernel/intern/subdiv_foreach.cc @@ -295,8 +295,8 @@ static void subdiv_foreach_corner_vertices_regular_do( const int ptex_face_index = ctx->face_ptex_offset[coarse_poly_index]; for (int corner = 0; corner < coarse_poly.size(); corner++) { const int coarse_vert = ctx->coarse_corner_verts[coarse_poly[corner]]; - if (check_usage && - BLI_BITMAP_TEST_AND_SET_ATOMIC(ctx->coarse_vertices_used_map, coarse_vert)) { + if (check_usage && BLI_BITMAP_TEST_AND_SET_ATOMIC(ctx->coarse_vertices_used_map, coarse_vert)) + { continue; } const int coarse_vertex_index = coarse_vert; @@ -334,8 +334,8 @@ static void subdiv_foreach_corner_vertices_special_do( int ptex_face_index = ctx->face_ptex_offset[coarse_poly_index]; for (int corner = 0; corner < coarse_poly.size(); corner++, ptex_face_index++) { const int coarse_vert = ctx->coarse_corner_verts[coarse_poly[corner]]; - if (check_usage && - BLI_BITMAP_TEST_AND_SET_ATOMIC(ctx->coarse_vertices_used_map, coarse_vert)) { + if (check_usage && BLI_BITMAP_TEST_AND_SET_ATOMIC(ctx->coarse_vertices_used_map, coarse_vert)) + { continue; } const int coarse_vertex_index = coarse_vert; @@ -430,7 +430,8 @@ static void subdiv_foreach_edge_vertices_regular_do(SubdivForeachTaskContext *ct int subdiv_vertex_index = ctx->vertices_edge_offset + coarse_edge_index * num_subdiv_vertices_per_coarse_edge; for (int vertex_index = 0; vertex_index < num_subdiv_vertices_per_coarse_edge; - vertex_index++, subdiv_vertex_index++) { + vertex_index++, subdiv_vertex_index++) + { float fac = (vertex_index + 1) * inv_resolution_1; if (flip) { fac = 1.0f - fac; @@ -498,7 +499,8 @@ static void subdiv_foreach_edge_vertices_special_do(SubdivForeachTaskContext *ct vertex_delta = -1; } for (int vertex_index = 1; vertex_index < num_vertices_per_ptex_edge; - vertex_index++, subdiv_vertex_index += vertex_delta) { + vertex_index++, subdiv_vertex_index += vertex_delta) + { const float u = vertex_index * inv_ptex_resolution_1; vertex_edge(ctx->foreach_context, tls, @@ -513,7 +515,8 @@ static void subdiv_foreach_edge_vertices_special_do(SubdivForeachTaskContext *ct const int next_corner = (corner + 1) % coarse_poly.size(); const int next_ptex_face_index = ptex_face_start_index + next_corner; for (int vertex_index = 1; vertex_index < num_vertices_per_ptex_edge - 1; - vertex_index++, subdiv_vertex_index += vertex_delta) { + vertex_index++, subdiv_vertex_index += vertex_delta) + { const float v = 1.0f - vertex_index * inv_ptex_resolution_1; vertex_edge(ctx->foreach_context, tls, @@ -1402,7 +1405,8 @@ static void subdiv_foreach_loops_special(SubdivForeachTaskContext *ctx, coarse_poly.size() * num_inner_edges_per_ptex_face + ptex_face_inner_resolution - 1; for (int corner = 0, prev_corner = coarse_poly.size() - 1; corner < coarse_poly.size(); - prev_corner = corner, corner++, subdiv_loop_index += 4) { + prev_corner = corner, corner++, subdiv_loop_index += 4) + { const int corner_edge_index = start_edge_index + corner * num_inner_edges_per_ptex_face; const int current_patch_end_vertex_index = start_vertex_index + corner * num_inner_vertices_per_ptex + @@ -1443,7 +1447,8 @@ static void subdiv_foreach_loops_special(SubdivForeachTaskContext *ctx, } /* Loops for faces connecting inner ptex part with boundary. */ for (int prev_corner = coarse_poly.size() - 1, corner = 0; corner < coarse_poly.size(); - prev_corner = corner, corner++) { + prev_corner = corner, corner++) + { const int coarse_vert = ctx->coarse_corner_verts[coarse_poly[corner]]; const int coarse_edge_i = ctx->coarse_corner_edges[coarse_poly[corner]]; const int coase_prev_vert = ctx->coarse_corner_verts[coarse_poly[prev_corner]]; @@ -1636,9 +1641,11 @@ static void subdiv_foreach_polys(SubdivForeachTaskContext *ctx, void *tls, int p /* Hi-poly subdivided mesh. */ int subdiv_polyon_index = start_poly_index; for (int ptex_of_poly_index = 0; ptex_of_poly_index < num_ptex_faces_per_poly; - ptex_of_poly_index++) { + ptex_of_poly_index++) + { for (int subdiv_poly_index = 0; subdiv_poly_index < num_polys_per_ptex; - subdiv_poly_index++, subdiv_polyon_index++) { + subdiv_poly_index++, subdiv_polyon_index++) + { const int loopstart = start_loop_index + (ptex_of_poly_index * num_loops_per_ptex) + (subdiv_poly_index * 4); ctx->foreach_context->poly( @@ -1810,7 +1817,8 @@ bool BKE_subdiv_foreach_subdiv_geometry(Subdiv *subdiv, ctx.num_subdiv_edges, ctx.num_subdiv_loops, ctx.num_subdiv_polygons, - ctx.subdiv_polygon_offset)) { + ctx.subdiv_polygon_offset)) + { subdiv_foreach_ctx_free(&ctx); return false; } diff --git a/source/blender/blenkernel/intern/subdiv_mesh.cc b/source/blender/blenkernel/intern/subdiv_mesh.cc index e28ba92d132..eabf6847b40 100644 --- a/source/blender/blenkernel/intern/subdiv_mesh.cc +++ b/source/blender/blenkernel/intern/subdiv_mesh.cc @@ -696,7 +696,8 @@ static void subdiv_mesh_ensure_vertex_interpolation(SubdivMeshContext *ctx, /* Check whether we've moved to another corner or polygon. */ if (tls->vertex_interpolation_initialized) { if (tls->vertex_interpolation_coarse_poly_index != coarse_poly_index || - tls->vertex_interpolation_coarse_corner != coarse_corner) { + tls->vertex_interpolation_coarse_corner != coarse_corner) + { vertex_interpolation_end(&tls->vertex_interpolation); tls->vertex_interpolation_initialized = false; } @@ -707,7 +708,8 @@ static void subdiv_mesh_ensure_vertex_interpolation(SubdivMeshContext *ctx, } /* Update it for a new corner if needed. */ if (!tls->vertex_interpolation_initialized || - tls->vertex_interpolation_coarse_corner != coarse_corner) { + tls->vertex_interpolation_coarse_corner != coarse_corner) + { vertex_interpolation_from_corner(ctx, &tls->vertex_interpolation, coarse_poly, coarse_corner); } /* Store settings used for the current state of interpolator. */ @@ -868,7 +870,8 @@ static void subdiv_mesh_ensure_loop_interpolation(SubdivMeshContext *ctx, /* Check whether we've moved to another corner or polygon. */ if (tls->loop_interpolation_initialized) { if (tls->loop_interpolation_coarse_poly_index != coarse_poly_index || - tls->loop_interpolation_coarse_corner != coarse_corner) { + tls->loop_interpolation_coarse_corner != coarse_corner) + { loop_interpolation_end(&tls->loop_interpolation); tls->loop_interpolation_initialized = false; } @@ -1151,7 +1154,8 @@ Mesh *BKE_subdiv_to_mesh(Subdiv *subdiv, /* Make sure evaluator is up to date with possible new topology, and that * it is refined for the new positions of coarse vertices. */ if (!BKE_subdiv_eval_begin_from_mesh( - subdiv, coarse_mesh, nullptr, SUBDIV_EVALUATOR_TYPE_CPU, nullptr)) { + subdiv, coarse_mesh, nullptr, SUBDIV_EVALUATOR_TYPE_CPU, nullptr)) + { /* This could happen in two situations: * - OpenSubdiv is disabled. * - Something totally bad happened, and OpenSubdiv rejected our diff --git a/source/blender/blenkernel/intern/subsurf_ccg.cc b/source/blender/blenkernel/intern/subsurf_ccg.cc index 30f3202963c..93dbc4f224b 100644 --- a/source/blender/blenkernel/intern/subsurf_ccg.cc +++ b/source/blender/blenkernel/intern/subsurf_ccg.cc @@ -102,7 +102,8 @@ static CCGSubSurf *_getSubSurf(CCGSubSurf *prevSS, int subdivLevels, int numLaye ccgSubSurf_getUseAgeCounts(prevSS, &oldUseAging, nullptr, nullptr, nullptr); if ((oldUseAging != useAging) || - (ccgSubSurf_getSimpleSubdiv(prevSS) != !!(flags & CCG_SIMPLE_SUBDIV))) { + (ccgSubSurf_getSimpleSubdiv(prevSS) != !!(flags & CCG_SIMPLE_SUBDIV))) + { ccgSubSurf_free(prevSS); } else { @@ -390,7 +391,8 @@ static void set_subsurf_legacy_uv(CCGSubSurf *ss, DerivedMesh *dm, DerivedMesh * CCGFace **faceMap = static_cast( MEM_mallocN(totface * sizeof(*faceMap), "facemapuv")); for (ccgSubSurf_initFaceIterator(uvss, &fi); !ccgFaceIterator_isStopped(&fi); - ccgFaceIterator_next(&fi)) { + ccgFaceIterator_next(&fi)) + { CCGFace *f = ccgFaceIterator_getCurrent(&fi); faceMap[POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f))] = f; } @@ -597,7 +599,8 @@ static void ss_sync_ccg_from_derivedmesh(CCGSubSurf *ss, * other parts of code significantly to handle missing faces. * since this really shouldn't even be possible we just bail. */ if (ccgSubSurf_syncFace(ss, POINTER_FROM_INT(i), poly.size(), fverts.data(), &f) == - eCCGError_InvalidValue) { + eCCGError_InvalidValue) + { static int hasGivenError = 0; if (!hasGivenError) { @@ -682,7 +685,8 @@ static void UNUSED_FUNCTION(ccgDM_getMinMax)(DerivedMesh *dm, float r_min[3], fl } for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); - ccgVertIterator_next(&vi)) { + ccgVertIterator_next(&vi)) + { CCGVert *v = ccgVertIterator_getCurrent(&vi); float *co = static_cast(ccgSubSurf_getVertData(ss, v)); @@ -690,7 +694,8 @@ static void UNUSED_FUNCTION(ccgDM_getMinMax)(DerivedMesh *dm, float r_min[3], fl } for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); - ccgEdgeIterator_next(&ei)) { + ccgEdgeIterator_next(&ei)) + { CCGEdge *e = ccgEdgeIterator_getCurrent(&ei); CCGElem *edgeData = static_cast(ccgSubSurf_getEdgeDataArray(ss, e)); @@ -700,7 +705,8 @@ static void UNUSED_FUNCTION(ccgDM_getMinMax)(DerivedMesh *dm, float r_min[3], fl } for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); - ccgFaceIterator_next(&fi)) { + ccgFaceIterator_next(&fi)) + { CCGFace *f = ccgFaceIterator_getCurrent(&fi); int S, x, y, numVerts = ccgSubSurf_getFaceNumVerts(f); @@ -1016,7 +1022,8 @@ static void ccgDM_release(DerivedMesh *dm) if (ccgdm->multires.modified_flags) { /* Check that mmd still exists */ if (!ccgdm->multires.local_mmd && - BLI_findindex(&ccgdm->multires.ob->modifiers, ccgdm->multires.mmd) < 0) { + BLI_findindex(&ccgdm->multires.ob->modifiers, ccgdm->multires.mmd) < 0) + { ccgdm->multires.mmd = nullptr; } @@ -1356,7 +1363,8 @@ static void create_ccgdm_maps(CCGDerivedMesh *ccgdm, CCGSubSurf *ss) ccgdm->vertMap = static_cast( MEM_mallocN(totvert * sizeof(*ccgdm->vertMap), "vertMap")); for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); - ccgVertIterator_next(&vi)) { + ccgVertIterator_next(&vi)) + { CCGVert *v = ccgVertIterator_getCurrent(&vi); ccgdm->vertMap[POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v))].vert = v; @@ -1366,7 +1374,8 @@ static void create_ccgdm_maps(CCGDerivedMesh *ccgdm, CCGSubSurf *ss) ccgdm->edgeMap = static_cast( MEM_mallocN(totedge * sizeof(*ccgdm->edgeMap), "edgeMap")); for (ccgSubSurf_initEdgeIterator(ss, &ei); !ccgEdgeIterator_isStopped(&ei); - ccgEdgeIterator_next(&ei)) { + ccgEdgeIterator_next(&ei)) + { CCGEdge *e = ccgEdgeIterator_getCurrent(&ei); ccgdm->edgeMap[POINTER_AS_INT(ccgSubSurf_getEdgeEdgeHandle(e))].edge = e; @@ -1376,7 +1385,8 @@ static void create_ccgdm_maps(CCGDerivedMesh *ccgdm, CCGSubSurf *ss) ccgdm->faceMap = static_cast( MEM_mallocN(totface * sizeof(*ccgdm->faceMap), "faceMap")); for (ccgSubSurf_initFaceIterator(ss, &fi); !ccgFaceIterator_isStopped(&fi); - ccgFaceIterator_next(&fi)) { + ccgFaceIterator_next(&fi)) + { CCGFace *f = ccgFaceIterator_getCurrent(&fi); ccgdm->faceMap[POINTER_AS_INT(ccgSubSurf_getFaceFaceHandle(f))].face = f; @@ -1866,7 +1876,8 @@ void subsurf_calculate_limit_positions(Mesh *me, float (*r_positions)[3]) ss_sync_from_derivedmesh(ss, dm, nullptr, 0, 0); for (ccgSubSurf_initVertIterator(ss, &vi); !ccgVertIterator_isStopped(&vi); - ccgVertIterator_next(&vi)) { + ccgVertIterator_next(&vi)) + { CCGVert *v = ccgVertIterator_getCurrent(&vi); int idx = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v)); int N = ccgSubSurf_getVertNumEdges(v); diff --git a/source/blender/blenkernel/intern/text.c b/source/blender/blenkernel/intern/text.c index 4b770ab8989..5dc7f0e8a97 100644 --- a/source/blender/blenkernel/intern/text.c +++ b/source/blender/blenkernel/intern/text.c @@ -1150,7 +1150,8 @@ static void txt_curs_swap(Text *text) static void txt_pop_first(Text *text) { if (txt_get_span(text->curl, text->sell) < 0 || - (text->curl == text->sell && text->curc > text->selc)) { + (text->curl == text->sell && text->curc > text->selc)) + { txt_curs_swap(text); } @@ -1160,7 +1161,8 @@ static void txt_pop_first(Text *text) static void txt_pop_last(Text *text) { if (txt_get_span(text->curl, text->sell) > 0 || - (text->curl == text->sell && text->curc < text->selc)) { + (text->curl == text->sell && text->curc < text->selc)) + { txt_curs_swap(text); } @@ -1185,13 +1187,15 @@ void txt_order_cursors(Text *text, const bool reverse) /* Flip so text->curl is before/after text->sell */ if (reverse == false) { if ((txt_get_span(text->curl, text->sell) < 0) || - (text->curl == text->sell && text->curc > text->selc)) { + (text->curl == text->sell && text->curc > text->selc)) + { txt_curs_swap(text); } } else { if ((txt_get_span(text->curl, text->sell) > 0) || - (text->curl == text->sell && text->curc < text->selc)) { + (text->curl == text->sell && text->curc < text->selc)) + { txt_curs_swap(text); } } diff --git a/source/blender/blenkernel/intern/texture.cc b/source/blender/blenkernel/intern/texture.cc index 7f9e4bbdc07..a42fdf906e0 100644 --- a/source/blender/blenkernel/intern/texture.cc +++ b/source/blender/blenkernel/intern/texture.cc @@ -272,7 +272,8 @@ void BKE_texture_mapping_init(TexMapping *texmap) float smat[4][4], rmat[4][4], tmat[4][4], proj[4][4], size[3]; if (texmap->projx == PROJ_X && texmap->projy == PROJ_Y && texmap->projz == PROJ_Z && - is_zero_v3(texmap->loc) && is_zero_v3(texmap->rot) && is_one_v3(texmap->size)) { + is_zero_v3(texmap->loc) && is_zero_v3(texmap->rot) && is_one_v3(texmap->size)) + { unit_m4(texmap->mat); texmap->flag |= TEXMAP_UNIT_MATRIX; diff --git a/source/blender/blenkernel/intern/tracking.cc b/source/blender/blenkernel/intern/tracking.cc index e10c4b8ffe3..a0ac5779d16 100644 --- a/source/blender/blenkernel/intern/tracking.cc +++ b/source/blender/blenkernel/intern/tracking.cc @@ -1678,8 +1678,8 @@ void BKE_tracking_plane_tracks_remove_point_track(MovieTracking *tracking, MovieTrackingTrack *track) { MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking); - LISTBASE_FOREACH_MUTABLE ( - MovieTrackingPlaneTrack *, plane_track, &tracking_object->plane_tracks) { + LISTBASE_FOREACH_MUTABLE (MovieTrackingPlaneTrack *, plane_track, &tracking_object->plane_tracks) + { if (BKE_tracking_plane_track_has_point_track(plane_track, track)) { if (!BKE_tracking_plane_track_remove_point_track(plane_track, track)) { /* Delete planes with less than 3 point tracks in it. */ @@ -2718,7 +2718,8 @@ ImBuf *BKE_tracking_get_search_imbuf(const ImBuf *ibuf, if (disable_channels) { if ((track->flag & TRACK_PREVIEW_GRAYSCALE) || (track->flag & TRACK_DISABLE_RED) || - (track->flag & TRACK_DISABLE_GREEN) || (track->flag & TRACK_DISABLE_BLUE)) { + (track->flag & TRACK_DISABLE_GREEN) || (track->flag & TRACK_DISABLE_BLUE)) + { disable_imbuf_channels(searchibuf, track, true); } } diff --git a/source/blender/blenkernel/intern/tracking_auto.cc b/source/blender/blenkernel/intern/tracking_auto.cc index a2154e475e1..c21818108a1 100644 --- a/source/blender/blenkernel/intern/tracking_auto.cc +++ b/source/blender/blenkernel/intern/tracking_auto.cc @@ -300,7 +300,8 @@ static bool tracking_check_marker_margin(const libmv_Marker *libmv_marker, if (libmv_marker->center[0] < margin_left || libmv_marker->center[0] > frame_width - margin_right || libmv_marker->center[1] < margin_bottom || - libmv_marker->center[1] > frame_height - margin_top) { + libmv_marker->center[1] > frame_height - margin_top) + { return false; } @@ -644,7 +645,8 @@ static void autotrack_context_step_cb(void *__restrict userdata, /* Check whether marker is going outside of allowed frame margin. */ if (!tracking_check_marker_margin( - libmv_current_marker, track->margin, autotrack_clip->width, autotrack_clip->height)) { + libmv_current_marker, track->margin, autotrack_clip->width, autotrack_clip->height)) + { return; } diff --git a/source/blender/blenkernel/intern/tracking_plane_tracker.cc b/source/blender/blenkernel/intern/tracking_plane_tracker.cc index de3c6835418..ebd11c1027d 100644 --- a/source/blender/blenkernel/intern/tracking_plane_tracker.cc +++ b/source/blender/blenkernel/intern/tracking_plane_tracker.cc @@ -130,7 +130,8 @@ static void track_plane_from_existing_motion(MovieTrackingPlaneTrack *plane_trac new_plane_marker.framenr = current_frame + frame_delta; if (!retrack && keyframe_plane_marker && next_plane_marker && - (plane_track->flag & PLANE_TRACK_AUTOKEY)) { + (plane_track->flag & PLANE_TRACK_AUTOKEY)) + { float fac = (float(next_plane_marker->framenr) - start_plane_marker->framenr) / (float(keyframe_plane_marker->framenr) - start_plane_marker->framenr); diff --git a/source/blender/blenkernel/intern/tracking_region_tracker.cc b/source/blender/blenkernel/intern/tracking_region_tracker.cc index fb63887810f..48a258d1bbf 100644 --- a/source/blender/blenkernel/intern/tracking_region_tracker.cc +++ b/source/blender/blenkernel/intern/tracking_region_tracker.cc @@ -278,7 +278,8 @@ static bool refine_marker_reference_frame_get(MovieTrackingTrack *track, MovieTrackingMarker *reference = backwards ? marker + 1 : marker - 1; while (reference >= first_marker && reference <= last_marker && - (reference->flag & MARKER_DISABLED) != 0) { + (reference->flag & MARKER_DISABLED) != 0) + { if (backwards) { reference++; } diff --git a/source/blender/blenkernel/intern/tracking_stabilize.cc b/source/blender/blenkernel/intern/tracking_stabilize.cc index 36db23aa0ea..a230c57b636 100644 --- a/source/blender/blenkernel/intern/tracking_stabilize.cc +++ b/source/blender/blenkernel/intern/tracking_stabilize.cc @@ -267,7 +267,8 @@ static void retrieve_next_higher_usable_frame( BLI_assert(0 <= i && i < end); while (i < end && - (markers[i].framenr < ref_frame || is_effectively_disabled(ctx, track, &markers[i]))) { + (markers[i].framenr < ref_frame || is_effectively_disabled(ctx, track, &markers[i]))) + { i++; } if (i < end && markers[i].framenr < *next_higher) { @@ -282,7 +283,8 @@ static void retrieve_next_lower_usable_frame( MovieTrackingMarker *markers = track->markers; BLI_assert(0 <= i && i < track->markersnr); while (i >= 0 && - (markers[i].framenr > ref_frame || is_effectively_disabled(ctx, track, &markers[i]))) { + (markers[i].framenr > ref_frame || is_effectively_disabled(ctx, track, &markers[i]))) + { i--; } if (0 <= i && markers[i].framenr > *next_lower) { @@ -1116,7 +1118,8 @@ static float calculate_autoscale_factor(StabContext *ctx, int size, float aspect /* Calculate maximal frame range of tracks where stabilization is active. */ LISTBASE_FOREACH (MovieTrackingTrack *, track, &tracking_camera_object->tracks) { if ((track->flag & TRACK_USE_2D_STAB) || - ((stab->flag & TRACKING_STABILIZE_ROTATION) && (track->flag & TRACK_USE_2D_STAB_ROT))) { + ((stab->flag & TRACKING_STABILIZE_ROTATION) && (track->flag & TRACK_USE_2D_STAB_ROT))) + { int first_frame = track->markers[0].framenr; int last_frame = track->markers[track->markersnr - 1].framenr; sfra = min_ii(sfra, first_frame); @@ -1267,7 +1270,8 @@ void BKE_tracking_stabilization_data_get(MovieClip *clip, } if (enabled && stabilization_determine_offset_for_frame( - ctx, framenr, aspect, translation, pivot, angle, &scale_step)) { + ctx, framenr, aspect, translation, pivot, angle, &scale_step)) + { stabilization_calculate_data( ctx, framenr, size, aspect, do_compensate, scale_step, translation, pivot, scale, angle); compensate_rotation_center(size, aspect, *angle, *scale, pivot, translation); diff --git a/source/blender/blenkernel/intern/tracking_util.cc b/source/blender/blenkernel/intern/tracking_util.cc index 0a6669e2a29..efe1054c0c0 100644 --- a/source/blender/blenkernel/intern/tracking_util.cc +++ b/source/blender/blenkernel/intern/tracking_util.cc @@ -626,7 +626,8 @@ static ImBuf *make_grayscale_ibuf_copy(ImBuf *ibuf) const size_t num_pixels = size_t(grayscale->x) * size_t(grayscale->y); grayscale->channels = 1; if ((grayscale->rect_float = MEM_cnew_array(num_pixels, "tracking grayscale image")) != - nullptr) { + nullptr) + { grayscale->mall |= IB_rectfloat; grayscale->flags |= IB_rectfloat; @@ -655,7 +656,8 @@ static ImBuf *float_image_to_ibuf(libmv_FloatImage *float_image) size_t num_total_channels = size_t(ibuf->x) * size_t(ibuf->y) * float_image->channels; ibuf->channels = float_image->channels; if ((ibuf->rect_float = MEM_cnew_array(num_total_channels, "tracking grayscale image")) != - nullptr) { + nullptr) + { ibuf->mall |= IB_rectfloat; ibuf->flags |= IB_rectfloat; diff --git a/source/blender/blenkernel/intern/undo_system.cc b/source/blender/blenkernel/intern/undo_system.cc index 4058c7b91d6..76d3f26b59b 100644 --- a/source/blender/blenkernel/intern/undo_system.cc +++ b/source/blender/blenkernel/intern/undo_system.cc @@ -767,7 +767,8 @@ bool BKE_undosys_step_load_data_ex(UndoStack *ustack, * from given reference step. */ bool is_processing_extra_skipped_steps = false; for (UndoStep *us_iter = undosys_step_iter_first(us_reference, undo_dir); us_iter != nullptr; - us_iter = (undo_dir == -1) ? us_iter->prev : us_iter->next) { + us_iter = (undo_dir == -1) ? us_iter->prev : us_iter->next) + { BLI_assert(us_iter != nullptr); const bool is_final = (us_iter == us_target_active); diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c index a3d46850c92..e5f64df3741 100644 --- a/source/blender/blenkernel/intern/unit.c +++ b/source/blender/blenkernel/intern/unit.c @@ -714,7 +714,8 @@ static const char *unit_find_str(const char *str, const char *substr, bool case_ if (str_found == str || /* Weak unicode support!, so "µm" won't match up be replaced by "m" * since non ascii utf8 values will NEVER return true */ - isalpha_or_utf8(*BLI_str_find_prev_char_utf8(str_found, str)) == 0) { + isalpha_or_utf8(*BLI_str_find_prev_char_utf8(str_found, str)) == 0) + { /* Next char cannot be alpha-numeric. */ int len_name = strlen(substr); @@ -812,7 +813,8 @@ static char *find_next_op(const char *str, char *remaining_str, int len_max) if (remaining_str != str && i != 0) { /* Check for velocity or acceleration (e.g. '/' in 'ft/s' is not an op). */ if ((remaining_str[i] == '/') && ELEM(remaining_str[i - 1], 't', 'T', 'm', 'M') && - ELEM(remaining_str[i + 1], 's', 'S')) { + ELEM(remaining_str[i + 1], 's', 'S')) + { continue; } @@ -1110,7 +1112,8 @@ bool BKE_unit_replace_string( /* Apply the default unit on the whole expression, this allows to handle nasty cases like * '2+2in'. */ if (BLI_snprintf(str_tmp, sizeof(str_tmp), "(%s)*%.9g", str, default_unit->scalar) < - sizeof(str_tmp)) { + sizeof(str_tmp)) + { strncpy(str, str_tmp, len_max); } else { diff --git a/source/blender/blenkernel/intern/vfont.c b/source/blender/blenkernel/intern/vfont.c index 1d55cd9d494..1f55f4396c1 100644 --- a/source/blender/blenkernel/intern/vfont.c +++ b/source/blender/blenkernel/intern/vfont.c @@ -1339,7 +1339,8 @@ static bool vfont_to_curve(Object *ob, if (cu->textoncurve && cu->textoncurve->type == OB_CURVES_LEGACY) { BLI_assert(cu->textoncurve->runtime.curve_cache != NULL); if (cu->textoncurve->runtime.curve_cache != NULL && - cu->textoncurve->runtime.curve_cache->anim_path_accum_length != NULL) { + cu->textoncurve->runtime.curve_cache->anim_path_accum_length != NULL) + { float distfac, imat[4][4], imat3[3][3], cmat[3][3]; float minx, maxx; float timeofs, sizefac; @@ -1487,15 +1488,18 @@ static bool vfont_to_curve(Object *ob, float charwidth = char_width(cu, che, info); float charhalf = (charwidth / 2.0f); if (cursor_params->cursor_location[1] >= ct->yof - (0.25f * linedist) && - cursor_params->cursor_location[1] <= (ct->yof + (0.75f * linedist))) { + cursor_params->cursor_location[1] <= (ct->yof + (0.75f * linedist))) + { /* On this row. */ if (cursor_params->cursor_location[0] >= (ct->xof) && - cursor_params->cursor_location[0] <= (ct->xof + charhalf)) { + cursor_params->cursor_location[0] <= (ct->xof + charhalf)) + { /* Left half of character. */ cursor_params->r_string_offset = i; } else if (cursor_params->cursor_location[0] >= (ct->xof + charhalf) && - cursor_params->cursor_location[0] <= (ct->xof + charwidth)) { + cursor_params->cursor_location[0] <= (ct->xof + charwidth)) + { /* Right half of character. */ cursor_params->r_string_offset = i + 1; } @@ -1504,7 +1508,8 @@ static bool vfont_to_curve(Object *ob, } if (ELEM(mode, FO_CURSUP, FO_CURSDOWN, FO_PAGEUP, FO_PAGEDOWN) && - iter_data->status == VFONT_TO_CURVE_INIT) { + iter_data->status == VFONT_TO_CURVE_INIT) + { ct = &chartransdata[ef->pos]; if (ELEM(mode, FO_CURSUP, FO_PAGEUP) && ct->linenr == 0) { @@ -1617,7 +1622,8 @@ static bool vfont_to_curve(Object *ob, info = &(custrinfo[i]); if ((cu->overflow == CU_OVERFLOW_TRUNCATE) && (ob && ob->mode != OB_MODE_EDIT) && - (info->flag & CU_CHINFO_OVERFLOW)) { + (info->flag & CU_CHINFO_OVERFLOW)) + { break; } @@ -1643,7 +1649,8 @@ static bool vfont_to_curve(Object *ob, if ((i < (slen - 1)) && (mem[i + 1] != '\n') && ((mem[i + 1] != ' ') || (custrinfo[i + 1].flag & CU_CHINFO_UNDERLINE)) && - ((custrinfo[i + 1].flag & CU_CHINFO_WRAP) == 0)) { + ((custrinfo[i + 1].flag & CU_CHINFO_WRAP) == 0)) + { uloverlap = xtrax + 0.1f; } /* Find the character, the characters has to be in the memory already @@ -1751,7 +1758,8 @@ static bool vfont_to_curve(Object *ob, /* We iterated enough or got a good enough result. */ if ((!iter_data->iteraction--) || ((iter_data->bisect.max - iter_data->bisect.min) < - (cu->fsize * FONT_TO_CURVE_SCALE_THRESHOLD))) { + (cu->fsize * FONT_TO_CURVE_SCALE_THRESHOLD))) + { if (valid) { iter_data->status = VFONT_TO_CURVE_DONE; } diff --git a/source/blender/blenkernel/intern/vfontdata_freetype.c b/source/blender/blenkernel/intern/vfontdata_freetype.c index 9fe83ce7aa0..ee3515d2a1f 100644 --- a/source/blender/blenkernel/intern/vfontdata_freetype.c +++ b/source/blender/blenkernel/intern/vfontdata_freetype.c @@ -219,7 +219,8 @@ static VChar *freetypechar_to_vchar(FT_Face face, FT_ULong charcode, VFontData * (len_squared_v2v2(bezt->vec[0], bezt->vec[2]) > eps_sq) && (len_squared_v2v2(bezt->vec[0], bezt->vec[2]) > max_ff(len_squared_v2v2(bezt->vec[0], bezt->vec[1]), - len_squared_v2v2(bezt->vec[1], bezt->vec[2])))) { + len_squared_v2v2(bezt->vec[1], bezt->vec[2])))) + { bezt->h1 = bezt->h2 = HD_ALIGN; } bezt->radius = 1.0f; @@ -293,7 +294,8 @@ static FT_Face vfont_face_load_from_packed_file(FT_Library library, PackedFile * FT_UInt glyph_index = 0; FT_Get_First_Char(face, &glyph_index); if (!glyph_index || - FT_Load_Glyph(face, glyph_index, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP) != FT_Err_Ok) { + FT_Load_Glyph(face, glyph_index, FT_LOAD_NO_SCALE | FT_LOAD_NO_BITMAP) != FT_Err_Ok) + { FT_Done_Face(face); return NULL; } diff --git a/source/blender/blenkernel/intern/workspace.cc b/source/blender/blenkernel/intern/workspace.cc index 2183a3c82e1..813919bfd30 100644 --- a/source/blender/blenkernel/intern/workspace.cc +++ b/source/blender/blenkernel/intern/workspace.cc @@ -309,7 +309,8 @@ static bool UNUSED_FUNCTION(workspaces_is_screen_used) (const Main *bmain, bScreen *screen) { for (WorkSpace *workspace = static_cast(bmain->workspaces.first); workspace; - workspace = static_cast(workspace->id.next)) { + workspace = static_cast(workspace->id.next)) + { if (workspace_layout_find_exec(workspace, screen)) { return true; } @@ -336,7 +337,8 @@ void BKE_workspace_remove(Main *bmain, WorkSpace *workspace) for (WorkSpaceLayout *layout = static_cast(workspace->layouts.first), *layout_next; layout; - layout = layout_next) { + layout = layout_next) + { layout_next = layout->next; BKE_workspace_layout_remove(bmain, workspace, layout); } @@ -349,7 +351,8 @@ WorkSpaceInstanceHook *BKE_workspace_instance_hook_create(const Main *bmain, con /* set an active screen-layout for each possible window/workspace combination */ for (WorkSpace *workspace = static_cast(bmain->workspaces.first); workspace; - workspace = static_cast(workspace->id.next)) { + workspace = static_cast(workspace->id.next)) + { BKE_workspace_active_layout_set( hook, winid, workspace, static_cast(workspace->layouts.first)); } @@ -365,12 +368,14 @@ void BKE_workspace_instance_hook_free(const Main *bmain, WorkSpaceInstanceHook * /* Free relations for this hook */ for (WorkSpace *workspace = static_cast(bmain->workspaces.first); workspace; - workspace = static_cast(workspace->id.next)) { + workspace = static_cast(workspace->id.next)) + { for (WorkSpaceDataRelation *relation = static_cast( workspace->hook_layout_relations.first), *relation_next; relation; - relation = relation_next) { + relation = relation_next) + { relation_next = relation->next; if (relation->parent == hook) { workspace_relation_remove(&workspace->hook_layout_relations, relation); @@ -417,7 +422,8 @@ void BKE_workspace_relations_free(ListBase *relation_list) relation = static_cast(relation_list->first), *relation_next; relation; - relation = relation_next) { + relation = relation_next) + { relation_next = relation->next; workspace_relation_remove(relation_list, relation); } @@ -457,7 +463,8 @@ WorkSpaceLayout *BKE_workspace_layout_find_global(const Main *bmain, } for (WorkSpace *workspace = static_cast(bmain->workspaces.first); workspace; - workspace = static_cast(workspace->id.next)) { + workspace = static_cast(workspace->id.next)) + { if ((layout = workspace_layout_find_exec(workspace, screen))) { if (r_workspace) { *r_workspace = workspace; diff --git a/source/blender/blenkernel/intern/writeavi.c b/source/blender/blenkernel/intern/writeavi.c index a1f14623cef..d51bfec1899 100644 --- a/source/blender/blenkernel/intern/writeavi.c +++ b/source/blender/blenkernel/intern/writeavi.c @@ -119,7 +119,8 @@ bMovieHandle *BKE_movie_handle_get(const char imtype) R_IMF_IMTYPE_H264, R_IMF_IMTYPE_XVID, R_IMF_IMTYPE_THEORA, - R_IMF_IMTYPE_AV1)) { + R_IMF_IMTYPE_AV1)) + { mh.start_movie = BKE_ffmpeg_start; mh.append_movie = BKE_ffmpeg_append; mh.end_movie = BKE_ffmpeg_end; diff --git a/source/blender/blenkernel/intern/writeffmpeg.c b/source/blender/blenkernel/intern/writeffmpeg.c index ffafd926785..06eb9bb895a 100644 --- a/source/blender/blenkernel/intern/writeffmpeg.c +++ b/source/blender/blenkernel/intern/writeffmpeg.c @@ -1217,7 +1217,8 @@ static int start_ffmpeg_impl(FFMpegContext *context, if (context->ffmpeg_type == FFMPEG_DV) { audio_codec = AV_CODEC_ID_PCM_S16LE; if (context->ffmpeg_audio_codec != AV_CODEC_ID_NONE && - rd->ffcodecdata.audio_mixrate != 48000 && rd->ffcodecdata.audio_channels != 2) { + rd->ffcodecdata.audio_mixrate != 48000 && rd->ffcodecdata.audio_channels != 2) + { BKE_report(reports, RPT_ERROR, "FFMPEG only supports 48khz / stereo audio for DV!"); goto fail; } @@ -1738,7 +1739,8 @@ void BKE_ffmpeg_image_type_verify(RenderData *rd, const ImageFormatData *imf) if (imf->imtype == R_IMF_IMTYPE_FFMPEG) { if (rd->ffcodecdata.type <= 0 || rd->ffcodecdata.codec <= 0 || - rd->ffcodecdata.audio_codec <= 0 || rd->ffcodecdata.video_bitrate <= 1) { + rd->ffcodecdata.audio_codec <= 0 || rd->ffcodecdata.video_bitrate <= 1) + { BKE_ffmpeg_preset_set(rd, FFMPEG_PRESET_H264); rd->ffcodecdata.constant_rate_factor = FFM_CRF_MEDIUM; rd->ffcodecdata.ffmpeg_preset = FFM_PRESET_GOOD; diff --git a/source/blender/blenlib/BLI_atomic_disjoint_set.hh b/source/blender/blenlib/BLI_atomic_disjoint_set.hh index b5cb652e2bc..ab458ef3a32 100644 --- a/source/blender/blenlib/BLI_atomic_disjoint_set.hh +++ b/source/blender/blenlib/BLI_atomic_disjoint_set.hh @@ -60,7 +60,8 @@ class AtomicDisjointSet { /* Implement union by rank heuristic. */ x_item.rank > y_item.rank /* If the rank is the same, make a consistent decision. */ - || (x_item.rank == y_item.rank && x < y)) { + || (x_item.rank == y_item.rank && x < y)) + { std::swap(x_item, y_item); std::swap(x, y); } diff --git a/source/blender/blenlib/BLI_linklist_stack.h b/source/blender/blenlib/BLI_linklist_stack.h index 3e4acb44457..63878d5a61f 100644 --- a/source/blender/blenlib/BLI_linklist_stack.h +++ b/source/blender/blenlib/BLI_linklist_stack.h @@ -146,7 +146,8 @@ LinkNode *_##var##_iter; \ unsigned int i; \ for (_##var##_iter = _##var##_stack, i = 0; _##var##_iter; \ - _##var##_iter = _##var##_iter->next, i++) { \ + _##var##_iter = _##var##_iter->next, i++) \ + { \ (data)[i] = _BLI_SMALLSTACK_CAST(var)(_##var##_iter->link); \ } \ } \ diff --git a/source/blender/blenlib/BLI_virtual_array.hh b/source/blender/blenlib/BLI_virtual_array.hh index d830ca541fe..54a5ece2f2e 100644 --- a/source/blender/blenlib/BLI_virtual_array.hh +++ b/source/blender/blenlib/BLI_virtual_array.hh @@ -1260,7 +1260,8 @@ inline void devirtualize_varray(const VArray &varray, const Func &func, bool { if (enable) { if (call_with_devirtualized_parameters( - std::make_tuple(VArrayDevirtualizer{varray}), func)) { + std::make_tuple(VArrayDevirtualizer{varray}), func)) + { return; } } @@ -1282,7 +1283,8 @@ inline void devirtualize_varray2(const VArray &varray1, if (call_with_devirtualized_parameters( std::make_tuple(VArrayDevirtualizer{varray1}, VArrayDevirtualizer{varray2}), - func)) { + func)) + { return; } } diff --git a/source/blender/blenlib/intern/BLI_filelist.c b/source/blender/blenlib/intern/BLI_filelist.c index 6240c855c99..4d489c0ae9f 100644 --- a/source/blender/blenlib/intern/BLI_filelist.c +++ b/source/blender/blenlib/intern/BLI_filelist.c @@ -127,7 +127,8 @@ static void bli_builddir(struct BuildDirCtx *dir_ctx, const char *dirname) dirname_with_slash, dirname, sizeof(dirname_with_slash) - 1); if ((dirname_with_slash_len > 0) && - (BLI_path_slash_is_native_compat(dirname[dirname_with_slash_len - 1]) == false)) { + (BLI_path_slash_is_native_compat(dirname[dirname_with_slash_len - 1]) == false)) + { dirname_with_slash[dirname_with_slash_len++] = SEP; dirname_with_slash[dirname_with_slash_len] = '\0'; } diff --git a/source/blender/blenlib/intern/BLI_kdopbvh.c b/source/blender/blenlib/intern/BLI_kdopbvh.c index afd036fb85d..5b6002bd461 100644 --- a/source/blender/blenlib/intern/BLI_kdopbvh.c +++ b/source/blender/blenlib/intern/BLI_kdopbvh.c @@ -467,7 +467,8 @@ static void bvhtree_print_tree(BVHTree *tree, BVHNode *node, int depth) } printf(" - %d (%ld): ", node->index, (long int)(node - tree->nodearray)); for (axis_iter = (axis_t)(2 * tree->start_axis); axis_iter < (axis_t)(2 * tree->stop_axis); - axis_iter++) { + axis_iter++) + { printf("%.3f ", node->bv[axis_iter]); } printf("\n"); @@ -582,7 +583,8 @@ static void build_implicit_tree_helper(const BVHTree *tree, BVHBuildHelper *data /* Calculate the smallest tree_type^n such that tree_type^n >= leafs_num */ for (data->leafs_per_child[0] = 1; data->leafs_per_child[0] < data->leafs_num; - data->leafs_per_child[0] *= data->tree_type) { + data->leafs_per_child[0] *= data->tree_type) + { /* pass */ } @@ -1205,7 +1207,8 @@ static bool tree_overlap_traverse_num(BVHOverlapData_Thread *data_thread, /* only difference to tree_overlap_traverse! */ if (!data->callback || - data->callback(data->userdata, node1->index, node2->index, data_thread->thread)) { + data->callback(data->userdata, node1->index, node2->index, data_thread->thread)) + { /* both leafs, insert overlap! */ if (data_thread->overlap) { overlap = BLI_stack_push_r(data_thread->overlap); @@ -1351,7 +1354,8 @@ BVHTreeOverlap *BLI_bvhtree_overlap_ex( /* check for compatibility of both trees (can't compare 14-DOP with 18-DOP) */ if (UNLIKELY((tree1->axis != tree2->axis) && (tree1->axis == 14 || tree2->axis == 14) && - (tree1->axis == 18 || tree2->axis == 18))) { + (tree1->axis == 18 || tree2->axis == 18))) + { BLI_assert(0); return NULL; } @@ -1470,8 +1474,8 @@ static bool tree_intersect_plane_test(const float *bv, const float plane[4]) const float bb_max[3] = {bv[1], bv[3], bv[5]}; float bb_near[3], bb_far[3]; aabb_get_near_far_from_plane(plane, bb_min, bb_max, bb_near, bb_far); - if ((plane_point_side_v3(plane, bb_near) > 0.0f) != - (plane_point_side_v3(plane, bb_far) > 0.0f)) { + if ((plane_point_side_v3(plane, bb_near) > 0.0f) != (plane_point_side_v3(plane, bb_far) > 0.0f)) + { return true; } @@ -1713,7 +1717,8 @@ static bool isect_aabb_v3(BVHNode *node, const float co[3]) const BVHTreeAxisRange *bv = (const BVHTreeAxisRange *)node->bv; if (co[0] > bv[0].min && co[0] < bv[0].max && co[1] > bv[1].min && co[1] < bv[1].max && - co[2] > bv[2].min && co[2] < bv[2].max) { + co[2] > bv[2].min && co[2] < bv[2].max) + { return true; } @@ -1805,7 +1810,8 @@ static float ray_nearest_hit(const BVHRayCastData *data, const float bv[6]) if (data->ray_dot_axis[i] == 0.0f) { /* axis aligned ray */ if (data->ray.origin[i] < bv[0] - data->ray.radius || - data->ray.origin[i] > bv[1] + data->ray.radius) { + data->ray.origin[i] > bv[1] + data->ray.radius) + { return FLT_MAX; } } @@ -1857,7 +1863,8 @@ static float fast_ray_nearest_hit(const BVHRayCastData *data, const BVHNode *nod if ((t1x > t2y || t2x < t1y || t1x > t2z || t2x < t1z || t1y > t2z || t2y < t1z) || (t2x < 0.0f || t2y < 0.0f || t2z < 0.0f) || - (t1x > data->hit.dist || t1y > data->hit.dist || t1z > data->hit.dist)) { + (t1x > data->hit.dist || t1y > data->hit.dist || t1z > data->hit.dist)) + { return FLT_MAX; } return max_fff(t1x, t1y, t1z); @@ -2223,7 +2230,8 @@ static void bvhtree_nearest_projected_dfs_recursive(BVHNearestProjectedData *__r if (dist_squared_to_projected_aabb(&data->precalc, (float[3]){bv[0], bv[2], bv[4]}, (float[3]){bv[1], bv[3], bv[5]}, - data->closest_axis) <= data->nearest.dist_sq) { + data->closest_axis) <= data->nearest.dist_sq) + { bvhtree_nearest_projected_dfs_recursive(data, node->children[i]); } } @@ -2235,7 +2243,8 @@ static void bvhtree_nearest_projected_dfs_recursive(BVHNearestProjectedData *__r if (dist_squared_to_projected_aabb(&data->precalc, (float[3]){bv[0], bv[2], bv[4]}, (float[3]){bv[1], bv[3], bv[5]}, - data->closest_axis) <= data->nearest.dist_sq) { + data->closest_axis) <= data->nearest.dist_sq) + { bvhtree_nearest_projected_dfs_recursive(data, node->children[i]); } } @@ -2277,7 +2286,8 @@ static void bvhtree_nearest_projected_with_clipplane_test_dfs_recursive( if ((isect_type != ISECT_AABB_PLANE_BEHIND_ANY) && dist_squared_to_projected_aabb(&data->precalc, bb_min, bb_max, data->closest_axis) <= - data->nearest.dist_sq) { + data->nearest.dist_sq) + { if (isect_type == ISECT_AABB_PLANE_CROSS_ANY) { bvhtree_nearest_projected_with_clipplane_test_dfs_recursive(data, node->children[i]); } @@ -2299,7 +2309,8 @@ static void bvhtree_nearest_projected_with_clipplane_test_dfs_recursive( if (isect_type != ISECT_AABB_PLANE_BEHIND_ANY && dist_squared_to_projected_aabb(&data->precalc, bb_min, bb_max, data->closest_axis) <= - data->nearest.dist_sq) { + data->nearest.dist_sq) + { if (isect_type == ISECT_AABB_PLANE_CROSS_ANY) { bvhtree_nearest_projected_with_clipplane_test_dfs_recursive(data, node->children[i]); } @@ -2357,7 +2368,8 @@ int BLI_bvhtree_find_nearest_projected(const BVHTree *tree, if (isect_type != 0 && dist_squared_to_projected_aabb(&data.precalc, bb_min, bb_max, data.closest_axis) <= - data.nearest.dist_sq) { + data.nearest.dist_sq) + { if (isect_type == 1) { bvhtree_nearest_projected_with_clipplane_test_dfs_recursive(&data, root); } @@ -2404,10 +2416,12 @@ static bool bvhtree_walk_dfs_recursive(BVHTree_WalkData *walk_data, const BVHNod /* First pick the closest node to recurse into */ if (walk_data->walk_order_cb( - (const BVHTreeAxisRange *)node->bv, node->main_axis, walk_data->userdata)) { + (const BVHTreeAxisRange *)node->bv, node->main_axis, walk_data->userdata)) + { for (int i = 0; i != node->node_num; i++) { if (walk_data->walk_parent_cb((const BVHTreeAxisRange *)node->children[i]->bv, - walk_data->userdata)) { + walk_data->userdata)) + { if (!bvhtree_walk_dfs_recursive(walk_data, node->children[i])) { return false; } @@ -2417,7 +2431,8 @@ static bool bvhtree_walk_dfs_recursive(BVHTree_WalkData *walk_data, const BVHNod else { for (int i = node->node_num - 1; i >= 0; i--) { if (walk_data->walk_parent_cb((const BVHTreeAxisRange *)node->children[i]->bv, - walk_data->userdata)) { + walk_data->userdata)) + { if (!bvhtree_walk_dfs_recursive(walk_data, node->children[i])) { return false; } diff --git a/source/blender/blenlib/intern/BLI_mempool.c b/source/blender/blenlib/intern/BLI_mempool.c index 99c29bb73d2..4b17d2b24fd 100644 --- a/source/blender/blenlib/intern/BLI_mempool.c +++ b/source/blender/blenlib/intern/BLI_mempool.c @@ -734,7 +734,8 @@ void *mempool_iter_threadsafe_step(BLI_mempool_threadsafe_iter *ts_iter) (iter->curchunk != NULL) && (atomic_cas_ptr((void **)ts_iter->curchunk_threaded_shared, iter->curchunk, iter->curchunk->next) != iter->curchunk); - iter->curchunk = *ts_iter->curchunk_threaded_shared) { + iter->curchunk = *ts_iter->curchunk_threaded_shared) + { /* pass. */ } if (UNLIKELY(iter->curchunk == NULL)) { diff --git a/source/blender/blenlib/intern/BLI_mmap.c b/source/blender/blenlib/intern/BLI_mmap.c index aeb0dec5ebd..576f6e70e4d 100644 --- a/source/blender/blenlib/intern/BLI_mmap.c +++ b/source/blender/blenlib/intern/BLI_mmap.c @@ -189,11 +189,13 @@ bool BLI_mmap_read(BLI_mmap_file *file, void *dest, size_t offset, size_t length memcpy(dest, file->memory + offset, length); #else /* On Windows, we use exception handling to be notified of errors. */ - __try { + __try + { memcpy(dest, file->memory + offset, length); } __except (GetExceptionCode() == EXCEPTION_IN_PAGE_ERROR ? EXCEPTION_EXECUTE_HANDLER : - EXCEPTION_CONTINUE_SEARCH) { + EXCEPTION_CONTINUE_SEARCH) + { file->io_error = true; return false; } diff --git a/source/blender/blenlib/intern/array_store.c b/source/blender/blenlib/intern/array_store.c index 611e9eb0df1..62aaa737493 100644 --- a/source/blender/blenlib/intern/array_store.c +++ b/source/blender/blenlib/intern/array_store.c @@ -1166,7 +1166,8 @@ static BChunkList *bchunk_list_from_data_merge(const BArrayInfo *info, if (!BLI_listbase_is_empty(&chunk_list_reference->chunk_refs)) { const BChunkRef *cref = chunk_list_reference->chunk_refs.last; while ((cref->prev != NULL) && (cref != cref_match_first) && - (cref->link->data_len <= data_len - i_prev)) { + (cref->link->data_len <= data_len - i_prev)) + { BChunk *chunk_test = cref->link; size_t offset = data_len - chunk_test->data_len; if (bchunk_data_compare(chunk_test, data, data_len, offset)) { @@ -1237,7 +1238,8 @@ static BChunkList *bchunk_list_from_data_merge(const BArrayInfo *info, } else if ((data_len - i_prev >= info->chunk_byte_size) && (chunk_list_reference->chunk_refs_len >= chunk_list_reference_skip_len) && - (chunk_list_reference->chunk_refs.first != NULL)) { + (chunk_list_reference->chunk_refs.first != NULL)) + { /* -------------------------------------------------------------------- * Non-Aligned Chunk De-Duplication. */ @@ -1304,7 +1306,8 @@ static BChunkList *bchunk_list_from_data_merge(const BArrayInfo *info, #endif while ((cref != chunk_list_reference_last) && - (chunk_list_reference_bytes_remaining >= info->accum_read_ahead_bytes)) { + (chunk_list_reference_bytes_remaining >= info->accum_read_ahead_bytes)) + { hash_key key = key_from_chunk_ref(info, cref diff --git a/source/blender/blenlib/intern/array_utils.c b/source/blender/blenlib/intern/array_utils.c index a401059755d..766cf5c0346 100644 --- a/source/blender/blenlib/intern/array_utils.c +++ b/source/blender/blenlib/intern/array_utils.c @@ -30,7 +30,8 @@ void _bli_array_reverse(void *arr_v, uint arr_len, size_t arr_stride) char *buf = BLI_array_alloca(buf, arr_stride); for (i = 0, i_end = (arr_len - 1) * arr_stride_uint; i < arr_half_stride; - i += arr_stride_uint, i_end -= arr_stride_uint) { + i += arr_stride_uint, i_end -= arr_stride_uint) + { memcpy(buf, &arr[i], arr_stride); memcpy(&arr[i], &arr[i_end], arr_stride); memcpy(&arr[i_end], buf, arr_stride); @@ -97,7 +98,8 @@ uint _bli_array_deduplicate_ordered(void *arr, uint arr_len, size_t arr_stride) for (uint i = 0; i < arr_len; i++) { if ((i == j) || (memcmp(POINTER_OFFSET(arr, arr_stride_uint * i), POINTER_OFFSET(arr, arr_stride_uint * j), - arr_stride) == 0)) { + arr_stride) == 0)) + { continue; } j += 1; diff --git a/source/blender/blenlib/intern/boxpack_2d.c b/source/blender/blenlib/intern/boxpack_2d.c index 514bb4378e3..5ded1863337 100644 --- a/source/blender/blenlib/intern/boxpack_2d.c +++ b/source/blender/blenlib/intern/boxpack_2d.c @@ -424,7 +424,8 @@ void BLI_box_pack_2d( if (/* Constrain boxes to positive X/Y values */ box_xmin_get(box) < 0.0f || box_ymin_get(box) < 0.0f || /* check for last intersected */ - (vert->isect_cache[j] && box_isect(box, vert->isect_cache[j]))) { + (vert->isect_cache[j] && box_isect(box, vert->isect_cache[j]))) + { /* Here we check that the last intersected * box will intersect with this one using * isect_cache that can store a pointer to a diff --git a/source/blender/blenlib/intern/delaunay_2d.cc b/source/blender/blenlib/intern/delaunay_2d.cc index b714865ce57..4deb8f3ac4e 100644 --- a/source/blender/blenlib/intern/delaunay_2d.cc +++ b/source/blender/blenlib/intern/delaunay_2d.cc @@ -1361,7 +1361,8 @@ void dc_tri(CDTArrangement *cdt, while (filtered_incircle(basel_sym->vert->co, basel->vert->co, lcand->next->vert->co, - lcand->rot->next->vert->co) > 0.0) { + lcand->rot->next->vert->co) > 0.0) + { if (dbg_level > 1) { std::cout << "incircle says to remove lcand\n"; std::cout << " lcand" << lcand << "\n"; @@ -1380,7 +1381,8 @@ void dc_tri(CDTArrangement *cdt, while (filtered_incircle(basel_sym->vert->co, basel->vert->co, rcand->next->vert->co, - sym(rcand)->next->next->vert->co) > 0.0) { + sym(rcand)->next->next->vert->co) > 0.0) + { if (dbg_level > 0) { std::cout << "incircle says to remove rcand\n"; std::cout << " rcand" << rcand << "\n"; @@ -1404,10 +1406,11 @@ void dc_tri(CDTArrangement *cdt, } /* The next cross edge to be connected is to either `lcand->next->vert` or `rcand->next->vert`; * if both are valid, choose the appropriate one using the #incircle test. */ - if (!valid_lcand || (valid_rcand && filtered_incircle(lcand->next->vert->co, - lcand->vert->co, - rcand->vert->co, - rcand->next->vert->co) > 0)) { + if (!valid_lcand || + (valid_rcand && + filtered_incircle( + lcand->next->vert->co, lcand->vert->co, rcand->vert->co, rcand->next->vert->co) > 0)) + { if (dbg_level > 0) { std::cout << "connecting rcand\n"; std::cout << " se1=basel_sym" << basel_sym << "\n"; @@ -1753,7 +1756,8 @@ void fill_crossdata_for_intersect(const FatCo &curco, } case isect_result>::LINE_LINE_COLINEAR: { if (distance_squared(va->co.approx, v2->co.approx) <= - distance_squared(vb->co.approx, v2->co.approx)) { + distance_squared(vb->co.approx, v2->co.approx)) + { fill_crossdata_for_through_vert(va, se_vcva, cd, cd_next); } else { @@ -1982,7 +1986,8 @@ void add_edge_constraint( for (j = i - 1; j > 0; --j) { cd_prev = &crossings[j]; if ((cd_prev->lambda == 0.0 && cd_prev->vert != v) || - (cd_prev->lambda != 0.0 && cd_prev->in->vert != v && cd_prev->in->next->vert != v)) { + (cd_prev->lambda != 0.0 && cd_prev->in->vert != v && cd_prev->in->next->vert != v)) + { break; } cd_prev->lambda = -1.0; /* Mark cd_prev as 'deleted'. */ @@ -2262,7 +2267,8 @@ int add_face_constraints(CDT_state *cdt_state, int id = cdt_state->need_ids ? f : 0; add_face_ids(cdt_state, face_symedge0, id, fedge_start, fedge_end); if (cdt_state->need_ids || - ELEM(output_type, CDT_CONSTRAINTS_VALID_BMESH, CDT_CONSTRAINTS_VALID_BMESH_WITH_HOLES)) { + ELEM(output_type, CDT_CONSTRAINTS_VALID_BMESH, CDT_CONSTRAINTS_VALID_BMESH_WITH_HOLES)) + { add_face_ids(cdt_state, face_symedge0, f, fedge_start, fedge_end); } } @@ -2387,12 +2393,14 @@ template void remove_non_constraint_edges_leave_valid_bmesh(CDT_stat CDTFace *fleft = se->face; CDTFace *fright = sym(se)->face; if (fleft != cdt->outer_face && fright != cdt->outer_face && - (fleft->input_ids.size() > 0 || fright->input_ids.size() > 0)) { + (fleft->input_ids.size() > 0 || fright->input_ids.size() > 0)) + { /* Is there another #SymEdge with same left and right faces? * Or is there a vertex not part of e touching the same left and right faces? */ for (SymEdge *se2 = se->next; dissolve && se2 != se; se2 = se2->next) { if (sym(se2)->face == fright || - (se2->vert != se->next->vert && vert_touches_face(se2->vert, fright))) { + (se2->vert != se->next->vert && vert_touches_face(se2->vert, fright))) + { dissolve = false; } } diff --git a/source/blender/blenlib/intern/dynlib.c b/source/blender/blenlib/intern/dynlib.c index 1cd23ea2ca0..91f6e3f69d5 100644 --- a/source/blender/blenlib/intern/dynlib.c +++ b/source/blender/blenlib/intern/dynlib.c @@ -66,7 +66,8 @@ char *BLI_dynlib_get_error_as_string(DynamicLibrary *lib) MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), buf, sizeof(buf), - NULL)) { + NULL)) + { return buf; } } diff --git a/source/blender/blenlib/intern/expr_pylike_eval.c b/source/blender/blenlib/intern/expr_pylike_eval.c index 1c32336fee0..cc603246943 100644 --- a/source/blender/blenlib/intern/expr_pylike_eval.c +++ b/source/blender/blenlib/intern/expr_pylike_eval.c @@ -600,7 +600,8 @@ static bool parse_add_func(ExprParseState *state, eOpCode code, int args, void * CHECK_ERROR(args == 3); if (jmp_gap >= 3 && prev_ops[-3].opcode == OPCODE_CONST && - prev_ops[-2].opcode == OPCODE_CONST && prev_ops[-1].opcode == OPCODE_CONST) { + prev_ops[-2].opcode == OPCODE_CONST && prev_ops[-1].opcode == OPCODE_CONST) + { TernaryOpFunc func = funcptr; /* volatile because some compilers overly aggressive optimize this call out. @@ -1013,7 +1014,8 @@ static bool parse_expr(ExprParseState *state) /* Parse condition. */ if (!parse_next_token(state) || !parse_or(state) || state->token != TOKEN_ELSE || - !parse_next_token(state)) { + !parse_next_token(state)) + { MEM_freeN(body); return false; } diff --git a/source/blender/blenlib/intern/fileops.c b/source/blender/blenlib/intern/fileops.c index b804eacfbe7..79a0f94686f 100644 --- a/source/blender/blenlib/intern/fileops.c +++ b/source/blender/blenlib/intern/fileops.c @@ -103,7 +103,8 @@ bool BLI_file_external_operation_execute(const char *filepath, FileExternalOpera #ifdef WIN32 char *opstring = windows_operation_string(operation); if (BLI_windows_external_operation_supported(filepath, opstring) && - BLI_windows_external_operation_execute(filepath, opstring)) { + BLI_windows_external_operation_execute(filepath, opstring)) + { return true; } return false; @@ -923,7 +924,8 @@ static int delete_soft(const char *file, const char **error_message) char *xdg_session_desktop = getenv("XDG_SESSION_DESKTOP"); if ((xdg_current_desktop != NULL && STREQ(xdg_current_desktop, "KDE")) || - (xdg_session_desktop != NULL && STREQ(xdg_session_desktop, "KDE"))) { + (xdg_session_desktop != NULL && STREQ(xdg_session_desktop, "KDE"))) + { args[0] = "kioclient5"; args[1] = "move"; args[2] = file; diff --git a/source/blender/blenlib/intern/filereader_zstd.c b/source/blender/blenlib/intern/filereader_zstd.c index 9ec865a4a06..17f3900cb1d 100644 --- a/source/blender/blenlib/intern/filereader_zstd.c +++ b/source/blender/blenlib/intern/filereader_zstd.c @@ -172,7 +172,8 @@ static const char *zstd_ensure_cache(ZstdReader *zstd, int frame) char *uncompressed_data = MEM_mallocN(uncompressed_size, __func__); char *compressed_data = MEM_mallocN(compressed_size, __func__); if (zstd->base->seek(zstd->base, zstd->seek.compressed_ofs[frame], SEEK_SET) < 0 || - zstd->base->read(zstd->base, compressed_data, compressed_size) < compressed_size) { + zstd->base->read(zstd->base, compressed_data, compressed_size) < compressed_size) + { MEM_freeN(compressed_data); MEM_freeN(uncompressed_data); return NULL; diff --git a/source/blender/blenlib/intern/implicit_sharing.cc b/source/blender/blenlib/intern/implicit_sharing.cc index 3625e7babae..a5943af9344 100644 --- a/source/blender/blenlib/intern/implicit_sharing.cc +++ b/source/blender/blenlib/intern/implicit_sharing.cc @@ -83,7 +83,8 @@ void *resize_trivial_array_impl(void *old_data, BLI_assert(old_size != 0); if ((*sharing_info)->is_mutable()) { if (auto *info = const_cast( - dynamic_cast(*sharing_info))) { + dynamic_cast(*sharing_info))) + { /* If the array was allocated with the MEM allocator, we can use realloc directly, which * could theoretically give better performance if the data can be reused in place. */ void *new_data = static_cast(MEM_reallocN(old_data, new_size)); diff --git a/source/blender/blenlib/intern/listbase.cc b/source/blender/blenlib/intern/listbase.cc index 3b549cf68c4..a72ed23d13b 100644 --- a/source/blender/blenlib/intern/listbase.cc +++ b/source/blender/blenlib/intern/listbase.cc @@ -511,8 +511,8 @@ int BLI_listbase_count_at_most(const ListBase *listbase, const int count_max) Link *link; int count = 0; - for (link = static_cast(listbase->first); link && count != count_max; - link = link->next) { + for (link = static_cast(listbase->first); link && count != count_max; link = link->next) + { count++; } @@ -754,7 +754,8 @@ void *BLI_listbase_string_or_index_find(const ListBase *listbase, int index_iter; for (link = static_cast(listbase->first), index_iter = 0; link; - link = link->next, index_iter++) { + link = link->next, index_iter++) + { if (string != nullptr && string[0] != '\0') { const char *string_iter = ((const char *)link) + string_offset; diff --git a/source/blender/blenlib/intern/math_boolean.cc b/source/blender/blenlib/intern/math_boolean.cc index bb6136022c5..3445e44dd3f 100644 --- a/source/blender/blenlib/intern/math_boolean.cc +++ b/source/blender/blenlib/intern/math_boolean.cc @@ -890,7 +890,8 @@ static double orient3dadapt( if ((adxtail == 0.0) && (bdxtail == 0.0) && (cdxtail == 0.0) && (adytail == 0.0) && (bdytail == 0.0) && (cdytail == 0.0) && (adztail == 0.0) && (bdztail == 0.0) && - (cdztail == 0.0)) { + (cdztail == 0.0)) + { return det; } @@ -1418,7 +1419,8 @@ static double incircleadapt( Two_Diff_Tail(pc[0], pd[0], cdx, cdxtail); Two_Diff_Tail(pc[1], pd[1], cdy, cdytail); if ((adxtail == 0.0) && (bdxtail == 0.0) && (cdxtail == 0.0) && (adytail == 0.0) && - (bdytail == 0.0) && (cdytail == 0.0)) { + (bdytail == 0.0) && (cdytail == 0.0)) + { return det; } @@ -2321,7 +2323,8 @@ static double insphereadapt(const double *pa, Two_Diff_Tail(pd[2], pe[2], dez, deztail); if ((aextail == 0.0) && (aeytail == 0.0) && (aeztail == 0.0) && (bextail == 0.0) && (beytail == 0.0) && (beztail == 0.0) && (cextail == 0.0) && (ceytail == 0.0) && - (ceztail == 0.0) && (dextail == 0.0) && (deytail == 0.0) && (deztail == 0.0)) { + (ceztail == 0.0) && (dextail == 0.0) && (deytail == 0.0) && (deztail == 0.0)) + { return det; } diff --git a/source/blender/blenlib/intern/math_geom.c b/source/blender/blenlib/intern/math_geom.c index c21b07573e8..f6feffc6865 100644 --- a/source/blender/blenlib/intern/math_geom.c +++ b/source/blender/blenlib/intern/math_geom.c @@ -1469,7 +1469,8 @@ bool isect_point_poly_v2(const float pt[2], if (((verts[i][1] > pt[1]) != (verts[j][1] > pt[1])) && (pt[0] < (verts[j][0] - verts[i][0]) * (pt[1] - verts[i][1]) / (verts[j][1] - verts[i][1]) + - verts[i][0])) { + verts[i][0])) + { isect = !isect; } } @@ -1488,7 +1489,8 @@ bool isect_point_poly_v2_int(const int pt[2], if (((verts[i][1] > pt[1]) != (verts[j][1] > pt[1])) && (pt[0] < (verts[j][0] - verts[i][0]) * (pt[1] - verts[i][1]) / (verts[j][1] - verts[i][1]) + - verts[i][0])) { + verts[i][0])) + { isect = !isect; } } @@ -1869,7 +1871,8 @@ bool isect_ray_tri_watertight_v3(const float ray_origin[3], #if 0 || (sign_T > *r_lambda * xor_signmask(det, sign_mask)) #endif - ) { + ) + { return false; } @@ -2259,7 +2262,8 @@ bool isect_tri_tri_v3_ex(const float tri_a[3][3], } if ((side[1][0] && side[1][1] && side[1][2]) && (side[1][0] < 0.0f) == (side[1][1] < 0.0f) && - (side[1][0] < 0.0f) == (side[1][2] < 0.0f)) { + (side[1][0] < 0.0f) == (side[1][2] < 0.0f)) + { /* All vertices of the 2nd triangle are positioned on the same side to the * plane defined by the 1st triangle. */ return false; @@ -2274,7 +2278,8 @@ bool isect_tri_tri_v3_ex(const float tri_a[3][3], side[0][2] = (float)(dot_v3db_v3fl(plane_b, tri_a[2]) + plane_b[3]); if ((side[0][0] && side[0][1] && side[0][2]) && (side[0][0] < 0.0f) == (side[0][1] < 0.0f) && - (side[0][0] < 0.0f) == (side[0][2] < 0.0f)) { + (side[0][0] < 0.0f) == (side[0][2] < 0.0f)) + { /* All vertices of the 1st triangle are positioned on the same side to the * plane defined by the 2nd triangle. */ return false; @@ -3666,7 +3671,8 @@ int barycentric_inside_triangle_v2(const float w[3]) return 1; } if (IN_RANGE_INCL(w[0], 0.0f, 1.0f) && IN_RANGE_INCL(w[1], 0.0f, 1.0f) && - IN_RANGE_INCL(w[2], 0.0f, 1.0f)) { + IN_RANGE_INCL(w[2], 0.0f, 1.0f)) + { return 2; } diff --git a/source/blender/blenlib/intern/math_matrix.c b/source/blender/blenlib/intern/math_matrix.c index 1b1ae9a8a53..40e47f7dda1 100644 --- a/source/blender/blenlib/intern/math_matrix.c +++ b/source/blender/blenlib/intern/math_matrix.c @@ -1840,7 +1840,8 @@ bool is_uniform_scaled_m3(const float m[3][3]) l6 = len_squared_v3(t[2]); if (fabsf(l2 - l1) <= eps && fabsf(l3 - l1) <= eps && fabsf(l4 - l1) <= eps && - fabsf(l5 - l1) <= eps && fabsf(l6 - l1) <= eps) { + fabsf(l5 - l1) <= eps && fabsf(l6 - l1) <= eps) + { return true; } diff --git a/source/blender/blenlib/intern/math_rotation.c b/source/blender/blenlib/intern/math_rotation.c index 49e6b61fad5..835dfd8ec0f 100644 --- a/source/blender/blenlib/intern/math_rotation.c +++ b/source/blender/blenlib/intern/math_rotation.c @@ -1405,7 +1405,8 @@ void mat3_normalized_to_eul(float eul[3], const float mat[3][3]) /* return best, which is just the one with lowest values it in */ if (fabsf(eul1[0]) + fabsf(eul1[1]) + fabsf(eul1[2]) > - fabsf(eul2[0]) + fabsf(eul2[1]) + fabsf(eul2[2])) { + fabsf(eul2[0]) + fabsf(eul2[1]) + fabsf(eul2[2])) + { copy_v3_v3(eul, eul2); } else { @@ -1964,7 +1965,8 @@ void mat4_to_dquat(DualQuat *dq, const float basemat[4][4], const float mat[4][4 copy_m3_m4(mat3, mat); if (!is_orthonormal_m3(mat3) || (determinant_m4(mat) < 0.0f) || - len_squared_v3(dscale) > square_f(1e-4f)) { + len_squared_v3(dscale) > square_f(1e-4f)) + { /* Extract R and S. */ float tmp[4][4]; @@ -2361,7 +2363,8 @@ bool mat3_from_axis_conversion( } if ((_axis_signed(src_forward) == _axis_signed(src_up)) || - (_axis_signed(dst_forward) == _axis_signed(dst_up))) { + (_axis_signed(dst_forward) == _axis_signed(dst_up))) + { /* we could assert here! */ unit_m3(r_mat); return false; diff --git a/source/blender/blenlib/intern/math_vec.cc b/source/blender/blenlib/intern/math_vec.cc index fcc726316bb..18a3633e1a9 100644 --- a/source/blender/blenlib/intern/math_vec.cc +++ b/source/blender/blenlib/intern/math_vec.cc @@ -87,7 +87,8 @@ isect_result isect_seg_seg(const mpq2 &v1, const mpq2 &v2, const mpq2 &v3, /* Avoid dividing mu by div: it is expensive in multi-precision. */ mpq_class mudiv = ((v1[1] - v3[1]) * (v2[0] - v1[0]) - (v1[0] - v3[0]) * (v2[1] - v1[1])); if (ans.lambda >= 0 && ans.lambda <= 1 && - ((div > 0 && mudiv >= 0 && mudiv <= div) || (div < 0 && mudiv <= 0 && mudiv >= div))) { + ((div > 0 && mudiv >= 0 && mudiv <= div) || (div < 0 && mudiv <= 0 && mudiv >= div))) + { if (ans.lambda == 0 || ans.lambda == 1 || mudiv == 0 || mudiv == div) { ans.kind = isect_result::LINE_LINE_EXACT; } diff --git a/source/blender/blenlib/intern/mesh_boolean.cc b/source/blender/blenlib/intern/mesh_boolean.cc index 5c15975f393..387990c9c31 100644 --- a/source/blender/blenlib/intern/mesh_boolean.cc +++ b/source/blender/blenlib/intern/mesh_boolean.cc @@ -2554,7 +2554,8 @@ static void inside_shape_callback(void *userdata, std::cout << " fv2=(" << fv2[0] << "," << fv2[1] << "," << fv2[2] << ")\n"; } if (isect_ray_tri_epsilon_v3( - ray->origin, ray->direction, fv0, fv1, fv2, &dist, nullptr, FLT_EPSILON)) { + ray->origin, ray->direction, fv0, fv1, fv2, &dist, nullptr, FLT_EPSILON)) + { /* Count parity as +1 if ray is in the same direction as tri's normal, * and -1 if the directions are opposite. */ double3 o_db{double(ray->origin[0]), double(ray->origin[1]), double(ray->origin[2])}; @@ -3116,7 +3117,8 @@ static bool dissolve_leaves_valid_bmesh(FaceMergeState *fms, bool ok = true; /* Is there another edge, not me, in A's face, whose right face is B's left? */ for (int a_e_index = (a_edge_start + 1) % alen; ok && a_e_index != a_edge_start; - a_e_index = (a_e_index + 1) % alen) { + a_e_index = (a_e_index + 1) % alen) + { const MergeEdge &a_me_cur = fms->edge[mf_left.edge[a_e_index]]; if (a_me_cur.right_face == b_left_face) { ok = false; diff --git a/source/blender/blenlib/intern/path_util.c b/source/blender/blenlib/intern/path_util.c index 66b7dfd8827..1920447f9fd 100644 --- a/source/blender/blenlib/intern/path_util.c +++ b/source/blender/blenlib/intern/path_util.c @@ -267,7 +267,8 @@ void BLI_path_normalize(char *path) (start_temp = ((start <= &path[path_len - 3]) && STREQ(&path[path_len - 3], SEP_STR "..")) ? &path[path_len - 3] : - NULL))) { + NULL))) + { start = start_temp + 1; /* Skip the `/`. */ BLI_assert(start_base != start); @@ -461,7 +462,8 @@ bool BLI_path_make_safe(char *path) #endif for (curr_slash = (char *)BLI_path_slash_find(curr_path); curr_slash; - curr_slash = (char *)BLI_path_slash_find(curr_path)) { + curr_slash = (char *)BLI_path_slash_find(curr_path)) + { const char backup = *curr_slash; *curr_slash = '\0'; if (!skip_first && (*curr_path != '\0') && BLI_filename_make_safe(curr_path)) { @@ -556,7 +558,8 @@ static void BLI_path_unc_to_short(wchar_t *unc) * - `\\?\C:\folder\...` to `C:\folder\...` */ if ((len > 3) && (unc[0] == L'\\') && (unc[1] == L'\\') && (unc[2] == L'?') && - ELEM(unc[3], L'\\', L'/')) { + ELEM(unc[3], L'\\', L'/')) + { if ((len > 5) && (unc[5] == L':')) { wcsncpy(tmp, unc + 4, len - 4); tmp[len - 4] = L'\0'; @@ -1221,7 +1224,8 @@ bool BLI_path_program_search(char *fullname, const size_t maxlen, const char *na #else BLI_exists(filepath_test) #endif - ) { + ) + { BLI_strncpy(fullname, filepath_test, maxlen); retval = true; break; diff --git a/source/blender/blenlib/intern/polyfill_2d.c b/source/blender/blenlib/intern/polyfill_2d.c index c5a877a9539..5962f33ff1f 100644 --- a/source/blender/blenlib/intern/polyfill_2d.c +++ b/source/blender/blenlib/intern/polyfill_2d.c @@ -329,7 +329,8 @@ static void kdtree2d_node_remove(struct KDTree2D *tree, uint32_t index) node->flag |= KDNODE_FLAG_REMOVED; while ((node->neg == KDNODE_UNSET) && (node->pos == KDNODE_UNSET) && - (node->parent != KDNODE_UNSET)) { + (node->parent != KDNODE_UNSET)) + { KDTreeNode2D *node_parent = &tree->nodes[node->parent]; BLI_assert((uint32_t)(node - tree->nodes) == node_index); @@ -364,10 +365,12 @@ static bool kdtree2d_isect_tri_recursive(const struct KDTree2D *tree, if ((node->flag & KDNODE_FLAG_REMOVED) == 0) { /* bounding box test first */ if ((co[0] >= bounds[0].min) && (co[0] <= bounds[0].max) && (co[1] >= bounds[1].min) && - (co[1] <= bounds[1].max)) { + (co[1] <= bounds[1].max)) + { if ((span_tri_v2_sign(tri_coords[0], tri_coords[1], co) != CONCAVE) && (span_tri_v2_sign(tri_coords[1], tri_coords[2], co) != CONCAVE) && - (span_tri_v2_sign(tri_coords[2], tri_coords[0], co) != CONCAVE)) { + (span_tri_v2_sign(tri_coords[2], tri_coords[0], co) != CONCAVE)) + { if (!ELEM(node->index, tri_index[0], tri_index[1], tri_index[2])) { return true; } @@ -738,7 +741,8 @@ static bool pf_ear_tip_check(PolyFill *pf, PolyIndex *pi_ear_tip, const eSign si * It's logical - the chance is low that points exist on the * same side as the ear we're clipping off. */ if ((span_tri_v2_sign(v3, v1, v) != CONCAVE) && (span_tri_v2_sign(v1, v2, v) != CONCAVE) && - (span_tri_v2_sign(v2, v3, v) != CONCAVE)) { + (span_tri_v2_sign(v2, v3, v) != CONCAVE)) + { return false; } diff --git a/source/blender/blenlib/intern/scanfill.c b/source/blender/blenlib/intern/scanfill.c index 04e6ed4a7bb..d3a10211096 100644 --- a/source/blender/blenlib/intern/scanfill.c +++ b/source/blender/blenlib/intern/scanfill.c @@ -382,8 +382,8 @@ static void testvertexnearedge(ScanFillContext *sf_ctx) /* find the edge which has vertex eve, * NOTE: we _know_ this will crash if 'ed1' becomes NULL * but this will never happen. */ - for (ed1 = sf_ctx->filledgebase.first; !(ed1->v1 == eve || ed1->v2 == eve); - ed1 = ed1->next) { + for (ed1 = sf_ctx->filledgebase.first; !(ed1->v1 == eve || ed1->v2 == eve); ed1 = ed1->next) + { /* do nothing */ } @@ -911,7 +911,8 @@ uint BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const int flag, const float n toggle++; for (eed = (toggle & 1) ? sf_ctx->filledgebase.first : sf_ctx->filledgebase.last; eed; - eed = (toggle & 1) ? eed->next : eed->prev) { + eed = (toggle & 1) ? eed->next : eed->prev) + { if (eed->v1->poly_nr == SF_POLY_UNSET && eed->v2->poly_nr == poly) { eed->v1->poly_nr = poly; eed->poly_nr = poly; @@ -983,7 +984,8 @@ uint BLI_scanfill_calc_ex(ScanFillContext *sf_ctx, const int flag, const float n toggle++; for (eed = (toggle & 1) ? sf_ctx->filledgebase.first : sf_ctx->filledgebase.last; eed; - eed = eed_next) { + eed = eed_next) + { eed_next = (toggle & 1) ? eed->next : eed->prev; if (eed->v1->edge_count == 1) { eed->v2->edge_count--; diff --git a/source/blender/blenlib/intern/scanfill_utils.c b/source/blender/blenlib/intern/scanfill_utils.c index 28b89a79fb0..15fa4420934 100644 --- a/source/blender/blenlib/intern/scanfill_utils.c +++ b/source/blender/blenlib/intern/scanfill_utils.c @@ -173,15 +173,18 @@ static bool scanfill_preprocess_self_isect(ScanFillContext *sf_ctx, ScanFillEdge *eed_other; for (eed_other = eed->next; eed_other; - eed_other = (eed_other == pi->edge_last) ? NULL : eed_other->next) { + eed_other = (eed_other == pi->edge_last) ? NULL : eed_other->next) + { if (!ELEM(eed->v1, eed_other->v1, eed_other->v2) && - !ELEM(eed->v2, eed_other->v1, eed_other->v2) && (eed != eed_other)) { + !ELEM(eed->v2, eed_other->v1, eed_other->v2) && (eed != eed_other)) + { /* check isect */ float pt[2]; BLI_assert(eed != eed_other); if (isect_seg_seg_v2_point( - eed->v1->co, eed->v2->co, eed_other->v1->co, eed_other->v2->co, pt) == 1) { + eed->v1->co, eed->v2->co, eed_other->v1->co, eed_other->v2->co, pt) == 1) + { ScanFillIsect *isect; if (UNLIKELY(isect_hash == NULL)) { @@ -388,7 +391,8 @@ bool BLI_scanfill_calc_self_isect(ScanFillContext *sf_ctx, BLI_assert(eed->poly_nr == eed->v2->poly_nr); if ((poly_info[poly_nr].edge_last != NULL) && - (poly_info[poly_nr].edge_last->poly_nr != eed->poly_nr)) { + (poly_info[poly_nr].edge_last->poly_nr != eed->poly_nr)) + { poly_nr++; } diff --git a/source/blender/blenlib/intern/smallhash.c b/source/blender/blenlib/intern/smallhash.c index 4da07ad9e4c..64e9f0183ed 100644 --- a/source/blender/blenlib/intern/smallhash.c +++ b/source/blender/blenlib/intern/smallhash.c @@ -111,7 +111,8 @@ BLI_INLINE SmallHashEntry *smallhash_lookup(const SmallHash *sh, const uintptr_t /* NOTE: there are always more buckets than entries, * so we know there will always be a free bucket if the key isn't found. */ for (e = &sh->buckets[h % sh->nbuckets]; e->val != SMHASH_CELL_FREE; - h = SMHASH_NEXT(h, hoff), e = &sh->buckets[h % sh->nbuckets]) { + h = SMHASH_NEXT(h, hoff), e = &sh->buckets[h % sh->nbuckets]) + { if (e->key == key) { /* should never happen because unused keys are zero'd */ BLI_assert(e->val != SMHASH_CELL_UNUSED); @@ -129,7 +130,8 @@ BLI_INLINE SmallHashEntry *smallhash_lookup_first_free(SmallHash *sh, const uint uint hoff = 1; for (e = &sh->buckets[h % sh->nbuckets]; smallhash_val_is_used(e->val); - h = SMHASH_NEXT(h, hoff), e = &sh->buckets[h % sh->nbuckets]) { + h = SMHASH_NEXT(h, hoff), e = &sh->buckets[h % sh->nbuckets]) + { /* pass */ } @@ -381,7 +383,8 @@ double BLI_smallhash_calc_quality(SmallHash *sh) uint hoff = 1; for (e = &sh->buckets[h % sh->nbuckets]; e != e_final; - h = SMHASH_NEXT(h, hoff), e = &sh->buckets[h % sh->nbuckets]) { + h = SMHASH_NEXT(h, hoff), e = &sh->buckets[h % sh->nbuckets]) + { count += 1; } diff --git a/source/blender/blenlib/intern/storage.c b/source/blender/blenlib/intern/storage.c index f796d6adca5..1cabccbbed4 100644 --- a/source/blender/blenlib/intern/storage.c +++ b/source/blender/blenlib/intern/storage.c @@ -268,7 +268,8 @@ eFileAttributes BLI_file_attributes(const char *path) ret |= FILE_ATTR_SPARSE_FILE; } if (attr & FILE_ATTRIBUTE_OFFLINE || attr & FILE_ATTRIBUTE_RECALL_ON_OPEN || - attr & FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS) { + attr & FILE_ATTRIBUTE_RECALL_ON_DATA_ACCESS) + { ret |= FILE_ATTR_OFFLINE; } if (attr & FILE_ATTRIBUTE_REPARSE_POINT) { diff --git a/source/blender/blenlib/intern/string_utf8.c b/source/blender/blenlib/intern/string_utf8.c index 0f32db4a79e..d1db44e5884 100644 --- a/source/blender/blenlib/intern/string_utf8.c +++ b/source/blender/blenlib/intern/string_utf8.c @@ -415,7 +415,8 @@ char32_t BLI_str_utf32_char_to_upper(const char32_t wc) if ((wc <= U'z' && wc >= U'a') || (wc <= U'\xF6' && wc >= U'\xE0') || /* Correct but the first case is know, only check the second */ // (wc <= U'\xFE' && wc >= U'\xF8') - (wc >= U'\xF8')) { + (wc >= U'\xF8')) + { return wc - 32; } return wc; @@ -438,7 +439,8 @@ char32_t BLI_str_utf32_char_to_upper(const char32_t wc) /* There are only three remaining ranges that contain capitalization. */ if (!(wc <= U'\x0292' && wc >= U'\x00FF') && !(wc <= U'\x04F9' && wc >= U'\x03AC') && - !(wc <= U'\x1FE1' && wc >= U'\x1E01')) { + !(wc <= U'\x1FE1' && wc >= U'\x1E01')) + { return wc; } @@ -543,7 +545,8 @@ char32_t BLI_str_utf32_char_to_lower(const char32_t wc) /* There are only three remaining ranges that contain capitalization. */ if (!(wc <= U'\x0216' && wc >= U'\x00D8') && !(wc <= U'\x04F8' && wc >= U'\x0386') && - !(wc <= U'\x1FE9' && wc >= U'\x1E00')) { + !(wc <= U'\x1FE9' && wc >= U'\x1E00')) + { return wc; } @@ -962,7 +965,8 @@ size_t BLI_str_partition_ex_utf8(const char *str, for (char *sep = (char *)(from_right ? BLI_str_find_prev_char_utf8(end, str) : str); from_right ? (sep > str) : ((sep < end) && (*sep != '\0')); sep = (char *)(from_right ? (str != sep ? BLI_str_find_prev_char_utf8(sep, str) : NULL) : - str + index)) { + str + index)) + { size_t index_ofs = 0; const uint c = BLI_str_utf8_as_unicode_step_or_error(sep, (size_t)(end - sep), &index_ofs); if (UNLIKELY(c == BLI_UTF8_ERR)) { diff --git a/source/blender/blenlib/intern/system_win32.c b/source/blender/blenlib/intern/system_win32.c index f5c678abbc7..5a08f77d20a 100644 --- a/source/blender/blenlib/intern/system_win32.c +++ b/source/blender/blenlib/intern/system_win32.c @@ -158,7 +158,8 @@ static bool BLI_windows_system_backtrace_run_trace(FILE *fp, HANDLE hThread, PCO NULL, SymFunctionTableAccess64, SymGetModuleBase64, - 0)) { + 0)) + { if (frame.AddrPC.Offset) { char module[MAX_PATH]; @@ -170,7 +171,8 @@ static bool BLI_windows_system_backtrace_run_trace(FILE *fp, HANDLE hThread, PCO lineinfo.SizeOfStruct = sizeof(lineinfo); DWORD displacement = 0; if (SymGetLineFromAddr( - GetCurrentProcess(), (DWORD64)(frame.AddrPC.Offset), &displacement, &lineinfo)) { + GetCurrentProcess(), (DWORD64)(frame.AddrPC.Offset), &displacement, &lineinfo)) + { fprintf(fp, " %s:%d", lineinfo.FileName, lineinfo.LineNumber); } fprintf(fp, "\n"); diff --git a/source/blender/blenlib/intern/voronoi_2d.c b/source/blender/blenlib/intern/voronoi_2d.c index 489043a76f5..2ed8f02dfbb 100644 --- a/source/blender/blenlib/intern/voronoi_2d.c +++ b/source/blender/blenlib/intern/voronoi_2d.c @@ -578,13 +578,15 @@ static int voronoi_getNextSideCoord( float co[2], cur_distance; if (fabsf(edge->start[other_dim] - coord[other_dim]) < VORONOI_EPS && - len_squared_v2v2(coord, edge->start) > VORONOI_EPS) { + len_squared_v2v2(coord, edge->start) > VORONOI_EPS) + { copy_v2_v2(co, edge->start); ok = true; } if (fabsf(edge->end[other_dim] - coord[other_dim]) < VORONOI_EPS && - len_squared_v2v2(coord, edge->end) > VORONOI_EPS) { + len_squared_v2v2(coord, edge->end) > VORONOI_EPS) + { copy_v2_v2(co, edge->end); ok = true; } diff --git a/source/blender/blenlib/intern/winstuff_dir.c b/source/blender/blenlib/intern/winstuff_dir.c index d5bc84c4c4f..74f1e1f78a0 100644 --- a/source/blender/blenlib/intern/winstuff_dir.c +++ b/source/blender/blenlib/intern/winstuff_dir.c @@ -54,7 +54,8 @@ DIR *opendir(const char *path) DIR *newd = NULL; if ((GetFileAttributesW(path_16) & FILE_ATTRIBUTE_DIRECTORY) && - ((path_len = strlen(path)) < (sizeof(newd->path) - PATH_SUFFIX_LEN))) { + ((path_len = strlen(path)) < (sizeof(newd->path) - PATH_SUFFIX_LEN))) + { newd = MEM_mallocN(sizeof(DIR), "opendir"); newd->handle = INVALID_HANDLE_VALUE; memcpy(newd->path, path, path_len); diff --git a/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc b/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc index 5fbb063463b..0717e88a19e 100644 --- a/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc +++ b/source/blender/blenlib/tests/BLI_delaunay_2d_test.cc @@ -165,7 +165,8 @@ int get_output_edge_index(const CDT_result &out, int out_index_1, int out_ind int ne = int(out.edge.size()); for (int i = 0; i < ne; ++i) { if ((out.edge[i].first == out_index_1 && out.edge[i].second == out_index_2) || - (out.edge[i].first == out_index_2 && out.edge[i].second == out_index_1)) { + (out.edge[i].first == out_index_2 && out.edge[i].second == out_index_1)) + { return i; } } diff --git a/source/blender/blenlib/tests/BLI_linklist_lockfree_test.cc b/source/blender/blenlib/tests/BLI_linklist_lockfree_test.cc index 0c2b4ee52cc..a0af053758d 100644 --- a/source/blender/blenlib/tests/BLI_linklist_lockfree_test.cc +++ b/source/blender/blenlib/tests/BLI_linklist_lockfree_test.cc @@ -46,7 +46,8 @@ TEST(LockfreeLinkList, InsertMultiple) /* Check rest of the nodes. */ int node_index = 0; for (LockfreeLinkNode *node = BLI_linklist_lockfree_begin(&list); node != nullptr; - node = node->next, ++node_index) { + node = node->next, ++node_index) + { EXPECT_EQ(node, &nodes[node_index]); if (node_index != nodes_num - 1) { EXPECT_EQ(node->next, &nodes[node_index + 1]); @@ -93,7 +94,8 @@ TEST(LockfreeLinkList, InsertMultipleConcurrent) bool *visited_nodes = (bool *)MEM_callocN(sizeof(bool) * nodes_num, "visited nodes"); /* First, we make sure that none of the nodes are added twice. */ for (LockfreeLinkNode *node_v = BLI_linklist_lockfree_begin(&list); node_v != nullptr; - node_v = node_v->next) { + node_v = node_v->next) + { IndexedNode *node = (IndexedNode *)node_v; EXPECT_GE(node->index, 0); EXPECT_LT(node->index, nodes_num); diff --git a/source/blender/blenlib/tests/BLI_mesh_intersect_test.cc b/source/blender/blenlib/tests/BLI_mesh_intersect_test.cc index afe70c85200..6f879c62e6b 100644 --- a/source/blender/blenlib/tests/BLI_mesh_intersect_test.cc +++ b/source/blender/blenlib/tests/BLI_mesh_intersect_test.cc @@ -298,7 +298,8 @@ TEST(mesh_intersect, TriTri) EXPECT_TRUE(v0 != nullptr && v1 != nullptr && v2 != nullptr); EXPECT_TRUE(v3 != nullptr && v4 != nullptr && v5 != nullptr); if (v0 != nullptr && v1 != nullptr && v2 != nullptr && v3 != nullptr && v4 != nullptr && - v5 != nullptr) { + v5 != nullptr) + { EXPECT_EQ(v0->orig, 0); EXPECT_EQ(v1->orig, 1); const Face *f0 = find_tri_with_verts(out, v4, v1, v5); @@ -369,7 +370,8 @@ TEST(mesh_intersect, TriTriReversed) EXPECT_TRUE(v0 != nullptr && v1 != nullptr && v2 != nullptr); EXPECT_TRUE(v3 != nullptr && v4 != nullptr && v5 != nullptr); if (v0 != nullptr && v1 != nullptr && v2 != nullptr && v3 != nullptr && v4 != nullptr && - v5 != nullptr) { + v5 != nullptr) + { EXPECT_EQ(v0->orig, 0); EXPECT_EQ(v1->orig, 1); const Face *f0 = find_tri_with_verts(out, v4, v5, v1); diff --git a/source/blender/blenlib/tests/BLI_polyfill_2d_test.cc b/source/blender/blenlib/tests/BLI_polyfill_2d_test.cc index 547300a098e..1f87f2229fe 100644 --- a/source/blender/blenlib/tests/BLI_polyfill_2d_test.cc +++ b/source/blender/blenlib/tests/BLI_polyfill_2d_test.cc @@ -118,7 +118,8 @@ static void test_polyfill_topology(const float /*poly*/[][2], } for (ehi = BLI_edgehashIterator_new(edgehash), i = 0; BLI_edgehashIterator_isDone(ehi) == false; - BLI_edgehashIterator_step(ehi), i++) { + BLI_edgehashIterator_step(ehi), i++) + { void **p = BLI_edgehashIterator_getValue_p(ehi); EXPECT_TRUE(ELEM(intptr_t(*p), 1, 2)); } diff --git a/source/blender/blenlib/tests/BLI_task_test.cc b/source/blender/blenlib/tests/BLI_task_test.cc index b7ee6962aec..385d3d912b5 100644 --- a/source/blender/blenlib/tests/BLI_task_test.cc +++ b/source/blender/blenlib/tests/BLI_task_test.cc @@ -271,7 +271,8 @@ TEST(task, ListBaseIter) EXPECT_EQ(items_num, 0); LinkData *item; for (i = 0, item = (LinkData *)list.first; i < ITEMS_NUM && item != nullptr; - i++, item = item->next) { + i++, item = item->next) + { EXPECT_EQ(POINTER_AS_INT(item->data), i); } EXPECT_EQ(ITEMS_NUM, i); diff --git a/source/blender/blenlib/tests/performance/BLI_task_performance_test.cc b/source/blender/blenlib/tests/performance/BLI_task_performance_test.cc index 68fdf4031ab..5d6ef85874c 100644 --- a/source/blender/blenlib/tests/performance/BLI_task_performance_test.cc +++ b/source/blender/blenlib/tests/performance/BLI_task_performance_test.cc @@ -120,7 +120,8 @@ static void task_listbase_test_do(ListBase *list, LinkData *item; int j; for (j = 0, item = (LinkData *)list->first; j < items_num && item != nullptr; - j++, item = item->next) { + j++, item = item->next) + { EXPECT_EQ(POINTER_AS_INT(item->data), j); item->data = POINTER_FROM_INT(0); } diff --git a/source/blender/blenloader/intern/blend_validate.cc b/source/blender/blenloader/intern/blend_validate.cc index 7ac0a4fe1af..b8ab1dd2c4c 100644 --- a/source/blender/blenloader/intern/blend_validate.cc +++ b/source/blender/blenloader/intern/blend_validate.cc @@ -46,7 +46,8 @@ bool BLO_main_validate_libraries(Main *bmain, ReportList *reports) int i = set_listbasepointers(bmain, lbarray); while (i--) { for (ID *id = static_cast(lbarray[i]->first); id != nullptr; - id = static_cast(id->next)) { + id = static_cast(id->next)) + { if (ID_IS_LINKED(id)) { is_valid = false; BKE_reportf(reports, diff --git a/source/blender/blenloader/intern/readblenentry.cc b/source/blender/blenloader/intern/readblenentry.cc index d5b810f6a98..4de3874b3e9 100644 --- a/source/blender/blenloader/intern/readblenentry.cc +++ b/source/blender/blenloader/intern/readblenentry.cc @@ -191,7 +191,8 @@ LinkNode *BLO_blendhandle_get_datablock_info(BlendHandle *bh, bool has_preview = false; /* See if we can find a preview in the data of this ID. */ for (BHead *data_bhead = blo_bhead_next(fd, id_bhead); data_bhead->code == BLO_CODE_DATA; - data_bhead = blo_bhead_next(fd, data_bhead)) { + data_bhead = blo_bhead_next(fd, data_bhead)) + { if (data_bhead->SDNAnr == sdna_nr_preview_image) { has_preview = true; break; @@ -229,7 +230,8 @@ static BHead *blo_blendhandle_read_preview_rects(FileData *fd, { for (int preview_index = 0; preview_index < NUM_ICON_SIZES; preview_index++) { if (preview_from_file->rect[preview_index] && preview_from_file->w[preview_index] && - preview_from_file->h[preview_index]) { + preview_from_file->h[preview_index]) + { bhead = blo_bhead_next(fd, bhead); BLI_assert((preview_from_file->w[preview_index] * preview_from_file->h[preview_index] * sizeof(uint)) == bhead->len); diff --git a/source/blender/blenloader/intern/readfile.cc b/source/blender/blenloader/intern/readfile.cc index 87446026c44..53bc72cdfd6 100644 --- a/source/blender/blenloader/intern/readfile.cc +++ b/source/blender/blenloader/intern/readfile.cc @@ -366,7 +366,8 @@ static void split_libdata(ListBase *lb_src, Main **lib_main_array, const uint li if (id->lib) { if ((uint(id->lib->temp_index) < lib_main_array_len) && /* this check should never fail, just in case 'id->lib' is a dangling pointer. */ - (lib_main_array[id->lib->temp_index]->curlib == id->lib)) { + (lib_main_array[id->lib->temp_index]->curlib == id->lib)) + { Main *mainvar = lib_main_array[id->lib->temp_index]; ListBase *lb_dst = which_libbase(mainvar, GS(id->name)); BLI_remlink(lb_src, id); @@ -401,7 +402,8 @@ void blo_split_main(ListBase *mainlist, Main *main) int i = 0; for (Library *lib = static_cast(main->libraries.first); lib; - lib = static_cast(lib->id.next), i++) { + lib = static_cast(lib->id.next), i++) + { Main *libmain = BKE_main_new(); libmain->curlib = lib; libmain->versionfile = lib->versionfile; @@ -926,7 +928,8 @@ static void decode_blender_header(FileData *fd) if (readsize == sizeof(header) && STREQLEN(header, "BLENDER", 7) && ELEM(header[7], '_', '-') && ELEM(header[8], 'v', 'V') && - (isdigit(header[9]) && isdigit(header[10]) && isdigit(header[11]))) { + (isdigit(header[9]) && isdigit(header[10]) && isdigit(header[11]))) + { fd->flags |= FD_FLAGS_FILE_OK; /* what size are pointers in the file ? */ @@ -2294,8 +2297,8 @@ static void lib_link_window_scene_data_restore(wmWindow *win, Scene *scene, View /* Local-view can become invalid during undo/redo steps, * so we exit it when no could be found. */ - for (base = static_cast(view_layer->object_bases.first); base; - base = base->next) { + for (base = static_cast(view_layer->object_bases.first); base; base = base->next) + { if (base->local_view_bits & v3d->local_view_uuid) { break; } @@ -3583,7 +3586,8 @@ static void lib_link_all(FileData *fd, Main *bmain) } if ((fd->flags & FD_FLAGS_IS_MEMFILE) && do_partial_undo && - (id->tag & LIB_TAG_UNDO_OLD_ID_REUSED) != 0) { + (id->tag & LIB_TAG_UNDO_OLD_ID_REUSED) != 0) + { /* This ID has been re-used from 'old' bmain. Since it was therefore unchanged across * current undo step, and old IDs re-use their old memory address, we do not need to liblink * it at all. */ diff --git a/source/blender/blenloader/intern/undofile.cc b/source/blender/blenloader/intern/undofile.cc index 43643f25eb2..ad109117fd5 100644 --- a/source/blender/blenloader/intern/undofile.cc +++ b/source/blender/blenloader/intern/undofile.cc @@ -60,7 +60,8 @@ void BLO_memfile_merge(MemFile *first, MemFile *second) /* First, detect all memchunks in second memfile that are not owned by it. */ for (MemFileChunk *sc = static_cast(second->chunks.first); sc != nullptr; - sc = static_cast(sc->next)) { + sc = static_cast(sc->next)) + { if (sc->is_identical) { BLI_ghash_insert(buffer_to_second_memchunk, (void *)sc->buf, sc); } @@ -69,7 +70,8 @@ void BLO_memfile_merge(MemFile *first, MemFile *second) /* Now, check all chunks from first memfile (the one we are removing), and if a memchunk owned by * it is also used by the second memfile, transfer the ownership. */ for (MemFileChunk *fc = static_cast(first->chunks.first); fc != nullptr; - fc = static_cast(fc->next)) { + fc = static_cast(fc->next)) + { if (!fc->is_identical) { MemFileChunk *sc = static_cast( BLI_ghash_lookup(buffer_to_second_memchunk, fc->buf)); @@ -121,7 +123,8 @@ void BLO_memfile_write_init(MemFileWriteData *mem_data, void **entry; if (!BLI_ghash_ensure_p(mem_data->id_session_uuid_mapping, POINTER_FROM_UINT(current_session_uuid), - &entry)) { + &entry)) + { *entry = mem_chunk; } else { @@ -231,7 +234,8 @@ bool BLO_memfile_write_file(struct MemFile *memfile, const char *filepath) } for (chunk = static_cast(memfile->chunks.first); chunk; - chunk = static_cast(chunk->next)) { + chunk = static_cast(chunk->next)) + { #ifdef _WIN32 if (size_t(write(file, chunk->buf, uint(chunk->size))) != chunk->size) #else diff --git a/source/blender/blenloader/intern/versioning_250.c b/source/blender/blenloader/intern/versioning_250.c index d05de03f4bb..c94022153a7 100644 --- a/source/blender/blenloader/intern/versioning_250.c +++ b/source/blender/blenloader/intern/versioning_250.c @@ -908,7 +908,8 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* Add default gravity to scenes */ for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if ((sce->physics_settings.flag & PHYS_GLOBAL_GRAVITY) == 0 && - is_zero_v3(sce->physics_settings.gravity)) { + is_zero_v3(sce->physics_settings.gravity)) + { sce->physics_settings.gravity[0] = sce->physics_settings.gravity[1] = 0.0f; sce->physics_settings.gravity[2] = -9.81f; sce->physics_settings.flag = PHYS_GLOBAL_GRAVITY; @@ -1406,7 +1407,8 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain) /* initialize to sane default so toggling on border shows something */ for (sce = bmain->scenes.first; sce; sce = sce->id.next) { if (sce->r.border.xmin == 0.0f && sce->r.border.ymin == 0.0f && sce->r.border.xmax == 0.0f && - sce->r.border.ymax == 0.0f) { + sce->r.border.ymax == 0.0f) + { sce->r.border.xmin = 0.0f; sce->r.border.ymin = 0.0f; sce->r.border.xmax = 1.0f; diff --git a/source/blender/blenloader/intern/versioning_260.c b/source/blender/blenloader/intern/versioning_260.c index 06f3628cf21..5917e60a64b 100644 --- a/source/blender/blenloader/intern/versioning_260.c +++ b/source/blender/blenloader/intern/versioning_260.c @@ -455,7 +455,8 @@ static void do_versions_affine_tracker_track(MovieTrackingTrack *track) MovieTrackingMarker *marker = &track->markers[i]; if (is_zero_v2(marker->pattern_corners[0]) && is_zero_v2(marker->pattern_corners[1]) && - is_zero_v2(marker->pattern_corners[2]) && is_zero_v2(marker->pattern_corners[3])) { + is_zero_v2(marker->pattern_corners[2]) && is_zero_v2(marker->pattern_corners[3])) + { marker->pattern_corners[0][0] = track->pat_min_legacy[0]; marker->pattern_corners[0][1] = track->pat_min_legacy[1]; @@ -1623,7 +1624,8 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) MovieTrackingObject *tracking_object; for (tracking_object = tracking->objects.first; tracking_object; - tracking_object = tracking_object->next) { + tracking_object = tracking_object->next) + { if (tracking_object->keyframe1 == 0 && tracking_object->keyframe2 == 0) { tracking_object->keyframe1 = tracking->settings.keyframe1_legacy; tracking_object->keyframe2 = tracking->settings.keyframe2_legacy; @@ -1684,7 +1686,8 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (sl->spacetype == SPACE_VIEW3D) { View3D *v3d = (View3D *)sl; if (v3d->render_border.xmin == 0.0f && v3d->render_border.ymin == 0.0f && - v3d->render_border.xmax == 0.0f && v3d->render_border.ymax == 0.0f) { + v3d->render_border.xmax == 0.0f && v3d->render_border.ymax == 0.0f) + { v3d->render_border.xmax = 1.0f; v3d->render_border.ymax = 1.0f; } @@ -2045,7 +2048,8 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (ELEM(srl->freestyleConfig.raycasting_algorithm, FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE, - FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL)) { + FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL)) + { srl->freestyleConfig.raycasting_algorithm = 0; /* deprecated */ srl->freestyleConfig.flags |= FREESTYLE_CULLING; } @@ -2328,11 +2332,9 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) if (sl->spacetype == SPACE_OUTLINER) { SpaceOutliner *space_outliner = (SpaceOutliner *)sl; - if (!ELEM(space_outliner->outlinevis, - SO_SCENES, - SO_LIBRARIES, - SO_SEQUENCE, - SO_DATA_API)) { + if (!ELEM( + space_outliner->outlinevis, SO_SCENES, SO_LIBRARIES, SO_SEQUENCE, SO_DATA_API)) + { space_outliner->outlinevis = SO_SCENES; } } @@ -2453,7 +2455,8 @@ void blo_do_versions_260(FileData *fd, Library *UNUSED(lib), Main *bmain) for (clip = bmain->movieclips.first; clip; clip = clip->id.next) { MovieTrackingPlaneTrack *plane_track; for (plane_track = clip->tracking.plane_tracks_legacy.first; plane_track; - plane_track = plane_track->next) { + plane_track = plane_track->next) + { plane_track->image_opacity = 1.0f; } } diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index 0b93f193bff..c915c36ed40 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -320,7 +320,8 @@ static void do_versions_compositor_render_passes_storage(bNode *node) int pass_index = 0; const char *sockname; for (bNodeSocket *sock = node->outputs.first; sock && pass_index < 31; - sock = sock->next, pass_index++) { + sock = sock->next, pass_index++) + { if (sock->storage == NULL) { NodeImageLayer *sockdata = MEM_callocN(sizeof(NodeImageLayer), "node image layer"); sock->storage = sockdata; @@ -690,7 +691,8 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) Brush *br; for (br = bmain->brushes.first; br; br = br->id.next) { if ((br->ob_mode & OB_MODE_SCULPT) && - ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK)) { + ELEM(br->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_SNAKE_HOOK)) + { br->alpha = 1.0f; } } @@ -1402,8 +1404,8 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (!DNA_struct_elem_find( - fd->filesdna, "MovieTrackingStabilization", "int", "tot_rot_track")) { + if (!DNA_struct_elem_find(fd->filesdna, "MovieTrackingStabilization", "int", "tot_rot_track")) + { MovieClip *clip; for (clip = bmain->movieclips.first; clip != NULL; clip = clip->id.next) { if (clip->tracking.stabilization.rot_track_legacy) { @@ -1539,8 +1541,8 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) LISTBASE_FOREACH (MaskLayer *, mlayer, &mask->masklayers) { LISTBASE_FOREACH (MaskSpline *, mspline, &mlayer->splines) { int i = 0; - for (MaskSplinePoint *mspoint = mspline->points; i < mspline->tot_point; - mspoint++, i++) { + for (MaskSplinePoint *mspoint = mspline->points; i < mspline->tot_point; mspoint++, i++) + { if (mspoint->parent.id_type == 0) { BKE_mask_parent_init(&mspoint->parent); } @@ -1685,7 +1687,8 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain) } if (!DNA_struct_elem_find( - fd->filesdna, "ParticleInstanceModifierData", "float", "particle_amount")) { + fd->filesdna, "ParticleInstanceModifierData", "float", "particle_amount")) + { for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) { if (md->type == eModifierType_ParticleInstance) { diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index be03b32850e..335cf087517 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -568,7 +568,8 @@ static void do_version_collection_propagate_lib_to_children(Collection *collecti { if (ID_IS_LINKED(collection)) { for (CollectionChild *collection_child = collection->children.first; collection_child != NULL; - collection_child = collection_child->next) { + collection_child = collection_child->next) + { if (!ID_IS_LINKED(collection_child->collection)) { collection_child->collection->id.lib = collection->id.lib; } @@ -694,8 +695,8 @@ static bool replace_bbone_scale_rnapath(char **p_old_path) return false; } - if (BLI_str_endswith(old_path, "bbone_scalein") || - BLI_str_endswith(old_path, "bbone_scaleout")) { + if (BLI_str_endswith(old_path, "bbone_scalein") || BLI_str_endswith(old_path, "bbone_scaleout")) + { *p_old_path = BLI_strdupcat(old_path, "x"); MEM_freeN(old_path); @@ -978,7 +979,8 @@ static void do_version_curvemapping_walker(Main *bmain, void (*callback)(CurveMa CMP_NODE_TIME, CMP_NODE_HUECORRECT, TEX_NODE_CURVE_RGB, - TEX_NODE_CURVE_TIME)) { + TEX_NODE_CURVE_TIME)) + { callback((CurveMapping *)node->storage); } } @@ -1179,7 +1181,8 @@ void do_versions_after_linking_280(FileData *fd, Main *bmain) /* Convert group layer visibility flags to hidden nested collection. */ for (Collection *collection = bmain->collections.first; collection; - collection = collection->id.next) { + collection = collection->id.next) + { /* Add fake user for all existing groups. */ id_fake_user_set(&collection->id); @@ -1228,7 +1231,8 @@ void do_versions_after_linking_280(FileData *fd, Main *bmain) * which is FORBIDDEN! NOTE: we need this to be recursive, since a child collection may be * sorted before its parent in bmain. */ for (Collection *collection = bmain->collections.first; collection != NULL; - collection = collection->id.next) { + collection = collection->id.next) + { do_version_collection_propagate_lib_to_children(collection); } @@ -1493,7 +1497,8 @@ void do_versions_after_linking_280(FileData *fd, Main *bmain) /* If the settings in the Bone are not set, copy. */ if (pchan->bone->bbone_prev_type == BBONE_HANDLE_AUTO && pchan->bone->bbone_next_type == BBONE_HANDLE_AUTO && - pchan->bone->bbone_prev == NULL && pchan->bone->bbone_next == NULL) { + pchan->bone->bbone_prev == NULL && pchan->bone->bbone_next == NULL) + { pchan->bone->bbone_prev_type = (pchan->bboneflag & PCHAN_BBONE_CUSTOM_START_REL) ? BBONE_HANDLE_RELATIVE : BBONE_HANDLE_ABSOLUTE; @@ -1798,7 +1803,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) for (Mesh *me = bmain->meshes.first; me; me = me->id.next) { /* If we have UVs, so this file will have MTexPoly layers too! */ if (CustomData_has_layer(&me->ldata, CD_MLOOPUV) || - CustomData_has_layer(&me->ldata, CD_PROP_FLOAT2)) { + CustomData_has_layer(&me->ldata, CD_PROP_FLOAT2)) + { CustomData_update_typemap(&me->pdata); CustomData_free_layers(&me->pdata, CD_MTEXPOLY, me->totpoly); } @@ -1848,7 +1854,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (ntree->type == NTREE_SHADER) { LISTBASE_FOREACH (bNode *, node, &ntree->nodes) { if (node->type == 194 /* SH_NODE_EEVEE_METALLIC */ && - STREQ(node->idname, "ShaderNodeOutputMetallic")) { + STREQ(node->idname, "ShaderNodeOutputMetallic")) + { BLI_strncpy(node->idname, "ShaderNodeEeveeMetallic", sizeof(node->idname)); error |= NTREE_DOVERSION_NEED_OUTPUT; } @@ -1860,13 +1867,15 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } else if (node->type == 196 /* SH_NODE_OUTPUT_EEVEE_MATERIAL */ && - STREQ(node->idname, "ShaderNodeOutputEeveeMaterial")) { + STREQ(node->idname, "ShaderNodeOutputEeveeMaterial")) + { node->type = SH_NODE_OUTPUT_MATERIAL; BLI_strncpy(node->idname, "ShaderNodeOutputMaterial", sizeof(node->idname)); } else if (node->type == 194 /* SH_NODE_EEVEE_METALLIC */ && - STREQ(node->idname, "ShaderNodeEeveeMetallic")) { + STREQ(node->idname, "ShaderNodeEeveeMetallic")) + { node->type = SH_NODE_BSDF_PRINCIPLED; BLI_strncpy(node->idname, "ShaderNodeBsdfPrincipled", sizeof(node->idname)); node->custom1 = SHD_GLOSSY_MULTI_GGX; @@ -1900,7 +1909,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (use_collection_compat_28 && (DNA_struct_elem_find(fd->filesdna, "ViewLayer", "FreestyleConfig", "freestyle_config") == false) && - DNA_struct_elem_find(fd->filesdna, "Scene", "ListBase", "view_layers")) { + DNA_struct_elem_find(fd->filesdna, "Scene", "ListBase", "view_layers")) + { for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { ViewLayer *view_layer; for (view_layer = scene->view_layers.first; view_layer; view_layer = view_layer->next) { @@ -1930,8 +1940,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } /* Grease pencil multi-frame falloff curve. */ - if (!DNA_struct_elem_find( - fd->filesdna, "GP_Sculpt_Settings", "CurveMapping", "cur_falloff")) { + if (!DNA_struct_elem_find(fd->filesdna, "GP_Sculpt_Settings", "CurveMapping", "cur_falloff")) + { for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { /* sculpt brushes */ GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt; @@ -2020,7 +2030,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) SO_LIBRARIES, SO_SEQUENCE, SO_DATA_API, - SO_ID_ORPHANS)) { + SO_ID_ORPHANS)) + { space_outliner->outlinevis = SO_VIEW_LAYER; } } @@ -2651,8 +2662,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (!DNA_struct_elem_find( - fd->filesdna, "RigidBodyWorld", "RigidBodyWorld_Shared", "*shared")) { + if (!DNA_struct_elem_find(fd->filesdna, "RigidBodyWorld", "RigidBodyWorld_Shared", "*shared")) + { for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { RigidBodyWorld *rbw = scene->rigidbody_world; @@ -3349,8 +3360,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } /* Grease pencil primitive curve */ - if (!DNA_struct_elem_find( - fd->filesdna, "GP_Sculpt_Settings", "CurveMapping", "cur_primitive")) { + if (!DNA_struct_elem_find(fd->filesdna, "GP_Sculpt_Settings", "CurveMapping", "cur_primitive")) + { for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) { GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt; if ((gset) && (gset->cur_primitive == NULL)) { @@ -3668,8 +3679,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 280, 49)) { /* All tool names changed, reset to defaults. */ - for (WorkSpace *workspace = bmain->workspaces.first; workspace; - workspace = workspace->id.next) { + for (WorkSpace *workspace = bmain->workspaces.first; workspace; workspace = workspace->id.next) + { while (!BLI_listbase_is_empty(&workspace->tools)) { BKE_workspace_tool_remove(workspace, workspace->tools.first); } @@ -3868,7 +3879,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) ARegion *region = NULL; if (ELEM(sl->spacetype, SPACE_VIEW3D, SPACE_IMAGE, SPACE_SEQ) && ((region = do_versions_find_region_or_null(regionbase, RGN_TYPE_TOOL_HEADER)) == - NULL)) { + NULL)) + { /* Add tool header. */ region = do_versions_add_region(RGN_TYPE_TOOL_HEADER, "tool header"); region->alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP; @@ -3905,8 +3917,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (!DNA_struct_elem_find( - fd->filesdna, "View3DOverlay", "float", "sculpt_mode_mask_opacity")) { + if (!DNA_struct_elem_find(fd->filesdna, "View3DOverlay", "float", "sculpt_mode_mask_opacity")) + { for (bScreen *screen = bmain->screens.first; screen; screen = screen->id.next) { LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { @@ -4283,8 +4295,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } - if (!DNA_struct_elem_find( - fd->filesdna, "LayerCollection", "short", "local_collections_bits")) { + if (!DNA_struct_elem_find(fd->filesdna, "LayerCollection", "short", "local_collections_bits")) + { LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) { LISTBASE_FOREACH (LayerCollection *, layer_collection, &view_layer->layer_collections) { @@ -4715,8 +4727,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) case eGpencilModifierType_Array: { ArrayGpencilModifierData *mmd = (ArrayGpencilModifierData *)md; mmd->seed = 1; - if ((mmd->offset[0] != 0.0f) || (mmd->offset[1] != 0.0f) || - (mmd->offset[2] != 0.0f)) { + if ((mmd->offset[0] != 0.0f) || (mmd->offset[1] != 0.0f) || (mmd->offset[2] != 0.0f)) + { mmd->flag |= GP_ARRAY_USE_OFFSET; } if ((mmd->shift[0] != 0.0f) || (mmd->shift[1] != 0.0f) || (mmd->shift[2] != 0.0f)) { @@ -4878,7 +4890,8 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) /* Boundary Edges Auto-masking. */ if (!DNA_struct_elem_find( - fd->filesdna, "Brush", "int", "automasking_boundary_edges_propagation_steps")) { + fd->filesdna, "Brush", "int", "automasking_boundary_edges_propagation_steps")) + { for (Brush *br = bmain->brushes.first; br; br = br->id.next) { br->automasking_boundary_edges_propagation_steps = 1; } diff --git a/source/blender/blenloader/intern/versioning_290.cc b/source/blender/blenloader/intern/versioning_290.cc index 08b60bf919e..4b620d97851 100644 --- a/source/blender/blenloader/intern/versioning_290.cc +++ b/source/blender/blenloader/intern/versioning_290.cc @@ -872,8 +872,8 @@ void blo_do_versions_290(FileData *fd, Library * /*lib*/, Main *bmain) /* Init Grease Pencil new random curves. */ if (!DNA_struct_elem_find(fd->filesdna, "BrushGpencilSettings", "float", "random_hue")) { LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) { - if ((brush->gpencil_settings) && - (brush->gpencil_settings->curve_rand_pressure == nullptr)) { + if ((brush->gpencil_settings) && (brush->gpencil_settings->curve_rand_pressure == nullptr)) + { brush->gpencil_settings->curve_rand_pressure = BKE_curvemapping_add( 1, 0.0f, 0.0f, 1.0f, 1.0f); brush->gpencil_settings->curve_rand_strength = BKE_curvemapping_add( @@ -1054,8 +1054,8 @@ void blo_do_versions_290(FileData *fd, Library * /*lib*/, Main *bmain) } /* Initialize additional velocity parameter for #CacheFile's. */ - if (!DNA_struct_elem_find( - fd->filesdna, "MeshSeqCacheModifierData", "float", "velocity_scale")) { + if (!DNA_struct_elem_find(fd->filesdna, "MeshSeqCacheModifierData", "float", "velocity_scale")) + { LISTBASE_FOREACH (Object *, object, &bmain->objects) { LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) { if (md->type == eModifierType_MeshSequenceCache) { @@ -1303,8 +1303,8 @@ void blo_do_versions_290(FileData *fd, Library * /*lib*/, Main *bmain) /* Ensure that particle systems generated by fluid modifier have correct phystype. */ LISTBASE_FOREACH (ParticleSettings *, part, &bmain->particles) { - if (ELEM( - part->type, PART_FLUID_FLIP, PART_FLUID_SPRAY, PART_FLUID_BUBBLE, PART_FLUID_FOAM)) { + if (ELEM(part->type, PART_FLUID_FLIP, PART_FLUID_SPRAY, PART_FLUID_BUBBLE, PART_FLUID_FOAM)) + { part->phystype = PART_PHYS_NO; } } @@ -1614,7 +1614,8 @@ void blo_do_versions_290(FileData *fd, Library * /*lib*/, Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 292, 14) || - ((bmain->versionfile == 293) && !MAIN_VERSION_ATLEAST(bmain, 293, 1))) { + ((bmain->versionfile == 293) && !MAIN_VERSION_ATLEAST(bmain, 293, 1))) + { FOREACH_NODETREE_BEGIN (bmain, ntree, id) { if (ntree->type != NTREE_GEOMETRY) { continue; @@ -1750,7 +1751,8 @@ void blo_do_versions_290(FileData *fd, Library * /*lib*/, Main *bmain) SEQ_RENDER_SIZE_PROXY_100, SEQ_RENDER_SIZE_PROXY_75, SEQ_RENDER_SIZE_PROXY_50, - SEQ_RENDER_SIZE_PROXY_25)) { + SEQ_RENDER_SIZE_PROXY_25)) + { sseq->flag |= SEQ_USE_PROXIES; } if (sseq->render_size == SEQ_RENDER_SIZE_FULL) { diff --git a/source/blender/blenloader/intern/versioning_300.cc b/source/blender/blenloader/intern/versioning_300.cc index 4c9b557dadf..aa8fd58c7c8 100644 --- a/source/blender/blenloader/intern/versioning_300.cc +++ b/source/blender/blenloader/intern/versioning_300.cc @@ -204,8 +204,8 @@ static void version_idproperty_move_data_string(IDPropertyUIDataString *ui_data, static void version_idproperty_ui_data(IDProperty *idprop_group) { - if (idprop_group == - nullptr) { /* nullptr check here to reduce verbosity of calls to this function. */ + if (idprop_group == nullptr) + { /* nullptr check here to reduce verbosity of calls to this function. */ return; } @@ -555,7 +555,8 @@ static void version_geometry_nodes_add_realize_instance_nodes(bNodeTree *ntree) GEO_NODE_TRIM_CURVE, GEO_NODE_REPLACE_MATERIAL, GEO_NODE_SUBDIVIDE_MESH, - GEO_NODE_TRIANGULATE)) { + GEO_NODE_TRIANGULATE)) + { bNodeSocket *geometry_socket = static_cast(node->inputs.first); add_realize_instances_before_socket(ntree, node, geometry_socket); } @@ -864,7 +865,8 @@ static void version_geometry_nodes_primitive_uv_maps(bNodeTree &ntree) GEO_NODE_MESH_PRIMITIVE_CYLINDER, GEO_NODE_MESH_PRIMITIVE_GRID, GEO_NODE_MESH_PRIMITIVE_ICO_SPHERE, - GEO_NODE_MESH_PRIMITIVE_UV_SPHERE)) { + GEO_NODE_MESH_PRIMITIVE_UV_SPHERE)) + { continue; } bNodeSocket *primitive_output_socket = nullptr; @@ -956,7 +958,8 @@ static void version_geometry_nodes_extrude_smooth_propagation(bNodeTree &ntree) continue; } if (static_cast(node->storage)->mode != - GEO_NODE_EXTRUDE_MESH_EDGES) { + GEO_NODE_EXTRUDE_MESH_EDGES) + { continue; } bNodeSocket *geometry_in_socket = nodeFindSocket(node, SOCK_IN, "Mesh"); @@ -982,8 +985,8 @@ static void version_geometry_nodes_extrude_smooth_propagation(bNodeTree &ntree) bNode *capture_node = geometry_in_link->fromnode; const NodeGeometryAttributeCapture &capture_storage = *static_cast(capture_node->storage); - if (capture_storage.data_type != CD_PROP_BOOL || - capture_storage.domain != ATTR_DOMAIN_FACE) { + if (capture_storage.data_type != CD_PROP_BOOL || capture_storage.domain != ATTR_DOMAIN_FACE) + { return false; } bNodeSocket *capture_in_socket = nodeFindSocket(capture_node, SOCK_IN, "Value_003"); @@ -1116,22 +1119,26 @@ void do_versions_after_linking_300(FileData * /*fd*/, Main *bmain) ToolSettings *tool_settings = scene->toolsettings; ImagePaintSettings *imapaint = &tool_settings->imapaint; if (imapaint->canvas != nullptr && - ELEM(imapaint->canvas->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) { + ELEM(imapaint->canvas->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) + { imapaint->canvas = nullptr; } if (imapaint->stencil != nullptr && - ELEM(imapaint->stencil->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) { + ELEM(imapaint->stencil->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) + { imapaint->stencil = nullptr; } if (imapaint->clone != nullptr && - ELEM(imapaint->clone->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) { + ELEM(imapaint->clone->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) + { imapaint->clone = nullptr; } } LISTBASE_FOREACH (Brush *, brush, &bmain->brushes) { if (brush->clone.image != nullptr && - ELEM(brush->clone.image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) { + ELEM(brush->clone.image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) + { brush->clone.image = nullptr; } } @@ -1412,7 +1419,8 @@ static bool replace_bbone_len_scale_rnapath(char **p_old_path, int *p_index) int len = strlen(old_path); if (BLI_str_endswith(old_path, ".bbone_curveiny") || - BLI_str_endswith(old_path, ".bbone_curveouty")) { + BLI_str_endswith(old_path, ".bbone_curveouty")) + { old_path[len - 1] = 'z'; return true; } @@ -1420,7 +1428,8 @@ static bool replace_bbone_len_scale_rnapath(char **p_old_path, int *p_index) if (BLI_str_endswith(old_path, ".bbone_scaleinx") || BLI_str_endswith(old_path, ".bbone_scaleiny") || BLI_str_endswith(old_path, ".bbone_scaleoutx") || - BLI_str_endswith(old_path, ".bbone_scaleouty")) { + BLI_str_endswith(old_path, ".bbone_scaleouty")) + { int index = (old_path[len - 1] == 'y' ? 2 : 0); old_path[len - 1] = 0; @@ -1778,7 +1787,8 @@ static bool version_set_seq_single_frame_content(Sequence *seq, void * /*user_da { if ((seq->len == 1) && (seq->type == SEQ_TYPE_IMAGE || - ((seq->type & SEQ_TYPE_EFFECT) && SEQ_effect_get_num_inputs(seq->type) == 0))) { + ((seq->type & SEQ_TYPE_EFFECT) && SEQ_effect_get_num_inputs(seq->type) == 0))) + { seq->flag |= SEQ_SINGLE_FRAME_CONTENT; } return true; @@ -2209,7 +2219,8 @@ static void version_fix_image_format_copy(Main *bmain, ImageFormatData *format) LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { if (format != &scene->r.im_format && ELEM(format->view_settings.curve_mapping, scene->view_settings.curve_mapping, - scene->r.im_format.view_settings.curve_mapping)) { + scene->r.im_format.view_settings.curve_mapping)) + { format->view_settings.curve_mapping = BKE_curvemapping_copy( format->view_settings.curve_mapping); break; @@ -2236,13 +2247,15 @@ static void version_ensure_missing_regions(ScrArea *area, SpaceLink *sl) switch (sl->spacetype) { case SPACE_FILE: { if (ARegion *ui_region = do_versions_add_region_if_not_found( - regionbase, RGN_TYPE_UI, "versioning: UI region for file", RGN_TYPE_TOOLS)) { + regionbase, RGN_TYPE_UI, "versioning: UI region for file", RGN_TYPE_TOOLS)) + { ui_region->alignment = RGN_ALIGN_TOP; ui_region->flag |= RGN_FLAG_DYNAMIC_SIZE; } if (ARegion *exec_region = do_versions_add_region_if_not_found( - regionbase, RGN_TYPE_EXECUTE, "versioning: execute region for file", RGN_TYPE_UI)) { + regionbase, RGN_TYPE_EXECUTE, "versioning: execute region for file", RGN_TYPE_UI)) + { exec_region->alignment = RGN_ALIGN_BOTTOM; exec_region->flag = RGN_FLAG_DYNAMIC_SIZE; } @@ -2251,7 +2264,8 @@ static void version_ensure_missing_regions(ScrArea *area, SpaceLink *sl) regionbase, RGN_TYPE_TOOL_PROPS, "versioning: tool props region for file", - RGN_TYPE_EXECUTE)) { + RGN_TYPE_EXECUTE)) + { tool_props_region->alignment = RGN_ALIGN_RIGHT; tool_props_region->flag = RGN_FLAG_HIDDEN; } @@ -2540,8 +2554,8 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 300, 13)) { /* Convert Surface Deform to sparse-capable bind structure. */ - if (!DNA_struct_elem_find( - fd->filesdna, "SurfaceDeformModifierData", "int", "num_mesh_verts")) { + if (!DNA_struct_elem_find(fd->filesdna, "SurfaceDeformModifierData", "int", "num_mesh_verts")) + { LISTBASE_FOREACH (Object *, ob, &bmain->objects) { LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) { if (md->type == eModifierType_SurfaceDeform) { @@ -2567,15 +2581,16 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain) } } - if (!DNA_struct_elem_find( - fd->filesdna, "WorkSpace", "AssetLibraryReference", "asset_library")) { + if (!DNA_struct_elem_find(fd->filesdna, "WorkSpace", "AssetLibraryReference", "asset_library")) + { LISTBASE_FOREACH (WorkSpace *, workspace, &bmain->workspaces) { BKE_asset_library_reference_init_default(&workspace->asset_library_ref); } } if (!DNA_struct_elem_find( - fd->filesdna, "FileAssetSelectParams", "AssetLibraryReference", "asset_library_ref")) { + fd->filesdna, "FileAssetSelectParams", "AssetLibraryReference", "asset_library_ref")) + { LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) { @@ -2661,7 +2676,8 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain) } if (!DNA_struct_elem_find( - fd->filesdna, "FileAssetSelectParams", "AssetLibraryReference", "asset_library_ref")) { + fd->filesdna, "FileAssetSelectParams", "AssetLibraryReference", "asset_library_ref")) + { LISTBASE_FOREACH (bScreen *, screen, &bmain->screens) { LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { LISTBASE_FOREACH (SpaceLink *, space, &area->spacedata) { @@ -2748,7 +2764,8 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain) if (!MAIN_VERSION_ATLEAST(bmain, 300, 22)) { if (!DNA_struct_elem_find( - fd->filesdna, "LineartGpencilModifierData", "bool", "use_crease_on_smooth")) { + fd->filesdna, "LineartGpencilModifierData", "bool", "use_crease_on_smooth")) + { LISTBASE_FOREACH (Object *, ob, &bmain->objects) { if (ob->type == OB_GPENCIL_LEGACY) { LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) { @@ -3173,7 +3190,8 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain) /* Special case to handle older in-development 3.1 files, before change from 3.0 branch gets * merged in master. */ if (!MAIN_VERSION_ATLEAST(bmain, 300, 42) || - (bmain->versionfile == 301 && !MAIN_VERSION_ATLEAST(bmain, 301, 3))) { + (bmain->versionfile == 301 && !MAIN_VERSION_ATLEAST(bmain, 301, 3))) + { /* Update LibOverride operations regarding insertions in RNA collections (i.e. modifiers, * constraints and NLA tracks). */ ID *id_iter; @@ -3320,7 +3338,8 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 301, 7) || - (bmain->versionfile == 302 && !MAIN_VERSION_ATLEAST(bmain, 302, 4))) { + (bmain->versionfile == 302 && !MAIN_VERSION_ATLEAST(bmain, 302, 4))) + { /* Duplicate value for two flags that mistakenly had the same numeric value. */ LISTBASE_FOREACH (Object *, ob, &bmain->objects) { LISTBASE_FOREACH (ModifierData *, md, &ob->modifiers) { @@ -4092,7 +4111,8 @@ void blo_do_versions_300(FileData *fd, Library * /*lib*/, Main *bmain) /* Grease Pencil Build modifier: * Set default value for new natural draw-speed factor and maximum gap. */ if (!DNA_struct_elem_find(fd->filesdna, "BuildGpencilModifierData", "float", "speed_fac") || - !DNA_struct_elem_find(fd->filesdna, "BuildGpencilModifierData", "float", "speed_maxgap")) { + !DNA_struct_elem_find(fd->filesdna, "BuildGpencilModifierData", "float", "speed_maxgap")) + { LISTBASE_FOREACH (Object *, ob, &bmain->objects) { LISTBASE_FOREACH (GpencilModifierData *, md, &ob->greasepencil_modifiers) { if (md->type == eGpencilModifierType_Build) { diff --git a/source/blender/blenloader/intern/versioning_common.cc b/source/blender/blenloader/intern/versioning_common.cc index 31e8c7620dc..9468b978716 100644 --- a/source/blender/blenloader/intern/versioning_common.cc +++ b/source/blender/blenloader/intern/versioning_common.cc @@ -207,7 +207,8 @@ void version_node_socket_index_animdata(Main *bmain, * keyframe data. Not sure what causes that, so I (Sybren) moved the code here from * versioning_290.cc as-is (structure-wise). */ for (int input_index = total_number_of_sockets - 1; input_index >= socket_index_orig; - input_index--) { + input_index--) + { FOREACH_NODETREE_BEGIN (bmain, ntree, owner_id) { if (ntree->type != node_tree_type) { continue; diff --git a/source/blender/blenloader/intern/versioning_cycles.c b/source/blender/blenloader/intern/versioning_cycles.c index 67772140466..3a4454ef7e3 100644 --- a/source/blender/blenloader/intern/versioning_cycles.c +++ b/source/blender/blenloader/intern/versioning_cycles.c @@ -130,7 +130,8 @@ static void displacement_node_insert(bNodeTree *ntree) bNodeSocket *tosock = link->tosock; if (!(tonode->type == SH_NODE_OUTPUT_MATERIAL && fromnode->type != SH_NODE_DISPLACEMENT && - STREQ(tosock->identifier, "Displacement"))) { + STREQ(tosock->identifier, "Displacement"))) + { continue; } @@ -442,7 +443,8 @@ static void update_math_node_single_operand_operators(bNodeTree *ntree) NODE_MATH_ABSOLUTE, NODE_MATH_FRACTION, NODE_MATH_ARCCOSINE, - NODE_MATH_ARCTANGENT)) { + NODE_MATH_ARCTANGENT)) + { bNodeSocket *sockA = BLI_findlink(&node->inputs, 0); bNodeSocket *sockB = BLI_findlink(&node->inputs, 1); if (!sockA->link && sockB->link) { @@ -481,7 +483,8 @@ static void update_vector_math_node_add_and_subtract_operators(bNodeTree *ntree) if (node->type == SH_NODE_VECTOR_MATH) { bNodeSocket *sockOutValue = nodeFindSocket(node, SOCK_OUT, "Value"); if (socket_is_used(sockOutValue) && - ELEM(node->custom1, NODE_VECTOR_MATH_ADD, NODE_VECTOR_MATH_SUBTRACT)) { + ELEM(node->custom1, NODE_VECTOR_MATH_ADD, NODE_VECTOR_MATH_SUBTRACT)) + { bNode *absNode = nodeAddStaticNode(NULL, ntree, SH_NODE_VECTOR_MATH); absNode->custom1 = NODE_VECTOR_MATH_ABSOLUTE; @@ -819,7 +822,8 @@ static void update_mapping_node_fcurve_rna_path_callback(ID *UNUSED(id), { MappingNodeFCurveCallbackData *data = (MappingNodeFCurveCallbackData *)_data; if (!STRPREFIX(fcurve->rna_path, data->nodePath) || - BLI_str_endswith(fcurve->rna_path, "default_value")) { + BLI_str_endswith(fcurve->rna_path, "default_value")) + { return; } char *old_fcurve_rna_path = fcurve->rna_path; @@ -1194,7 +1198,8 @@ static void update_voronoi_node_square_distance(bNodeTree *ntree) NodeTexVoronoi *tex = (NodeTexVoronoi *)node->storage; bNodeSocket *sockDistance = nodeFindSocket(node, SOCK_OUT, "Distance"); if (tex->distance == SHD_VORONOI_EUCLIDEAN && - ELEM(tex->feature, SHD_VORONOI_F1, SHD_VORONOI_F2) && socket_is_used(sockDistance)) { + ELEM(tex->feature, SHD_VORONOI_F1, SHD_VORONOI_F2) && socket_is_used(sockDistance)) + { bNode *multiplyNode = nodeAddStaticNode(NULL, ntree, SH_NODE_MATH); multiplyNode->custom1 = NODE_MATH_MULTIPLY; multiplyNode->locx = node->locx + node->width + 20.0f; @@ -1389,7 +1394,8 @@ void do_versions_after_linking_cycles(Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 279, 2) || - (MAIN_VERSION_ATLEAST(bmain, 280, 0) && !MAIN_VERSION_ATLEAST(bmain, 280, 4))) { + (MAIN_VERSION_ATLEAST(bmain, 280, 0) && !MAIN_VERSION_ATLEAST(bmain, 280, 4))) + { displacement_node_insert(ntree); } @@ -1400,7 +1406,8 @@ void do_versions_after_linking_cycles(Main *bmain) } if (!MAIN_VERSION_ATLEAST(bmain, 279, 4) || - (MAIN_VERSION_ATLEAST(bmain, 280, 0) && !MAIN_VERSION_ATLEAST(bmain, 280, 5))) { + (MAIN_VERSION_ATLEAST(bmain, 280, 0) && !MAIN_VERSION_ATLEAST(bmain, 280, 5))) + { /* Switch to squared roughness convention */ square_roughness_node_insert(ntree); } diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index 562e89866d0..153a49f167a 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -1395,8 +1395,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) } } - if ((ob->softflag & OB_SB_ENABLE) && - !BKE_modifiers_findby_type(ob, eModifierType_Softbody)) { + if ((ob->softflag & OB_SB_ENABLE) && !BKE_modifiers_findby_type(ob, eModifierType_Softbody)) + { if (ob->softflag & OB_SB_POSTDEF) { md = ob->modifiers.first; @@ -1932,8 +1932,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain) /* unless the file was created 2.44.3 but not 2.45, update the constraints */ if (!(bmain->versionfile == 244 && bmain->subversionfile == 3) && - ((bmain->versionfile < 245) || - (bmain->versionfile == 245 && bmain->subversionfile == 0))) { + ((bmain->versionfile < 245) || (bmain->versionfile == 245 && bmain->subversionfile == 0))) + { for (ob = bmain->objects.first; ob; ob = ob->id.next) { ListBase *list; list = &ob->constraints; diff --git a/source/blender/blenloader/intern/writefile.cc b/source/blender/blenloader/intern/writefile.cc index 230f9647835..5f987160bd5 100644 --- a/source/blender/blenloader/intern/writefile.cc +++ b/source/blender/blenloader/intern/writefile.cc @@ -624,7 +624,8 @@ static void mywrite_id_begin(WriteData *wd, ID *id) if (wd->mem.id_session_uuid_mapping != nullptr && (curr_memchunk == nullptr || curr_memchunk->id_session_uuid != id->session_uuid || (prev_memchunk != nullptr && - (prev_memchunk->id_session_uuid == curr_memchunk->id_session_uuid)))) { + (prev_memchunk->id_session_uuid == curr_memchunk->id_session_uuid)))) + { void *ref = BLI_ghash_lookup(wd->mem.id_session_uuid_mapping, POINTER_FROM_UINT(id->session_uuid)); if (ref != nullptr) { @@ -959,9 +960,9 @@ static void write_libraries(WriteData *wd, Main *main) found_one = false; while (!found_one && tot--) { for (id = static_cast(lbarray[tot]->first); id; id = static_cast(id->next)) { - if (id->us > 0 && - ((id->tag & LIB_TAG_EXTERN) || - ((id->tag & LIB_TAG_INDIRECT) && (id->flag & LIB_INDIRECT_WEAK_LINK)))) { + if (id->us > 0 && ((id->tag & LIB_TAG_EXTERN) || ((id->tag & LIB_TAG_INDIRECT) && + (id->flag & LIB_INDIRECT_WEAK_LINK)))) + { found_one = true; break; } @@ -995,9 +996,9 @@ static void write_libraries(WriteData *wd, Main *main) /* Write link placeholders for all direct linked IDs. */ while (a--) { for (id = static_cast(lbarray[a]->first); id; id = static_cast(id->next)) { - if (id->us > 0 && - ((id->tag & LIB_TAG_EXTERN) || - ((id->tag & LIB_TAG_INDIRECT) && (id->flag & LIB_INDIRECT_WEAK_LINK)))) { + if (id->us > 0 && ((id->tag & LIB_TAG_EXTERN) || ((id->tag & LIB_TAG_INDIRECT) && + (id->flag & LIB_INDIRECT_WEAK_LINK)))) + { if (!BKE_idtype_idcode_is_linkable(GS(id->name))) { CLOG_ERROR(&LOG, "Data-block '%s' from lib '%s' is not linkable, but is flagged as " diff --git a/source/blender/bmesh/intern/bmesh_core.c b/source/blender/bmesh/intern/bmesh_core.c index 5fbbd087d7e..37e0163503c 100644 --- a/source/blender/bmesh/intern/bmesh_core.c +++ b/source/blender/bmesh/intern/bmesh_core.c @@ -540,7 +540,8 @@ int bmesh_elem_check(void *element, const char htype) case BM_EDGE: { BMEdge *e = element; if (e->v1_disk_link.prev == NULL || e->v2_disk_link.prev == NULL || - e->v1_disk_link.next == NULL || e->v2_disk_link.next == NULL) { + e->v1_disk_link.next == NULL || e->v2_disk_link.next == NULL) + { err |= IS_EDGE_NULL_DISK_LINK; } @@ -1909,7 +1910,8 @@ BMFace *bmesh_kernel_join_face_kill_edge(BMesh *bm, BMFace *f1, BMFace *f2, BMEd /* validate that for each face, each vertex has another edge in its disk cycle that is * not e, and not shared. */ if (BM_edge_in_face(l_f1->next->e, f2) || BM_edge_in_face(l_f1->prev->e, f2) || - BM_edge_in_face(l_f2->next->e, f1) || BM_edge_in_face(l_f2->prev->e, f1)) { + BM_edge_in_face(l_f2->next->e, f1) || BM_edge_in_face(l_f2->prev->e, f1)) + { return NULL; } diff --git a/source/blender/bmesh/intern/bmesh_edgeloop.c b/source/blender/bmesh/intern/bmesh_edgeloop.c index 4391a6a92d7..079c75e890b 100644 --- a/source/blender/bmesh/intern/bmesh_edgeloop.c +++ b/source/blender/bmesh/intern/bmesh_edgeloop.c @@ -146,7 +146,8 @@ int BM_mesh_edgeloops_find(BMesh *bm, /* add both directions */ if (bm_loop_build(el_store, e->v1, e->v2, 1) && bm_loop_build(el_store, e->v2, e->v1, -1) && - el_store->len > 1) { + el_store->len > 1) + { BLI_addtail(r_eloops, el_store); count++; } diff --git a/source/blender/bmesh/intern/bmesh_interp.c b/source/blender/bmesh/intern/bmesh_interp.c index 234fd8079b3..56b6ca23ad0 100644 --- a/source/blender/bmesh/intern/bmesh_interp.c +++ b/source/blender/bmesh/intern/bmesh_interp.c @@ -1132,7 +1132,8 @@ static void bm_loop_walk_data(struct LoopWalkCtx *lwc, BMLoop *l_walk) BLI_assert(l_other->v == l_walk->v); if (BM_elem_flag_test(l_other, BM_ELEM_INTERNAL_TAG)) { if (CustomData_data_equals( - lwc->type, lwc->data_ref, BM_ELEM_CD_GET_VOID_P(l_other, lwc->cd_layer_offset))) { + lwc->type, lwc->data_ref, BM_ELEM_CD_GET_VOID_P(l_other, lwc->cd_layer_offset))) + { bm_loop_walk_data(lwc, l_other); } } diff --git a/source/blender/bmesh/intern/bmesh_iterators.cc b/source/blender/bmesh/intern/bmesh_iterators.cc index c27d02b9a04..ba8e71f934a 100644 --- a/source/blender/bmesh/intern/bmesh_iterators.cc +++ b/source/blender/bmesh/intern/bmesh_iterators.cc @@ -112,7 +112,8 @@ int BMO_iter_as_array(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], void *ele; for (ele = BMO_iter_new(&oiter, slot_args, slot_name, restrictmask); ele; - ele = BMO_iter_step(&oiter)) { + ele = BMO_iter_step(&oiter)) + { array[i] = ele; i++; if (i == len) { @@ -185,7 +186,8 @@ void *BMO_iter_as_arrayN(BMOpSlot slot_args[BMO_OP_MAX_SLOTS], BLI_assert(stack_array_size == 0 || (stack_array_size && stack_array)); if ((ele = static_cast(BMO_iter_new(&iter, slot_args, slot_name, restrictmask))) && - slot_len > 0) { + slot_len > 0) + { BMElem **array = slot_len > stack_array_size ? static_cast(MEM_mallocN(sizeof(ele) * slot_len, __func__)) : reinterpret_cast(stack_array); diff --git a/source/blender/bmesh/intern/bmesh_marking.c b/source/blender/bmesh/intern/bmesh_marking.c index a81e70b4e67..9c85131b1cc 100644 --- a/source/blender/bmesh/intern/bmesh_marking.c +++ b/source/blender/bmesh/intern/bmesh_marking.c @@ -319,7 +319,8 @@ static void bm_mesh_select_mode_flush_vert_to_edge_iter_fn(void *UNUSED(userdata const bool is_selected = BM_elem_flag_test(e, BM_ELEM_SELECT); const bool is_hidden = BM_elem_flag_test(e, BM_ELEM_HIDDEN); if (!is_hidden && - (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && BM_elem_flag_test(e->v2, BM_ELEM_SELECT))) { + (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && BM_elem_flag_test(e->v2, BM_ELEM_SELECT))) + { BM_elem_flag_enable(e, BM_ELEM_SELECT); chunk_data->delta_selection_len += is_selected ? 0 : 1; } @@ -442,8 +443,8 @@ void BM_mesh_deselect_flush(BMesh *bm) BM_ITER_MESH (e, &eiter, bm, BM_EDGES_OF_MESH) { if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) { if (BM_elem_flag_test(e, BM_ELEM_SELECT)) { - if (!BM_elem_flag_test(e->v1, BM_ELEM_SELECT) || - !BM_elem_flag_test(e->v2, BM_ELEM_SELECT)) { + if (!BM_elem_flag_test(e->v1, BM_ELEM_SELECT) || !BM_elem_flag_test(e->v2, BM_ELEM_SELECT)) + { BM_elem_flag_disable(e, BM_ELEM_SELECT); } } @@ -480,7 +481,8 @@ void BM_mesh_select_flush(BMesh *bm) BM_ITER_MESH (e, &eiter, bm, BM_EDGES_OF_MESH) { if (BM_elem_flag_test(e->v1, BM_ELEM_SELECT) && BM_elem_flag_test(e->v2, BM_ELEM_SELECT) && - !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) { + !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) + { BM_elem_flag_enable(e, BM_ELEM_SELECT); } } @@ -1233,7 +1235,8 @@ void BM_mesh_elem_hflag_disable_test(BMesh *bm, } if ((htype == (BM_VERT | BM_EDGE | BM_FACE)) && (hflag == BM_ELEM_SELECT) && - (respecthide == false) && (hflag_test == 0)) { + (respecthide == false) && (hflag_test == 0)) + { /* fast path for deselect all, avoid topology loops * since we know all will be de-selected anyway. */ for (i = 0; i < 3; i++) { diff --git a/source/blender/bmesh/intern/bmesh_mesh.cc b/source/blender/bmesh/intern/bmesh_mesh.cc index db70182fa27..1dadf2eb08c 100644 --- a/source/blender/bmesh/intern/bmesh_mesh.cc +++ b/source/blender/bmesh/intern/bmesh_mesh.cc @@ -278,8 +278,8 @@ void bmesh_edit_begin(BMesh * /*bm*/, BMOpTypeFlag /*type_flag*/) * until this is shown to be better for certain types of mesh edits. */ #ifdef BMOP_UNTAN_MULTIRES_ENABLED /* switch multires data out of tangent space */ - if ((type_flag & BMO_OPTYPE_FLAG_UNTAN_MULTIRES) && - CustomData_has_layer(&bm->ldata, CD_MDISPS)) { + if ((type_flag & BMO_OPTYPE_FLAG_UNTAN_MULTIRES) && CustomData_has_layer(&bm->ldata, CD_MDISPS)) + { bmesh_mdisps_space_set(bm, MULTIRES_SPACE_TANGENT, MULTIRES_SPACE_ABSOLUTE); /* ensure correct normals, if possible */ @@ -378,7 +378,8 @@ void BM_mesh_elem_index_ensure_ex(BMesh *bm, const char htype, int elem_offset[4 if (htype & (BM_FACE | BM_LOOP)) { if ((bm->elem_index_dirty & (BM_FACE | BM_LOOP)) || - (elem_offset && (elem_offset[2] || elem_offset[3]))) { + (elem_offset && (elem_offset[2] || elem_offset[3]))) + { BMIter iter; BMElem *ele; diff --git a/source/blender/bmesh/intern/bmesh_mesh_convert.cc b/source/blender/bmesh/intern/bmesh_mesh_convert.cc index 3515b3a48d6..81f193ef1e1 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_convert.cc +++ b/source/blender/bmesh/intern/bmesh_mesh_convert.cc @@ -378,7 +378,8 @@ void BM_mesh_bm_from_me(BMesh *bm, const Mesh *me, const struct BMeshFromMeshPar int i; KeyBlock *block; for (i = 0, block = static_cast(me->key->block.first); i < tot_shape_keys; - block = block->next, i++) { + block = block->next, i++) + { if (is_new) { CustomData_add_layer_named(&bm->vdata, CD_SHAPEKEY, CD_SET_DEFAULT, 0, block->name); int j = CustomData_get_layer_index_n(&bm->vdata, CD_SHAPEKEY, i); @@ -620,7 +621,8 @@ static BMVert **bm_to_mesh_vertex_map(BMesh *bm, const int old_verts_num) /* Not fool-proof, but chances are if we have many verts with the same index, * we will want to use the first one, * since the second is more likely to be a duplicate. */ - (vertMap[keyi] == nullptr)) { + (vertMap[keyi] == nullptr)) + { vertMap[keyi] = eve; } } @@ -799,7 +801,8 @@ static void bm_to_mesh_shape(BMesh *bm, /* Original key-indices are only used to check the vertex existed when entering edit-mode. */ (cd_shape_keyindex_offset != -1) && /* Offsets are only needed if the current shape is a basis for others. */ - BKE_keyblock_is_basis(key, bm->shapenr - 1)) { + BKE_keyblock_is_basis(key, bm->shapenr - 1)) + { BLI_assert(actkey != nullptr); /* Assured by `actkey_has_layer` check. */ const int actkey_uuid = bm_to_mesh_shape_layer_index_from_kb(bm, actkey); @@ -927,7 +930,8 @@ static void bm_to_mesh_shape(BMesh *bm, if ((currkey->data != nullptr) && (cd_shape_keyindex_offset != -1) && ((keyi = BM_ELEM_CD_GET_INT(eve, cd_shape_keyindex_offset)) != ORIGINDEX_NONE) && - (keyi < currkey->totelem)) { + (keyi < currkey->totelem)) + { /* Reconstruct keys via vertices original key indices. * WARNING(@ideasman42): `currkey->data` is known to be unreliable as the edit-mesh * coordinates may be flushed back to the shape-key when exporting or rendering. diff --git a/source/blender/bmesh/intern/bmesh_mesh_normals.cc b/source/blender/bmesh/intern/bmesh_mesh_normals.cc index 761b5f6c277..0bd765a8a02 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_normals.cc +++ b/source/blender/bmesh/intern/bmesh_mesh_normals.cc @@ -501,10 +501,12 @@ static int bm_mesh_loops_calc_normals_for_loop(BMesh *bm, * BM_vert_step_fan_loop() is quite cheap in term of CPU cycles, * so really think it's not worth it. */ if (BM_elem_flag_test(l_curr->e, BM_ELEM_TAG) && - (BM_elem_flag_test(l_curr, BM_ELEM_TAG) || !BM_loop_check_cyclic_smooth_fan(l_curr))) { + (BM_elem_flag_test(l_curr, BM_ELEM_TAG) || !BM_loop_check_cyclic_smooth_fan(l_curr))) + { } else if (!BM_elem_flag_test(l_curr->e, BM_ELEM_TAG) && - !BM_elem_flag_test(l_curr->prev->e, BM_ELEM_TAG)) { + !BM_elem_flag_test(l_curr->prev->e, BM_ELEM_TAG)) + { /* Simple case (both edges around that vertex are sharp in related polygon), * this vertex just takes its poly normal. */ @@ -913,7 +915,8 @@ static void bm_mesh_loops_calc_normals_for_vert_with_clnors( continue; } if (do_rebuild && !BM_ELEM_API_FLAG_TEST(l_curr, BM_LNORSPACE_UPDATE) && - !(bm->spacearr_dirty & BM_SPACEARR_DIRTY_ALL)) { + !(bm->spacearr_dirty & BM_SPACEARR_DIRTY_ALL)) + { continue; } BM_elem_flag_disable(l_curr, BM_ELEM_TAG); @@ -1036,7 +1039,8 @@ static void bm_mesh_loops_calc_normals_for_vert_without_clnors( continue; } if (do_rebuild && !BM_ELEM_API_FLAG_TEST(l_curr, BM_LNORSPACE_UPDATE) && - !(bm->spacearr_dirty & BM_SPACEARR_DIRTY_ALL)) { + !(bm->spacearr_dirty & BM_SPACEARR_DIRTY_ALL)) + { continue; } bm_mesh_loops_calc_normals_for_loop(bm, @@ -1130,7 +1134,8 @@ static void bm_mesh_loops_calc_normals__single_threaded(BMesh *bm, l_curr = l_first = BM_FACE_FIRST_LOOP(f_curr); do { if (do_rebuild && !BM_ELEM_API_FLAG_TEST(l_curr, BM_LNORSPACE_UPDATE) && - !(bm->spacearr_dirty & BM_SPACEARR_DIRTY_ALL)) { + !(bm->spacearr_dirty & BM_SPACEARR_DIRTY_ALL)) + { continue; } bm_mesh_loops_calc_normals_for_loop(bm, @@ -1785,7 +1790,8 @@ void BM_lnorspace_invalidate(BMesh *bm, const bool do_invalidate_all) /* Note that we only handle unselected neighbor vertices here, main loop will take care of * selected ones. */ if (!BM_elem_flag_test(l->prev->v, BM_ELEM_SELECT) && - !BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->prev->v))) { + !BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->prev->v))) + { BMLoop *l_prev; BMIter liter_prev; @@ -1796,7 +1802,8 @@ void BM_lnorspace_invalidate(BMesh *bm, const bool do_invalidate_all) } if (!BM_elem_flag_test(l->next->v, BM_ELEM_SELECT) && - !BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->next->v))) { + !BLI_BITMAP_TEST(done_verts, BM_elem_index_get(l->next->v))) + { BMLoop *l_next; BMIter liter_next; @@ -2256,7 +2263,8 @@ bool BM_custom_loop_normals_to_vector_layer(BMesh *bm) void BM_custom_loop_normals_from_vector_layer(BMesh *bm, bool add_sharp_edges) { if (!CustomData_has_layer(&bm->ldata, CD_CUSTOMLOOPNORMAL) || - !CustomData_has_layer(&bm->ldata, CD_NORMAL)) { + !CustomData_has_layer(&bm->ldata, CD_NORMAL)) + { return; } diff --git a/source/blender/bmesh/intern/bmesh_mesh_tessellate.c b/source/blender/bmesh/intern/bmesh_mesh_tessellate.c index d18680e8839..cbdfd948142 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_tessellate.c +++ b/source/blender/bmesh/intern/bmesh_mesh_tessellate.c @@ -82,7 +82,8 @@ BLI_INLINE void bmesh_calc_tessellation_for_face_impl(BMLoop *(*looptris)[3], } if (UNLIKELY(is_quad_flip_v3_first_third_fast( - l_ptr_a[0]->v->co, l_ptr_a[1]->v->co, l_ptr_a[2]->v->co, l_ptr_b[2]->v->co))) { + l_ptr_a[0]->v->co, l_ptr_a[1]->v->co, l_ptr_a[2]->v->co, l_ptr_b[2]->v->co))) + { /* Flip out of degenerate 0-2 state. */ l_ptr_a[2] = l_ptr_b[2]; l_ptr_b[0] = l_ptr_a[1]; diff --git a/source/blender/bmesh/intern/bmesh_mesh_validate.c b/source/blender/bmesh/intern/bmesh_mesh_validate.c index 4abde609558..7d10b00cea4 100644 --- a/source/blender/bmesh/intern/bmesh_mesh_validate.c +++ b/source/blender/bmesh/intern/bmesh_mesh_validate.c @@ -55,8 +55,8 @@ bool BM_mesh_validate(BMesh *bm) BM_mesh_elem_index_ensure(bm, BM_ALL); BM_ITER_MESH_INDEX (v, &iter, bm, BM_VERTS_OF_MESH, i) { - if (BM_elem_flag_test(v, BM_ELEM_SELECT | BM_ELEM_HIDDEN) == - (BM_ELEM_SELECT | BM_ELEM_HIDDEN)) { + if (BM_elem_flag_test(v, BM_ELEM_SELECT | BM_ELEM_HIDDEN) == (BM_ELEM_SELECT | BM_ELEM_HIDDEN)) + { ERRMSG("vert %d: is hidden and selected", i); } @@ -88,8 +88,8 @@ bool BM_mesh_validate(BMesh *bm) /* edge radial structure */ BM_ITER_MESH_INDEX (e, &iter, bm, BM_EDGES_OF_MESH, i) { - if (BM_elem_flag_test(e, BM_ELEM_SELECT | BM_ELEM_HIDDEN) == - (BM_ELEM_SELECT | BM_ELEM_HIDDEN)) { + if (BM_elem_flag_test(e, BM_ELEM_SELECT | BM_ELEM_HIDDEN) == (BM_ELEM_SELECT | BM_ELEM_HIDDEN)) + { ERRMSG("edge %d: is hidden and selected", i); } @@ -124,8 +124,8 @@ bool BM_mesh_validate(BMesh *bm) BMLoop *l_iter; BMLoop *l_first; - if (BM_elem_flag_test(f, BM_ELEM_SELECT | BM_ELEM_HIDDEN) == - (BM_ELEM_SELECT | BM_ELEM_HIDDEN)) { + if (BM_elem_flag_test(f, BM_ELEM_SELECT | BM_ELEM_HIDDEN) == (BM_ELEM_SELECT | BM_ELEM_HIDDEN)) + { ERRMSG("face %d: is hidden and selected", i); } diff --git a/source/blender/bmesh/intern/bmesh_mods.c b/source/blender/bmesh/intern/bmesh_mods.c index c383237c1ae..96de00753b5 100644 --- a/source/blender/bmesh/intern/bmesh_mods.c +++ b/source/blender/bmesh/intern/bmesh_mods.c @@ -767,7 +767,8 @@ bool BM_edge_rotate_check_degenerate(BMEdge *e, BMLoop *l1, BMLoop *l2) /* result is zero area corner */ if ((dot_v3v3(ed_dir_new, ed_dir_v1_new) > 0.999f) || - (dot_v3v3(ed_dir_new_flip, ed_dir_v2_new) > 0.999f)) { + (dot_v3v3(ed_dir_new_flip, ed_dir_v2_new) > 0.999f)) + { return false; } @@ -860,7 +861,8 @@ BMEdge *BM_edge_rotate(BMesh *bm, BMEdge *e, const bool ccw, const short check_f * the #BM_edge_rotate_check will ensure this, but its possibly corrupt state or future edits * break this */ if ((l1 = BM_face_vert_share_loop(f, v1)) && (l2 = BM_face_vert_share_loop(f, v2)) && - BM_face_split(bm, f, l1, l2, NULL, NULL, true)) { + BM_face_split(bm, f, l1, l2, NULL, NULL, true)) + { /* we should really be able to know the faces some other way, * rather than fetching them back from the edge, but this is predictable * where using the return values from face split isn't. - campbell */ diff --git a/source/blender/bmesh/intern/bmesh_operators.c b/source/blender/bmesh/intern/bmesh_operators.c index ddecab23ed4..2a704f9b1c9 100644 --- a/source/blender/bmesh/intern/bmesh_operators.c +++ b/source/blender/bmesh/intern/bmesh_operators.c @@ -599,7 +599,8 @@ void BMO_mesh_selected_remap(BMesh *bm, ese->ele = BMO_slot_map_elem_get(slot_elem_map, ese->ele); if (UNLIKELY((ese->ele == NULL) || - (check_select && (BM_elem_flag_test(ese->ele, BM_ELEM_SELECT) == false)))) { + (check_select && (BM_elem_flag_test(ese->ele, BM_ELEM_SELECT) == false)))) + { BLI_remlink(&bm->selected, ese); MEM_freeN(ese); } @@ -823,7 +824,8 @@ static void bmo_slot_buffer_from_hflag(BMesh *bm, if (htype & BM_VERT) { BM_ITER_MESH (ele, &iter, bm, BM_VERTS_OF_MESH) { if ((!respecthide || !BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) && - BM_elem_flag_test_bool(ele, hflag) == test_for_enabled) { + BM_elem_flag_test_bool(ele, hflag) == test_for_enabled) + { output->data.buf[i] = ele; i++; } @@ -833,7 +835,8 @@ static void bmo_slot_buffer_from_hflag(BMesh *bm, if (htype & BM_EDGE) { BM_ITER_MESH (ele, &iter, bm, BM_EDGES_OF_MESH) { if ((!respecthide || !BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) && - BM_elem_flag_test_bool(ele, hflag) == test_for_enabled) { + BM_elem_flag_test_bool(ele, hflag) == test_for_enabled) + { output->data.buf[i] = ele; i++; } @@ -843,7 +846,8 @@ static void bmo_slot_buffer_from_hflag(BMesh *bm, if (htype & BM_FACE) { BM_ITER_MESH (ele, &iter, bm, BM_FACES_OF_MESH) { if ((!respecthide || !BM_elem_flag_test(ele, BM_ELEM_HIDDEN)) && - BM_elem_flag_test_bool(ele, hflag) == test_for_enabled) { + BM_elem_flag_test_bool(ele, hflag) == test_for_enabled) + { output->data.buf[i] = ele; i++; } diff --git a/source/blender/bmesh/intern/bmesh_polygon.c b/source/blender/bmesh/intern/bmesh_polygon.c index 13fde0e8cf4..77fbfe9a335 100644 --- a/source/blender/bmesh/intern/bmesh_polygon.c +++ b/source/blender/bmesh/intern/bmesh_polygon.c @@ -1274,7 +1274,8 @@ void BM_face_splits_check_optimal(BMFace *f, BMLoop *(*loops)[2], int len) for (i = 0; i < len; i++) { BMLoop *l_a_dummy, *l_b_dummy; if (f != BM_vert_pair_share_face_by_angle( - loops[i][0]->v, loops[i][1]->v, &l_a_dummy, &l_b_dummy, false)) { + loops[i][0]->v, loops[i][1]->v, &l_a_dummy, &l_b_dummy, false)) + { loops[i][0] = NULL; } } diff --git a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c index de1ab723b9c..8e3dfe99fd9 100644 --- a/source/blender/bmesh/intern/bmesh_polygon_edgenet.c +++ b/source/blender/bmesh/intern/bmesh_polygon_edgenet.c @@ -325,8 +325,8 @@ static bool bm_face_split_edgenet_find_loop_walk(BMVert *v_init, /* in rare cases there may be edges with a single connecting vertex */ if (e_next != e_first) { do { - if (BM_ELEM_API_FLAG_TEST(e_next, EDGE_NET) && - (bm_edge_flagged_radial_count(e_next) < 2)) { + if (BM_ELEM_API_FLAG_TEST(e_next, EDGE_NET) && (bm_edge_flagged_radial_count(e_next) < 2)) + { BMVert *v_next; v_next = BM_edge_other_vert(e_next, v); @@ -525,13 +525,9 @@ bool BM_face_split_edgenet(BMesh *bm, while ((v = STACK_POP(vert_queue))) { BM_ELEM_API_FLAG_DISABLE(v, VERT_IN_QUEUE); - if (bm_face_split_edgenet_find_loop(v, - f->no, - face_normal_matrix, - edge_order, - edge_order_len, - face_verts, - &face_verts_len)) { + if (bm_face_split_edgenet_find_loop( + v, f->no, face_normal_matrix, edge_order, edge_order_len, face_verts, &face_verts_len)) + { BMFace *f_new; f_new = BM_face_create_verts(bm, face_verts, face_verts_len, f, BM_CREATE_NOP, false); @@ -559,7 +555,8 @@ bool BM_face_split_edgenet(BMesh *bm, do { /* Avoid adding to queue multiple times (not common but happens). */ if (!BM_ELEM_API_FLAG_TEST(l_iter->v, VERT_IN_QUEUE) && - bm_face_split_edgenet_find_loop_pair_exists(l_iter->v)) { + bm_face_split_edgenet_find_loop_pair_exists(l_iter->v)) + { STACK_PUSH(vert_queue, l_iter->v); BM_ELEM_API_FLAG_ENABLE(l_iter->v, VERT_IN_QUEUE); } @@ -823,8 +820,8 @@ static void bvhtree_test_edges_isect_2d_ray_cb(void *user_data, /* direction is normalized, so this will be the distance */ float dist_new; - if (isect_ray_seg_v2( - data->v_origin->co, ray->direction, e->v1->co, e->v2->co, &dist_new, NULL)) { + if (isect_ray_seg_v2(data->v_origin->co, ray->direction, e->v1->co, e->v2->co, &dist_new, NULL)) + { /* avoid float precision issues, possible this is greater, * check above zero to allow some overlap * (and needed for partial-connect which will overlap vertices) */ @@ -895,8 +892,8 @@ static BMEdge *test_edges_isect_2d_vert(const struct EdgeGroup_FindConnection_Ar float t_best = 1.0f; for (uint i = 0; i < args->edge_arr_new_len; i++) { float co_isect[2]; - if (UNLIKELY( - edge_isect_verts_point_2d(args->edge_arr_new[i], v_origin, v_other, co_isect))) { + if (UNLIKELY(edge_isect_verts_point_2d(args->edge_arr_new[i], v_origin, v_other, co_isect))) + { const float t_test = line_point_factor_v2(co_isect, v_origin->co, v_other->co); if (t_test < t_best) { t_best = t_test; @@ -1009,7 +1006,8 @@ static int bm_face_split_edgenet_find_connection(const struct EdgeGroup_FindConn BMVert *v_iter = v_pair[j]; if (BM_elem_flag_test(v_iter, VERT_IS_VALID)) { if (direction_sign ? (v_iter->co[SORT_AXIS] > v_origin->co[SORT_AXIS]) : - (v_iter->co[SORT_AXIS] < v_origin->co[SORT_AXIS])) { + (v_iter->co[SORT_AXIS] < v_origin->co[SORT_AXIS])) + { BLI_SMALLSTACK_PUSH(vert_search, v_iter); BLI_SMALLSTACK_PUSH(vert_blacklist, v_iter); BM_elem_flag_disable(v_iter, VERT_IS_VALID); @@ -1378,7 +1376,8 @@ bool BM_face_split_edgenet_connect_islands(BMesh *bm, struct EdgeGroupIsland **group_arr_p = &group_arr[group_arr_len]; for (struct EdgeGroupIsland *g = (void *)group_head; g; - g = (struct EdgeGroupIsland *)g->edge_links.next) { + g = (struct EdgeGroupIsland *)g->edge_links.next) + { LinkNode *edge_links = g->edge_links.link; /* init with *any* different verts */ diff --git a/source/blender/bmesh/intern/bmesh_query.c b/source/blender/bmesh/intern/bmesh_query.c index e471d4804be..ed779a45620 100644 --- a/source/blender/bmesh/intern/bmesh_query.c +++ b/source/blender/bmesh/intern/bmesh_query.c @@ -223,7 +223,8 @@ static float bm_face_calc_split_dot(BMLoop *l_a, BMLoop *l_b) float no[2][3]; if ((BM_face_calc_normal_subset(l_a, l_b, no[0]) != 0.0f) && - (BM_face_calc_normal_subset(l_b, l_a, no[1]) != 0.0f)) { + (BM_face_calc_normal_subset(l_b, l_a, no[1]) != 0.0f)) + { return dot_v3v3(no[0], no[1]); } return -1.0f; @@ -904,7 +905,8 @@ bool BM_edge_is_contiguous_loop_cd(const BMEdge *e, l_iter_cd_v2 = BM_ELEM_CD_GET_VOID_P(l_iter_v2, cd_loop_offset); if ((CustomData_data_equals(cd_loop_type, l_base_cd_v1, l_iter_cd_v1) == 0) || - (CustomData_data_equals(cd_loop_type, l_base_cd_v2, l_iter_cd_v2) == 0)) { + (CustomData_data_equals(cd_loop_type, l_base_cd_v2, l_iter_cd_v2) == 0)) + { return false; } @@ -1403,7 +1405,8 @@ float BM_vert_calc_edge_angle_ex(const BMVert *v, const float fallback) if ((e1 = v->e) && (e2 = bmesh_disk_edge_next(e1, v)) && (e1 != e2) && /* make sure we come full circle and only have 2 connected edges */ - (e1 == bmesh_disk_edge_next(e2, v))) { + (e1 == bmesh_disk_edge_next(e2, v))) + { BMVert *v1 = BM_edge_other_vert(e1, v); BMVert *v2 = BM_edge_other_vert(e2, v); @@ -1768,7 +1771,8 @@ bool BM_face_exists_multi(BMVert **varr, BMEdge **earr, int len) BM_elem_flag_test(e, BM_ELEM_INTERNAL_TAG) == false && /* ...using boundary verts */ BM_elem_flag_test(e->v1, BM_ELEM_INTERNAL_TAG) && - BM_elem_flag_test(e->v2, BM_ELEM_INTERNAL_TAG)) { + BM_elem_flag_test(e->v2, BM_ELEM_INTERNAL_TAG)) + { int tot_face_tag = 0; BM_ITER_ELEM (f, &fiter, e, BM_FACES_OF_EDGE) { if (BM_elem_flag_test(f, BM_ELEM_INTERNAL_TAG)) { diff --git a/source/blender/bmesh/intern/bmesh_walkers_impl.c b/source/blender/bmesh/intern/bmesh_walkers_impl.c index a112e69fbfa..3ccd7ade8f3 100644 --- a/source/blender/bmesh/intern/bmesh_walkers_impl.c +++ b/source/blender/bmesh/intern/bmesh_walkers_impl.c @@ -932,7 +932,8 @@ static void bmw_EdgeLoopWalker_begin(BMWalker *walker, void *data) /* Without checking the face count, the 3 edges could be this edge * plus two boundary edges (which would not be stepped over), see #84906. */ ((vert_edge_count[0] == 3 && vert_face_count[0] == 3) || - (vert_edge_count[1] == 3 && vert_face_count[1] == 3))) { + (vert_edge_count[1] == 3 && vert_face_count[1] == 3))) + { BMIter iter; BMFace *f_iter; BMFace *f_best = NULL; @@ -1005,7 +1006,8 @@ static void *bmw_EdgeLoopWalker_step(BMWalker *walker) if (bmw_mask_check_edge(walker, nexte) && !BLI_gset_haskey(walker->visit_set, nexte) && /* Never step onto a boundary edge, this gives odd-results. */ - (BM_edge_is_boundary(nexte) == false)) { + (BM_edge_is_boundary(nexte) == false)) + { lwalk = BMW_state_add(walker); lwalk->cur = nexte; lwalk->lastv = v; @@ -1027,7 +1029,8 @@ static void *bmw_EdgeLoopWalker_step(BMWalker *walker) BM_ITER_ELEM (nexte, &eiter, v, BM_EDGES_OF_VERT) { if ((nexte->l == NULL) && bmw_mask_check_edge(walker, nexte) && - !BLI_gset_haskey(walker->visit_set, nexte)) { + !BLI_gset_haskey(walker->visit_set, nexte)) + { lwalk = BMW_state_add(walker); lwalk->cur = nexte; lwalk->lastv = v; @@ -1097,7 +1100,8 @@ static void *bmw_EdgeLoopWalker_step(BMWalker *walker) /* Initial edge was a boundary, so is this edge and vertex is only a part of this face * this lets us walk over the boundary of an ngon which is handy. */ - (owalk.is_single == true && vert_edge_tot == 2 && BM_edge_is_boundary(e))) { + (owalk.is_single == true && vert_edge_tot == 2 && BM_edge_is_boundary(e))) + { /* Find next boundary edge in the fan. */ do { l = BM_loop_other_edge_loop(l, v); diff --git a/source/blender/bmesh/operators/bmo_beautify.c b/source/blender/bmesh/operators/bmo_beautify.c index e21fb5a1f7e..450f6c06d65 100644 --- a/source/blender/bmesh/operators/bmo_beautify.c +++ b/source/blender/bmesh/operators/bmo_beautify.c @@ -53,7 +53,8 @@ void bmo_beautify_fill_exec(BMesh *bm, BMOperator *op) if (BM_edge_rotate_check(e) && /* faces are tagged */ BMO_face_flag_test(bm, e->l->f, FACE_MARK) && - BMO_face_flag_test(bm, e->l->radial_next->f, FACE_MARK)) { + BMO_face_flag_test(bm, e->l->radial_next->f, FACE_MARK)) + { edge_array[edge_array_len] = e; edge_array_len++; } diff --git a/source/blender/bmesh/operators/bmo_bisect_plane.c b/source/blender/bmesh/operators/bmo_bisect_plane.c index e7e130165db..7c4b445b456 100644 --- a/source/blender/bmesh/operators/bmo_bisect_plane.c +++ b/source/blender/bmesh/operators/bmo_bisect_plane.c @@ -72,7 +72,8 @@ void bmo_bisect_plane_exec(BMesh *bm, BMOperator *op) BMO_ITER (v, &siter, op->slots_in, "geom", BM_VERT) { if ((clear_outer && plane_point_side_v3(plane_outer, v->co) > 0.0f) || - (clear_inner && plane_point_side_v3(plane_inner, v->co) < 0.0f)) { + (clear_inner && plane_point_side_v3(plane_inner, v->co) < 0.0f)) + { STACK_PUSH(vert_arr, v); } } diff --git a/source/blender/bmesh/operators/bmo_connect.c b/source/blender/bmesh/operators/bmo_connect.c index 6c784758d85..b9c013a650c 100644 --- a/source/blender/bmesh/operators/bmo_connect.c +++ b/source/blender/bmesh/operators/bmo_connect.c @@ -46,7 +46,8 @@ static int bm_face_connect_verts(BMesh *bm, BMFace *f, const bool check_degenera if (BMO_vert_flag_test(bm, l_iter->v, VERT_INPUT) && /* Ensure this vertex isn't part of a contiguous group. */ ((BMO_vert_flag_test(bm, l_iter->prev->v, VERT_INPUT) == 0) || - (BMO_vert_flag_test(bm, l_iter->next->v, VERT_INPUT) == 0))) { + (BMO_vert_flag_test(bm, l_iter->next->v, VERT_INPUT) == 0))) + { if (!l_tag_prev) { l_tag_prev = l_tag_first = l_iter; continue; @@ -72,7 +73,8 @@ static int bm_face_connect_verts(BMesh *bm, BMFace *f, const bool check_degenera if (!BM_loop_is_adjacent(l_tag_first, l_tag_prev) && /* ensure we don't add the same pair twice */ - (((loops_split[0][0] == l_tag_first) && (loops_split[0][1] == l_tag_prev)) == 0)) { + (((loops_split[0][0] == l_tag_first) && (loops_split[0][1] == l_tag_prev)) == 0)) + { BMLoop **l_pair = STACK_PUSH_RET(loops_split); l_pair[0] = l_tag_first; l_pair[1] = l_tag_prev; @@ -107,7 +109,8 @@ static int bm_face_connect_verts(BMesh *bm, BMFace *f, const bool check_degenera /* Note that duplicate edges in this case is very unlikely but it can happen, see #70287. */ bool edge_exists = (BM_edge_exists(verts_pair[i][0], verts_pair[i][1]) != NULL); if ((l_pair[0] = BM_face_vert_share_loop(f, verts_pair[i][0])) && - (l_pair[1] = BM_face_vert_share_loop(f, verts_pair[i][1]))) { + (l_pair[1] = BM_face_vert_share_loop(f, verts_pair[i][1]))) + { f_new = BM_face_split(bm, f, l_pair[0], l_pair[1], &l_new, NULL, edge_exists); /* Check if duplicate faces have been created, store the loops for removal in this case. diff --git a/source/blender/bmesh/operators/bmo_connect_nonplanar.c b/source/blender/bmesh/operators/bmo_connect_nonplanar.c index 8112844fc8a..31016ca31b7 100644 --- a/source/blender/bmesh/operators/bmo_connect_nonplanar.c +++ b/source/blender/bmesh/operators/bmo_connect_nonplanar.c @@ -73,7 +73,8 @@ static bool bm_face_split_find(BMesh *bm, BMFace *f, BMLoop *l_pair[2], float *r float no_a[3], no_b[3]; if (BM_face_calc_normal_subset(l_a, l_b, no_a) != 0.0f && - BM_face_calc_normal_subset(l_b, l_a, no_b) != 0.0f) { + BM_face_calc_normal_subset(l_b, l_a, no_b) != 0.0f) + { const float err_a = bm_face_subset_calc_planar(l_a, l_b, no_a); const float err_b = bm_face_subset_calc_planar(l_b, l_a, no_b); const float err_test = err_a + err_b; diff --git a/source/blender/bmesh/operators/bmo_dissolve.c b/source/blender/bmesh/operators/bmo_dissolve.c index ab468200e8d..bf279e09f6d 100644 --- a/source/blender/bmesh/operators/bmo_dissolve.c +++ b/source/blender/bmesh/operators/bmo_dissolve.c @@ -85,7 +85,8 @@ static void bm_face_split(BMesh *bm, const short oflag, bool use_edge_delete) BM_ITER_ELEM (l, &liter, v, BM_LOOPS_OF_VERT) { if (l->f->len > 3) { if (BMO_vert_flag_test(bm, l->next->v, oflag) == 0 && - BMO_vert_flag_test(bm, l->prev->v, oflag) == 0) { + BMO_vert_flag_test(bm, l->prev->v, oflag) == 0) + { BM_face_split(bm, l->f, l->next, l->prev, NULL, NULL, true); } } @@ -556,7 +557,8 @@ void bmo_dissolve_degenerate_exec(BMesh *bm, BMOperator *op) /* check edges are not already going to be collapsed */ !BMO_edge_flag_test(bm, l_iter->e, EDGE_COLLAPSE) && - !BMO_edge_flag_test(bm, l_iter->prev->e, EDGE_COLLAPSE))) { + !BMO_edge_flag_test(bm, l_iter->prev->e, EDGE_COLLAPSE))) + { /* test if the faces loop (ear) is degenerate */ float dir_prev[3], len_prev; float dir_next[3], len_next; @@ -580,8 +582,8 @@ void bmo_dissolve_degenerate_exec(BMesh *bm, BMOperator *op) else { /* add a joining edge and tag for removal */ BMLoop *l_split; - if (BM_face_split( - bm, l_iter->f, l_iter->prev, l_iter->next, &l_split, NULL, true)) { + if (BM_face_split(bm, l_iter->f, l_iter->prev, l_iter->next, &l_split, NULL, true)) + { BMO_edge_flag_enable(bm, l_split->e, EDGE_COLLAPSE); found = true; reset = true; diff --git a/source/blender/bmesh/operators/bmo_edgenet.c b/source/blender/bmesh/operators/bmo_edgenet.c index 11095edac02..9fbe4770957 100644 --- a/source/blender/bmesh/operators/bmo_edgenet.c +++ b/source/blender/bmesh/operators/bmo_edgenet.c @@ -80,7 +80,8 @@ static BMEdge *edge_next(BMesh *bm, BMEdge *e) for (i = 0; i < 2; i++) { BM_ITER_ELEM (e2, &iter, i ? e->v2 : e->v1, BM_EDGES_OF_VERT) { if (BMO_edge_flag_test(bm, e2, EDGE_MARK) && - (BMO_edge_flag_test(bm, e2, EDGE_VIS) == false) && (e2 != e)) { + (BMO_edge_flag_test(bm, e2, EDGE_VIS) == false) && (e2 != e)) + { return e2; } } @@ -129,7 +130,8 @@ void bmo_edgenet_prepare_exec(BMesh *bm, BMOperator *op) BMO_ITER (e, &siter, op->slots_in, "edges", BM_EDGE) { if (!BMO_edge_flag_test(bm, e, EDGE_VIS)) { if (BMO_iter_elem_count_flag(bm, BM_EDGES_OF_VERT, e->v1, EDGE_MARK, true) == 1 || - BMO_iter_elem_count_flag(bm, BM_EDGES_OF_VERT, e->v2, EDGE_MARK, true) == 1) { + BMO_iter_elem_count_flag(bm, BM_EDGES_OF_VERT, e->v2, EDGE_MARK, true) == 1) + { break; } } @@ -173,9 +175,11 @@ void bmo_edgenet_prepare_exec(BMesh *bm, BMOperator *op) } if (edges1 && BLI_array_len(edges1) > 2 && - BM_edge_share_vert_check(edges1[0], edges1[BLI_array_len(edges1) - 1])) { + BM_edge_share_vert_check(edges1[0], edges1[BLI_array_len(edges1) - 1])) + { if (edges2 && BLI_array_len(edges2) > 2 && - BM_edge_share_vert_check(edges2[0], edges2[BLI_array_len(edges2) - 1])) { + BM_edge_share_vert_check(edges2[0], edges2[BLI_array_len(edges2) - 1])) + { BLI_array_free(edges1); BLI_array_free(edges2); return; @@ -185,7 +189,8 @@ void bmo_edgenet_prepare_exec(BMesh *bm, BMOperator *op) } if (edges2 && BLI_array_len(edges2) > 2 && - BM_edge_share_vert_check(edges2[0], edges2[BLI_array_len(edges2) - 1])) { + BM_edge_share_vert_check(edges2[0], edges2[BLI_array_len(edges2) - 1])) + { edges2 = NULL; } diff --git a/source/blender/bmesh/operators/bmo_extrude.c b/source/blender/bmesh/operators/bmo_extrude.c index 21b32d48711..076383fc57e 100644 --- a/source/blender/bmesh/operators/bmo_extrude.c +++ b/source/blender/bmesh/operators/bmo_extrude.c @@ -191,7 +191,8 @@ void bmo_extrude_edge_only_exec(BMesh *bm, BMOperator *op) } for (e = BMO_iter_new(&siter, dupeop.slots_out, "boundary_map.out", 0); e; - e = BMO_iter_step(&siter)) { + e = BMO_iter_step(&siter)) + { BMVert *f_verts[4]; e_new = BMO_iter_map_value_ptr(&siter); @@ -455,7 +456,8 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) slot_edges_exclude = BMO_slot_get(op->slots_in, "edges_exclude"); for (e = BMO_iter_new(&siter, dupeop.slots_out, "boundary_map.out", 0); e; - e = BMO_iter_step(&siter)) { + e = BMO_iter_step(&siter)) + { BMVert *f_verts[4]; #ifdef USE_EDGE_REGION_FLAGS BMEdge *f_edges[4]; @@ -581,7 +583,8 @@ void bmo_extrude_face_region_exec(BMesh *bm, BMOperator *op) /* link isolated vert */ for (v = BMO_iter_new(&siter, dupeop.slots_out, "isovert_map.out", 0); v; - v = BMO_iter_step(&siter)) { + v = BMO_iter_step(&siter)) + { BMVert *v2 = BMO_iter_map_value_ptr(&siter); /* not essential, but ensures face normals from extruded edges are contiguous */ diff --git a/source/blender/bmesh/operators/bmo_fill_grid.c b/source/blender/bmesh/operators/bmo_fill_grid.c index 9a2d297e36c..01f251da9b1 100644 --- a/source/blender/bmesh/operators/bmo_fill_grid.c +++ b/source/blender/bmesh/operators/bmo_fill_grid.c @@ -633,8 +633,8 @@ void bmo_grid_fill_exec(BMesh *bm, BMOperator *op) if (BM_mesh_edgeloops_find_path( bm, &eloops_rail, bm_edge_test_rail_cb, bm, v_a_first, v_b_first) && - BM_mesh_edgeloops_find_path( - bm, &eloops_rail, bm_edge_test_rail_cb, bm, v_a_last, v_b_last)) { + BM_mesh_edgeloops_find_path(bm, &eloops_rail, bm_edge_test_rail_cb, bm, v_a_last, v_b_last)) + { estore_rail_a = eloops_rail.first; estore_rail_b = eloops_rail.last; } @@ -644,7 +644,8 @@ void bmo_grid_fill_exec(BMesh *bm, BMOperator *op) if (BM_mesh_edgeloops_find_path( bm, &eloops_rail, bm_edge_test_rail_cb, bm, v_a_first, v_b_last) && BM_mesh_edgeloops_find_path( - bm, &eloops_rail, bm_edge_test_rail_cb, bm, v_a_last, v_b_first)) { + bm, &eloops_rail, bm_edge_test_rail_cb, bm, v_a_last, v_b_first)) + { estore_rail_a = eloops_rail.first; estore_rail_b = eloops_rail.last; BM_edgeloop_flip(bm, estore_b); diff --git a/source/blender/bmesh/operators/bmo_hull.c b/source/blender/bmesh/operators/bmo_hull.c index 2e58b49a9d3..e49fa01b0b1 100644 --- a/source/blender/bmesh/operators/bmo_hull.c +++ b/source/blender/bmesh/operators/bmo_hull.c @@ -71,7 +71,8 @@ static BMFace *hull_find_example_face(BMesh *bm, BMEdge *e) BM_ITER_ELEM (f, &iter, e, BM_FACES_OF_EDGE) { if (BMO_face_flag_test(bm, f, HULL_FLAG_INPUT) || - BMO_face_flag_test(bm, f, HULL_FLAG_OUTPUT_GEOM) == false) { + BMO_face_flag_test(bm, f, HULL_FLAG_OUTPUT_GEOM) == false) + { return f; } } diff --git a/source/blender/bmesh/operators/bmo_inset.c b/source/blender/bmesh/operators/bmo_inset.c index a9e8174f556..26156ff8867 100644 --- a/source/blender/bmesh/operators/bmo_inset.c +++ b/source/blender/bmesh/operators/bmo_inset.c @@ -185,7 +185,8 @@ static void bm_loop_customdata_merge(BMesh *bm, BM_ELEM_CD_GET_VOID_P(l_a_inner, offset), BM_ELEM_CD_GET_VOID_P(l_b_inner, offset)) == false) # endif - ) { + ) + { /* no need to allocate a temp block: * a = (a + b); * a *= 0.5f; @@ -207,7 +208,8 @@ static void bm_loop_customdata_merge(BMesh *bm, /* check if the 2 faces share an edge */ if (is_flip ? (l_b_inner_inset->e == l_a_inner_inset->prev->e) : - (l_a_inner_inset->e == l_b_inner_inset->prev->e)) { + (l_a_inner_inset->e == l_b_inner_inset->prev->e)) + { /* simple case, we have all loops already */ } else { @@ -222,7 +224,8 @@ static void bm_loop_customdata_merge(BMesh *bm, void *data_dst = BM_ELEM_CD_GET_VOID_P(l_iter, offset); if (CustomData_data_equals(type, data_dst, data_cmp_a) || - CustomData_data_equals(type, data_dst, data_cmp_b)) { + CustomData_data_equals(type, data_dst, data_cmp_b)) + { CustomData_data_copy_value(type, data_src, data_dst); } } @@ -721,7 +724,8 @@ void bmo_inset_region_exec(BMesh *bm, BMOperator *op) (use_boundary && BM_edge_is_boundary(e) && BM_elem_flag_test(e->l->f, BM_ELEM_TAG)) || /* tag if edge is an interior edge in between a tagged and untagged face */ - bm_edge_is_mixed_face_tag(e->l)) { + bm_edge_is_mixed_face_tag(e->l)) + { /* tag */ BM_elem_flag_enable(e->v1, BM_ELEM_TAG); BM_elem_flag_enable(e->v2, BM_ELEM_TAG); diff --git a/source/blender/bmesh/operators/bmo_join_triangles.c b/source/blender/bmesh/operators/bmo_join_triangles.c index 3a2216d78a0..e2d267baae0 100644 --- a/source/blender/bmesh/operators/bmo_join_triangles.c +++ b/source/blender/bmesh/operators/bmo_join_triangles.c @@ -137,7 +137,8 @@ static bool bm_edge_is_contiguous_loop_cd_all(const BMEdge *e, { int cd_offset; for (cd_offset = delimit_data->cd_offset; cd_offset < delimit_data->cd_offset_end; - cd_offset += delimit_data->cd_size) { + cd_offset += delimit_data->cd_size) + { if (BM_edge_is_contiguous_loop_cd(e, delimit_data->cd_type, cd_offset) == false) { return false; } @@ -212,7 +213,8 @@ static float bm_edge_is_delimit(const BMEdge *e, const struct DelimitData *delim (fabsf(angle_normalized_v3v3(edge_vecs[2], edge_vecs[3]) - (float)M_PI_2) > delimit_data->angle_shape) || (fabsf(angle_normalized_v3v3(edge_vecs[3], edge_vecs[0]) - (float)M_PI_2) > - delimit_data->angle_shape)) { + delimit_data->angle_shape)) + { goto fail; } } @@ -278,14 +280,16 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op) if (BMO_slot_bool_get(op->slots_in, "cmp_uvs") && bm_edge_delimit_cdata( - &bm->ldata, CD_PROP_FLOAT2, &delimit_data.cdata[delimit_data.cdata_len])) { + &bm->ldata, CD_PROP_FLOAT2, &delimit_data.cdata[delimit_data.cdata_len])) + { delimit_data.cdata_len += 1; } delimit_data.cdata[delimit_data.cdata_len].cd_offset = -1; if (BMO_slot_bool_get(op->slots_in, "cmp_vcols") && bm_edge_delimit_cdata( - &bm->ldata, CD_PROP_BYTE_COLOR, &delimit_data.cdata[delimit_data.cdata_len])) { + &bm->ldata, CD_PROP_BYTE_COLOR, &delimit_data.cdata[delimit_data.cdata_len])) + { delimit_data.cdata_len += 1; } @@ -300,7 +304,8 @@ void bmo_join_triangles_exec(BMesh *bm, BMOperator *op) BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { BMFace *f_a, *f_b; if (BM_edge_face_pair(e, &f_a, &f_b) && - (BMO_face_flag_test(bm, f_a, FACE_INPUT) && BMO_face_flag_test(bm, f_b, FACE_INPUT))) { + (BMO_face_flag_test(bm, f_a, FACE_INPUT) && BMO_face_flag_test(bm, f_b, FACE_INPUT))) + { if (!bm_edge_is_delimit(e, &delimit_data)) { BMO_edge_flag_enable(bm, e, EDGE_MARK); totedge_tag++; diff --git a/source/blender/bmesh/operators/bmo_offset_edgeloops.c b/source/blender/bmesh/operators/bmo_offset_edgeloops.c index b545cd9067a..7c2921020ee 100644 --- a/source/blender/bmesh/operators/bmo_offset_edgeloops.c +++ b/source/blender/bmesh/operators/bmo_offset_edgeloops.c @@ -40,7 +40,8 @@ static BMFace *bm_face_split_walk_back(BMesh *bm, BMLoop *l_src, BMLoop **r_l) int num, i; for (l_dst = l_src->prev, num = 0; BM_elem_index_get(l_dst->prev->v) != -1; - l_dst = l_dst->prev, num++) { + l_dst = l_dst->prev, num++) + { /* pass */ } diff --git a/source/blender/bmesh/operators/bmo_smooth_laplacian.c b/source/blender/bmesh/operators/bmo_smooth_laplacian.c index d19530edae6..a5c0ea2e0d7 100644 --- a/source/blender/bmesh/operators/bmo_smooth_laplacian.c +++ b/source/blender/bmesh/operators/bmo_smooth_laplacian.c @@ -379,7 +379,8 @@ static void validate_solution( leni = len_v3v3(vi1, vi2); lene = len_v3v3(ve1, ve2); if (lene > leni * SMOOTH_LAPLACIAN_MAX_EDGE_PERCENTAGE || - lene < leni * SMOOTH_LAPLACIAN_MIN_EDGE_PERCENTAGE) { + lene < leni * SMOOTH_LAPLACIAN_MIN_EDGE_PERCENTAGE) + { sys->zerola[idv1] = true; sys->zerola[idv2] = true; } @@ -463,7 +464,8 @@ void bmo_smooth_laplacian_vert_exec(BMesh *bm, BMOperator *op) if ((sys->zerola[i] == false) && /* Non zero check is to account for vertices that aren't connected to a selected face. * Without this wire edges become `nan`, see #89214. */ - (sys->ring_areas[i] != 0.0f)) { + (sys->ring_areas[i] != 0.0f)) + { w = sys->vweights[i] * sys->ring_areas[i]; sys->vweights[i] = (w == 0.0f) ? 0.0f : -lambda_factor / (4.0f * w); w = sys->vlengths[i]; diff --git a/source/blender/bmesh/operators/bmo_subdivide.c b/source/blender/bmesh/operators/bmo_subdivide.c index 72509dd4f6c..fe7c81a660b 100644 --- a/source/blender/bmesh/operators/bmo_subdivide.c +++ b/source/blender/bmesh/operators/bmo_subdivide.c @@ -1175,7 +1175,8 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) /* find the boundary of one of the split edges */ for (a = 0; a < vlen; a++) { if (!BMO_vert_flag_test(bm, loops[a ? (a - 1) : (vlen - 1)]->v, ELE_INNER) && - BMO_vert_flag_test(bm, loops[a]->v, ELE_INNER)) { + BMO_vert_flag_test(bm, loops[a]->v, ELE_INNER)) + { break; } } @@ -1190,7 +1191,8 @@ void bmo_subdivide_edges_exec(BMesh *bm, BMOperator *op) for (j = 0; j < vlen; j++) { b = (j + a + numcuts + 1) % vlen; if (!BMO_vert_flag_test(bm, loops[b == 0 ? vlen - 1 : b - 1]->v, ELE_INNER) && - BMO_vert_flag_test(bm, loops[b]->v, ELE_INNER)) { + BMO_vert_flag_test(bm, loops[b]->v, ELE_INNER)) + { break; } } diff --git a/source/blender/bmesh/operators/bmo_subdivide_edgering.c b/source/blender/bmesh/operators/bmo_subdivide_edgering.c index 474b8ad6263..59ddb6d6d93 100644 --- a/source/blender/bmesh/operators/bmo_subdivide_edgering.c +++ b/source/blender/bmesh/operators/bmo_subdivide_edgering.c @@ -624,7 +624,8 @@ static void bm_edgering_pair_interpolate(BMesh *bm, } for (el_store_ring = eloops_ring->first; el_store_ring; - el_store_ring = BM_EDGELOOP_NEXT(el_store_ring)) { + el_store_ring = BM_EDGELOOP_NEXT(el_store_ring)) + { ListBase *lb_ring = BM_edgeloop_verts_get(el_store_ring); LinkData *v_iter; @@ -709,7 +710,8 @@ static void bm_edgering_pair_interpolate(BMesh *bm, tri_end = tri_array[resolu - 1]; for (el_store_ring = eloops_ring->first; el_store_ring; - el_store_ring = BM_EDGELOOP_NEXT(el_store_ring)) { + el_store_ring = BM_EDGELOOP_NEXT(el_store_ring)) + { ListBase *lb_ring = BM_edgeloop_verts_get(el_store_ring); LinkData *v_iter; @@ -718,7 +720,8 @@ static void bm_edgering_pair_interpolate(BMesh *bm, /* skip first and last */ for (v_iter = ((LinkData *)lb_ring->first)->next, i = 1; v_iter != lb_ring->last; - v_iter = v_iter->next, i++) { + v_iter = v_iter->next, i++) + { float co_a[3], co_b[3]; tri_tmp = tri_array[i]; @@ -740,7 +743,8 @@ static void bm_edgering_pair_interpolate(BMesh *bm, /* calculate a bezier handle per edge ring */ for (el_store_ring = eloops_ring->first; el_store_ring; - el_store_ring = BM_EDGELOOP_NEXT(el_store_ring)) { + el_store_ring = BM_EDGELOOP_NEXT(el_store_ring)) + { ListBase *lb_ring = BM_edgeloop_verts_get(el_store_ring); LinkData *v_iter; @@ -790,7 +794,8 @@ static void bm_edgering_pair_interpolate(BMesh *bm, /* skip first and last */ for (v_iter = ((LinkData *)lb_ring->first)->next, i = 1; v_iter != lb_ring->last; - v_iter = v_iter->next, i++) { + v_iter = v_iter->next, i++) + { if (i > 0 && i < resolu - 1) { copy_v3_v3(((BMVert *)v_iter->data)->co, coord_array[i]); @@ -1030,7 +1035,8 @@ static void bm_edgering_pair_subdiv(BMesh *bm, /* Clear tags so subdiv verts don't get tagged too. */ for (el_store_ring = eloops_ring->first; el_store_ring; - el_store_ring = BM_EDGELOOP_NEXT(el_store_ring)) { + el_store_ring = BM_EDGELOOP_NEXT(el_store_ring)) + { bm_edgeloop_vert_tag(el_store_ring, false); } diff --git a/source/blender/bmesh/operators/bmo_utils.c b/source/blender/bmesh/operators/bmo_utils.c index 9109a8eda42..bedba53b4e8 100644 --- a/source/blender/bmesh/operators/bmo_utils.c +++ b/source/blender/bmesh/operators/bmo_utils.c @@ -229,8 +229,8 @@ static void bmo_region_extend_expand(BMesh *bm, BMEdge *e; BM_ITER_ELEM (e, &eiter, v, BM_EDGES_OF_VERT) { if (BM_edge_is_wire(e)) { - if (!BMO_edge_flag_test(bm, e, SEL_FLAG) && - !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) { + if (!BMO_edge_flag_test(bm, e, SEL_FLAG) && !BM_elem_flag_test(e, BM_ELEM_HIDDEN)) + { BMO_edge_flag_enable(bm, e, SEL_FLAG); BMO_vert_flag_enable(bm, BM_edge_other_vert(e, v), SEL_FLAG); } @@ -255,7 +255,8 @@ static void bmo_region_extend_expand(BMesh *bm, BM_ITER_ELEM (f_other, &fiter, l->e, BM_FACES_OF_EDGE) { if (!BMO_face_flag_test(bm, f_other, SEL_ORIG | SEL_FLAG) && - !BM_elem_flag_test(f_other, BM_ELEM_HIDDEN)) { + !BM_elem_flag_test(f_other, BM_ELEM_HIDDEN)) + { BMO_face_flag_enable(bm, f_other, SEL_FLAG); } } @@ -266,7 +267,8 @@ static void bmo_region_extend_expand(BMesh *bm, BM_ITER_ELEM (f_other, &fiter, l->v, BM_FACES_OF_VERT) { if (!BMO_face_flag_test(bm, f_other, SEL_ORIG | SEL_FLAG) && - !BM_elem_flag_test(f_other, BM_ELEM_HIDDEN)) { + !BM_elem_flag_test(f_other, BM_ELEM_HIDDEN)) + { BMO_face_flag_enable(bm, f_other, SEL_FLAG); } } diff --git a/source/blender/bmesh/tools/bmesh_beautify.c b/source/blender/bmesh/tools/bmesh_beautify.c index 3cb5d3513e3..8dc074cc885 100644 --- a/source/blender/bmesh/tools/bmesh_beautify.c +++ b/source/blender/bmesh/tools/bmesh_beautify.c @@ -182,7 +182,8 @@ static float bm_edge_calc_rotate_beauty__area(const float v1[3], * so the rotation calculation is scale independent. */ if (!(signum_i_ex(cross_tri_v2(v2_xy, v3_xy, v4_xy) / no_scale, eps) + - signum_i_ex(cross_tri_v2(v2_xy, v4_xy, v1_xy) / no_scale, eps))) { + signum_i_ex(cross_tri_v2(v2_xy, v4_xy, v1_xy) / no_scale, eps))) + { break; } } diff --git a/source/blender/bmesh/tools/bmesh_bevel.c b/source/blender/bmesh/tools/bmesh_bevel.c index 5118eb792d5..04aa678b6a6 100644 --- a/source/blender/bmesh/tools/bmesh_bevel.c +++ b/source/blender/bmesh/tools/bmesh_bevel.c @@ -775,7 +775,8 @@ static bool contig_ldata_across_edge(BMesh *bm, BMEdge *e, BMFace *f1, BMFace *f for (int i = 0; i < bm->ldata.totlayer; i++) { if (CustomData_layer_has_math(&bm->ldata, i)) { if (!contig_ldata_across_loops(bm, lv1f1, lv1f2, i) || - !contig_ldata_across_loops(bm, lv2f1, lv2f2, i)) { + !contig_ldata_across_loops(bm, lv2f1, lv2f2, i)) + { return false; } } @@ -1843,7 +1844,8 @@ static void move_profile_plane(BoundVert *bndv, BMVert *bmvert) cross_v3_v3v3(no3, d2, pro->proj_dir); if (normalize_v3(no) > BEVEL_EPSILON_BIG && normalize_v3(no2) > BEVEL_EPSILON_BIG && - normalize_v3(no3) > BEVEL_EPSILON_BIG) { + normalize_v3(no3) > BEVEL_EPSILON_BIG) + { float dot2 = dot_v3v3(no, no2); float dot3 = dot_v3v3(no, no3); if (fabsf(dot2) < (1 - BEVEL_EPSILON_BIG) && fabsf(dot3) < (1 - BEVEL_EPSILON_BIG)) { @@ -2273,7 +2275,8 @@ static void check_edge_data_seam_sharp_edges(BevVert *bv, int flag, bool neg) /* First edge with seam or sharp edge data. */ while ((!neg && !BEV_EXTEND_EDGE_DATA_CHECK(e, flag)) || - (neg && BEV_EXTEND_EDGE_DATA_CHECK(e, flag))) { + (neg && BEV_EXTEND_EDGE_DATA_CHECK(e, flag))) + { e = e->next; if (e == efirst) { break; @@ -2295,14 +2298,16 @@ static void check_edge_data_seam_sharp_edges(BevVert *bv, int flag, bool neg) while (((!neg && !BEV_EXTEND_EDGE_DATA_CHECK(ne, flag)) || (neg && BEV_EXTEND_EDGE_DATA_CHECK(ne, flag))) && - ne != efirst) { + ne != efirst) + { if (ne->is_bev) { flag_count++; } ne = ne->next; } if (ne == e || (ne == efirst && ((!neg && !BEV_EXTEND_EDGE_DATA_CHECK(efirst, flag)) || - (neg && BEV_EXTEND_EDGE_DATA_CHECK(efirst, flag))))) { + (neg && BEV_EXTEND_EDGE_DATA_CHECK(efirst, flag))))) + { break; } /* Set seam_len / sharp_len of starting edge. */ @@ -3087,7 +3092,8 @@ static void build_boundary(BevelParams *bp, BevVert *bv, bool construct) * and emiter will be set to the first edge of such an edge. * A miter kind of BEVEL_MITER_SHARP means no special miter */ if ((miter_outer != BEVEL_MITER_SHARP && !emiter && ang_kind == ANGLE_LARGER) || - (miter_inner != BEVEL_MITER_SHARP && ang_kind == ANGLE_SMALLER)) { + (miter_inner != BEVEL_MITER_SHARP && ang_kind == ANGLE_SMALLER)) + { if (ang_kind == ANGLE_LARGER) { emiter = e; } @@ -3160,7 +3166,8 @@ static void build_boundary(BevelParams *bp, BevVert *bv, bool construct) else { /* construct == false. */ AngleKind ang_kind = edges_angle_kind(e, e2, bv->v); if ((miter_outer != BEVEL_MITER_SHARP && !emiter && ang_kind == ANGLE_LARGER) || - (miter_inner != BEVEL_MITER_SHARP && ang_kind == ANGLE_SMALLER)) { + (miter_inner != BEVEL_MITER_SHARP && ang_kind == ANGLE_SMALLER)) + { if (ang_kind == ANGLE_LARGER) { emiter = e; } @@ -4494,7 +4501,8 @@ static int tri_corner_test(BevelParams *bp, BevVert *bv) } float angdiff = fabsf(fabsf(totang) - 3.0f * (float)M_PI_2); if ((bp->pro_super_r == PRO_SQUARE_R && angdiff > (float)M_PI / 16.0f) || - (angdiff > (float)M_PI_4)) { + (angdiff > (float)M_PI_4)) + { return -1; } if (bv->edgecount != 3 || bv->selcount != 3) { @@ -5358,7 +5366,8 @@ static void bevel_build_rings(BevelParams *bp, BMesh *bm, BevVert *bv, BoundVert VMesh *vm1; if (bp->pro_super_r == PRO_SQUARE_R && bv->selcount >= 3 && !odd && - bp->profile_type != BEVEL_PROFILE_CUSTOM) { + bp->profile_type != BEVEL_PROFILE_CUSTOM) + { vm1 = square_out_adj_vmesh(bp, bv); } else if (vpipe) { @@ -6112,7 +6121,8 @@ static int bevel_edge_order_extend(BMesh *bm, BevVert *bv, int i) BM_BEVEL_EDGE_TAG_ENABLE(nextbme); int tryj = bevel_edge_order_extend(bm, bv, j + 1); if (tryj > bestj || - (tryj == bestj && edges_face_connected_at_vert(bv->edges[tryj].e, bv->edges[0].e))) { + (tryj == bestj && edges_face_connected_at_vert(bv->edges[tryj].e, bv->edges[0].e))) + { bestj = tryj; BLI_array_clear(save_path); for (int k = j + 1; k <= bestj; k++) { @@ -6171,7 +6181,8 @@ static bool fast_bevel_edge_order(BevVert *bv) } } if (nsucs == 0 || (nsucs == 2 && j != 1) || nsucs > 2 || - (j == bv->edgecount - 1 && !edges_face_connected_at_vert(bmenext, bv->edges[0].e))) { + (j == bv->edgecount - 1 && !edges_face_connected_at_vert(bmenext, bv->edges[0].e))) + { for (int k = 1; k < j; k++) { BM_BEVEL_EDGE_TAG_DISABLE(bv->edges[k].e); bv->edges[k].e = NULL; @@ -6351,7 +6362,8 @@ static BevVert *bevel_vert_construct(BMesh *bm, BevelParams *bp, BMVert *v) } if ((nsel == 0 && bp->affect_type != BEVEL_AFFECT_VERTICES) || - (tot_edges < 2 && bp->affect_type == BEVEL_AFFECT_VERTICES)) { + (tot_edges < 2 && bp->affect_type == BEVEL_AFFECT_VERTICES)) + { /* Signal this vert isn't being beveled. */ BM_elem_flag_disable(v, BM_ELEM_TAG); return NULL; @@ -6749,8 +6761,8 @@ static bool bev_rebuild_polygon(BMesh *bm, BevelParams *bp, BMFace *f) /* Want to undo seam and smooth for corner segments * if those attrs aren't contiguous around face. */ if (k < n - 1 && ee[k] == ee[k + 1]) { - if (BM_elem_flag_test(ee[k], BM_ELEM_SEAM) && - !BM_elem_flag_test(bme_prev, BM_ELEM_SEAM)) { + if (BM_elem_flag_test(ee[k], BM_ELEM_SEAM) && !BM_elem_flag_test(bme_prev, BM_ELEM_SEAM)) + { BM_elem_flag_disable(bme_new, BM_ELEM_SEAM); } /* Actually want "sharp" to be contiguous, so reverse the test. */ @@ -7806,7 +7818,8 @@ void BM_mesh_bevel(BMesh *bm, /* Get separate non-custom profile samples for the miter profiles if they are needed */ if (bp.profile_type == BEVEL_PROFILE_CUSTOM && - (bp.miter_inner != BEVEL_MITER_SHARP || bp.miter_outer != BEVEL_MITER_SHARP)) { + (bp.miter_inner != BEVEL_MITER_SHARP || bp.miter_outer != BEVEL_MITER_SHARP)) + { set_profile_spacing(&bp, &bp.pro_spacing_miter, false); } diff --git a/source/blender/bmesh/tools/bmesh_bisect_plane.c b/source/blender/bmesh/tools/bmesh_bisect_plane.c index 444f45277ca..52e8a42391f 100644 --- a/source/blender/bmesh/tools/bmesh_bisect_plane.c +++ b/source/blender/bmesh/tools/bmesh_bisect_plane.c @@ -348,7 +348,8 @@ static void bm_face_bisect_verts( /* It would be nice to avoid loop lookup here, * but we need to know which face the verts are in. */ if ((l_a = BM_face_vert_share_loop(face_split_arr[j], v_a)) && - (l_b = BM_face_vert_share_loop(face_split_arr[j], v_b))) { + (l_b = BM_face_vert_share_loop(face_split_arr[j], v_b))) + { found = true; break; } diff --git a/source/blender/bmesh/tools/bmesh_boolean.cc b/source/blender/bmesh/tools/bmesh_boolean.cc index e09b8130f40..5caf47c7235 100644 --- a/source/blender/bmesh/tools/bmesh_boolean.cc +++ b/source/blender/bmesh/tools/bmesh_boolean.cc @@ -112,7 +112,8 @@ static bool bmvert_attached_to_hidden_face(BMVert *bmv) BMIter iter; for (BMFace *bmf = static_cast(BM_iter_new(&iter, nullptr, BM_FACES_OF_VERT, bmv)); bmf; - bmf = static_cast(BM_iter_step(&iter))) { + bmf = static_cast(BM_iter_step(&iter))) + { if (BM_elem_flag_test(bmf, BM_ELEM_HIDDEN)) { return true; } @@ -155,7 +156,8 @@ static bool apply_mesh_output_to_bmesh(BMesh *bm, IMesh &m_out, bool keep_hidden BMVert *bmv = BM_vert_at_index(bm, v); if ((keep_hidden && (BM_elem_flag_test(bmv, BM_ELEM_HIDDEN) || bmvert_attached_to_hidden_face(bmv))) || - bmvert_attached_to_wire(bmv)) { + bmvert_attached_to_wire(bmv)) + { BM_elem_flag_enable(bmv, KEEP_FLAG); } else { diff --git a/source/blender/bmesh/tools/bmesh_decimate_collapse.c b/source/blender/bmesh/tools/bmesh_decimate_collapse.c index 082c5821404..c5d4defa887 100644 --- a/source/blender/bmesh/tools/bmesh_decimate_collapse.c +++ b/source/blender/bmesh/tools/bmesh_decimate_collapse.c @@ -181,7 +181,8 @@ static bool bm_edge_collapse_is_degenerate_flip(BMEdge *e, const float optimize_ /* avoid normalize */ if (dot_v3v3(cross_exist, cross_optim) <= - (len_squared_v3(cross_exist) + len_squared_v3(cross_optim)) * 0.01f) { + (len_squared_v3(cross_exist) + len_squared_v3(cross_optim)) * 0.01f) + { return true; } #else @@ -232,7 +233,8 @@ static void bm_decim_build_edge_cost_single(BMEdge *e, float cost; if (UNLIKELY(vweights && ((vweights[BM_elem_index_get(e->v1)] == 0.0f) || - (vweights[BM_elem_index_get(e->v2)] == 0.0f)))) { + (vweights[BM_elem_index_get(e->v2)] == 0.0f)))) + { goto clear; } @@ -300,7 +302,8 @@ static void bm_decim_build_edge_cost_single(BMEdge *e, } else #endif - if (vweights) { + if (vweights) + { const float e_weight = 2.0f - (vweights[BM_elem_index_get(e->v1)] + vweights[BM_elem_index_get(e->v2)]); if (e_weight) { @@ -372,13 +375,15 @@ static bool bm_edge_symmetry_check_cb(void *user_data, if (dot_v3v3(e_other_dir, sym_data->e_dir) > 0.0f) { if ((len_squared_v3v3(sym_data->e_v1_co, e_other->v1->co) > sym_data->limit_sq) || - (len_squared_v3v3(sym_data->e_v2_co, e_other->v2->co) > sym_data->limit_sq)) { + (len_squared_v3v3(sym_data->e_v2_co, e_other->v2->co) > sym_data->limit_sq)) + { return true; } } else { if ((len_squared_v3v3(sym_data->e_v1_co, e_other->v2->co) > sym_data->limit_sq) || - (len_squared_v3v3(sym_data->e_v2_co, e_other->v1->co) > sym_data->limit_sq)) { + (len_squared_v3v3(sym_data->e_v2_co, e_other->v1->co) > sym_data->limit_sq)) + { return true; } } @@ -620,7 +625,8 @@ static void bm_decim_triangulate_end(BMesh *bm, const int edges_tri_tot) if ((l_a->f->len == 3 && l_b->f->len == 3) && !CAN_LOOP_MERGE(l_a->next) && !CAN_LOOP_MERGE(l_a->prev) && !CAN_LOOP_MERGE(l_b->next) && - !CAN_LOOP_MERGE(l_b->prev)) { + !CAN_LOOP_MERGE(l_b->prev)) + { BMVert *vquad[4] = { e->v1, BM_vert_in_edge(e, l_a->next->v) ? l_a->prev->v : l_a->next->v, @@ -989,7 +995,8 @@ static bool bm_edge_collapse(BMesh *bm, #endif /* not totally common but we want to avoid */ if (ELEM(e_a_other[0], e_b_other[0], e_b_other[1]) || - ELEM(e_a_other[1], e_b_other[0], e_b_other[1])) { + ELEM(e_a_other[1], e_b_other[0], e_b_other[1])) + { return false; } @@ -1173,7 +1180,8 @@ static bool bm_decim_edge_collapse(BMesh *bm, edge_symmetry_map, #endif customdata_flag, - customdata_fac)) { + customdata_fac)) + { /* update collapse info */ int i; @@ -1335,7 +1343,8 @@ void BM_mesh_decimate_collapse(BMesh *bm, { /* simple non-mirror case */ while ((bm->totface > face_tot_target) && (BLI_heap_is_empty(eheap) == false) && - (BLI_heap_top_value(eheap) != COST_INVALID)) { + (BLI_heap_top_value(eheap) != COST_INVALID)) + { // const float value = BLI_heap_node_value(BLI_heap_top(eheap)); BMEdge *e = BLI_heap_pop_min(eheap); float optimize_co[3]; @@ -1364,7 +1373,8 @@ void BM_mesh_decimate_collapse(BMesh *bm, #ifdef USE_SYMMETRY else { while ((bm->totface > face_tot_target) && (BLI_heap_is_empty(eheap) == false) && - (BLI_heap_top_value(eheap) != COST_INVALID)) { + (BLI_heap_top_value(eheap) != COST_INVALID)) + { /** * \note * - `eheap_table[e_index_mirr]` is only removed from the heap at the last moment @@ -1442,7 +1452,8 @@ void BM_mesh_decimate_collapse(BMesh *bm, edge_symmetry_map, customdata_flag, optimize_co, - false)) { + false)) + { if (e_mirr && (eheap_table[e_index_mirr])) { BLI_assert(e_index_mirr != e_index); BLI_heap_remove(eheap, eheap_table[e_index_mirr]); diff --git a/source/blender/bmesh/tools/bmesh_decimate_dissolve.c b/source/blender/bmesh/tools/bmesh_decimate_dissolve.c index 11adeaf5c10..e118496f0c2 100644 --- a/source/blender/bmesh/tools/bmesh_decimate_dissolve.c +++ b/source/blender/bmesh/tools/bmesh_decimate_dissolve.c @@ -73,7 +73,8 @@ static bool bm_edge_is_contiguous_loop_cd_all(const BMEdge *e, int cd_loop_offset; for (cd_loop_offset = delimit_data->cd_loop_offset; cd_loop_offset < delimit_data->cd_loop_offset_end; - cd_loop_offset += delimit_data->cd_loop_size) { + cd_loop_offset += delimit_data->cd_loop_size) + { if (BM_edge_is_contiguous_loop_cd(e, delimit_data->cd_loop_type, cd_loop_offset) == false) { return false; } @@ -199,7 +200,8 @@ static bool bm_loop_collapse_is_degenerate(BMLoop *l_ear) if (!BM_vert_is_edge_pair(l_ear->prev->v)) { mul_v2_m3v3_center(adjacent_2d, axis_mat, l_ear->prev->prev->v->co, center); if (signum_i(cross_tri_v2(adjacent_2d, tri_2d[0], tri_2d[1])) != - signum_i(cross_tri_v2(adjacent_2d, tri_2d[0], tri_2d[2]))) { + signum_i(cross_tri_v2(adjacent_2d, tri_2d[0], tri_2d[2]))) + { return true; } } @@ -207,7 +209,8 @@ static bool bm_loop_collapse_is_degenerate(BMLoop *l_ear) if (!BM_vert_is_edge_pair(l_ear->next->v)) { mul_v2_m3v3_center(adjacent_2d, axis_mat, l_ear->next->next->v->co, center); if (signum_i(cross_tri_v2(adjacent_2d, tri_2d[2], tri_2d[1])) != - signum_i(cross_tri_v2(adjacent_2d, tri_2d[2], tri_2d[0]))) { + signum_i(cross_tri_v2(adjacent_2d, tri_2d[2], tri_2d[0]))) + { return true; } } @@ -330,7 +333,8 @@ void BM_mesh_decimate_dissolve_ex(BMesh *bm, } while ((BLI_heap_is_empty(eheap) == false) && - (BLI_heap_node_value(enode_top = BLI_heap_top(eheap)) < angle_limit_cos_neg)) { + (BLI_heap_node_value(enode_top = BLI_heap_top(eheap)) < angle_limit_cos_neg)) + { BMFace *f_new = NULL; BMEdge *e; @@ -451,7 +455,8 @@ void BM_mesh_decimate_dissolve_ex(BMesh *bm, } while ((BLI_heap_is_empty(vheap) == false) && - (BLI_heap_node_value(vnode_top = BLI_heap_top(vheap)) < angle_limit)) { + (BLI_heap_node_value(vnode_top = BLI_heap_top(vheap)) < angle_limit)) + { BMEdge *e_new = NULL; BMVert *v; @@ -464,7 +469,8 @@ void BM_mesh_decimate_dissolve_ex(BMesh *bm, #else BM_vert_is_edge_pair(v) #endif - ) { + ) + { e_new = BM_vert_collapse_edge(bm, v->e, v, true, true, true); /* join edges */ if (e_new) { diff --git a/source/blender/bmesh/tools/bmesh_decimate_unsubdivide.c b/source/blender/bmesh/tools/bmesh_decimate_unsubdivide.c index 02f0a25ea06..4b874d6d218 100644 --- a/source/blender/bmesh/tools/bmesh_decimate_unsubdivide.c +++ b/source/blender/bmesh/tools/bmesh_decimate_unsubdivide.c @@ -50,7 +50,8 @@ static bool bm_vert_dissolve_fan_test(BMVert *v) if (((tot_edge == 4) && (tot_edge_boundary == 0) && (tot_edge_manifold == 4)) || ((tot_edge == 3) && (tot_edge_boundary == 0) && (tot_edge_manifold == 3)) || - ((tot_edge == 3) && (tot_edge_boundary == 2) && (tot_edge_manifold == 1))) { + ((tot_edge == 3) && (tot_edge_boundary == 2) && (tot_edge_manifold == 1))) + { if (!BM_face_exists(varr, tot_edge)) { return true; } diff --git a/source/blender/bmesh/tools/bmesh_edgenet.c b/source/blender/bmesh/tools/bmesh_edgenet.c index 020f2613f7d..9226af36974 100644 --- a/source/blender/bmesh/tools/bmesh_edgenet.c +++ b/source/blender/bmesh/tools/bmesh_edgenet.c @@ -213,7 +213,8 @@ begin: /* flush flag down the path */ vn_next->flag &= ~VNINFO_FLAG_IS_MIXFACE; if ((vn_curr->flag & VNINFO_FLAG_IS_MIXFACE) || (vn_next->face == -1) || - (vn_next->face != vn_curr->face)) { + (vn_next->face != vn_curr->face)) + { vn_next->flag |= VNINFO_FLAG_IS_MIXFACE; } diff --git a/source/blender/bmesh/tools/bmesh_edgesplit.c b/source/blender/bmesh/tools/bmesh_edgesplit.c index 03ff6b39d0e..bec5df5dd4b 100644 --- a/source/blender/bmesh/tools/bmesh_edgesplit.c +++ b/source/blender/bmesh/tools/bmesh_edgesplit.c @@ -52,7 +52,8 @@ void BM_mesh_edgesplit(BMesh *bm, BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { if (BM_elem_flag_test(e, BM_ELEM_TAG)) { if (UNLIKELY((BM_elem_flag_test(e->v1, BM_ELEM_TAG) == false) && - (BM_elem_flag_test(e->v2, BM_ELEM_TAG) == false))) { + (BM_elem_flag_test(e->v2, BM_ELEM_TAG) == false))) + { BM_elem_flag_enable(e->v1, BM_ELEM_TAG); BM_elem_flag_enable(e->v2, BM_ELEM_TAG); } diff --git a/source/blender/bmesh/tools/bmesh_intersect.c b/source/blender/bmesh/tools/bmesh_intersect.c index 0a668342ab4..ce1ed86e7fc 100644 --- a/source/blender/bmesh/tools/bmesh_intersect.c +++ b/source/blender/bmesh/tools/bmesh_intersect.c @@ -234,7 +234,8 @@ static void face_edges_split(BMesh *bm, use_partial_connect, mem_arena_edgenet, &edge_arr_holes, - &edge_arr_holes_len)) { + &edge_arr_holes_len)) + { edge_arr_len = edge_arr_holes_len; edge_arr = edge_arr_holes; /* owned by the arena */ } @@ -294,8 +295,8 @@ static enum ISectType intersect_line_tri(const float p0[3], copy_v3_v3(ix_pair[1], ix_pair[0]); } - if ((ix_pair_type == 1) || - (len_squared_v3v3(ix_pair[0], ix_pair[1]) <= e->eps_margin_sq)) { + if ((ix_pair_type == 1) || (len_squared_v3v3(ix_pair[0], ix_pair[1]) <= e->eps_margin_sq)) + { fac = line_point_factor_v3(ix_pair[1], t_cos[i_t0], t_cos[i_t1]); if ((fac >= e->eps_margin) && (fac <= 1.0f - e->eps_margin)) { fac = line_point_factor_v3(ix_pair[0], p0, p1); @@ -311,13 +312,14 @@ static enum ISectType intersect_line_tri(const float p0[3], /* check ray isn't planar with tri */ if (fabsf(dot_v3v3(p_dir, t_nor)) >= e->eps) { - if (isect_line_segment_tri_epsilon_v3( - p0, p1, t_cos[0], t_cos[1], t_cos[2], &fac, NULL, 0.0f)) { + if (isect_line_segment_tri_epsilon_v3(p0, p1, t_cos[0], t_cos[1], t_cos[2], &fac, NULL, 0.0f)) + { if ((fac >= e->eps_margin) && (fac <= 1.0f - e->eps_margin)) { interp_v3_v3v3(r_ix, p0, p1, fac); if (min_fff(len_squared_v3v3(t_cos[0], r_ix), len_squared_v3v3(t_cos[1], r_ix), - len_squared_v3v3(t_cos[2], r_ix)) >= e->eps_margin_sq) { + len_squared_v3v3(t_cos[2], r_ix)) >= e->eps_margin_sq) + { return IX_EDGE_TRI; } } @@ -513,7 +515,8 @@ static void bm_isect_tri_tri( if (no_shared) { if (UNLIKELY(ELEM(fv_a[0], UNPACK3(fv_b)) || ELEM(fv_a[1], UNPACK3(fv_b)) || - ELEM(fv_a[2], UNPACK3(fv_b)))) { + ELEM(fv_a[2], UNPACK3(fv_b)))) + { return; } } @@ -580,7 +583,8 @@ static void bm_isect_tri_tri( uint i_b_e1 = (i_b_e0 + 1) % 3; if (BM_ELEM_API_FLAG_TEST(fv_b[i_b_e0], VERT_VISIT_B) || - BM_ELEM_API_FLAG_TEST(fv_b[i_b_e1], VERT_VISIT_B)) { + BM_ELEM_API_FLAG_TEST(fv_b[i_b_e1], VERT_VISIT_B)) + { continue; } @@ -622,7 +626,8 @@ static void bm_isect_tri_tri( uint i_a_e1 = (i_a_e0 + 1) % 3; if (BM_ELEM_API_FLAG_TEST(fv_a[i_a_e0], VERT_VISIT_A) || - BM_ELEM_API_FLAG_TEST(fv_a[i_a_e1], VERT_VISIT_A)) { + BM_ELEM_API_FLAG_TEST(fv_a[i_a_e1], VERT_VISIT_A)) + { continue; } @@ -732,7 +737,8 @@ static void bm_isect_tri_tri( BMVert *iv; if (BM_ELEM_API_FLAG_TEST(fv_a[i_a_e0], VERT_VISIT_A) || - BM_ELEM_API_FLAG_TEST(fv_a[i_a_e1], VERT_VISIT_A)) { + BM_ELEM_API_FLAG_TEST(fv_a[i_a_e1], VERT_VISIT_A)) + { continue; } @@ -753,7 +759,8 @@ static void bm_isect_tri_tri( BMVert *iv; if (BM_ELEM_API_FLAG_TEST(fv_b[i_b_e0], VERT_VISIT_B) || - BM_ELEM_API_FLAG_TEST(fv_b[i_b_e1], VERT_VISIT_B)) { + BM_ELEM_API_FLAG_TEST(fv_b[i_b_e1], VERT_VISIT_B)) + { continue; } @@ -855,7 +862,8 @@ static void raycast_callback(void *userdata, # else isect_ray_tri_epsilon_v3(ray->origin, ray->direction, v0, v1, v2, &dist, NULL, FLT_EPSILON) # endif - ) { + ) + { if (dist >= 0.0f) { # ifdef USE_DUMP printf("%s:\n", __func__); @@ -1194,7 +1202,8 @@ bool BM_mesh_intersect(BMesh *bm, BLI_assert(BM_vert_in_edge(e, v_end)); if (!BM_edge_exists(v_prev, vi) && !BM_vert_splice_check_double(v_prev, vi) && - !BM_vert_pair_share_face_check(v_prev, vi)) { + !BM_vert_pair_share_face_check(v_prev, vi)) + { BM_vert_splice(bm, vi, v_prev); } else { @@ -1409,7 +1418,8 @@ bool BM_mesh_intersect(BMesh *bm, uint i; for (i = 0; i < STACK_SIZE(splice_ls); i++) { if (!BLI_gset_haskey(verts_invalid, splice_ls[i][0]) && - !BLI_gset_haskey(verts_invalid, splice_ls[i][1])) { + !BLI_gset_haskey(verts_invalid, splice_ls[i][1])) + { if (!BM_edge_exists(UNPACK2(splice_ls[i])) && !BM_vert_splice_check_double(UNPACK2(splice_ls[i]))) { BM_vert_splice(bm, splice_ls[i][1], splice_ls[i][0]); diff --git a/source/blender/bmesh/tools/bmesh_intersect_edges.c b/source/blender/bmesh/tools/bmesh_intersect_edges.c index fbd27bda766..b1ade4fab6c 100644 --- a/source/blender/bmesh/tools/bmesh_intersect_edges.c +++ b/source/blender/bmesh/tools/bmesh_intersect_edges.c @@ -408,7 +408,8 @@ static bool bm_edgexedge_isect_cb(void *userdata, int index_a, int index_b, int if (isect_ray_ray_epsilon_v3(co_a, dir_a, co_b, dir_b, data->dist_sq_sq, &lambda_a, &lambda_b)) { struct EDBMSplitElem pair_tmp[2]; if (bm_edgexedge_isect_impl( - data, e_a, e_b, co_a, dir_a, co_b, dir_b, lambda_a, lambda_b, pair_tmp)) { + data, e_a, e_b, co_a, dir_a, co_b, dir_b, lambda_a, lambda_b, pair_tmp)) + { struct EDBMSplitElem *pair = BLI_stack_push_r(data->pair_stack[thread]); pair[0] = pair_tmp[0]; pair[1] = pair_tmp[1]; @@ -569,8 +570,8 @@ bool BM_mesh_intersect_edges( /* Tag and count the edges. */ int edges_act_len = 0, edges_remain_len = 0; BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) { - if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) || - (len_squared_v3v3(e->v1->co, e->v2->co) < dist_sq)) { + if (BM_elem_flag_test(e, BM_ELEM_HIDDEN) || (len_squared_v3v3(e->v1->co, e->v2->co) < dist_sq)) + { /* Don't test hidden edges or smaller than the minimum distance. * These have already been handled in the vertices overlap. */ BM_elem_index_set(e, 0); diff --git a/source/blender/bmesh/tools/bmesh_path_region.c b/source/blender/bmesh/tools/bmesh_path_region.c index 5b86b06aa50..c089577a3bc 100644 --- a/source/blender/bmesh/tools/bmesh_path_region.c +++ b/source/blender/bmesh/tools/bmesh_path_region.c @@ -80,7 +80,8 @@ static bool bm_vert_region_test_chain(BMVert *v, int *const depths[2], const int } if (BM_vert_is_edge_pair_manifold(v) && bm_vert_pair_ends(v, v_end_pair) && bm_vert_region_test(v_end_pair[0], depths, pass) && - bm_vert_region_test(v_end_pair[1], depths, pass)) { + bm_vert_region_test(v_end_pair[1], depths, pass)) + { return true; } diff --git a/source/blender/bmesh/tools/bmesh_path_region_uv.c b/source/blender/bmesh/tools/bmesh_path_region_uv.c index 25637fae949..b5a1eca77c2 100644 --- a/source/blender/bmesh/tools/bmesh_path_region_uv.c +++ b/source/blender/bmesh/tools/bmesh_path_region_uv.c @@ -78,7 +78,8 @@ static bool bm_loop_region_test_chain(BMLoop *l, int *const depths[2], const int } if (BM_vert_is_edge_pair_manifold(l->v) && bm_loop_pair_ends(l, l_end_pair) && bm_loop_region_test(l_end_pair[0], depths, pass) && - bm_loop_region_test(l_end_pair[1], depths, pass)) { + bm_loop_region_test(l_end_pair[1], depths, pass)) + { return true; } @@ -249,7 +250,8 @@ static LinkNode *mesh_calc_path_region_elem(BMesh *bm, while (BM_vert_is_edge_pair_manifold(l_b->v) && ((depths[side][l_b_index] == -1) && /* Don't walk back to the beginning */ - (l_b != (j ? l_iter->prev : l_iter->next)))) { + (l_b != (j ? l_iter->prev : l_iter->next)))) + { depths[side][l_b_index] = pass; l_b = j ? l_b->next : l_b->prev; diff --git a/source/blender/bmesh/tools/bmesh_region_match.c b/source/blender/bmesh/tools/bmesh_region_match.c index fe16c098c21..119dbc4d04d 100644 --- a/source/blender/bmesh/tools/bmesh_region_match.c +++ b/source/blender/bmesh/tools/bmesh_region_match.c @@ -499,7 +499,8 @@ static void bm_uuidwalk_pass_add(UUIDWalk *uuidwalk, void **val_p; if (!BLI_ghash_haskey(uuidwalk->verts_uuid, l_iter->v) && !BLI_ghash_ensure_p(verts_uuid_pass, l_iter->v, &val_p) && - (bm_vert_is_uuid_connect(uuidwalk, l_iter->v) == true)) { + (bm_vert_is_uuid_connect(uuidwalk, l_iter->v) == true)) + { const UUID_Int uuid = bm_uuidwalk_calc_vert_uuid(uuidwalk, l_iter->v); *val_p = (void *)uuid; } @@ -510,7 +511,8 @@ static void bm_uuidwalk_pass_add(UUIDWalk *uuidwalk, do { if (!BLI_ghash_haskey(uuidwalk->faces_uuid, l_iter_radial->f) && !BLI_gset_haskey(faces_step_next, l_iter_radial->f) && - bm_uuidwalk_face_test(uuidwalk, l_iter_radial->f)) { + bm_uuidwalk_face_test(uuidwalk, l_iter_radial->f)) + { BLI_gset_insert(faces_step_next, l_iter_radial->f); /* add to fstep */ @@ -771,13 +773,15 @@ static BMFace **bm_mesh_region_match_pair( UUIDFaceStepItem *fstep_item_dst; for (fstep_item_src = fstep_src->items.first, fstep_item_dst = fstep_dst->items.first; fstep_item_src && fstep_item_dst; - fstep_item_src = fstep_item_src->next, fstep_item_dst = fstep_item_dst->next) { + fstep_item_src = fstep_item_src->next, fstep_item_dst = fstep_item_dst->next) + { while ((fstep_item_dst != NULL) && (fstep_item_dst->uuid < fstep_item_src->uuid)) { fstep_item_dst = fstep_item_dst->next; } if ((fstep_item_dst == NULL) || (fstep_item_src->uuid != fstep_item_dst->uuid) || - (fstep_item_src->list_len > fstep_item_dst->list_len)) { + (fstep_item_src->list_len > fstep_item_dst->list_len)) + { /* if the target walker has less than the source * then the islands don't match, bail early */ ok = false; @@ -935,7 +939,8 @@ static void bm_face_region_pivot_edge_use_best(GHash *gh, if ((*r_e_pivot_best == NULL) || ((e_pivot_best_id[0] != e_pivot_test_id[0]) ? (e_pivot_best_id[0] < e_pivot_test_id[0]) : - (e_pivot_best_id[1] < e_pivot_test_id[1]))) { + (e_pivot_best_id[1] < e_pivot_test_id[1]))) + { e_pivot_best_id[0] = e_pivot_test_id[0]; e_pivot_best_id[1] = e_pivot_test_id[1]; diff --git a/source/blender/compositor/intern/COM_ConstantFolder.cc b/source/blender/compositor/intern/COM_ConstantFolder.cc index 5cbacd5376f..8cda97a13bc 100644 --- a/source/blender/compositor/intern/COM_ConstantFolder.cc +++ b/source/blender/compositor/intern/COM_ConstantFolder.cc @@ -26,7 +26,8 @@ static bool is_constant_foldable(NodeOperation *operation) for (int i = 0; i < operation->get_number_of_input_sockets(); i++) { NodeOperation *input = operation->get_input_operation(i); if (!input->get_flags().is_constant_operation || - !static_cast(input)->can_get_constant_elem()) { + !static_cast(input)->can_get_constant_elem()) + { return false; } } diff --git a/source/blender/compositor/intern/COM_ExecutionGroup.cc b/source/blender/compositor/intern/COM_ExecutionGroup.cc index 7ec204bf862..0044494091a 100644 --- a/source/blender/compositor/intern/COM_ExecutionGroup.cc +++ b/source/blender/compositor/intern/COM_ExecutionGroup.cc @@ -103,7 +103,8 @@ bool ExecutionGroup::add_operation(NodeOperation *operation) } if (!operation->get_flags().is_read_buffer_operation && - !operation->get_flags().is_write_buffer_operation) { + !operation->get_flags().is_write_buffer_operation) + { flags_.complex = operation->get_flags().complex; flags_.open_cl = operation->get_flags().open_cl; flags_.single_threaded = operation->get_flags().single_threaded; @@ -323,7 +324,8 @@ void ExecutionGroup::execute(ExecutionSystem *graph) int number_evaluated = 0; for (int index = start_index; index < chunks_len_ && number_evaluated < max_number_evaluated; - index++) { + index++) + { chunk_index = chunk_order[index]; int y_chunk = chunk_index / x_chunks_len_; int x_chunk = chunk_index - (y_chunk * x_chunks_len_); diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.cc b/source/blender/compositor/intern/COM_MemoryBuffer.cc index 539e1179bc8..edff127c6c0 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.cc +++ b/source/blender/compositor/intern/COM_MemoryBuffer.cc @@ -208,7 +208,8 @@ void MemoryBuffer::copy_from(const MemoryBuffer *src, copy_single_elem_from(src, channel_offset, elem_size, to_channel_offset); } else if (!src->is_a_single_elem() && elem_size == src->get_num_channels() && - elem_size == this->get_num_channels()) { + elem_size == this->get_num_channels()) + { BLI_assert(to_channel_offset == 0); BLI_assert(channel_offset == 0); copy_rows_from(src, area, to_x, to_y); diff --git a/source/blender/compositor/intern/COM_MemoryBuffer.h b/source/blender/compositor/intern/COM_MemoryBuffer.h index 701ef9679c9..19c403ab105 100644 --- a/source/blender/compositor/intern/COM_MemoryBuffer.h +++ b/source/blender/compositor/intern/COM_MemoryBuffer.h @@ -535,7 +535,8 @@ class MemoryBuffer { float v = y; this->wrap_pixel(u, v, extend_x, extend_y); if ((extend_x != MemoryBufferExtend::Repeat && (u < 0.0f || u >= get_width())) || - (extend_y != MemoryBufferExtend::Repeat && (v < 0.0f || v >= get_height()))) { + (extend_y != MemoryBufferExtend::Repeat && (v < 0.0f || v >= get_height()))) + { copy_vn_fl(result, num_channels_, 0.0f); return; } diff --git a/source/blender/compositor/intern/COM_NodeGraph.cc b/source/blender/compositor/intern/COM_NodeGraph.cc index c4f840cde4e..008a5a8dbec 100644 --- a/source/blender/compositor/intern/COM_NodeGraph.cc +++ b/source/blender/compositor/intern/COM_NodeGraph.cc @@ -151,7 +151,8 @@ void NodeGraph::add_bNodeLink(const NodeRange &node_range, bNodeLink *b_nodelink return; } if ((b_nodelink->fromsock->flag & SOCK_UNAVAIL) || (b_nodelink->tosock->flag & SOCK_UNAVAIL) || - (b_nodelink->flag & NODE_LINK_MUTED)) { + (b_nodelink->flag & NODE_LINK_MUTED)) + { return; } @@ -219,7 +220,8 @@ void NodeGraph::add_proxies_group_inputs(bNode *b_node, bNode *b_node_io) bool is_active_group = false; for (bNodeSocket *b_sock_io = (bNodeSocket *)b_node_io->outputs.first; b_sock_io; - b_sock_io = b_sock_io->next) { + b_sock_io = b_sock_io->next) + { bNodeSocket *b_sock_group = find_b_node_input(b_node, b_sock_io->identifier); if (b_sock_group) { SocketProxyNode *proxy = new SocketProxyNode(b_node_io, b_sock_group, b_sock_io, true); @@ -240,11 +242,13 @@ void NodeGraph::add_proxies_group_outputs(const CompositorContext &context, bool is_active_group = false; for (bNodeSocket *b_sock_io = (bNodeSocket *)b_node_io->inputs.first; b_sock_io; - b_sock_io = b_sock_io->next) { + b_sock_io = b_sock_io->next) + { bNodeSocket *b_sock_group = find_b_node_output(b_node, b_sock_io->identifier); if (b_sock_group) { if (context.is_groupnode_buffer_enabled() && - context.get_execution_model() == eExecutionModel::Tiled) { + context.get_execution_model() == eExecutionModel::Tiled) + { SocketBufferNode *buffer = new SocketBufferNode(b_node_io, b_sock_io, b_sock_group); add_node(buffer, b_group_tree, key, is_active_group); } diff --git a/source/blender/compositor/intern/COM_NodeOperation.cc b/source/blender/compositor/intern/COM_NodeOperation.cc index ab9b5ad1ad6..39e8bf8fe80 100644 --- a/source/blender/compositor/intern/COM_NodeOperation.cc +++ b/source/blender/compositor/intern/COM_NodeOperation.cc @@ -225,8 +225,9 @@ bool NodeOperation::determine_depending_area_of_interest(rcti *input, bool first = true; for (int i = 0; i < get_number_of_input_sockets(); i++) { NodeOperation *input_operation = this->get_input_operation(i); - if (input_operation && input_operation->determine_depending_area_of_interest( - input, read_operation, &temp_output)) { + if (input_operation && + input_operation->determine_depending_area_of_interest(input, read_operation, &temp_output)) + { if (first) { output->xmin = temp_output.xmin; output->ymin = temp_output.ymin; diff --git a/source/blender/compositor/intern/COM_NodeOperationBuilder.cc b/source/blender/compositor/intern/COM_NodeOperationBuilder.cc index 9a98e191d4f..e33794f2a01 100644 --- a/source/blender/compositor/intern/COM_NodeOperationBuilder.cc +++ b/source/blender/compositor/intern/COM_NodeOperationBuilder.cc @@ -385,7 +385,8 @@ void NodeOperationBuilder::resolve_proxies() for (const Link &link : links_) { /* don't replace links from proxy to proxy, since we may need them for replacing others! */ if (link.from()->get_operation().get_flags().is_proxy_operation && - !link.to()->get_operation().get_flags().is_proxy_operation) { + !link.to()->get_operation().get_flags().is_proxy_operation) + { proxy_links.append(link); } } @@ -413,8 +414,8 @@ void NodeOperationBuilder::determine_canvases() /* Determine all canvas areas of the operations. */ const rcti &preferred_area = COM_AREA_NONE; for (NodeOperation *op : operations_) { - if (op->is_output_operation(context_->is_rendering()) && - !op->get_flags().is_preview_operation) { + if (op->is_output_operation(context_->is_rendering()) && !op->get_flags().is_preview_operation) + { rcti canvas = COM_AREA_NONE; op->determine_canvas(preferred_area, canvas); op->set_canvas(canvas); @@ -422,8 +423,8 @@ void NodeOperationBuilder::determine_canvases() } for (NodeOperation *op : operations_) { - if (op->is_output_operation(context_->is_rendering()) && - op->get_flags().is_preview_operation) { + if (op->is_output_operation(context_->is_rendering()) && op->get_flags().is_preview_operation) + { rcti canvas = COM_AREA_NONE; op->determine_canvas(preferred_area, canvas); op->set_canvas(canvas); diff --git a/source/blender/compositor/intern/COM_WorkScheduler.cc b/source/blender/compositor/intern/COM_WorkScheduler.cc index 539d23ff6b5..56ac192724e 100644 --- a/source/blender/compositor/intern/COM_WorkScheduler.cc +++ b/source/blender/compositor/intern/COM_WorkScheduler.cc @@ -129,7 +129,8 @@ static void opencl_start(const CompositorContext &context) static bool opencl_schedule(WorkPackage *package) { if (package->type == eWorkPackageType::Tile && package->execution_group->get_flags().open_cl && - g_work_scheduler.opencl.active) { + g_work_scheduler.opencl.active) + { BLI_thread_queue_push(g_work_scheduler.opencl.queue, package); return true; } diff --git a/source/blender/compositor/nodes/COM_ConvertColorSpaceNode.cc b/source/blender/compositor/nodes/COM_ConvertColorSpaceNode.cc index d26b649e30b..a0f6d946770 100644 --- a/source/blender/compositor/nodes/COM_ConvertColorSpaceNode.cc +++ b/source/blender/compositor/nodes/COM_ConvertColorSpaceNode.cc @@ -71,7 +71,8 @@ bool ConvertColorSpaceNode::performs_conversion(NodeConvertColorSpace &settings) } if (STREQLEN( - settings.from_color_space, settings.to_color_space, sizeof(settings.from_color_space))) { + settings.from_color_space, settings.to_color_space, sizeof(settings.from_color_space))) + { CLOG_INFO(&LOG, 2, "Color space conversion bypassed for node: %s. To and from are the same: %s.", diff --git a/source/blender/compositor/nodes/COM_CryptomatteNode.cc b/source/blender/compositor/nodes/COM_CryptomatteNode.cc index ee31fce0ea8..74b709099ed 100644 --- a/source/blender/compositor/nodes/COM_CryptomatteNode.cc +++ b/source/blender/compositor/nodes/COM_CryptomatteNode.cc @@ -171,7 +171,8 @@ void CryptomatteNode::input_operations_from_image_source( int layer_index; LISTBASE_FOREACH_INDEX (RenderLayer *, render_layer, &image->rr->layers, layer_index) { if (!blender::StringRef(prefix).startswith(blender::StringRef( - render_layer->name, BLI_strnlen(render_layer->name, sizeof(render_layer->name))))) { + render_layer->name, BLI_strnlen(render_layer->name, sizeof(render_layer->name))))) + { continue; } LISTBASE_FOREACH (RenderPass *, render_pass, &render_layer->passes) { diff --git a/source/blender/compositor/nodes/COM_MaskNode.cc b/source/blender/compositor/nodes/COM_MaskNode.cc index e078d12921e..647d4cabaee 100644 --- a/source/blender/compositor/nodes/COM_MaskNode.cc +++ b/source/blender/compositor/nodes/COM_MaskNode.cc @@ -45,7 +45,8 @@ void MaskNode::convert_to_operations(NodeConverter &converter, operation->set_feather(bool(editor_node->custom1 & CMP_NODE_MASK_FLAG_NO_FEATHER) == 0); if ((editor_node->custom1 & CMP_NODE_MASK_FLAG_MOTION_BLUR) && (editor_node->custom2 > 1) && - (editor_node->custom3 > FLT_EPSILON)) { + (editor_node->custom3 > FLT_EPSILON)) + { operation->set_motion_blur_samples(editor_node->custom2); operation->set_motion_blur_shutter(editor_node->custom3); } diff --git a/source/blender/compositor/operations/COM_AntiAliasOperation.cc b/source/blender/compositor/operations/COM_AntiAliasOperation.cc index e0083b702e1..ffee95146d5 100644 --- a/source/blender/compositor/operations/COM_AntiAliasOperation.cc +++ b/source/blender/compositor/operations/COM_AntiAliasOperation.cc @@ -140,7 +140,8 @@ void AntiAliasOperation::execute_pixel(float output[4], int x, int y, void *data &row_curr[x + 1], &row_next[x - 1], &row_next[x], - &row_next[x + 1])) { + &row_next[x + 1])) + { /* Some rounding magic to so make weighting correct with the * original coefficients. */ @@ -207,9 +208,11 @@ void AntiAliasOperation::update_memory_buffer_partial(MemoryBuffer *output, const float *row_next = row_curr + input->row_stride; int x_offset = 0; for (int x = area.xmin; x < area.xmax; - x++, out += output->elem_stride, x_offset += input->elem_stride) { + x++, out += output->elem_stride, x_offset += input->elem_stride) + { if (x == input_area.xmin || x == input_area.xmax - 1 || y == input_area.xmin || - y == input_area.ymax - 1) { + y == input_area.ymax - 1) + { out[0] = row_curr[x_offset]; continue; } @@ -231,7 +234,8 @@ void AntiAliasOperation::update_memory_buffer_partial(MemoryBuffer *output, &row_curr[x_offset + input->elem_stride], &row_next[x_offset - input->elem_stride], &row_next[x_offset], - &row_next[x_offset + input->elem_stride])) { + &row_next[x_offset + input->elem_stride])) + { /* Some rounding magic to make weighting correct with the * original coefficients. */ uchar result = ((3 * ninepix[0] + 5 * ninepix[1] + 3 * ninepix[2] + 5 * ninepix[3] + diff --git a/source/blender/compositor/operations/COM_BokehImageOperation.cc b/source/blender/compositor/operations/COM_BokehImageOperation.cc index b74ac9dac64..e4cecb5901f 100644 --- a/source/blender/compositor/operations/COM_BokehImageOperation.cc +++ b/source/blender/compositor/operations/COM_BokehImageOperation.cc @@ -56,12 +56,14 @@ float BokehImageOperation::is_inside_bokeh(float distance, float x, float y) const float catadioptric_distance_to_center = distance_rounding_to_center * data_->catadioptric; if (distance_rounding_to_center >= distance_to_center && - catadioptric_distance_to_center <= distance_to_center) { + catadioptric_distance_to_center <= distance_to_center) + { if (distance_rounding_to_center - distance_to_center < 1.0f) { inside_bokeh = (distance_rounding_to_center - distance_to_center); } else if (data_->catadioptric != 0.0f && - distance_to_center - catadioptric_distance_to_center < 1.0f) { + distance_to_center - catadioptric_distance_to_center < 1.0f) + { inside_bokeh = (distance_to_center - catadioptric_distance_to_center); } else { diff --git a/source/blender/compositor/operations/COM_ColorMatteOperation.cc b/source/blender/compositor/operations/COM_ColorMatteOperation.cc index 41bf91634cd..a203a5541f5 100644 --- a/source/blender/compositor/operations/COM_ColorMatteOperation.cc +++ b/source/blender/compositor/operations/COM_ColorMatteOperation.cc @@ -59,7 +59,8 @@ void ColorMatteOperation::execute_pixel_sampled(float output[4], * otherwise 0.5 would key all hue's */ /* hue */ - ((h_wrap = 2.0f * fabsf(in_color[0] - in_key[0])) < hue || (2.0f - h_wrap) < hue)) { + ((h_wrap = 2.0f * fabsf(in_color[0] - in_key[0])) < hue || (2.0f - h_wrap) < hue)) + { output[0] = 0.0f; /* make transparent */ } @@ -94,7 +95,8 @@ void ColorMatteOperation::update_memory_buffer_partial(MemoryBuffer *output, * otherwise 0.5 would key all hue's. */ /* #hue */ - ((h_wrap = 2.0f * fabsf(in_color[0] - in_key[0])) < hue || (2.0f - h_wrap) < hue)) { + ((h_wrap = 2.0f * fabsf(in_color[0] - in_key[0])) < hue || (2.0f - h_wrap) < hue)) + { it.out[0] = 0.0f; /* Make transparent. */ } diff --git a/source/blender/compositor/operations/COM_ConvertColorSpaceOperation.cc b/source/blender/compositor/operations/COM_ConvertColorSpaceOperation.cc index 3d19f13c8b0..c21dd6f27cf 100644 --- a/source/blender/compositor/operations/COM_ConvertColorSpaceOperation.cc +++ b/source/blender/compositor/operations/COM_ConvertColorSpaceOperation.cc @@ -21,7 +21,8 @@ void ConvertColorSpaceOperation::set_settings(NodeConvertColorSpace *node_color_ void ConvertColorSpaceOperation::init_execution() { if (BLI_strnlen(settings_->from_color_space, sizeof(settings_->from_color_space)) == 0 || - BLI_strnlen(settings_->to_color_space, sizeof(settings_->to_color_space)) == 0) { + BLI_strnlen(settings_->to_color_space, sizeof(settings_->to_color_space)) == 0) + { return; } diff --git a/source/blender/compositor/operations/COM_DespeckleOperation.cc b/source/blender/compositor/operations/COM_DespeckleOperation.cc index a0c82ad531c..1609132e4f5 100644 --- a/source/blender/compositor/operations/COM_DespeckleOperation.cc +++ b/source/blender/compositor/operations/COM_DespeckleOperation.cc @@ -103,7 +103,8 @@ void DespeckleOperation::execute_pixel(float output[4], int x, int y, void * /*d // mul_v4_fl(color_mid, 1.0f / w); if ((w != 0.0f) && ((w / WTOT) > (threshold_neighbor_)) && - color_diff(color_mid, color_org, threshold_)) { + color_diff(color_mid, color_org, threshold_)) + { mul_v4_fl(color_mid_ok, 1.0f / w); interp_v4_v4v4(output, color_org, color_mid_ok, value[0]); } @@ -218,7 +219,8 @@ void DespeckleOperation::update_memory_buffer_partial(MemoryBuffer *output, // mul_v4_fl(color_mid, 1.0f / w); if ((w != 0.0f) && ((w / WTOT) > (threshold_neighbor_)) && - color_diff(color_mid, color_org, threshold_)) { + color_diff(color_mid, color_org, threshold_)) + { const float factor = *it.in(FACTOR_INPUT_INDEX); mul_v4_fl(color_mid_ok, 1.0f / w); interp_v4_v4v4(it.out, color_org, color_mid_ok, factor); diff --git a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cc b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cc index cb872f61941..63fba8e07dc 100644 --- a/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cc +++ b/source/blender/compositor/operations/COM_DisplaceSimpleOperation.cc @@ -138,7 +138,8 @@ void DisplaceSimpleOperation::update_memory_buffer_partial(MemoryBuffer *output, const float height = this->get_height(); const MemoryBuffer *input_color = inputs[0]; for (BuffersIterator it = output->iterate_with(inputs.drop_front(1), area); !it.is_end(); - ++it) { + ++it) + { float scale_x = *it.in(1); float scale_y = *it.in(2); diff --git a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc index e120dd5f41a..8487093a7c9 100644 --- a/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc +++ b/source/blender/compositor/operations/COM_DoubleEdgeMaskOperation.cc @@ -196,10 +196,10 @@ static void do_adjacentBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x - rw] || - !lomask[x + 1]) { /* Test if outer mask is empty underneath or to the right. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x - rw] || !lomask[x + 1]) + { /* Test if outer mask is empty underneath or to the right. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -221,10 +221,10 @@ static void do_adjacentBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x - rw] || - !lomask[x - 1]) { /* Test if outer mask is empty underneath or to the left. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x - rw] || !lomask[x - 1]) + { /* Test if outer mask is empty underneath or to the left. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -246,10 +246,10 @@ static void do_adjacentBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x + rw] || - !lomask[x + 1]) { /* Test if outer mask is empty above or to the right. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x + rw] || !lomask[x + 1]) + { /* Test if outer mask is empty above or to the right. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -271,10 +271,10 @@ static void do_adjacentBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x + rw] || - !lomask[x - 1]) { /* Test if outer mask is empty above or to the left. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x + rw] || !lomask[x - 1]) + { /* Test if outer mask is empty above or to the left. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -296,10 +296,10 @@ static void do_adjacentBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x - 1] || - !lomask[x + 1]) { /* Test if outer mask is empty to the left or to the right. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x - 1] || !lomask[x + 1]) + { /* Test if outer mask is empty to the left or to the right. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -323,10 +323,10 @@ static void do_adjacentBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x - 1] || - !lomask[x + 1]) { /* Test if outer mask is empty to the left or to the right. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x - 1] || !lomask[x + 1]) + { /* Test if outer mask is empty to the left or to the right. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -349,10 +349,10 @@ static void do_adjacentBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x - rw] || - !lomask[x + rw]) { /* Test if outer mask is empty underneath or above. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x - rw] || !lomask[x + rw]) + { /* Test if outer mask is empty underneath or above. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -376,10 +376,10 @@ static void do_adjacentBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x - rw] || - !lomask[x + rw]) { /* Test if outer mask is empty underneath or above. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x - rw] || !lomask[x + rw]) + { /* Test if outer mask is empty underneath or above. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -572,10 +572,10 @@ static void do_allBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x - rw] || - !lomask[x + 1]) { /* Test if outer mask is empty underneath or to the right. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x - rw] || !lomask[x + 1]) + { /* Test if outer mask is empty underneath or to the right. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -596,10 +596,10 @@ static void do_allBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x - rw] || - !lomask[x - 1]) { /* Test if outer mask is empty above or to the left. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x - rw] || !lomask[x - 1]) + { /* Test if outer mask is empty above or to the left. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -620,10 +620,10 @@ static void do_allBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x + rw] || - !lomask[x + 1]) { /* Test if outer mask is empty underneath or to the right. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x + rw] || !lomask[x + 1]) + { /* Test if outer mask is empty underneath or to the right. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -644,10 +644,10 @@ static void do_allBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x + rw] || - !lomask[x - 1]) { /* Test if outer mask is empty underneath or to the left. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x + rw] || !lomask[x - 1]) + { /* Test if outer mask is empty underneath or to the left. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -668,10 +668,10 @@ static void do_allBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x - 1] || - !lomask[x + 1]) { /* Test if outer mask is empty to the left or to the right. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x - 1] || !lomask[x + 1]) + { /* Test if outer mask is empty to the left or to the right. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -694,10 +694,10 @@ static void do_allBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x - 1] || - !lomask[x + 1]) { /* Test if outer mask is empty to the left or to the right. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x - 1] || !lomask[x + 1]) + { /* Test if outer mask is empty to the left or to the right. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -719,10 +719,10 @@ static void do_allBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x - rw] || - !lomask[x + rw]) { /* Test if outer mask is empty underneath or above. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x - rw] || !lomask[x + rw]) + { /* Test if outer mask is empty underneath or above. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -745,10 +745,10 @@ static void do_allBleedBorders( } } else if (lomask[x]) { /* Inner mask was empty, test if outer mask is filled. */ - if (!lomask[x - rw] || - !lomask[x + rw]) { /* Test if outer mask is empty underneath or above. */ - osz++; /* Increment outer edge size. */ - lres[x] = 3; /* Flag pixel as outer edge. */ + if (!lomask[x - rw] || !lomask[x + rw]) + { /* Test if outer mask is empty underneath or above. */ + osz++; /* Increment outer edge size. */ + lres[x] = 3; /* Flag pixel as outer edge. */ } else { gsz++; /* Increment the gradient pixel count. */ @@ -800,7 +800,8 @@ static void do_allEdgeDetection(uint t, if ((!lomask[pix_nextCol] && !limask[pix_nextCol]) || (!lomask[pix_prevCol] && !limask[pix_prevCol]) || (!lomask[pix_nextRow] && !limask[pix_nextRow]) || - (!lomask[pix_prevRow] && !limask[pix_prevRow])) { + (!lomask[pix_prevRow] && !limask[pix_prevRow])) + { in_osz++; /* Increment the outer boundary pixel count. */ lres[a] = 3; /* Flag pixel as part of outer edge. */ } @@ -870,7 +871,8 @@ static void do_adjacentEdgeDetection(uint t, if ((!lomask[pix_nextCol] && !limask[pix_nextCol]) || (!lomask[pix_prevCol] && !limask[pix_prevCol]) || (!lomask[pix_nextRow] && !limask[pix_nextRow]) || - (!lomask[pix_prevRow] && !limask[pix_prevRow])) { + (!lomask[pix_prevRow] && !limask[pix_prevRow])) + { in_osz++; /* Increment the outer boundary pixel count. */ lres[a] = 3; /* Flag pixel as part of outer edge. */ } @@ -884,7 +886,8 @@ static void do_adjacentEdgeDetection(uint t, if ((!limask[pix_nextCol] && lomask[pix_nextCol]) || (!limask[pix_prevCol] && lomask[pix_prevCol]) || (!limask[pix_nextRow] && lomask[pix_nextRow]) || - (!limask[pix_prevRow] && lomask[pix_prevRow])) { + (!limask[pix_prevRow] && lomask[pix_prevRow])) + { in_isz++; /* Increment the inner boundary pixel count. */ lres[a] = 4; /* Flag pixel as part of inner edge. */ } @@ -1120,8 +1123,8 @@ static void do_fillGradientBuffer(uint rw, t = gbuf[gradient_fill_offset]; /* Calculate column of pixel indexed by `gbuf[x]`. */ fsz = gbuf[gradient_fill_offset + 1]; /* Calculate row of pixel indexed by `gbuf[x]`. */ dmin = 0xffffffff; /* Reset min distance to edge pixel. */ - for (a = outer_edge_offset + osz - 1; a >= outer_edge_offset; - a--) { /* Loop through all outer edge buffer pixels. */ + for (a = outer_edge_offset + osz - 1; a >= outer_edge_offset; a--) + { /* Loop through all outer edge buffer pixels. */ ud = a << 1; dy = t - gbuf[ud]; /* Set dx to gradient pixel column - outer edge pixel row. */ dx = fsz - gbuf[ud + 1]; /* Set dy to gradient pixel row - outer edge pixel column. */ @@ -1138,14 +1141,14 @@ static void do_fillGradientBuffer(uint rw, odist = odist * (rsopf - (rsf * odist * odist)); /* -- This line can be iterated for more accuracy. -- */ dmin = 0xffffffff; /* Reset min distance to edge pixel. */ - for (a = inner_edge_offset + isz - 1; a >= inner_edge_offset; - a--) { /* Loop through all inside edge pixels. */ + for (a = inner_edge_offset + isz - 1; a >= inner_edge_offset; a--) + { /* Loop through all inside edge pixels. */ ud = a << 1; dy = t - gbuf[ud]; /* Compute delta in Y from gradient pixel to inside edge pixel. */ dx = fsz - gbuf[ud + 1]; /* Compute delta in X from gradient pixel to inside edge pixel. */ ud = dx * dx + dy * dy; /* Compute sum of squares. */ - if (ud < - dmin) { /* If our new sum of squares is less than the current minimum we've found. */ + if (ud < dmin) + { /* If our new sum of squares is less than the current minimum we've found. */ dmin = ud; /* Set a new minimum equal to the new lower value. */ } } diff --git a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc index 7557d1bc4bd..362a1f67302 100644 --- a/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc +++ b/source/blender/compositor/operations/COM_FastGaussianBlurOperation.cc @@ -361,7 +361,8 @@ void *FastGaussianBlurValueOperation::initialize_tile_data(rcti *rect) float *src = new_buf->get_buffer(); float *dst = copy->get_buffer(); for (int i = copy->get_width() * copy->get_height(); i != 0; - i--, src += COM_DATA_TYPE_VALUE_CHANNELS, dst += COM_DATA_TYPE_VALUE_CHANNELS) { + i--, src += COM_DATA_TYPE_VALUE_CHANNELS, dst += COM_DATA_TYPE_VALUE_CHANNELS) + { if (*src < *dst) { *dst = *src; } @@ -371,7 +372,8 @@ void *FastGaussianBlurValueOperation::initialize_tile_data(rcti *rect) float *src = new_buf->get_buffer(); float *dst = copy->get_buffer(); for (int i = copy->get_width() * copy->get_height(); i != 0; - i--, src += COM_DATA_TYPE_VALUE_CHANNELS, dst += COM_DATA_TYPE_VALUE_CHANNELS) { + i--, src += COM_DATA_TYPE_VALUE_CHANNELS, dst += COM_DATA_TYPE_VALUE_CHANNELS) + { if (*src > *dst) { *dst = *src; } diff --git a/source/blender/compositor/operations/COM_MaskOperation.cc b/source/blender/compositor/operations/COM_MaskOperation.cc index 53f59f831db..c726a750aa0 100644 --- a/source/blender/compositor/operations/COM_MaskOperation.cc +++ b/source/blender/compositor/operations/COM_MaskOperation.cc @@ -45,8 +45,8 @@ void MaskOperation::init_execution() MaskLayer *masklay; MaskLayerShape *masklay_shape; - for (masklay = (MaskLayer *)mask_temp->masklayers.first; masklay; - masklay = masklay->next) { + for (masklay = (MaskLayer *)mask_temp->masklayers.first; masklay; masklay = masklay->next) + { masklay_shape = BKE_mask_layer_shape_verify_frame(masklay, frame_number_); BKE_mask_layer_shape_from_mask(masklay, masklay_shape); } diff --git a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc index fcd37f2a179..7ec93d57c84 100644 --- a/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc +++ b/source/blender/compositor/operations/COM_PlaneCornerPinOperation.cc @@ -269,7 +269,8 @@ bool PlaneCornerPinWarpImageOperation::determine_depending_area_of_interest( { for (int i = 0; i < 4; i++) { if (get_input_operation(i + 1)->determine_depending_area_of_interest( - input, read_operation, output)) { + input, read_operation, output)) + { return true; } } diff --git a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc index 59e924311e3..55760a19bc3 100644 --- a/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc +++ b/source/blender/compositor/operations/COM_PlaneDistortCommonOperation.cc @@ -254,7 +254,8 @@ void PlaneDistortMaskOperation::execute_pixel_sampled(float output[4], isect_point_tri_v2(point, sample_data->frame_space_corners[0], sample_data->frame_space_corners[2], - sample_data->frame_space_corners[3])) { + sample_data->frame_space_corners[3])) + { inside_counter++; } } @@ -273,7 +274,8 @@ void PlaneDistortMaskOperation::execute_pixel_sampled(float output[4], isect_point_tri_v2(point, sample_data->frame_space_corners[0], sample_data->frame_space_corners[2], - sample_data->frame_space_corners[3])) { + sample_data->frame_space_corners[3])) + { inside_counter++; } } @@ -312,7 +314,8 @@ int PlaneDistortMaskOperation::get_jitter_samples_inside_count(int x, isect_point_tri_v2(point, sample_data.frame_space_corners[0], sample_data.frame_space_corners[2], - sample_data.frame_space_corners[3])) { + sample_data.frame_space_corners[3])) + { inside_count++; } } diff --git a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc index fb6c3944d60..5f491647118 100644 --- a/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc +++ b/source/blender/compositor/operations/COM_ProjectorLensDistortionOperation.cc @@ -79,7 +79,8 @@ bool ProjectorLensDistortionOperation::determine_depending_area_of_interest( rcti disp_input; BLI_rcti_init(&disp_input, 0, 5, 0, 5); if (this->get_input_operation(1)->determine_depending_area_of_interest( - &disp_input, read_operation, output)) { + &disp_input, read_operation, output)) + { return true; } new_input.xmin = input->xmin - 7; /* (0.25f * 20 * 1) + 2 == worse case dispersion */ @@ -88,7 +89,8 @@ bool ProjectorLensDistortionOperation::determine_depending_area_of_interest( new_input.xmax = input->xmax + 7; /* (0.25f * 20 * 1) + 2 == worse case dispersion */ } if (this->get_input_operation(0)->determine_depending_area_of_interest( - &new_input, read_operation, output)) { + &new_input, read_operation, output)) + { return true; } return false; diff --git a/source/blender/compositor/operations/COM_RenderLayersProg.cc b/source/blender/compositor/operations/COM_RenderLayersProg.cc index d95ee2a5e1a..ae3d092508c 100644 --- a/source/blender/compositor/operations/COM_RenderLayersProg.cc +++ b/source/blender/compositor/operations/COM_RenderLayersProg.cc @@ -324,7 +324,8 @@ void RenderLayersDepthProg::execute_pixel_sampled(float output[4], float *input_buffer = this->get_input_buffer(); if (input_buffer == nullptr || ix < 0 || iy < 0 || ix >= int(this->get_width()) || - iy >= int(this->get_height())) { + iy >= int(this->get_height())) + { output[0] = 10e10f; } else { diff --git a/source/blender/compositor/operations/COM_SMAAOperation.cc b/source/blender/compositor/operations/COM_SMAAOperation.cc index 8f4ed844b9f..19296766165 100644 --- a/source/blender/compositor/operations/COM_SMAAOperation.cc +++ b/source/blender/compositor/operations/COM_SMAAOperation.cc @@ -861,7 +861,8 @@ int SMAABlendingWeightCalculationOperation::search_xright(int x, int y) x++; sample_image_fn_(x, y, e); if (e[1] == 0.0f || /* Is the edge not activated? */ - e[0] != 0.0f) { /* Or is there a crossing edge that breaks the line? */ + e[0] != 0.0f) + { /* Or is there a crossing edge that breaks the line? */ break; } sample_image_fn_(x, y - 1, e); @@ -905,7 +906,8 @@ int SMAABlendingWeightCalculationOperation::search_ydown(int x, int y) y++; sample_image_fn_(x, y, e); if (e[0] == 0.0f || /* Is the edge not activated? */ - e[1] != 0.0f) { /* Or is there a crossing edge that breaks the line? */ + e[1] != 0.0f) + { /* Or is there a crossing edge that breaks the line? */ break; } sample_image_fn_(x - 1, y, e); diff --git a/source/blender/compositor/operations/COM_TextureOperation.cc b/source/blender/compositor/operations/COM_TextureOperation.cc index aa0a27503c5..9ea9731047b 100644 --- a/source/blender/compositor/operations/COM_TextureOperation.cc +++ b/source/blender/compositor/operations/COM_TextureOperation.cc @@ -50,7 +50,8 @@ void TextureBaseOperation::deinit_execution() BKE_image_pool_free(pool_); pool_ = nullptr; if (texture_ != nullptr && texture_->use_nodes && texture_->nodetree != nullptr && - texture_->nodetree->runtime->execdata != nullptr) { + texture_->nodetree->runtime->execdata != nullptr) + { ntreeTexEndExecTree(texture_->nodetree->runtime->execdata); } NodeOperation::deinit_execution(); diff --git a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cc b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cc index bf6ee64c73f..c906b9d0bc5 100644 --- a/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cc +++ b/source/blender/compositor/operations/COM_VariableSizeBokehBlurOperation.cc @@ -338,12 +338,14 @@ static void blur_pixel(int x, int y, PixelData &p) const float *row_color = p.image_input->get_elem(minx, miny); const float *row_size = p.size_input->get_elem(minx, miny); for (int ny = miny; ny < maxy; - ny += p.step, row_size += size_row_stride, row_color += color_row_stride) { + ny += p.step, row_size += size_row_stride, row_color += color_row_stride) + { const float dy = ny - y; const float *size_elem = row_size; const float *color = row_color; for (int nx = minx; nx < maxx; - nx += p.step, size_elem += size_elem_stride, color += color_elem_stride) { + nx += p.step, size_elem += size_elem_stride, color += color_elem_stride) + { if (nx == x && ny == y) { continue; } @@ -395,7 +397,8 @@ void VariableSizeBokehBlurOperation::update_memory_buffer_partial(MemoryBuffer * for (BuffersIterator it = output->iterate_with({p.image_input, p.size_input}, area); !it.is_end(); - ++it) { + ++it) + { const float *color = it.in(0); const float size = *it.in(1); copy_v4_v4(p.color_accum, color); diff --git a/source/blender/compositor/operations/COM_VectorBlurOperation.cc b/source/blender/compositor/operations/COM_VectorBlurOperation.cc index 39b190c8c8e..3a6c9127a40 100644 --- a/source/blender/compositor/operations/COM_VectorBlurOperation.cc +++ b/source/blender/compositor/operations/COM_VectorBlurOperation.cc @@ -825,7 +825,8 @@ void zbuf_accumulate_vecblur(NodeBlurData *nbd, for (fy = -0.5f + jit[step & 255][0], y = 0; y < ysize; y++, fy += 1.0f) { for (fx = -0.5f + jit[step & 255][1], x = 0; x < xsize; - x++, fx += 1.0f, dimg += 4, dz1 += 4, dz2 += 4, dm++, dz++) { + x++, fx += 1.0f, dimg += 4, dz1 += 4, dz2 += 4, dm++, dz++) + { if (*dm > 1) { float jfx = fx + 0.5f; float jfy = fy + 0.5f; diff --git a/source/blender/compositor/realtime_compositor/intern/compile_state.cc b/source/blender/compositor/realtime_compositor/intern/compile_state.cc index d5fb91ddae2..46bbc758243 100644 --- a/source/blender/compositor/realtime_compositor/intern/compile_state.cc +++ b/source/blender/compositor/realtime_compositor/intern/compile_state.cc @@ -93,7 +93,8 @@ bool CompileState::should_compile_shader_compile_unit(DNode node) * complete and should be compiled. Identity domains are an exception as they are always * compatible because they represents single values. */ if (shader_compile_unit_domain_ != Domain::identity() && - shader_compile_unit_domain_ != compute_shader_node_domain(node)) { + shader_compile_unit_domain_ != compute_shader_node_domain(node)) + { return true; } diff --git a/source/blender/compositor/realtime_compositor/intern/scheduler.cc b/source/blender/compositor/realtime_compositor/intern/scheduler.cc index 171a0c21cc1..c1ec75057eb 100644 --- a/source/blender/compositor/realtime_compositor/intern/scheduler.cc +++ b/source/blender/compositor/realtime_compositor/intern/scheduler.cc @@ -267,8 +267,8 @@ static NeededBuffers compute_number_of_needed_buffers(DNode output_node) /* If any of the links is not between two shader nodes, it means that the node outputs * a buffer through this output and so we increment the number of output buffers. */ - if (!is_output_linked_to_node_conditioned(doutput, is_shader_node) || - !is_shader_node(node)) { + if (!is_output_linked_to_node_conditioned(doutput, is_shader_node) || !is_shader_node(node)) + { number_of_output_buffers++; } } diff --git a/source/blender/datatoc/datatoc_icon.c b/source/blender/datatoc/datatoc_icon.c index 2a87cf62d3a..b249773d908 100644 --- a/source/blender/datatoc/datatoc_icon.c +++ b/source/blender/datatoc/datatoc_icon.c @@ -219,8 +219,8 @@ static struct IconInfo *icon_merge_context_info_for_icon_head(struct IconMergeCo for (int i = 0; i < context->num_read_icons; i++) { struct IconInfo *read_icon_info = &context->read_icons[i]; const struct IconHead *read_icon_head = &read_icon_info->head; - if (read_icon_head->orig_x == icon_head->orig_x && - read_icon_head->orig_y == icon_head->orig_y) { + if (read_icon_head->orig_x == icon_head->orig_x && read_icon_head->orig_y == icon_head->orig_y) + { return read_icon_info; } } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc index c0ee0b29137..dfde4294db1 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes.cc @@ -378,7 +378,8 @@ void DepsgraphNodeBuilder::begin_build() * possibly deleted memory. */ IDInfo *id_info = (IDInfo *)MEM_mallocN(sizeof(IDInfo), "depsgraph id info"); if (deg_copy_on_write_is_needed(id_node->id_type) && - deg_copy_on_write_is_expanded(id_node->id_cow) && id_node->id_orig != id_node->id_cow) { + deg_copy_on_write_is_expanded(id_node->id_cow) && id_node->id_orig != id_node->id_cow) + { id_info->id_cow = id_node->id_cow; } else { @@ -681,7 +682,8 @@ void DepsgraphNodeBuilder::build_collection(LayerCollection *from_layer_collecti if (built_map_.checkIsBuiltAndTag(collection)) { id_node = find_id_node(&collection->id); if (is_collection_visible && id_node->is_visible_on_build == false && - id_node->is_collection_fully_expanded == true) { + id_node->is_collection_fully_expanded == true) + { /* Collection became visible, make sure nested collections and * objects are poked with the new visibility flag, since they * might become visible too. */ @@ -815,7 +817,8 @@ void DepsgraphNodeBuilder::build_object(int base_index, } /* Force field Texture. */ if ((object->pd != nullptr) && (object->pd->forcefield == PFIELD_TEXTURE) && - (object->pd->tex != nullptr)) { + (object->pd->tex != nullptr)) + { build_texture(object->pd->tex); } /* Object dupligroup. */ @@ -1144,8 +1147,8 @@ void DepsgraphNodeBuilder::build_animation_images(ID *id) bool has_image_animation = false; if (ELEM(GS(id->name), ID_MA, ID_WO)) { bNodeTree *ntree = *BKE_ntree_ptr_from_id(id); - if (ntree != nullptr && - ntree->runtime->runtime_flag & NTREE_RUNTIME_FLAG_HAS_IMAGE_ANIMATION) { + if (ntree != nullptr && ntree->runtime->runtime_flag & NTREE_RUNTIME_FLAG_HAS_IMAGE_ANIMATION) + { has_image_animation = true; } } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc index 6fd3aaf282a..0429fea6426 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_nodes_rig.cc @@ -74,7 +74,8 @@ void DepsgraphNodeBuilder::build_ik_pose(Object *object, bPoseChannel *pchan, bC } if (has_operation_node( - &object->id, NodeType::EVAL_POSE, rootchan->name, OperationCode::POSE_IK_SOLVER)) { + &object->id, NodeType::EVAL_POSE, rootchan->name, OperationCode::POSE_IK_SOLVER)) + { return; } @@ -103,10 +104,9 @@ void DepsgraphNodeBuilder::build_splineik_pose(Object *object, /* Find the chain's root. */ bPoseChannel *rootchan = BKE_armature_splineik_solver_find_root(pchan, data); - if (has_operation_node(&object->id, - NodeType::EVAL_POSE, - rootchan->name, - OperationCode::POSE_SPLINE_IK_SOLVER)) { + if (has_operation_node( + &object->id, NodeType::EVAL_POSE, rootchan->name, OperationCode::POSE_SPLINE_IK_SOLVER)) + { return; } diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc index 8398f5888f4..1d1e805552c 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations.cc @@ -120,7 +120,8 @@ namespace { bool driver_target_depends_on_time(const DriverTarget *target) { if (target->idtype == ID_SCE && - (target->rna_path != nullptr && STREQ(target->rna_path, "frame_current"))) { + (target->rna_path != nullptr && STREQ(target->rna_path, "frame_current"))) + { return true; } return false; @@ -313,8 +314,8 @@ void DepsgraphRelationBuilder::add_depends_on_transform_relation(const DepsNodeH void DepsgraphRelationBuilder::add_customdata_mask(Object *object, const DEGCustomDataMeshMasks &customdata_masks) { - if (customdata_masks != DEGCustomDataMeshMasks() && object != nullptr && - object->type == OB_MESH) { + if (customdata_masks != DEGCustomDataMeshMasks() && object != nullptr && object->type == OB_MESH) + { IDNode *id_node = graph_->find_id_node(&object->id); if (id_node == nullptr) { @@ -428,14 +429,16 @@ void DepsgraphRelationBuilder::add_particle_forcefield_relations(const Operation add_relation(eff_key, key, name); if (ELEM(relation->pd->shape, PFIELD_SHAPE_SURFACE, PFIELD_SHAPE_POINTS) || - relation->pd->forcefield == PFIELD_GUIDE) { + relation->pd->forcefield == PFIELD_GUIDE) + { ComponentKey mod_key(&relation->ob->id, NodeType::GEOMETRY); add_relation(mod_key, key, name); } /* Force field Texture. */ if ((relation->pd != nullptr) && (relation->pd->forcefield == PFIELD_TEXTURE) && - (relation->pd->tex != nullptr)) { + (relation->pd->tex != nullptr)) + { ComponentKey tex_key(&relation->pd->tex->id, NodeType::GENERIC_DATABLOCK); add_relation(tex_key, key, "Force field Texture"); } @@ -788,7 +791,8 @@ void DepsgraphRelationBuilder::build_object(Object *object) /* Force field Texture. */ if ((object->pd != nullptr) && (object->pd->forcefield == PFIELD_TEXTURE) && - (object->pd->tex != nullptr)) { + (object->pd->tex != nullptr)) + { build_texture(object->pd->tex); } @@ -1236,7 +1240,8 @@ void DepsgraphRelationBuilder::build_constraints(ID *id, if (ELEM(cti->type, CONSTRAINT_TYPE_FOLLOWTRACK, CONSTRAINT_TYPE_CAMERASOLVER, - CONSTRAINT_TYPE_OBJECTSOLVER)) { + CONSTRAINT_TYPE_OBJECTSOLVER)) + { bool depends_on_camera = false; if (cti->type == CONSTRAINT_TYPE_FOLLOWTRACK) { bFollowTrackConstraint *data = (bFollowTrackConstraint *)con->data; @@ -1300,7 +1305,8 @@ void DepsgraphRelationBuilder::build_constraints(ID *id, } /* if needs bbone shape, reference the segment computation */ if (BKE_constraint_target_uses_bbone(con, ct) && - check_pchan_has_bbone_segments(ct->tar, ct->subtarget)) { + check_pchan_has_bbone_segments(ct->tar, ct->subtarget)) + { opcode = OperationCode::BONE_SEGMENTS; } OperationKey target_key(&ct->tar->id, NodeType::BONE, ct->subtarget, opcode); @@ -1376,7 +1382,8 @@ void DepsgraphRelationBuilder::build_constraints(ID *id, CONSTRAINT_TYPE_ROTLIKE, CONSTRAINT_TYPE_SIZELIKE, CONSTRAINT_TYPE_LOCLIKE, - CONSTRAINT_TYPE_TRANSLIKE)) { + CONSTRAINT_TYPE_TRANSLIKE)) + { /* TODO(sergey): Add used space check. */ ComponentKey target_transform_key(&ct->tar->id, NodeType::TRANSFORM); add_relation(target_transform_key, constraint_op_key, cti->name); @@ -1540,8 +1547,8 @@ void DepsgraphRelationBuilder::build_animation_images(ID *id) bool has_image_animation = false; if (ELEM(GS(id->name), ID_MA, ID_WO)) { bNodeTree *ntree = *BKE_ntree_ptr_from_id(id); - if (ntree != nullptr && - ntree->runtime->runtime_flag & NTREE_RUNTIME_FLAG_HAS_IMAGE_ANIMATION) { + if (ntree != nullptr && ntree->runtime->runtime_flag & NTREE_RUNTIME_FLAG_HAS_IMAGE_ANIMATION) + { has_image_animation = true; } } @@ -1782,7 +1789,8 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu) } /* Special handling for directly-named bones. */ if ((dtar->flag & DTAR_FLAG_STRUCT_REF) && (object && object->type == OB_ARMATURE) && - (dtar->pchan_name[0])) { + (dtar->pchan_name[0])) + { bPoseChannel *target_pchan = BKE_pose_channel_find_name(object->pose, dtar->pchan_name); if (target_pchan == nullptr) { continue; @@ -1811,7 +1819,8 @@ void DepsgraphRelationBuilder::build_driver_variables(ID *id, FCurve *fcu) continue; } if (is_same_bone_dependency(variable_exit_key, self_key) || - is_same_nodetree_node_dependency(variable_exit_key, self_key)) { + is_same_nodetree_node_dependency(variable_exit_key, self_key)) + { continue; } add_relation(variable_exit_key, driver_key, "RNA Target -> Driver"); @@ -1994,7 +2003,8 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) add_relation(effector_geometry_key, rb_init_key, "RigidBody Field"); } if ((effector_relation->pd->forcefield == PFIELD_TEXTURE) && - (effector_relation->pd->tex != nullptr)) { + (effector_relation->pd->tex != nullptr)) + { ComponentKey tex_key(&effector_relation->pd->tex->id, NodeType::GENERIC_DATABLOCK); add_relation(tex_key, rb_init_key, "Force field Texture"); } @@ -2012,7 +2022,8 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene) } if (object->parent != nullptr && object->parent->rigidbody_object != nullptr && - object->parent->rigidbody_object->shape == RB_SHAPE_COMPOUND) { + object->parent->rigidbody_object->shape == RB_SHAPE_COMPOUND) + { /* If we are a child of a compound shape object, the transforms and sim evaluation will be * handled by the parent compound shape object. Do not add any evaluation triggers * for the child objects. @@ -2105,7 +2116,8 @@ void DepsgraphRelationBuilder::build_particle_systems(Object *object) psys_key, object, part->collision_group, "Particle Collision"); } else if ((psys->flag & PSYS_HAIR_DYNAMICS) && psys->clmd != nullptr && - psys->clmd->coll_parms != nullptr) { + psys->clmd->coll_parms != nullptr) + { add_particle_collision_relations( psys_key, object, psys->clmd->coll_parms->group, "Hair Collision"); } @@ -3212,7 +3224,8 @@ void DepsgraphRelationBuilder::build_copy_on_write_relations(IDNode *id_node) } int rel_flag = (RELATION_FLAG_NO_FLUSH | RELATION_FLAG_GODMODE); if ((ELEM(id_type, ID_ME, ID_CV, ID_PT, ID_VO) && comp_node->type == NodeType::GEOMETRY) || - (id_type == ID_CF && comp_node->type == NodeType::CACHE)) { + (id_type == ID_CF && comp_node->type == NodeType::CACHE)) + { rel_flag &= ~RELATION_FLAG_NO_FLUSH; } /* TODO(sergey): Needs better solution for this. */ diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_impl.h b/source/blender/depsgraph/intern/builder/deg_builder_relations_impl.h index 83d12bea6a1..8f6e780371c 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_impl.h +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_impl.h @@ -166,8 +166,8 @@ bool DepsgraphRelationBuilder::is_same_bone_dependency(const KeyFrom &key_from, return false; } /* We are only interested in relations like BONE_DONE -> BONE_LOCAL... */ - if (!(op_from->opcode == OperationCode::BONE_DONE && - op_to->opcode == OperationCode::BONE_LOCAL)) { + if (!(op_from->opcode == OperationCode::BONE_DONE && op_to->opcode == OperationCode::BONE_LOCAL)) + { return false; } /* ... BUT, we also need to check if it's same bone. */ @@ -202,7 +202,8 @@ bool DepsgraphRelationBuilder::is_same_nodetree_node_dependency(const KeyFrom &k } /* We are only interested in relations like BONE_DONE -> BONE_LOCAL... */ if (!(op_from->opcode == OperationCode::PARAMETERS_EVAL && - op_to->opcode == OperationCode::PARAMETERS_EVAL)) { + op_to->opcode == OperationCode::PARAMETERS_EVAL)) + { return false; } return true; diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc index 2de07998ba9..799b0fc06da 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc @@ -239,7 +239,8 @@ void DepsgraphRelationBuilder::build_splineik_pose(Object *object, /* Walk to the chain's root/ */ int segcount = 1; for (bPoseChannel *parchan = pchan->parent; parchan != nullptr && segcount < data->chainlen; - parchan = parchan->parent, segcount++) { + parchan = parchan->parent, segcount++) + { /* Make Spline IK solver dependent on this bone's result, since it can * only run after the standard results of the bone are know. Validate * links step on the bone will ensure that users of this bone only grab @@ -430,7 +431,8 @@ void DepsgraphRelationBuilder::build_rig(Object *object) OperationCode opcode = OperationCode::BONE_DONE; /* Inheriting parent roll requires access to prev handle's B-Bone properties. */ if ((pchan->bone->bbone_flag & BBONE_ADD_PARENT_END_ROLL) != 0 && - check_pchan_has_bbone_segments(object, prev)) { + check_pchan_has_bbone_segments(object, prev)) + { opcode = OperationCode::BONE_SEGMENTS; } OperationKey prev_key(&object->id, NodeType::BONE, prev->name, opcode); diff --git a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc index c6273b66d90..a50053acf68 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder_rna.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder_rna.cc @@ -268,7 +268,8 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, } else if (RNA_struct_is_a(ptr->type, &RNA_Modifier) && (contains(prop_identifier, "show_viewport") || - contains(prop_identifier, "show_render"))) { + contains(prop_identifier, "show_render"))) + { node_identifier.type = NodeType::GEOMETRY; node_identifier.operation_code = OperationCode::VISIBILITY; return node_identifier; @@ -281,7 +282,8 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, RNA_struct_is_a(ptr->type, &RNA_MeshUVLoop) || RNA_struct_is_a(ptr->type, &RNA_MeshLoopColor) || RNA_struct_is_a(ptr->type, &RNA_VertexGroupElement) || - RNA_struct_is_a(ptr->type, &RNA_ShaderFx)) { + RNA_struct_is_a(ptr->type, &RNA_ShaderFx)) + { /* When modifier is used as FROM operation this is likely referencing to * the property (for example, modifier's influence). * But when it's used as TO operation, this is geometry component. */ @@ -313,7 +315,8 @@ RNANodeIdentifier RNANodeQuery::construct_node_identifier(const PointerRNA *ptr, contains(prop_identifier, "delta_location") || contains(prop_identifier, "delta_rotation_euler") || contains(prop_identifier, "delta_rotation_quaternion") || - contains(prop_identifier, "delta_scale")) { + contains(prop_identifier, "delta_scale")) + { node_identifier.type = NodeType::TRANSFORM; return node_identifier; } diff --git a/source/blender/depsgraph/intern/depsgraph_physics.cc b/source/blender/depsgraph/intern/depsgraph_physics.cc index 1b90a55bf66..70823da0a73 100644 --- a/source/blender/depsgraph/intern/depsgraph_physics.cc +++ b/source/blender/depsgraph/intern/depsgraph_physics.cc @@ -104,7 +104,8 @@ void DEG_add_collision_relations(DepsNodeHandle *handle, continue; } if (filter_function == nullptr || - filter_function(ob1, BKE_modifiers_findby_type(ob1, (ModifierType)modifier_type))) { + filter_function(ob1, BKE_modifiers_findby_type(ob1, (ModifierType)modifier_type))) + { DEG_add_object_pointcache_relation(handle, ob1, DEG_OB_COMP_TRANSFORM, name); DEG_add_object_pointcache_relation(handle, ob1, DEG_OB_COMP_GEOMETRY, name); } @@ -134,7 +135,8 @@ void DEG_add_forcefield_relations(DepsNodeHandle *handle, DEG_add_object_pointcache_relation(handle, relation->ob, DEG_OB_COMP_TRANSFORM, name); if (relation->psys || ELEM(relation->pd->shape, PFIELD_SHAPE_SURFACE, PFIELD_SHAPE_POINTS) || - relation->pd->forcefield == PFIELD_GUIDE) { + relation->pd->forcefield == PFIELD_GUIDE) + { /* TODO(sergey): Consider going more granular with more dedicated * particle system operation. */ DEG_add_object_pointcache_relation(handle, relation->ob, DEG_OB_COMP_GEOMETRY, name); diff --git a/source/blender/depsgraph/intern/depsgraph_query_foreach.cc b/source/blender/depsgraph/intern/depsgraph_query_foreach.cc index 3fdff6b1302..a95b29764b8 100644 --- a/source/blender/depsgraph/intern/depsgraph_query_foreach.cc +++ b/source/blender/depsgraph/intern/depsgraph_query_foreach.cc @@ -68,7 +68,8 @@ void deg_foreach_dependent_operation(const Depsgraph * /*graph*/, } if (source_component_type != DEG_OB_COMP_ANY && - nodeTypeToObjectComponent(comp_node->type) != source_component_type) { + nodeTypeToObjectComponent(comp_node->type) != source_component_type) + { continue; } for (OperationNode *op_node : comp_node->operations) { diff --git a/source/blender/depsgraph/intern/depsgraph_query_iter.cc b/source/blender/depsgraph/intern/depsgraph_query_iter.cc index ccfb184ec73..27e194230e0 100644 --- a/source/blender/depsgraph/intern/depsgraph_query_iter.cc +++ b/source/blender/depsgraph/intern/depsgraph_query_iter.cc @@ -271,7 +271,8 @@ bool deg_iterator_objects_step(DEGObjectIterData *data) if (ob_visibility & OB_VISIBLE_INSTANCES) { if ((data->flag & DEG_ITER_OBJECT_FLAG_DUPLI) && - ((object->transflag & OB_DUPLI) || object->runtime.geometry_set_eval != nullptr)) { + ((object->transflag & OB_DUPLI) || object->runtime.geometry_set_eval != nullptr)) + { ListBase *duplis = object_duplilist(data->graph, data->scene, object); deg_iterator_duplis_init(data, object, duplis); } diff --git a/source/blender/depsgraph/intern/eval/deg_eval.cc b/source/blender/depsgraph/intern/eval/deg_eval.cc index e0397dad038..fcb3b6308db 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval.cc @@ -359,7 +359,8 @@ void depsgraph_ensure_view_layer(Depsgraph *graph) * This allows us to have proper view layer pointer. */ Scene *scene_cow = graph->scene_cow; if (deg_copy_on_write_is_expanded(&scene_cow->id) && - (scene_cow->id.recalc & ID_RECALC_COPY_ON_WRITE) == 0) { + (scene_cow->id.recalc & ID_RECALC_COPY_ON_WRITE) == 0) + { return; } diff --git a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc index 6675fd150d0..ff0b64a20ce 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_copy_on_write.cc @@ -381,7 +381,8 @@ void scene_minimize_unused_view_layers(const Depsgraph *depsgraph, for (ViewLayer *view_layer_cow = reinterpret_cast(scene_cow->view_layers.first), *view_layer_next; view_layer_cow != nullptr; - view_layer_cow = view_layer_next) { + view_layer_cow = view_layer_next) + { view_layer_next = view_layer_cow->next; if (view_layer_input != nullptr && STREQ(view_layer_input->name, view_layer_cow->name)) { view_layer_eval = view_layer_cow; @@ -887,7 +888,8 @@ ID *deg_update_copy_on_write_datablock(const Depsgraph *depsgraph, const IDNode /* In case we don't need to do a copy-on-write, we can use the update cache of the grease * pencil data to do an update-on-write. */ if (id_type == ID_GD_LEGACY && BKE_gpencil_can_avoid_full_copy_on_write( - (const ::Depsgraph *)depsgraph, (bGPdata *)id_orig)) { + (const ::Depsgraph *)depsgraph, (bGPdata *)id_orig)) + { BKE_gpencil_update_on_write((bGPdata *)id_orig, (bGPdata *)id_cow); return id_cow; } diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index 31048a81028..23d006c3718 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -178,7 +178,8 @@ inline OperationNode *flush_schedule_children(OperationNode *op_node, FlushQueue /* Relation only allows flushes on user changes, but the node was not * affected by user. */ if ((rel->flag & RELATION_FLAG_FLUSH_USER_EDIT_ONLY) && - (op_node->flag & DEPSOP_FLAG_USER_MODIFIED) == 0) { + (op_node->flag & DEPSOP_FLAG_USER_MODIFIED) == 0) + { continue; } OperationNode *to_node = (OperationNode *)rel->to; diff --git a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc index 7688ffda26f..4f6af6fa0ef 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_runtime_backup_animation.cc @@ -44,7 +44,8 @@ void animated_property_store_cb(ID *id, FCurve *fcurve, void *data_v) /* Resolve path to the property. */ PathResolvedRNA resolved_rna; if (!BKE_animsys_rna_path_resolve( - &data->id_pointer_rna, fcurve->rna_path, fcurve->array_index, &resolved_rna)) { + &data->id_pointer_rna, fcurve->rna_path, fcurve->array_index, &resolved_rna)) + { return; } @@ -104,7 +105,8 @@ void AnimationBackup::restore_to_id(ID *id) if (!BKE_animsys_rna_path_resolve(&id_pointer_rna, value_backup.rna_path.c_str(), value_backup.array_index, - &resolved_rna)) { + &resolved_rna)) + { return; } diff --git a/source/blender/depsgraph/intern/node/deg_node_component.cc b/source/blender/depsgraph/intern/node/deg_node_component.cc index cc2feeec42b..9702a2d6a26 100644 --- a/source/blender/depsgraph/intern/node/deg_node_component.cc +++ b/source/blender/depsgraph/intern/node/deg_node_component.cc @@ -106,7 +106,8 @@ OperationNode *ComponentNode::find_operation(OperationIDKey key) const else { for (OperationNode *op_node : operations) { if (op_node->opcode == key.opcode && op_node->name_tag == key.name_tag && - STREQ(op_node->name.c_str(), key.name)) { + STREQ(op_node->name.c_str(), key.name)) + { node = op_node; break; } diff --git a/source/blender/draw/engines/basic/basic_engine.c b/source/blender/draw/engines/basic/basic_engine.c index 7dcf05651f9..01c4d4c7757 100644 --- a/source/blender/draw/engines/basic/basic_engine.c +++ b/source/blender/draw/engines/basic/basic_engine.c @@ -173,7 +173,8 @@ static void basic_cache_populate(void *vedata, Object *ob) /* Make flat object selectable in ortho view if wireframe is enabled. */ if ((draw_ctx->v3d->overlay.flag & V3D_OVERLAY_WIREFRAMES) || - (draw_ctx->v3d->shading.type == OB_WIRE) || (ob->dtx & OB_DRAWWIRE) || (ob->dt == OB_WIRE)) { + (draw_ctx->v3d->shading.type == OB_WIRE) || (ob->dtx & OB_DRAWWIRE) || (ob->dt == OB_WIRE)) + { int flat_axis = 0; bool is_flat_object_viewed_from_side = ((draw_ctx->rv3d->persp == RV3D_ORTHO) && DRW_object_is_flat(ob, &flat_axis) && diff --git a/source/blender/draw/engines/eevee/eevee_cryptomatte.c b/source/blender/draw/engines/eevee/eevee_cryptomatte.c index d805a039e8f..df5c761a73e 100644 --- a/source/blender/draw/engines/eevee/eevee_cryptomatte.c +++ b/source/blender/draw/engines/eevee/eevee_cryptomatte.c @@ -500,7 +500,8 @@ static void eevee_cryptomatte_postprocess_weights(EEVEE_Data *vedata) int accum_pixel_stride = eevee_cryptomatte_pixel_stride(view_layer); for (int pixel_index = 0; pixel_index < buffer_size; - pixel_index++, accum_pixel_index += accum_pixel_stride) { + pixel_index++, accum_pixel_index += accum_pixel_stride) + { float coverage = 1.0f; if (volumetric_transmittance_buffer != NULL) { coverage = (volumetric_transmittance_buffer[pixel_index * 4] + diff --git a/source/blender/draw/engines/eevee/eevee_depth_of_field.c b/source/blender/draw/engines/eevee/eevee_depth_of_field.c index 29e0c0665ed..08a598772d7 100644 --- a/source/blender/draw/engines/eevee/eevee_depth_of_field.c +++ b/source/blender/draw/engines/eevee/eevee_depth_of_field.c @@ -345,7 +345,8 @@ static void dof_bokeh_pass_init(EEVEE_FramebufferList *fbl, EEVEE_EffectsInfo *fx) { if ((fx->dof_bokeh_aniso[0] == 1.0f) && (fx->dof_bokeh_aniso[1] == 1.0f) && - (fx->dof_bokeh_blades == 0.0)) { + (fx->dof_bokeh_blades == 0.0)) + { fx->dof_bokeh_gather_lut_tx = NULL; fx->dof_bokeh_scatter_lut_tx = NULL; fx->dof_bokeh_resolve_lut_tx = NULL; @@ -631,7 +632,8 @@ static void dof_reduce_pass_init(EEVEE_FramebufferList *fbl, /* TODO(@fclem): In the future, we need to check if mip_count did not change. * For now it's ok as we always define all mip level. */ if (res[0] != GPU_texture_width(txl->dof_reduced_color) || - res[1] != GPU_texture_width(txl->dof_reduced_color)) { + res[1] != GPU_texture_width(txl->dof_reduced_color)) + { DRW_TEXTURE_FREE_SAFE(txl->dof_reduced_color); DRW_TEXTURE_FREE_SAFE(txl->dof_reduced_coc); } diff --git a/source/blender/draw/engines/eevee/eevee_effects.c b/source/blender/draw/engines/eevee/eevee_effects.c index 2b4ea6bf848..6540414bde0 100644 --- a/source/blender/draw/engines/eevee/eevee_effects.c +++ b/source/blender/draw/engines/eevee/eevee_effects.c @@ -390,7 +390,8 @@ void EEVEE_create_minmax_buffer(EEVEE_Data *vedata, GPUTexture *depth_src, int l GPU_framebuffer_bind(fbl->main_fb); if (GPU_mip_render_workaround() || - GPU_type_matches(GPU_DEVICE_INTEL_UHD, GPU_OS_WIN, GPU_DRIVER_ANY)) { + GPU_type_matches(GPU_DEVICE_INTEL_UHD, GPU_OS_WIN, GPU_DRIVER_ANY)) + { /* Fix dot corruption on intel HD5XX/HD6XX series. */ GPU_flush(); } @@ -503,7 +504,8 @@ void EEVEE_draw_effects(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) if (!stl->g_data->valid_double_buffer && ((effects->enabled_effects & EFFECT_DOUBLE_BUFFER) != 0) && - (DRW_state_is_image_render() == false)) { + (DRW_state_is_image_render() == false)) + { /* If history buffer is not valid request another frame. * This fix black reflections on area resize. */ DRW_viewport_request_redraw(); diff --git a/source/blender/draw/engines/eevee/eevee_engine.c b/source/blender/draw/engines/eevee/eevee_engine.c index 9a3215eeb97..3afbc361dfd 100644 --- a/source/blender/draw/engines/eevee/eevee_engine.c +++ b/source/blender/draw/engines/eevee/eevee_engine.c @@ -230,7 +230,8 @@ static void eevee_draw_scene(void *vedata) bool taa_use_reprojection = (stl->effects->enabled_effects & EFFECT_TAA_REPROJECT) != 0; if (DRW_state_is_image_render() || taa_use_reprojection || - ((stl->effects->enabled_effects & EFFECT_TAA) != 0)) { + ((stl->effects->enabled_effects & EFFECT_TAA) != 0)) + { int samp = taa_use_reprojection ? stl->effects->taa_reproject_sample + 1 : stl->effects->taa_current_sample; BLI_halton_3d(primes, offset, samp, r); @@ -256,14 +257,16 @@ static void eevee_draw_scene(void *vedata) if (((stl->effects->enabled_effects & EFFECT_TAA) != 0) && (stl->effects->taa_current_sample > 1) && !DRW_state_is_image_render() && - !taa_use_reprojection) { + !taa_use_reprojection) + { DRW_view_set_active(stl->effects->taa_view); } /* when doing viewport rendering the overrides needs to be recalculated for * every loop as this normally happens once inside * `EEVEE_temporal_sampling_init` */ else if (((stl->effects->enabled_effects & EFFECT_TAA) != 0) && - (stl->effects->taa_current_sample > 1) && DRW_state_is_image_render()) { + (stl->effects->taa_current_sample > 1) && DRW_state_is_image_render()) + { EEVEE_temporal_sampling_update_matrices(vedata); } @@ -342,7 +345,8 @@ static void eevee_draw_scene(void *vedata) DRW_view_set_active(NULL); if (DRW_state_is_image_render() && (stl->effects->enabled_effects & EFFECT_SSR) && - !stl->effects->ssr_was_valid_double_buffer) { + !stl->effects->ssr_was_valid_double_buffer) + { /* SSR needs one iteration to start properly. */ loop_len++; /* Reset sampling (and accumulation) after the first sample to avoid diff --git a/source/blender/draw/engines/eevee/eevee_lightcache.c b/source/blender/draw/engines/eevee/eevee_lightcache.c index 83a978ccff6..03597f1bb0d 100644 --- a/source/blender/draw/engines/eevee/eevee_lightcache.c +++ b/source/blender/draw/engines/eevee/eevee_lightcache.c @@ -309,11 +309,13 @@ static bool EEVEE_lightcache_validate(const LightCache *light_cache, /* See if we need the same amount of texture space. */ if ((irr_size[0] == light_cache->grid_tx.tex_size[0]) && (irr_size[1] == light_cache->grid_tx.tex_size[1]) && - (irr_size[2] == light_cache->grid_tx.tex_size[2]) && (grid_len == light_cache->grid_len)) { + (irr_size[2] == light_cache->grid_tx.tex_size[2]) && (grid_len == light_cache->grid_len)) + { int mip_len = log2_floor_u(cube_res) - MIN_CUBE_LOD_LEVEL; if ((cube_res == light_cache->cube_tx.tex_size[0]) && (cube_len == light_cache->cube_tx.tex_size[2] / 6) && - (cube_len == light_cache->cube_len) && (mip_len == light_cache->mips_len)) { + (cube_len == light_cache->cube_len) && (mip_len == light_cache->mips_len)) + { return true; } } @@ -386,7 +388,8 @@ static bool eevee_lightcache_static_load(LightCache *lcache) { /* We use fallback if a texture is not setup and there is no data to restore it. */ if ((!lcache->grid_tx.tex && !lcache->grid_tx.data) || !lcache->grid_data || - (!lcache->cube_tx.tex && !lcache->cube_tx.data) || !lcache->cube_data) { + (!lcache->cube_tx.tex && !lcache->cube_tx.data) || !lcache->cube_data) + { return false; } /* If cache is too big for this GPU. */ @@ -731,7 +734,8 @@ static void eevee_lightbake_create_resources(EEVEE_LightBake *lbake) /* TODO: validate irradiance and reflection cache independently... */ if (!EEVEE_lightcache_validate( - lbake->lcache, lbake->cube_len, lbake->ref_cube_res, lbake->grid_len, lbake->irr_size)) { + lbake->lcache, lbake->cube_len, lbake->ref_cube_res, lbake->grid_len, lbake->irr_size)) + { eevee->light_cache_data = lbake->lcache = NULL; } @@ -1104,10 +1108,12 @@ static void compute_cell_id(EEVEE_LightGrid *egrid, *r_final_idx = i; cell_id_to_grid_loc(egrid, *r_final_idx, r_local_cell); if (((r_local_cell[0] % *r_stride) == 0) && ((r_local_cell[1] % *r_stride) == 0) && - ((r_local_cell[2] % *r_stride) == 0)) { + ((r_local_cell[2] % *r_stride) == 0)) + { if (!(((r_local_cell[0] % prev_stride) == 0) && ((r_local_cell[1] % prev_stride) == 0) && ((r_local_cell[2] % prev_stride) == 0)) || - ((i == 0) && (lvl == max_lvl))) { + ((i == 0) && (lvl == max_lvl))) + { if (visited_cells == cell_idx) { return; } @@ -1209,7 +1215,8 @@ static void eevee_lightbake_render_grid_sample(void *ved, void *user_data) /* If it is the last sample grid sample (and last bounce). */ if ((lbake->bounce_curr == lbake->bounce_len - 1) && (lbake->grid_curr == lbake->grid_len - 1) && - (lbake->grid_sample == lbake->grid_sample_len - 1)) { + (lbake->grid_sample == lbake->grid_sample_len - 1)) + { lcache->flag &= ~LIGHTCACHE_UPDATE_GRID; } } @@ -1458,7 +1465,8 @@ void EEVEE_lightbake_job(void *custom_data, bool *stop, bool *do_update, float * lbake->probe = lbake->grid_prb + 1; lbake->grid = lcache->grid_data + 1; for (lbake->grid_curr = 1; lbake->grid_curr < lbake->grid_len; - lbake->grid_curr++, lbake->probe++, lbake->grid++) { + lbake->grid_curr++, lbake->probe++, lbake->grid++) + { LightProbe *prb = *lbake->probe; lbake->grid_sample_len = prb->grid_resolution_x * prb->grid_resolution_y * prb->grid_resolution_z; @@ -1476,7 +1484,8 @@ void EEVEE_lightbake_job(void *custom_data, bool *stop, bool *do_update, float * lbake->probe = lbake->cube_prb + 1; lbake->cube = lcache->cube_data + 1; for (lbake->cube_offset = 1; lbake->cube_offset < lbake->cube_len; - lbake->cube_offset++, lbake->probe++, lbake->cube++) { + lbake->cube_offset++, lbake->probe++, lbake->cube++) + { lightbake_do_sample(lbake, eevee_lightbake_render_probe_sample); } } diff --git a/source/blender/draw/engines/eevee/eevee_lightprobes.c b/source/blender/draw/engines/eevee/eevee_lightprobes.c index 20f5d53378f..cba80ebbd3f 100644 --- a/source/blender/draw/engines/eevee/eevee_lightprobes.c +++ b/source/blender/draw/engines/eevee/eevee_lightprobes.c @@ -94,7 +94,8 @@ static void planar_pool_ensure_alloc(EEVEE_Data *vedata, int num_planar_ref) /* Fix case were the pool was allocated width the dummy size (1,1,1). */ if (txl->planar_pool && (num_planar_ref > 0) && (GPU_texture_width(txl->planar_pool) != width || - GPU_texture_height(txl->planar_pool) != height)) { + GPU_texture_height(txl->planar_pool) != height)) + { DRW_TEXTURE_FREE_SAFE(txl->planar_pool); DRW_TEXTURE_FREE_SAFE(txl->planar_depth); } @@ -148,7 +149,8 @@ void EEVEE_lightprobes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) } else { if (scene_eval->eevee.light_cache_data && - (scene_eval->eevee.light_cache_data->flag & LIGHTCACHE_NOT_USABLE)) { + (scene_eval->eevee.light_cache_data->flag & LIGHTCACHE_NOT_USABLE)) + { /* Error message info. */ BLI_snprintf( vedata->info, sizeof(vedata->info), "Error: LightCache cannot be loaded on this GPU"); @@ -437,7 +439,8 @@ void EEVEE_lightprobes_cache_add(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata if ((probe->type == LIGHTPROBE_TYPE_CUBE && pinfo->num_cube >= EEVEE_PROBE_MAX) || (probe->type == LIGHTPROBE_TYPE_GRID && pinfo->num_grid >= EEVEE_PROBE_MAX) || - (probe->type == LIGHTPROBE_TYPE_PLANAR && pinfo->num_planar >= MAX_PLANAR)) { + (probe->type == LIGHTPROBE_TYPE_PLANAR && pinfo->num_planar >= MAX_PLANAR)) + { printf("Too many probes in the view !!!\n"); return; } @@ -708,7 +711,8 @@ void EEVEE_lightprobes_cache_finish(EEVEE_ViewLayerData *sldata, EEVEE_Data *ved /* If light-cache auto-update is enable we tag the relevant part * of the cache to update and fire up a baking job. */ if (!DRW_state_is_image_render() && !DRW_state_is_opengl_render() && - (pinfo->do_grid_update || pinfo->do_cube_update)) { + (pinfo->do_grid_update || pinfo->do_cube_update)) + { BLI_assert(draw_ctx->evil_C); if (draw_ctx->scene->eevee.flag & SCE_EEVEE_GI_AUTOBAKE) { @@ -1249,8 +1253,8 @@ void EEVEE_lightprobes_refresh(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) const Scene *scene_eval = DEG_get_evaluated_scene(draw_ctx->depsgraph); LightCache *light_cache = vedata->stl->g_data->light_cache; - if ((light_cache->flag & LIGHTCACHE_UPDATE_WORLD) && - (light_cache->flag & LIGHTCACHE_BAKED) == 0) { + if ((light_cache->flag & LIGHTCACHE_UPDATE_WORLD) && (light_cache->flag & LIGHTCACHE_BAKED) == 0) + { EEVEE_lightbake_update_world_quick(sldata, vedata, scene_eval); } } diff --git a/source/blender/draw/engines/eevee/eevee_lookdev.c b/source/blender/draw/engines/eevee/eevee_lookdev.c index 85ea69b97f5..78ecd9a2fe4 100644 --- a/source/blender/draw/engines/eevee/eevee_lookdev.c +++ b/source/blender/draw/engines/eevee/eevee_lookdev.c @@ -111,7 +111,8 @@ void EEVEE_lookdev_init(EEVEE_Data *vedata) const int sphere_size = U.lookdev_sphere_size * UI_SCALE_FAC * viewport_scale; if (sphere_size != effects->sphere_size || rect->xmax != effects->anchor[0] || - rect->ymin != effects->anchor[1]) { + rect->ymin != effects->anchor[1]) + { /* Make sphere resolution adaptive to viewport_scale, DPI and #U.lookdev_sphere_size. */ float res_scale = clamp_f( (U.lookdev_sphere_size / 400.0f) * viewport_scale * UI_SCALE_FAC, 0.1f, 1.0f); @@ -176,7 +177,8 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata, /* If one of the component is missing we start from scratch. */ if ((stl->lookdev_grid_data == NULL) || (stl->lookdev_cube_data == NULL) || (txl->lookdev_grid_tx == NULL) || (txl->lookdev_cube_tx == NULL) || - (g_data->light_cache && g_data->light_cache->ref_res != cube_res)) { + (g_data->light_cache && g_data->light_cache->ref_res != cube_res)) + { eevee_lookdev_lightcache_delete(vedata); } @@ -257,7 +259,8 @@ void EEVEE_lookdev_cache_init(EEVEE_Data *vedata, g_data->studiolight_intensity != shading->studiolight_intensity || g_data->studiolight_cubemap_res != scene->eevee.gi_cubemap_resolution || g_data->studiolight_glossy_clamp != scene->eevee.gi_glossy_clamp || - g_data->studiolight_filter_quality != scene->eevee.gi_filter_quality) { + g_data->studiolight_filter_quality != scene->eevee.gi_filter_quality) + { stl->lookdev_lightcache->flag |= LIGHTCACHE_UPDATE_WORLD; g_data->studiolight_index = sl->index; copy_m3_m3(g_data->studiolight_matrix, studiolight_matrix); diff --git a/source/blender/draw/engines/eevee/eevee_motion_blur.c b/source/blender/draw/engines/eevee/eevee_motion_blur.c index 704e932a46c..71455357afa 100644 --- a/source/blender/draw/engines/eevee/eevee_motion_blur.c +++ b/source/blender/draw/engines/eevee/eevee_motion_blur.c @@ -388,7 +388,8 @@ void EEVEE_motion_blur_cache_populate(EEVEE_ViewLayerData *UNUSED(sldata), /* Avoid drawing object that has no motions since object_moves is always true. */ if (!mb_geom->use_deform && /* Object deformation can happen without transform. */ equals_m4m4(mb_data->obmat[MB_PREV], mb_data->obmat[MB_CURR]) && - equals_m4m4(mb_data->obmat[MB_NEXT], mb_data->obmat[MB_CURR])) { + equals_m4m4(mb_data->obmat[MB_NEXT], mb_data->obmat[MB_CURR])) + { return; } @@ -452,7 +453,8 @@ void EEVEE_motion_blur_cache_finish(EEVEE_Data *vedata) for (BLI_ghashIterator_init(&ghi, effects->motion_blur.object); BLI_ghashIterator_done(&ghi) == false; - BLI_ghashIterator_step(&ghi)) { + BLI_ghashIterator_step(&ghi)) + { EEVEE_ObjectMotionData *mb_data = BLI_ghashIterator_getValue(&ghi); EEVEE_HairMotionData *mb_hair = mb_data->hair_data; EEVEE_GeometryMotionData *mb_geom = mb_data->geometry_data; @@ -470,7 +472,8 @@ void EEVEE_motion_blur_cache_finish(EEVEE_Data *vedata) EEVEE_HairMotionStepData **step_data_cache_ptr; if (!BLI_ghash_ensure_p(effects->motion_blur.hair_motion_step_cache[mb_step], vbo, - (void ***)&step_data_cache_ptr)) { + (void ***)&step_data_cache_ptr)) + { EEVEE_HairMotionStepData *new_step_data = MEM_callocN(sizeof(EEVEE_HairMotionStepData), __func__); /* Duplicate the vbo, otherwise it would be lost when evaluating another frame. */ @@ -519,9 +522,9 @@ void EEVEE_motion_blur_cache_finish(EEVEE_Data *vedata) GPU_vertbuf_use(vbo); /* Perform a copy to avoid losing it after RE_engine_frame_set(). */ GPUVertBuf **vbo_cache_ptr; - if (!BLI_ghash_ensure_p(effects->motion_blur.position_vbo_cache[mb_step], - vbo, - (void ***)&vbo_cache_ptr)) { + if (!BLI_ghash_ensure_p( + effects->motion_blur.position_vbo_cache[mb_step], vbo, (void ***)&vbo_cache_ptr)) + { /* Duplicate the vbo, otherwise it would be lost when evaluating another frame. */ GPUVertBuf *duplicated_vbo = GPU_vertbuf_duplicate(vbo); *vbo_cache_ptr = duplicated_vbo; @@ -576,7 +579,8 @@ void EEVEE_motion_blur_swap_data(EEVEE_Data *vedata) /* Rename attributes in #position_vbo_cache. */ for (BLI_ghashIterator_init(&ghi, effects->motion_blur.position_vbo_cache[MB_PREV]); !BLI_ghashIterator_done(&ghi); - BLI_ghashIterator_step(&ghi)) { + BLI_ghashIterator_step(&ghi)) + { GPUVertBuf *vbo = BLI_ghashIterator_getValue(&ghi); GPUVertFormat *format = (GPUVertFormat *)GPU_vertbuf_get_format(vbo); int attrib_id = GPU_vertformat_attr_id_get(format, "nxt"); @@ -585,7 +589,8 @@ void EEVEE_motion_blur_swap_data(EEVEE_Data *vedata) /* Object Data. */ for (BLI_ghashIterator_init(&ghi, effects->motion_blur.object); !BLI_ghashIterator_done(&ghi); - BLI_ghashIterator_step(&ghi)) { + BLI_ghashIterator_step(&ghi)) + { EEVEE_ObjectMotionData *mb_data = BLI_ghashIterator_getValue(&ghi); EEVEE_GeometryMotionData *mb_geom = mb_data->geometry_data; EEVEE_HairMotionData *mb_hair = mb_data->hair_data; diff --git a/source/blender/draw/engines/eevee/eevee_occlusion.c b/source/blender/draw/engines/eevee/eevee_occlusion.c index 85e19927011..78f790e7742 100644 --- a/source/blender/draw/engines/eevee/eevee_occlusion.c +++ b/source/blender/draw/engines/eevee/eevee_occlusion.c @@ -43,7 +43,8 @@ int EEVEE_occlusion_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) } if (scene_eval->eevee.flag & SCE_EEVEE_GTAO_ENABLED || - stl->g_data->render_passes & EEVEE_RENDER_PASS_AO) { + stl->g_data->render_passes & EEVEE_RENDER_PASS_AO) + { const float *viewport_size = DRW_viewport_size_get(); const int fs_size[2] = {(int)viewport_size[0], (int)viewport_size[1]}; @@ -203,8 +204,8 @@ void EEVEE_occlusion_compute(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) } if (GPU_mip_render_workaround() || - GPU_type_matches_ex( - GPU_DEVICE_INTEL_UHD, GPU_OS_WIN, GPU_DRIVER_ANY, GPU_BACKEND_OPENGL)) { + GPU_type_matches_ex(GPU_DEVICE_INTEL_UHD, GPU_OS_WIN, GPU_DRIVER_ANY, GPU_BACKEND_OPENGL)) + { /* Fix dot corruption on intel HD5XX/HD6XX series. */ GPU_flush(); } diff --git a/source/blender/draw/engines/eevee/eevee_render.c b/source/blender/draw/engines/eevee/eevee_render.c index 1be0901085e..4e34b5a5efe 100644 --- a/source/blender/draw/engines/eevee/eevee_render.c +++ b/source/blender/draw/engines/eevee/eevee_render.c @@ -561,7 +561,8 @@ void EEVEE_render_draw(EEVEE_Data *vedata, RenderEngine *engine, RenderLayer *rl double r[3]; if ((stl->effects->enabled_effects & EFFECT_SSR) && (render_samples == 1) && - !stl->effects->ssr_was_valid_double_buffer) { + !stl->effects->ssr_was_valid_double_buffer) + { /* SSR needs one iteration to start properly. * This iteration was done, reset to the original target sample count. */ render_samples--; diff --git a/source/blender/draw/engines/eevee/eevee_renderpasses.c b/source/blender/draw/engines/eevee/eevee_renderpasses.c index 237c830d547..5099d021f2d 100644 --- a/source/blender/draw/engines/eevee/eevee_renderpasses.c +++ b/source/blender/draw/engines/eevee/eevee_renderpasses.c @@ -138,7 +138,8 @@ BLI_INLINE bool eevee_renderpasses_volumetric_active(const EEVEE_EffectsInfo *ef { if (effects->enabled_effects & EFFECT_VOLUMETRIC) { if (g_data->render_passes & - (EEVEE_RENDER_PASS_VOLUME_LIGHT | EEVEE_RENDERPASSES_USES_TRANSMITTANCE)) { + (EEVEE_RENDER_PASS_VOLUME_LIGHT | EEVEE_RENDERPASSES_USES_TRANSMITTANCE)) + { return true; } } @@ -183,7 +184,8 @@ void EEVEE_renderpasses_output_init(EEVEE_ViewLayerData *sldata, } if ((g_data->render_passes & EEVEE_RENDER_PASS_BLOOM) != 0 && - (effects->enabled_effects & EFFECT_BLOOM) != 0) { + (effects->enabled_effects & EFFECT_BLOOM) != 0) + { EEVEE_bloom_output_init(sldata, vedata, tot_samples); } @@ -433,7 +435,8 @@ void EEVEE_renderpasses_draw(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) const int current_sample = stl->effects->taa_current_sample; const int total_samples = stl->effects->taa_total_sample; if ((render_pass & EEVEE_RENDERPASSES_POST_PROCESS_ON_FIRST_SAMPLE) && - (current_sample > 1 && total_samples != 1)) { + (current_sample > 1 && total_samples != 1)) + { return; } diff --git a/source/blender/draw/engines/eevee/eevee_shaders_extra.cc b/source/blender/draw/engines/eevee/eevee_shaders_extra.cc index 07838d7cd76..0b821efc93c 100644 --- a/source/blender/draw/engines/eevee/eevee_shaders_extra.cc +++ b/source/blender/draw/engines/eevee/eevee_shaders_extra.cc @@ -59,7 +59,8 @@ void eevee_shader_material_create_info_amend(GPUMaterial *gpumat, info.define("USE_SHADER_TO_RGBA"); } if (GPU_material_flag_get(gpumat, GPU_MATFLAG_BARYCENTRIC) && !is_volume && !is_hair && - !is_point_cloud && !is_background) { + !is_point_cloud && !is_background) + { info.define("USE_BARYCENTRICS"); info.builtins(BuiltinBits::BARYCENTRIC_COORD); } diff --git a/source/blender/draw/engines/eevee/eevee_shadows.c b/source/blender/draw/engines/eevee/eevee_shadows.c index 1282f8312cb..b602a68f586 100644 --- a/source/blender/draw/engines/eevee/eevee_shadows.c +++ b/source/blender/draw/engines/eevee/eevee_shadows.c @@ -67,7 +67,8 @@ void EEVEE_shadows_init(EEVEE_ViewLayerData *sldata) } if ((linfo->shadow_cascade_size != sh_cascade_size) || - (linfo->shadow_high_bitdepth != sh_high_bitdepth)) { + (linfo->shadow_high_bitdepth != sh_high_bitdepth)) + { BLI_assert((sh_cascade_size > 0) && (sh_cascade_size <= 4096)); DRW_TEXTURE_FREE_SAFE(sldata->shadow_cascade_pool); CLAMP(sh_cascade_size, 1, 4096); diff --git a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c index f7544f503c7..fcdde05a6f0 100644 --- a/source/blender/draw/engines/eevee/eevee_temporal_sampling.c +++ b/source/blender/draw/engines/eevee/eevee_temporal_sampling.c @@ -295,7 +295,8 @@ int EEVEE_temporal_sampling_init(EEVEE_ViewLayerData *UNUSED(sldata), EEVEE_Data if (((effects->taa_total_sample == 0) || (effects->taa_current_sample < effects->taa_total_sample)) || - (!view_is_valid) || DRW_state_is_image_render()) { + (!view_is_valid) || DRW_state_is_image_render()) + { if (view_is_valid) { /* Viewport rendering updates the matrices in `eevee_draw_scene` */ if (!DRW_state_is_image_render()) { @@ -392,7 +393,8 @@ void EEVEE_temporal_sampling_draw(EEVEE_Data *vedata) /* Do reprojection for noise reduction */ /* TODO: do AA jitter if in only render view. */ if (!DRW_state_is_image_render() && (effects->enabled_effects & EFFECT_TAA_REPROJECT) != 0 && - stl->g_data->valid_taa_history) { + stl->g_data->valid_taa_history) + { GPU_framebuffer_bind(effects->target_buffer); DRW_draw_pass(psl->taa_resolve); SWAP_BUFFERS_TAA(); @@ -411,9 +413,9 @@ void EEVEE_temporal_sampling_draw(EEVEE_Data *vedata) effects->taa_current_sample += 1; } else { - if (!DRW_state_is_playback() && - ((effects->taa_total_sample == 0) || - (effects->taa_current_sample < effects->taa_total_sample))) { + if (!DRW_state_is_playback() && ((effects->taa_total_sample == 0) || + (effects->taa_current_sample < effects->taa_total_sample))) + { DRW_viewport_request_redraw(); } } diff --git a/source/blender/draw/engines/eevee/eevee_volumes.c b/source/blender/draw/engines/eevee/eevee_volumes.c index 859713e7c93..823631c126b 100644 --- a/source/blender/draw/engines/eevee/eevee_volumes.c +++ b/source/blender/draw/engines/eevee/eevee_volumes.c @@ -98,7 +98,8 @@ void EEVEE_volumes_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) /* TODO: compute snap to maxZBuffer for clustered rendering. */ if ((common_data->vol_tex_size[0] != tex_size[0]) || (common_data->vol_tex_size[1] != tex_size[1]) || - (common_data->vol_tex_size[2] != tex_size[2])) { + (common_data->vol_tex_size[2] != tex_size[2])) + { DRW_TEXTURE_FREE_SAFE(txl->volume_prop_scattering); DRW_TEXTURE_FREE_SAFE(txl->volume_prop_extinction); DRW_TEXTURE_FREE_SAFE(txl->volume_prop_emission); @@ -243,8 +244,8 @@ void EEVEE_volumes_cache_init(EEVEE_ViewLayerData *sldata, EEVEE_Data *vedata) /* World Volumetric */ struct World *wo = scene->world; - if (wo != NULL && wo->use_nodes && wo->nodetree && - !LOOK_DEV_STUDIO_LIGHT_ENABLED(draw_ctx->v3d)) { + if (wo != NULL && wo->use_nodes && wo->nodetree && !LOOK_DEV_STUDIO_LIGHT_ENABLED(draw_ctx->v3d)) + { struct GPUMaterial *mat = EEVEE_material_get(vedata, scene, NULL, wo, VAR_MAT_VOLUME); if (mat && GPU_material_has_volume_output(mat)) { diff --git a/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl b/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl index 3f07f80571a..83bf29c813d 100644 --- a/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/closure_eval_lib.glsl @@ -82,8 +82,8 @@ } \ \ /* Starts at 1 because 0 is world irradiance. */ \ - for (int i = 1; cl_common.diffuse_accum > 0.0 && i < prbNumRenderGrid && i < MAX_GRID; \ - i++) { \ + for (int i = 1; cl_common.diffuse_accum > 0.0 && i < prbNumRenderGrid && i < MAX_GRID; i++) \ + { \ ClosureGridData grid = closure_grid_eval_init(i, cl_common); \ if (grid.attenuation > 1e-8) { \ CLOSURE_META_SUBROUTINE_DATA(grid_eval, grid, t0, t1, t2, t3); \ diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_gather_frag.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_gather_frag.glsl index 03837b97cb6..2de14ab89b7 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_dof_gather_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_dof_gather_frag.glsl @@ -160,7 +160,8 @@ void dof_gather_accumulator(float base_radius, first_ring = false; if (do_density_change && (ring == change_density_at_ring) && - (density_change < gather_max_density_change)) { + (density_change < gather_max_density_change)) + { if (dof_do_density_change(base_radius, min_intersectable_radius)) { base_radius *= radius_downscale_factor; ring += gather_density_change_ring; diff --git a/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl b/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl index dc382e68d22..fa454dc5412 100644 --- a/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl +++ b/source/blender/draw/engines/eevee/shaders/effect_dof_lib.glsl @@ -312,7 +312,8 @@ float dof_coc_max_slight_focus(float coc1, float coc2) /* Do not consider values below 0.5 for expansion as they are "encoded". * See setup pass shader for more infos. */ if ((coc1 == DOF_TILE_DEFOCUS && coc2 == DOF_TILE_FOCUS) || - (coc1 == DOF_TILE_FOCUS && coc2 == DOF_TILE_DEFOCUS)) { + (coc1 == DOF_TILE_FOCUS && coc2 == DOF_TILE_DEFOCUS)) + { /* Tile where completely out of focus and in focus are both present. * Consider as very slightly out of focus. */ return DOF_TILE_MIXED; diff --git a/source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl b/source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl index f17c9b2bb51..6b95a6e4c67 100644 --- a/source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl +++ b/source/blender/draw/engines/eevee/shaders/volumetric_scatter_frag.glsl @@ -59,7 +59,8 @@ void main() vec3 prev_volume = ndc_to_volume(prev_ndc * 0.5 + 0.5); if ((volHistoryAlpha > 0.0) && all(greaterThan(prev_volume, vec3(0.0))) && - all(lessThan(prev_volume, vec3(1.0)))) { + all(lessThan(prev_volume, vec3(1.0)))) + { vec4 h_Scattering = texture(historyScattering, prev_volume); vec4 h_Transmittance = texture(historyTransmittance, prev_volume); outScattering = mix(outScattering, h_Scattering, volHistoryAlpha); diff --git a/source/blender/draw/engines/eevee_next/eevee_cryptomatte.cc b/source/blender/draw/engines/eevee_next/eevee_cryptomatte.cc index db888df1973..9e5c9267981 100644 --- a/source/blender/draw/engines/eevee_next/eevee_cryptomatte.cc +++ b/source/blender/draw/engines/eevee_next/eevee_cryptomatte.cc @@ -43,7 +43,8 @@ void Cryptomatte::begin_sync() } if (!(enabled_passes & - (EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT | EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET))) { + (EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT | EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET))) + { cryptomatte_object_buf.resize(16); } } @@ -52,7 +53,8 @@ void Cryptomatte::sync_object(Object *ob, ResourceHandle res_handle) { const eViewLayerEEVEEPassType enabled_passes = inst_.film.enabled_passes_get(); if (!(enabled_passes & - (EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT | EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET))) { + (EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT | EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET))) + { return; } diff --git a/source/blender/draw/engines/eevee_next/eevee_depth_of_field.cc b/source/blender/draw/engines/eevee_next/eevee_depth_of_field.cc index 92eeb31ad4d..1c2b9bafd66 100644 --- a/source/blender/draw/engines/eevee_next/eevee_depth_of_field.cc +++ b/source/blender/draw/engines/eevee_next/eevee_depth_of_field.cc @@ -126,7 +126,8 @@ void DepthOfField::sync() /* Balance blur radius between fx dof and jitter dof. */ if (do_jitter_ && (inst_.sampling.dof_ring_count_get() > 0) && !camera.is_panoramic() && - !inst_.is_viewport()) { + !inst_.is_viewport()) + { /* Compute a minimal overblur radius to fill the gaps between the samples. * This is just the simplified form of dividing the area of the bokeh by * the number of samples. */ diff --git a/source/blender/draw/engines/eevee_next/eevee_instance.cc b/source/blender/draw/engines/eevee_next/eevee_instance.cc index b0a40d27982..95bcf92d32c 100644 --- a/source/blender/draw/engines/eevee_next/eevee_instance.cc +++ b/source/blender/draw/engines/eevee_next/eevee_instance.cc @@ -286,7 +286,8 @@ void Instance::render_read_result(RenderLayer *render_layer, const char *view_na /* The vector pass is initialized to weird values. Set it to neutral value if not rendered. */ if ((pass_bits & EEVEE_RENDER_PASS_VECTOR) == 0) { for (std::string vector_pass_name : - Film::pass_to_render_pass_names(EEVEE_RENDER_PASS_VECTOR, view_layer)) { + Film::pass_to_render_pass_names(EEVEE_RENDER_PASS_VECTOR, view_layer)) + { RenderPass *vector_rp = RE_pass_find_by_name( render_layer, vector_pass_name.c_str(), view_name); if (vector_rp) { diff --git a/source/blender/draw/engines/eevee_next/eevee_material.cc b/source/blender/draw/engines/eevee_next/eevee_material.cc index a210681517a..321af18b933 100644 --- a/source/blender/draw/engines/eevee_next/eevee_material.cc +++ b/source/blender/draw/engines/eevee_next/eevee_material.cc @@ -197,7 +197,8 @@ MaterialPass MaterialModule::material_pass_get(Object *ob, MAT_PIPE_FORWARD, MAT_PIPE_FORWARD_PREPASS, MAT_PIPE_FORWARD_PREPASS_VELOCITY) && - GPU_material_flag_get(matpass.gpumat, GPU_MATFLAG_TRANSPARENT)) { + GPU_material_flag_get(matpass.gpumat, GPU_MATFLAG_TRANSPARENT)) + { /* Transparent pass is generated later. */ matpass.sub_pass = nullptr; } diff --git a/source/blender/draw/engines/eevee_next/eevee_shader.cc b/source/blender/draw/engines/eevee_next/eevee_shader.cc index 116d6004642..26d9642a525 100644 --- a/source/blender/draw/engines/eevee_next/eevee_shader.cc +++ b/source/blender/draw/engines/eevee_next/eevee_shader.cc @@ -257,7 +257,8 @@ void ShaderModule::material_create_info_ammend(GPUMaterial *gpumat, GPUCodegenOu } if (GPU_material_flag_get(gpumat, GPU_MATFLAG_TRANSPARENT) == false && - pipeline_type == MAT_PIPE_FORWARD) { + pipeline_type == MAT_PIPE_FORWARD) + { /* Opaque forward do support AOVs and render pass if not using transparency. */ info.additional_info("eevee_aov_out"); info.additional_info("eevee_render_pass_out"); diff --git a/source/blender/draw/engines/eevee_next/eevee_shadow.cc b/source/blender/draw/engines/eevee_next/eevee_shadow.cc index 81e84d12961..80c82819a5a 100644 --- a/source/blender/draw/engines/eevee_next/eevee_shadow.cc +++ b/source/blender/draw/engines/eevee_next/eevee_shadow.cc @@ -69,7 +69,8 @@ void ShadowTileMap::sync_cubeface( const float4x4 &object_mat_, float near_, float far_, eCubeFace face, float lod_bias_) { if (projection_type != SHADOW_PROJECTION_CUBEFACE || (cubeface != face) || (near != near_) || - (far != far_)) { + (far != far_)) + { set_dirty(); } projection_type = SHADOW_PROJECTION_CUBEFACE; @@ -1018,7 +1019,8 @@ void ShadowModule::debug_end_sync() eDebugMode::DEBUG_SHADOW_TILEMAPS, eDebugMode::DEBUG_SHADOW_VALUES, eDebugMode::DEBUG_SHADOW_TILE_RANDOM_COLOR, - eDebugMode::DEBUG_SHADOW_TILEMAP_RANDOM_COLOR)) { + eDebugMode::DEBUG_SHADOW_TILEMAP_RANDOM_COLOR)) + { return; } @@ -1156,7 +1158,8 @@ void ShadowModule::debug_draw(View &view, GPUFrameBuffer *view_fb) eDebugMode::DEBUG_SHADOW_TILEMAPS, eDebugMode::DEBUG_SHADOW_VALUES, eDebugMode::DEBUG_SHADOW_TILE_RANDOM_COLOR, - eDebugMode::DEBUG_SHADOW_TILEMAP_RANDOM_COLOR)) { + eDebugMode::DEBUG_SHADOW_TILEMAP_RANDOM_COLOR)) + { return; } diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_accumulator_lib.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_accumulator_lib.glsl index 957c9b01a2a..8305bd4252e 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_accumulator_lib.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_accumulator_lib.glsl @@ -524,7 +524,8 @@ void dof_gather_accumulator(sampler2D color_tx, first_ring = false; if (do_density_change && (ring == change_density_at_ring) && - (density_change < gather_max_density_change)) { + (density_change < gather_max_density_change)) + { if (dof_do_density_change(base_radius, min_intersectable_radius)) { base_radius *= radius_downscale_factor; ring += gather_density_change_ring; diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_stabilize_comp.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_stabilize_comp.glsl index 8ecaa0688a1..960097a2e2b 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_stabilize_comp.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_depth_of_field_stabilize_comp.glsl @@ -315,7 +315,8 @@ float dof_history_blend_factor( blend = mix(blend, 1.0, coc_diff_ratio); /* Discard out of view history. */ if (any(lessThan(texel, vec2(0))) || - any(greaterThanEqual(texel, vec2(imageSize(out_history_img))))) { + any(greaterThanEqual(texel, vec2(imageSize(out_history_img))))) + { blend = 1.0; } /* Discard history if invalid. */ diff --git a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_debug_frag.glsl b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_debug_frag.glsl index 1e3884bfcfb..67d06ef78a8 100644 --- a/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_debug_frag.glsl +++ b/source/blender/draw/engines/eevee_next/shaders/eevee_shadow_debug_frag.glsl @@ -104,8 +104,8 @@ bool debug_tilemaps(vec3 P, LightData light) int tile_index = shadow_tile_offset(px % SHADOW_TILEMAP_RES, tilemap.tiles_index, 0); ShadowTileData tile = shadow_tile_unpack(tiles_buf[tile_index]); /* Leave 1 px border between tilemaps. */ - if (!any( - equal(ivec2(gl_FragCoord.xy) % (SHADOW_TILEMAP_RES * debug_tile_size_px), ivec2(0)))) { + if (!any(equal(ivec2(gl_FragCoord.xy) % (SHADOW_TILEMAP_RES * debug_tile_size_px), ivec2(0)))) + { gl_FragDepth = 0.0; out_color_add = vec4(debug_tile_state_color(tile), 0.0); out_color_mul = vec4(0.0); diff --git a/source/blender/draw/engines/external/external_engine.c b/source/blender/draw/engines/external/external_engine.c index 11f147d5e36..2f540df235b 100644 --- a/source/blender/draw/engines/external/external_engine.c +++ b/source/blender/draw/engines/external/external_engine.c @@ -191,7 +191,8 @@ static void external_cache_populate(void *vedata, Object *ob) } if (!(DRW_object_is_renderable(ob) && - DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF)) { + DRW_object_visibility_in_active_context(ob) & OB_VISIBLE_SELF)) + { return; } diff --git a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c index ec67c8cfbe4..4616fc48473 100644 --- a/source/blender/draw/engines/gpencil/gpencil_cache_utils.c +++ b/source/blender/draw/engines/gpencil/gpencil_cache_utils.c @@ -49,7 +49,8 @@ GPENCIL_tObject *gpencil_object_cache_add(GPENCIL_PrivateData *pd, Object *ob) for (int i = 0; i < tot_materials; i++) { MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, i + 1); if (((gp_style != NULL) && (gp_style->flag & GP_MATERIAL_IS_STROKE_HOLDOUT)) || - (gp_style->flag & GP_MATERIAL_IS_FILL_HOLDOUT)) { + (gp_style->flag & GP_MATERIAL_IS_FILL_HOLDOUT)) + { tgp_ob->do_mat_holdout = true; break; } @@ -299,7 +300,8 @@ GPENCIL_tLayer *gpencil_layer_cache_add(GPENCIL_PrivateData *pd, LISTBASE_FOREACH (bGPDlayer_Mask *, mask, &gpl->mask_layers) { bGPDlayer *gpl_mask = BKE_gpencil_layer_named_get(gpd, mask->name); if (gpl_mask && (gpl_mask != gpl) && ((gpl_mask->flag & GP_LAYER_HIDE) == 0) && - ((mask->flag & GP_MASK_HIDE) == 0)) { + ((mask->flag & GP_MASK_HIDE) == 0)) + { int index = BLI_findindex(&gpd->layers, gpl_mask); if (index < GP_MAX_MASKBITS) { const bool invert = (mask->flag & GP_MASK_INVERT) != 0; diff --git a/source/blender/draw/engines/gpencil/gpencil_engine.c b/source/blender/draw/engines/gpencil/gpencil_engine.c index 09667ff95ad..03c4c05b5b5 100644 --- a/source/blender/draw/engines/gpencil/gpencil_engine.c +++ b/source/blender/draw/engines/gpencil/gpencil_engine.c @@ -112,7 +112,8 @@ void GPENCIL_engine_init(void *ved) stl->pd->v3d_color_type = (v3d->shading.type == OB_SOLID) ? v3d->shading.color_type : -1; /* Special case: If Vertex Paint mode, use always Vertex mode. */ if (v3d->shading.type == OB_SOLID && ctx->obact && ctx->obact->type == OB_GPENCIL_LEGACY && - ctx->obact->mode == OB_MODE_VERTEX_GPENCIL) { + ctx->obact->mode == OB_MODE_VERTEX_GPENCIL) + { stl->pd->v3d_color_type = V3D_SHADING_VERTEX_COLOR; } @@ -473,8 +474,8 @@ static void gpencil_stroke_cache_populate(bGPDlayer *gpl, iter->pd->use_multiedit_lines_only; bool is_onion = gpl && gpf && gpf->runtime.onion_id != 0; bool hide_onion = is_onion && ((gp_style->flag & GP_MATERIAL_HIDE_ONIONSKIN) != 0); - if ((hide_material) || (!show_stroke && !show_fill) || (only_lines && !is_onion) || - (hide_onion)) { + if ((hide_material) || (!show_stroke && !show_fill) || (only_lines && !is_onion) || (hide_onion)) + { return; } @@ -917,7 +918,8 @@ void GPENCIL_draw_scene(void *ved) /* Fade 3D objects. */ if ((!pd->is_render) && (pd->fade_3d_object_opacity > -1.0f) && (pd->obact != NULL) && - (pd->obact->type == OB_GPENCIL_LEGACY)) { + (pd->obact->type == OB_GPENCIL_LEGACY)) + { float background_color[3]; ED_view3d_background_color_get(pd->scene, pd->v3d, background_color); /* Blend color. */ diff --git a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c index 2f2620e2a63..67b53384336 100644 --- a/source/blender/draw/engines/gpencil/gpencil_shader_fx.c +++ b/source/blender/draw/engines/gpencil/gpencil_shader_fx.c @@ -37,7 +37,8 @@ static bool effect_is_active(bGPdata *gpd, ShaderFxData *fx, bool is_viewport) } if (((fx->mode & eShaderFxMode_Realtime) && (is_viewport == true)) || - ((fx->mode & eShaderFxMode_Render) && (is_viewport == false))) { + ((fx->mode & eShaderFxMode_Render) && (is_viewport == false))) + { return true; } diff --git a/source/blender/draw/engines/image/image_drawing_mode.hh b/source/blender/draw/engines/image/image_drawing_mode.hh index e1499cf2711..afed17118d0 100644 --- a/source/blender/draw/engines/image/image_drawing_mode.hh +++ b/source/blender/draw/engines/image/image_drawing_mode.hh @@ -208,7 +208,8 @@ template class ScreenTileTextures : public BaseTextureMethod { bool assigned = false; for (TextureInfoBounds &info_bound : info_bounds) { if (info_bound.info == nullptr && - BLI_rctf_compare(&info_bound.uv_bounds, &info.clipping_uv_bounds, 0.001)) { + BLI_rctf_compare(&info_bound.uv_bounds, &info.clipping_uv_bounds, 0.001)) + { info_bound.info = &info; info.tile_id = info_bound.tile_id; assigned = true; @@ -490,8 +491,8 @@ template class ScreenSpaceDrawingMode : public AbstractD &extracted_buffer, texture_region_width, texture_region_height, 32, IB_rectfloat); int offset = 0; - for (int y = gpu_texture_region_to_update.ymin; y < gpu_texture_region_to_update.ymax; - y++) { + for (int y = gpu_texture_region_to_update.ymin; y < gpu_texture_region_to_update.ymax; y++) + { float yf = y / (float)texture_height; float v = info.clipping_uv_bounds.ymax * yf + info.clipping_uv_bounds.ymin * (1.0 - yf) - tile_offset_y; diff --git a/source/blender/draw/engines/overlay/overlay_armature.cc b/source/blender/draw/engines/overlay/overlay_armature.cc index 20a9cde5310..4b71934ece7 100644 --- a/source/blender/draw/engines/overlay/overlay_armature.cc +++ b/source/blender/draw/engines/overlay/overlay_armature.cc @@ -98,7 +98,8 @@ bool OVERLAY_armature_is_pose_mode(Object *ob, const DRWContextState *draw_ctx) /* Pose armature is handled by pose mode engine. */ if (((ob == active_ob) || (ob->mode & OB_MODE_POSE)) && - ((draw_ctx->object_mode & OB_MODE_POSE) != 0)) { + ((draw_ctx->object_mode & OB_MODE_POSE) != 0)) + { return true; } @@ -1096,7 +1097,8 @@ static const float *get_bone_solid_with_consts_color(const ArmatureDrawContext * static float consts_color[4]; if ((arm->flag & ARM_POSEMODE) && !(boneflag & BONE_DRAW_LOCKED_WEIGHT) && - set_pchan_color(ctx, PCHAN_COLOR_CONSTS, boneflag, constflag, consts_color)) { + set_pchan_color(ctx, PCHAN_COLOR_CONSTS, boneflag, constflag, consts_color)) + { interp_v3_v3v3(consts_color, col, consts_color, 0.5f); } else { @@ -1551,7 +1553,8 @@ static void draw_points(ArmatureDrawContext *ctx, /* Draw root point if we are not connected to our parent */ if (!(eBone ? (eBone->parent && (boneflag & BONE_CONNECTED)) : - (pchan->bone->parent && (boneflag & BONE_CONNECTED)))) { + (pchan->bone->parent && (boneflag & BONE_CONNECTED)))) + { if (select_id != -1) { DRW_select_load_id(select_id | BONESEL_ROOT); } @@ -1681,7 +1684,8 @@ static void draw_bone_envelope(ArmatureDrawContext *ctx, } if ((select_id == -1) && (boneflag & BONE_NO_DEFORM) == 0 && - ((boneflag & BONE_SELECTED) || (eBone && (boneflag & (BONE_ROOTSEL | BONE_TIPSEL))))) { + ((boneflag & BONE_SELECTED) || (eBone && (boneflag & (BONE_ROOTSEL | BONE_TIPSEL))))) + { drw_shgroup_bone_envelope_distance( ctx, BONE_VAR(eBone, pchan, disp_mat), rad_head, rad_tail, distance); } @@ -1732,7 +1736,8 @@ static void draw_bone_line(ArmatureDrawContext *ctx, /* Draw root point if we are not connected to our parent. */ if (!(eBone ? (eBone->parent && (boneflag & BONE_CONNECTED)) : - (pchan->bone->parent && (boneflag & BONE_CONNECTED)))) { + (pchan->bone->parent && (boneflag & BONE_CONNECTED)))) + { if (eBone) { col_head = (eBone->flag & BONE_ROOTSEL) ? &G_draw.block.color_vertex_select.x : col_bone; @@ -2060,7 +2065,8 @@ static void draw_bone_relations(ArmatureDrawContext *ctx, /* Only draw if bone or its parent is selected - reduces viewport complexity with complex * rigs */ if ((boneflag & BONE_SELECTED) || - (pchan->parent->bone && (pchan->parent->bone->flag & BONE_SELECTED))) { + (pchan->parent->bone && (pchan->parent->bone->flag & BONE_SELECTED))) + { if ((boneflag & BONE_CONNECTED) == 0) { draw_bone_bone_relationship_line(ctx, pchan->pose_head, @@ -2261,7 +2267,8 @@ static void draw_armature_edit(ArmatureDrawContext *ctx) for (eBone = static_cast(arm->edbo->first), index = ob_orig->runtime.select_id; eBone; - eBone = eBone->next, index += 0x10000) { + eBone = eBone->next, index += 0x10000) + { if (eBone->layer & arm->layer) { if ((eBone->flag & BONE_HIDDEN_A) == 0) { const int select_id = is_select ? index : uint(-1); @@ -2366,11 +2373,12 @@ static void draw_armature_pose(ArmatureDrawContext *ctx) /* In weight paint mode retrieve the vertex group lock status. */ if ((draw_ctx->object_mode & OB_MODE_ALL_WEIGHT_PAINT) && (draw_ctx->object_pose == ob) && - (draw_ctx->obact != nullptr)) { + (draw_ctx->obact != nullptr)) + { draw_locked_weights = true; - for (pchan = static_cast(ob->pose->chanbase.first); pchan; - pchan = pchan->next) { + for (pchan = static_cast(ob->pose->chanbase.first); pchan; pchan = pchan->next) + { pchan->bone->flag &= ~BONE_DRAW_LOCKED_WEIGHT; } @@ -2391,7 +2399,8 @@ static void draw_armature_pose(ArmatureDrawContext *ctx) const DRWView *view = is_pose_select ? DRW_view_default_get() : nullptr; for (pchan = static_cast(ob->pose->chanbase.first); pchan; - pchan = pchan->next, index += 0x10000) { + pchan = pchan->next, index += 0x10000) + { Bone *bone = pchan->bone; const bool bone_visible = (bone->flag & (BONE_HIDDEN_P | BONE_HIDDEN_PG)) == 0; diff --git a/source/blender/draw/engines/overlay/overlay_background.cc b/source/blender/draw/engines/overlay/overlay_background.cc index 2442efc033e..41e59fe3b9f 100644 --- a/source/blender/draw/engines/overlay/overlay_background.cc +++ b/source/blender/draw/engines/overlay/overlay_background.cc @@ -51,7 +51,8 @@ void OVERLAY_background_cache_init(OVERLAY_Data *vedata) color_override[3] = 1.0f; } else if (v3d->shading.background_type == V3D_SHADING_BACKGROUND_VIEWPORT && - v3d->shading.type <= OB_SOLID) { + v3d->shading.type <= OB_SOLID) + { background_type = BG_SOLID; copy_v3_v3(color_override, v3d->shading.background_color); color_override[3] = 1.0f; diff --git a/source/blender/draw/engines/overlay/overlay_edit_uv.cc b/source/blender/draw/engines/overlay/overlay_edit_uv.cc index d712b163c9b..90c83357477 100644 --- a/source/blender/draw/engines/overlay/overlay_edit_uv.cc +++ b/source/blender/draw/engines/overlay/overlay_edit_uv.cc @@ -416,7 +416,8 @@ void OVERLAY_edit_uv_cache_init(OVERLAY_Data *vedata) * first one in the order that is used during uv editing. We can only trust that the first object * has the correct batches with the correct selection state. See #83187. */ if ((pd->edit_uv.do_uv_overlay || pd->edit_uv.do_uv_shadow_overlay) && - draw_ctx->obact->type == OB_MESH) { + draw_ctx->obact->type == OB_MESH) + { uint objects_len = 0; Object **objects = BKE_view_layer_array_from_objects_in_mode_unique_data( draw_ctx->scene, draw_ctx->view_layer, nullptr, &objects_len, draw_ctx->object_mode); diff --git a/source/blender/draw/engines/overlay/overlay_extra.cc b/source/blender/draw/engines/overlay/overlay_extra.cc index 13feaf708aa..bc0b19f3aaa 100644 --- a/source/blender/draw/engines/overlay/overlay_extra.cc +++ b/source/blender/draw/engines/overlay/overlay_extra.cc @@ -317,7 +317,8 @@ void OVERLAY_empty_shape(OVERLAY_ExtraCallBuffers *cb, void OVERLAY_empty_cache_populate(OVERLAY_Data *vedata, Object *ob) { if (((ob->base_flag & BASE_FROM_DUPLI) != 0) && ((ob->transflag & OB_DUPLICOLLECTION) != 0) && - ob->instance_collection) { + ob->instance_collection) + { return; } @@ -980,7 +981,8 @@ static void camera_view3d_reconstruction( } if ((v3d->flag2 & V3D_SHOW_CAMERAPATH) && (tracking_object->flag & TRACKING_OBJECT_CAMERA) && - !is_select) { + !is_select) + { const MovieTrackingReconstruction *reconstruction = &tracking_object->reconstruction; if (reconstruction->camnr) { @@ -1295,7 +1297,8 @@ static void OVERLAY_relationship_lines(OVERLAY_ExtraCallBuffers *cb, for (GpencilModifierData *md = static_cast(ob->greasepencil_modifiers.first); md; - md = md->next) { + md = md->next) + { if (md->type == eGpencilModifierType_Hook) { HookGpencilModifierData *hmd = (HookGpencilModifierData *)md; float center[3]; diff --git a/source/blender/draw/engines/overlay/overlay_gpencil.cc b/source/blender/draw/engines/overlay/overlay_gpencil.cc index 7e0ac4f3d06..b9868e794ad 100644 --- a/source/blender/draw/engines/overlay/overlay_gpencil.cc +++ b/source/blender/draw/engines/overlay/overlay_gpencil.cc @@ -97,7 +97,8 @@ void OVERLAY_edit_gpencil_cache_init(OVERLAY_Data *vedata) (ts->gpencil_selectmode_edit != GP_SELECTMODE_STROKE)); if (!GPENCIL_CURVE_EDIT_SESSIONS_ON(gpd) && - ((!GPENCIL_VERTEX_MODE(gpd) && !GPENCIL_PAINT_MODE(gpd)) || use_vertex_mask)) { + ((!GPENCIL_VERTEX_MODE(gpd) && !GPENCIL_PAINT_MODE(gpd)) || use_vertex_mask)) + { DRWState state = DRW_STATE_WRITE_COLOR | DRW_STATE_WRITE_DEPTH | DRW_STATE_DEPTH_LESS_EQUAL | DRW_STATE_BLEND_ALPHA; DRW_PASS_CREATE(psl->edit_gpencil_ps, state | pd->clipping_state); @@ -187,7 +188,8 @@ void OVERLAY_edit_gpencil_cache_init(OVERLAY_Data *vedata) DRW_shgroup_uniform_vec3_copy(grp, "pPosition", ts->gp_sculpt.guide.location); } else if (ts->gp_sculpt.guide.reference_point == GP_GUIDE_REF_OBJECT && - ts->gp_sculpt.guide.reference_object != nullptr) { + ts->gp_sculpt.guide.reference_object != nullptr) + { UI_GetThemeColor4fv(TH_GIZMO_SECONDARY, color); DRW_shgroup_uniform_vec3_copy(grp, "pPosition", ts->gp_sculpt.guide.reference_object->loc); } @@ -440,7 +442,8 @@ void OVERLAY_gpencil_cache_populate(OVERLAY_Data *vedata, Object *ob) /* don't show object extras in set's */ if ((ob->base_flag & (BASE_FROM_SET | BASE_FROM_DUPLI)) == 0) { if ((v3d->gp_flag & V3D_GP_SHOW_MATERIAL_NAME) && (ob->mode == OB_MODE_EDIT_GPENCIL) && - DRW_state_show_text()) { + DRW_state_show_text()) + { OVERLAY_gpencil_color_names(ob); } } diff --git a/source/blender/draw/engines/overlay/overlay_grid.cc b/source/blender/draw/engines/overlay/overlay_grid.cc index b38825723f4..2ff8022ed26 100644 --- a/source/blender/draw/engines/overlay/overlay_grid.cc +++ b/source/blender/draw/engines/overlay/overlay_grid.cc @@ -89,7 +89,8 @@ void OVERLAY_grid_init(OVERLAY_Data *vedata) const bool show_ortho_grid = (pd->v3d_gridflag & V3D_SHOW_ORTHO_GRID) != 0; if (pd->hide_overlays || !(pd->v3d_gridflag & (V3D_SHOW_X | V3D_SHOW_Y | V3D_SHOW_Z | - V3D_SHOW_FLOOR | V3D_SHOW_ORTHO_GRID))) { + V3D_SHOW_FLOOR | V3D_SHOW_ORTHO_GRID))) + { return; } diff --git a/source/blender/draw/engines/overlay/overlay_image.cc b/source/blender/draw/engines/overlay/overlay_image.cc index e6b5a386aa7..01a136e3a26 100644 --- a/source/blender/draw/engines/overlay/overlay_image.cc +++ b/source/blender/draw/engines/overlay/overlay_image.cc @@ -454,7 +454,8 @@ void OVERLAY_image_scene_background_draw(OVERLAY_Data *vedata) OVERLAY_PassList *psl = vedata->psl; if (DRW_state_is_fbo() && (!DRW_pass_is_empty(psl->image_background_scene_ps) || - !DRW_pass_is_empty(psl->image_foreground_scene_ps))) { + !DRW_pass_is_empty(psl->image_foreground_scene_ps))) + { const DefaultFramebufferList *dfbl = DRW_viewport_framebuffer_list_get(); GPU_framebuffer_bind(dfbl->default_fb); diff --git a/source/blender/draw/engines/overlay/overlay_sculpt_curves.cc b/source/blender/draw/engines/overlay/overlay_sculpt_curves.cc index 7114c01cd3a..51ac7a29fec 100644 --- a/source/blender/draw/engines/overlay/overlay_sculpt_curves.cc +++ b/source/blender/draw/engines/overlay/overlay_sculpt_curves.cc @@ -99,8 +99,8 @@ void OVERLAY_sculpt_curves_cache_populate(OVERLAY_Data *vedata, Object *object) { populate_selection_overlay(vedata, object); const View3DOverlay &overlay = vedata->stl->pd->overlay; - if ((overlay.flag & V3D_OVERLAY_SCULPT_CURVES_CAGE) && - overlay.sculpt_curves_cage_opacity > 0.0f) { + if ((overlay.flag & V3D_OVERLAY_SCULPT_CURVES_CAGE) && overlay.sculpt_curves_cage_opacity > 0.0f) + { populate_edit_overlay(vedata, object); } } diff --git a/source/blender/draw/engines/overlay/overlay_wireframe.cc b/source/blender/draw/engines/overlay/overlay_wireframe.cc index fd6259f4cb1..67f80e5844b 100644 --- a/source/blender/draw/engines/overlay/overlay_wireframe.cc +++ b/source/blender/draw/engines/overlay/overlay_wireframe.cc @@ -195,7 +195,8 @@ void OVERLAY_wireframe_cache_populate(OVERLAY_Data *vedata, if (use_wire && pd->wireframe_mode && ob->particlesystem.first) { for (ParticleSystem *psys = static_cast(ob->particlesystem.first); psys != nullptr; - psys = psys->next) { + psys = psys->next) + { if (!DRW_object_is_visible_psys_in_active_context(ob, psys)) { continue; } diff --git a/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_point_vert.glsl b/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_point_vert.glsl index dc359099a5b..8b1dc6fa88b 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_point_vert.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_edit_curve_point_vert.glsl @@ -27,7 +27,8 @@ void main() bool show_handle = showCurveHandles; if ((uint(curveHandleDisplay) == CURVE_HANDLE_SELECTED) && - ((data & VERT_SELECTED_BEZT_HANDLE) == 0u)) { + ((data & VERT_SELECTED_BEZT_HANDLE) == 0u)) + { show_handle = false; } diff --git a/source/blender/draw/engines/overlay/shaders/overlay_grid_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_grid_frag.glsl index 2b333696f94..1a44c5ccb84 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_grid_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_grid_frag.glsl @@ -106,7 +106,8 @@ void main() if (flag_test(grid_flag, PLANE_IMAGE) && /* Grid begins to appear when the length of one grid unit is at least * (256/grid_size) pixels Value of grid_size defined in `overlay_grid.c`. */ - !flag_test(grid_flag, CUSTOM_GRID)) { + !flag_test(grid_flag, CUSTOM_GRID)) + { grid_res = grid_buf.zoom_factor; } diff --git a/source/blender/draw/engines/overlay/shaders/overlay_outline_prepass_gpencil_frag.glsl b/source/blender/draw/engines/overlay/shaders/overlay_outline_prepass_gpencil_frag.glsl index c5d6bae390b..626d606c0ea 100644 --- a/source/blender/draw/engines/overlay/shaders/overlay_outline_prepass_gpencil_frag.glsl +++ b/source/blender/draw/engines/overlay/shaders/overlay_outline_prepass_gpencil_frag.glsl @@ -16,7 +16,8 @@ void main() gp_interp.sspos.zw, gp_interp.aspect, gp_interp.thickness.x, - gp_interp.hardness) < 0.001) { + gp_interp.hardness) < 0.001) + { discard; return; } diff --git a/source/blender/draw/engines/select/select_engine.c b/source/blender/draw/engines/select/select_engine.c index afe36903cfa..1cf5586c146 100644 --- a/source/blender/draw/engines/select/select_engine.c +++ b/source/blender/draw/engines/select/select_engine.c @@ -51,7 +51,8 @@ static void select_engine_framebuffer_setup(void) } if ((e_data.texture_u32 != NULL) && ((GPU_texture_width(e_data.texture_u32) != size[0]) || - (GPU_texture_height(e_data.texture_u32) != size[1]))) { + (GPU_texture_height(e_data.texture_u32) != size[1]))) + { GPU_texture_free(e_data.texture_u32); e_data.texture_u32 = NULL; } diff --git a/source/blender/draw/engines/workbench/workbench_effect_dof.c b/source/blender/draw/engines/workbench/workbench_effect_dof.c index a7247f4e9a6..54a1f813fba 100644 --- a/source/blender/draw/engines/workbench/workbench_effect_dof.c +++ b/source/blender/draw/engines/workbench/workbench_effect_dof.c @@ -130,7 +130,8 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata) Camera *cam = camera != NULL && camera->type == OB_CAMERA ? camera->data : NULL; if ((wpd->shading.flag & V3D_SHADING_DEPTH_OF_FIELD) == 0 || (cam == NULL) || - ((cam->dof.flag & CAM_DOF_ENABLED) == 0)) { + ((cam->dof.flag & CAM_DOF_ENABLED) == 0)) + { wpd->dof_enabled = false; /* Cleanup. */ @@ -226,7 +227,8 @@ void workbench_dof_engine_init(WORKBENCH_Data *vedata) float ratio = 1.0f / cam->dof.aperture_ratio; if (wpd->vldata->dof_sample_ubo == NULL || blades != wpd->dof_blades || - rotation != wpd->dof_rotation || ratio != wpd->dof_ratio) { + rotation != wpd->dof_rotation || ratio != wpd->dof_ratio) + { wpd->dof_blades = blades; wpd->dof_rotation = rotation; wpd->dof_ratio = ratio; diff --git a/source/blender/draw/engines/workbench/workbench_engine.c b/source/blender/draw/engines/workbench/workbench_engine.c index 2fea8bfe805..7eeea7eba66 100644 --- a/source/blender/draw/engines/workbench/workbench_engine.c +++ b/source/blender/draw/engines/workbench/workbench_engine.c @@ -342,7 +342,8 @@ static eV3DShadingColorType workbench_color_type_get(WORKBENCH_PrivateData *wpd, } if (is_sculpt_pbvh && color_type == V3D_SHADING_TEXTURE_COLOR && - BKE_pbvh_type(BKE_object_sculpt_pbvh_get(ob)) != PBVH_FACES) { + BKE_pbvh_type(BKE_object_sculpt_pbvh_get(ob)) != PBVH_FACES) + { /* Force use of material color for sculpt. */ color_type = V3D_SHADING_MATERIAL_COLOR; } diff --git a/source/blender/draw/engines/workbench/workbench_shadow.c b/source/blender/draw/engines/workbench/workbench_shadow.c index 655093a3fd4..3503ec82c13 100644 --- a/source/blender/draw/engines/workbench/workbench_shadow.c +++ b/source/blender/draw/engines/workbench/workbench_shadow.c @@ -221,7 +221,8 @@ static float workbench_shadow_object_shadow_distance(WORKBENCH_PrivateData *wpd, wpd->shadow_cached_direction, wpd->shadow_far_plane, &dist_isect, - true)) { + true)) + { if (dist_isect < dist) { dist = dist_isect; } @@ -251,7 +252,8 @@ static bool workbench_shadow_camera_in_object_shadow(WORKBENCH_PrivateData *wpd, if ((oed->shadow_min[0] > wpd->shadow_near_max[0]) || (oed->shadow_max[0] < wpd->shadow_near_min[0]) || (oed->shadow_min[1] > wpd->shadow_near_max[1]) || - (oed->shadow_max[1] < wpd->shadow_near_min[1])) { + (oed->shadow_max[1] < wpd->shadow_near_min[1])) + { return false; } /* Test projected near rectangle sides */ diff --git a/source/blender/draw/engines/workbench/workbench_state.cc b/source/blender/draw/engines/workbench/workbench_state.cc index 3c8f95addd7..21e1b930d99 100644 --- a/source/blender/draw/engines/workbench/workbench_state.cc +++ b/source/blender/draw/engines/workbench/workbench_state.cc @@ -87,7 +87,8 @@ void SceneState::init(Object *camera_ob /*= nullptr*/) shading.flag &= ~(V3D_SHADING_SHADOW | V3D_SHADING_CAVITY | V3D_SHADING_DEPTH_OF_FIELD); } if (SHADING_XRAY_ENABLED(shading) != SHADING_XRAY_ENABLED(previous_shading) || - shading.flag != previous_shading.flag) { + shading.flag != previous_shading.flag) + { reset_taa = true; } diff --git a/source/blender/draw/engines/workbench/workbench_volume.c b/source/blender/draw/engines/workbench/workbench_volume.c index 54a00787ebc..7f625a2801e 100644 --- a/source/blender/draw/engines/workbench/workbench_volume.c +++ b/source/blender/draw/engines/workbench/workbench_volume.c @@ -75,7 +75,8 @@ static void workbench_volume_modifier_cache_populate(WORKBENCH_Data *vedata, } if ((!fds->use_coba && (fds->tex_density == NULL && fds->tex_color == NULL)) || - (fds->use_coba && fds->tex_field == NULL)) { + (fds->use_coba && fds->tex_field == NULL)) + { return; } diff --git a/source/blender/draw/intern/DRW_gpu_wrapper.hh b/source/blender/draw/intern/DRW_gpu_wrapper.hh index 82288a5fe86..7606aff4b55 100644 --- a/source/blender/draw/intern/DRW_gpu_wrapper.hh +++ b/source/blender/draw/intern/DRW_gpu_wrapper.hh @@ -889,7 +889,8 @@ class Texture : NonCopyable { int3 size(0); GPU_texture_get_mipmap_size(tx_, 0, size); if (size != int3(w, h, d) || GPU_texture_format(tx_) != format || - GPU_texture_is_cube(tx_) != cubemap || GPU_texture_is_array(tx_) != layered) { + GPU_texture_is_cube(tx_) != cubemap || GPU_texture_is_array(tx_) != layered) + { free(); } } diff --git a/source/blender/draw/intern/draw_attributes.cc b/source/blender/draw/intern/draw_attributes.cc index a6755c6adea..73e7dabd117 100644 --- a/source/blender/draw/intern/draw_attributes.cc +++ b/source/blender/draw/intern/draw_attributes.cc @@ -10,7 +10,8 @@ static bool drw_attributes_has_request(const DRW_Attributes *requests, for (int i = 0; i < requests->num_requests; i++) { const DRW_AttributeRequest &src_req = requests->requests[i]; if (src_req.domain == req.domain && src_req.layer_index == req.layer_index && - src_req.cd_type == req.cd_type) { + src_req.cd_type == req.cd_type) + { return true; } } @@ -63,7 +64,8 @@ void drw_attributes_add_request(DRW_Attributes *attrs, const eAttrDomain domain) { if (attrs->num_requests >= GPU_MAX_ATTR || - drw_attributes_has_request(attrs, {type, layer_index, domain})) { + drw_attributes_has_request(attrs, {type, layer_index, domain})) + { return; } diff --git a/source/blender/draw/intern/draw_cache_extract_mesh.cc b/source/blender/draw/intern/draw_cache_extract_mesh.cc index 326019c20f6..0ce5ce3f32e 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh.cc +++ b/source/blender/draw/intern/draw_cache_extract_mesh.cc @@ -803,7 +803,8 @@ void mesh_buffer_cache_create_requested_subdiv(MeshBatchCache *cache, /* We use only one extractor for face dots, as the work is done in a single compute shader. */ if (DRW_vbo_requested(mbuflist->vbo.fdots_nor) || DRW_vbo_requested(mbuflist->vbo.fdots_pos) || - DRW_ibo_requested(mbuflist->ibo.fdots)) { + DRW_ibo_requested(mbuflist->ibo.fdots)) + { extractors.append(&extract_fdots_pos); } diff --git a/source/blender/draw/intern/draw_cache_extract_mesh_render_data.cc b/source/blender/draw/intern/draw_cache_extract_mesh_render_data.cc index ab207399a89..f32467a15de 100644 --- a/source/blender/draw/intern/draw_cache_extract_mesh_render_data.cc +++ b/source/blender/draw/intern/draw_cache_extract_mesh_render_data.cc @@ -135,8 +135,8 @@ void mesh_render_data_update_loose_geom(MeshRenderData *mr, const eMRIterType iter_type, const eMRDataType data_flag) { - if ((iter_type & (MR_ITER_LOOSE_EDGE | MR_ITER_LOOSE_VERT)) || - (data_flag & MR_DATA_LOOSE_GEOM)) { + if ((iter_type & (MR_ITER_LOOSE_EDGE | MR_ITER_LOOSE_VERT)) || (data_flag & MR_DATA_LOOSE_GEOM)) + { mesh_render_data_loose_geom_ensure(mr, cache); mr->loose_edges = cache->loose_geom.edges; mr->loose_verts = cache->loose_geom.verts; @@ -464,7 +464,8 @@ MeshRenderData *mesh_render_data_create(Object *object, * using the cage mesh with deformed coordinates. */ if ((is_mode_active && mr->me->runtime->is_original_bmesh && mr->me->runtime->wrapper_type == ME_WRAPPER_TYPE_BMESH) || - (do_uvedit && !do_final)) { + (do_uvedit && !do_final)) + { mr->extract_type = MR_EXTRACT_BMESH; } else { diff --git a/source/blender/draw/intern/draw_cache_impl_curve.cc b/source/blender/draw/intern/draw_cache_impl_curve.cc index cede4e279ab..9ef4f4b3e38 100644 --- a/source/blender/draw/intern/draw_cache_impl_curve.cc +++ b/source/blender/draw/intern/draw_cache_impl_curve.cc @@ -121,7 +121,8 @@ static int curve_render_normal_len_get(const ListBase *lb, const CurveCache *ob_ const BevList *bl; const Nurb *nu; for (bl = (const BevList *)ob_curve_cache->bev.first, nu = (const Nurb *)lb->first; nu && bl; - bl = bl->next, nu = nu->next) { + bl = bl->next, nu = nu->next) + { int nr = bl->nr; int skip = nu->resolu / 16; #if 0 @@ -584,7 +585,8 @@ static void curve_create_edit_curves_nor(CurveRenderData *rdata, for (bl = (const BevList *)rdata->ob_curve_cache->bev.first, nu = (const Nurb *)rdata->nurbs->first; nu && bl; - bl = bl->next, nu = nu->next) { + bl = bl->next, nu = nu->next) + { const BevPoint *bevp = bl->bevpoints; int nr = bl->nr; int skip = nu->resolu / 16; @@ -900,7 +902,8 @@ void DRW_curve_batch_cache_create_requested(Object *ob, const struct Scene *scen curve_create_curves_lines(rdata, cache->ibo.curves_lines); } if (DRW_vbo_requested(cache->edit.pos) || DRW_vbo_requested(cache->edit.data) || - DRW_ibo_requested(cache->ibo.edit_verts) || DRW_ibo_requested(cache->ibo.edit_lines)) { + DRW_ibo_requested(cache->ibo.edit_verts) || DRW_ibo_requested(cache->ibo.edit_lines)) + { curve_create_edit_data_and_handles( rdata, cache->edit.pos, cache->edit.data, cache->ibo.edit_verts, cache->ibo.edit_lines); } diff --git a/source/blender/draw/intern/draw_cache_impl_lattice.c b/source/blender/draw/intern/draw_cache_impl_lattice.c index 9831f477929..28e9d589ce0 100644 --- a/source/blender/draw/intern/draw_cache_impl_lattice.c +++ b/source/blender/draw/intern/draw_cache_impl_lattice.c @@ -231,7 +231,8 @@ static bool lattice_batch_cache_valid(Lattice *lt) if ((cache->dims.u_len != lt->pntsu) || (cache->dims.v_len != lt->pntsv) || (cache->dims.w_len != lt->pntsw) || - (cache->show_only_outside != ((lt->flag & LT_OUTSIDE) != 0))) { + (cache->show_only_outside != ((lt->flag & LT_OUTSIDE) != 0))) + { return false; } diff --git a/source/blender/draw/intern/draw_cache_impl_mesh.cc b/source/blender/draw/intern/draw_cache_impl_mesh.cc index 5cc568fe2ab..10ab77e2dab 100644 --- a/source/blender/draw/intern/draw_cache_impl_mesh.cc +++ b/source/blender/draw/intern/draw_cache_impl_mesh.cc @@ -519,7 +519,8 @@ static void drw_mesh_weight_state_extract(Object *ob, BKE_object_defgroup_check_lock_relative_multi(wstate->defgroup_len, wstate->defgroup_locked, wstate->defgroup_sel, - wstate->defgroup_sel_count)) { + wstate->defgroup_sel_count)) + { wstate->flags |= DRW_MESH_WEIGHT_STATE_LOCK_RELATIVE; /* Compute the set of locked and unlocked deform vertex groups. */ @@ -1404,7 +1405,8 @@ void DRW_mesh_batch_cache_create_requested(struct TaskGraph *task_graph, if (batch_requested & (MBC_SURFACE | MBC_WIRE_LOOPS_UVS | MBC_EDITUV_FACES_STRETCH_AREA | - MBC_EDITUV_FACES_STRETCH_ANGLE | MBC_EDITUV_FACES | MBC_EDITUV_EDGES | MBC_EDITUV_VERTS)) { + MBC_EDITUV_FACES_STRETCH_ANGLE | MBC_EDITUV_FACES | MBC_EDITUV_EDGES | MBC_EDITUV_VERTS)) + { /* Modifiers will only generate an orco layer if the mesh is deformed. */ if (cache->cd_needed.orco != 0) { /* Orco is always extracted from final mesh. */ @@ -1428,7 +1430,8 @@ void DRW_mesh_batch_cache_create_requested(struct TaskGraph *task_graph, cd_uv_update = true; } if ((cache->cd_used.tan & cache->cd_needed.tan) != cache->cd_needed.tan || - cache->cd_used.tan_orco != cache->cd_needed.tan_orco) { + cache->cd_used.tan_orco != cache->cd_needed.tan_orco) + { GPU_VERTBUF_DISCARD_SAFE(mbc->buff.vbo.tan); } if (cache->cd_used.orco != cache->cd_needed.orco) { diff --git a/source/blender/draw/intern/draw_cache_impl_particles.c b/source/blender/draw/intern/draw_cache_impl_particles.c index 6ae592f9bb6..e1c15dcaa78 100644 --- a/source/blender/draw/intern/draw_cache_impl_particles.c +++ b/source/blender/draw/intern/draw_cache_impl_particles.c @@ -248,7 +248,8 @@ static void ensure_seg_pt_count(PTCacheEdit *edit, ParticleHairCache *hair_cache) { if ((hair_cache->pos != NULL && hair_cache->indices != NULL) || - (hair_cache->proc_point_buf != NULL)) { + (hair_cache->proc_point_buf != NULL)) + { return; } @@ -978,8 +979,8 @@ static void particle_batch_cache_ensure_procedural_strand_data(PTCacheEdit *edit } else { int curr_point = 0; - if ((psys->pathcache != NULL) && - (!psys->childcache || (psys->part->draw & PART_DRAW_PARENT))) { + if ((psys->pathcache != NULL) && (!psys->childcache || (psys->part->draw & PART_DRAW_PARENT))) + { curr_point = particle_batch_cache_fill_strands_data(psys, psmd, psys->pathcache, @@ -1078,8 +1079,8 @@ static void particle_batch_cache_ensure_procedural_indices(PTCacheEdit *edit, } else { int curr_point = 0; - if ((psys->pathcache != NULL) && - (!psys->childcache || (psys->part->draw & PART_DRAW_PARENT))) { + if ((psys->pathcache != NULL) && (!psys->childcache || (psys->part->draw & PART_DRAW_PARENT))) + { curr_point = particle_batch_cache_fill_segments_indices( psys->pathcache, 0, psys->totpart, verts_per_hair, &elb); } @@ -1269,8 +1270,8 @@ static void particle_batch_cache_ensure_pos_and_seg(PTCacheEdit *edit, hair_cache); } else { - if ((psys->pathcache != NULL) && - (!psys->childcache || (psys->part->draw & PART_DRAW_PARENT))) { + if ((psys->pathcache != NULL) && (!psys->childcache || (psys->part->draw & PART_DRAW_PARENT))) + { curr_point = particle_batch_cache_fill_segments(psys, psmd, psys->pathcache, @@ -1702,7 +1703,8 @@ bool particles_ensure_procedural_data(Object *object, /* Refreshed on combing and simulation. */ if ((*r_hair_cache)->proc_point_buf == NULL || - (gpu_material && (*r_hair_cache)->proc_length_buf == NULL)) { + (gpu_material && (*r_hair_cache)->proc_length_buf == NULL)) + { ensure_seg_pt_count(source.edit, source.psys, &cache->hair); particle_batch_cache_ensure_procedural_pos( source.edit, source.psys, &cache->hair, gpu_material); diff --git a/source/blender/draw/intern/draw_cache_impl_pointcloud.cc b/source/blender/draw/intern/draw_cache_impl_pointcloud.cc index 704bbb46469..4796ec177a9 100644 --- a/source/blender/draw/intern/draw_cache_impl_pointcloud.cc +++ b/source/blender/draw/intern/draw_cache_impl_pointcloud.cc @@ -192,8 +192,8 @@ void DRW_pointcloud_batch_cache_free_old(PointCloud *pointcloud, int ctime) bool do_discard = false; - if (drw_attributes_overlap(&cache->eval_cache.attr_used_over_time, - &cache->eval_cache.attr_used)) { + if (drw_attributes_overlap(&cache->eval_cache.attr_used_over_time, &cache->eval_cache.attr_used)) + { cache->eval_cache.last_attr_matching_time = ctime; } diff --git a/source/blender/draw/intern/draw_cache_impl_subdivision.cc b/source/blender/draw/intern/draw_cache_impl_subdivision.cc index d63da3d9bd3..9e512fdb634 100644 --- a/source/blender/draw/intern/draw_cache_impl_subdivision.cc +++ b/source/blender/draw/intern/draw_cache_impl_subdivision.cc @@ -273,7 +273,8 @@ static GPUShader *get_subdiv_shader(int shader_type) SHADER_PATCH_EVALUATION, SHADER_PATCH_EVALUATION_FVAR, SHADER_PATCH_EVALUATION_FACE_DOTS, - SHADER_PATCH_EVALUATION_ORCO)) { + SHADER_PATCH_EVALUATION_ORCO)) + { return get_patch_evaluation_shader(shader_type); } @@ -291,7 +292,8 @@ static GPUShader *get_subdiv_shader(int shader_type) SHADER_BUFFER_LINES, SHADER_BUFFER_LNOR, SHADER_BUFFER_TRIS_MULTIPLE_MATERIALS, - SHADER_BUFFER_UV_STRETCH_AREA)) { + SHADER_BUFFER_UV_STRETCH_AREA)) + { defines = "#define SUBDIV_POLYGON_OFFSET\n"; } else if (shader_type == SHADER_BUFFER_TRIS) { @@ -1199,8 +1201,8 @@ static bool draw_subdiv_build_cache(DRWSubdivCache *cache, cache_building_context.cache = cache; do_subdiv_traversal(&cache_building_context, subdiv); - if (cache->num_subdiv_loops == 0 && cache->num_subdiv_verts == 0 && - !cache->may_have_loose_geom) { + if (cache->num_subdiv_loops == 0 && cache->num_subdiv_verts == 0 && !cache->may_have_loose_geom) + { /* Either the traversal failed, or we have an empty mesh, either way we cannot go any further. * The subdiv_polygon_offset cannot then be reliably stored in the cache, so free it directly. */ @@ -2128,7 +2130,8 @@ static bool draw_subdiv_create_requested_buffers(Object *ob, } if (!BKE_subdiv_eval_begin_from_mesh( - subdiv, mesh_eval, nullptr, SUBDIV_EVALUATOR_TYPE_GPU, evaluator_cache)) { + subdiv, mesh_eval, nullptr, SUBDIV_EVALUATOR_TYPE_GPU, evaluator_cache)) + { /* This could happen in two situations: * - OpenSubdiv is disabled. * - Something totally bad happened, and OpenSubdiv rejected our @@ -2351,7 +2354,8 @@ void DRW_create_subdivision(Object *ob, do_cage, ts, use_hide, - g_evaluator_cache)) { + g_evaluator_cache)) + { return; } diff --git a/source/blender/draw/intern/draw_color_management.cc b/source/blender/draw/intern/draw_color_management.cc index a5d73f93780..b77e404aef9 100644 --- a/source/blender/draw/intern/draw_color_management.cc +++ b/source/blender/draw/intern/draw_color_management.cc @@ -35,7 +35,8 @@ static float dither_get(eDRWColorManagementType color_management_type, const Sce { if (ELEM(color_management_type, eDRWColorManagementType::ViewTransformAndLook, - eDRWColorManagementType::UseRenderSettings)) { + eDRWColorManagementType::UseRenderSettings)) + { return scene.r.dither_intensity; } return 0.0f; @@ -67,7 +68,8 @@ static eDRWColorManagementType drw_color_management_type_for_space_image(const S const bool display_color_channel = (display_channels_mode & (SI_SHOW_ALPHA | SI_SHOW_ZBUF)) == 0; if (display_color_channel && image && (image->source != IMA_SRC_GENERATED) && - ((image->flag & IMA_VIEW_AS_RENDER) != 0)) { + ((image->flag & IMA_VIEW_AS_RENDER) != 0)) + { return eDRWColorManagementType::UseRenderSettings; } return eDRWColorManagementType::ViewTransform; diff --git a/source/blender/draw/intern/draw_common.c b/source/blender/draw/intern/draw_common.c index 15314ca5337..1c2a1c3b0b2 100644 --- a/source/blender/draw/intern/draw_common.c +++ b/source/blender/draw/intern/draw_common.c @@ -230,7 +230,8 @@ void DRW_globals_update(void) bool user_weight_ramp = (U.flag & USER_CUSTOM_RANGE) != 0; if (weight_ramp_custom != user_weight_ramp || - (user_weight_ramp && memcmp(&weight_ramp_copy, &U.coba_weight, sizeof(ColorBand)) != 0)) { + (user_weight_ramp && memcmp(&weight_ramp_copy, &U.coba_weight, sizeof(ColorBand)) != 0)) + { DRW_TEXTURE_FREE_SAFE(G_draw.weight_ramp); } @@ -414,7 +415,8 @@ bool DRW_object_is_flat(Object *ob, int *r_axis) OB_FONT, OB_CURVES, OB_POINTCLOUD, - OB_VOLUME)) { + OB_VOLUME)) + { /* Non-meshes object cannot be considered as flat. */ return false; } diff --git a/source/blender/draw/intern/draw_curves.cc b/source/blender/draw/intern/draw_curves.cc index ae3a908e483..46802f8f4f7 100644 --- a/source/blender/draw/intern/draw_curves.cc +++ b/source/blender/draw/intern/draw_curves.cc @@ -38,7 +38,8 @@ BLI_INLINE eParticleRefineShaderType drw_curves_shader_type_get() * parallel with fragment work, whereas compute inserts an explicit dependency, * due to switching of command encoder types. */ if (GPU_compute_shader_support() && GPU_shader_storage_buffer_objects_support() && - (GPU_backend_get_type() != GPU_BACKEND_METAL)) { + (GPU_backend_get_type() != GPU_BACKEND_METAL)) + { return PART_REFINE_SHADER_COMPUTE; } if (GPU_transform_feedback_support()) { diff --git a/source/blender/draw/intern/draw_fluid.c b/source/blender/draw/intern/draw_fluid.c index 889fa48d18e..a408020a248 100644 --- a/source/blender/draw/intern/draw_fluid.c +++ b/source/blender/draw/intern/draw_fluid.c @@ -447,7 +447,8 @@ void DRW_smoke_ensure_coba_field(FluidModifierData *fmd) FLUID_DOMAIN_FIELD_PHI_OUT, FLUID_DOMAIN_FIELD_PHI_OBSTACLE, FLUID_DOMAIN_FIELD_FLAGS, - FLUID_DOMAIN_FIELD_PRESSURE)) { + FLUID_DOMAIN_FIELD_PRESSURE)) + { fds->tex_coba = create_transfer_function(TFUNC_COLOR_RAMP, fds->coba); BLI_addtail(&DST.vmempool->smoke_textures, BLI_genericNodeN(&fds->tex_coba)); } diff --git a/source/blender/draw/intern/draw_hair.cc b/source/blender/draw/intern/draw_hair.cc index 03a222a7157..7919c80c9a7 100644 --- a/source/blender/draw/intern/draw_hair.cc +++ b/source/blender/draw/intern/draw_hair.cc @@ -41,7 +41,8 @@ BLI_INLINE eParticleRefineShaderType drw_hair_shader_type_get() * parallel with fragment work, whereas compute inserts an explicit dependency, * due to switching of command encoder types. */ if (GPU_compute_shader_support() && GPU_shader_storage_buffer_objects_support() && - (GPU_backend_get_type() != GPU_BACKEND_METAL)) { + (GPU_backend_get_type() != GPU_BACKEND_METAL)) + { return PART_REFINE_SHADER_COMPUTE; } if (GPU_transform_feedback_support()) { diff --git a/source/blender/draw/intern/draw_instance_data.c b/source/blender/draw/intern/draw_instance_data.c index 6df28032cda..9d45dab851c 100644 --- a/source/blender/draw/intern/draw_instance_data.c +++ b/source/blender/draw/intern/draw_instance_data.c @@ -649,7 +649,8 @@ GPUUniformBuf *drw_ensure_layer_attribute_buffer(void) float value[4]; if (BKE_view_layer_find_rgba_attribute( - DST.draw_ctx.scene, DST.draw_ctx.view_layer, attr->name, value)) { + DST.draw_ctx.scene, DST.draw_ctx.view_layer, attr->name, value)) + { LayerAttribute *item = &buffer[count++]; memcpy(item->data, value, sizeof(item->data)); diff --git a/source/blender/draw/intern/draw_manager.c b/source/blender/draw/intern/draw_manager.c index daf4675764f..2eac1cfff7c 100644 --- a/source/blender/draw/intern/draw_manager.c +++ b/source/blender/draw/intern/draw_manager.c @@ -253,7 +253,8 @@ bool DRW_object_is_visible_psys_in_active_context(const Object *object, const Pa return false; } if ((part->childtype == 0) && - (psys->flag & PSYS_HAIR_DYNAMICS && psys->pointcache->flag & PTCACHE_BAKED) == 0) { + (psys->flag & PSYS_HAIR_DYNAMICS && psys->pointcache->flag & PTCACHE_BAKED) == 0) + { return false; } } @@ -1264,7 +1265,8 @@ static bool is_compositor_enabled(void) } if (DST.draw_ctx.v3d->shading.use_compositor == V3D_SHADING_USE_COMPOSITOR_CAMERA && - DST.draw_ctx.rv3d->persp != RV3D_CAMOB) { + DST.draw_ctx.rv3d->persp != RV3D_CAMOB) + { return false; } @@ -1571,7 +1573,8 @@ void DRW_draw_callbacks_post_scene(void) /* XR callbacks (controllers, custom draw functions) for session surface. */ if (((v3d->flag2 & V3D_XR_SHOW_CONTROLLERS) != 0) || - ((v3d->flag2 & V3D_XR_SHOW_CUSTOM_OVERLAYS) != 0)) { + ((v3d->flag2 & V3D_XR_SHOW_CUSTOM_OVERLAYS) != 0)) + { GPU_depth_test(GPU_DEPTH_NONE); GPU_apply_state(); @@ -1940,7 +1943,8 @@ void DRW_render_gpencil(struct RenderEngine *engine, struct Depsgraph *depsgraph RenderResult *render_result = RE_engine_get_result(engine); RenderLayer *render_layer = RE_GetRenderLayer(render_result, view_layer->name); for (RenderView *render_view = render_result->views.first; render_view != NULL; - render_view = render_view->next) { + render_view = render_view->next) + { RE_SetActiveRenderView(render, render_view->name); DRW_view_reset(); DST.buffer_finish_called = false; @@ -2021,7 +2025,8 @@ void DRW_render_to_image(RenderEngine *engine, struct Depsgraph *depsgraph) /*RR_ALL_VIEWS*/ NULL); RenderLayer *render_layer = render_result->layers.first; for (RenderView *render_view = render_result->views.first; render_view != NULL; - render_view = render_view->next) { + render_view = render_view->next) + { RE_SetActiveRenderView(render, render_view->name); DRW_view_reset(); engine_type->draw_engine->render_to_image(data, engine, render_layer, &render_rect); @@ -2330,7 +2335,8 @@ static void draw_select_framebuffer_depth_only_setup(const int size[2]) if ((g_select_buffer.texture_depth != NULL) && ((GPU_texture_width(g_select_buffer.texture_depth) != size[0]) || - (GPU_texture_height(g_select_buffer.texture_depth) != size[1]))) { + (GPU_texture_height(g_select_buffer.texture_depth) != size[1]))) + { GPU_texture_free(g_select_buffer.texture_depth); g_select_buffer.texture_depth = NULL; } diff --git a/source/blender/draw/intern/draw_manager.cc b/source/blender/draw/intern/draw_manager.cc index 097f271e01c..93d28537865 100644 --- a/source/blender/draw/intern/draw_manager.cc +++ b/source/blender/draw/intern/draw_manager.cc @@ -81,7 +81,8 @@ void Manager::sync_layer_attributes() for (uint32_t id : id_list) { if (layer_attributes_buf[count].sync( - DST.draw_ctx.scene, DST.draw_ctx.view_layer, layer_attributes.lookup(id))) { + DST.draw_ctx.scene, DST.draw_ctx.view_layer, layer_attributes.lookup(id))) + { /* Check if the buffer is full. */ if (++count == size) { break; diff --git a/source/blender/draw/intern/draw_manager_exec.c b/source/blender/draw/intern/draw_manager_exec.c index 6c3c1db329d..1ee5ed67ee5 100644 --- a/source/blender/draw/intern/draw_manager_exec.c +++ b/source/blender/draw/intern/draw_manager_exec.c @@ -926,7 +926,8 @@ static void draw_call_batching_do(DRWShadingGroup *shgroup, if ((state->neg_scale != neg_scale) || /* Need to change state. */ (state->resource_chunk != chunk) || /* Need to change UBOs. */ (state->batch != call->batch) /* Need to change VAO. */ - ) { + ) + { draw_call_batching_flush(shgroup, state); state->batch = call->batch; @@ -1222,7 +1223,8 @@ static void drw_draw_pass_ex(DRWPass *pass, /* Fix #67342 for some reason. AMD Pro driver bug. */ if ((DST.state & DRW_STATE_BLEND_CUSTOM) != 0 && - GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL)) { + GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL)) + { drw_state_set(DST.state & ~DRW_STATE_BLEND_CUSTOM); } diff --git a/source/blender/draw/intern/draw_manager_shader.c b/source/blender/draw/intern/draw_manager_shader.c index c7c3cc6b718..ad358f86f37 100644 --- a/source/blender/draw/intern/draw_manager_shader.c +++ b/source/blender/draw/intern/draw_manager_shader.c @@ -571,7 +571,8 @@ void DRW_shader_queue_optimize_material(GPUMaterial *mat) if (ELEM(GPU_material_optimization_status(mat), GPU_MAT_OPTIMIZATION_SKIP, GPU_MAT_OPTIMIZATION_SUCCESS, - GPU_MAT_OPTIMIZATION_QUEUED)) { + GPU_MAT_OPTIMIZATION_QUEUED)) + { return; } diff --git a/source/blender/draw/intern/draw_manager_text.cc b/source/blender/draw/intern/draw_manager_text.cc index 31215ec0090..d1c1d9a2294 100644 --- a/source/blender/draw/intern/draw_manager_text.cc +++ b/source/blender/draw/intern/draw_manager_text.cc @@ -166,7 +166,8 @@ void DRW_text_cache_draw(DRWTextStore *dt, ARegion *region, View3D *v3d) vos->vec, vos->sco, V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_WIN | V3D_PROJ_TEST_CLIP_NEAR) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { tot++; } else { @@ -270,7 +271,8 @@ void DRW_text_edit_mesh_measure_stats(ARegion *region, } if (v3d->overlay.edit_flag & - (V3D_OVERLAY_EDIT_EDGE_LEN | V3D_OVERLAY_EDIT_EDGE_ANG | V3D_OVERLAY_EDIT_INDICES)) { + (V3D_OVERLAY_EDIT_EDGE_LEN | V3D_OVERLAY_EDIT_EDGE_ANG | V3D_OVERLAY_EDIT_INDICES)) + { BoundBox bb; const rcti rect = {0, region->winx, 0, region->winy}; @@ -290,7 +292,8 @@ void DRW_text_edit_mesh_measure_stats(ARegion *region, /* draw selected edges, or edges next to selected verts while dragging */ if (BM_elem_flag_test(eed, BM_ELEM_SELECT) || (do_moving && (BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) || - BM_elem_flag_test(eed->v2, BM_ELEM_SELECT)))) { + BM_elem_flag_test(eed->v2, BM_ELEM_SELECT)))) + { float v1_clip[3], v2_clip[3]; if (vert_coords) { @@ -356,7 +359,8 @@ void DRW_text_edit_mesh_measure_stats(ARegion *region, BM_elem_flag_test(l_a->next->next->v, BM_ELEM_SELECT) || BM_elem_flag_test(l_a->prev->v, BM_ELEM_SELECT) || BM_elem_flag_test(l_b->next->next->v, BM_ELEM_SELECT) || - BM_elem_flag_test(l_b->prev->v, BM_ELEM_SELECT)))) { + BM_elem_flag_test(l_b->prev->v, BM_ELEM_SELECT)))) + { float v1_clip[3], v2_clip[3]; if (vert_coords) { @@ -495,7 +499,8 @@ void DRW_text_edit_mesh_measure_stats(ARegion *region, BM_ITER_ELEM (loop, &liter, efa, BM_LOOPS_OF_FACE) { if (is_face_sel || (do_moving && (BM_elem_flag_test(loop->v, BM_ELEM_SELECT) || BM_elem_flag_test(loop->prev->v, BM_ELEM_SELECT) || - BM_elem_flag_test(loop->next->v, BM_ELEM_SELECT)))) { + BM_elem_flag_test(loop->next->v, BM_ELEM_SELECT)))) + { float v2_local[3]; /* lazy init center calc */ diff --git a/source/blender/draw/intern/draw_texture_pool.cc b/source/blender/draw/intern/draw_texture_pool.cc index d572cc75b27..bd48e4294de 100644 --- a/source/blender/draw/intern/draw_texture_pool.cc +++ b/source/blender/draw/intern/draw_texture_pool.cc @@ -84,7 +84,8 @@ GPUTexture *DRW_texture_pool_query(DRWTexturePool *pool, if ((GPU_texture_format(handle.texture) == format) && (GPU_texture_width(handle.texture) == width) && (GPU_texture_height(handle.texture) == height) && - (GPU_texture_usage(handle.texture) == usage)) { + (GPU_texture_usage(handle.texture) == usage)) + { handle.users_bits |= user_bit; return handle.texture; } diff --git a/source/blender/draw/intern/draw_view.c b/source/blender/draw/intern/draw_view.c index 269942edaf8..cc702998ea7 100644 --- a/source/blender/draw/intern/draw_view.c +++ b/source/blender/draw/intern/draw_view.c @@ -107,7 +107,8 @@ void DRW_draw_cursor(void) if (ED_view3d_project_int_global( region, cursor->location, co, V3D_PROJ_TEST_NOP | V3D_PROJ_TEST_CLIP_NEAR) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { RegionView3D *rv3d = region->regiondata; float cursor_quat[4]; diff --git a/source/blender/draw/intern/draw_volume.cc b/source/blender/draw/intern/draw_volume.cc index bec9e579842..34c54b63230 100644 --- a/source/blender/draw/intern/draw_volume.cc +++ b/source/blender/draw/intern/draw_volume.cc @@ -184,7 +184,8 @@ static DRWShadingGroup *drw_volume_object_mesh_init(Scene *scene, /* Smoke Simulation */ if ((md = BKE_modifiers_findby_type(ob, eModifierType_Fluid)) && BKE_modifier_is_enabled(scene, md, eModifierMode_Realtime) && - ((FluidModifierData *)md)->domain != nullptr) { + ((FluidModifierData *)md)->domain != nullptr) + { FluidModifierData *fmd = (FluidModifierData *)md; FluidDomainSettings *fds = fmd->domain; diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_paint_mask.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_paint_mask.cc index 6b487b85e0f..bbaf66987b9 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_paint_mask.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_ibo_lines_paint_mask.cc @@ -47,7 +47,8 @@ static void extract_lines_paint_mask_iter_poly_mesh(const MeshRenderData *mr, const int e_index = mr->corner_edges[ml_index]; if (!((mr->use_hide && mr->hide_edge && mr->hide_edge[e_index]) || - ((mr->e_origindex) && (mr->e_origindex[e_index] == ORIGINDEX_NONE)))) { + ((mr->e_origindex) && (mr->e_origindex[e_index] == ORIGINDEX_NONE)))) + { const int ml_index_last = poly.size() + poly.start() - 1; const int ml_index_other = (ml_index == ml_index_last) ? poly.start() : (ml_index + 1); @@ -120,7 +121,8 @@ static void extract_lines_paint_mask_iter_subdiv_mesh(const DRWSubdivCache *subd } else { if (!((mr->use_hide && mr->hide_edge && mr->hide_edge[coarse_edge_index]) || - ((mr->e_origindex) && (mr->e_origindex[coarse_edge_index] == ORIGINDEX_NONE)))) { + ((mr->e_origindex) && (mr->e_origindex[coarse_edge_index] == ORIGINDEX_NONE)))) + { const uint ml_index_other = (loop_idx == (end_loop_idx - 1)) ? start_loop_idx : loop_idx + 1; if (mr->select_poly && mr->select_poly[coarse_quad_index]) { diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edit_data.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edit_data.cc index 2fd6d09dd5e..ce53bbad706 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edit_data.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_edit_data.cc @@ -32,7 +32,8 @@ static void mesh_render_data_edge_flag(const MeshRenderData *mr, eattr->e_flag |= VFLAG_EDGE_SELECTED; } if (is_vertex_select_mode && BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) && - BM_elem_flag_test(eed->v2, BM_ELEM_SELECT)) { + BM_elem_flag_test(eed->v2, BM_ELEM_SELECT)) + { eattr->e_flag |= VFLAG_EDGE_SELECTED; eattr->e_flag |= VFLAG_VERT_SELECTED; } diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_lnor.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_lnor.cc index bd1e91bd4a7..5dbfde46ee1 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_lnor.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_lnor.cc @@ -77,8 +77,8 @@ static void extract_lnor_iter_poly_mesh(const MeshRenderData *mr, const int poly /* Flag for paint mode overlay. * Only use origindex in edit mode where it is used to display the edge-normals. * In paint mode it will use the un-mapped data to draw the wire-frame. */ - if (hidden || - (mr->edit_bmesh && (mr->v_origindex) && mr->v_origindex[vert] == ORIGINDEX_NONE)) { + if (hidden || (mr->edit_bmesh && (mr->v_origindex) && mr->v_origindex[vert] == ORIGINDEX_NONE)) + { lnor_data->w = -1; } else if (mr->select_poly && mr->select_poly[poly_index]) { @@ -199,8 +199,8 @@ static void extract_lnor_hq_iter_poly_mesh(const MeshRenderData *mr, /* Flag for paint mode overlay. * Only use origindex in edit mode where it is used to display the edge-normals. * In paint mode it will use the un-mapped data to draw the wire-frame. */ - if (hidden || - (mr->edit_bmesh && (mr->v_origindex) && mr->v_origindex[vert] == ORIGINDEX_NONE)) { + if (hidden || (mr->edit_bmesh && (mr->v_origindex) && mr->v_origindex[vert] == ORIGINDEX_NONE)) + { lnor_data->w = -1; } else if (mr->select_poly && mr->select_poly[poly_index]) { diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_mesh_analysis.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_mesh_analysis.cc index ec875f7e36f..6050089fd25 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_mesh_analysis.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_mesh_analysis.cc @@ -233,7 +233,8 @@ static void statvis_calc_thickness(const MeshRenderData *mr, float *r_thickness) hit.dist = face_dists[index]; if ((BLI_bvhtree_ray_cast( tree, ray_co, ray_no, 0.0f, &hit, treeData.raycast_callback, &treeData) != -1) && - hit.dist < face_dists[index]) { + hit.dist < face_dists[index]) + { float angle_fac = fabsf(dot_v3v3(mr->poly_normals[index], hit.no)); angle_fac = 1.0f - angle_fac; angle_fac = angle_fac * angle_fac * angle_fac; @@ -350,7 +351,8 @@ static void statvis_calc_intersect(const MeshRenderData *mr, float *r_intersect) for (int i = 0; i < overlap_len; i++) { for (const IndexRange f_hit : {mr->polys[mr->looptris[overlap[i].indexA].poly], - mr->polys[mr->looptris[overlap[i].indexB].poly]}) { + mr->polys[mr->looptris[overlap[i].indexB].poly]}) + { int l_index = f_hit.start(); for (int k = 0; k < f_hit.size(); k++, l_index++) { r_intersect[l_index] = 1.0f; diff --git a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_pos_nor.cc b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_pos_nor.cc index dcdc8b43a36..96d41a987d6 100644 --- a/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_pos_nor.cc +++ b/source/blender/draw/intern/mesh_extractors/extract_mesh_vbo_pos_nor.cc @@ -96,7 +96,8 @@ static void extract_pos_nor_iter_poly_mesh(const MeshRenderData *mr, vert->nor = data->normals[vert_i].low; /* Flag for paint mode overlay. */ if (poly_hidden || vert_hidden || - ((mr->v_origindex) && (mr->v_origindex[vert_i] == ORIGINDEX_NONE))) { + ((mr->v_origindex) && (mr->v_origindex[vert_i] == ORIGINDEX_NONE))) + { vert->nor.w = -1; } else if (mr->select_vert && mr->select_vert[vert_i]) { @@ -470,7 +471,8 @@ static void extract_pos_nor_hq_iter_poly_mesh(const MeshRenderData *mr, /* Flag for paint mode overlay. */ if (poly_hidden || vert_hidden || - ((mr->v_origindex) && (mr->v_origindex[vert_i] == ORIGINDEX_NONE))) { + ((mr->v_origindex) && (mr->v_origindex[vert_i] == ORIGINDEX_NONE))) + { vert->nor[3] = -1; } else if (mr->select_vert && mr->select_vert[vert_i]) { diff --git a/source/blender/draw/intern/shaders/common_gpencil_lib.glsl b/source/blender/draw/intern/shaders/common_gpencil_lib.glsl index bb55035f9e6..f48c355835a 100644 --- a/source/blender/draw/intern/shaders/common_gpencil_lib.glsl +++ b/source/blender/draw/intern/shaders/common_gpencil_lib.glsl @@ -316,7 +316,8 @@ vec4 gpencil_vertex(vec4 viewport_size, /* Reminder: we packed the cap flag into the sign of strength and thickness sign. */ if ((is_stroke_start && strength1 > 0.0) || (is_stroke_end && thickness1 > 0.0) || - (miter_break && !is_stroke_start && !is_stroke_end)) { + (miter_break && !is_stroke_start && !is_stroke_end)) + { screen_ofs += line * x; } diff --git a/source/blender/editors/animation/anim_channels_defines.c b/source/blender/editors/animation/anim_channels_defines.c index 779775e4159..abcb3883f10 100644 --- a/source/blender/editors/animation/anim_channels_defines.c +++ b/source/blender/editors/animation/anim_channels_defines.c @@ -4484,7 +4484,8 @@ void ANIM_channel_draw( if (ELEM(ac->spacetype, SPACE_ACTION, SPACE_GRAPH) && (acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE) || acf->has_setting(ac, ale, ACHANNEL_SETTING_ALWAYS_VISIBLE)) && - !ELEM(ale->type, ANIMTYPE_GPLAYER, ANIMTYPE_DSGPENCIL)) { + !ELEM(ale->type, ANIMTYPE_GPLAYER, ANIMTYPE_DSGPENCIL)) + { /* for F-Curves, draw color-preview of curve left to the visibility icon */ if (ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE)) { FCurve *fcu = (FCurve *)ale->data; @@ -4576,7 +4577,8 @@ void ANIM_channel_draw( * - Exception for graph editor, which needs extra space for the scroll bar. */ if (ac->spacetype == SPACE_GRAPH && - ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE, ANIMTYPE_GROUP)) { + ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE, ANIMTYPE_GROUP)) + { offset = V2D_SCROLL_WIDTH; } else { @@ -4614,8 +4616,8 @@ void ANIM_channel_draw( } /* check if there's enough space for the toggles if the sliders are drawn too */ - if (!(draw_sliders) || - (BLI_rcti_size_x(&v2d->mask) > ANIM_UI_get_channel_button_width() / 2)) { + if (!(draw_sliders) || (BLI_rcti_size_x(&v2d->mask) > ANIM_UI_get_channel_button_width() / 2)) + { /* protect... */ if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) { offset += ICON_WIDTH; @@ -4658,7 +4660,8 @@ void ANIM_channel_draw( * to keep a clean line down the side. */ if ((draw_sliders) && - ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE, ANIMTYPE_SHAPEKEY, ANIMTYPE_GPLAYER)) { + ELEM(ale->type, ANIMTYPE_FCURVE, ANIMTYPE_NLACURVE, ANIMTYPE_SHAPEKEY, ANIMTYPE_GPLAYER)) + { /* adjust offset */ offset += SLIDER_WIDTH; } @@ -5173,8 +5176,8 @@ static void draw_setting_widget(bAnimContext *ac, } if ((ale->fcurve_owner_id != NULL && !BKE_id_is_editable(ac->bmain, ale->fcurve_owner_id)) || - (ale->fcurve_owner_id == NULL && ale->id != NULL && - !BKE_id_is_editable(ac->bmain, ale->id))) { + (ale->fcurve_owner_id == NULL && ale->id != NULL && !BKE_id_is_editable(ac->bmain, ale->id))) + { if (setting != ACHANNEL_SETTING_EXPAND) { UI_but_disable(but, TIP_("Can't edit this property from a linked data-block")); } @@ -5232,7 +5235,8 @@ void ANIM_channel_draw_widgets(const bContext *C, if (ELEM(ac->spacetype, SPACE_ACTION, SPACE_GRAPH) && (acf->has_setting(ac, ale, ACHANNEL_SETTING_VISIBLE) || acf->has_setting(ac, ale, ACHANNEL_SETTING_ALWAYS_VISIBLE)) && - (ale->type != ANIMTYPE_GPLAYER)) { + (ale->type != ANIMTYPE_GPLAYER)) + { /* Pin toggle. */ if (acf->has_setting(ac, ale, ACHANNEL_SETTING_ALWAYS_VISIBLE)) { draw_setting_widget(ac, ale, acf, block, offset, ymid, ACHANNEL_SETTING_ALWAYS_VISIBLE); @@ -5332,8 +5336,8 @@ void ANIM_channel_draw_widgets(const bContext *C, } /* check if there's enough space for the toggles if the sliders are drawn too */ - if (!(draw_sliders) || - (BLI_rcti_size_x(&v2d->mask) > ANIM_UI_get_channel_button_width() / 2)) { + if (!(draw_sliders) || (BLI_rcti_size_x(&v2d->mask) > ANIM_UI_get_channel_button_width() / 2)) + { /* protect... */ if (acf->has_setting(ac, ale, ACHANNEL_SETTING_PROTECT)) { offset -= ICON_WIDTH; @@ -5367,7 +5371,8 @@ void ANIM_channel_draw_widgets(const bContext *C, /* NLA Action "pushdown" */ if ((ale->type == ANIMTYPE_NLAACTION) && (ale->adt && ale->adt->action) && - !(ale->adt->flag & ADT_NLA_EDIT_ON)) { + !(ale->adt->flag & ADT_NLA_EDIT_ON)) + { uiBut *but; PointerRNA *opptr_b; @@ -5409,7 +5414,8 @@ void ANIM_channel_draw_widgets(const bContext *C, ANIMTYPE_NLACURVE, ANIMTYPE_SHAPEKEY, ANIMTYPE_GPLAYER)) || - ale->type == ANIMTYPE_SHAPEKEY) { + ale->type == ANIMTYPE_SHAPEKEY) + { /* adjust offset */ /* TODO: make slider width dynamic, * so that they can be easier to use when the view is wide enough. */ diff --git a/source/blender/editors/animation/anim_channels_edit.c b/source/blender/editors/animation/anim_channels_edit.c index 4cb2095698b..4d5c37130c3 100644 --- a/source/blender/editors/animation/anim_channels_edit.c +++ b/source/blender/editors/animation/anim_channels_edit.c @@ -1151,7 +1151,8 @@ static void rearrange_animchannel_add_to_islands(ListBase *islands, * (it was either wrong sel status, or full already) */ (is_sel == 0) || /* 4) hidden status changes */ - ((island->flag & REORDER_ISLAND_HIDDEN) != is_hidden)) { + ((island->flag & REORDER_ISLAND_HIDDEN) != is_hidden)) + { /* create a new island now */ island = MEM_callocN(sizeof(tReorderChannelIsland), "tReorderChannelIsland"); BLI_addtail(islands, island); @@ -3012,7 +3013,8 @@ static bool rename_anim_channels(bAnimContext *ac, int channel_index) /* Don't allow renaming linked/liboverride channels. */ if (ale->fcurve_owner_id != NULL && - (ID_IS_LINKED(ale->fcurve_owner_id) || ID_IS_OVERRIDE_LIBRARY(ale->fcurve_owner_id))) { + (ID_IS_LINKED(ale->fcurve_owner_id) || ID_IS_OVERRIDE_LIBRARY(ale->fcurve_owner_id))) + { ANIM_animdata_freelist(&anim_data); return false; } diff --git a/source/blender/editors/animation/anim_deps.c b/source/blender/editors/animation/anim_deps.c index de1bf8eaa8a..c2b5d0a8daf 100644 --- a/source/blender/editors/animation/anim_deps.c +++ b/source/blender/editors/animation/anim_deps.c @@ -62,11 +62,8 @@ void ANIM_list_elem_update(Main *bmain, Scene *scene, bAnimListElem *ale) } /* Tag copy on the main object if updating anything directly inside AnimData */ - if (ELEM(ale->type, - ANIMTYPE_ANIMDATA, - ANIMTYPE_NLAACTION, - ANIMTYPE_NLATRACK, - ANIMTYPE_NLACURVE)) { + if (ELEM(ale->type, ANIMTYPE_ANIMDATA, ANIMTYPE_NLAACTION, ANIMTYPE_NLATRACK, ANIMTYPE_NLACURVE)) + { DEG_id_tag_update(id, ID_RECALC_ANIMATION); return; } @@ -370,7 +367,8 @@ void ANIM_animdata_update(bAnimContext *ac, ListBase *anim_data) ANIMTYPE_ANIMDATA, ANIMTYPE_NLAACTION, ANIMTYPE_NLATRACK, - ANIMTYPE_NLACURVE)) { + ANIMTYPE_NLACURVE)) + { if (ale->update & ANIM_UPDATE_DEPS) { ale->update &= ~ANIM_UPDATE_DEPS; ANIM_list_elem_update(ac->bmain, ac->scene, ale); diff --git a/source/blender/editors/animation/anim_draw.c b/source/blender/editors/animation/anim_draw.c index 8fd3cbe2451..a6ed20765b6 100644 --- a/source/blender/editors/animation/anim_draw.c +++ b/source/blender/editors/animation/anim_draw.c @@ -234,7 +234,8 @@ AnimData *ANIM_nla_mapping_get(bAnimContext *ac, bAnimListElem *ale) ANIMCONT_FCURVES, ANIMCONT_NLA, ANIMCONT_CHANNEL, - ANIMCONT_TIMELINE)) { + ANIMCONT_TIMELINE)) + { /* handling depends on the type of animation-context we've got */ if (ale) { /* NLA Control Curves occur on NLA strips, diff --git a/source/blender/editors/animation/anim_filter.c b/source/blender/editors/animation/anim_filter.c index 990d18af8c2..cb3eb8bdbc6 100644 --- a/source/blender/editors/animation/anim_filter.c +++ b/source/blender/editors/animation/anim_filter.c @@ -1025,7 +1025,8 @@ static bool skip_fcurve_selected_data(bDopeSheet *ads, FCurve *fcu, ID *owner_id /* Only consider if F-Curve involves `pose.bones`. */ if (fcu->rna_path && - BLI_str_quoted_substr(fcu->rna_path, "pose.bones[", bone_name, sizeof(bone_name))) { + BLI_str_quoted_substr(fcu->rna_path, "pose.bones[", bone_name, sizeof(bone_name))) + { /* Get bone-name, and check if this bone is selected. */ pchan = BKE_pose_channel_find_name(ob->pose, bone_name); @@ -1062,7 +1063,8 @@ static bool skip_fcurve_selected_data(bDopeSheet *ads, FCurve *fcu, ID *owner_id /* Only consider if F-Curve involves `sequence_editor.sequences`. */ if (fcu->rna_path && - BLI_str_quoted_substr(fcu->rna_path, "sequences_all[", seq_name, sizeof(seq_name))) { + BLI_str_quoted_substr(fcu->rna_path, "sequences_all[", seq_name, sizeof(seq_name))) + { /* Get strip name, and check if this strip is selected. */ Editing *ed = SEQ_editing_get(scene); if (ed) { @@ -1324,7 +1326,8 @@ static size_t animfilter_fcurves(ListBase *anim_data, */ for (fcu = first; (fcu = animfilter_fcurve_next(ads, fcu, fcurve_type, filter_mode, owner, owner_id)); - fcu = fcu->next) { + fcu = fcu->next) + { if (UNLIKELY(fcurve_type == ANIMTYPE_NLACURVE)) { /* NLA Control Curve - Basically the same as normal F-Curves, * except we need to set some stuff differently */ @@ -1366,7 +1369,8 @@ static size_t animfilter_act_group(bAnimContext *ac, /* Care about hierarchy but group isn't expanded. */ ((filter_mode & ANIMFILTER_LIST_VISIBLE) && EXPANDED_AGRP(ac, agrp) == 0) && /* Care about selection status. */ - (filter_mode & (ANIMFILTER_SEL | ANIMFILTER_UNSEL))) { + (filter_mode & (ANIMFILTER_SEL | ANIMFILTER_UNSEL))) + { /* If the group itself isn't selected appropriately, * we shouldn't consider its children either. */ if (ANIMCHANNEL_SELOK(SEL_AGRP(agrp)) == 0) { @@ -1692,7 +1696,8 @@ static size_t animdata_filter_shapekey(bAnimContext *ac, /* Skip shapekey if the name doesn't match the filter string. */ if (ads != NULL && ads->searchstr[0] != '\0' && - name_matches_dopesheet_filter(ads, kb->name) == false) { + name_matches_dopesheet_filter(ads, kb->name) == false) + { continue; } @@ -1756,7 +1761,8 @@ static size_t animdata_filter_gpencil_layers_data(ListBase *anim_data, /* skip layer if the name doesn't match the filter string */ if (ads != NULL && ads->searchstr[0] != '\0' && - name_matches_dopesheet_filter(ads, gpl->info) == false) { + name_matches_dopesheet_filter(ads, gpl->info) == false) + { continue; } @@ -1835,8 +1841,8 @@ static size_t animdata_filter_gpencil(bAnimContext *ac, ViewLayer *view_layer = (ViewLayer *)ac->view_layer; /* Include all annotation datablocks. */ - if (((ads->filterflag & ADS_FILTER_ONLYSEL) == 0) || - (ads->filterflag & ADS_FILTER_INCL_HIDDEN)) { + if (((ads->filterflag & ADS_FILTER_ONLYSEL) == 0) || (ads->filterflag & ADS_FILTER_INCL_HIDDEN)) + { LISTBASE_FOREACH (bGPdata *, gpd, &ac->bmain->gpencils) { if (gpd->flag & GP_DATA_ANNOTATIONS) { items += animdata_filter_gpencil_data(anim_data, ads, gpd, filter_mode); @@ -1863,7 +1869,8 @@ static size_t animdata_filter_gpencil(bAnimContext *ac, /* Layer visibility - we check both object and base, * since these may not be in sync yet. */ if ((base->flag & BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT) == 0 || - (base->flag & BASE_ENABLED_AND_VISIBLE_IN_DEFAULT_VIEWPORT) == 0) { + (base->flag & BASE_ENABLED_AND_VISIBLE_IN_DEFAULT_VIEWPORT) == 0) + { continue; } @@ -2816,8 +2823,8 @@ static size_t animdata_filter_dopesheet_ob( } /* grease pencil */ - if ((ob->type == OB_GPENCIL_LEGACY) && (ob->data) && - !(ads->filterflag & ADS_FILTER_NOGPENCIL)) { + if ((ob->type == OB_GPENCIL_LEGACY) && (ob->data) && !(ads->filterflag & ADS_FILTER_NOGPENCIL)) + { tmp_items += animdata_filter_ds_gpencil(ac, &tmp_data, ads, ob->data, filter_mode); } } @@ -3080,7 +3087,8 @@ static bool animdata_filter_base_is_ok(bDopeSheet *ads, if ((filter_mode & ANIMFILTER_DATA_VISIBLE) && !(ads->filterflag & ADS_FILTER_INCL_HIDDEN)) { /* layer visibility - we check both object and base, since these may not be in sync yet */ if ((base->flag & BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT) == 0 || - (base->flag & BASE_ENABLED_AND_VISIBLE_IN_DEFAULT_VIEWPORT) == 0) { + (base->flag & BASE_ENABLED_AND_VISIBLE_IN_DEFAULT_VIEWPORT) == 0) + { return false; } @@ -3245,7 +3253,8 @@ static size_t animdata_filter_dopesheet(bAnimContext *ac, BKE_view_layer_synced_ensure(scene, view_layer); ListBase *object_bases = BKE_view_layer_object_bases_get(view_layer); if ((filter_mode & ANIMFILTER_LIST_CHANNELS) && !(ads->flag & ADS_FLAG_NO_DB_SORT) && - (object_bases->first != object_bases->last)) { + (object_bases->first != object_bases->last)) + { /* Filter list of bases (i.e. objects), sort them, then add their contents normally... */ /* TODO: Cache the old sorted order - if the set of bases hasn't changed, don't re-sort... */ Base **sorted_bases; diff --git a/source/blender/editors/animation/anim_ipo_utils.c b/source/blender/editors/animation/anim_ipo_utils.c index e319f4d8a03..4b35fc4f1fa 100644 --- a/source/blender/editors/animation/anim_ipo_utils.c +++ b/source/blender/editors/animation/anim_ipo_utils.c @@ -87,7 +87,8 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) char pchanName[256], constName[256]; if (BLI_str_quoted_substr(fcu->rna_path, "bones[", pchanName, sizeof(pchanName)) && - BLI_str_quoted_substr(fcu->rna_path, "constraints[", constName, sizeof(constName))) { + BLI_str_quoted_substr(fcu->rna_path, "constraints[", constName, sizeof(constName))) + { /* assemble the string to display in the UI... */ structname = BLI_sprintfN("%s : %s", pchanName, constName); @@ -111,9 +112,11 @@ int getname_anim_fcurve(char *name, ID *id, FCurve *fcu) if (GS(ptr.owner_id->name) == ID_SCE) { char stripname[256]; if (BLI_str_quoted_substr( - fcu->rna_path, "sequence_editor.sequences_all[", stripname, sizeof(stripname))) { + fcu->rna_path, "sequence_editor.sequences_all[", stripname, sizeof(stripname))) + { if (strstr(fcu->rna_path, ".transform.") || strstr(fcu->rna_path, ".crop.") || - strstr(fcu->rna_path, ".modifiers[")) { + strstr(fcu->rna_path, ".modifiers[")) + { const char *structname_all = BLI_sprintfN("%s : %s", stripname, structname); if (free_structname) { MEM_freeN((void *)structname); diff --git a/source/blender/editors/animation/anim_markers.c b/source/blender/editors/animation/anim_markers.c index 32f91407330..6a1717fe45e 100644 --- a/source/blender/editors/animation/anim_markers.c +++ b/source/blender/editors/animation/anim_markers.c @@ -119,7 +119,8 @@ int ED_markers_post_apply_transform( case TFM_TIME_EXTEND: { /* apply delta if marker is on the right side of the current frame */ if ((side == 'B') || (side == 'L' && marker->frame < cfra) || - (side == 'R' && marker->frame >= cfra)) { + (side == 'R' && marker->frame >= cfra)) + { marker->frame += round_fl_to_int(value); changed_tot++; } @@ -812,7 +813,8 @@ static bool ed_marker_move_use_time(MarkerMove *mm) (((SpaceAction *)mm->slink)->flag & SACTION_DRAWTIME)) || ((mm->slink->spacetype == SPACE_GRAPH) && (((SpaceGraph *)mm->slink)->flag & SIPO_DRAWTIME)) || - ((mm->slink->spacetype == SPACE_NLA) && (((SpaceNla *)mm->slink)->flag & SNLA_DRAWTIME))) { + ((mm->slink->spacetype == SPACE_NLA) && (((SpaceNla *)mm->slink)->flag & SNLA_DRAWTIME))) + { return true; } @@ -1579,7 +1581,8 @@ static void ED_markers_select_leftright(bAnimContext *ac, LISTBASE_FOREACH (TimeMarker *, marker, markers) { if ((mode == MARKERS_LRSEL_LEFT && marker->frame <= scene->r.cfra) || - (mode == MARKERS_LRSEL_RIGHT && marker->frame >= scene->r.cfra)) { + (mode == MARKERS_LRSEL_RIGHT && marker->frame >= scene->r.cfra)) + { marker->flag |= SELECT; } } diff --git a/source/blender/editors/animation/anim_motion_paths.c b/source/blender/editors/animation/anim_motion_paths.c index 02c97613269..d751cdcf6e0 100644 --- a/source/blender/editors/animation/anim_motion_paths.c +++ b/source/blender/editors/animation/anim_motion_paths.c @@ -351,7 +351,8 @@ void animviz_motionpath_compute_range(Object *ob, Scene *scene) const bool has_action = ob->adt && ob->adt->action; if (avs->path_range == MOTIONPATH_RANGE_SCENE || !has_action || - BLI_listbase_is_empty(&ob->adt->action->curves)) { + BLI_listbase_is_empty(&ob->adt->action->curves)) + { /* Default to the scene (preview) range if there is no animation data to * find selected keys in. */ avs->path_sf = PSFRA; diff --git a/source/blender/editors/animation/anim_ops.c b/source/blender/editors/animation/anim_ops.c index 5c53cf192d0..d3f563f5886 100644 --- a/source/blender/editors/animation/anim_ops.c +++ b/source/blender/editors/animation/anim_ops.c @@ -195,8 +195,8 @@ static void change_frame_seq_preview_begin(bContext *C, const wmEvent *event) if (area && area->spacetype == SPACE_SEQ) { SpaceSeq *sseq = area->spacedata.first; ARegion *region = CTX_wm_region(C); - if (ED_space_sequencer_check_show_strip(sseq) && - !ED_time_scrub_event_in_region(region, event)) { + if (ED_space_sequencer_check_show_strip(sseq) && !ED_time_scrub_event_in_region(region, event)) + { ED_sequencer_special_preview_set(C, event->mval); } } diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c index cbc8e1d5105..9a0f0008d51 100644 --- a/source/blender/editors/animation/drivers.c +++ b/source/blender/editors/animation/drivers.c @@ -173,14 +173,16 @@ static int add_driver_with_target(ReportList *UNUSED(reports), */ /* XXX: if we have N-1 mapping, should we include all those in the expression? */ if ((RNA_property_unit(dst_prop) == PROP_UNIT_ROTATION) && - (RNA_property_unit(src_prop) != PROP_UNIT_ROTATION)) { + (RNA_property_unit(src_prop) != PROP_UNIT_ROTATION)) + { /* Rotation Destination: normal -> radians, so convert src to radians * (However, if both input and output is a rotation, don't apply such corrections) */ BLI_strncpy(driver->expression, "radians(var)", sizeof(driver->expression)); } else if ((RNA_property_unit(src_prop) == PROP_UNIT_ROTATION) && - (RNA_property_unit(dst_prop) != PROP_UNIT_ROTATION)) { + (RNA_property_unit(dst_prop) != PROP_UNIT_ROTATION)) + { /* Rotation Source: radians -> normal, so convert src to degrees * (However, if both input and output is a rotation, don't apply such corrections) */ @@ -203,7 +205,8 @@ static int add_driver_with_target(ReportList *UNUSED(reports), if (ELEM(src_ptr->type, &RNA_Object, &RNA_PoseBone) && (STREQ(prop_name, "location") || STREQ(prop_name, "scale") || STRPREFIX(prop_name, "rotation_")) && - (src_ptr->data != dst_ptr->data)) { + (src_ptr->data != dst_ptr->data)) + { /* Transform Channel */ DriverTarget *dtar; @@ -310,7 +313,8 @@ int ANIM_add_driver_with_target(ReportList *reports, RNA_id_pointer_create(src_id, &id_ptr2); if ((RNA_path_resolve_property(&id_ptr2, src_path, &ptr2, &prop2) == false) || - (mapping_type == CREATEDRIVER_MAPPING_NONE)) { + (mapping_type == CREATEDRIVER_MAPPING_NONE)) + { /* No target - So, fall back to default method for adding a "simple" driver normally */ return ANIM_add_driver( reports, dst_id, dst_path, dst_index, flag | CREATEDRIVER_WITH_DEFAULT_DVAR, driver_type); @@ -992,7 +996,8 @@ static int add_driver_button_menu_invoke(bContext *C, wmOperator *op, const wmEv PropertyRNA *prop; if ((prop = RNA_struct_find_property(op->ptr, "mapping_type")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { /* Mapping Type is Set - Directly go into creating drivers */ return add_driver_button_menu_exec(C, op); } diff --git a/source/blender/editors/animation/keyframes_edit.c b/source/blender/editors/animation/keyframes_edit.c index 1e9b43c8df8..201f5cdb409 100644 --- a/source/blender/editors/animation/keyframes_edit.c +++ b/source/blender/editors/animation/keyframes_edit.c @@ -604,7 +604,8 @@ bool keyframe_region_lasso_test(const KeyframeEdit_LassoData *data_lasso, const BLI_rctf_transform_pt_v(data_lasso->rectf_view, data_lasso->rectf_scaled, xy_view, xy); if (BLI_lasso_is_point_inside( - data_lasso->mcoords, data_lasso->mcoords_len, xy_view[0], xy_view[1], INT_MAX)) { + data_lasso->mcoords, data_lasso->mcoords_len, xy_view[0], xy_view[1], INT_MAX)) + { return true; } } diff --git a/source/blender/editors/animation/keyframes_general.c b/source/blender/editors/animation/keyframes_general.c index 989086a947b..175c6a6691a 100644 --- a/source/blender/editors/animation/keyframes_general.c +++ b/source/blender/editors/animation/keyframes_general.c @@ -98,7 +98,8 @@ void clean_fcurve(struct bAnimContext *ac, bAnimListElem *ale, float thresh, boo /* Check if any points. */ if ((fcu == NULL) || (fcu->bezt == NULL) || (fcu->totvert == 0) || - (!cleardefault && fcu->totvert == 1)) { + (!cleardefault && fcu->totvert == 1)) + { return; } @@ -558,7 +559,8 @@ static void decimate_fcurve_segment(FCurve *fcu, * has a check that prevents removal of the first and last index in the * passed array. */ if (bezt_segment_len + bezt_segment_start_idx != fcu->totvert && - prepare_for_decimate(fcu, bezt_segment_len + bezt_segment_start_idx)) { + prepare_for_decimate(fcu, bezt_segment_len + bezt_segment_start_idx)) + { bezt_segment_len++; } if (bezt_segment_start_idx != 0 && prepare_for_decimate(fcu, bezt_segment_start_idx - 1)) { @@ -917,7 +919,8 @@ short copy_animedit_keys(bAnimContext *ac, ListBase *anim_data) * - this check should also eliminate any problems associated with using sample-data */ if (ANIM_fcurve_keyframes_loop( - NULL, fcu, NULL, ANIM_editkeyframes_ok(BEZT_OK_SELECTED), NULL) == 0) { + NULL, fcu, NULL, ANIM_editkeyframes_ok(BEZT_OK_SELECTED), NULL) == 0) + { continue; } @@ -1151,15 +1154,18 @@ static void do_curve_mirror_flippping(tAnimCopybufItem *aci, BezTriple *bezt) flip = true; } else if (BLI_strn_endswith(aci->rna_path, "rotation_quaternion", slength) && - ELEM(aci->array_index, 2, 3)) { + ELEM(aci->array_index, 2, 3)) + { flip = true; } else if (BLI_strn_endswith(aci->rna_path, "rotation_euler", slength) && - ELEM(aci->array_index, 1, 2)) { + ELEM(aci->array_index, 1, 2)) + { flip = true; } else if (BLI_strn_endswith(aci->rna_path, "rotation_axis_angle", slength) && - ELEM(aci->array_index, 2, 3)) { + ELEM(aci->array_index, 2, 3)) + { flip = true; } diff --git a/source/blender/editors/animation/keyframing.c b/source/blender/editors/animation/keyframing.c index e7c6615e60f..7d27ca18176 100644 --- a/source/blender/editors/animation/keyframing.c +++ b/source/blender/editors/animation/keyframing.c @@ -429,8 +429,8 @@ int insert_bezt_fcurve(FCurve *fcu, const BezTriple *bezt, eInsertKeyFlags flag) if (flag & INSERTKEY_CYCLE_AWARE) { /* If replacing an end point of a cyclic curve without offset, * modify the other end too. */ - if (ELEM(i, 0, fcu->totvert - 1) && - BKE_fcurve_get_cycle_type(fcu) == FCU_CYCLE_PERFECT) { + if (ELEM(i, 0, fcu->totvert - 1) && BKE_fcurve_get_cycle_type(fcu) == FCU_CYCLE_PERFECT) + { replace_bezt_keyframe_ypos(&fcu->bezt[i == 0 ? fcu->totvert - 1 : 0], bezt); } } @@ -1567,7 +1567,8 @@ int insert_keyframe(Main *bmain, &remapped_context, values[array_index], keytype, - flag)) { + flag)) + { ret++; exclude = array_index; break; @@ -1624,7 +1625,8 @@ int insert_keyframe(Main *bmain, /* Key a single index. */ else { if (array_index >= 0 && array_index < value_count && - BLI_BITMAP_TEST_BOOL(successful_remaps, array_index)) { + BLI_BITMAP_TEST_BOOL(successful_remaps, array_index)) + { ret += insert_keyframe_fcurve_value(bmain, reports, &ptr, @@ -2307,8 +2309,8 @@ static int clear_anim_v3d_exec(bContext *C, wmOperator *UNUSED(op)) /* Get bone-name, and check if this bone is selected. */ bPoseChannel *pchan = NULL; char bone_name[sizeof(pchan->name)]; - if (BLI_str_quoted_substr( - fcu->rna_path, "pose.bones[", bone_name, sizeof(bone_name))) { + if (BLI_str_quoted_substr(fcu->rna_path, "pose.bones[", bone_name, sizeof(bone_name))) + { pchan = BKE_pose_channel_find_name(ob->pose, bone_name); /* Delete if bone is selected. */ if ((pchan) && (pchan->bone)) { @@ -2593,7 +2595,8 @@ static int insert_key_button_exec(bContext *C, wmOperator *op) } else if ((ptr.type == &RNA_Object) && (strstr(identifier, "location") || strstr(identifier, "rotation") || - strstr(identifier, "scale"))) { + strstr(identifier, "scale"))) + { /* NOTE: Keep this label in sync with the "ID" case in * keyingsets_utils.py :: get_transform_generators_base_info() */ diff --git a/source/blender/editors/armature/armature_add.c b/source/blender/editors/armature/armature_add.c index 806da5ee286..812d6e6d3f2 100644 --- a/source/blender/editors/armature/armature_add.c +++ b/source/blender/editors/armature/armature_add.c @@ -510,15 +510,18 @@ static void updateDuplicateActionConstraintSettings( flip = true; } else if (BLI_strn_endswith(new_curve->rna_path, "rotation_quaternion", slength) && - ELEM(new_curve->array_index, 2, 3)) { + ELEM(new_curve->array_index, 2, 3)) + { flip = true; } else if (BLI_strn_endswith(new_curve->rna_path, "rotation_euler", slength) && - ELEM(new_curve->array_index, 1, 2)) { + ELEM(new_curve->array_index, 1, 2)) + { flip = true; } else if (BLI_strn_endswith(new_curve->rna_path, "rotation_axis_angle", slength) && - ELEM(new_curve->array_index, 2, 3)) { + ELEM(new_curve->array_index, 2, 3)) + { flip = true; } @@ -723,7 +726,8 @@ static void updateDuplicateTransformConstraintSettings(Object *ob, for (int i = 0; i < 3; i++) { if ((trans->from == TRANS_LOCATION && trans->map[i] == X) || - (trans->from == TRANS_ROTATION && trans->map[i] != X)) { + (trans->from == TRANS_ROTATION && trans->map[i] != X)) + { /* X Loc to X/Y/Z Scale: Min/Max Flipped */ /* Y Rot to X/Y/Z Scale: Min/Max Flipped */ /* Z Rot to X/Y/Z Scale: Min/Max Flipped */ @@ -741,7 +745,8 @@ static void updateDuplicateTransformConstraintSettings(Object *ob, for (int i = 0; i < 3; i++) { if ((trans->from == TRANS_LOCATION && trans->map[i] == X) || - (trans->from == TRANS_ROTATION && trans->map[i] != X)) { + (trans->from == TRANS_ROTATION && trans->map[i] != X)) + { /* X Loc to X/Y/Z Loc: Min/Max Flipped (and Inverted) * Y Rot to X/Y/Z Loc: Min/Max Flipped * Z Rot to X/Y/Z Loc: Min/Max Flipped */ @@ -756,7 +761,8 @@ static void updateDuplicateTransformConstraintSettings(Object *ob, trans->to_max_rot[2] *= -1; if ((trans->from == TRANS_LOCATION && trans->map[1] != X) || - (trans->from == TRANS_ROTATION && trans->map[1] != Y) || trans->from == TRANS_SCALE) { + (trans->from == TRANS_ROTATION && trans->map[1] != Y) || trans->from == TRANS_SCALE) + { /* Invert the Y rotation */ trans->to_min_rot[1] *= -1; trans->to_max_rot[1] *= -1; @@ -767,7 +773,8 @@ static void updateDuplicateTransformConstraintSettings(Object *ob, for (int i = 0; i < 3; i++) { if ((trans->from == TRANS_LOCATION && trans->map[i] == X && i != 1) || (trans->from == TRANS_ROTATION && trans->map[i] == Y && i != 1) || - (trans->from == TRANS_ROTATION && trans->map[i] == Z)) { + (trans->from == TRANS_ROTATION && trans->map[i] == Z)) + { /* X Loc to X/Z Rot: Flipped * Y Rot to X/Z Rot: Flipped * Z Rot to X/Y/Z rot: Flipped */ @@ -803,7 +810,8 @@ static void updateDuplicateConstraintSettings(EditBone *dup_bone, EditBone *orig ListBase *conlist; if ((pchan = BKE_pose_channel_ensure(ob->pose, dup_bone->name)) == NULL || - (conlist = &pchan->constraints) == NULL) { + (conlist = &pchan->constraints) == NULL) + { return; } @@ -960,7 +968,8 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) /* Find the selected bones and duplicate them as needed */ for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; - ebone_iter = ebone_iter->next) { + ebone_iter = ebone_iter->next) + { if (EBONE_VISIBLE(arm, ebone_iter) && (ebone_iter->flag & BONE_SELECTED)) { EditBone *ebone; char new_bone_name_buff[MAXBONENAME]; @@ -987,7 +996,8 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) /* Run though the list and fix the pointers */ for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; - ebone_iter = ebone_iter->next) { + ebone_iter = ebone_iter->next) + { if (EBONE_VISIBLE(arm, ebone_iter) && (ebone_iter->flag & BONE_SELECTED)) { EditBone *ebone = ebone_iter->temp.ebone; @@ -1033,7 +1043,8 @@ static int armature_duplicate_selected_exec(bContext *C, wmOperator *op) /* Deselect the old bones and select the new ones */ for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; - ebone_iter = ebone_iter->next) { + ebone_iter = ebone_iter->next) + { if (EBONE_VISIBLE(arm, ebone_iter)) { ebone_iter->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); } @@ -1178,7 +1189,8 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op) /* Find the selected bones and duplicate them as needed, with mirrored name. */ for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; - ebone_iter = ebone_iter->next) { + ebone_iter = ebone_iter->next) + { if (EBONE_VISIBLE(arm, ebone_iter) && (ebone_iter->flag & BONE_SELECTED)) { if (ebone_iter->temp.ebone != NULL) { /* This will be set if the mirror bone already exists (no need to make a new one) @@ -1213,7 +1225,8 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op) /* Run through the list and fix the pointers. */ for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; - ebone_iter = ebone_iter->next) { + ebone_iter = ebone_iter->next) + { if (ebone_iter->temp.ebone) { /* copy all flags except for ... */ const int flag_copy = ((int)~0) & ~(BONE_SELECTED | BONE_ROOTSEL | BONE_TIPSEL); @@ -1281,7 +1294,8 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op) /* Deselect the old bones and select the new ones */ for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; - ebone_iter = ebone_iter->next) { + ebone_iter = ebone_iter->next) + { if (EBONE_VISIBLE(arm, ebone_iter)) { ebone_iter->flag &= ~(BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); } @@ -1289,7 +1303,8 @@ static int armature_symmetrize_exec(bContext *C, wmOperator *op) /* New bones will be selected, but some of the bones may already exist */ for (ebone_iter = arm->edbo->first; ebone_iter && ebone_iter != ebone_first_dupe; - ebone_iter = ebone_iter->next) { + ebone_iter = ebone_iter->next) + { EditBone *ebone = ebone_iter->temp.ebone; if (ebone && EBONE_SELECTABLE(arm, ebone)) { ED_armature_ebone_select_set(ebone, true); diff --git a/source/blender/editors/armature/armature_edit.c b/source/blender/editors/armature/armature_edit.c index 0e3748ad661..77a37b98612 100644 --- a/source/blender/editors/armature/armature_edit.c +++ b/source/blender/editors/armature/armature_edit.c @@ -750,7 +750,8 @@ static int armature_fill_bones_exec(bContext *C, wmOperator *op) ebp_b = ebp_a->next; if (((ebp_a->head_owner == ebp_b->tail_owner) && (ebp_a->head_owner != NULL)) || - ((ebp_a->tail_owner == ebp_b->head_owner) && (ebp_a->tail_owner != NULL))) { + ((ebp_a->tail_owner == ebp_b->head_owner) && (ebp_a->tail_owner != NULL))) + { BKE_report(op->reports, RPT_ERROR, "Same bone selected..."); BLI_freelistN(&points); return OPERATOR_CANCELLED; @@ -1018,7 +1019,8 @@ static void fix_connected_bone(EditBone *ebone) float diff[3]; if (!(ebone->parent) || !(ebone->flag & BONE_CONNECTED) || - equals_v3v3(ebone->parent->tail, ebone->head)) { + equals_v3v3(ebone->parent->tail, ebone->head)) + { return; } @@ -1381,12 +1383,14 @@ static int armature_dissolve_selected_exec(bContext *C, wmOperator *UNUSED(op)) for (ebone = arm->edbo->first; ebone; ebone = ebone->next) { /* break connections for unseen bones */ if (((arm->layer & ebone->layer) && - (ED_armature_ebone_selectflag_get(ebone) & (BONE_TIPSEL | BONE_SELECTED))) == 0) { + (ED_armature_ebone_selectflag_get(ebone) & (BONE_TIPSEL | BONE_SELECTED))) == 0) + { ebone->temp.ebone = NULL; } if (((arm->layer & ebone->layer) && - (ED_armature_ebone_selectflag_get(ebone) & (BONE_ROOTSEL | BONE_SELECTED))) == 0) { + (ED_armature_ebone_selectflag_get(ebone) & (BONE_ROOTSEL | BONE_SELECTED))) == 0) + { if (ebone->parent && (ebone->flag & BONE_CONNECTED)) { ebone->parent->temp.ebone = NULL; } diff --git a/source/blender/editors/armature/armature_select.c b/source/blender/editors/armature/armature_select.c index d2eb718401d..4cb4e6239cf 100644 --- a/source/blender/editors/armature/armature_select.c +++ b/source/blender/editors/armature/armature_select.c @@ -831,7 +831,8 @@ cache_end: * Otherwise ensure the value is the smallest it can be, * relative to the active bone, as long as it's not the active bone. */ if ((cycle_order.best.as_u32 == 0) || - (cycle_order.test.as_u32 && (cycle_order.test.as_u32 < cycle_order.best.as_u32))) { + (cycle_order.test.as_u32 && (cycle_order.test.as_u32 < cycle_order.best.as_u32))) + { cycle_order.best = cycle_order.test; result_cycle.hitresult = hitresult; result_cycle.base = base; @@ -1254,7 +1255,8 @@ bool ED_armature_edit_select_op_from_tagged(bArmature *arm, const int sel_op) /* When there is a partial selection without both endpoints, only select an endpoint. */ if ((is_inside_flag & BONESEL_BONE) && - ELEM(is_inside_flag & (BONESEL_ROOT | BONESEL_TIP), BONESEL_ROOT, BONESEL_TIP)) { + ELEM(is_inside_flag & (BONESEL_ROOT | BONESEL_TIP), BONESEL_ROOT, BONESEL_TIP)) + { is_inside_flag &= ~BONESEL_BONE; } @@ -1428,8 +1430,8 @@ static void armature_select_more(bArmature *arm, EditBone *ebone) static void armature_select_less(bArmature *UNUSED(arm), EditBone *ebone) { - if ((EBONE_PREV_FLAG_GET(ebone) & (BONE_ROOTSEL | BONE_TIPSEL)) != - (BONE_ROOTSEL | BONE_TIPSEL)) { + if ((EBONE_PREV_FLAG_GET(ebone) & (BONE_ROOTSEL | BONE_TIPSEL)) != (BONE_ROOTSEL | BONE_TIPSEL)) + { ED_armature_ebone_select_set(ebone, false); } @@ -2137,7 +2139,8 @@ static int armature_select_mirror_exec(bContext *C, wmOperator *op) int flag_new = extend ? EBONE_PREV_FLAG_GET(ebone) : 0; if ((ebone_mirror = ED_armature_ebone_get_mirrored(arm->edbo, ebone)) && - EBONE_VISIBLE(arm, ebone_mirror)) { + EBONE_VISIBLE(arm, ebone_mirror)) + { const int flag_mirror = EBONE_PREV_FLAG_GET(ebone_mirror); flag_new |= flag_mirror; @@ -2271,7 +2274,8 @@ static int armature_shortest_path_pick_invoke(bContext *C, wmOperator *op, const if (ebone_isect_parent) { if (armature_shortest_path_select(arm, ebone_isect_parent, ebone_src, false, true) && - armature_shortest_path_select(arm, ebone_isect_parent, ebone_dst, false, true)) { + armature_shortest_path_select(arm, ebone_isect_parent, ebone_dst, false, true)) + { armature_shortest_path_select(arm, ebone_isect_parent, ebone_src, false, false); armature_shortest_path_select(arm, ebone_isect_parent, ebone_dst, false, false); changed = true; diff --git a/source/blender/editors/armature/armature_skinning.c b/source/blender/editors/armature/armature_skinning.c index 39d558638ce..e990a12b7c0 100644 --- a/source/blender/editors/armature/armature_skinning.c +++ b/source/blender/editors/armature/armature_skinning.c @@ -199,7 +199,8 @@ static void envelope_bone_weighting(Object *ob, bool use_mask = false; if ((ob->mode & OB_MODE_WEIGHT_PAINT) && - (mesh->editflag & (ME_EDIT_PAINT_FACE_SEL | ME_EDIT_PAINT_VERT_SEL))) { + (mesh->editflag & (ME_EDIT_PAINT_FACE_SEL | ME_EDIT_PAINT_VERT_SEL))) + { use_mask = true; } diff --git a/source/blender/editors/armature/armature_utils.c b/source/blender/editors/armature/armature_utils.c index 75800318fef..26ac342b707 100644 --- a/source/blender/editors/armature/armature_utils.c +++ b/source/blender/editors/armature/armature_utils.c @@ -191,8 +191,8 @@ EditBone *ED_armature_ebone_find_shared_parent(EditBone *ebone_child[], const ui } /* only need search the first chain */ - for (EditBone *ebone_iter = ebone_child[0]->parent; ebone_iter; - ebone_iter = ebone_iter->parent) { + for (EditBone *ebone_iter = ebone_child[0]->parent; ebone_iter; ebone_iter = ebone_iter->parent) + { if (EBONE_TEMP_UINT(ebone_iter) == ebone_child_tot) { return ebone_iter; } diff --git a/source/blender/editors/armature/meshlaplacian.cc b/source/blender/editors/armature/meshlaplacian.cc index 156e7bf597d..a990e434988 100644 --- a/source/blender/editors/armature/meshlaplacian.cc +++ b/source/blender/editors/armature/meshlaplacian.cc @@ -1023,7 +1023,8 @@ static MDefBoundIsect *meshdeform_ray_tree_intersect(MeshDeformBind *mdb, &hit, harmonic_ray_callback, &data, - BVH_RAYCAST_WATERTIGHT) != -1) { + BVH_RAYCAST_WATERTIGHT) != -1) + { const blender::Span corner_verts = mdb->cagemesh_cache.corner_verts; const MLoopTri *lt = &mdb->cagemesh_cache.looptris[hit.index]; const blender::IndexRange poly = mdb->cagemesh_cache.polys[lt->poly]; @@ -1171,7 +1172,8 @@ static void meshdeform_bind_floodfill(MeshDeformBind *mdb) if (b != -1) { if (tag[b] == MESHDEFORM_TAG_UNTYPED || - (tag[b] == MESHDEFORM_TAG_BOUNDARY && !mdb->boundisect[a][i - 1])) { + (tag[b] == MESHDEFORM_TAG_BOUNDARY && !mdb->boundisect[a][i - 1])) + { tag[b] = MESHDEFORM_TAG_EXTERIOR; stack[stacksize++] = b; } diff --git a/source/blender/editors/armature/pose_lib_2.c b/source/blender/editors/armature/pose_lib_2.c index db490c8b32e..9a35a9dd530 100644 --- a/source/blender/editors/armature/pose_lib_2.c +++ b/source/blender/editors/armature/pose_lib_2.c @@ -138,7 +138,8 @@ static void poselib_keytag_pose(bContext *C, Scene *scene, PoseBlendData *pbd) } if (BKE_pose_backup_is_selection_relevant(pbd->pose_backup) && - !PBONE_SELECTED(armature, pchan->bone)) { + !PBONE_SELECTED(armature, pchan->bone)) + { continue; } @@ -222,7 +223,8 @@ static int poselib_blend_handle_event(bContext *UNUSED(C), wmOperator *op, const /* Handle the release confirm event directly, it has priority over others. */ if (pbd->release_confirm_info.use_release_confirm && - (event->type == pbd->release_confirm_info.init_event_type) && (event->val == KM_RELEASE)) { + (event->type == pbd->release_confirm_info.init_event_type) && (event->val == KM_RELEASE)) + { pbd->state = POSE_BLEND_CONFIRM; return OPERATOR_RUNNING_MODAL; } diff --git a/source/blender/editors/armature/pose_select.c b/source/blender/editors/armature/pose_select.c index 47a327902fe..d9d28cf6c6b 100644 --- a/source/blender/editors/armature/pose_select.c +++ b/source/blender/editors/armature/pose_select.c @@ -288,8 +288,8 @@ void ED_armature_pose_select_in_wpaint_mode(const Scene *scene, Object *ob_arm = agmd->object; if (ob_arm != NULL) { Base *base_arm = BKE_view_layer_base_find(view_layer, ob_arm); - if ((base_arm != NULL) && (base_arm != base_select) && - (base_arm->flag & BASE_SELECTED)) { + if ((base_arm != NULL) && (base_arm != base_select) && (base_arm->flag & BASE_SELECTED)) + { ED_object_base_select(base_arm, BA_DESELECT); } } @@ -305,8 +305,8 @@ void ED_armature_pose_select_in_wpaint_mode(const Scene *scene, Object *ob_arm = amd->object; if (ob_arm != NULL) { Base *base_arm = BKE_view_layer_base_find(view_layer, ob_arm); - if ((base_arm != NULL) && (base_arm != base_select) && - (base_arm->flag & BASE_SELECTED)) { + if ((base_arm != NULL) && (base_arm != base_select) && (base_arm->flag & BASE_SELECTED)) + { ED_object_base_select(base_arm, BA_DESELECT); } } @@ -696,7 +696,8 @@ static int pose_select_constraint_target_exec(bContext *C, wmOperator *UNUSED(op /* Any armature that is also in pose mode should be selected. */ if ((ct->subtarget[0] != '\0') && (ob != NULL) && (ob->type == OB_ARMATURE) && - (ob->mode == OB_MODE_POSE)) { + (ob->mode == OB_MODE_POSE)) + { bPoseChannel *pchanc = BKE_pose_channel_find_name(ob->pose, ct->subtarget); if ((pchanc) && !(pchanc->bone->flag & BONE_UNSELECTABLE)) { pchanc->bone->flag |= BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL; @@ -1237,7 +1238,8 @@ static int pose_select_mirror_exec(bContext *C, wmOperator *op) int flag_new = extend ? PBONE_PREV_FLAG_GET(pchan) : 0; if ((pchan_mirror = BKE_pose_channel_get_mirrored(ob->pose, pchan->name)) && - PBONE_VISIBLE(arm, pchan_mirror->bone)) { + PBONE_VISIBLE(arm, pchan_mirror->bone)) + { const int flag_mirror = PBONE_PREV_FLAG_GET(pchan_mirror); flag_new |= flag_mirror; diff --git a/source/blender/editors/armature/pose_slide.c b/source/blender/editors/armature/pose_slide.c index 38762913b3d..6dc8d09f291 100644 --- a/source/blender/editors/armature/pose_slide.c +++ b/source/blender/editors/armature/pose_slide.c @@ -468,7 +468,8 @@ static void pose_slide_apply_vec3(tPoseSlideOp *pso, BLI_assert(fcu->array_index < 3); if ((lock == 0) || ((lock & PS_LOCK_X) && (idx == 0)) || ((lock & PS_LOCK_Y) && (idx == 1)) || - ((lock & PS_LOCK_Z) && (idx == 2))) { + ((lock & PS_LOCK_Z) && (idx == 2))) + { /* Just work on these channels one by one... there's no interaction between values. */ pose_slide_apply_val(pso, fcu, pfl->ob, &vec[fcu->array_index]); } @@ -739,7 +740,8 @@ static void pose_slide_rest_pose_apply_vec3(tPoseSlideOp *pso, float vec[3], flo const int lock = pso->axislock; for (int idx = 0; idx < 3; idx++) { if ((lock == 0) || ((lock & PS_LOCK_X) && (idx == 0)) || ((lock & PS_LOCK_Y) && (idx == 1)) || - ((lock & PS_LOCK_Z) && (idx == 2))) { + ((lock & PS_LOCK_Z) && (idx == 2))) + { float diff_val = default_value - vec[idx]; if (pso->mode == POSESLIDE_RELAX_REST) { vec[idx] += ED_slider_factor_get(pso->slider) * diff_val; diff --git a/source/blender/editors/asset/intern/asset_ops.cc b/source/blender/editors/asset/intern/asset_ops.cc index f2f702e92e2..6afbea919c5 100644 --- a/source/blender/editors/asset/intern/asset_ops.cc +++ b/source/blender/editors/asset/intern/asset_ops.cc @@ -286,7 +286,8 @@ void AssetClearHelper::reportResults(const bContext *C, ReportList &reports) con /* Dedicated error message for when there is an active asset detected, but it's not an ID local * to this file. Helps users better understanding what's going on. */ if (AssetHandle active_asset = CTX_wm_asset_handle(C, &is_valid); - is_valid && !ED_asset_handle_get_local_id(&active_asset)) { + is_valid && !ED_asset_handle_get_local_id(&active_asset)) + { BKE_report(&reports, RPT_ERROR, "No asset data-blocks from the current file selected (assets must be stored in " diff --git a/source/blender/editors/curve/editcurve.c b/source/blender/editors/curve/editcurve.c index f1ac1924ff6..6da8a8c4bf0 100644 --- a/source/blender/editors/curve/editcurve.c +++ b/source/blender/editors/curve/editcurve.c @@ -1174,7 +1174,8 @@ static void remap_hooks_and_vertex_parents(Main *bmain, Object *obedit) LISTBASE_FOREACH (Object *, object, &bmain->objects) { int index; if ((object->parent) && (object->parent->data == curve) && - ELEM(object->partype, PARVERT1, PARVERT3)) { + ELEM(object->partype, PARVERT1, PARVERT3)) + { if (old_to_new_map == NULL) { old_to_new_map = init_index_map(obedit, &old_totvert); } @@ -1994,7 +1995,8 @@ static int sel_to_copy_ints(const BPoint *bp, if (selected_leg_count && /* Prevents leading and trailing unselected legs if all selected. * Unless it is extrusion from point or curve. */ - (selected_leg_count < max_j || max_j == 1)) { + (selected_leg_count < max_j || max_j == 1)) + { /* Prepend unselected leg if more than one leg selected at the starting edge. * max_j == 1 handles extrusion from point to curve and from curve to surface cases. */ if (is_first_sel && (copy_intervals[0] < copy_intervals[1] || max_j == 1)) { @@ -2085,7 +2087,8 @@ bool ed_editnurb_extrude_flag(EditNurb *editnurb, const uint8_t flag) for (int j = 1; j <= intvl_cnt_v; j++, selected_v = !selected_v) { BPoint *old_bp_v = nu->bp + intvls_v[j - 1] * nu->pntsu; for (int v_j = intvls_v[j - 1]; v_j <= intvls_v[j]; - v_j++, new_bp_v += new_pntsu, old_bp_v += nu->pntsu) { + v_j++, new_bp_v += new_pntsu, old_bp_v += nu->pntsu) + { BPoint *new_bp_u_v = new_bp_v; bool selected_u = is_first_sel_u; for (int i = 1; i <= intvl_cnt_u; i++, selected_u = !selected_u) { @@ -2322,7 +2325,8 @@ static void adduplicateflagNurb( MEM_freeN(usel); if ((newu == 0 || newv == 0) || - (split && !isNurbselU(nu, &newv, SELECT) && !isNurbselV(nu, &newu, SELECT))) { + (split && !isNurbselU(nu, &newv, SELECT) && !isNurbselV(nu, &newu, SELECT))) + { if (G.debug & G_DEBUG) { printf("Can't duplicate Nurb\n"); } @@ -2395,7 +2399,8 @@ static void adduplicateflagNurb( cu->actvert, starta, cu->actvert % nu->pntsu + newu + - b * newnu->pntsu)) { + b * newnu->pntsu)) + { /* actvert in cyclicu selection */ break; } @@ -2404,7 +2409,8 @@ static void adduplicateflagNurb( cu, starta, starta + newu, - cu->actvert - starta + b * newnu->pntsu)) { + cu->actvert - starta + b * newnu->pntsu)) + { /* actvert in 'current' iteration selection */ break; } @@ -2447,7 +2453,8 @@ static void adduplicateflagNurb( starta, starta + newu, cu->actvert - (a / nu->pntsu * nu->pntsu + diffa + - (starta % nu->pntsu)))) { + (starta % nu->pntsu)))) + { break; } } @@ -2487,7 +2494,8 @@ static void adduplicateflagNurb( cu, starta, starta + newu, - cu->actvert - (diffa + (starta % nu->pntsu)))) { + cu->actvert - (diffa + (starta % nu->pntsu)))) + { break; } } @@ -3437,8 +3445,8 @@ static void subdividenurb(Object *obedit, View3D *v3d, int number_cuts) break; } - if (BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt) && - BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, nextbezt)) { + if (BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt) && BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, nextbezt)) + { amount += number_cuts; } bezt++; @@ -4676,13 +4684,15 @@ static int make_segment_exec(bContext *C, wmOperator *op) if (!(nu1->flagu & CU_NURB_CYCLIC) && nu1->pntsu > 1) { if (nu1->type == CU_BEZIER && BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, nu1->bezt) && - BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, &nu1->bezt[nu1->pntsu - 1])) { + BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, &nu1->bezt[nu1->pntsu - 1])) + { nu1->flagu |= CU_NURB_CYCLIC; BKE_nurb_handles_calc(nu1); ok = true; } else if (ELEM(nu1->type, CU_NURBS, CU_POLY) && nu1->bp->f1 & SELECT && - (nu1->bp[nu1->pntsu - 1].f1 & SELECT)) { + (nu1->bp[nu1->pntsu - 1].f1 & SELECT)) + { nu1->flagu |= CU_NURB_CYCLIC; BKE_nurb_knot_calc_u(nu1); ok = true; @@ -4723,7 +4733,8 @@ static int make_segment_exec(bContext *C, wmOperator *op) /* All curves failed: If there is more than one error give a generic error report. */ if (((status.error_selected_few ? 1 : 0) + (status.error_resolution ? 1 : 0) + - (status.error_generic ? 1 : 0)) > 1) { + (status.error_generic ? 1 : 0)) > 1) + { BKE_report(op->reports, RPT_ERROR, "Could not make new segments"); } @@ -5675,7 +5686,8 @@ static int add_vertex_invoke(bContext *C, wmOperator *op, const wmEvent *event) float location_test[3]; madd_v3_v3v3fl(location_test, location, view_dir, lambda); if ((vc.rv3d->is_persp == false) || - (mul_project_m4_v3_zfac(vc.rv3d->persmat, location_test) > 0.0f)) { + (mul_project_m4_v3_zfac(vc.rv3d->persmat, location_test) > 0.0f)) + { copy_v3_v3(location, location_test); } } @@ -6084,7 +6096,8 @@ static bool curve_delete_segments(Object *obedit, View3D *v3d, const bool split) bezt2 = &nu->bezt[nu->pntsu - 2]; if ((nu->flagu & CU_NURB_CYCLIC) && BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt1) && - BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt2)) { + BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt2)) + { /* check if need to join start of spline to end */ nu1 = BKE_nurb_copy(nu, cut + 1, 1); ED_curve_beztcpy(editnurb, &nu1->bezt[1], nu->bezt, cut); @@ -6108,7 +6121,8 @@ static bool curve_delete_segments(Object *obedit, View3D *v3d, const bool split) bezt2 = &nu->bezt[1]; if ((nu->flagu & CU_NURB_CYCLIC) && BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt1) && - BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt2)) { + BEZT_ISSEL_ANY_HIDDENHANDLES(v3d, bezt2)) + { /* check if need to join start of spline to end */ nu1 = BKE_nurb_copy(nu, cut + 1, 1); ED_curve_beztcpy(editnurb, &nu1->bezt[cut], nu->bezt, 1); @@ -6673,7 +6687,8 @@ static int curve_dissolve_exec(bContext *C, wmOperator *UNUSED(op)) test_bezt_is_sel_any, v3d, span_step, - &span_len)) { + &span_len)) + { BezTriple *bezt_prev = &nu->bezt[mod_i(span_step[0] - 1, nu->pntsu)]; BezTriple *bezt_next = &nu->bezt[mod_i(span_step[1] + 1, nu->pntsu)]; diff --git a/source/blender/editors/curve/editcurve_add.c b/source/blender/editors/curve/editcurve_add.c index 15d6592baae..c256fafe1d2 100644 --- a/source/blender/editors/curve/editcurve_add.c +++ b/source/blender/editors/curve/editcurve_add.c @@ -509,7 +509,8 @@ static int curvesurf_prim_add(bContext *C, wmOperator *op, int type, int isSurf) WM_operator_view3d_unit_defaults(C, op); if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, NULL, &enter_editmode, &local_view_bits, NULL)) { + C, op, 'Z', loc, rot, NULL, &enter_editmode, &local_view_bits, NULL)) + { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/curve/editcurve_paint.c b/source/blender/editors/curve/editcurve_paint.c index b4fa97a0e0a..20a2aca6158 100644 --- a/source/blender/editors/curve/editcurve_paint.c +++ b/source/blender/editors/curve/editcurve_paint.c @@ -144,7 +144,8 @@ static void stroke_elem_pressure_set(const struct CurveDrawData *cdd, float pressure) { if ((cdd->project.surface_offset != 0.0f) && !cdd->project.use_surface_offset_absolute && - !is_zero_v3(selem->normal_local)) { + !is_zero_v3(selem->normal_local)) + { const float adjust = stroke_elem_radius_from_pressure(cdd, pressure) - stroke_elem_radius_from_pressure(cdd, selem->pressure); madd_v3_v3fl(selem->location_local, selem->normal_local, adjust); @@ -182,8 +183,8 @@ static bool stroke_elem_project(const struct CurveDrawData *cdd, /* project to 'location_world' */ if (cdd->project.use_plane) { /* get the view vector to 'location' */ - if (ED_view3d_win_to_3d_on_plane( - region, cdd->project.plane, mval_fl, true, r_location_world)) { + if (ED_view3d_win_to_3d_on_plane(region, cdd->project.plane, mval_fl, true, r_location_world)) + { if (r_normal_world) { zero_v3(r_normal_world); } @@ -505,7 +506,8 @@ static void curve_draw_event_add_first(wmOperator *op, const wmEvent *event) curve_draw_event_add(op, event); if ((cps->depth_mode == CURVE_PAINT_PROJECT_SURFACE) && cdd->project.use_depth && - (cps->flag & CURVE_PAINT_FLAG_DEPTH_STROKE_ENDPOINTS)) { + (cps->flag & CURVE_PAINT_FLAG_DEPTH_STROKE_ENDPOINTS)) + { RegionView3D *rv3d = cdd->vc.rv3d; cdd->project.use_depth = false; @@ -514,7 +516,8 @@ static void curve_draw_event_add_first(wmOperator *op, const wmEvent *event) float normal[3] = {0.0f}; if (ELEM(cps->surface_plane, CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW, - CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE)) { + CURVE_PAINT_SURFACE_PLANE_NORMAL_SURFACE)) + { if (ED_view3d_depth_read_cached_normal(cdd->vc.region, cdd->depths, event->mval, normal)) { if (cps->surface_plane == CURVE_PAINT_SURFACE_PLANE_NORMAL_VIEW) { float cross_a[3], cross_b[3]; @@ -684,7 +687,8 @@ static void curve_draw_exec_precalc(wmOperator *op) } if (len_squared_v2v2(selem_first->mval, selem_last->mval) <= - square_f(STROKE_CYCLIC_DIST_PX * UI_SCALE_FAC)) { + square_f(STROKE_CYCLIC_DIST_PX * UI_SCALE_FAC)) + { use_cyclic = true; } } diff --git a/source/blender/editors/curve/editcurve_pen.c b/source/blender/editors/curve/editcurve_pen.c index 60e2dda504a..49e5fd93d1d 100644 --- a/source/blender/editors/curve/editcurve_pen.c +++ b/source/blender/editors/curve/editcurve_pen.c @@ -165,7 +165,8 @@ static void update_location_for_2d_curve(const ViewContext *vc, float location[3 float location_test[3]; madd_v3_v3v3fl(location_test, location, view_dir, lambda); if ((vc->rv3d->is_persp == false) || - (mul_project_m4_v3_zfac(vc->rv3d->persmat, location_test) > 0.0f)) { + (mul_project_m4_v3_zfac(vc->rv3d->persmat, location_test) > 0.0f)) + { copy_v3_v3(location, location_test); } } @@ -496,7 +497,8 @@ static bool get_closest_vertex_to_point_in_nurbs(const ViewContext *vc, /* Consider handles only if visible. Else only consider the middle point of the triple. */ int handle_display = vc->v3d->overlay.handle_display; if (handle_display == CURVE_HANDLE_NONE || - (handle_display == CURVE_HANDLE_SELECTED && !BEZT_ISSEL_ANY(bezt))) { + (handle_display == CURVE_HANDLE_SELECTED && !BEZT_ISSEL_ANY(bezt))) + { start = 1; end = 2; } @@ -1389,7 +1391,8 @@ static bool make_cyclic_if_endpoints(ViewContext *vc, if (nu == sel_nu && ((nu->type == CU_BEZIER && bezt != sel_bezt && ELEM(bezt, nu->bezt, nu->bezt + nu->pntsu - 1) && bezt_idx == 1) || - (nu->type != CU_BEZIER && bp != sel_bp && ELEM(bp, nu->bp, nu->bp + nu->pntsu - 1)))) { + (nu->type != CU_BEZIER && bp != sel_bp && ELEM(bp, nu->bp, nu->bp + nu->pntsu - 1)))) + { View3D *v3d = vc->v3d; ListBase *nurbs = object_editcurve_get(vc->obedit); curve_toggle_cyclic(v3d, nurbs, 0); @@ -1661,7 +1664,8 @@ static int curve_pen_modal(bContext *C, wmOperator *op, const wmEvent *event) /* Close spline on Click, if enabled. */ if (!cpd->acted && close_spline && close_spline_method == ON_CLICK && cpd->found_point && - !cpd->dragging) { + !cpd->dragging) + { if (cpd->nu && !is_cyclic(cpd->nu)) { copy_v2_v2_int(vc.mval, event->mval); cpd->acted = make_cyclic_if_endpoints(&vc, cpd->nu, cpd->bezt, cpd->bp); @@ -1776,7 +1780,8 @@ static int curve_pen_invoke(bContext *C, wmOperator *op, const wmEvent *event) &vc, nurbs, mval_fl, &nu1, &bezt1, &bp1, &bezt_idx); if (move_point && nu1 && !nu1->hide && - (bezt || (bezt1 && !BEZT_ISSEL_IDX(bezt1, bezt_idx)) || (bp1 && !(bp1->f1 & SELECT)))) { + (bezt || (bezt1 && !BEZT_ISSEL_IDX(bezt1, bezt_idx)) || (bp1 && !(bp1->f1 & SELECT)))) + { /* Select the closest bezt or bp. */ ED_curve_deselect_all(cu->editnurb); if (bezt1) { diff --git a/source/blender/editors/curve/editfont.c b/source/blender/editors/curve/editfont.c index 99a146c84d0..34abff37eb9 100644 --- a/source/blender/editors/curve/editfont.c +++ b/source/blender/editors/curve/editfont.c @@ -1075,7 +1075,8 @@ static int paste_text_exec(bContext *C, wmOperator *op) } else { if ((clipboard_system.len <= MAXTEXT) && - font_paste_utf8(C, clipboard_system.buf, clipboard_system.len)) { + font_paste_utf8(C, clipboard_system.buf, clipboard_system.len)) + { text_update_edited(C, obedit, FO_EDIT); retval = OPERATOR_FINISHED; } @@ -2399,7 +2400,8 @@ bool ED_curve_editfont_select_pick( for (j = 0; j < 4; j++) { if (ED_view3d_project_float_object( - vc.region, obedit_co[j], screen_co[j], V3D_PROJ_TEST_CLIP_BB) == V3D_PROJ_RET_OK) { + vc.region, obedit_co[j], screen_co[j], V3D_PROJ_TEST_CLIP_BB) == V3D_PROJ_RET_OK) + { project_ok |= (1 << j); } } diff --git a/source/blender/editors/curves/intern/curves_ops.cc b/source/blender/editors/curves/intern/curves_ops.cc index fa08fa8a04f..34bfdddd928 100644 --- a/source/blender/editors/curves/intern/curves_ops.cc +++ b/source/blender/editors/curves/intern/curves_ops.cc @@ -796,7 +796,8 @@ static int curves_set_selection_domain_exec(bContext *C, wmOperator *op) if (!attributes.add(".selection", domain, bke::cpp_type_to_custom_data_type(type), - bke::AttributeInitMoveArray(dst))) { + bke::AttributeInitMoveArray(dst))) + { MEM_freeN(dst); } } diff --git a/source/blender/editors/curves/intern/curves_selection.cc b/source/blender/editors/curves/intern/curves_selection.cc index 8b2e5aec326..d79c4a6ea22 100644 --- a/source/blender/editors/curves/intern/curves_selection.cc +++ b/source/blender/editors/curves/intern/curves_selection.cc @@ -726,7 +726,8 @@ bool select_lasso(const ViewContext &vc, /* Check the lasso bounding box first as an optimization. */ if (BLI_rcti_isect_pt_v(&bbox, int2(pos_proj)) && BLI_lasso_is_point_inside( - coord_array, coords.size(), int(pos_proj.x), int(pos_proj.y), IS_CLIPPED)) { + coord_array, coords.size(), int(pos_proj.x), int(pos_proj.y), IS_CLIPPED)) + { apply_selection_operation_at_index(selection.span, point_i, sel_op); changed = true; } @@ -744,7 +745,8 @@ bool select_lasso(const ViewContext &vc, /* Check the lasso bounding box first as an optimization. */ if (BLI_rcti_isect_pt_v(&bbox, int2(pos_proj)) && BLI_lasso_is_point_inside( - coord_array, coords.size(), int(pos_proj.x), int(pos_proj.y), IS_CLIPPED)) { + coord_array, coords.size(), int(pos_proj.x), int(pos_proj.y), IS_CLIPPED)) + { apply_selection_operation_at_index(selection.span, curve_i, sel_op); changed = true; } @@ -766,7 +768,8 @@ bool select_lasso(const ViewContext &vc, int(pos1_proj.y), int(pos2_proj.x), int(pos2_proj.y), - IS_CLIPPED)) { + IS_CLIPPED)) + { apply_selection_operation_at_index(selection.span, curve_i, sel_op); changed = true; break; diff --git a/source/blender/editors/geometry/geometry_attributes.cc b/source/blender/editors/geometry/geometry_attributes.cc index 6150f78bcde..65685ff394d 100644 --- a/source/blender/editors/geometry/geometry_attributes.cc +++ b/source/blender/editors/geometry/geometry_attributes.cc @@ -263,7 +263,8 @@ static int geometry_attribute_convert_exec(bContext *C, wmOperator *op) name.c_str(), eCustomDataType(RNA_enum_get(op->ptr, "data_type")), eAttrDomain(RNA_enum_get(op->ptr, "domain")), - op->reports)) { + op->reports)) + { return OPERATOR_CANCELLED; } break; @@ -565,7 +566,8 @@ static bool geometry_color_attribute_convert_poll(bContext *C) return false; } if (!(ATTR_DOMAIN_AS_MASK(meta_data->domain) & ATTR_DOMAIN_MASK_COLOR) || - !(CD_TYPE_AS_MASK(meta_data->data_type) & CD_MASK_COLOR_ALL)) { + !(CD_TYPE_AS_MASK(meta_data->data_type) & CD_MASK_COLOR_ALL)) + { return false; } diff --git a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c index 731b1b07193..0399e8b2c2a 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/button2d_gizmo.c @@ -336,7 +336,8 @@ static bool gizmo_button2d_bounds(bContext *C, wmGizmo *gz, rcti *r_bounding_box if (gz->parent_gzgroup->type->flag & WM_GIZMOGROUPTYPE_3D) { ARegion *region = CTX_wm_region(C); if (ED_view3d_project_float_global(region, matrix_final[3], co_proj, V3D_PROJ_TEST_NOP) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { float matrix_final_no_offset[4][4]; const RegionView3D *rv3d = region->regiondata; WM_gizmo_calc_matrix_final_no_offset(gz, matrix_final_no_offset); diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c index 12572584f8f..89c794335dc 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/cage2d_gizmo.c @@ -589,7 +589,8 @@ static void cage2d_draw_rect_corner_handles(const rctf *r, { /* Only draw corner handles when hovering over the corners. */ if (highlighted < ED_GIZMO_CAGE2D_PART_SCALE_MIN_X_MIN_Y || - highlighted > ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MAX_Y) { + highlighted > ED_GIZMO_CAGE2D_PART_SCALE_MAX_X_MAX_Y) + { return; } @@ -1013,7 +1014,8 @@ static int gizmo_cage2d_invoke(bContext *C, wmGizmo *gz, const wmEvent *event) WM_gizmo_calc_matrix_final_no_offset(gz, data->orig_matrix_final_no_offset); if (gizmo_window_project_2d( - C, gz, (const float[2]){UNPACK2(event->mval)}, 2, false, data->orig_mouse) == 0) { + C, gz, (const float[2]){UNPACK2(event->mval)}, 2, false, data->orig_mouse) == 0) + { zero_v2(data->orig_mouse); } diff --git a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c index f244e56ce21..ce8bac5b318 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/cage3d_gizmo.c @@ -93,7 +93,8 @@ static void gizmo_rect_pivot_from_scale_part(int part, bool has_translation) { if (part >= ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z && - part <= ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z) { + part <= ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z) + { int index = (part - ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z); int range[3]; range[2] = index % 3; @@ -145,7 +146,8 @@ static void cage3d_draw_box_interaction(const RegionView3D *rv3d, const float margin[3]) { if (highlighted >= ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z && - highlighted <= ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z) { + highlighted <= ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z) + { int index = (highlighted - ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z); int range[3]; range[2] = index % 3; @@ -321,7 +323,8 @@ static void gizmo_cage3d_draw_intern( if (transform_flag & ED_GIZMO_CAGE_XFORM_FLAG_SCALE) { for (int i = ED_GIZMO_CAGE3D_PART_SCALE_MIN_X_MIN_Y_MIN_Z; i <= ED_GIZMO_CAGE3D_PART_SCALE_MAX_X_MAX_Y_MAX_Z; - i++) { + i++) + { if (i == ED_GIZMO_CAGE3D_PART_SCALE_MID_X_MID_Y_MID_Z) { continue; } @@ -446,7 +449,8 @@ static int gizmo_cage3d_invoke(bContext *C, wmGizmo *gz, const wmEvent *event) gizmo_calc_matrix_final_no_offset(gz, data->orig_matrix_final_no_offset, true); if (gizmo_window_project_3d( - C, gz, (const float[2]){UNPACK2(event->mval)}, false, data->orig_mouse) == 0) { + C, gz, (const float[2]){UNPACK2(event->mval)}, false, data->orig_mouse) == 0) + { zero_v3(data->orig_mouse); } diff --git a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c index 866952015f1..c11b3461cb7 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/move3d_gizmo.c @@ -251,7 +251,8 @@ static int gizmo_move_modal(bContext *C, float mval_proj_init[2], mval_proj_curr[2]; if ((gizmo_window_project_2d(C, gz, inter->init.mval, 2, false, mval_proj_init) == false) || (gizmo_window_project_2d( - C, gz, (const float[2]){UNPACK2(event->mval)}, 2, false, mval_proj_curr) == false)) { + C, gz, (const float[2]){UNPACK2(event->mval)}, 2, false, mval_proj_curr) == false)) + { return OPERATOR_RUNNING_MODAL; } sub_v2_v2v2(prop_delta, mval_proj_curr, mval_proj_init); @@ -288,7 +289,8 @@ static int gizmo_move_modal(bContext *C, NULL, &dist_px, co, - NULL)) { + NULL)) + { float matrix_space_inv[4][4]; invert_m4_m4(matrix_space_inv, gz->matrix_space); mul_v3_m4v3(move->prop_co, matrix_space_inv, co); diff --git a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c index df4222fe154..cccc3243640 100644 --- a/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c +++ b/source/blender/editors/gizmo_library/gizmo_types/snap3d_gizmo.c @@ -222,7 +222,8 @@ static bool snap_cursor_poll(ARegion *region, void *data) { SnapGizmo3D *snap_gizmo = (SnapGizmo3D *)data; if (!(snap_gizmo->gizmo.state & WM_GIZMO_STATE_HIGHLIGHT) && - !(snap_gizmo->gizmo.flag & WM_GIZMO_DRAW_VALUE)) { + !(snap_gizmo->gizmo.flag & WM_GIZMO_DRAW_VALUE)) + { return false; } diff --git a/source/blender/editors/gpencil_legacy/annotate_draw.c b/source/blender/editors/gpencil_legacy/annotate_draw.c index e3346fe9690..5a35c06153b 100644 --- a/source/blender/editors/gpencil_legacy/annotate_draw.c +++ b/source/blender/editors/gpencil_legacy/annotate_draw.c @@ -218,7 +218,8 @@ static void annotation_draw_stroke_buffer(bGPdata *gps, } /* Draw starting arrow stroke. */ if ((sflag & GP_STROKE_USE_ARROW_START) && - (runtime.arrow_start_style != GP_STROKE_ARROWSTYLE_NONE)) { + (runtime.arrow_start_style != GP_STROKE_ARROWSTYLE_NONE)) + { float start[2]; copy_v2_v2(start, points[0].m_xy); annotation_draw_stroke_arrow_buffer( diff --git a/source/blender/editors/gpencil_legacy/annotate_paint.c b/source/blender/editors/gpencil_legacy/annotate_paint.c index 17c1fcefb89..f4fc06d8b18 100644 --- a/source/blender/editors/gpencil_legacy/annotate_paint.c +++ b/source/blender/editors/gpencil_legacy/annotate_paint.c @@ -317,8 +317,8 @@ static void annotation_stroke_convertcoords(tGPsdata *p, if (gpd->runtime.sbuffer_sflag & GP_STROKE_3DSPACE) { int mval_i[2]; round_v2i_v2fl(mval_i, mval); - if (annotation_project_check(p) && - ED_view3d_autodist_simple(p->region, mval_i, out, 0, depth)) { + if (annotation_project_check(p) && ED_view3d_autodist_simple(p->region, mval_i, out, 0, depth)) + { /* projecting onto 3D-Geometry * - nothing more needs to be done here, since view_autodist_simple() has already done it */ @@ -340,7 +340,8 @@ static void annotation_stroke_convertcoords(tGPsdata *p, const float zfac = ED_view3d_calc_zfac(p->region->regiondata, rvec); if (ED_view3d_project_float_global(p->region, rvec, mval_prj, V3D_PROJ_TEST_NOP) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { float dvec[3]; float xy_delta[2]; sub_v2_v2v2(xy_delta, mval_prj, mval); @@ -897,7 +898,8 @@ static void annotation_stroke_newfrombuffer(tGPsdata *p) /** Create arrow strokes. */ /* End arrow stroke. */ if ((runtime.sbuffer_sflag & GP_STROKE_USE_ARROW_END) && - (runtime.arrow_end_style != GP_STROKE_ARROWSTYLE_NONE)) { + (runtime.arrow_end_style != GP_STROKE_ARROWSTYLE_NONE)) + { int totarrowpoints = runtime.arrow_end_style; /* Setting up arrow stroke. */ @@ -918,7 +920,8 @@ static void annotation_stroke_newfrombuffer(tGPsdata *p) } /* Start arrow stroke. */ if ((runtime.sbuffer_sflag & GP_STROKE_USE_ARROW_START) && - (runtime.arrow_start_style != GP_STROKE_ARROWSTYLE_NONE)) { + (runtime.arrow_start_style != GP_STROKE_ARROWSTYLE_NONE)) + { int totarrowpoints = runtime.arrow_start_style; /* Setting up arrow stroke. */ @@ -968,7 +971,8 @@ static void annotation_stroke_newfrombuffer(tGPsdata *p) if ((ED_view3d_depth_read_cached(depths, mval_i, depth_margin, depth_arr + i) == 0) && (i && (ED_view3d_depth_read_cached_seg( - depths, mval_i, mval_prev, depth_margin + 1, depth_arr + i) == 0))) { + depths, mval_i, mval_prev, depth_margin + 1, depth_arr + i) == 0))) + { interp_depth = true; } else { @@ -1022,8 +1026,8 @@ static void annotation_stroke_newfrombuffer(tGPsdata *p) pt = gps->points; /* convert all points (normal behavior) */ - for (i = 0, ptc = gpd->runtime.sbuffer; i < gpd->runtime.sbuffer_used && ptc; - i++, ptc++, pt++) { + for (i = 0, ptc = gpd->runtime.sbuffer; i < gpd->runtime.sbuffer_used && ptc; i++, ptc++, pt++) + { /* convert screen-coordinates to appropriate coordinates (and store them) */ annotation_stroke_convertcoords(p, ptc->m_xy, &pt->x, depth_arr ? depth_arr + i : NULL); @@ -1160,14 +1164,16 @@ static void annotation_stroke_eraser_dostroke(tGPsdata *p, /* Check that point segment of the bound-box of the eraser stroke. */ if ((!ELEM(V2D_IS_CLIPPED, pc1[0], pc1[1]) && BLI_rcti_isect_pt(rect, pc1[0], pc1[1])) || - (!ELEM(V2D_IS_CLIPPED, pc2[0], pc2[1]) && BLI_rcti_isect_pt(rect, pc2[0], pc2[1]))) { + (!ELEM(V2D_IS_CLIPPED, pc2[0], pc2[1]) && BLI_rcti_isect_pt(rect, pc2[0], pc2[1]))) + { /* Check if point segment of stroke had anything to do with * eraser region (either within stroke painted, or on its lines) * - this assumes that line-width is irrelevant. */ if (gpencil_stroke_inside_circle(mval, radius, pc1[0], pc1[1], pc2[0], pc2[1])) { if ((annotation_stroke_eraser_is_occluded(p, pt1, pc1[0], pc1[1]) == false) || - (annotation_stroke_eraser_is_occluded(p, pt2, pc2[0], pc2[1]) == false)) { + (annotation_stroke_eraser_is_occluded(p, pt2, pc2[0], pc2[1]) == false)) + { /* Edge is affected - Check individual points now */ if (len_v2v2_int(mval_i, pc1) <= radius) { pt1->flag |= GP_SPOINT_TAG; @@ -2464,7 +2470,8 @@ static int annotation_draw_modal(bContext *C, wmOperator *op, const wmEvent *eve EVT_DOWNARROWKEY, EVT_RIGHTARROWKEY, EVT_UPARROWKEY, - EVT_ZKEY)) { + EVT_ZKEY)) + { /* allow some keys: * - For frame changing #33412. * - For undo (during sketching sessions). @@ -2480,7 +2487,8 @@ static int annotation_draw_modal(bContext *C, wmOperator *op, const wmEvent *eve EVT_PAD6, EVT_PAD7, EVT_PAD8, - EVT_PAD9)) { + EVT_PAD9)) + { /* Allow numpad keys so that camera/view manipulations can still take place * - #EVT_PAD0 in particular is really important for Grease Pencil drawing, * as animators may be working "to camera", so having this working @@ -2506,7 +2514,8 @@ static int annotation_draw_modal(bContext *C, wmOperator *op, const wmEvent *eve * as that would break polyline #32647. */ if (event->val == KM_PRESS && - ELEM(event->type, EVT_RETKEY, EVT_PADENTER, EVT_ESCKEY, EVT_SPACEKEY, EVT_EKEY)) { + ELEM(event->type, EVT_RETKEY, EVT_PADENTER, EVT_ESCKEY, EVT_SPACEKEY, EVT_EKEY)) + { /* exit() ends the current stroke before cleaning up */ p->status = GP_STATUS_DONE; estate = OPERATOR_FINISHED; @@ -2661,7 +2670,8 @@ static int annotation_draw_modal(bContext *C, wmOperator *op, const wmEvent *eve } /* eraser size */ else if ((p->paintmode == GP_PAINTMODE_ERASER) && - ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, EVT_PADPLUSKEY, EVT_PADMINUS)) { + ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, EVT_PADPLUSKEY, EVT_PADMINUS)) + { /* just resize the brush (local version) * TODO: fix the hardcoded size jumps (set to make a visible difference) and hardcoded keys */ diff --git a/source/blender/editors/gpencil_legacy/drawgpencil.c b/source/blender/editors/gpencil_legacy/drawgpencil.c index f7068c32db8..3c422a07aec 100644 --- a/source/blender/editors/gpencil_legacy/drawgpencil.c +++ b/source/blender/editors/gpencil_legacy/drawgpencil.c @@ -319,13 +319,15 @@ static void gpencil_draw_strokes(tGPDdraw *tgpw) if ((gp_style == NULL) || (gp_style->flag & GP_MATERIAL_HIDE) || /* If onion and ghost flag do not draw. */ - (tgpw->onion && (gp_style->flag & GP_MATERIAL_HIDE_ONIONSKIN))) { + (tgpw->onion && (gp_style->flag & GP_MATERIAL_HIDE_ONIONSKIN))) + { continue; } /* if disable fill, the colors with fill must be omitted too except fill boundary strokes */ if ((tgpw->disable_fill == 1) && (gp_style->fill_rgba[3] > 0.0f) && - ((gps->flag & GP_STROKE_NOFILL) == 0) && (gp_style->flag & GP_MATERIAL_FILL_SHOW)) { + ((gps->flag & GP_STROKE_NOFILL) == 0) && (gp_style->flag & GP_MATERIAL_FILL_SHOW)) + { continue; } diff --git a/source/blender/editors/gpencil_legacy/gpencil_convert.c b/source/blender/editors/gpencil_legacy/gpencil_convert.c index 97763060269..1ddb512826b 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_convert.c +++ b/source/blender/editors/gpencil_legacy/gpencil_convert.c @@ -792,7 +792,8 @@ static void gpencil_stroke_to_path(bContext *C, /* add points */ for (i = (stitch) ? 1 : 0, pt = &gps->points[(stitch) ? 1 : 0], bp = &nu->bp[old_nbp]; i < gps->totpoints; - i++, pt++, bp++) { + i++, pt++, bp++) + { float p[3]; float width = pt->pressure * (gps->thickness + gpl->line_change) * WIDTH_CORR_FAC; @@ -1415,7 +1416,8 @@ static bool gpencil_convert_check_has_valid_timing(bContext *C, bGPDlayer *gpl, bool valid = true; if (!gpl || !(gpf = BKE_gpencil_layer_frame_get(gpl, scene->r.cfra, GP_GETFRAME_USE_PREV)) || - !(gps = gpf->strokes.first)) { + !(gps = gpf->strokes.first)) + { return false; } @@ -1579,7 +1581,8 @@ static bool gpencil_convert_poll_property(const bContext *UNUSED(C), "radius_multiplier", "use_link_strokes", "bevel_depth", - "bevel_resolution")) { + "bevel_resolution")) + { return true; } diff --git a/source/blender/editors/gpencil_legacy/gpencil_data.c b/source/blender/editors/gpencil_legacy/gpencil_data.c index 25d424b92cb..7ba73cc0268 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_data.c +++ b/source/blender/editors/gpencil_legacy/gpencil_data.c @@ -2229,7 +2229,8 @@ static bool gpencil_vertex_group_poll(bContext *C) Main *bmain = CTX_data_main(C); const bGPdata *gpd = (const bGPdata *)ob->data; if (BKE_id_is_editable(bmain, &ob->id) && BKE_id_is_editable(bmain, ob->data) && - !BLI_listbase_is_empty(&gpd->vertex_group_names)) { + !BLI_listbase_is_empty(&gpd->vertex_group_names)) + { if (ELEM(ob->mode, OB_MODE_EDIT_GPENCIL, OB_MODE_SCULPT_GPENCIL)) { return true; } @@ -2247,7 +2248,8 @@ static bool gpencil_vertex_group_weight_poll(bContext *C) Main *bmain = CTX_data_main(C); const bGPdata *gpd = (const bGPdata *)ob->data; if (BKE_id_is_editable(bmain, &ob->id) && BKE_id_is_editable(bmain, ob->data) && - !BLI_listbase_is_empty(&gpd->vertex_group_names)) { + !BLI_listbase_is_empty(&gpd->vertex_group_names)) + { if (ob->mode == OB_MODE_WEIGHT_GPENCIL) { return true; } @@ -2928,7 +2930,8 @@ int ED_gpencil_join_objects_exec(bContext *C, wmOperator *op) old_idx++; } if (!BLI_listbase_is_empty(&gpd_dst->vertex_group_names) && - gpd_dst->vertex_group_active_index == 0) { + gpd_dst->vertex_group_active_index == 0) + { gpd_dst->vertex_group_active_index = 1; } diff --git a/source/blender/editors/gpencil_legacy/gpencil_edit.c b/source/blender/editors/gpencil_legacy/gpencil_edit.c index 6c54a9f7d53..545c4973d86 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_edit.c +++ b/source/blender/editors/gpencil_legacy/gpencil_edit.c @@ -1876,8 +1876,8 @@ static int gpencil_move_to_layer_exec(bContext *C, wmOperator *op) } bGPDframe *init_gpf = (is_multiedit) ? gpl_src->frames.first : gpl_src->actframe; for (bGPDframe *gpf_src = init_gpf; gpf_src; gpf_src = gpf_src->next) { - if ((gpf_src == gpl_src->actframe) || - ((gpf_src->flag & GP_FRAME_SELECT) && (is_multiedit))) { + if ((gpf_src == gpl_src->actframe) || ((gpf_src->flag & GP_FRAME_SELECT) && (is_multiedit))) + { if (gpf_src == NULL) { continue; } @@ -3278,8 +3278,8 @@ static int gpencil_stroke_cyclical_set_exec(bContext *C, wmOperator *op) for (gps = gpf->strokes.first; gps; gps = gps->next) { MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1); /* skip strokes that are not selected or invalid for current view */ - if (((gps->flag & GP_STROKE_SELECT) == 0) || - ED_gpencil_stroke_can_use(C, gps) == false) { + if (((gps->flag & GP_STROKE_SELECT) == 0) || ED_gpencil_stroke_can_use(C, gps) == false) + { continue; } /* skip hidden or locked colors */ @@ -4473,7 +4473,8 @@ static int gpencil_count_subdivision_cuts(bGPDstroke *gps) } if ((gps->flag & GP_STROKE_CYCLIC) && (gps->points[0].flag & GP_SPOINT_SELECT) && - (gps->points[gps->totpoints - 1].flag & GP_SPOINT_SELECT)) { + (gps->points[gps->totpoints - 1].flag & GP_SPOINT_SELECT)) + { totnewpoints++; } diff --git a/source/blender/editors/gpencil_legacy/gpencil_edit_curve.c b/source/blender/editors/gpencil_legacy/gpencil_edit_curve.c index 26890004238..c32c38e28c4 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_edit_curve.c +++ b/source/blender/editors/gpencil_legacy/gpencil_edit_curve.c @@ -73,7 +73,8 @@ static int gpencil_stroke_enter_editcurve_mode_exec(bContext *C, wmOperator *op) LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) { /* only allow selected and non-converted strokes to be transformed */ if ((gps->flag & GP_STROKE_SELECT && gps->editcurve == NULL) || - (gps->editcurve != NULL && gps->editcurve->flag & GP_CURVE_NEEDS_STROKE_UPDATE)) { + (gps->editcurve != NULL && gps->editcurve->flag & GP_CURVE_NEEDS_STROKE_UPDATE)) + { BKE_gpencil_stroke_editcurve_update(gpd, gpl, gps); /* Update the selection from the stroke to the curve. */ BKE_gpencil_editcurve_stroke_sync_selection(gpd, gps, gps->editcurve); diff --git a/source/blender/editors/gpencil_legacy/gpencil_fill.c b/source/blender/editors/gpencil_legacy/gpencil_fill.c index e085325735f..1e072f9362a 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_fill.c +++ b/source/blender/editors/gpencil_legacy/gpencil_fill.c @@ -516,7 +516,8 @@ static void gpencil_stroke_collision( gps_a->boundbox_max, gps_b->boundbox_min, gps_b->boundbox_max, - 1.1f)) { + 1.1f)) + { continue; } @@ -524,7 +525,8 @@ static void gpencil_stroke_collision( for (int i = 0; i < gps_b->totpoints - 1; i++) { /* Skip segments over same pixel. */ if (((int)a1xy[0] == (int)stroke->points2d[i + 1][0]) && - ((int)a1xy[1] == (int)stroke->points2d[i + 1][1])) { + ((int)a1xy[1] == (int)stroke->points2d[i + 1][1])) + { continue; } @@ -624,7 +626,8 @@ static void gpencil_cut_extensions(tGPDfill *tgpf) gps_a->boundbox_max, gps_b->boundbox_min, gps_b->boundbox_max, - 1.1f)) { + 1.1f)) + { continue; } @@ -791,7 +794,8 @@ static void gpencil_create_extensions_radius(tGPDfill *tgpf) BLI_gset_add(connected_endpoints, stroke1_end); } for (bGPDstroke *gps2 = (bGPDstroke *)(((Link *)gps)->next); gps2 != NULL; - gps2 = (bGPDstroke *)(((Link *)gps2)->next)) { + gps2 = (bGPDstroke *)(((Link *)gps2)->next)) + { /* Don't check distance to temporary extensions. */ if ((gps2->flag & GP_STROKE_NOFILL) && (gps2->flag & GP_STROKE_TAG)) { continue; @@ -803,7 +807,8 @@ static void gpencil_create_extensions_radius(tGPDfill *tgpf) gps->boundbox_max, gps2->boundbox_min, gps2->boundbox_max, - connection_dist)) { + connection_dist)) + { continue; } @@ -867,8 +872,8 @@ static bool gpencil_stroke_is_drawable(tGPDfill *tgpf, bGPDstroke *gps) const bool is_help_stroke = (gps->flag & GP_STROKE_NOFILL) && (gps->flag & GP_STROKE_HELP); const bool stroke_collide = (gps->flag & GP_STROKE_COLLIDE) != 0; - if (is_line_mode && is_extend_stroke && tgpf->is_render && use_stroke_collide && - !stroke_collide) { + if (is_line_mode && is_extend_stroke && tgpf->is_render && use_stroke_collide && !stroke_collide) + { return false; } @@ -1171,7 +1176,8 @@ static void gpencil_draw_datablock(tGPDfill *tgpf, const float ink[4]) /* Normal strokes. */ if (ELEM(tgpf->fill_draw_mode, GP_FILL_DMODE_STROKE, GP_FILL_DMODE_BOTH)) { if (gpencil_stroke_is_drawable(tgpf, gps) && ((gps->flag & GP_STROKE_TAG) == 0) && - ((gps->flag & GP_STROKE_HELP) == 0)) { + ((gps->flag & GP_STROKE_HELP) == 0)) + { ED_gpencil_draw_fill(&tgpw); } /* In stroke mode, still must draw the extend lines. */ @@ -2017,7 +2023,8 @@ static void gpencil_get_outline_points(tGPDfill *tgpf, const bool dilate) } /* Current pixel is equal to starting or first pixel. */ if ((boundary_co[0] == start_co[0] && boundary_co[1] == start_co[1]) || - (boundary_co[0] == first_co[0] && boundary_co[1] == first_co[1])) { + (boundary_co[0] == first_co[0] && boundary_co[1] == first_co[1])) + { BLI_stack_pop(tgpf->stack, &v); break; } @@ -2072,7 +2079,8 @@ static void gpencil_get_depth_array(tGPDfill *tgpf) if ((ED_view3d_depth_read_cached(depths, mval_i, depth_margin, tgpf->depth_arr + i) == 0) && (i && (ED_view3d_depth_read_cached_seg( - depths, mval_i, mval_prev, depth_margin + 1, tgpf->depth_arr + i) == 0))) { + depths, mval_i, mval_prev, depth_margin + 1, tgpf->depth_arr + i) == 0))) + { interp_depth = true; } else { @@ -2326,7 +2334,8 @@ static bool gpencil_fill_poll(bContext *C) ScrArea *area = CTX_wm_area(C); if (area->spacetype == SPACE_VIEW3D) { if ((obact == NULL) || (obact->type != OB_GPENCIL_LEGACY) || - (obact->mode != OB_MODE_PAINT_GPENCIL)) { + (obact->mode != OB_MODE_PAINT_GPENCIL)) + { return false; } diff --git a/source/blender/editors/gpencil_legacy/gpencil_interpolate.c b/source/blender/editors/gpencil_legacy/gpencil_interpolate.c index 7be70b305f3..5386bcb74ea 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_interpolate.c +++ b/source/blender/editors/gpencil_legacy/gpencil_interpolate.c @@ -418,7 +418,8 @@ static bGPDframe *gpencil_get_previous_keyframe(bGPDlayer *gpl, { if (gpl->actframe != NULL && gpl->actframe->framenum < cfra) { if ((!exclude_breakdowns) || - ((exclude_breakdowns) && (gpl->actframe->key_type != BEZT_KEYTYPE_BREAKDOWN))) { + ((exclude_breakdowns) && (gpl->actframe->key_type != BEZT_KEYTYPE_BREAKDOWN))) + { return gpl->actframe; } } @@ -535,8 +536,8 @@ static void gpencil_interpolate_set_points(bContext *C, tGPDinterpolate *tgpi) BKE_gpencil_stroke_flip(gps_to); } else if (tgpi->flipmode == GP_INTERPOLATE_FLIPAUTO) { - if (gpencil_stroke_need_flip( - tgpi->depsgraph, tgpi->ob, gpl, &tgpi->gsc, gps_from, gps_to)) { + if (gpencil_stroke_need_flip(tgpi->depsgraph, tgpi->ob, gpl, &tgpi->gsc, gps_from, gps_to)) + { BKE_gpencil_stroke_flip(gps_to); } } @@ -1310,8 +1311,8 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op) LISTBASE_FOREACH (bGPDstroke *, gps_from, &prevFrame->strokes) { bGPDstroke *gps_to = NULL; /* Only selected. */ - if (GPENCIL_EDIT_MODE(gpd) && (only_selected) && - ((gps_from->flag & GP_STROKE_SELECT) == 0)) { + if (GPENCIL_EDIT_MODE(gpd) && (only_selected) && ((gps_from->flag & GP_STROKE_SELECT) == 0)) + { continue; } /* Skip strokes that are invalid for current view. */ diff --git a/source/blender/editors/gpencil_legacy/gpencil_paint.c b/source/blender/editors/gpencil_legacy/gpencil_paint.c index 41979f33273..3ef4083b08a 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_paint.c +++ b/source/blender/editors/gpencil_legacy/gpencil_paint.c @@ -457,7 +457,8 @@ static void gpencil_stroke_convertcoords(tGPsdata *p, const float zfac = ED_view3d_calc_zfac(p->region->regiondata, rvec); if (ED_view3d_project_float_global(p->region, rvec, mval_prj, V3D_PROJ_TEST_NOP) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { float dvec[3]; float xy_delta[2]; sub_v2_v2v2(xy_delta, mval_prj, mval); @@ -1142,8 +1143,8 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) gpencil_world_to_object_space(depsgraph, obact, gpl, gps); /* If camera view or view projection, reproject flat to view to avoid perspective effect. */ - if ((!is_depth) && - (((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || (is_camera))) { + if ((!is_depth) && (((align_flag & GP_PROJECT_VIEWSPACE) && is_lock_axis_view) || (is_camera))) + { ED_gpencil_project_stroke_to_view(p->C, p->gpl, gps); } } @@ -1166,7 +1167,8 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) if ((ED_view3d_depth_read_cached(depths, mval_i, depth_margin, depth_arr + i) == 0) && (i && (ED_view3d_depth_read_cached_seg( - depths, mval_i, mval_prev, depth_margin + 1, depth_arr + i) == 0))) { + depths, mval_i, mval_prev, depth_margin + 1, depth_arr + i) == 0))) + { interp_depth = true; } else { @@ -1186,7 +1188,8 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) else { if ((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) && ((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE_ENDPOINTS) || - (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE_FIRST))) { + (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE_FIRST))) + { int first_valid = 0; int last_valid = 0; @@ -1231,8 +1234,8 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) /* convert all points (normal behavior) */ int i; - for (i = 0, ptc = gpd->runtime.sbuffer; i < gpd->runtime.sbuffer_used && ptc; - i++, ptc++, pt++) { + for (i = 0, ptc = gpd->runtime.sbuffer; i < gpd->runtime.sbuffer_used && ptc; i++, ptc++, pt++) + { /* convert screen-coordinates to appropriate coordinates (and store them) */ gpencil_stroke_convertcoords(p, ptc->m_xy, &pt->x, depth_arr ? depth_arr + i : NULL); @@ -1279,7 +1282,8 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) /* Simplify adaptive */ if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_SETTINGS) && - (brush->gpencil_settings->simplify_f > 0.0f)) { + (brush->gpencil_settings->simplify_f > 0.0f)) + { BKE_gpencil_stroke_simplify_adaptive(gpd, gps, brush->gpencil_settings->simplify_f); } @@ -1296,7 +1300,8 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) /* Convert to Outline. */ if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_SETTINGS) && - (brush->gpencil_settings->flag & GP_BRUSH_OUTLINE_STROKE)) { + (brush->gpencil_settings->flag & GP_BRUSH_OUTLINE_STROKE)) + { gps = gpencil_stroke_to_outline(p, gps); } @@ -1338,7 +1343,8 @@ static void gpencil_stroke_newfrombuffer(tGPsdata *p) /* post process stroke */ if ((p->brush->gpencil_settings->flag & GP_BRUSH_GROUP_SETTINGS) && - p->brush->gpencil_settings->flag & GP_BRUSH_TRIM_STROKE) { + p->brush->gpencil_settings->flag & GP_BRUSH_TRIM_STROKE) + { BKE_gpencil_stroke_trim(gpd, gps); } @@ -1566,7 +1572,8 @@ static void gpencil_stroke_eraser_dostroke(tGPsdata *p, } } else if ((p->flags & GP_PAINTFLAG_STROKE_ERASER) || - (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_STROKE)) { + (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_STROKE)) + { for (i = 0; (i + 1) < gps->totpoints; i++) { /* only process if it hasn't been masked out... */ @@ -1653,7 +1660,8 @@ static void gpencil_stroke_eraser_dostroke(tGPsdata *p, /* Check that point segment of the bound-box of the eraser stroke. */ if ((!ELEM(V2D_IS_CLIPPED, pc0[0], pc0[1]) && BLI_rcti_isect_pt(rect, pc0[0], pc0[1])) || (!ELEM(V2D_IS_CLIPPED, pc1[0], pc1[1]) && BLI_rcti_isect_pt(rect, pc1[0], pc1[1])) || - (!ELEM(V2D_IS_CLIPPED, pc2[0], pc2[1]) && BLI_rcti_isect_pt(rect, pc2[0], pc2[1]))) { + (!ELEM(V2D_IS_CLIPPED, pc2[0], pc2[1]) && BLI_rcti_isect_pt(rect, pc2[0], pc2[1]))) + { /* Check if point segment of stroke had anything to do with * eraser region (either within stroke painted, or on its lines) * - this assumes that line-width is irrelevant. @@ -1713,13 +1721,13 @@ static void gpencil_stroke_eraser_dostroke(tGPsdata *p, pt0->flag |= GP_SPOINT_TAG; do_cull = true; } - if ((pt1->strength <= GPENCIL_ALPHA_OPACITY_THRESH) || - (pt1->pressure < cull_thresh)) { + if ((pt1->strength <= GPENCIL_ALPHA_OPACITY_THRESH) || (pt1->pressure < cull_thresh)) + { pt1->flag |= GP_SPOINT_TAG; do_cull = true; } - if ((pt2->strength <= GPENCIL_ALPHA_OPACITY_THRESH) || - (pt2->pressure < cull_thresh)) { + if ((pt2->strength <= GPENCIL_ALPHA_OPACITY_THRESH) || (pt2->pressure < cull_thresh)) + { pt2->flag |= GP_SPOINT_TAG; do_cull = true; } @@ -1746,13 +1754,15 @@ static void gpencil_stroke_eraser_dostroke(tGPsdata *p, /* 2) Tag any point with overly low influence for removal in the next pass */ if ((inf1 > 0.0f) && ((pt1->pressure < cull_thresh) || (p->flags & GP_PAINTFLAG_HARD_ERASER) || - (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_HARD))) { + (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_HARD))) + { pt1->flag |= GP_SPOINT_TAG; do_cull = true; } if ((inf1 > 2.0f) && ((pt2->pressure < cull_thresh) || (p->flags & GP_PAINTFLAG_HARD_ERASER) || - (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_HARD))) { + (eraser->gpencil_settings->eraser_mode == GP_BRUSH_ERASER_HARD))) + { pt2->flag |= GP_SPOINT_TAG; do_cull = true; } @@ -1845,8 +1855,8 @@ static void gpencil_stroke_doeraser(tGPsdata *p) } /* Check if the stroke collide with mouse. */ - if (!ED_gpencil_stroke_check_collision( - &p->gsc, gps, p->mval, calc_radius, p->diff_mat)) { + if (!ED_gpencil_stroke_check_collision(&p->gsc, gps, p->mval, calc_radius, p->diff_mat)) + { continue; } @@ -2098,7 +2108,8 @@ static bool gpencil_session_initdata(bContext *C, wmOperator *op, tGPsdata *p) /* lock axis (in some modes, disable) */ if (((*p->align_flag & GP_PROJECT_DEPTH_VIEW) == 0) && - ((*p->align_flag & GP_PROJECT_DEPTH_STROKE) == 0)) { + ((*p->align_flag & GP_PROJECT_DEPTH_STROKE) == 0)) + { p->lock_axis = ts->gp_sculpt.lock_axis; } else { @@ -2877,7 +2888,8 @@ static void gpencil_draw_apply(bContext *C, wmOperator *op, tGPsdata *p, Depsgra } } else if ((p->brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP) && - (gpd->runtime.sbuffer_used > 0)) { + (gpd->runtime.sbuffer_used > 0)) + { pt = (tGPspoint *)gpd->runtime.sbuffer + gpd->runtime.sbuffer_used - 1; if (p->paintmode != GP_PAINTMODE_ERASER) { ED_gpencil_toggle_brush_cursor(C, true, pt->m_xy); @@ -2906,7 +2918,8 @@ static void gpencil_draw_apply_event(bContext *C, /* verify direction for straight lines and guides */ if ((is_speed_guide) || - ((event->modifier & KM_ALT) && (RNA_boolean_get(op->ptr, "disable_straight") == false))) { + ((event->modifier & KM_ALT) && (RNA_boolean_get(op->ptr, "disable_straight") == false))) + { if (p->straight == 0) { int dx = (int)fabsf(p->mval[0] - p->mvali[0]); int dy = (int)fabsf(p->mval[1] - p->mvali[1]); @@ -2983,8 +2996,8 @@ static void gpencil_draw_apply_event(bContext *C, copy_v2_v2(p->mvali, p->mval); if (is_speed_guide && !ELEM(p->paintmode, GP_PAINTMODE_ERASER, GP_PAINTMODE_SET_CP) && - ((guide->use_snapping && (guide->type == GP_GUIDE_GRID)) || - (guide->type == GP_GUIDE_ISO))) { + ((guide->use_snapping && (guide->type == GP_GUIDE_GRID)) || (guide->type == GP_GUIDE_ISO))) + { p->flags |= GP_PAINTFLAG_REQ_VECTOR; } @@ -3011,11 +3024,13 @@ static void gpencil_draw_apply_event(bContext *C, p->guide.stroke_angle = atan2f(pt[1], pt[0]); /* determine iso angle, less weight is given for vertical strokes */ if (((p->guide.stroke_angle >= 0.0f) && (p->guide.stroke_angle < DEG2RAD(75))) || - (p->guide.stroke_angle < DEG2RAD(-105))) { + (p->guide.stroke_angle < DEG2RAD(-105))) + { p->guide.rot_angle = guide->angle; } else if (((p->guide.stroke_angle < 0.0f) && (p->guide.stroke_angle > DEG2RAD(-75))) || - (p->guide.stroke_angle > DEG2RAD(105))) { + (p->guide.stroke_angle > DEG2RAD(105))) + { p->guide.rot_angle = -guide->angle; } else { @@ -3143,7 +3158,8 @@ static void gpencil_guide_event_handling(bContext *C, /* Enter or exit set center point mode */ if ((event->type == EVT_OKEY) && (event->val == KM_RELEASE)) { if ((p->paintmode == GP_PAINTMODE_DRAW) && guide->use_guide && - (guide->reference_point != GP_GUIDE_REF_OBJECT)) { + (guide->reference_point != GP_GUIDE_REF_OBJECT)) + { add_notifier = true; p->paintmode = GP_PAINTMODE_SET_CP; ED_gpencil_toggle_brush_cursor(C, false, NULL); @@ -3709,7 +3725,8 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) EVT_PAD6, EVT_PAD7, EVT_PAD8, - EVT_PAD9)) { + EVT_PAD9)) + { /* Allow numpad keys so that camera/view manipulations can still take place * - #EVT_PAD0 in particular is really important for Grease Pencil drawing, * as animators may be working "to camera", so having this working @@ -3827,7 +3844,8 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) int size_before = p->gpd->runtime.sbuffer_used; if (((p->flags & GP_PAINTFLAG_FIRSTRUN) == 0) && (p->paintmode != GP_PAINTMODE_ERASER) && - !(is_speed_guide && (p->flags & GP_PAINTFLAG_REQ_VECTOR))) { + !(is_speed_guide && (p->flags & GP_PAINTFLAG_REQ_VECTOR))) + { gpencil_add_fake_points(event, p); } @@ -3854,7 +3872,8 @@ static int gpencil_draw_modal(bContext *C, wmOperator *op, const wmEvent *event) } /* eraser size */ else if ((p->paintmode == GP_PAINTMODE_ERASER) && - ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, EVT_PADPLUSKEY, EVT_PADMINUS)) { + ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE, EVT_PADPLUSKEY, EVT_PADMINUS)) + { /* Just resize the brush (local version). */ switch (event->type) { case WHEELDOWNMOUSE: /* larger */ diff --git a/source/blender/editors/gpencil_legacy/gpencil_primitive.c b/source/blender/editors/gpencil_legacy/gpencil_primitive.c index c46a1311dc6..cce222cfad9 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_primitive.c +++ b/source/blender/editors/gpencil_legacy/gpencil_primitive.c @@ -452,7 +452,8 @@ static void gpencil_primitive_status_indicators(bContext *C, tGPDprimitive *tgpi GP_STROKE_ARC, GP_STROKE_LINE, GP_STROKE_BOX, - GP_STROKE_POLYLINE)) { + GP_STROKE_POLYLINE)) + { if (hasNumInput(&tgpi->num)) { char str_ofs[NUM_STR_REP_LEN]; @@ -788,7 +789,8 @@ static void gpencil_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi) round_v2i_v2fl(mval_i, ptc->m_xy); if ((ED_view3d_depth_read_cached(depths, mval_i, depth_margin, depth_arr + i) == 0) && (i && (ED_view3d_depth_read_cached_seg( - depths, mval_i, mval_prev, depth_margin + 1, depth_arr + i) == 0))) { + depths, mval_i, mval_prev, depth_margin + 1, depth_arr + i) == 0))) + { interp_depth = true; } else { @@ -818,7 +820,8 @@ static void gpencil_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi) else { if ((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE) && ((ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE_ENDPOINTS) || - (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE_FIRST))) { + (ts->gpencil_v3d_align & GP_PROJECT_DEPTH_STROKE_FIRST))) + { int first_valid = 0; int last_valid = 0; @@ -1491,7 +1494,8 @@ static void gpencil_primitive_edit_event_handling( copy_v2_v2(tgpi->end, tgpi->mval); } else if (tgpi->sel_cp == SELECT_CP1 || - (tgpi->sel_cp == SELECT_CP2 && tgpi->type != GP_STROKE_CURVE)) { + (tgpi->sel_cp == SELECT_CP2 && tgpi->type != GP_STROKE_CURVE)) + { float dx = (tgpi->mval[0] - tgpi->mvalo[0]); float dy = (tgpi->mval[1] - tgpi->mvalo[1]); tgpi->cp1[0] += dx; @@ -1808,14 +1812,16 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e } } else if ((event->val == KM_RELEASE) && (tgpi->flag == IN_PROGRESS) && - !ELEM(tgpi->type, GP_STROKE_POLYLINE)) { + !ELEM(tgpi->type, GP_STROKE_POLYLINE)) + { /* set control points and enter edit mode */ tgpi->flag = IN_CURVE_EDIT; gpencil_primitive_update_cps(tgpi); gpencil_primitive_update(C, op, tgpi); } else if ((event->val == KM_RELEASE) && (tgpi->flag == IN_PROGRESS) && - !ELEM(tgpi->type, GP_STROKE_CURVE, GP_STROKE_POLYLINE)) { + !ELEM(tgpi->type, GP_STROKE_CURVE, GP_STROKE_POLYLINE)) + { /* stop drawing primitive */ tgpi->flag = IDLE; gpencil_primitive_interaction_end(C, op, win, tgpi); @@ -1823,7 +1829,8 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e return OPERATOR_FINISHED; } else if ((event->val == KM_RELEASE) && (tgpi->flag == IN_PROGRESS) && - ELEM(tgpi->type, GP_STROKE_POLYLINE)) { + ELEM(tgpi->type, GP_STROKE_POLYLINE)) + { /* set control points and enter edit mode */ tgpi->flag = IN_POLYLINE; gpencil_primitive_update(C, op, tgpi); @@ -1973,7 +1980,8 @@ static int gpencil_primitive_modal(bContext *C, wmOperator *op, const wmEvent *e } default: { if (tgpi->flag != IN_CURVE_EDIT && (event->val == KM_PRESS) && - handleNumInput(C, &tgpi->num, event)) { + handleNumInput(C, &tgpi->num, event)) + { float value; /* Grab data from numeric input, and store this new value (the user see an int) */ diff --git a/source/blender/editors/gpencil_legacy/gpencil_sculpt_paint.c b/source/blender/editors/gpencil_legacy/gpencil_sculpt_paint.c index 899e401d1ff..fa21fdd9c1c 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_sculpt_paint.c +++ b/source/blender/editors/gpencil_legacy/gpencil_sculpt_paint.c @@ -639,7 +639,8 @@ static void gpencil_brush_calc_midpoint(tGP_BrushEditData *gso) float mval_prj[2]; if (ED_view3d_project_float_global(gso->region, rvec, mval_prj, V3D_PROJ_TEST_NOP) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { float dvec[3]; float xy_delta[2]; sub_v2_v2v2(xy_delta, mval_prj, gso->mval); @@ -1529,7 +1530,8 @@ static bool gpencil_sculpt_brush_do_stroke(tGP_BrushEditData *gso, /* Check that point segment of the bound-box of the selection stroke. */ if ((!ELEM(V2D_IS_CLIPPED, pc1[0], pc1[1]) && BLI_rcti_isect_pt(rect, pc1[0], pc1[1])) || - (!ELEM(V2D_IS_CLIPPED, pc2[0], pc2[1]) && BLI_rcti_isect_pt(rect, pc2[0], pc2[1]))) { + (!ELEM(V2D_IS_CLIPPED, pc2[0], pc2[1]) && BLI_rcti_isect_pt(rect, pc2[0], pc2[1]))) + { /* Check if point segment of stroke had anything to do with * brush region (either within stroke painted, or on its lines) * - this assumes that line-width is irrelevant. @@ -1647,7 +1649,8 @@ static bool gpencil_sculpt_brush_do_frame(bContext *C, /* Check if the stroke collide with brush. */ if ((gps->totpoints > 1) && - !ED_gpencil_stroke_check_collision(gsc, gps, gso->mval, radius, bound_mat)) { + !ED_gpencil_stroke_check_collision(gsc, gps, gso->mval, radius, bound_mat)) + { continue; } @@ -1914,7 +1917,8 @@ static bool get_automasking_strokes_list(tGP_BrushEditData *gso) /* Check if the stroke collide with brush. */ if ((is_masking_stroke) && - ED_gpencil_stroke_check_collision(gsc, gps, gso->mval, radius, bound_mat)) { + ED_gpencil_stroke_check_collision(gsc, gps, gso->mval, radius, bound_mat)) + { bGPDspoint *pt1, *pt2; int pc1[2] = {0}; @@ -1956,8 +1960,9 @@ static bool get_automasking_strokes_list(tGP_BrushEditData *gso) } /* Check segment. */ - if (!pick_stroke && gpencil_stroke_inside_circle( - gso->mval, radius, pc1[0], pc1[1], pc2[0], pc2[1])) { + if (!pick_stroke && + gpencil_stroke_inside_circle(gso->mval, radius, pc1[0], pc1[1], pc2[0], pc2[1])) + { pick_stroke = true; i = gps->totpoints; } @@ -2139,7 +2144,8 @@ static void gpencil_sculpt_brush_apply(bContext *C, wmOperator *op, PointerRNA * (ts->gp_sculpt.flag & (GP_SCULPT_SETT_FLAG_AUTOMASK_STROKE | GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_STROKE | GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_STROKE | GP_SCULPT_SETT_FLAG_AUTOMASK_LAYER_ACTIVE | - GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE))) { + GP_SCULPT_SETT_FLAG_AUTOMASK_MATERIAL_ACTIVE))) + { gso->automasking_ready = get_automasking_strokes_list(gso); } diff --git a/source/blender/editors/gpencil_legacy/gpencil_select.c b/source/blender/editors/gpencil_legacy/gpencil_select.c index ed7093a8f35..58b8c1bb0bb 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_select.c +++ b/source/blender/editors/gpencil_legacy/gpencil_select.c @@ -127,7 +127,8 @@ static bool gpencil_3d_point_to_screen_space(ARegion *region, int screen_co[2]; if (ED_view3d_project_int_global( region, parent_co, screen_co, V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { if (!ELEM(V2D_IS_CLIPPED, screen_co[0], screen_co[1])) { copy_v2_v2_int(r_co, screen_co); return true; @@ -1606,13 +1607,15 @@ static bool gpencil_do_curve_circle_sel(bContext *C, /* do 2d projection */ if (ED_view3d_project_int_global( region, parent_co, screen_co, V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN) != - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { continue; } /* view and bounding box test */ if (ELEM(V2D_IS_CLIPPED, screen_co[0], screen_co[1]) && - !BLI_rcti_isect_pt(rect, screen_co[0], screen_co[1])) { + !BLI_rcti_isect_pt(rect, screen_co[0], screen_co[1])) + { continue; } diff --git a/source/blender/editors/gpencil_legacy/gpencil_trace_ops.c b/source/blender/editors/gpencil_legacy/gpencil_trace_ops.c index fd7e13f70a8..992684d6338 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_trace_ops.c +++ b/source/blender/editors/gpencil_legacy/gpencil_trace_ops.c @@ -211,8 +211,8 @@ static void trace_start_job(void *customdata, bool *stop, bool *do_update, float G.is_break = false; /* Single Image. */ - if ((trace_job->image->source == IMA_SRC_FILE) || - (trace_job->mode == GPENCIL_TRACE_MODE_SINGLE)) { + if ((trace_job->image->source == IMA_SRC_FILE) || (trace_job->mode == GPENCIL_TRACE_MODE_SINGLE)) + { void *lock; ImageUser *iuser = trace_job->ob_active->iuser; diff --git a/source/blender/editors/gpencil_legacy/gpencil_utils.c b/source/blender/editors/gpencil_legacy/gpencil_utils.c index 34da7c160c4..c1f95104c6f 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_utils.c +++ b/source/blender/editors/gpencil_legacy/gpencil_utils.c @@ -672,8 +672,8 @@ void gpencil_point_to_xy( BLI_assert(!(gps->flag & GP_STROKE_2DSPACE) || (gsc->area->spacetype != SPACE_VIEW3D)); if (gps->flag & GP_STROKE_3DSPACE) { - if (ED_view3d_project_int_global(region, &pt->x, xyval, V3D_PROJ_TEST_NOP) == - V3D_PROJ_RET_OK) { + if (ED_view3d_project_int_global(region, &pt->x, xyval, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) + { *r_x = xyval[0]; *r_y = xyval[1]; } @@ -827,7 +827,8 @@ bool gpencil_point_xy_to_3d(const GP_SpaceConversion *gsc, float mval_prj[2]; if (ED_view3d_project_float_global(gsc->region, rvec, mval_prj, V3D_PROJ_TEST_NOP) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { float dvec[3]; float xy_delta[2]; sub_v2_v2v2(xy_delta, mval_prj, screen_co); @@ -1157,7 +1158,8 @@ void ED_gpencil_stroke_reproject(Depsgraph *depsgraph, &ray_normal[0], &depth, &location[0], - &normal[0])) { + &normal[0])) + { /* Apply offset over surface. */ float normal_vector[3]; sub_v3_v3v3(normal_vector, ray_start, location); @@ -1787,7 +1789,8 @@ float ED_gpencil_radial_control_scale(struct bContext *C, { float scale_fac = 1.0f; if ((brush && brush->gpencil_settings) && (brush->ob_mode == OB_MODE_PAINT_GPENCIL) && - (brush->gpencil_tool == GPAINT_TOOL_DRAW)) { + (brush->gpencil_tool == GPAINT_TOOL_DRAW)) + { float cursor_radius = ED_gpencil_cursor_radius(C, mval[0], mval[1]); scale_fac = max_ff(cursor_radius, 1.0f) / max_ff(initial_value, 1.0f); } @@ -1833,7 +1836,8 @@ static void gpencil_brush_cursor_draw(bContext *C, int x, int y, void *customdat /* while drawing hide */ if ((gpd->runtime.sbuffer_used > 0) && ((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) && - ((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP) == 0)) { + ((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP) == 0)) + { return; } @@ -1860,7 +1864,8 @@ static void gpencil_brush_cursor_draw(bContext *C, int x, int y, void *customdat if ((gp_style) && GPENCIL_PAINT_MODE(gpd) && ((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE) == 0) && ((brush->gpencil_settings->flag & GP_BRUSH_STABILIZE_MOUSE_TEMP) == 0) && - (brush->gpencil_tool == GPAINT_TOOL_DRAW)) { + (brush->gpencil_tool == GPAINT_TOOL_DRAW)) + { const bool is_vertex_stroke = (GPENCIL_USE_VERTEX_COLOR_STROKE(ts, brush) && @@ -1904,8 +1909,8 @@ static void gpencil_brush_cursor_draw(bContext *C, int x, int y, void *customdat } radius = brush->size; - if (brush->gpencil_settings->sculpt_flag & - (GP_SCULPT_FLAG_INVERT | GP_SCULPT_FLAG_TMP_INVERT)) { + if (brush->gpencil_settings->sculpt_flag & (GP_SCULPT_FLAG_INVERT | GP_SCULPT_FLAG_TMP_INVERT)) + { copy_v3_v3(color, brush->sub_col); } else { @@ -1924,8 +1929,8 @@ static void gpencil_brush_cursor_draw(bContext *C, int x, int y, void *customdat } radius = brush->size; - if (brush->gpencil_settings->sculpt_flag & - (GP_SCULPT_FLAG_INVERT | GP_SCULPT_FLAG_TMP_INVERT)) { + if (brush->gpencil_settings->sculpt_flag & (GP_SCULPT_FLAG_INVERT | GP_SCULPT_FLAG_TMP_INVERT)) + { copy_v3_v3(color, brush->sub_col); } else { @@ -2089,8 +2094,8 @@ static void gpencil_stroke_convertcoords(ARegion *region, const float zfac = ED_view3d_calc_zfac(region->regiondata, rvec); - if (ED_view3d_project_float_global(region, rvec, mval_prj, V3D_PROJ_TEST_NOP) == - V3D_PROJ_RET_OK) { + if (ED_view3d_project_float_global(region, rvec, mval_prj, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) + { float dvec[3]; float xy_delta[2]; sub_v2_v2v2(xy_delta, mval_prj, point2D->m_xy); @@ -3160,7 +3165,8 @@ bGPDstroke *ED_gpencil_stroke_nearest_to_ends(bContext *C, /* Check if one of the ends is inside target stroke bounding box. */ if (!ED_gpencil_stroke_check_collision(gsc, gps_target, pt2d_start, radius, diff_mat) && - !ED_gpencil_stroke_check_collision(gsc, gps_target, pt2d_end, radius, diff_mat)) { + !ED_gpencil_stroke_check_collision(gsc, gps_target, pt2d_end, radius, diff_mat)) + { continue; } /* Check the distance of the ends with the ends of target stroke to avoid middle contact. @@ -3180,14 +3186,16 @@ bGPDstroke *ED_gpencil_stroke_nearest_to_ends(bContext *C, if ((len_squared_v2v2(ctrl1, pt2d_target_start) > radius_sqr) && (len_squared_v2v2(ctrl1, pt2d_target_end) > radius_sqr) && (len_squared_v2v2(ctrl2, pt2d_target_start) > radius_sqr) && - (len_squared_v2v2(ctrl2, pt2d_target_end) > radius_sqr)) { + (len_squared_v2v2(ctrl2, pt2d_target_end) > radius_sqr)) + { continue; } if ((len_squared_v2v2(pt2d_start, pt2d_target_start) > radius_sqr) && (len_squared_v2v2(pt2d_start, pt2d_target_end) > radius_sqr) && (len_squared_v2v2(pt2d_end, pt2d_target_start) > radius_sqr) && - (len_squared_v2v2(pt2d_end, pt2d_target_end) > radius_sqr)) { + (len_squared_v2v2(pt2d_end, pt2d_target_end) > radius_sqr)) + { continue; } @@ -3356,7 +3364,8 @@ void ED_gpencil_layer_merge(bGPdata *gpd, LISTBASE_FOREACH (bGPDlayer_Mask *, mask, &gpl_src->mask_layers) { /* Don't add merged layers or missing layer names. */ if (!BKE_gpencil_layer_named_get(gpd, mask->name) || STREQ(mask->name, gpl_src->info) || - STREQ(mask->name, gpl_dst->info)) { + STREQ(mask->name, gpl_dst->info)) + { continue; } if (!BKE_gpencil_layer_mask_named_get(gpl_dst, mask->name)) { diff --git a/source/blender/editors/gpencil_legacy/gpencil_uv.c b/source/blender/editors/gpencil_legacy/gpencil_uv.c index bed0b5ba295..c1e4afa295a 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_uv.c +++ b/source/blender/editors/gpencil_legacy/gpencil_uv.c @@ -412,7 +412,8 @@ static int gpencil_transform_fill_modal(bContext *C, wmOperator *op, const wmEve case EVT_PADENTER: case EVT_RETKEY: { if ((event->val == KM_PRESS) || - ((event->val == KM_RELEASE) && RNA_boolean_get(op->ptr, "release_confirm"))) { + ((event->val == KM_RELEASE) && RNA_boolean_get(op->ptr, "release_confirm"))) + { gpencil_uv_transform_calc(C, op); gpencil_uv_transform_exit(C, op); return OPERATOR_FINISHED; diff --git a/source/blender/editors/gpencil_legacy/gpencil_vertex_ops.c b/source/blender/editors/gpencil_legacy/gpencil_vertex_ops.c index d040d4fa8b9..b55db6417e6 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_vertex_ops.c +++ b/source/blender/editors/gpencil_legacy/gpencil_vertex_ops.c @@ -674,7 +674,8 @@ static bool gpencil_extract_palette_from_vertex(bContext *C, /* Only solid strokes or stencil. */ if ((use_stroke) && ((gp_style->stroke_style == GP_MATERIAL_STROKE_STYLE_TEXTURE) && - ((gp_style->flag & GP_MATERIAL_STROKE_PATTERN) == 0))) { + ((gp_style->flag & GP_MATERIAL_STROKE_PATTERN) == 0))) + { continue; } @@ -863,7 +864,8 @@ static int gpencil_material_to_vertex_exec(bContext *C, wmOperator *op) /* Only solid strokes or stencil. */ if ((use_stroke) && ((gp_style->stroke_style == GP_MATERIAL_STROKE_STYLE_TEXTURE) && - ((gp_style->flag & GP_MATERIAL_STROKE_PATTERN) == 0))) { + ((gp_style->flag & GP_MATERIAL_STROKE_PATTERN) == 0))) + { continue; } diff --git a/source/blender/editors/gpencil_legacy/gpencil_vertex_paint.c b/source/blender/editors/gpencil_legacy/gpencil_vertex_paint.c index a68b5fc2e88..44bca62af43 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_vertex_paint.c +++ b/source/blender/editors/gpencil_legacy/gpencil_vertex_paint.c @@ -892,7 +892,8 @@ static bool gpencil_vertexpaint_select_stroke(tGP_BrushVertexpaintData *gso, /* Check that point segment of the bound-box of the selection stroke. */ if ((!ELEM(V2D_IS_CLIPPED, pc1[0], pc1[1]) && BLI_rcti_isect_pt(rect, pc1[0], pc1[1])) || - (!ELEM(V2D_IS_CLIPPED, pc2[0], pc2[1]) && BLI_rcti_isect_pt(rect, pc2[0], pc2[1]))) { + (!ELEM(V2D_IS_CLIPPED, pc2[0], pc2[1]) && BLI_rcti_isect_pt(rect, pc2[0], pc2[1]))) + { /* Check if point segment of stroke had anything to do with * brush region (either within stroke painted, or on its lines) * - this assumes that line-width is irrelevant. @@ -904,8 +905,8 @@ static bool gpencil_vertexpaint_select_stroke(tGP_BrushVertexpaintData *gso, pt_active = pt->runtime.pt_orig; if (pt_active != NULL) { /* If masked and the point is not selected, skip it. */ - if (GPENCIL_ANY_VERTEX_MASK(gso->mask) && - ((pt_active->flag & GP_SPOINT_SELECT) == 0)) { + if (GPENCIL_ANY_VERTEX_MASK(gso->mask) && ((pt_active->flag & GP_SPOINT_SELECT) == 0)) + { continue; } index = (pt->runtime.pt_orig) ? pt->runtime.idx_orig : i; diff --git a/source/blender/editors/gpencil_legacy/gpencil_weight_paint.c b/source/blender/editors/gpencil_legacy/gpencil_weight_paint.c index c27a6073b35..fb800c33581 100644 --- a/source/blender/editors/gpencil_legacy/gpencil_weight_paint.c +++ b/source/blender/editors/gpencil_legacy/gpencil_weight_paint.c @@ -1059,13 +1059,14 @@ static void gpencil_weightpaint_select_stroke(tGP_BrushWeightpaintData *gso, /* Check that point segment of the bound-box of the selection stroke */ if ((!ELEM(V2D_IS_CLIPPED, pc1[0], pc1[1]) && BLI_rcti_isect_pt(rect, pc1[0], pc1[1])) || - (!ELEM(V2D_IS_CLIPPED, pc2[0], pc2[1]) && BLI_rcti_isect_pt(rect, pc2[0], pc2[1]))) { + (!ELEM(V2D_IS_CLIPPED, pc2[0], pc2[1]) && BLI_rcti_isect_pt(rect, pc2[0], pc2[1]))) + { /* Check if point segment of stroke had anything to do with * brush region (either within stroke painted, or on its lines) * - this assumes that line-width is irrelevant. */ - if (gpencil_stroke_inside_circle( - gso->mouse, radius_wide, pc1[0], pc1[1], pc2[0], pc2[1])) { + if (gpencil_stroke_inside_circle(gso->mouse, radius_wide, pc1[0], pc1[1], pc2[0], pc2[1])) + { if (widen_brush) { within_brush = (gpencil_stroke_inside_circle( gso->mouse, radius_brush, pc1[0], pc1[1], pc2[0], pc2[1])); diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_color.cc b/source/blender/editors/interface/eyedroppers/eyedropper_color.cc index 37ba23a0ed3..726cac2c3a0 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_color.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_color.cc @@ -92,7 +92,8 @@ static bool eyedropper_init(bContext *C, wmOperator *op) (RNA_property_editable(&eye->ptr, eye->prop) == false) || (RNA_property_array_length(&eye->ptr, eye->prop) < 3) || (RNA_property_type(eye->prop) != PROP_FLOAT) || - (ELEM(prop_subtype, PROP_COLOR, PROP_COLOR_GAMMA) == 0)) { + (ELEM(prop_subtype, PROP_COLOR, PROP_COLOR_GAMMA) == 0)) + { MEM_freeN(eye); return false; } @@ -173,7 +174,8 @@ static bool eyedropper_cryptomatte_sample_renderlayer_fl(RenderLayer *render_lay LISTBASE_FOREACH (RenderPass *, render_pass, &render_layer->passes) { if (STRPREFIX(render_pass->name, render_pass_name_prefix) && - !STREQLEN(render_pass->name, render_pass_name_prefix, sizeof(render_pass->name))) { + !STREQLEN(render_pass->name, render_pass_name_prefix, sizeof(render_pass->name))) + { BLI_assert(render_pass->channels == 4); const int x = int(fpos[0] * render_pass->rectx); const int y = int(fpos[1] * render_pass->recty); diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc b/source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc index 1791b3fd6e6..714538f912b 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_datablock.cc @@ -83,7 +83,8 @@ static int datadropper_init(bContext *C, wmOperator *op) if ((ddr->ptr.data == nullptr) || (ddr->prop == nullptr) || (RNA_property_editable(&ddr->ptr, ddr->prop) == false) || - (RNA_property_type(ddr->prop) != PROP_POINTER)) { + (RNA_property_type(ddr->prop) != PROP_POINTER)) + { MEM_freeN(ddr); return false; } @@ -342,7 +343,8 @@ static bool datadropper_poll(bContext *C) /* data dropper only supports object data */ if ((CTX_wm_window(C) != nullptr) && (but = UI_context_active_but_prop_get(C, &ptr, &prop, &index_dummy)) && - (but->type == UI_BTYPE_SEARCH_MENU) && (but->flag & UI_BUT_VALUE_CLEAR)) { + (but->type == UI_BTYPE_SEARCH_MENU) && (but->flag & UI_BUT_VALUE_CLEAR)) + { if (prop && RNA_property_type(prop) == PROP_POINTER) { StructRNA *type = RNA_property_pointer_type(&ptr, prop); const short idcode = RNA_type_to_ID_code(type); diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_depth.cc b/source/blender/editors/interface/eyedroppers/eyedropper_depth.cc index 8dd6c9c1239..8c52926b27b 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_depth.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_depth.cc @@ -88,7 +88,8 @@ static int depthdropper_init(bContext *C, wmOperator *op) if (rv3d && rv3d->persp == RV3D_CAMOB) { View3D *v3d = CTX_wm_view3d(C); if (v3d->camera && v3d->camera->data && - BKE_id_is_editable(CTX_data_main(C), static_cast(v3d->camera->data))) { + BKE_id_is_editable(CTX_data_main(C), static_cast(v3d->camera->data))) + { Camera *camera = (Camera *)v3d->camera->data; RNA_pointer_create(&camera->id, &RNA_CameraDOFSettings, &camera->dof, &ddr->ptr); ddr->prop = RNA_struct_find_property(&ddr->ptr, "focus_distance"); @@ -102,7 +103,8 @@ static int depthdropper_init(bContext *C, wmOperator *op) if ((ddr->ptr.data == nullptr) || (ddr->prop == nullptr) || (RNA_property_editable(&ddr->ptr, ddr->prop) == false) || - (RNA_property_type(ddr->prop) != PROP_FLOAT)) { + (RNA_property_type(ddr->prop) != PROP_FLOAT)) + { MEM_freeN(ddr); return false; } @@ -337,10 +339,12 @@ static bool depthdropper_poll(bContext *C) /* check if there's an active button taking depth value */ if ((CTX_wm_window(C) != nullptr) && (but = UI_context_active_but_prop_get(C, &ptr, &prop, &index_dummy)) && - (but->type == UI_BTYPE_NUM) && (prop != nullptr)) { + (but->type == UI_BTYPE_NUM) && (prop != nullptr)) + { if ((RNA_property_type(prop) == PROP_FLOAT) && (RNA_property_subtype(prop) & PROP_UNIT_LENGTH) && - (RNA_property_array_check(prop) == false)) { + (RNA_property_array_check(prop) == false)) + { return true; } } @@ -349,7 +353,8 @@ static bool depthdropper_poll(bContext *C) if (rv3d && rv3d->persp == RV3D_CAMOB) { View3D *v3d = CTX_wm_view3d(C); if (v3d->camera && v3d->camera->data && - BKE_id_is_editable(CTX_data_main(C), static_cast(v3d->camera->data))) { + BKE_id_is_editable(CTX_data_main(C), static_cast(v3d->camera->data))) + { return true; } } diff --git a/source/blender/editors/interface/eyedroppers/eyedropper_driver.cc b/source/blender/editors/interface/eyedroppers/eyedropper_driver.cc index 034cc5365b3..382845d1459 100644 --- a/source/blender/editors/interface/eyedroppers/eyedropper_driver.cc +++ b/source/blender/editors/interface/eyedroppers/eyedropper_driver.cc @@ -54,7 +54,8 @@ static bool driverdropper_init(bContext *C, wmOperator *op) if ((ddr->ptr.data == nullptr) || (ddr->prop == nullptr) || (RNA_property_editable(&ddr->ptr, ddr->prop) == false) || - (RNA_property_animateable(&ddr->ptr, ddr->prop) == false) || (but->flag & UI_BUT_DRIVEN)) { + (RNA_property_animateable(&ddr->ptr, ddr->prop) == false) || (but->flag & UI_BUT_DRIVEN)) + { MEM_freeN(ddr); return false; } diff --git a/source/blender/editors/interface/interface.cc b/source/blender/editors/interface/interface.cc index 4061de0f9c0..ab3ecb877dd 100644 --- a/source/blender/editors/interface/interface.cc +++ b/source/blender/editors/interface/interface.cc @@ -729,7 +729,8 @@ static bool ui_but_equals_old(const uiBut *but, const uiBut *oldbut) /* If the buttons have own identity comparator callbacks (and they match), use this to * determine equality. */ if (but->identity_cmp_func && (but->type == oldbut->type) && - (but->identity_cmp_func == oldbut->identity_cmp_func)) { + (but->identity_cmp_func == oldbut->identity_cmp_func)) + { /* Test if the comparison is symmetrical (if a == b then b == a), may help catch some issues. */ BLI_assert(but->identity_cmp_func(but, oldbut) == but->identity_cmp_func(oldbut, but)); @@ -759,7 +760,8 @@ static bool ui_but_equals_old(const uiBut *but, const uiBut *oldbut) return false; } if (!but->funcN && ((but->poin != oldbut->poin && (uiBut *)oldbut->poin != oldbut) || - (but->pointype != oldbut->pointype))) { + (but->pointype != oldbut->pointype))) + { return false; } if (but->optype != oldbut->optype) { @@ -773,7 +775,8 @@ static bool ui_but_equals_old(const uiBut *but, const uiBut *oldbut) uiButViewItem *but_item = (uiButViewItem *)but; uiButViewItem *oldbut_item = (uiButViewItem *)oldbut; if (!but_item->view_item || !oldbut_item->view_item || - !UI_view_item_matches(but_item->view_item, oldbut_item->view_item)) { + !UI_view_item_matches(but_item->view_item, oldbut_item->view_item)) + { return false; } } @@ -1144,7 +1147,8 @@ static void ui_menu_block_set_keyaccels(uiBlock *block) UI_BTYPE_PULLDOWN, /* For PIE-menus. */ UI_BTYPE_ROW) || - (but->flag & UI_HIDDEN)) { + (but->flag & UI_HIDDEN)) + { continue; } @@ -1250,13 +1254,9 @@ static bool ui_but_event_operator_string_from_operator(const bContext *C, static_cast(op_call_params->opptr->data) : nullptr; - if (WM_key_event_operator_string(C, - op_call_params->optype->idname, - op_call_params->opcontext, - prop, - true, - buf, - buf_len)) { + if (WM_key_event_operator_string( + C, op_call_params->optype->idname, op_call_params->opcontext, prop, true, buf, buf_len)) + { found = true; } return found; @@ -1278,7 +1278,8 @@ static bool ui_but_event_operator_string_from_menu(const bContext *C, IDP_AddToGroup(prop_menu, IDP_NewString(mt->idname, "name", sizeof(mt->idname))); if (WM_key_event_operator_string( - C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, true, buf, buf_len)) { + C, "WM_OT_call_menu", WM_OP_INVOKE_REGION_WIN, prop_menu, true, buf, buf_len)) + { found = true; } @@ -1316,7 +1317,8 @@ static bool ui_but_event_operator_string_from_panel(const bContext *C, IDP_ReplaceInGroup(prop_panel, IDP_New(IDP_INT, &val, "keep_open")); if (WM_key_event_operator_string( - C, "WM_OT_call_panel", WM_OP_INVOKE_REGION_WIN, prop_panel, true, buf, buf_len)) { + C, "WM_OT_call_panel", WM_OP_INVOKE_REGION_WIN, prop_panel, true, buf, buf_len)) + { found = true; break; } @@ -1410,7 +1412,8 @@ static bool ui_but_event_property_operator_string(const bContext *C, ELEM(but_parent->menu_create_func, ui_def_but_rna__menu, ui_def_but_rna__panel_type, - ui_def_but_rna__menu_type)) { + ui_def_but_rna__menu_type)) + { prop_enum_value = int(but->hardmin); ptr = &but_parent->rnapoin; prop = but_parent->rnaprop; @@ -1477,7 +1480,8 @@ static bool ui_but_event_property_operator_string(const bContext *C, bool found = false; for (int data_path_index = 0; data_path_index < data_path_variations_num && (found == false); - data_path_index++) { + data_path_index++) + { const char *data_path = data_path_variations[data_path_index]; if (data_path || (prop_enum_value_ok && prop_enum_value_id)) { /* Create a property to host the "data_path" property we're sending to the operators. */ @@ -1519,7 +1523,8 @@ static bool ui_but_event_property_operator_string(const bContext *C, for (int i = 0; (i < opnames_len) && (opnames[i]); i++) { if (WM_key_event_operator_string( - C, opnames[i], WM_OP_INVOKE_REGION_WIN, prop_path, false, buf, buf_len)) { + C, opnames[i], WM_OP_INVOKE_REGION_WIN, prop_path, false, buf, buf_len)) + { found = true; break; } @@ -2166,7 +2171,8 @@ static void ui_block_message_subscribe(ARegion *region, struct wmMsgBus *mbus, u if ((but_prev && (but_prev->rnaprop == but->rnaprop) && (but_prev->rnapoin.type == but->rnapoin.type) && (but_prev->rnapoin.data == but->rnapoin.data) && - (but_prev->rnapoin.owner_id == but->rnapoin.owner_id)) == false) { + (but_prev->rnapoin.owner_id == but->rnapoin.owner_id)) == false) + { /* TODO: could make this into utility function. */ wmMsgSubscribeValue value = {}; value.owner = region; @@ -2436,7 +2442,8 @@ bool ui_but_is_bool(const uiBut *but) UI_BTYPE_TOGGLE_N, UI_BTYPE_ICON_TOGGLE, UI_BTYPE_ICON_TOGGLE_N, - UI_BTYPE_TAB)) { + UI_BTYPE_TAB)) + { return true; } @@ -2849,7 +2856,8 @@ void ui_but_string_get_ex(uiBut *but, &but->rnapoin, but->rnaprop, value, - &buf)) { + &buf)) + { BLI_strncpy(str, buf, maxlen); buf = str; } @@ -2969,7 +2977,8 @@ char *ui_but_string_get_dynamic(uiBut *but, int *r_str_size) &but->rnapoin, but->rnaprop, value, - &value_id)) { + &value_id)) + { value_id = ""; } @@ -3161,7 +3170,8 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str) * is utterly weak and should be redesigned IMHO, but that's not a simple task. */ if (search_but && search_but->rnasearchprop && RNA_property_collection_lookup_string( - &search_but->rnasearchpoin, search_but->rnasearchprop, str, &rptr)) { + &search_but->rnasearchpoin, search_but->rnasearchprop, str, &rptr)) + { RNA_property_pointer_set(&but->rnapoin, but->rnaprop, rptr, nullptr); } else if (search_but->item_active != nullptr) { @@ -3181,7 +3191,8 @@ bool ui_but_string_set(bContext *C, uiBut *but, const char *str) &but->rnapoin, but->rnaprop, str, - &value)) { + &value)) + { RNA_property_enum_set(&but->rnapoin, but->rnaprop, value); return true; } @@ -3803,8 +3814,8 @@ static void ui_but_update_ex(uiBut *but, const bool validate) case UI_BTYPE_ICON_TOGGLE: case UI_BTYPE_ICON_TOGGLE_N: - if ((but->rnaprop == nullptr) || - (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) { + if ((but->rnaprop == nullptr) || (RNA_property_flag(but->rnaprop) & PROP_ICONS_CONSECUTIVE)) + { if (but->rnaprop && RNA_property_flag(but->rnaprop) & PROP_ICONS_REVERSE) { but->drawflag |= UI_BUT_ICON_REVERSE; } @@ -3837,7 +3848,8 @@ static void ui_but_update_ex(uiBut *but, const bool validate) &but->rnapoin, but->rnaprop, value_enum, - &item)) { + &item)) + { const size_t slen = strlen(item.name); ui_but_string_free_internal(but); ui_but_string_set_internal(but, item.name, slen); @@ -4196,7 +4208,8 @@ static uiBut *ui_def_but(uiBlock *block, UI_BTYPE_BLOCK, UI_BTYPE_BUT_MENU, UI_BTYPE_SEARCH_MENU, - UI_BTYPE_POPOVER)) { + UI_BTYPE_POPOVER)) + { but->drawflag |= (UI_BUT_TEXT_LEFT | UI_BUT_ICON_LEFT); } #ifdef USE_NUMBUTS_LR_ALIGN @@ -4228,7 +4241,8 @@ static uiBut *ui_def_but(uiBlock *block, UI_BTYPE_SEPR, UI_BTYPE_SEPR_LINE, UI_BTYPE_SEPR_SPACER) || - (but->type >= UI_BTYPE_SEARCH_MENU)) { + (but->type >= UI_BTYPE_SEARCH_MENU)) + { /* pass */ } else { @@ -6410,8 +6424,8 @@ static void operator_enum_search_update_fn(const struct bContext *C, const EnumPropertyItem *item = filtered_items[i]; /* NOTE: need to give the index rather than the * identifier because the enum can be freed */ - if (!UI_search_item_add( - items, item->name, POINTER_FROM_INT(item->value), item->icon, 0, 0)) { + if (!UI_search_item_add(items, item->name, POINTER_FROM_INT(item->value), item->icon, 0, 0)) + { break; } } diff --git a/source/blender/editors/interface/interface_align.cc b/source/blender/editors/interface/interface_align.cc index 9deefb2d25d..0c902a8b52b 100644 --- a/source/blender/editors/interface/interface_align.cc +++ b/source/blender/editors/interface/interface_align.cc @@ -270,7 +270,8 @@ static void block_align_stitch_neighbors(ButAlign *butal, * it may have both of its stitching flags * set, but would not be the case of its immediate neighbor! */ while ((butal->flags[side] & stitch_s1) && (butal = butal->neighbors[side_s1]) && - (butal->flags[side] & stitch_s2)) { + (butal->flags[side] & stitch_s2)) + { butal_neighbor = butal->neighbors[side]; /* If we actually do have a neighbor, we directly set its values accordingly, diff --git a/source/blender/editors/interface/interface_anim.cc b/source/blender/editors/interface/interface_anim.cc index 3e78457f142..f8ab1f5ab7f 100644 --- a/source/blender/editors/interface/interface_anim.cc +++ b/source/blender/editors/interface/interface_anim.cc @@ -123,7 +123,8 @@ static uiBut *ui_but_anim_decorate_find_attached_button(uiButDecorator *but) LISTBASE_CIRCULAR_BACKWARD_BEGIN (uiBut *, &but->block->buttons, but_iter, but->prev) { if (but_iter != but && ui_but_rna_equals_ex( - but_iter, &but->decorated_rnapoin, but->decorated_rnaprop, but->decorated_rnaindex)) { + but_iter, &but->decorated_rnapoin, but->decorated_rnaprop, but->decorated_rnaindex)) + { return but_iter; } } diff --git a/source/blender/editors/interface/interface_context_menu.cc b/source/blender/editors/interface/interface_context_menu.cc index eb944b7f30e..81022076638 100644 --- a/source/blender/editors/interface/interface_context_menu.cc +++ b/source/blender/editors/interface/interface_context_menu.cc @@ -128,7 +128,8 @@ static void but_shortcut_name_func(bContext *C, void *arg1, int /*event*/) /* complex code to change name of button */ if (WM_key_event_operator_string( - C, idname, but->opcontext, prop, true, shortcut_str, sizeof(shortcut_str))) { + C, idname, but->opcontext, prop, true, shortcut_str, sizeof(shortcut_str))) + { ui_but_add_shortcut(but, shortcut_str, true); } else { @@ -969,7 +970,8 @@ bool ui_popup_context_menu_for_button(bContext *C, uiBut *but, const wmEvent *ev if (((prop_type == PROP_POINTER) || (prop_type == PROP_STRING && but->type == UI_BTYPE_SEARCH_MENU && ((uiButSearch *)but)->items_update_fn == ui_rna_collection_search_update_fn)) && - ui_jump_to_target_button_poll(C)) { + ui_jump_to_target_button_poll(C)) + { uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Jump to Target"), ICON_NONE, diff --git a/source/blender/editors/interface/interface_draw.cc b/source/blender/editors/interface/interface_draw.cc index 74761daa430..2c74b32e626 100644 --- a/source/blender/editors/interface/interface_draw.cc +++ b/source/blender/editors/interface/interface_draw.cc @@ -728,7 +728,8 @@ void ui_draw_but_WAVEFORM(ARegion * /*region*/, SCOPES_WAVEFRM_RGB_PARADE, SCOPES_WAVEFRM_YCC_601, SCOPES_WAVEFRM_YCC_709, - SCOPES_WAVEFRM_YCC_JPEG)) { + SCOPES_WAVEFRM_YCC_JPEG)) + { const int rgb = (scopes->wavefrm_mode == SCOPES_WAVEFRM_RGB_PARADE); GPU_matrix_push(); @@ -2035,7 +2036,8 @@ void ui_draw_but_TRACKPREVIEW(ARegion * /*region*/, } else if ((scopes->track_search) && ((!scopes->track_preview) || - (scopes->track_preview->x != width || scopes->track_preview->y != height))) { + (scopes->track_preview->x != width || scopes->track_preview->y != height))) + { if (scopes->track_preview) { IMB_freeImBuf(scopes->track_preview); } diff --git a/source/blender/editors/interface/interface_handlers.cc b/source/blender/editors/interface/interface_handlers.cc index fb4468a4f0f..23190e3e3a9 100644 --- a/source/blender/editors/interface/interface_handlers.cc +++ b/source/blender/editors/interface/interface_handlers.cc @@ -876,8 +876,8 @@ static void ui_apply_but_func(bContext *C, uiBut *but) /* Ensure this callback runs once and last. */ uiAfterFunc *after_prev = after->prev; - if (after_prev && - (after_prev->custom_interaction_handle == data->custom_interaction_handle)) { + if (after_prev && (after_prev->custom_interaction_handle == data->custom_interaction_handle)) + { after_prev->custom_interaction_handle = nullptr; memset(&after_prev->custom_interaction_callbacks, 0x0, @@ -953,7 +953,8 @@ static void ui_apply_but_undo(uiBut *but) /* XXX: disable all undo pushes from UI changes from sculpt mode as they cause memfile undo * steps to be written which cause lag: #71434. */ if (BKE_paintmode_get_active_from_context(static_cast(but->block->evil_C)) == - PAINT_MODE_SCULPT) { + PAINT_MODE_SCULPT) + { skip_undo = true; } } @@ -1491,7 +1492,8 @@ static void ui_multibut_states_create(uiBut *but_active, uiHandleButtonData *dat * NOTE: if we mix buttons which are proportional and others which are not, * this may work a bit strangely. */ if ((but_active->rnaprop && (RNA_property_flag(but_active->rnaprop) & PROP_PROPORTIONAL)) || - ELEM(but_active->unit_type, RNA_SUBTYPE_UNIT_VALUE(PROP_UNIT_LENGTH))) { + ELEM(but_active->unit_type, RNA_SUBTYPE_UNIT_VALUE(PROP_UNIT_LENGTH))) + { if (data->origvalue != 0.0) { data->multi_data.is_proportional = true; } @@ -1704,7 +1706,8 @@ static void ui_drag_toggle_set(bContext *C, uiDragToggleHandle *drag_info, const * chances are high the button won't move about :) */ if (len_manhattan_v2v2(drag_info->but_cent_start, but_cent_new) > 1.0f) { if (fabsf(drag_info->but_cent_start[0] - but_cent_new[0]) < - fabsf(drag_info->but_cent_start[1] - but_cent_new[1])) { + fabsf(drag_info->but_cent_start[1] - but_cent_new[1])) + { drag_info->xy_lock[0] = true; } else { @@ -1819,7 +1822,8 @@ static bool ui_selectcontext_begin(bContext *C, uiBut *but, uiSelectContextStore const int rna_type = RNA_property_type(prop); if (UI_context_copy_to_selected_list(C, &ptr, prop, &lb, &use_path_from_id, &path) && - !BLI_listbase_is_empty(&lb)) { + !BLI_listbase_is_empty(&lb)) + { selctx_data->elems_len = BLI_listbase_count(&lb); selctx_data->elems = static_cast( MEM_mallocN(sizeof(uiSelectContextElem) * selctx_data->elems_len, __func__)); @@ -1830,7 +1834,8 @@ static bool ui_selectcontext_begin(bContext *C, uiBut *but, uiSelectContextStore } if (!UI_context_copy_to_selected_check( - &ptr, &link->ptr, prop, path, use_path_from_id, &lptr, &lprop)) { + &ptr, &link->ptr, prop, path, use_path_from_id, &lptr, &lprop)) + { selctx_data->elems_len -= 1; i -= 1; continue; @@ -1963,7 +1968,8 @@ static void ui_selectcontext_apply(bContext *C, if ((rna_type == PROP_BOOLEAN) && ELEM(subtype, PROP_LAYER, PROP_LAYER_MEMBER) && is_array && /* could check for 'handle_layer_buttons' */ - but->func) { + but->func) + { wmWindow *win = CTX_wm_window(C); if ((win->eventstate->modifier & KM_SHIFT) == 0) { const int len = RNA_property_array_length(&but->rnapoin, prop); @@ -2063,8 +2069,8 @@ static bool ui_but_drag_init(bContext *C, WM_event_drag_threshold(event), int((UI_UNIT_Y / 2) * ui_block_to_window_scale(data->region, but->block))); - if (abs(data->dragstartx - event->xy[0]) + abs(data->dragstarty - event->xy[1]) > - drag_threshold) { + if (abs(data->dragstartx - event->xy[0]) + abs(data->dragstarty - event->xy[1]) > drag_threshold) + { button_activate_state(C, but, BUTTON_STATE_EXIT); data->cancel = true; #ifdef USE_DRAG_TOGGLE @@ -2101,7 +2107,8 @@ static bool ui_but_drag_init(bContext *C, RGN_TYPE_NAV_BAR, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER, - RGN_TYPE_FOOTER)) { + RGN_TYPE_FOOTER)) + { const int region_alignment = RGN_ALIGN_ENUM_FROM_MASK(data->region->alignment); int lock_axis = -1; @@ -2119,7 +2126,8 @@ static bool ui_but_drag_init(bContext *C, } else #endif - if (but->type == UI_BTYPE_COLOR) { + if (but->type == UI_BTYPE_COLOR) + { bool valid = false; uiDragColorHandle *drag_info = MEM_cnew(__func__); @@ -2237,7 +2245,8 @@ static void ui_apply_but( } else # endif - if (data->select_others.elems_len == 0) { + if (data->select_others.elems_len == 0) + { wmWindow *win = CTX_wm_window(C); /* may have been enabled before activating */ if (data->select_others.is_enabled || IS_ALLSELECT_EVENT(win->eventstate)) { @@ -2377,7 +2386,8 @@ static void ui_apply_but( #ifdef USE_DRAG_MULTINUM if (data->multi_data.has_mbuts) { if ((data->multi_data.init == uiHandleButtonMulti::INIT_ENABLE) && - (data->multi_data.skip == false)) { + (data->multi_data.skip == false)) + { if (data->cancel) { ui_multibut_restore(C, data, block); } @@ -3419,7 +3429,8 @@ static void ui_textedit_begin(bContext *C, uiBut *but, uiHandleButtonData *data) } if (ui_but_is_float(but) && !ui_but_is_unit(but) && - !ui_but_anim_expression_get(but, nullptr, 0) && !no_zero_strip) { + !ui_but_anim_expression_get(but, nullptr, 0) && !no_zero_strip) + { BLI_str_rstrip_float_zero(data->str, '\0'); } @@ -3508,7 +3519,8 @@ static void ui_textedit_end(bContext *C, uiBut *but, uiHandleButtonData *data) if ((ui_searchbox_apply(but, data->searchbox) == false) && (ui_searchbox_find_index(data->searchbox, but->editstr) == -1) && - !but_search->results_are_suggestions) { + !but_search->results_are_suggestions) + { if (but->flag & UI_BUT_VALUE_CLEAR) { /* It is valid for _VALUE_CLEAR flavor to have no active element @@ -3557,7 +3569,8 @@ static void ui_textedit_next_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa UI_BTYPE_SEPR, UI_BTYPE_SEPR_LINE, UI_BTYPE_ROUNDBOX, - UI_BTYPE_LISTBOX)) { + UI_BTYPE_LISTBOX)) + { return; } @@ -3589,7 +3602,8 @@ static void ui_textedit_prev_but(uiBlock *block, uiBut *actbut, uiHandleButtonDa UI_BTYPE_SEPR, UI_BTYPE_SEPR_LINE, UI_BTYPE_ROUNDBOX, - UI_BTYPE_LISTBOX)) { + UI_BTYPE_LISTBOX)) + { return; } @@ -3633,7 +3647,8 @@ static void ui_do_but_textedit( if (data->searchbox) { #ifdef USE_KEYNAV_LIMIT if ((event->type == MOUSEMOVE) && - ui_mouse_motion_keynav_test(&data->searchbox_keynav_state, event)) { + ui_mouse_motion_keynav_test(&data->searchbox_keynav_state, event)) + { /* pass */ } else { @@ -3872,7 +3887,8 @@ static void ui_do_but_textedit( #if defined(__APPLE__) ((event->modifier & KM_OSKEY) && ((event->modifier & (KM_ALT | KM_CTRL)) == 0)) || #endif - ((event->modifier & KM_CTRL) && ((event->modifier & (KM_ALT | KM_OSKEY)) == 0))) { + ((event->modifier & KM_CTRL) && ((event->modifier & (KM_ALT | KM_OSKEY)) == 0))) + { int undo_pos; const char *undo_str = ui_textedit_undo( data->undo_stack_text, is_redo ? 1 : -1, &undo_pos); @@ -3896,7 +3912,8 @@ static void ui_do_but_textedit( #ifdef WITH_INPUT_IME && !is_ime_composing && !WM_event_is_ime_switch(event) #endif - ) { + ) + { char utf8_buf_override[2] = {'\0', '\0'}; const char *utf8_buf = event->utf8_buf; @@ -3932,7 +3949,8 @@ static void ui_do_but_textedit( } if (event->type == WM_IME_COMPOSITE_EVENT && ime_data->result_len) { if (ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER) && - STREQ(ime_data->str_result, "\xE3\x80\x82")) { + STREQ(ime_data->str_result, "\xE3\x80\x82")) + { /* Convert Ideographic Full Stop (U+3002) to decimal point when entering numbers. */ ui_textedit_insert_ascii(but, data, '.'); } @@ -4028,11 +4046,8 @@ static void ui_numedit_begin(uiBut *but, uiHandleButtonData *data) data->coba = (ColorBand *)but->poin; but_coba->edit_coba = data->coba; } - else if (ELEM(but->type, - UI_BTYPE_UNITVEC, - UI_BTYPE_HSVCUBE, - UI_BTYPE_HSVCIRCLE, - UI_BTYPE_COLOR)) { + else if (ELEM(but->type, UI_BTYPE_UNITVEC, UI_BTYPE_HSVCUBE, UI_BTYPE_HSVCIRCLE, UI_BTYPE_COLOR)) + { ui_but_v3_get(but, data->origvec); copy_v3_v3(data->vec, data->origvec); but->editvec = data->vec; @@ -4504,7 +4519,8 @@ static int ui_do_but_HOTKEYEVT(bContext *C, if (data->state == BUTTON_STATE_HIGHLIGHT) { if (ELEM(event->type, LEFTMOUSE, EVT_PADENTER, EVT_RETKEY, EVT_BUT_OPEN) && - (event->val == KM_PRESS)) { + (event->val == KM_PRESS)) + { but->drawstr[0] = 0; hotkey_but->modifier_key = 0; button_activate_state(C, but, BUTTON_STATE_WAIT_KEY_EVENT); @@ -4616,7 +4632,8 @@ static int ui_do_but_TAB( if (is_property && ELEM(rna_type, PROP_POINTER, PROP_STRING) && (but->custom_data != nullptr) && (event->type == LEFTMOUSE) && - ((event->val == KM_DBL_CLICK) || (event->modifier & KM_CTRL))) { + ((event->val == KM_DBL_CLICK) || (event->modifier & KM_CTRL))) + { button_activate_state(C, but, BUTTON_STATE_TEXT_EDITING); return WM_UI_HANDLER_BREAK; } @@ -4650,7 +4667,8 @@ static int ui_do_but_TEX( /* pass - allow filesel, enter to execute */ } else if (ELEM(but->emboss, UI_EMBOSS_NONE, UI_EMBOSS_NONE_OR_STATUS) && - ((event->modifier & KM_CTRL) == 0)) { + ((event->modifier & KM_CTRL) == 0)) + { /* pass */ } else { @@ -4837,7 +4855,8 @@ static int ui_do_but_EXIT(bContext *C, uiBut *but, uiHandleButtonData *data, con int ret = WM_UI_HANDLER_BREAK; /* XXX: (a bit ugly) Special case handling for file-browser drag button. */ if (ui_but_drag_is_draggable(but) && but->imb && - ui_but_contains_point_px_icon(but, data->region, event)) { + ui_but_contains_point_px_icon(but, data->region, event)) + { ret = WM_UI_HANDLER_CONTINUE; } /* Same special case handling for UI lists. Return CONTINUE so that a tweak or CLICK event @@ -5400,7 +5419,8 @@ static int ui_do_but_NUM( (ui_but_is_cursor_warp(but) ? screen_mx : mx), is_motion, snap, - fac)) { + fac)) + { ui_numedit_apply(C, block, but, data); } #ifdef USE_DRAG_MULTINUM @@ -5508,7 +5528,8 @@ static bool ui_numedit_but_SLI(uiBut *but, /* prevent unwanted drag adjustments, test motion so modifier keys refresh. */ if ((but->type != UI_BTYPE_SCROLL) && (is_motion || data->draglock) && - (ui_but_dragedit_update_mval(data, mx) == false)) { + (ui_but_dragedit_update_mval(data, mx) == false)) + { return changed; } @@ -5749,7 +5770,8 @@ static int ui_do_but_SLI( true, is_motion, event->modifier & KM_CTRL, - event->modifier & KM_SHIFT)) { + event->modifier & KM_SHIFT)) + { ui_numedit_apply(C, block, but, data); } @@ -5977,7 +5999,8 @@ static int ui_do_but_LISTROW(bContext *C, */ if ((ELEM(event->type, LEFTMOUSE, EVT_PADENTER, EVT_RETKEY) && (event->val == KM_PRESS) && (event->modifier & KM_CTRL)) || - (event->type == LEFTMOUSE && event->val == KM_DBL_CLICK)) { + (event->type == LEFTMOUSE && event->val == KM_DBL_CLICK)) + { uiBut *labelbut = ui_but_list_row_text_activate( C, but, data, event, BUTTON_ACTIVATE_TEXT_EDITING); if (labelbut) { @@ -6017,8 +6040,8 @@ static int ui_do_but_BLOCK(bContext *C, uiBut *but, uiHandleButtonData *data, co return WM_UI_HANDLER_BREAK; } if (ui_but_supports_cycling(but)) { - if (ELEM(event->type, MOUSEPAN, WHEELDOWNMOUSE, WHEELUPMOUSE) && - (event->modifier & KM_CTRL)) { + if (ELEM(event->type, MOUSEPAN, WHEELDOWNMOUSE, WHEELUPMOUSE) && (event->modifier & KM_CTRL)) + { int type = event->type; int val = event->val; @@ -7331,7 +7354,8 @@ static int ui_do_but_CURVE( event->xy[0], event->xy[1], event->modifier & KM_CTRL, - event->modifier & KM_SHIFT)) { + event->modifier & KM_SHIFT)) + { ui_numedit_apply(C, block, but, data); } } @@ -7641,7 +7665,8 @@ static int ui_do_but_CURVEPROFILE( if (event->type == MOUSEMOVE) { if (mx != data->draglastx || my != data->draglasty) { if (ui_numedit_but_CURVEPROFILE( - block, but, data, mx, my, event->modifier & KM_CTRL, event->modifier & KM_SHIFT)) { + block, but, data, mx, my, event->modifier & KM_CTRL, event->modifier & KM_SHIFT)) + { ui_numedit_apply(C, block, but, data); } } @@ -7937,7 +7962,8 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * if ((event->type == RIGHTMOUSE) && (event->modifier & (KM_SHIFT | KM_CTRL | KM_ALT | KM_OSKEY)) == 0 && - (event->val == KM_PRESS)) { + (event->val == KM_PRESS)) + { /* For some button types that are typically representing entire sets of data, right-clicking * to spawn the context menu should also activate the item. This makes it clear which item * will be operated on. @@ -7975,7 +8001,8 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * ELEM(event->type, LEFTMOUSE, EVT_BUT_OPEN, EVT_PADENTER, EVT_RETKEY) && (event->val == KM_RELEASE) && /* Only returns true if the event was handled. */ - ui_do_but_extra_operator_icon(C, but, data, event)) { + ui_do_but_extra_operator_icon(C, but, data, event)) + { return WM_UI_HANDLER_BREAK; } } @@ -8112,9 +8139,11 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * if (data) { if (ISMOUSE_MOTION(event->type) || /* if we started dragging, progress on any event */ - (data->multi_data.init == uiHandleButtonMulti::INIT_SETUP)) { + (data->multi_data.init == uiHandleButtonMulti::INIT_SETUP)) + { if (ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER) && - ELEM(data->state, BUTTON_STATE_TEXT_EDITING, BUTTON_STATE_NUM_EDITING)) { + ELEM(data->state, BUTTON_STATE_TEXT_EDITING, BUTTON_STATE_NUM_EDITING)) + { /* initialize! */ if (data->multi_data.init == uiHandleButtonMulti::INIT_UNSET) { /* --> (uiHandleButtonMulti::INIT_SETUP | uiHandleButtonMulti::INIT_DISABLE) */ @@ -8145,7 +8174,8 @@ static int ui_do_button(bContext *C, uiBlock *block, uiBut *but, const wmEvent * ELEM(data->state, BUTTON_STATE_TEXT_EDITING, BUTTON_STATE_NUM_EDITING)) || ((abs(data->multi_data.drag_lock_x - event->xy[0]) > margin_x) && /* Just to be sure, check we're dragging more horizontally then vertically. */ - abs(event->prev_xy[0] - event->xy[0]) > abs(event->prev_xy[1] - event->xy[1]))) { + abs(event->prev_xy[0] - event->xy[0]) > abs(event->prev_xy[1] - event->xy[1]))) + { if (data->multi_data.has_mbuts) { ui_multibut_states_create(but, data); data->multi_data.init = uiHandleButtonMulti::INIT_ENABLE; @@ -8295,7 +8325,8 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s /* Menu button types may draw as popovers, check for this case * ignoring other kinds of menus (mainly enums). (see #66538). */ ((but->type == UI_BTYPE_MENU) && - (UI_but_paneltype_get(but) || ui_but_menu_draw_as_popover(but)))) { + (UI_but_paneltype_get(but) || ui_but_menu_draw_as_popover(but)))) + { if (data->used_mouse && !data->autoopentimer) { int time; @@ -8303,7 +8334,8 @@ static void button_activate_state(bContext *C, uiBut *but, uiHandleButtonState s time = 1; } else if ((but->block->flag & UI_BLOCK_LOOP && but->type != UI_BTYPE_BLOCK) || - (but->block->auto_open == true)) { + (but->block->auto_open == true)) + { time = 5 * U.menuthreshold2; } else if (U.uiflag & USER_MENUOPENAUTO) { @@ -9181,7 +9213,8 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but) /* always deactivate button for pie menus, * else moving to blank space will leave activated */ if ((!ui_block_is_menu(block) || ui_block_is_pie_menu(block)) && - !ui_but_contains_point_px(but, region, event->xy)) { + !ui_but_contains_point_px(but, region, event->xy)) + { exit = true; } else if (but_other && ui_but_is_editable(but_other) && (but_other != but)) { @@ -9359,7 +9392,8 @@ static int ui_handle_button_event(bContext *C, const wmEvent *event, uiBut *but) /* Reset the button value when empty text is typed. */ if ((data->cancel == false) && (data->str != nullptr) && (data->str[0] == '\0') && - (but->rnaprop && ELEM(RNA_property_type(but->rnaprop), PROP_FLOAT, PROP_INT))) { + (but->rnaprop && ELEM(RNA_property_type(but->rnaprop), PROP_FLOAT, PROP_INT))) + { MEM_SAFE_FREE(data->str); ui_button_value_default(but, &data->value); @@ -9427,7 +9461,8 @@ static int ui_list_activate_hovered_row(bContext *C, if (!ui_list_invoke_item_operator(C, hovered_but, ui_list->dyn_data->custom_drag_optype, - &ui_list->dyn_data->custom_drag_opptr)) { + &ui_list->dyn_data->custom_drag_opptr)) + { return WM_UI_HANDLER_CONTINUE; } } @@ -9540,7 +9575,8 @@ static int ui_list_get_increment(const uiList *ui_list, const int type, const in /* Handle column offsets for grid layouts. */ if (ELEM(type, EVT_UPARROWKEY, EVT_DOWNARROWKEY) && - ELEM(ui_list->layout_type, UILST_LAYOUT_GRID, UILST_LAYOUT_BIG_PREVIEW_GRID)) { + ELEM(ui_list->layout_type, UILST_LAYOUT_GRID, UILST_LAYOUT_BIG_PREVIEW_GRID)) + { increment = (type == EVT_UPARROWKEY) ? -columns : columns; } else { @@ -9595,7 +9631,8 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *regi if ((ELEM(type, EVT_UPARROWKEY, EVT_DOWNARROWKEY, EVT_LEFTARROWKEY, EVT_RIGHTARROWKEY) && (event->modifier & (KM_SHIFT | KM_CTRL | KM_ALT | KM_OSKEY)) == 0) || (ELEM(type, WHEELUPMOUSE, WHEELDOWNMOUSE) && (event->modifier & KM_CTRL) && - (event->modifier & (KM_SHIFT | KM_ALT | KM_OSKEY)) == 0)) { + (event->modifier & (KM_SHIFT | KM_ALT | KM_OSKEY)) == 0)) + { const int value_orig = RNA_property_int_get(&listbox->rnapoin, listbox->rnaprop); int value, min, max; @@ -9614,7 +9651,8 @@ static int ui_handle_list_event(bContext *C, const wmEvent *event, ARegion *regi for (int i = 0; i < len; i++) { if (!dyn_data->items_filter_flags || - ((dyn_data->items_filter_flags[i] & UILST_FLT_ITEM) ^ filter_exclude)) { + ((dyn_data->items_filter_flags[i] & UILST_FLT_ITEM) ^ filter_exclude)) + { org_order[new_order ? new_order[++org_idx] : ++org_idx] = i; if (i == value) { current_idx = new_order ? new_order[org_idx] : org_idx; @@ -9919,7 +9957,8 @@ static void ui_mouse_motion_keynav_init(uiKeyNavLock *keynav, const wmEvent *eve static bool ui_mouse_motion_keynav_test(uiKeyNavLock *keynav, const wmEvent *event) { if (keynav->is_keynav && - (len_manhattan_v2v2_int(keynav->event_xy, event->xy) > BUTTON_KEYNAV_PX_LIMIT)) { + (len_manhattan_v2v2_int(keynav->event_xy, event->xy) > BUTTON_KEYNAV_PX_LIMIT)) + { keynav->is_keynav = false; } @@ -10539,7 +10578,8 @@ static int ui_handle_menu_event(bContext *C, /* exception for rna layer buts */ if (but->rnapoin.data && but->rnaprop && - ELEM(RNA_property_subtype(but->rnaprop), PROP_LAYER, PROP_LAYER_MEMBER)) { + ELEM(RNA_property_subtype(but->rnaprop), PROP_LAYER, PROP_LAYER_MEMBER)) + { if (but->rnaindex == act - 1) { doit = true; } @@ -10550,7 +10590,8 @@ static int ui_handle_menu_event(bContext *C, UI_BTYPE_MENU, UI_BTYPE_BLOCK, UI_BTYPE_PULLDOWN) && - count == act) { + count == act) + { doit = true; } @@ -10604,7 +10645,8 @@ static int ui_handle_menu_event(bContext *C, ((event->modifier & (KM_SHIFT | KM_CTRL | KM_OSKEY)) == 0) && /* Only respond to explicit press to avoid the event that opened the menu * activating an item when the key is held. */ - (event->flag & WM_EVENT_IS_REPEAT) == 0) { + (event->flag & WM_EVENT_IS_REPEAT) == 0) + { if (ui_menu_pass_event_to_parent_if_nonactive(menu, but, level, retval)) { break; } @@ -10712,7 +10754,8 @@ static int ui_handle_menu_event(bContext *C, } #ifdef USE_DRAG_POPUP else if ((event->type == LEFTMOUSE) && (event->val == KM_PRESS) && - (inside && is_floating && inside_title)) { + (inside && is_floating && inside_title)) + { if (!but || !ui_but_contains_point_px(but, region, event->xy)) { if (but) { UI_but_tooltip_timer_remove(C, but); @@ -10774,7 +10817,8 @@ static int ui_handle_menu_event(bContext *C, * for example when mouse was not over submenu */ if ((event->type == TIMER) || (/* inside && */ (!menu->menuretval || (menu->menuretval & UI_RETURN_UPDATE)) && - retval == WM_UI_HANDLER_CONTINUE)) { + retval == WM_UI_HANDLER_CONTINUE)) + { retval = ui_handle_menu_button(C, event, menu); } @@ -11041,15 +11085,16 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle ED_region_tag_redraw(region); } else { - if ((duration < 0.01 * U.pie_tap_timeout) && - !(block->pie_data.flags & UI_PIE_DRAG_STYLE)) { + if ((duration < 0.01 * U.pie_tap_timeout) && !(block->pie_data.flags & UI_PIE_DRAG_STYLE)) + { block->pie_data.flags |= UI_PIE_CLICK_STYLE; } else { uiBut *but = ui_region_find_active_but(menu->region); if (but && (U.pie_menu_confirm > 0) && - (dist >= UI_SCALE_FAC * (U.pie_menu_threshold + U.pie_menu_confirm))) { + (dist >= UI_SCALE_FAC * (U.pie_menu_threshold + U.pie_menu_confirm))) + { return ui_but_pie_menu_apply(C, menu, but, true); } @@ -11074,7 +11119,8 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle /* here instead, we use the offset location to account for the initial * direction timeout */ if ((U.pie_menu_confirm > 0) && - (dist >= UI_SCALE_FAC * (U.pie_menu_threshold + U.pie_menu_confirm))) { + (dist >= UI_SCALE_FAC * (U.pie_menu_threshold + U.pie_menu_confirm))) + { block->pie_data.flags |= UI_PIE_GESTURE_END_WAIT; copy_v2_v2(block->pie_data.last_pos, event_xy); block->pie_data.duration_gesture = duration; @@ -11130,7 +11176,8 @@ static int ui_pie_handler(bContext *C, const wmEvent *event, uiPopupBlockHandle case EVT_YKEY: case EVT_ZKEY: { if (ELEM(event->val, KM_PRESS, KM_DBL_CLICK) && - ((event->modifier & (KM_SHIFT | KM_CTRL | KM_OSKEY)) == 0)) { + ((event->modifier & (KM_SHIFT | KM_CTRL | KM_OSKEY)) == 0)) + { LISTBASE_FOREACH (uiBut *, but, &block->buttons) { if (but->menu_key == event->type) { ui_but_pie_button_activate(C, but, menu); @@ -11332,7 +11379,8 @@ static int ui_region_handler(bContext *C, const wmEvent *event, void * /*userdat /* Re-enable tool-tips. */ if (event->type == MOUSEMOVE && - (event->xy[0] != event->prev_xy[0] || event->xy[1] != event->prev_xy[1])) { + (event->xy[0] != event->prev_xy[0] || event->xy[1] != event->prev_xy[1])) + { ui_blocks_set_tooltips(region, true); } @@ -11401,7 +11449,8 @@ static int ui_handler_region_menu(bContext *C, const wmEvent *event, void * /*us (((data->menu->direction & (UI_DIR_LEFT | UI_DIR_RIGHT)) && BLI_rctf_isect_rect_x(&but->rect, &but_other->rect, nullptr)) || ((data->menu->direction & (UI_DIR_DOWN | UI_DIR_UP)) && - BLI_rctf_isect_rect_y(&but->rect, &but_other->rect, nullptr)))) { + BLI_rctf_isect_rect_y(&but->rect, &but_other->rect, nullptr)))) + { /* if mouse moves to a different root-level menu button, * open it to replace the current menu */ if ((but_other->flag & UI_BUT_DISABLED) == 0) { @@ -11436,7 +11485,8 @@ static int ui_handler_region_menu(bContext *C, const wmEvent *event, void * /*us /* Re-enable tool-tips. */ if (event->type == MOUSEMOVE && - (event->xy[0] != event->prev_xy[0] || event->xy[1] != event->prev_xy[1])) { + (event->xy[0] != event->prev_xy[0] || event->xy[1] != event->prev_xy[1])) + { ui_blocks_set_tooltips(region, true); } @@ -11531,7 +11581,8 @@ static int ui_popup_handler(bContext *C, const wmEvent *event, void *userdata) else { /* Re-enable tool-tips */ if (event->type == MOUSEMOVE && - (event->xy[0] != event->prev_xy[0] || event->xy[1] != event->prev_xy[1])) { + (event->xy[0] != event->prev_xy[0] || event->xy[1] != event->prev_xy[1])) + { ui_blocks_set_tooltips(menu->region, true); } } @@ -11600,12 +11651,14 @@ void UI_popup_handlers_remove(ListBase *handlers, uiPopupBlockHandle *popup) wmEventHandler_UI *handler = (wmEventHandler_UI *)handler_base; if (handler->handle_fn == ui_popup_handler && - handler->remove_fn == ui_popup_handler_remove && handler->user_data == popup) { + handler->remove_fn == ui_popup_handler_remove && handler->user_data == popup) + { /* tag refresh parent popup */ wmEventHandler_UI *handler_next = (wmEventHandler_UI *)handler->head.next; if (handler_next && handler_next->head.type == WM_HANDLER_TYPE_UI && handler_next->handle_fn == ui_popup_handler && - handler_next->remove_fn == ui_popup_handler_remove) { + handler_next->remove_fn == ui_popup_handler_remove) + { uiPopupBlockHandle *parent_popup = static_cast( handler_next->user_data); ED_region_tag_refresh_ui(parent_popup->region); diff --git a/source/blender/editors/interface/interface_icons.cc b/source/blender/editors/interface/interface_icons.cc index 772f45ceb02..4ea3645ea48 100644 --- a/source/blender/editors/interface/interface_icons.cc +++ b/source/blender/editors/interface/interface_icons.cc @@ -2300,7 +2300,8 @@ int UI_icon_from_library(const ID *id) } if (ID_IS_OVERRIDE_LIBRARY(id)) { if (!ID_IS_OVERRIDE_LIBRARY_REAL(id) || - (id->override_library->flag & IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED) != 0) { + (id->override_library->flag & IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED) != 0) + { return ICON_LIBRARY_DATA_OVERRIDE_NONEDITABLE; } return ICON_LIBRARY_DATA_OVERRIDE; diff --git a/source/blender/editors/interface/interface_layout.cc b/source/blender/editors/interface/interface_layout.cc index 1b5330acc19..d70221affa9 100644 --- a/source/blender/editors/interface/interface_layout.cc +++ b/source/blender/editors/interface/interface_layout.cc @@ -859,7 +859,8 @@ static void ui_item_enum_expand_exec(uiLayout *layout, } } else if (ELEM(layout->item.type, ITEM_LAYOUT_GRID_FLOW, ITEM_LAYOUT_COLUMN_FLOW) || - layout->root->type == UI_LAYOUT_MENU) { + layout->root->type == UI_LAYOUT_MENU) + { UI_block_layout_set_current(block, layout); } else { @@ -929,7 +930,8 @@ static void ui_item_enum_expand_tabs(uiLayout *layout, BLI_assert(last != block->buttons.last); for (uiBut *tab = last ? last->next : static_cast(block->buttons.first); tab; - tab = tab->next) { + tab = tab->next) + { UI_but_drawflag_enable(tab, ui_but_align_opposite_to_area_align_get(CTX_wm_region(C))); } @@ -942,7 +944,8 @@ static void ui_item_enum_expand_tabs(uiLayout *layout, int i = 0; for (uiBut *tab_but = last ? last->next : static_cast(block->buttons.first); (tab_but != nullptr) && (i < highlight_array_len); - tab_but = tab_but->next, i++) { + tab_but = tab_but->next, i++) + { SET_FLAG_FROM_TEST(tab_but->flag, !highlight_array[i], UI_BUT_INACTIVE); } } @@ -1006,7 +1009,8 @@ static uiBut *ui_item_with_label(uiLayout *layout, #ifdef UI_PROP_DECORATE || use_prop_decorate #endif - ) { + ) + { /* Also avoid setting 'align' if possible. Set the space to zero instead as aligning a large * number of labels can end up aligning thousands of buttons when displaying key-map search (a * heavy operation), see: #78636. */ @@ -2164,7 +2168,8 @@ void uiItemFullR(uiLayout *layout, /* Menus and pie-menus don't show checkbox without this. */ if ((layout->root->type == UI_LAYOUT_MENU) || /* Use check-boxes only as a fallback in pie-menu's, when no icon is defined. */ - ((layout->root->type == UI_LAYOUT_PIEMENU) && (icon == ICON_NONE))) { + ((layout->root->type == UI_LAYOUT_PIEMENU) && (icon == ICON_NONE))) + { const int prop_flag = RNA_property_flag(prop); if (type == PROP_BOOLEAN) { if ((is_array == false) || (index != RNA_NO_INDEX)) { @@ -2446,7 +2451,8 @@ void uiItemFullR(uiLayout *layout, UI_BTYPE_CHECKBOX, UI_BTYPE_CHECKBOX_N, UI_BTYPE_ICON_TOGGLE, - UI_BTYPE_ICON_TOGGLE_N)) { + UI_BTYPE_ICON_TOGGLE_N)) + { but->drawflag |= UI_BUT_CHECKBOX_INVERT; } } @@ -2478,7 +2484,8 @@ void uiItemFullR(uiLayout *layout, /* Mark non-embossed text-fields inside a list-box. */ if (but && (block->flag & UI_BLOCK_LIST_ITEM) && (but->type == UI_BTYPE_TEXT) && - ELEM(but->emboss, UI_EMBOSS_NONE, UI_EMBOSS_NONE_OR_STATUS)) { + ELEM(but->emboss, UI_EMBOSS_NONE, UI_EMBOSS_NONE_OR_STATUS)) + { UI_but_flag_enable(but, UI_BUT_LIST_ITEM); } @@ -3043,7 +3050,8 @@ static uiBut *ui_item_menu(uiLayout *layout, if (ELEM(layout->root->type, UI_LAYOUT_PANEL, UI_LAYOUT_TOOLBAR) || /* We never want a drop-down in menu! */ - (force_menu && layout->root->type != UI_LAYOUT_MENU)) { + (force_menu && layout->root->type != UI_LAYOUT_MENU)) + { UI_but_type_set_menu_from_pulldown(but); } @@ -3581,7 +3589,8 @@ void uiItemMenuEnumFullO_ptr(uiLayout *layout, if ((layout->root->block->flag & UI_BLOCK_LOOP) && (ot->prop && ot->invoke)) { char keybuf[128]; if (WM_key_event_operator_string( - C, ot->idname, layout->root->opcontext, nullptr, false, keybuf, sizeof(keybuf))) { + C, ot->idname, layout->root->opcontext, nullptr, false, keybuf, sizeof(keybuf))) + { ui_but_add_shortcut(but, keybuf, false); } } @@ -3776,7 +3785,8 @@ static void ui_litem_layout_row(uiLayout *litem) if (item->type != ITEM_BUTTON && ELEM(((uiLayout *)item)->alignment, UI_LAYOUT_ALIGN_RIGHT, UI_LAYOUT_ALIGN_CENTER) && litem->alignment == UI_LAYOUT_ALIGN_EXPAND && - ((uiItem *)litem)->flag & UI_ITEM_FIXED_SIZE) { + ((uiItem *)litem)->flag & UI_ITEM_FIXED_SIZE) + { min_flag = false; } @@ -3853,7 +3863,8 @@ static void ui_litem_layout_row(uiLayout *litem) uiItem *last_item = static_cast(litem->items.last); extra_pixel = litem->w - (x - litem->x); if (extra_pixel > 0 && litem->alignment == UI_LAYOUT_ALIGN_EXPAND && last_free_item && - last_item && last_item->flag & UI_ITEM_AUTO_FIXED_SIZE) { + last_item && last_item->flag & UI_ITEM_AUTO_FIXED_SIZE) + { ui_item_move(last_free_item, 0, extra_pixel); for (uiItem *item = last_free_item->next; item; item = item->next) { ui_item_move(item, extra_pixel, extra_pixel); @@ -4482,7 +4493,8 @@ static void ui_litem_estimate_grid_flow(uiLayout *litem) for (gflow->tot_rows = int(ceilf(float(gflow->tot_items) / gflow->tot_columns)); (gflow->tot_columns - step) > 0 && int(ceilf(float(gflow->tot_items) / (gflow->tot_columns - step))) <= gflow->tot_rows; - gflow->tot_columns -= step) { + gflow->tot_columns -= step) + { /* pass */ } } @@ -4496,7 +4508,8 @@ static void ui_litem_estimate_grid_flow(uiLayout *litem) for (gflow->tot_columns = int(ceilf(float(gflow->tot_items) / gflow->tot_rows)); (gflow->tot_rows - step) > 0 && int(ceilf(float(gflow->tot_items) / (gflow->tot_rows - step))) <= gflow->tot_columns; - gflow->tot_rows -= step) { + gflow->tot_rows -= step) + { /* pass */ } } @@ -5917,7 +5930,8 @@ static bool ui_layout_has_panel_label(const uiLayout *layout, const PanelType *p if (subitem->type == ITEM_BUTTON) { uiButtonItem *bitem = (uiButtonItem *)subitem; if (!(bitem->but->flag & UI_HIDDEN) && - STREQ(bitem->but->str, CTX_IFACE_(pt->translation_context, pt->label))) { + STREQ(bitem->but->str, CTX_IFACE_(pt->translation_context, pt->label))) + { return true; } } diff --git a/source/blender/editors/interface/interface_ops.cc b/source/blender/editors/interface/interface_ops.cc index 8168faba377..6cd87cdbd2b 100644 --- a/source/blender/editors/interface/interface_ops.cc +++ b/source/blender/editors/interface/interface_ops.cc @@ -198,7 +198,8 @@ static bool copy_as_driver_button_poll(bContext *C) if (ptr.owner_id && ptr.data && prop && ELEM(RNA_property_type(prop), PROP_BOOLEAN, PROP_INT, PROP_FLOAT, PROP_ENUM) && - (index >= 0 || !RNA_property_array_check(prop))) { + (index >= 0 || !RNA_property_array_check(prop))) + { path = RNA_path_from_ID_to_property(&ptr, prop); if (path) { @@ -476,7 +477,8 @@ static int unset_property_button_exec(bContext *C, wmOperator * /*op*/) /* if there is a valid property that is editable... */ if (ptr.data && prop && RNA_property_editable(&ptr, prop) && /* RNA_property_is_idprop(prop) && */ - RNA_property_is_set(&ptr, prop)) { + RNA_property_is_set(&ptr, prop)) + { RNA_property_unset(&ptr, prop); return operator_button_property_finish(C, &ptr, prop); } @@ -1080,10 +1082,11 @@ bool UI_context_copy_to_selected_list(bContext *C, char *idpath = nullptr; /* First, check the active PoseBone and PoseBone->Bone. */ - if (NOT_RNA_NULL( - owner_ptr = CTX_data_pointer_get_type(C, "active_pose_bone", &RNA_PoseBone))) { + if (NOT_RNA_NULL(owner_ptr = CTX_data_pointer_get_type(C, "active_pose_bone", &RNA_PoseBone))) + { if (NOT_NULL(idpath = RNA_path_from_struct_to_idproperty( - &owner_ptr, static_cast(ptr->data)))) { + &owner_ptr, static_cast(ptr->data)))) + { *r_lb = CTX_data_collection_get(C, "selected_pose_bones"); } else { @@ -1091,7 +1094,8 @@ bool UI_context_copy_to_selected_list(bContext *C, RNA_pointer_create(owner_ptr.owner_id, &RNA_Bone, pchan->bone, &owner_ptr); if (NOT_NULL(idpath = RNA_path_from_struct_to_idproperty( - &owner_ptr, static_cast(ptr->data)))) { + &owner_ptr, static_cast(ptr->data)))) + { ui_context_selected_bones_via_pose(C, r_lb); } } @@ -1102,7 +1106,8 @@ bool UI_context_copy_to_selected_list(bContext *C, if (NOT_RNA_NULL( owner_ptr = CTX_data_pointer_get_type_silent(C, "active_bone", &RNA_EditBone)) && NOT_NULL(idpath = RNA_path_from_struct_to_idproperty( - &owner_ptr, static_cast(ptr->data)))) { + &owner_ptr, static_cast(ptr->data)))) + { *r_lb = CTX_data_collection_get(C, "selected_editable_bones"); } @@ -1155,7 +1160,8 @@ bool UI_context_copy_to_selected_list(bContext *C, } else if (RNA_struct_is_a(ptr->type, &RNA_Constraint) && (path_from_bone = RNA_path_resolve_from_type_to_property(ptr, prop, &RNA_PoseBone)) != - nullptr) { + nullptr) + { *r_lb = CTX_data_collection_get(C, "selected_pose_bones"); *r_path = path_from_bone; } @@ -1227,7 +1233,8 @@ bool UI_context_copy_to_selected_list(bContext *C, ID *id_data = static_cast(ob->data); if ((id_data == nullptr) || (id_data->tag & LIB_TAG_DOIT) == 0 || - ID_IS_LINKED(id_data) || (GS(id_data->name) != id_code)) { + ID_IS_LINKED(id_data) || (GS(id_data->name) != id_code)) + { BLI_remlink(&lb, link); MEM_freeN(link); } @@ -1249,8 +1256,8 @@ bool UI_context_copy_to_selected_list(bContext *C, /* Sequencer's ID is scene :/ */ /* Try to recursively find an RNA_Sequence ancestor, * to handle situations like #41062... */ - if ((*r_path = RNA_path_resolve_from_type_to_property(ptr, prop, &RNA_Sequence)) != - nullptr) { + if ((*r_path = RNA_path_resolve_from_type_to_property(ptr, prop, &RNA_Sequence)) != nullptr) + { /* Special case when we do this for 'Sequence.lock'. * (if the sequence is locked, it won't be in "selected_editable_sequences"). */ const char *prop_id = RNA_property_identifier(prop); @@ -1274,7 +1281,8 @@ bool UI_context_copy_to_selected_list(bContext *C, const char *prop_id = RNA_property_identifier(prop); LISTBASE_FOREACH_MUTABLE (CollectionPointerLink *, link, r_lb) { if ((ptr->type != link->ptr.type) && - (RNA_struct_type_find_property(link->ptr.type, prop_id) != prop)) { + (RNA_struct_type_find_property(link->ptr.type, prop_id) != prop)) + { BLI_remlink(r_lb, link); MEM_freeN(link); } @@ -1347,7 +1355,8 @@ bool UI_context_copy_to_selected_check(PointerRNA *ptr, */ bool ignore_prop_eq = RNA_property_is_idprop(lprop) && RNA_property_is_idprop(prop); if (RNA_struct_is_a(lptr.type, &RNA_NodesModifier) && - RNA_struct_is_a(ptr->type, &RNA_NodesModifier)) { + RNA_struct_is_a(ptr->type, &RNA_NodesModifier)) + { ignore_prop_eq = false; NodesModifierData *nmd_link = (NodesModifierData *)lptr.data; @@ -1416,7 +1425,8 @@ static bool copy_to_selected_button(bContext *C, bool all, bool poll) } if (!UI_context_copy_to_selected_check( - &ptr, &link->ptr, prop, path, use_path_from_id, &lptr, &lprop)) { + &ptr, &link->ptr, prop, path, use_path_from_id, &lptr, &lprop)) + { continue; } @@ -1686,7 +1696,8 @@ static bool ui_editsource_uibut_match(uiBut *but_a, uiBut *but_b) if (BLI_rctf_compare(&but_a->rect, &but_b->rect, FLT_EPSILON) && (but_a->type == but_b->type) && (but_a->rnaprop == but_b->rnaprop) && (but_a->optype == but_b->optype) && (but_a->unit_type == but_b->unit_type) && - STREQLEN(but_a->drawstr, but_b->drawstr, UI_MAX_DRAW_STR)) { + STREQLEN(but_a->drawstr, but_b->drawstr, UI_MAX_DRAW_STR)) + { return true; } return false; @@ -1796,7 +1807,8 @@ static int editsource_exec(bContext *C, wmOperator *op) for (BLI_ghashIterator_init(&ghi, ui_editsource_info->hash); BLI_ghashIterator_done(&ghi) == false; - BLI_ghashIterator_step(&ghi)) { + BLI_ghashIterator_step(&ghi)) + { uiBut *but_key = static_cast(BLI_ghashIterator_getKey(&ghi)); if (but_key && ui_editsource_uibut_match(&ui_editsource_info->but_orig, but_key)) { but_store = static_cast(BLI_ghashIterator_getValue(&ghi)); @@ -2157,7 +2169,8 @@ bool UI_drop_color_poll(struct bContext *C, wmDrag *drag, const wmEvent * /*even } if (sima && (sima->mode == SI_MODE_PAINT) && sima->image && - (region && region->regiontype == RGN_TYPE_WINDOW)) { + (region && region->regiontype == RGN_TYPE_WINDOW)) + { return true; } } @@ -2379,8 +2392,8 @@ static int ui_view_drop_invoke(bContext *C, wmOperator * /*op*/, const wmEvent * std::unique_ptr drop_target = region_views_find_drop_target_at(region, event->xy); - if (!drop_target_apply_drop( - *C, *drop_target, *static_cast(event->customdata))) { + if (!drop_target_apply_drop(*C, *drop_target, *static_cast(event->customdata))) + { return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH; } diff --git a/source/blender/editors/interface/interface_panel.cc b/source/blender/editors/interface/interface_panel.cc index a08cd0b6310..f5948afa4b0 100644 --- a/source/blender/editors/interface/interface_panel.cc +++ b/source/blender/editors/interface/interface_panel.cc @@ -991,14 +991,16 @@ void UI_panels_draw(const bContext *C, ARegion *region) * and we need child panels to draw on top. */ LISTBASE_FOREACH_BACKWARD (uiBlock *, block, ®ion->uiblocks) { if (block->active && block->panel && !UI_panel_is_dragging(block->panel) && - !UI_block_is_search_only(block)) { + !UI_block_is_search_only(block)) + { UI_block_draw(C, block); } } LISTBASE_FOREACH_BACKWARD (uiBlock *, block, ®ion->uiblocks) { if (block->active && block->panel && UI_panel_is_dragging(block->panel) && - !UI_block_is_search_only(block)) { + !UI_block_is_search_only(block)) + { UI_block_draw(C, block); } } @@ -2323,7 +2325,8 @@ int ui_handler_panel_region(bContext *C, } } else if (((event->type == EVT_TABKEY) && (event->modifier & KM_CTRL)) || - ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE)) { + ELEM(event->type, WHEELUPMOUSE, WHEELDOWNMOUSE)) + { /* Cycle tabs. */ retval = ui_handle_panel_category_cycling(event, region, active_but); } diff --git a/source/blender/editors/interface/interface_query.cc b/source/blender/editors/interface/interface_query.cc index 562c05df77f..502b0bb4e3f 100644 --- a/source/blender/editors/interface/interface_query.cc +++ b/source/blender/editors/interface/interface_query.cc @@ -84,7 +84,8 @@ bool ui_but_is_interactive_ex(const uiBut *but, const bool labeledit, const bool return false; } if ((but->type == UI_BTYPE_TEXT) && - ELEM(but->emboss, UI_EMBOSS_NONE, UI_EMBOSS_NONE_OR_STATUS) && !labeledit) { + ELEM(but->emboss, UI_EMBOSS_NONE, UI_EMBOSS_NONE_OR_STATUS) && !labeledit) + { return false; } if ((but->type == UI_BTYPE_LISTROW) && labeledit) { @@ -551,7 +552,8 @@ bool ui_but_is_cursor_warp(const uiBut *but) UI_BTYPE_HSVCUBE, UI_BTYPE_HSVCIRCLE, UI_BTYPE_CURVE, - UI_BTYPE_CURVEPROFILE)) { + UI_BTYPE_CURVEPROFILE)) + { return true; } } @@ -764,7 +766,8 @@ bool ui_region_contains_point_px(const ARegion *region, const int xy[2]) ui_window_to_region(region, &mx, &my); if (!BLI_rcti_isect_pt(&v2d->mask, mx, my) || - UI_view2d_mouse_in_scrollers(region, ®ion->v2d, xy)) { + UI_view2d_mouse_in_scrollers(region, ®ion->v2d, xy)) + { return false; } } @@ -786,7 +789,8 @@ bool ui_region_contains_rect_px(const ARegion *region, const rcti *rect_px) rcti rect_region; ui_window_to_region_rcti(region, &rect_region, rect_px); if (!BLI_rcti_isect(&v2d->mask, &rect_region, nullptr) || - UI_view2d_rect_in_scrollers(region, ®ion->v2d, rect_px)) { + UI_view2d_rect_in_scrollers(region, ®ion->v2d, rect_px)) + { return false; } } diff --git a/source/blender/editors/interface/interface_region_color_picker.cc b/source/blender/editors/interface/interface_region_color_picker.cc index efb3d13de87..0913a591c01 100644 --- a/source/blender/editors/interface/interface_region_color_picker.cc +++ b/source/blender/editors/interface/interface_region_color_picker.cc @@ -321,7 +321,8 @@ static void ui_colorpicker_hide_reveal(uiBlock *block, ePickerType colormode) /* tag buttons */ LISTBASE_FOREACH (uiBut *, bt, &block->buttons) { if ((bt->func == ui_colorpicker_rgba_update_cb) && (bt->type == UI_BTYPE_NUM_SLIDER) && - (bt->rnaindex != 3)) { + (bt->rnaindex != 3)) + { /* RGB sliders (color circle and alpha are always shown) */ SET_FLAG_FROM_TEST(bt->flag, (colormode != PICKER_TYPE_RGB), UI_HIDDEN); } diff --git a/source/blender/editors/interface/interface_region_hud.cc b/source/blender/editors/interface/interface_region_hud.cc index 090aec4dcc1..85c96d52adb 100644 --- a/source/blender/editors/interface/interface_region_hud.cc +++ b/source/blender/editors/interface/interface_region_hud.cc @@ -172,7 +172,8 @@ static void hud_region_layout(const bContext *C, ARegion *region) ED_region_panels_layout(C, region); if (region->panels.first && - ((area->flag & AREA_FLAG_REGION_SIZE_UPDATE) || (region->sizey != size_y))) { + ((area->flag & AREA_FLAG_REGION_SIZE_UPDATE) || (region->sizey != size_y))) + { int winx_new = UI_SCALE_FAC * (region->sizex + 0.5f); int winy_new = UI_SCALE_FAC * (region->sizey + 0.5f); View2D *v2d = ®ion->v2d; diff --git a/source/blender/editors/interface/interface_region_menu_popup.cc b/source/blender/editors/interface/interface_region_menu_popup.cc index c1e0632a5bc..3a03b4c2753 100644 --- a/source/blender/editors/interface/interface_region_menu_popup.cc +++ b/source/blender/editors/interface/interface_region_menu_popup.cc @@ -136,8 +136,8 @@ static uiBut *ui_popup_menu_memory__internal(uiBlock *block, uiBut *but) if (ELEM(but_iter->type, UI_BTYPE_LABEL, UI_BTYPE_SEPR, UI_BTYPE_SEPR_LINE)) { continue; } - if (mem[hash_mod] == - ui_popup_string_hash(but_iter->str, but_iter->flag & UI_BUT_HAS_SEP_CHAR)) { + if (mem[hash_mod] == ui_popup_string_hash(but_iter->str, but_iter->flag & UI_BUT_HAS_SEP_CHAR)) + { return but_iter; } } diff --git a/source/blender/editors/interface/interface_region_search.cc b/source/blender/editors/interface/interface_region_search.cc index 68a50b77633..158ecb643c2 100644 --- a/source/blender/editors/interface/interface_region_search.cc +++ b/source/blender/editors/interface/interface_region_search.cc @@ -376,9 +376,9 @@ bool ui_searchbox_event( * (a little confusing if this isn't the case, although it does work). */ rcti rect; ui_searchbox_butrect(&rect, data, data->active); - if (BLI_rcti_isect_pt(&rect, - event->xy[0] - region->winrct.xmin, - event->xy[1] - region->winrct.ymin)) { + if (BLI_rcti_isect_pt( + &rect, event->xy[0] - region->winrct.xmin, event->xy[1] - region->winrct.ymin)) + { void *active = data->items.pointers[data->active]; if (search_but->item_context_menu_fn(C, search_but->arg, active, event)) { @@ -399,7 +399,8 @@ bool ui_searchbox_event( for (a = 0; a < data->items.totitem; a++) { ui_searchbox_butrect(&rect, data, a); if (BLI_rcti_isect_pt( - &rect, event->xy[0] - region->winrct.xmin, event->xy[1] - region->winrct.ymin)) { + &rect, event->xy[0] - region->winrct.xmin, event->xy[1] - region->winrct.ymin)) + { is_inside = true; if (data->active != a) { data->active = a; diff --git a/source/blender/editors/interface/interface_region_tooltip.cc b/source/blender/editors/interface/interface_region_tooltip.cc index e5e216c8cfc..6505a5b5299 100644 --- a/source/blender/editors/interface/interface_region_tooltip.cc +++ b/source/blender/editors/interface/interface_region_tooltip.cc @@ -550,7 +550,8 @@ static uiTooltipData *ui_tooltip_data_from_tool(bContext *C, uiBut *but, bool is static_cast(op_props.data), true, shortcut_brush, - ARRAY_SIZE(shortcut_brush))) { + ARRAY_SIZE(shortcut_brush))) + { shortcut = BLI_strdup(shortcut_brush); } WM_operator_properties_free(&op_props); @@ -567,7 +568,8 @@ static uiTooltipData *ui_tooltip_data_from_tool(bContext *C, uiBut *but, bool is nullptr, true, shortcut_toolbar, - ARRAY_SIZE(shortcut_toolbar))) { + ARRAY_SIZE(shortcut_toolbar))) + { /* Generate keymap in order to inspect it. * NOTE: we could make a utility to avoid the keymap generation part of this. */ const char *expr_imports[] = { @@ -645,7 +647,8 @@ static uiTooltipData *ui_tooltip_data_from_tool(bContext *C, uiBut *but, bool is /* pass */ } else if (BPY_run_string_as_string_and_size( - C, expr_imports, expr, nullptr, &expr_result, &expr_result_len)) { + C, expr_imports, expr, nullptr, &expr_result, &expr_result_len)) + { /* pass. */ } } @@ -668,7 +671,8 @@ static uiTooltipData *ui_tooltip_data_from_tool(bContext *C, uiBut *but, bool is static_cast(op_props.data), true, shortcut, - ARRAY_SIZE(shortcut))) { + ARRAY_SIZE(shortcut))) + { break; } item_step += strlen(item_step) + 1; @@ -1062,7 +1066,8 @@ static uiTooltipData *ui_tooltip_data_from_gizmo(bContext *C, wmGizmo *gz) IDProperty *prop = static_cast(gzop->ptr.data); char buf[128]; if (WM_key_event_operator_string( - C, gzop->type->idname, WM_OP_INVOKE_DEFAULT, prop, true, buf, ARRAY_SIZE(buf))) { + C, gzop->type->idname, WM_OP_INVOKE_DEFAULT, prop, true, buf, ARRAY_SIZE(buf))) + { uiTooltipField *field = text_field_add( data, uiTooltipFormat::Style::Normal, uiTooltipFormat::ColorID::Value, true); field->text = BLI_sprintfN(TIP_("Shortcut: %s"), buf); diff --git a/source/blender/editors/interface/interface_template_asset_view.cc b/source/blender/editors/interface/interface_template_asset_view.cc index 71bd66ff651..a21d5693a6a 100644 --- a/source/blender/editors/interface/interface_template_asset_view.cc +++ b/source/blender/editors/interface/interface_template_asset_view.cc @@ -188,8 +188,8 @@ static void populate_asset_collection(const AssetLibraryReference &asset_library RNA_warning("Expected a collection property"); return; } - if (!RNA_struct_is_a(RNA_property_pointer_type(&assets_dataptr, assets_prop), - &RNA_AssetHandle)) { + if (!RNA_struct_is_a(RNA_property_pointer_type(&assets_dataptr, assets_prop), &RNA_AssetHandle)) + { RNA_warning("Expected a collection property for AssetHandle items"); return; } diff --git a/source/blender/editors/interface/interface_template_list.cc b/source/blender/editors/interface/interface_template_list.cc index 28ffee73ca3..01b573fee2a 100644 --- a/source/blender/editors/interface/interface_template_list.cc +++ b/source/blender/editors/interface/interface_template_list.cc @@ -432,7 +432,8 @@ static void ui_template_list_collect_items(PointerRNA *list_ptr, RNA_PROP_BEGIN (list_ptr, itemptr, list_prop) { if (!dyn_data->items_filter_flags || - ((dyn_data->items_filter_flags[i] & UILST_FLT_ITEM) ^ filter_exclude)) { + ((dyn_data->items_filter_flags[i] & UILST_FLT_ITEM) ^ filter_exclude)) + { int new_order_idx; if (dyn_data->items_filter_neworder) { new_order_idx = dyn_data->items_filter_neworder[reorder_i++]; @@ -838,7 +839,8 @@ static void ui_template_list_layout_draw(const bContext *C, row = uiLayoutRow(layout, true); if ((input_data->dataptr.data && input_data->prop) && (dyn_data->items_shown > 0) && - (items->active_item_idx >= 0) && (items->active_item_idx < dyn_data->items_shown)) { + (items->active_item_idx >= 0) && (items->active_item_idx < dyn_data->items_shown)) + { PointerRNA *itemptr = &items->item_vec[items->active_item_idx].item; const int org_i = items->item_vec[items->active_item_idx].org_idx; @@ -1229,7 +1231,8 @@ uiList *uiTemplateList_ex(uiLayout *layout, active_propname, item_dyntip_propname, &input_data, - &ui_list_type)) { + &ui_list_type)) + { return nullptr; } diff --git a/source/blender/editors/interface/interface_template_search_menu.cc b/source/blender/editors/interface/interface_template_search_menu.cc index 547811ef1f8..a04c1cbfa18 100644 --- a/source/blender/editors/interface/interface_template_search_menu.cc +++ b/source/blender/editors/interface/interface_template_search_menu.cc @@ -197,7 +197,8 @@ static bool menu_items_from_ui_create_item_from_button(MenuSearch_Data *data, &but->rnapoin, but->rnaprop, value_enum, - &enum_item)) { + &enum_item)) + { drawstr_override = enum_item.name; } else { @@ -378,8 +379,8 @@ static void menu_items_from_all_operators(bContext *C, MenuSearch_Data *data) MemArena *memarena = data->memarena; GHashIterator iter; - for (WM_operatortype_iter(&iter); !BLI_ghashIterator_done(&iter); - BLI_ghashIterator_step(&iter)) { + for (WM_operatortype_iter(&iter); !BLI_ghashIterator_done(&iter); BLI_ghashIterator_step(&iter)) + { wmOperatorType *ot = (wmOperatorType *)BLI_ghashIterator_getValue(&iter); if ((ot->flag & OPTYPE_INTERNAL) && (G.debug & G_DEBUG_WM) == 0) { @@ -562,7 +563,8 @@ static MenuSearch_Data *menu_items_from_ui_create( GHashIterator iter; for (int space_type_ui_index = -1; space_type_ui_index < space_type_ui_items_len; - space_type_ui_index += 1) { + space_type_ui_index += 1) + { ScrArea *area = nullptr; ARegion *region = nullptr; diff --git a/source/blender/editors/interface/interface_template_search_operator.cc b/source/blender/editors/interface/interface_template_search_operator.cc index 3e28461e0f6..6ceb419291d 100644 --- a/source/blender/editors/interface/interface_template_search_operator.cc +++ b/source/blender/editors/interface/interface_template_search_operator.cc @@ -58,8 +58,8 @@ static void operator_search_update_fn(const bContext *C, const int words_len = BLI_string_find_split_words( str, str_len, ' ', (int(*)[2])words.data(), words_max); - for (WM_operatortype_iter(&iter); !BLI_ghashIterator_done(&iter); - BLI_ghashIterator_step(&iter)) { + for (WM_operatortype_iter(&iter); !BLI_ghashIterator_done(&iter); BLI_ghashIterator_step(&iter)) + { wmOperatorType *ot = static_cast(BLI_ghashIterator_getValue(&iter)); const char *ot_ui_name = CTX_IFACE_(ot->translation_context, ot->name); @@ -83,7 +83,8 @@ static void operator_search_update_fn(const bContext *C, nullptr, true, &name[len + 1], - sizeof(name) - len - 1)) { + sizeof(name) - len - 1)) + { name[len] = UI_SEP_CHAR; } } diff --git a/source/blender/editors/interface/interface_templates.cc b/source/blender/editors/interface/interface_templates.cc index 2b5365420c4..200d7e3269b 100644 --- a/source/blender/editors/interface/interface_templates.cc +++ b/source/blender/editors/interface/interface_templates.cc @@ -399,7 +399,8 @@ static bool id_search_add(const bContext *C, TemplateID *template_ui, uiSearchIt id, iconid, has_sep_char ? int(UI_BUT_HAS_SEP_CHAR) : 0, - name_prefix_offset)) { + name_prefix_offset)) + { return false; } @@ -605,7 +606,8 @@ static void template_id_liboverride_hierarchy_collection_root_find_recursive( } for (CollectionParent *iter = static_cast(collection->runtime.parents.first); iter != nullptr; - iter = iter->next) { + iter = iter->next) + { if (iter->collection->id.lib != collection->id.lib && ID_IS_LINKED(iter->collection)) { continue; } @@ -625,7 +627,8 @@ static void template_id_liboverride_hierarchy_collections_tag_recursive( for (CollectionParent *iter = static_cast(root_collection->runtime.parents.first); iter != nullptr; - iter = iter->next) { + iter = iter->next) + { if (ID_IS_LINKED(iter->collection)) { continue; } @@ -635,7 +638,8 @@ static void template_id_liboverride_hierarchy_collections_tag_recursive( for (CollectionChild *iter = static_cast(root_collection->children.first); iter != nullptr; - iter = iter->next) { + iter = iter->next) + { if (iter->collection->id.lib != root_collection->id.lib && ID_IS_LINKED(root_collection)) { continue; } @@ -643,11 +647,13 @@ static void template_id_liboverride_hierarchy_collections_tag_recursive( continue; } if (GS(target_id->name) == ID_OB && - !BKE_collection_has_object_recursive(iter->collection, (Object *)target_id)) { + !BKE_collection_has_object_recursive(iter->collection, (Object *)target_id)) + { continue; } if (GS(target_id->name) == ID_GR && - !BKE_collection_has_collection(iter->collection, (Collection *)target_id)) { + !BKE_collection_has_collection(iter->collection, (Collection *)target_id)) + { continue; } template_id_liboverride_hierarchy_collections_tag_recursive( @@ -698,8 +704,8 @@ ID *ui_template_id_liboverride_hierarchy_make( } if (object_active != nullptr) { if (ID_IS_LINKED(object_active)) { - if (object_active->id.lib != id->lib || - !ID_IS_OVERRIDABLE_LIBRARY_HIERARCHY(object_active)) { + if (object_active->id.lib != id->lib || !ID_IS_OVERRIDABLE_LIBRARY_HIERARCHY(object_active)) + { /* The active object is from a different library than the overridden ID, or otherwise * cannot be used in hierarchy. */ object_active = nullptr; @@ -718,7 +724,8 @@ ID *ui_template_id_liboverride_hierarchy_make( if (collection_active != nullptr) { if (ID_IS_LINKED(collection_active)) { if (collection_active->id.lib != id->lib || - !ID_IS_OVERRIDABLE_LIBRARY_HIERARCHY(collection_active)) { + !ID_IS_OVERRIDABLE_LIBRARY_HIERARCHY(collection_active)) + { /* The active collection is from a different library than the overridden ID, or otherwise * cannot be used in hierarchy. */ collection_active = nullptr; @@ -737,7 +744,8 @@ ID *ui_template_id_liboverride_hierarchy_make( } } if (collection_active == nullptr && object_active != nullptr && - (ID_IS_LINKED(object_active) || ID_IS_OVERRIDE_LIBRARY_REAL(object_active))) { + (ID_IS_LINKED(object_active) || ID_IS_OVERRIDE_LIBRARY_REAL(object_active))) + { /* If we failed to find a valid 'active' collection so far for our override hierarchy, but do * have a valid 'active' object, try to find a collection from that object. */ LISTBASE_FOREACH (Collection *, collection_iter, &bmain->collections) { @@ -762,7 +770,8 @@ ID *ui_template_id_liboverride_hierarchy_make( switch (GS(id->name)) { case ID_GR: if (collection_active != nullptr && - BKE_collection_has_collection(collection_active, (Collection *)id)) { + BKE_collection_has_collection(collection_active, (Collection *)id)) + { template_id_liboverride_hierarchy_collections_tag_recursive(collection_active, id, true); if (object_active != nullptr) { object_active->id.tag |= LIB_TAG_DOIT; @@ -778,7 +787,8 @@ ID *ui_template_id_liboverride_hierarchy_make( false); } else if (object_active != nullptr && !ID_IS_LINKED(object_active) && - &object_active->instance_collection->id == id) { + &object_active->instance_collection->id == id) + { object_active->id.tag |= LIB_TAG_DOIT; BKE_lib_override_library_create(bmain, scene, @@ -793,7 +803,8 @@ ID *ui_template_id_liboverride_hierarchy_make( break; case ID_OB: if (collection_active != nullptr && - BKE_collection_has_object_recursive(collection_active, (Object *)id)) { + BKE_collection_has_object_recursive(collection_active, (Object *)id)) + { template_id_liboverride_hierarchy_collections_tag_recursive(collection_active, id, true); if (object_active != nullptr) { object_active->id.tag |= LIB_TAG_DOIT; @@ -833,7 +844,8 @@ ID *ui_template_id_liboverride_hierarchy_make( case ID_NT: /* Essentially geometry nodes from modifier currently. */ if (object_active != nullptr) { if (collection_active != nullptr && - BKE_collection_has_object_recursive(collection_active, object_active)) { + BKE_collection_has_object_recursive(collection_active, object_active)) + { template_id_liboverride_hierarchy_collections_tag_recursive(collection_active, id, true); if (object_active != nullptr) { object_active->id.tag |= LIB_TAG_DOIT; @@ -1445,7 +1457,8 @@ static void template_ID(const bContext *C, but, template_id_cb, MEM_dupallocN(template_ui), POINTER_FROM_INT(UI_ID_ALONE)); if (!BKE_id_copy_is_allowed(id) || (idfrom && idfrom->lib) || (!editable) || /* object in editmode - don't change data */ - (idfrom && GS(idfrom->name) == ID_OB && (((Object *)idfrom)->mode & OB_MODE_EDIT))) { + (idfrom && GS(idfrom->name) == ID_OB && (((Object *)idfrom)->mode & OB_MODE_EDIT))) + { UI_but_flag_enable(but, UI_BUT_DISABLED); } } @@ -1470,8 +1483,8 @@ static void template_ID(const bContext *C, UI_UNIT_Y, nullptr); } - else if (!ELEM(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_OB, ID_WS) && - (hide_buttons == false)) { + else if (!ELEM(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_OB, ID_WS) && (hide_buttons == false)) + { uiDefIconButR(block, UI_BTYPE_ICON_TOGGLE, 0, @@ -2152,7 +2165,8 @@ static PropertyRNA *template_search_get_searchprop(PointerRNA *targetptr, } /* check if searchprop has same type as targetprop */ else if (RNA_property_pointer_type(searchptr, searchprop) != - RNA_property_pointer_type(targetptr, targetprop)) { + RNA_property_pointer_type(targetptr, targetprop)) + { RNA_warning("search collection items from %s.%s are not of type %s", RNA_struct_identifier(searchptr->type), searchpropname, @@ -2447,7 +2461,8 @@ void uiTemplateConstraints(uiLayout * /*layout*/, bContext *C, bool use_bone_con for (bConstraint *con = (constraints == nullptr) ? nullptr : static_cast(constraints->first); con; - con = con->next) { + con = con->next) + { /* Don't show invalid/legacy constraints. */ if (con->type == CONSTRAINT_TYPE_NULL) { continue; @@ -2538,7 +2553,8 @@ void uiTemplateGpencilModifiers(uiLayout * /*layout*/, bContext *C) if (!panels_match) { UI_panels_free_instanced(C, region); for (GpencilModifierData *md = static_cast(modifiers->first); md; - md = md->next) { + md = md->next) + { const GpencilModifierTypeInfo *mti = BKE_gpencil_modifier_get_info( GpencilModifierType(md->type)); if (mti->panelRegister == nullptr) { @@ -2674,7 +2690,8 @@ static bool ui_layout_operator_buts_poll_property(PointerRNA * /*ptr*/, user_data); if ((params->flag & UI_TEMPLATE_OP_PROPS_HIDE_ADVANCED) && - (RNA_property_tags(prop) & OP_PROP_TAG_ADVANCED)) { + (RNA_property_tags(prop) & OP_PROP_TAG_ADVANCED)) + { return false; } return params->op->type->poll_property(params->C, params->op, prop); @@ -6193,7 +6210,8 @@ void uiTemplateRunningJobs(uiLayout *layout, bContext *C) break; } if (WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_BAKE_TEXTURE) || - WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_BAKE)) { + WM_jobs_test(wm, scene, WM_JOB_TYPE_OBJECT_BAKE)) + { /* Skip bake jobs in compositor to avoid compo header displaying * progress bar which is not being updated (bake jobs only need * to update NC_IMAGE context. diff --git a/source/blender/editors/interface/interface_utils.cc b/source/blender/editors/interface/interface_utils.cc index c6b6db261d7..bbb726811d3 100644 --- a/source/blender/editors/interface/interface_utils.cc +++ b/source/blender/editors/interface/interface_utils.cc @@ -148,7 +148,8 @@ uiBut *uiDefAutoButR(uiBlock *block, } } else if (RNA_property_subtype(prop) == PROP_PERCENTAGE || - RNA_property_subtype(prop) == PROP_FACTOR) { + RNA_property_subtype(prop) == PROP_FACTOR) + { but = uiDefButR_prop(block, UI_BTYPE_NUM_SLIDER, 0, @@ -1116,8 +1117,9 @@ static bool ui_key_event_property_match(const char *opname, bool match = false; if (properties) { - if (ui_opptr && IDP_EqualsProperties_ex( - properties, static_cast(ui_opptr->data), is_strict)) { + if (ui_opptr && + IDP_EqualsProperties_ex(properties, static_cast(ui_opptr->data), is_strict)) + { match = true; } } @@ -1175,7 +1177,8 @@ const char *UI_key_event_operator_string(const bContext *C, properties, is_strict, dyn_data->custom_activate_optype, - dyn_data->custom_activate_opptr)) { + dyn_data->custom_activate_opptr)) + { event_val = KM_CLICK; event_type = LEFTMOUSE; } @@ -1184,7 +1187,8 @@ const char *UI_key_event_operator_string(const bContext *C, properties, is_strict, dyn_data->custom_drag_optype, - dyn_data->custom_drag_opptr)) { + dyn_data->custom_drag_opptr)) + { event_val = KM_CLICK_DRAG; event_type = LEFTMOUSE; } diff --git a/source/blender/editors/interface/interface_widgets.cc b/source/blender/editors/interface/interface_widgets.cc index ca2834be58b..7bb662845aa 100644 --- a/source/blender/editors/interface/interface_widgets.cc +++ b/source/blender/editors/interface/interface_widgets.cc @@ -1273,7 +1273,8 @@ static void widgetbase_draw_ex(uiWidgetBase *wtb, /* Draw everything in one draw-call. */ if (inner_col1[3] || inner_col2[3] || outline_col[3] || emboss_col[3] || tria_col[3] || - show_alpha_checkers) { + show_alpha_checkers) + { widgetbase_set_uniform_colors_ubv( wtb, inner_col1, inner_col2, outline_col, emboss_col, tria_col, show_alpha_checkers); @@ -1391,7 +1392,8 @@ static void widget_draw_icon( if (but->drawflag & UI_BUT_ICON_LEFT) { /* special case - icon_only pie buttons */ if (ui_block_is_pie_menu(but->block) && !ELEM(but->type, UI_BTYPE_MENU, UI_BTYPE_POPOVER) && - but->str && but->str[0] == '\0') { + but->str && but->str[0] == '\0') + { xs = rect->xmin + 2.0f * ofs; } else if (but->emboss == UI_EMBOSS_NONE || but->type == UI_BTYPE_LABEL) { @@ -2070,7 +2072,8 @@ static void widget_draw_text(const uiFontStyle *fstyle, if (!drawstr_right && (but->drawflag & UI_BUT_TEXT_LEFT) && ELEM(but->type, UI_BTYPE_NUM, UI_BTYPE_NUM_SLIDER) && /* if we're editing or multi-drag (fake editing), then use left alignment */ - (but->editstr == nullptr) && (drawstr == but->drawstr)) { + (but->editstr == nullptr) && (drawstr == but->drawstr)) + { drawstr_right = strrchr(drawstr + but->ofs, ':'); if (drawstr_right) { drawstr_right++; @@ -2128,7 +2131,8 @@ static void widget_draw_text(const uiFontStyle *fstyle, if (ul_index != -1) { rcti bounds; if (BLF_str_offset_to_glyph_bounds(fstyle->uifont_id, drawstr_ofs, ul_index, &bounds) && - !BLI_rcti_is_empty(&bounds)) { + !BLI_rcti_is_empty(&bounds)) + { int ul_width = round_fl_to_int(BLF_width(fstyle->uifont_id, "_", 2)); int pos_x = rect->xmin + font_xofs + bounds.xmin + (bounds.xmax - bounds.xmin - ul_width) / 2; @@ -2371,8 +2375,8 @@ static void widget_draw_text_icon(const uiFontStyle *fstyle, /* Menu contains sub-menu items with triangle icon on their right. Shortcut * strings should be drawn with some padding to the right then. */ - if (ui_block_is_menu(but->block) && - (but->block->content_hints & UI_BLOCK_CONTAINS_SUBMENU_BUT)) { + if (ui_block_is_menu(but->block) && (but->block->content_hints & UI_BLOCK_CONTAINS_SUBMENU_BUT)) + { rect->xmax -= UI_MENU_SUBMENU_PADDING; } @@ -3841,7 +3845,8 @@ static void widget_swatch(uiBut *but, if ((state->but_flag & (UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN | UI_BUT_OVERRIDDEN | UI_BUT_REDALERT)) || - (state->but_drawflag & UI_BUT_ANIMATED_CHANGED)) { + (state->but_drawflag & UI_BUT_ANIMATED_CHANGED)) + { /* draw based on state - color for keyed etc */ widgetbase_draw(&wtb, wcol); @@ -3871,7 +3876,8 @@ static void widget_swatch(uiBut *but, widgetbase_draw_ex(&wtb, wcol, show_alpha_checkers); if (color_but->is_pallete_color && - ((Palette *)but->rnapoin.owner_id)->active_color == color_but->palette_color_index) { + ((Palette *)but->rnapoin.owner_id)->active_color == color_but->palette_color_index) + { const float width = rect->xmax - rect->xmin; const float height = rect->ymax - rect->ymin; /* find color luminance and change it slightly */ @@ -3919,7 +3925,8 @@ static void widget_icon_has_anim(uiBut *but, { if (state->but_flag & (UI_BUT_ANIMATED | UI_BUT_ANIMATED_KEY | UI_BUT_DRIVEN | UI_BUT_REDALERT) && - but->emboss != UI_EMBOSS_NONE) { + but->emboss != UI_EMBOSS_NONE) + { uiWidgetBase wtb; widget_init(&wtb); wtb.draw_outline = false; @@ -4796,7 +4803,8 @@ void ui_draw_but(const bContext *C, ARegion *region, uiStyle *style, uiBut *but, * add up/down arrows if there is room. */ if ((!but->str[0] && but->icon && (BLI_rcti_size_x(rect) < BLI_rcti_size_y(rect) + 2)) || /* disable for brushes also */ - (but->flag & UI_BUT_ICON_PREVIEW)) { + (but->flag & UI_BUT_ICON_PREVIEW)) + { /* no arrows */ wt = widget_type(UI_WTYPE_MENU_ICON_RADIO); } diff --git a/source/blender/editors/interface/resources.cc b/source/blender/editors/interface/resources.cc index 6a2e2ff9073..30eae24505c 100644 --- a/source/blender/editors/interface/resources.cc +++ b/source/blender/editors/interface/resources.cc @@ -1404,8 +1404,8 @@ bool UI_GetIconThemeColor4ubv(int colorid, uchar col[4]) g_theme_state.regionid == RGN_TYPE_WINDOW) || (g_theme_state.spacetype == SPACE_PROPERTIES && g_theme_state.regionid == RGN_TYPE_NAV_BAR) || - (g_theme_state.spacetype == SPACE_FILE && - g_theme_state.regionid == RGN_TYPE_WINDOW))) { + (g_theme_state.spacetype == SPACE_FILE && g_theme_state.regionid == RGN_TYPE_WINDOW))) + { /* Only colored icons in specific places, overall UI is intended * to stay monochrome and out of the way except a few places where it * is important to communicate different data types. */ diff --git a/source/blender/editors/interface/view2d.cc b/source/blender/editors/interface/view2d.cc index 1c551d0b525..5fae557b100 100644 --- a/source/blender/editors/interface/view2d.cc +++ b/source/blender/editors/interface/view2d.cc @@ -1559,7 +1559,8 @@ void UI_view2d_scrollers_draw_ex(View2D *v2d, const rcti *mask_custom, bool use_ * and only the time-grids with their zoom-ability can do so). */ if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0 && (v2d->scroll & V2D_SCROLL_HORIZONTAL_HANDLES) && - (BLI_rcti_size_x(&slider) > V2D_SCROLL_HANDLE_SIZE_HOTSPOT)) { + (BLI_rcti_size_x(&slider) > V2D_SCROLL_HANDLE_SIZE_HOTSPOT)) + { state |= UI_SCROLL_ARROWS; } @@ -1594,7 +1595,8 @@ void UI_view2d_scrollers_draw_ex(View2D *v2d, const rcti *mask_custom, bool use_ * and only the time-grids with their zoomability can do so) */ if ((v2d->keepzoom & V2D_LOCKZOOM_Y) == 0 && (v2d->scroll & V2D_SCROLL_VERTICAL_HANDLES) && - (BLI_rcti_size_y(&slider) > V2D_SCROLL_HANDLE_SIZE_HOTSPOT)) { + (BLI_rcti_size_y(&slider) > V2D_SCROLL_HANDLE_SIZE_HOTSPOT)) + { state |= UI_SCROLL_ARROWS; } @@ -1827,7 +1829,8 @@ bool UI_view2d_view_to_region_rcti_clip(const View2D *v2d, const rctf *rect_src, rect_tmp.ymax = (rect_src->ymax - v2d->cur.ymin) / cur_size[1]; if (((rect_tmp.xmax < 0.0f) || (rect_tmp.xmin > 1.0f) || (rect_tmp.ymax < 0.0f) || - (rect_tmp.ymin > 1.0f)) == 0) { + (rect_tmp.ymin > 1.0f)) == 0) + { /* Step 2: convert proportional distances to screen coordinates. */ rect_tmp.xmin = v2d->mask.xmin + (rect_tmp.xmin * mask_size[0]); rect_tmp.xmax = v2d->mask.ymin + (rect_tmp.xmax * mask_size[0]); diff --git a/source/blender/editors/interface/view2d_gizmo_navigate.cc b/source/blender/editors/interface/view2d_gizmo_navigate.cc index 9e7a62e140e..9074f6ab62c 100644 --- a/source/blender/editors/interface/view2d_gizmo_navigate.cc +++ b/source/blender/editors/interface/view2d_gizmo_navigate.cc @@ -214,7 +214,8 @@ static void WIDGETGROUP_navigate_draw_prepare(const bContext *C, wmGizmoGroup *g const rcti *rect_visible = ED_region_visible_rect(region); if ((navgroup->state.rect_visible.xmax == rect_visible->xmax) && - (navgroup->state.rect_visible.ymax == rect_visible->ymax)) { + (navgroup->state.rect_visible.ymax == rect_visible->ymax)) + { return; } diff --git a/source/blender/editors/interface/view2d_ops.cc b/source/blender/editors/interface/view2d_ops.cc index ac24bda1d19..49a5b139663 100644 --- a/source/blender/editors/interface/view2d_ops.cc +++ b/source/blender/editors/interface/view2d_ops.cc @@ -1244,7 +1244,8 @@ static int view_zoomdrag_modal(bContext *C, wmOperator *op, const wmEvent *event /* Only respect user setting zoom axis if the view does not have any zoom restrictions * any will be scaled uniformly */ if ((v2d->keepzoom & V2D_LOCKZOOM_X) == 0 && (v2d->keepzoom & V2D_LOCKZOOM_Y) == 0 && - (v2d->keepzoom & V2D_KEEPASPECT)) { + (v2d->keepzoom & V2D_KEEPASPECT)) + { if (U.uiflag & USER_ZOOM_HORIZ) { facy = 0.0f; } @@ -2120,7 +2121,8 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, const wmEvent * */ if (ELEM(vsm->zone, SCROLLHANDLE_MIN, SCROLLHANDLE_MAX)) { if (((vsm->scroller == 'h') && (v2d->scroll & V2D_SCROLL_HORIZONTAL_HANDLES) == 0) || - ((vsm->scroller == 'v') && (v2d->scroll & V2D_SCROLL_VERTICAL_HANDLES) == 0)) { + ((vsm->scroller == 'v') && (v2d->scroll & V2D_SCROLL_VERTICAL_HANDLES) == 0)) + { /* switch to bar (i.e. no scaling gets handled) */ vsm->zone = SCROLLHANDLE_BAR; } @@ -2129,7 +2131,8 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, const wmEvent * /* check if zone is inappropriate (i.e. 'bar' but panning is banned), so cannot continue */ if (vsm->zone == SCROLLHANDLE_BAR) { if (((vsm->scroller == 'h') && (v2d->keepofs & V2D_LOCKOFS_X)) || - ((vsm->scroller == 'v') && (v2d->keepofs & V2D_LOCKOFS_Y))) { + ((vsm->scroller == 'v') && (v2d->keepofs & V2D_LOCKOFS_Y))) + { /* free customdata initialized */ scroller_activate_exit(C, op); @@ -2140,7 +2143,8 @@ static int scroller_activate_invoke(bContext *C, wmOperator *op, const wmEvent * /* zone is also inappropriate if scroller is not visible... */ if (((vsm->scroller == 'h') && (v2d->scroll & V2D_SCROLL_HORIZONTAL_FULLR)) || - ((vsm->scroller == 'v') && (v2d->scroll & V2D_SCROLL_VERTICAL_FULLR))) { + ((vsm->scroller == 'v') && (v2d->scroll & V2D_SCROLL_VERTICAL_FULLR))) + { /* free customdata initialized */ scroller_activate_exit(C, op); diff --git a/source/blender/editors/interface/views/grid_view.cc b/source/blender/editors/interface/views/grid_view.cc index 37d7ffef499..8b0c42e2bda 100644 --- a/source/blender/editors/interface/views/grid_view.cc +++ b/source/blender/editors/interface/views/grid_view.cc @@ -368,7 +368,8 @@ void GridViewLayoutBuilder::build_from_view(const AbstractGridView &grid_view, * stretch over the entire width. */ if (grid_view.get_item_count() < cols_per_row) { for (int padding_item_idx = 0; padding_item_idx < (cols_per_row - grid_view.get_item_count()); - padding_item_idx++) { + padding_item_idx++) + { uiItemS(grid_layout); } } diff --git a/source/blender/editors/interface/views/interface_view.cc b/source/blender/editors/interface/views/interface_view.cc index 2e62c7d425b..4c6fd59361a 100644 --- a/source/blender/editors/interface/views/interface_view.cc +++ b/source/blender/editors/interface/views/interface_view.cc @@ -293,7 +293,8 @@ uiButViewItem *ui_block_view_find_matching_view_item_but_in_old_block( } if (UI_view_item_matches(reinterpret_cast(&new_item), - reinterpret_cast(&old_item))) { + reinterpret_cast(&old_item))) + { return old_item_but; } } diff --git a/source/blender/editors/interface/views/tree_view.cc b/source/blender/editors/interface/views/tree_view.cc index 9732c23a519..1027fd6d37e 100644 --- a/source/blender/editors/interface/views/tree_view.cc +++ b/source/blender/editors/interface/views/tree_view.cc @@ -372,7 +372,8 @@ bool AbstractTreeViewItem::matches(const AbstractViewItem &other) const for (AbstractTreeViewItem *parent = parent_, *other_parent = other_tree_item.parent_; parent && other_parent; - parent = parent->parent_, other_parent = other_parent->parent_) { + parent = parent->parent_, other_parent = other_parent->parent_) + { if (!parent->matches_single(*other_parent)) { return false; } @@ -437,7 +438,8 @@ void TreeViewLayoutBuilder::polish_layout(const uiBlock &block) LISTBASE_FOREACH_BACKWARD (uiBut *, but, &block.buttons) { if (AbstractTreeViewItem::is_collapse_chevron_but(but) && but->next && /* Embossed buttons with padding-less text padding look weird, so don't touch them. */ - ELEM(but->next->emboss, UI_EMBOSS_NONE, UI_EMBOSS_NONE_OR_STATUS)) { + ELEM(but->next->emboss, UI_EMBOSS_NONE, UI_EMBOSS_NONE_OR_STATUS)) + { UI_but_drawflag_enable(static_cast(but->next), UI_BUT_NO_TEXT_PADDING); } diff --git a/source/blender/editors/io/io_gpencil_import.c b/source/blender/editors/io/io_gpencil_import.c index 91c719849cc..4ecd3782361 100644 --- a/source/blender/editors/io/io_gpencil_import.c +++ b/source/blender/editors/io/io_gpencil_import.c @@ -66,7 +66,8 @@ static int wm_gpencil_import_svg_exec(bContext *C, wmOperator *op) Scene *scene = CTX_data_scene(C); if (!RNA_struct_property_is_set_ex(op->ptr, "filepath", false) || - !RNA_struct_find_property(op->ptr, "directory")) { + !RNA_struct_find_property(op->ptr, "directory")) + { BKE_report(op->reports, RPT_ERROR, "No filename given"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/io/io_stl_ops.c b/source/blender/editors/io/io_stl_ops.c index bbdb494e48a..558bd55a7fe 100644 --- a/source/blender/editors/io/io_stl_ops.c +++ b/source/blender/editors/io/io_stl_ops.c @@ -76,7 +76,8 @@ static bool wm_stl_import_check(bContext *UNUSED(C), wmOperator *op) const int num_axes = 3; /* Both forward and up axes cannot be the same (or same except opposite sign). */ if (RNA_enum_get(op->ptr, "forward_axis") % num_axes == - (RNA_enum_get(op->ptr, "up_axis") % num_axes)) { + (RNA_enum_get(op->ptr, "up_axis") % num_axes)) + { RNA_enum_set(op->ptr, "up_axis", RNA_enum_get(op->ptr, "up_axis") % num_axes + 1); return true; } diff --git a/source/blender/editors/lattice/editlattice_select.c b/source/blender/editors/lattice/editlattice_select.c index 22a9d41fcf7..37e51277939 100644 --- a/source/blender/editors/lattice/editlattice_select.c +++ b/source/blender/editors/lattice/editlattice_select.c @@ -303,7 +303,8 @@ static int lattice_select_more_less(bContext *C, const bool select) lattice_test_bitmap_uvw(lt, selpoints, u, v + 1, w, select) || lattice_test_bitmap_uvw(lt, selpoints, u, v - 1, w, select) || lattice_test_bitmap_uvw(lt, selpoints, u, v, w + 1, select) || - lattice_test_bitmap_uvw(lt, selpoints, u, v, w - 1, select)) { + lattice_test_bitmap_uvw(lt, selpoints, u, v, w - 1, select)) + { SET_FLAG_FROM_TEST(bp->f1, select, SELECT); } } diff --git a/source/blender/editors/mask/mask_add.c b/source/blender/editors/mask/mask_add.c index 58767877750..fda54e1bbb4 100644 --- a/source/blender/editors/mask/mask_add.c +++ b/source/blender/editors/mask/mask_add.c @@ -256,7 +256,8 @@ static bool add_vertex_subdivide(const bContext *C, Mask *mask, const float co[2 &spline, &point, &u, - NULL)) { + NULL)) + { Scene *scene = CTX_data_scene(C); const float ctime = scene->r.cfra; @@ -320,7 +321,8 @@ static bool add_vertex_extrude(const bContext *C, MASKPOINT_DESEL_ALL(point); if ((spline->flag & MASK_SPLINE_CYCLIC) || - (point_index > 0 && point_index != spline->tot_point - 1)) { + (point_index > 0 && point_index != spline->tot_point - 1)) + { BKE_mask_calc_tangent_polyline(spline, point, tangent_point); sub_v2_v2v2(tangent_co, co, point->bezt.vec[1]); @@ -530,7 +532,8 @@ static int add_vertex_exec(bContext *C, wmOperator *op) /* TODO: having an active point but no active spline is possible, why? */ if (mask_layer && mask_layer->act_spline && mask_layer->act_point && - MASKPOINT_ISSEL_ANY(mask_layer->act_point)) { + MASKPOINT_ISSEL_ANY(mask_layer->act_point)) + { MaskSpline *spline = mask_layer->act_spline; MaskSplinePoint *active_point = mask_layer->act_point; const int cyclic_result = add_vertex_handle_cyclic(C, mask, spline, active_point, co); @@ -623,19 +626,9 @@ static int add_feather_vertex_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } - if (ED_mask_find_nearest_diff_point(C, - mask, - co, - threshold, - true, - NULL, - true, - true, - &mask_layer, - &spline, - &point, - &u, - NULL)) { + if (ED_mask_find_nearest_diff_point( + C, mask, co, threshold, true, NULL, true, true, &mask_layer, &spline, &point, &u, NULL)) + { float w = BKE_mask_point_weight(spline, point, u); float weight_scalar = BKE_mask_point_weight_scalar(spline, point, u); diff --git a/source/blender/editors/mask/mask_draw.c b/source/blender/editors/mask/mask_draw.c index 8e9384cd2d9..fbd89e54634 100644 --- a/source/blender/editors/mask/mask_draw.c +++ b/source/blender/editors/mask/mask_draw.c @@ -600,7 +600,8 @@ static void draw_mask_layers( MaskLayer *active = NULL; for (mask_layer = mask->masklayers.first, i = 0; mask_layer != NULL; - mask_layer = mask_layer->next, i++) { + mask_layer = mask_layer->next, i++) + { const bool is_active = (i == mask->masklay_act); if (mask_layer->visibility_flag & MASK_HIDE_VIEW) { @@ -800,7 +801,8 @@ void ED_mask_draw_frames( for (MaskLayerShape *mask_layer_shape = mask_layer->splines_shapes.first; mask_layer_shape != NULL; - mask_layer_shape = mask_layer_shape->next) { + mask_layer_shape = mask_layer_shape->next) + { int frame = mask_layer_shape->frame; // draw_keyframe(i, scene->r.cfra, sfra, framelen, 1); diff --git a/source/blender/editors/mask/mask_editaction.c b/source/blender/editors/mask/mask_editaction.c index 8ec6c356fd7..45107a8a248 100644 --- a/source/blender/editors/mask/mask_editaction.c +++ b/source/blender/editors/mask/mask_editaction.c @@ -49,7 +49,8 @@ bool ED_masklayer_frames_looper(MaskLayer *mask_layer, /* do loop */ for (mask_layer_shape = mask_layer->splines_shapes.first; mask_layer_shape; - mask_layer_shape = mask_layer_shape->next) { + mask_layer_shape = mask_layer_shape->next) + { /* execute callback */ if (mask_layer_shape_cb(mask_layer_shape, scene)) { return true; @@ -75,7 +76,8 @@ void ED_masklayer_make_cfra_list(MaskLayer *mask_layer, ListBase *elems, bool on /* loop through mask-frames, adding */ for (mask_layer_shape = mask_layer->splines_shapes.first; mask_layer_shape; - mask_layer_shape = mask_layer_shape->next) { + mask_layer_shape = mask_layer_shape->next) + { if ((onlysel == false) || (mask_layer_shape->flag & MASK_SHAPE_SELECT)) { ce = MEM_callocN(sizeof(CfraElem), "CfraElem"); @@ -101,7 +103,8 @@ bool ED_masklayer_frame_select_check(const MaskLayer *mask_layer) /* stop at the first one found */ for (mask_layer_shape = mask_layer->splines_shapes.first; mask_layer_shape; - mask_layer_shape = mask_layer_shape->next) { + mask_layer_shape = mask_layer_shape->next) + { if (mask_layer_shape->flag & MASK_SHAPE_SELECT) { return true; } @@ -142,7 +145,8 @@ void ED_mask_select_frames(MaskLayer *mask_layer, short select_mode) /* handle according to mode */ for (mask_layer_shape = mask_layer->splines_shapes.first; mask_layer_shape; - mask_layer_shape = mask_layer_shape->next) { + mask_layer_shape = mask_layer_shape->next) + { mask_layer_shape_select(mask_layer_shape, select_mode); } } @@ -183,7 +187,8 @@ void ED_masklayer_frames_select_box(MaskLayer *mask_layer, float min, float max, /* only select those frames which are in bounds */ for (mask_layer_shape = mask_layer->splines_shapes.first; mask_layer_shape; - mask_layer_shape = mask_layer_shape->next) { + mask_layer_shape = mask_layer_shape->next) + { if (IN_RANGE(mask_layer_shape->frame, min, max)) { mask_layer_shape_select(mask_layer_shape, select_mode); } @@ -203,7 +208,8 @@ void ED_masklayer_frames_select_region(KeyframeEditData *ked, /* only select frames which are within the region */ for (mask_layer_shape = mask_layer->splines_shapes.first; mask_layer_shape; - mask_layer_shape = mask_layer_shape->next) { + mask_layer_shape = mask_layer_shape->next) + { /* construct a dummy point coordinate to do this testing with */ float pt[2] = {0}; @@ -241,7 +247,8 @@ bool ED_masklayer_frames_delete(MaskLayer *mask_layer) /* check for frames to delete */ for (mask_layer_shape = mask_layer->splines_shapes.first; mask_layer_shape; - mask_layer_shape = mask_layer_shape_next) { + mask_layer_shape = mask_layer_shape_next) + { mask_layer_shape_next = mask_layer_shape->next; if (mask_layer_shape->flag & MASK_SHAPE_SELECT) { @@ -264,7 +271,8 @@ void ED_masklayer_frames_duplicate(MaskLayer *mask_layer) /* Duplicate selected frames. */ for (mask_layer_shape = mask_layer->splines_shapes.first; mask_layer_shape; - mask_layer_shape = gpfn) { + mask_layer_shape = gpfn) + { gpfn = mask_layer_shape->next; /* Duplicate this frame. */ diff --git a/source/blender/editors/mask/mask_ops.c b/source/blender/editors/mask/mask_ops.c index 58b3b07e1be..485386e4dae 100644 --- a/source/blender/editors/mask/mask_ops.c +++ b/source/blender/editors/mask/mask_ops.c @@ -274,14 +274,16 @@ static bool spline_under_mouse_get(const bContext *C, for (MaskLayer *mask_layer_orig = mask_orig->masklayers.first, *mask_layer_eval = mask_eval->masklayers.first; mask_layer_orig != NULL; - mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) { + mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) + { if (mask_layer_orig->visibility_flag & (MASK_HIDE_VIEW | MASK_HIDE_SELECT)) { continue; } for (MaskSpline *spline_orig = mask_layer_orig->splines.first, *spline_eval = mask_layer_eval->splines.first; spline_orig != NULL; - spline_orig = spline_orig->next, spline_eval = spline_eval->next) { + spline_orig = spline_orig->next, spline_eval = spline_eval->next) + { if ((spline_orig->flag & SELECT) == 0) { continue; } @@ -308,7 +310,8 @@ static bool spline_under_mouse_get(const bContext *C, float dist_squared = len_squared_v2v2(pixel_co, center); float max_bb_side = min_ff((max[0] - min[0]) * width, (max[1] - min[1]) * height); if (dist_squared <= max_bb_side * max_bb_side * 0.5f && - (closest_spline == NULL || dist_squared < closest_dist_squared)) { + (closest_spline == NULL || dist_squared < closest_dist_squared)) + { closest_layer = mask_layer_orig; closest_spline = spline_orig; closest_dist_squared = dist_squared; @@ -329,7 +332,8 @@ static bool spline_under_mouse_get(const bContext *C, NULL, NULL, NULL, - &diff_score)) { + &diff_score)) + { if (square_f(diff_score) < closest_dist_squared) { return false; } @@ -444,7 +448,8 @@ static void *slide_point_customdata(bContext *C, wmOperator *op, const wmEvent * &feather_spline, &feather_point, &uw, - &feather_score)) { + &feather_score)) + { if (slide_feather || !cv_point || feather_score < cv_score) { action = SLIDE_ACTION_FEATHER; @@ -687,7 +692,8 @@ static int slide_point_modal(bContext *C, wmOperator *op, const wmEvent *event) if (data->is_sliding_new_point && data->which_handle == MASK_WHICH_HANDLE_STICK) { if (ELEM(data->point, &data->spline->points[0], - &data->spline->points[data->spline->tot_point - 1])) { + &data->spline->points[data->spline->tot_point - 1])) + { SWAP(float, delta[0], delta[1]); delta[1] *= -1; @@ -1004,7 +1010,8 @@ static SlideSplineCurvatureData *slide_spline_curvature_customdata(bContext *C, &spline, &point, &u, - NULL)) { + NULL)) + { return NULL; } diff --git a/source/blender/editors/mask/mask_query.c b/source/blender/editors/mask/mask_query.c index 720820df420..4a121dad1b9 100644 --- a/source/blender/editors/mask/mask_query.c +++ b/source/blender/editors/mask/mask_query.c @@ -70,7 +70,8 @@ bool ED_mask_find_nearest_diff_point(const bContext *C, for (MaskLayer *mask_layer_orig = mask_orig->masklayers.first, *mask_layer_eval = mask_eval->masklayers.first; mask_layer_orig != NULL; - mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) { + mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) + { if (mask_layer_orig->visibility_flag & (MASK_HIDE_VIEW | MASK_HIDE_SELECT)) { continue; } @@ -78,13 +79,15 @@ bool ED_mask_find_nearest_diff_point(const bContext *C, for (MaskSpline *spline_orig = mask_layer_orig->splines.first, *spline_eval = mask_layer_eval->splines.first; spline_orig != NULL; - spline_orig = spline_orig->next, spline_eval = spline_eval->next) { + spline_orig = spline_orig->next, spline_eval = spline_eval->next) + { int i; MaskSplinePoint *cur_point_eval; for (i = 0, cur_point_eval = use_deform ? spline_eval->points_deform : spline_eval->points; i < spline_eval->tot_point; - i++, cur_point_eval++) { + i++, cur_point_eval++) + { uint tot_diff_point; float *diff_points = BKE_mask_point_segment_diff( spline_eval, cur_point_eval, width, height, &tot_diff_point); @@ -229,7 +232,8 @@ MaskSplinePoint *ED_mask_point_find_nearest(const bContext *C, for (MaskLayer *mask_layer_orig = mask_orig->masklayers.first, *mask_layer_eval = mask_eval->masklayers.first; mask_layer_orig != NULL; - mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) { + mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) + { if (mask_layer_orig->visibility_flag & (MASK_HIDE_VIEW | MASK_HIDE_SELECT)) { continue; @@ -238,7 +242,8 @@ MaskSplinePoint *ED_mask_point_find_nearest(const bContext *C, for (MaskSpline *spline_orig = mask_layer_orig->splines.first, *spline_eval = mask_layer_eval->splines.first; spline_orig != NULL; - spline_orig = spline_orig->next, spline_eval = spline_eval->next) { + spline_orig = spline_orig->next, spline_eval = spline_eval->next) + { MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline_eval); for (int i = 0; i < spline_orig->tot_point; i++) { @@ -384,12 +389,14 @@ bool ED_mask_feather_find_nearest(const bContext *C, for (MaskLayer *mask_layer_orig = mask_orig->masklayers.first, *mask_layer_eval = mask_eval->masklayers.first; mask_layer_orig != NULL; - mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) { + mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) + { for (MaskSpline *spline_orig = mask_layer_orig->splines.first, *spline_eval = mask_layer_eval->splines.first; spline_orig != NULL; - spline_orig = spline_orig->next, spline_eval = spline_eval->next) { + spline_orig = spline_orig->next, spline_eval = spline_eval->next) + { // MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline); int i, tot_feather_point; @@ -620,7 +627,8 @@ bool ED_mask_selected_minmax(const bContext *C, INIT_MINMAX2(min, max); for (MaskLayer *mask_layer = mask_eval->masklayers.first; mask_layer != NULL; - mask_layer = mask_layer->next) { + mask_layer = mask_layer->next) + { if (mask_layer->visibility_flag & (MASK_HIDE_VIEW | MASK_HIDE_SELECT)) { continue; } diff --git a/source/blender/editors/mask/mask_select.c b/source/blender/editors/mask/mask_select.c index 2493429c36f..7ec061fea67 100644 --- a/source/blender/editors/mask/mask_select.c +++ b/source/blender/editors/mask/mask_select.c @@ -453,14 +453,16 @@ static int box_select_exec(bContext *C, wmOperator *op) for (MaskLayer *mask_layer_orig = mask_orig->masklayers.first, *mask_layer_eval = mask_eval->masklayers.first; mask_layer_orig != NULL; - mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) { + mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) + { if (mask_layer_orig->visibility_flag & (MASK_HIDE_VIEW | MASK_HIDE_SELECT)) { continue; } for (MaskSpline *spline_orig = mask_layer_orig->splines.first, *spline_eval = mask_layer_eval->splines.first; spline_orig != NULL; - spline_orig = spline_orig->next, spline_eval = spline_eval->next) { + spline_orig = spline_orig->next, spline_eval = spline_eval->next) + { MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline_eval); @@ -546,14 +548,16 @@ static bool do_lasso_select_mask(bContext *C, for (MaskLayer *mask_layer_orig = mask_orig->masklayers.first, *mask_layer_eval = mask_eval->masklayers.first; mask_layer_orig != NULL; - mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) { + mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) + { if (mask_layer_orig->visibility_flag & (MASK_HIDE_VIEW | MASK_HIDE_SELECT)) { continue; } for (MaskSpline *spline_orig = mask_layer_orig->splines.first, *spline_eval = mask_layer_eval->splines.first; spline_orig != NULL; - spline_orig = spline_orig->next, spline_eval = spline_eval->next) { + spline_orig = spline_orig->next, spline_eval = spline_eval->next) + { MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline_eval); @@ -579,7 +583,8 @@ static bool do_lasso_select_mask(bContext *C, &screen_co[1]); if (BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) && - BLI_lasso_is_point_inside(mcoords, mcoords_len, screen_co[0], screen_co[1], INT_MAX)) { + BLI_lasso_is_point_inside(mcoords, mcoords_len, screen_co[0], screen_co[1], INT_MAX)) + { BKE_mask_point_select_set(point, select); BKE_mask_point_select_set_handle(point, MASK_WHICH_HANDLE_BOTH, select); changed = true; @@ -695,14 +700,16 @@ static int circle_select_exec(bContext *C, wmOperator *op) for (MaskLayer *mask_layer_orig = mask_orig->masklayers.first, *mask_layer_eval = mask_eval->masklayers.first; mask_layer_orig != NULL; - mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) { + mask_layer_orig = mask_layer_orig->next, mask_layer_eval = mask_layer_eval->next) + { if (mask_layer_orig->visibility_flag & (MASK_HIDE_VIEW | MASK_HIDE_SELECT)) { continue; } for (MaskSpline *spline_orig = mask_layer_orig->splines.first, *spline_eval = mask_layer_eval->splines.first; spline_orig != NULL; - spline_orig = spline_orig->next, spline_eval = spline_eval->next) { + spline_orig = spline_orig->next, spline_eval = spline_eval->next) + { MaskSplinePoint *points_array = BKE_mask_spline_point_array(spline_eval); diff --git a/source/blender/editors/mask/mask_shapekey.c b/source/blender/editors/mask/mask_shapekey.c index 12a34f51de4..ce376c5a99d 100644 --- a/source/blender/editors/mask/mask_shapekey.c +++ b/source/blender/editors/mask/mask_shapekey.c @@ -142,7 +142,8 @@ static int mask_shape_key_feather_reset_exec(bContext *C, wmOperator *UNUSED(op) BKE_mask_layer_shape_from_mask(mask_layer, mask_layer_shape_reset); for (mask_layer_shape = mask_layer->splines_shapes.first; mask_layer_shape; - mask_layer_shape = mask_layer_shape->next) { + mask_layer_shape = mask_layer_shape->next) + { if (mask_layer_shape_reset->tot_vert == mask_layer_shape->tot_vert) { int i_abs = 0; @@ -237,7 +238,8 @@ static int mask_shape_key_rekey_exec(bContext *C, wmOperator *op) MaskLayerShape *mask_layer_shape_lastsel = NULL; for (mask_layer_shape = mask_layer->splines_shapes.first; mask_layer_shape; - mask_layer_shape = mask_layer_shape_next) { + mask_layer_shape = mask_layer_shape_next) + { MaskLayerShape *mask_layer_shape_a = NULL; MaskLayerShape *mask_layer_shape_b = NULL; @@ -249,7 +251,8 @@ static int mask_shape_key_rekey_exec(bContext *C, wmOperator *op) mask_layer_shape_lastsel = mask_layer_shape; } if ((mask_layer_shape->next == NULL) || - (((MaskLayerShape *)mask_layer_shape->next)->flag & MASK_SHAPE_SELECT) == 0) { + (((MaskLayerShape *)mask_layer_shape->next)->flag & MASK_SHAPE_SELECT) == 0) + { mask_layer_shape_a = mask_layer_shape_lastsel; mask_layer_shape_b = mask_layer_shape; mask_layer_shape_lastsel = NULL; @@ -270,7 +273,8 @@ static int mask_shape_key_rekey_exec(bContext *C, wmOperator *op) /* move keys */ for (mask_layer_shape_tmp = mask_layer_shape_a; mask_layer_shape_tmp && (mask_layer_shape_tmp != mask_layer_shape_tmp_last); - mask_layer_shape_tmp = mask_layer_shape_tmp_next) { + mask_layer_shape_tmp = mask_layer_shape_tmp_next) + { mask_layer_shape_tmp_next = mask_layer_shape_tmp->next; BLI_remlink(&mask_layer->splines_shapes, mask_layer_shape_tmp); BLI_addtail(&shapes_tmp, mask_layer_shape_tmp); @@ -278,7 +282,8 @@ static int mask_shape_key_rekey_exec(bContext *C, wmOperator *op) /* re-key, NOTE: can't modify the keys here since it messes up. */ for (mask_layer_shape_tmp = shapes_tmp.first; mask_layer_shape_tmp; - mask_layer_shape_tmp = mask_layer_shape_tmp->next) { + mask_layer_shape_tmp = mask_layer_shape_tmp->next) + { BKE_mask_layer_evaluate(mask_layer, mask_layer_shape_tmp->frame, true); mask_layer_shape_tmp_rekey = BKE_mask_layer_shape_verify_frame( mask_layer, mask_layer_shape_tmp->frame); @@ -288,7 +293,8 @@ static int mask_shape_key_rekey_exec(bContext *C, wmOperator *op) /* restore unselected points and free copies */ for (mask_layer_shape_tmp = shapes_tmp.first; mask_layer_shape_tmp; - mask_layer_shape_tmp = mask_layer_shape_tmp_next) { + mask_layer_shape_tmp = mask_layer_shape_tmp_next) + { /* restore */ int i_abs = 0; MaskLayerShapeElem *shape_ele_src; diff --git a/source/blender/editors/mesh/editface.cc b/source/blender/editors/mesh/editface.cc index 151272ca212..9baf7982026 100644 --- a/source/blender/editors/mesh/editface.cc +++ b/source/blender/editors/mesh/editface.cc @@ -393,8 +393,8 @@ void paintface_select_more(Mesh *mesh, const bool face_step) continue; } const IndexRange poly = polys[i]; - if (poly_has_selected_neighbor( - corner_edges.slice(poly), edges, select_vert.span, face_step)) { + if (poly_has_selected_neighbor(corner_edges.slice(poly), edges, select_vert.span, face_step)) + { select_poly.span[i] = true; } } @@ -460,7 +460,8 @@ void paintface_select_less(Mesh *mesh, const bool face_step) } const IndexRange poly = polys[i]; if (poly_has_unselected_neighbor( - corner_edges.slice(poly), edges, verts_of_unselected_faces, face_step)) { + corner_edges.slice(poly), edges, verts_of_unselected_faces, face_step)) + { select_poly.span[i] = false; } } @@ -747,8 +748,8 @@ void paintvert_select_linked_pick(bContext *C, const bool select) { uint index = uint(-1); - if (!ED_mesh_pick_vert( - C, ob, region_coordinates, ED_MESH_PICK_DEFAULT_VERT_DIST, true, &index)) { + if (!ED_mesh_pick_vert(C, ob, region_coordinates, ED_MESH_PICK_DEFAULT_VERT_DIST, true, &index)) + { return; } diff --git a/source/blender/editors/mesh/editmesh_add.c b/source/blender/editors/mesh/editmesh_add.c index e19ff371637..d727a86a8d7 100644 --- a/source/blender/editors/mesh/editmesh_add.c +++ b/source/blender/editors/mesh/editmesh_add.c @@ -126,7 +126,8 @@ static int add_primitive_plane_exec(bContext *C, wmOperator *op) 0, RNA_float_get(op->ptr, "size") / 2.0f, creation_data.mat, - calc_uvs)) { + calc_uvs)) + { return OPERATOR_CANCELLED; } @@ -188,7 +189,8 @@ static int add_primitive_cube_exec(bContext *C, wmOperator *op) "create_cube matrix=%m4 size=%f calc_uvs=%b", creation_data.mat, RNA_float_get(op->ptr, "size"), - calc_uvs)) { + calc_uvs)) + { return OPERATOR_CANCELLED; } @@ -266,7 +268,8 @@ static int add_primitive_circle_exec(bContext *C, wmOperator *op) cap_end, cap_tri, creation_data.mat, - calc_uvs)) { + calc_uvs)) + { return OPERATOR_CANCELLED; } @@ -340,7 +343,8 @@ static int add_primitive_cylinder_exec(bContext *C, wmOperator *op) cap_tri, RNA_float_get(op->ptr, "depth"), creation_data.mat, - calc_uvs)) { + calc_uvs)) + { return OPERATOR_CANCELLED; } @@ -416,7 +420,8 @@ static int add_primitive_cone_exec(bContext *C, wmOperator *op) cap_tri, RNA_float_get(op->ptr, "depth"), creation_data.mat, - calc_uvs)) { + calc_uvs)) + { return OPERATOR_CANCELLED; } @@ -489,7 +494,8 @@ static int add_primitive_grid_exec(bContext *C, wmOperator *op) RNA_int_get(op->ptr, "y_subdivisions"), RNA_float_get(op->ptr, "size") / 2.0f, creation_data.mat, - calc_uvs)) { + calc_uvs)) + { return OPERATOR_CANCELLED; } @@ -562,7 +568,8 @@ static int add_primitive_monkey_exec(bContext *C, wmOperator *op) false, "create_monkey matrix=%m4 calc_uvs=%b", creation_data.mat, - calc_uvs)) { + calc_uvs)) + { return OPERATOR_CANCELLED; } @@ -627,7 +634,8 @@ static int add_primitive_uvsphere_exec(bContext *C, wmOperator *op) RNA_int_get(op->ptr, "ring_count"), RNA_float_get(op->ptr, "radius"), creation_data.mat, - calc_uvs)) { + calc_uvs)) + { return OPERATOR_CANCELLED; } @@ -694,7 +702,8 @@ static int add_primitive_icosphere_exec(bContext *C, wmOperator *op) RNA_int_get(op->ptr, "subdivisions"), RNA_float_get(op->ptr, "radius"), creation_data.mat, - calc_uvs)) { + calc_uvs)) + { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/mesh/editmesh_add_gizmo.c b/source/blender/editors/mesh/editmesh_add_gizmo.c index c6ee36b2c57..05eb8103a0a 100644 --- a/source/blender/editors/mesh/editmesh_add_gizmo.c +++ b/source/blender/editors/mesh/editmesh_add_gizmo.c @@ -338,7 +338,8 @@ static int add_primitive_cube_gizmo_exec(bContext *C, wmOperator *op) "create_cube matrix=%m4 size=%f calc_uvs=%b", matrix, 1.0f, - calc_uvs)) { + calc_uvs)) + { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/mesh/editmesh_bevel.c b/source/blender/editors/mesh/editmesh_bevel.c index 92e993f74a2..866c68bef53 100644 --- a/source/blender/editors/mesh/editmesh_bevel.c +++ b/source/blender/editors/mesh/editmesh_bevel.c @@ -671,13 +671,15 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, const wmEvent *event) /* When activated from toolbar, need to convert left-mouse release to confirm. */ if (ELEM(etype, LEFTMOUSE, opdata->launch_event) && (eval == KM_RELEASE) && - RNA_boolean_get(op->ptr, "release_confirm")) { + RNA_boolean_get(op->ptr, "release_confirm")) + { etype = EVT_MODAL_MAP; eval = BEV_MODAL_CONFIRM; } /* Modal numinput active, try to handle numeric inputs first... */ if (etype != EVT_MODAL_MAP && eval == KM_PRESS && has_numinput && - handleNumInput(C, &opdata->num_input[opdata->value_mode], event)) { + handleNumInput(C, &opdata->num_input[opdata->value_mode], event)) + { edbm_bevel_numinput_set_value(op); edbm_bevel_calc(op); edbm_bevel_update_status_text(C, op); @@ -882,7 +884,8 @@ static int edbm_bevel_modal(bContext *C, wmOperator *op, const wmEvent *event) /* Modal numinput inactive, try to handle numeric inputs last... */ if (!handled && eval == KM_PRESS && - handleNumInput(C, &opdata->num_input[opdata->value_mode], event)) { + handleNumInput(C, &opdata->num_input[opdata->value_mode], event)) + { edbm_bevel_numinput_set_value(op); edbm_bevel_calc(op); edbm_bevel_update_status_text(C, op); diff --git a/source/blender/editors/mesh/editmesh_bisect.c b/source/blender/editors/mesh/editmesh_bisect.c index fa60e44d6ae..1160f27eaee 100644 --- a/source/blender/editors/mesh/editmesh_bisect.c +++ b/source/blender/editors/mesh/editmesh_bisect.c @@ -106,7 +106,8 @@ static int mesh_bisect_invoke(bContext *C, wmOperator *op, const wmEvent *event) /* If the properties are set or there is no rv3d, * skip modal and exec immediately. */ if ((CTX_wm_region_view3d(C) == NULL) || (RNA_struct_property_is_set(op->ptr, "plane_co") && - RNA_struct_property_is_set(op->ptr, "plane_no"))) { + RNA_struct_property_is_set(op->ptr, "plane_no"))) + { return mesh_bisect_exec(C, op); } diff --git a/source/blender/editors/mesh/editmesh_extrude.c b/source/blender/editors/mesh/editmesh_extrude.c index 104d88878bf..566ef62b0e7 100644 --- a/source/blender/editors/mesh/editmesh_extrude.c +++ b/source/blender/editors/mesh/editmesh_extrude.c @@ -61,7 +61,8 @@ static void edbm_extrude_edge_exclude_mirror( BM_ITER_MESH (edge, &iter, bm, BM_EDGES_OF_MESH) { if (BM_elem_flag_test(edge, hflag) && BM_edge_is_boundary(edge) && - BM_elem_flag_test(edge->l->f, hflag)) { + BM_elem_flag_test(edge->l->f, hflag)) + { float co1[3], co2[3]; copy_v3_v3(co1, edge->v1->co); @@ -787,7 +788,8 @@ static int edbm_dupli_extrude_cursor_invoke(bContext *C, wmOperator *op, const w if ((ED_view3d_project_float_object(vc.region, eed->v1->co, co1, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) && (ED_view3d_project_float_object(vc.region, eed->v2->co, co2, V3D_PROJ_TEST_NOP) == - V3D_PROJ_RET_OK)) { + V3D_PROJ_RET_OK)) + { /* 2D rotate by 90d while adding. * (x, y) = (y, -x) * diff --git a/source/blender/editors/mesh/editmesh_extrude_screw.c b/source/blender/editors/mesh/editmesh_extrude_screw.c index a6ed3379f7a..01858d12322 100644 --- a/source/blender/editors/mesh/editmesh_extrude_screw.c +++ b/source/blender/editors/mesh/editmesh_extrude_screw.c @@ -127,7 +127,8 @@ static int edbm_screw_exec(bContext *C, wmOperator *op) turns * steps, DEG2RADF(360.0f * turns), obedit->object_to_world, - false)) { + false)) + { continue; } diff --git a/source/blender/editors/mesh/editmesh_extrude_spin.c b/source/blender/editors/mesh/editmesh_extrude_spin.c index 9127fdff3d6..7bcbc1c5017 100644 --- a/source/blender/editors/mesh/editmesh_extrude_spin.c +++ b/source/blender/editors/mesh/editmesh_extrude_spin.c @@ -80,7 +80,8 @@ static int edbm_spin_exec(bContext *C, wmOperator *op) obedit->object_to_world, use_normal_flip, dupli, - use_auto_merge)) { + use_auto_merge)) + { continue; } BMO_op_exec(bm, &spinop); diff --git a/source/blender/editors/mesh/editmesh_inset.c b/source/blender/editors/mesh/editmesh_inset.c index fa4ae7f984c..b3d48c8bfd5 100644 --- a/source/blender/editors/mesh/editmesh_inset.c +++ b/source/blender/editors/mesh/editmesh_inset.c @@ -388,7 +388,8 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event) return OPERATOR_CANCELLED; } if ((event->type == opdata->launch_event) && (event->val == KM_RELEASE) && - RNA_boolean_get(op->ptr, "release_confirm")) { + RNA_boolean_get(op->ptr, "release_confirm")) + { edbm_inset_calc(op); edbm_inset_exit(C, op); return OPERATOR_FINISHED; @@ -448,7 +449,8 @@ static int edbm_inset_modal(bContext *C, wmOperator *op, const wmEvent *event) case EVT_PADENTER: case EVT_RETKEY: if ((event->val == KM_PRESS) || - ((event->val == KM_RELEASE) && RNA_boolean_get(op->ptr, "release_confirm"))) { + ((event->val == KM_RELEASE) && RNA_boolean_get(op->ptr, "release_confirm"))) + { edbm_inset_calc(op); edbm_inset_exit(C, op); return OPERATOR_FINISHED; diff --git a/source/blender/editors/mesh/editmesh_intersect.c b/source/blender/editors/mesh/editmesh_intersect.c index 83cefd1c09d..3e894bec727 100644 --- a/source/blender/editors/mesh/editmesh_intersect.c +++ b/source/blender/editors/mesh/editmesh_intersect.c @@ -655,7 +655,8 @@ static void bm_face_split_by_edges_island_connect( true, mem_arena_edgenet, &edge_arr_holes, - &edge_arr_holes_len)) { + &edge_arr_holes_len)) + { edge_arr_len = edge_arr_holes_len; edge_arr = edge_arr_holes; /* owned by the arena */ } @@ -921,7 +922,8 @@ static int edbm_face_split_by_edges_exec(bContext *C, wmOperator *UNUSED(op)) if (angle_signed_on_axis_v3v3v3_v3( l->prev->v->co, l->v->co, v_other->co, l->f->no) < angle_signed_on_axis_v3v3v3_v3( - l->prev->v->co, l->v->co, l->next->v->co, l->f->no)) { + l->prev->v->co, l->v->co, l->next->v->co, l->f->no)) + { dot_best = dot_test; l_best = l; } diff --git a/source/blender/editors/mesh/editmesh_knife.c b/source/blender/editors/mesh/editmesh_knife.c index 967a9e25fe6..aa932d78040 100644 --- a/source/blender/editors/mesh/editmesh_knife.c +++ b/source/blender/editors/mesh/editmesh_knife.c @@ -735,7 +735,8 @@ static void knifetool_draw_visible_angles(const KnifeTool_OpData *kcd) /* Check for most recent cut (if cage is part of previous cut). */ if (!compare_v3v3(kfe->v1->cageco, kcd->prev.cage, KNIFE_FLT_EPSBIG) && - !compare_v3v3(kfe->v2->cageco, kcd->prev.cage, KNIFE_FLT_EPSBIG)) { + !compare_v3v3(kfe->v2->cageco, kcd->prev.cage, KNIFE_FLT_EPSBIG)) + { /* Determine acute angle. */ float angle1 = angle_v3v3v3(kcd->prev.cage, kcd->curr.cage, kfe->v1->cageco); float angle2 = angle_v3v3v3(kcd->prev.cage, kcd->curr.cage, kfe->v2->cageco); @@ -1360,7 +1361,8 @@ static void knife_bvh_raycast_cb(void *userdata, /* Discard clipped points. */ if (RV3D_CLIPPING_ENABLED(kcd->vc.v3d, kcd->vc.rv3d) && - ED_view3d_clipping_test(kcd->vc.rv3d, hit->co, false)) { + ED_view3d_clipping_test(kcd->vc.rv3d, hit->co, false)) + { return; } @@ -1977,7 +1979,8 @@ static void prepare_linehits_for_cut(KnifeTool_OpData *kcd) for (int j = i - 1; j >= 0; j--) { KnifeLineHit *lhj = &linehits[j]; if (!lhj->kfe || fabsf(lhi->l - lhj->l) > KNIFE_FLT_EPSBIG || - fabsf(lhi->m - lhj->m) > KNIFE_FLT_EPSBIG) { + fabsf(lhi->m - lhj->m) > KNIFE_FLT_EPSBIG) + { break; } @@ -2061,7 +2064,8 @@ static bool knife_add_single_cut__is_linehit_outside_face(BMFace *f, else if (lh->kfe && lh->kfe->e) { BMLoop *l; /* side-of-edge */ if ((l = BM_face_edge_share_loop(f, lh->kfe->e)) && - (BM_loop_point_side_of_edge_test(l, co) < 0.0f)) { + (BM_loop_point_side_of_edge_test(l, co) < 0.0f)) + { return true; } } @@ -2083,11 +2087,13 @@ static void knife_add_single_cut(KnifeTool_OpData *kcd, /* If the cut is on an edge. */ if ((lh1->v && lh2->v) && (lh1->v->v && lh2->v && lh2->v->v) && - (e_base = BM_edge_exists(lh1->v->v, lh2->v->v))) { + (e_base = BM_edge_exists(lh1->v->v, lh2->v->v))) + { return; } if (knife_add_single_cut__is_linehit_outside_face(f, lh1, lh2->hit) || - knife_add_single_cut__is_linehit_outside_face(f, lh2, lh1->hit)) { + knife_add_single_cut__is_linehit_outside_face(f, lh2, lh1->hit)) + { return; } @@ -2240,7 +2246,8 @@ static void knife_make_face_cuts(KnifeTool_OpData *kcd, BMesh *bm, BMFace *f, Li true, kcd->edgenet.arena, &edge_array_holes, - &edge_array_holes_len)) { + &edge_array_holes_len)) + { if (BM_elem_flag_test(f, BM_ELEM_SELECT)) { for (i = edge_array_len; i < edge_array_holes_len; i++) { BM_edge_select_set(bm, edge_array_holes[i], true); @@ -2371,7 +2378,8 @@ static void knife_make_cuts(KnifeTool_OpData *kcd, Object *ob) /* Split bmesh edges where needed. */ for (list = BLI_smallhash_iternew(ehash, &hiter, (uintptr_t *)&e); list; - list = BLI_smallhash_iternext(&hiter, (uintptr_t *)&e)) { + list = BLI_smallhash_iternext(&hiter, (uintptr_t *)&e)) + { BLI_listbase_sort_r(list, sort_verts_by_dist_cb, e->v1->co); for (ref = list->first; ref; ref = ref->next) { @@ -2387,7 +2395,8 @@ static void knife_make_cuts(KnifeTool_OpData *kcd, Object *ob) /* Do cuts for each face. */ for (list = BLI_smallhash_iternew(fhash, &hiter, (uintptr_t *)&f); list; - list = BLI_smallhash_iternext(&hiter, (uintptr_t *)&f)) { + list = BLI_smallhash_iternext(&hiter, (uintptr_t *)&f)) + { knife_make_face_cuts(kcd, bm, f, list); } @@ -2596,13 +2605,14 @@ static bool knife_ray_intersect_face(KnifeTool_OpData *kcd, * tessellation edge and might not hit either tessellation tri with * an exact test; * We will exclude hits near real edges by a later test. */ - if (isect_ray_tri_epsilon_v3( - v1, raydir, UNPACK3(tri_cos), &lambda, ray_tri_uv, KNIFE_FLT_EPS)) { + if (isect_ray_tri_epsilon_v3(v1, raydir, UNPACK3(tri_cos), &lambda, ray_tri_uv, KNIFE_FLT_EPS)) + { /* Check if line coplanar with tri. */ normal_tri_v3(tri_norm, UNPACK3(tri_cos)); plane_from_point_normal_v3(tri_plane, tri_cos[0], tri_norm); if ((dist_squared_to_plane_v3(v1, tri_plane) < KNIFE_FLT_EPS) && - (dist_squared_to_plane_v3(v2, tri_plane) < KNIFE_FLT_EPS)) { + (dist_squared_to_plane_v3(v2, tri_plane) < KNIFE_FLT_EPS)) + { return false; } interp_v3_v3v3v3_uv(hit_cageco, UNPACK3(tri_cos), ray_tri_uv); @@ -2676,7 +2686,8 @@ static bool coinciding_edges(BMEdge *e1, BMEdge *e2) co21 = e2->v1->co; co22 = e2->v2->co; if ((equals_v3v3(co11, co21) && equals_v3v3(co12, co22)) || - (equals_v3v3(co11, co22) && equals_v3v3(co12, co21))) { + (equals_v3v3(co11, co22) && equals_v3v3(co12, co21))) + { return true; } return false; @@ -2738,7 +2749,8 @@ static bool point_is_visible(KnifeTool_OpData *kcd, /* If box clipping on, make sure p is not clipped. */ if (RV3D_CLIPPING_ENABLED(kcd->vc.v3d, kcd->vc.rv3d) && - ED_view3d_clipping_test(kcd->vc.rv3d, p, false)) { + ED_view3d_clipping_test(kcd->vc.rv3d, p, false)) + { return false; } @@ -2766,12 +2778,9 @@ static bool point_is_visible(KnifeTool_OpData *kcd, copy_v3_v3(view_clip[0], p_ofs); madd_v3_v3v3fl(view_clip[1], p_ofs, view, dist); - if (clip_segment_v3_plane_n(view_clip[0], - view_clip[1], - kcd->vc.rv3d->clip_local, - 6, - view_clip[0], - view_clip[1])) { + if (clip_segment_v3_plane_n( + view_clip[0], view_clip[1], kcd->vc.rv3d->clip_local, 6, view_clip[0], view_clip[1])) + { dist = len_v3v3(p_ofs, view_clip[1]); } } @@ -2990,7 +2999,8 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd) /* First look for vertex hits. */ for (val_p = BLI_smallhash_iternew_p(&kfvs, &hiter, (uintptr_t *)&v); val_p; - val_p = BLI_smallhash_iternext_p(&hiter, (uintptr_t *)&v)) { + val_p = BLI_smallhash_iternext_p(&hiter, (uintptr_t *)&v)) + { KnifeEdge *kfe_hit = NULL; bool kfv_is_in_cut = false; @@ -3006,7 +3016,8 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd) knife_project_v2(kcd, v->cageco, s); float d = dist_squared_to_line_segment_v2(s, s1, s2); if ((d <= vert_tol_sq) && - point_is_visible(kcd, v->cageco, s, bm_elem_from_knife_vert(v, &kfe_hit))) { + point_is_visible(kcd, v->cageco, s, bm_elem_from_knife_vert(v, &kfe_hit))) + { kfv_is_in_cut = true; } } @@ -3040,11 +3051,13 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd) /* Now edge hits; don't add if a vertex at end of edge should have hit. */ for (val = BLI_smallhash_iternew(&kfes, &hiter, (uintptr_t *)&kfe); val; - val = BLI_smallhash_iternext(&hiter, (uintptr_t *)&kfe)) { + val = BLI_smallhash_iternext(&hiter, (uintptr_t *)&kfe)) + { /* If we intersect any of the vertices, don't attempt to intersect the edge. */ if (BLI_smallhash_lookup(&kfvs, (intptr_t)kfe->v1) || - BLI_smallhash_lookup(&kfvs, (intptr_t)kfe->v2)) { + BLI_smallhash_lookup(&kfvs, (intptr_t)kfe->v2)) + { continue; } @@ -3116,14 +3129,16 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd) !kcd->is_drag_hold; if (use_hit_prev || use_hit_curr) { for (val = BLI_smallhash_iternew(&faces, &hiter, (uintptr_t *)&f); val; - val = BLI_smallhash_iternext(&hiter, (uintptr_t *)&f)) { + val = BLI_smallhash_iternext(&hiter, (uintptr_t *)&f)) + { float p[3], p_cage[3]; uint ob_index = (uint)(uintptr_t)BLI_smallhash_lookup(&fobs, (uintptr_t)f); ob = kcd->objects[ob_index]; if (use_hit_prev && - knife_ray_intersect_face(kcd, s1, v1, v3, ob, ob_index, f, face_tol_sq, p, p_cage)) { + knife_ray_intersect_face(kcd, s1, v1, v3, ob, ob_index, f, face_tol_sq, p, p_cage)) + { if (point_is_visible(kcd, p_cage, s1, (BMElem *)f)) { memset(&hit, 0, sizeof(hit)); hit.f = f; @@ -3138,7 +3153,8 @@ static void knife_find_line_hits(KnifeTool_OpData *kcd) } if (use_hit_curr && - knife_ray_intersect_face(kcd, s2, v2, v4, ob, ob_index, f, face_tol_sq, p, p_cage)) { + knife_ray_intersect_face(kcd, s2, v2, v4, ob, ob_index, f, face_tol_sq, p, p_cage)) + { if (point_is_visible(kcd, p_cage, s2, (BMElem *)f)) { memset(&hit, 0, sizeof(hit)); hit.f = f; @@ -3421,7 +3437,8 @@ static KnifeEdge *knife_find_closest_edge_of_face( /* Check if we're close enough and calculate 'lambda'. */ /* In constrained mode calculate lambda differently, unless constrained along kcd->prev.edge */ if ((kcd->is_angle_snapping || kcd->axis_constrained) && (kfe != kcd->prev.edge) && - (kcd->mode == MODE_DRAGGING)) { + (kcd->mode == MODE_DRAGGING)) + { dis_sq = curdis_sq; if (!knife_snap_edge_constrained(kcd, sco, kfv1_sco, kfv2_sco, &dis_sq, &lambda)) { continue; @@ -3520,7 +3537,8 @@ static KnifeVert *knife_find_closest_vert_of_edge(KnifeTool_OpData *kcd, dis_sq = len_squared_v2v2(kfv_sco, sco); if (dis_sq < curdis_sq && dis_sq < maxdist_sq) { if (!RV3D_CLIPPING_ENABLED(kcd->vc.v3d, kcd->vc.rv3d) || - !ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, false)) { + !ED_view3d_clipping_test(kcd->vc.rv3d, kfv->cageco, false)) + { curv = kfv; curdis_sq = dis_sq; copy_v2_v2(cur_kfv_sco, kfv_sco); @@ -3569,7 +3587,8 @@ static bool knife_snap_angle_screen(KnifeTool_OpData *kcd) float snap_step; /* Currently user can input any float between 0 and 180. */ if (kcd->angle_snapping_increment > KNIFE_MIN_ANGLE_SNAPPING_INCREMENT && - kcd->angle_snapping_increment <= KNIFE_MAX_ANGLE_SNAPPING_INCREMENT) { + kcd->angle_snapping_increment <= KNIFE_MAX_ANGLE_SNAPPING_INCREMENT) + { snap_step = DEG2RADF(kcd->angle_snapping_increment); } else { @@ -3723,7 +3742,8 @@ static bool knife_snap_angle_relative(KnifeTool_OpData *kcd) /* Calculate snap step. */ float snap_step; if (kcd->angle_snapping_increment > KNIFE_MIN_ANGLE_SNAPPING_INCREMENT && - kcd->angle_snapping_increment <= KNIFE_MAX_ANGLE_SNAPPING_INCREMENT) { + kcd->angle_snapping_increment <= KNIFE_MAX_ANGLE_SNAPPING_INCREMENT) + { snap_step = DEG2RADF(kcd->angle_snapping_increment); } else { @@ -4260,7 +4280,8 @@ static int knife_update_active(KnifeTool_OpData *kcd) knife_input_ray_segment(kcd, kcd->curr.mval, 1.0f, origin, origin_ofs); if (!isect_line_plane_v3( - kcd->curr.cage, origin, origin_ofs, kcd->prev.cage, kcd->vc.rv3d->viewinv[2])) { + kcd->curr.cage, origin, origin_ofs, kcd->prev.cage, kcd->vc.rv3d->viewinv[2])) + { copy_v3_v3(kcd->curr.cage, kcd->prev.cage); /* Should never fail! */ @@ -4438,7 +4459,8 @@ static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event) if (kcd->angle_snapping) { if (kcd->num.str_cur >= 3 || - kcd->angle_snapping_increment > KNIFE_MAX_ANGLE_SNAPPING_INCREMENT / 10) { + kcd->angle_snapping_increment > KNIFE_MAX_ANGLE_SNAPPING_INCREMENT / 10) + { knife_reset_snap_angle_input(kcd); } knife_update_header(C, op, kcd); /* Update the angle multiple. */ @@ -4448,7 +4470,8 @@ static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event) applyNumInput(&kcd->num, &snapping_increment_temp); /* Restrict number key input to 0 - 180 degree range. */ if (snapping_increment_temp > KNIFE_MIN_ANGLE_SNAPPING_INCREMENT && - snapping_increment_temp <= KNIFE_MAX_ANGLE_SNAPPING_INCREMENT) { + snapping_increment_temp <= KNIFE_MAX_ANGLE_SNAPPING_INCREMENT) + { kcd->angle_snapping_increment = snapping_increment_temp; } knife_update_active(kcd); @@ -4701,7 +4724,8 @@ static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event) if (kcd->angle_snapping) { if (kcd->num.str_cur >= 3 || - kcd->angle_snapping_increment > KNIFE_MAX_ANGLE_SNAPPING_INCREMENT / 10) { + kcd->angle_snapping_increment > KNIFE_MAX_ANGLE_SNAPPING_INCREMENT / 10) + { knife_reset_snap_angle_input(kcd); } if (event->type != EVT_MODAL_MAP) { @@ -4710,7 +4734,8 @@ static int knifetool_modal(bContext *C, wmOperator *op, const wmEvent *event) applyNumInput(&kcd->num, &snapping_increment_temp); /* Restrict number key input to 0 - 180 degree range. */ if (snapping_increment_temp > KNIFE_MIN_ANGLE_SNAPPING_INCREMENT && - snapping_increment_temp <= KNIFE_MAX_ANGLE_SNAPPING_INCREMENT) { + snapping_increment_temp <= KNIFE_MAX_ANGLE_SNAPPING_INCREMENT) + { kcd->angle_snapping_increment = snapping_increment_temp; } knife_update_active(kcd); @@ -5108,7 +5133,8 @@ void EDBM_mesh_knife(ViewContext *vc, mul_m4_v3(ob->object_to_world, cent); knife_project_v2(kcd, cent, cent_ss); if ((kcd->cut_through || point_is_visible(kcd, cent, cent_ss, (BMElem *)f)) && - edbm_mesh_knife_point_isect(polys, cent_ss)) { + edbm_mesh_knife_point_isect(polys, cent_ss)) + { BM_elem_flag_enable(f, BM_ELEM_TAG); keep_search = true; } diff --git a/source/blender/editors/mesh/editmesh_loopcut.c b/source/blender/editors/mesh/editmesh_loopcut.c index 0f22865b348..061394d2fb7 100644 --- a/source/blender/editors/mesh/editmesh_loopcut.c +++ b/source/blender/editors/mesh/editmesh_loopcut.c @@ -387,7 +387,8 @@ static int loopcut_init(bContext *C, wmOperator *op, const wmEvent *event) for (uint base_index = 0; base_index < bases_len; base_index++) { Object *ob_iter = bases[base_index]->object; if (BKE_modifiers_is_deformed_by_lattice(ob_iter) || - BKE_modifiers_is_deformed_by_armature(ob_iter)) { + BKE_modifiers_is_deformed_by_armature(ob_iter)) + { BKE_report( op->reports, RPT_WARNING, "Loop cut does not work well on deformed edit mesh display"); break; diff --git a/source/blender/editors/mesh/editmesh_mask_extract.cc b/source/blender/editors/mesh/editmesh_mask_extract.cc index 2eefc364dd2..bbf15411d5e 100644 --- a/source/blender/editors/mesh/editmesh_mask_extract.cc +++ b/source/blender/editors/mesh/editmesh_mask_extract.cc @@ -149,7 +149,8 @@ static int geometry_extract_apply(bContext *C, 0.1, true, true, - true)) { + true)) + { continue; } } @@ -172,7 +173,8 @@ static int geometry_extract_apply(bContext *C, 0.1, true, true, - true)) { + true)) + { continue; } } diff --git a/source/blender/editors/mesh/editmesh_path.c b/source/blender/editors/mesh/editmesh_path.c index 91973e352f1..e65a0875dee 100644 --- a/source/blender/editors/mesh/editmesh_path.c +++ b/source/blender/editors/mesh/editmesh_path.c @@ -230,7 +230,8 @@ static void mouse_mesh_shortest_path_vert(Scene *UNUSED(scene), node = path; do { if ((is_path_ordered == false) || - WM_operator_properties_checker_interval_test(&op_params->interval_params, depth)) { + WM_operator_properties_checker_interval_test(&op_params->interval_params, depth)) + { verttag_set_cb((BMVert *)node->link, !all_set, &user_data); if (is_path_ordered) { v_dst_last = node->link; @@ -429,7 +430,8 @@ static void mouse_mesh_shortest_path_edge(Scene *scene, node = path; do { if ((is_path_ordered == false) || - WM_operator_properties_checker_interval_test(&op_params->interval_params, depth)) { + WM_operator_properties_checker_interval_test(&op_params->interval_params, depth)) + { edgetag_set_cb((BMEdge *)node->link, !all_set, &user_data); if (is_path_ordered) { e_dst_last = node->link; @@ -564,7 +566,8 @@ static void mouse_mesh_shortest_path_face(Scene *UNUSED(scene), node = path; do { if ((is_path_ordered == false) || - WM_operator_properties_checker_interval_test(&op_params->interval_params, depth)) { + WM_operator_properties_checker_interval_test(&op_params->interval_params, depth)) + { facetag_set_cb((BMFace *)node->link, !all_set, &user_data); if (is_path_ordered) { f_dst_last = node->link; @@ -720,11 +723,13 @@ static int edbm_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmE BMElem *ele_src, *ele_dst; if (!(ele_src = edbm_elem_active_elem_or_face_get(em->bm)) || - !(ele_dst = edbm_elem_find_nearest(&vc, ele_src->head.htype))) { + !(ele_dst = edbm_elem_find_nearest(&vc, ele_src->head.htype))) + { /* special case, toggle edge tags even when we don't have a path */ if (((em->selectmode & SCE_SELECT_EDGE) && (op_params.edge_mode != EDGE_MODE_SELECT)) && /* check if we only have a destination edge */ - ((ele_src == NULL) && (ele_dst = edbm_elem_find_nearest(&vc, BM_EDGE)))) { + ((ele_src == NULL) && (ele_dst = edbm_elem_find_nearest(&vc, BM_EDGE)))) + { ele_src = ele_dst; track_active = false; } @@ -767,7 +772,8 @@ static int edbm_shortest_path_pick_exec(bContext *C, wmOperator *op) BMElem *ele_src, *ele_dst; if (!(ele_src = edbm_elem_active_elem_or_face_get(em->bm)) || - !(ele_dst = EDBM_elem_from_index_any(em, index))) { + !(ele_dst = EDBM_elem_from_index_any(em, index))) + { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/mesh/editmesh_polybuild.c b/source/blender/editors/mesh/editmesh_polybuild.c index cfd07a6ff35..a3ce6c36295 100644 --- a/source/blender/editors/mesh/editmesh_polybuild.c +++ b/source/blender/editors/mesh/editmesh_polybuild.c @@ -225,7 +225,8 @@ static int edbm_polybuild_delete_at_cursor_invoke(bContext *C, "dissolve_verts verts=%hv use_face_split=%b use_boundary_tear=%b", BM_ELEM_TAG, false, - false)) { + false)) + { return OPERATOR_CANCELLED; } changed = true; @@ -345,7 +346,8 @@ static int edbm_polybuild_face_at_cursor_invoke(bContext *C, wmOperator *op, con BMEdge *e_iter = v_act->e; do { if ((BM_elem_flag_test(e_iter, BM_ELEM_HIDDEN) == false) && - (allow_wire ? BM_edge_is_wire(e_iter) : BM_edge_is_boundary(e_iter))) { + (allow_wire ? BM_edge_is_wire(e_iter) : BM_edge_is_boundary(e_iter))) + { if (i == 2) { e_pair[0] = e_pair[1] = NULL; break; @@ -579,7 +581,8 @@ static int edbm_polybuild_dissolve_at_cursor_invoke(bContext *C, "dissolve_verts verts=%hv use_face_split=%b use_boundary_tear=%b", BM_ELEM_TAG, false, - false)) { + false)) + { return OPERATOR_CANCELLED; } } diff --git a/source/blender/editors/mesh/editmesh_preselect_edgering.c b/source/blender/editors/mesh/editmesh_preselect_edgering.c index 832390331c3..bed6a6f930d 100644 --- a/source/blender/editors/mesh/editmesh_preselect_edgering.c +++ b/source/blender/editors/mesh/editmesh_preselect_edgering.c @@ -305,7 +305,8 @@ static void view3d_preselect_mesh_edgering_update_edges_from_edge( #else BM_edge_share_quad_check(eed_last, eed_start) #endif - ) { + ) + { v[1][0] = v[0][0]; v[1][1] = v[0][1]; diff --git a/source/blender/editors/mesh/editmesh_preselect_elem.c b/source/blender/editors/mesh/editmesh_preselect_elem.c index 5d8ce7cae44..f9449cfd163 100644 --- a/source/blender/editors/mesh/editmesh_preselect_elem.c +++ b/source/blender/editors/mesh/editmesh_preselect_elem.c @@ -231,7 +231,8 @@ static void view3d_preselect_update_preview_triangle_from_vert(struct EditMesh_P BMEdge *e_iter = v_act->e; do { if ((BM_elem_flag_test(e_iter, BM_ELEM_HIDDEN) == false) && - (allow_wire ? BM_edge_is_wire(e_iter) : BM_edge_is_boundary(e_iter))) { + (allow_wire ? BM_edge_is_wire(e_iter) : BM_edge_is_boundary(e_iter))) + { if (i == 2) { e_pair[0] = e_pair[1] = NULL; break; diff --git a/source/blender/editors/mesh/editmesh_rip.c b/source/blender/editors/mesh/editmesh_rip.c index 988d1e7e869..e955336f135 100644 --- a/source/blender/editors/mesh/editmesh_rip.c +++ b/source/blender/editors/mesh/editmesh_rip.c @@ -138,7 +138,8 @@ static float edbm_rip_edge_side_measure( score = len_v2v2(e_v1_co, e_v2_co); if (dist_squared_to_line_segment_v2(fmval_tweak, e_v1_co, e_v2_co) > - dist_squared_to_line_segment_v2(fmval, e_v1_co, e_v2_co)) { + dist_squared_to_line_segment_v2(fmval, e_v1_co, e_v2_co)) + { return score; } return -score; diff --git a/source/blender/editors/mesh/editmesh_select.cc b/source/blender/editors/mesh/editmesh_select.cc index dfe8af1bb92..945c7b0186b 100644 --- a/source/blender/editors/mesh/editmesh_select.cc +++ b/source/blender/editors/mesh/editmesh_select.cc @@ -246,7 +246,8 @@ static void findnearestvert__doClosest(void *userData, if (data->use_cycle) { if ((data->hit_cycle.vert == nullptr) && (index > data->cycle_index_prev) && - (dist_test_bias < FIND_NEAR_CYCLE_THRESHOLD_MIN)) { + (dist_test_bias < FIND_NEAR_CYCLE_THRESHOLD_MIN)) + { data->hit_cycle.dist_bias = dist_test_bias; data->hit_cycle.dist = dist_test; data->hit_cycle.index = index; @@ -320,7 +321,8 @@ BMVert *EDBM_vert_find_nearest_ex(ViewContext *vc, Base *base_iter = bases[base_index]; ED_view3d_viewcontext_init_object(vc, base_iter->object); if (use_cycle && prev_select.bm == vc->em->bm && - prev_select.elem == BM_vert_at_index_find_or_table(vc->em->bm, prev_select.index)) { + prev_select.elem == BM_vert_at_index_find_or_table(vc->em->bm, prev_select.index)) + { data.cycle_index_prev = prev_select.index; /* No need to compare in the rest of the loop. */ use_cycle = false; @@ -465,7 +467,8 @@ static void find_nearest_edge__doClosest( if (data->use_cycle) { if ((data->hit_cycle.edge == nullptr) && (index > data->cycle_index_prev) && - (dist_test_bias < FIND_NEAR_CYCLE_THRESHOLD_MIN)) { + (dist_test_bias < FIND_NEAR_CYCLE_THRESHOLD_MIN)) + { float screen_co_mid[2]; data->hit_cycle.dist_bias = dist_test_bias; @@ -570,7 +573,8 @@ BMEdge *EDBM_edge_find_nearest_ex(ViewContext *vc, Base *base_iter = bases[base_index]; ED_view3d_viewcontext_init_object(vc, base_iter->object); if (use_cycle && prev_select.bm == vc->em->bm && - prev_select.elem == BM_edge_at_index_find_or_table(vc->em->bm, prev_select.index)) { + prev_select.elem == BM_edge_at_index_find_or_table(vc->em->bm, prev_select.index)) + { data.cycle_index_prev = prev_select.index; /* No need to compare in the rest of the loop. */ use_cycle = false; @@ -683,7 +687,8 @@ static void findnearestface__doClosest(void *userData, if (data->use_cycle) { if ((data->hit_cycle.face == nullptr) && (index > data->cycle_index_prev) && - (dist_test_bias < FIND_NEAR_CYCLE_THRESHOLD_MIN)) { + (dist_test_bias < FIND_NEAR_CYCLE_THRESHOLD_MIN)) + { data->hit_cycle.dist_bias = dist_test_bias; data->hit_cycle.dist = dist_test; data->hit_cycle.index = index; @@ -791,7 +796,8 @@ BMFace *EDBM_face_find_nearest_ex(ViewContext *vc, Base *base_iter = bases[base_index]; ED_view3d_viewcontext_init_object(vc, base_iter->object); if (use_cycle && prev_select.bm == vc->em->bm && - prev_select.elem == BM_face_at_index_find_or_table(vc->em->bm, prev_select.index)) { + prev_select.elem == BM_face_at_index_find_or_table(vc->em->bm, prev_select.index)) + { data.cycle_index_prev = prev_select.index; /* No need to compare in the rest of the loop. */ use_cycle = false; @@ -1041,7 +1047,8 @@ bool EDBM_unified_findnearest_from_raycast(ViewContext *vc, } best_face = {0, nullptr}; if (ED_view3d_win_to_ray_clipped( - vc->depsgraph, vc->region, vc->v3d, mval_fl, ray_origin, ray_direction, true)) { + vc->depsgraph, vc->region, vc->v3d, mval_fl, ray_origin, ray_direction, true)) + { float dist_sq_best = FLT_MAX; float dist_sq_best_vert = FLT_MAX; float dist_sq_best_edge = FLT_MAX; @@ -1395,7 +1402,8 @@ static char *edbm_select_mode_get_description(bContext * /*C*/, if (RNA_struct_property_is_set(values, "type") && !RNA_struct_property_is_set(values, "use_extend") && !RNA_struct_property_is_set(values, "use_expand") && - !RNA_struct_property_is_set(values, "action")) { + !RNA_struct_property_is_set(values, "action")) + { switch (type) { case SCE_SELECT_VERTEX: return BLI_strdup(TIP_( @@ -1479,7 +1487,8 @@ static void walker_select_count(BMEditMesh *em, BMW_NIL_LAY); for (ele = static_cast(BMW_begin(&walker, start)); ele; - ele = static_cast(BMW_step(&walker))) { + ele = static_cast(BMW_step(&walker))) + { r_count_by_select[BM_elem_flag_test(ele, BM_ELEM_SELECT) ? 1 : 0] += 1; /* Early exit when mixed (could be optional if needed. */ @@ -1508,7 +1517,8 @@ static void walker_select(BMEditMesh *em, int walkercode, void *start, const boo BMW_NIL_LAY); for (ele = static_cast(BMW_begin(&walker, start)); ele; - ele = static_cast(BMW_step(&walker))) { + ele = static_cast(BMW_step(&walker))) + { if (!select) { BM_select_history_remove(bm, ele); } @@ -1776,12 +1786,14 @@ static bool mouse_mesh_loop( ED_view3d_init_mats_rv3d(vc.obedit, vc.rv3d); if (ED_view3d_project_float_object(vc.region, eed->v1->co, v1_co, V3D_PROJ_TEST_CLIP_NEAR) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { length_1 = len_squared_v2v2(mvalf, v1_co); } if (ED_view3d_project_float_object(vc.region, eed->v2->co, v2_co, V3D_PROJ_TEST_CLIP_NEAR) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { length_2 = len_squared_v2v2(mvalf, v2_co); } #if 0 @@ -1811,7 +1823,8 @@ static bool mouse_mesh_loop( BM_face_calc_center_median(f, cent); if (ED_view3d_project_float_object(vc.region, cent, co, V3D_PROJ_TEST_CLIP_NEAR) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { tdist = len_squared_v2v2(mvalf, co); if (tdist < best_dist) { // printf("Best face: %p (%f)\n", f, tdist); @@ -1846,7 +1859,8 @@ static int edbm_select_loop_invoke(bContext *C, wmOperator *op, const wmEvent *e RNA_boolean_get(op->ptr, "extend"), RNA_boolean_get(op->ptr, "deselect"), RNA_boolean_get(op->ptr, "toggle"), - RNA_boolean_get(op->ptr, "ring"))) { + RNA_boolean_get(op->ptr, "ring"))) + { return OPERATOR_FINISHED; } return OPERATOR_CANCELLED; @@ -3175,7 +3189,8 @@ static bool select_linked_delimit_test(BMEdge *e, int delimit, const DelimitData if (delimit & BMO_DELIM_UV) { if (BM_edge_is_contiguous_loop_cd( - e, delimit_data->cd_loop_type, delimit_data->cd_loop_offset) == 0) { + e, delimit_data->cd_loop_type, delimit_data->cd_loop_offset) == 0) + { return true; } } @@ -4232,7 +4247,8 @@ static void walker_deselect_nth(BMEditMesh *em, BLI_assert(walker.order == BMW_BREADTH_FIRST); for (ele = static_cast(BMW_begin(&walker, h_act)); ele != nullptr; - ele = static_cast(BMW_step(&walker))) { + ele = static_cast(BMW_step(&walker))) + { if (!BM_elem_flag_test(ele, BM_ELEM_TAG)) { /* Deselect elements that aren't at "nth" depth from active */ const int depth = BMW_current_depth(&walker) - 1; @@ -4510,8 +4526,8 @@ static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op) BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) { if ((BM_elem_flag_test(f, BM_ELEM_HIDDEN) != 0) || - (BM_elem_flag_test(f, BM_ELEM_TAG) != 0) || - (BM_elem_flag_test(f, BM_ELEM_SELECT) == 0)) { + (BM_elem_flag_test(f, BM_ELEM_TAG) != 0) || (BM_elem_flag_test(f, BM_ELEM_SELECT) == 0)) + { continue; } @@ -4526,8 +4542,8 @@ static int edbm_select_linked_flat_faces_exec(bContext *C, wmOperator *op) BM_ITER_ELEM (l2, &liter2, l, BM_LOOPS_OF_LOOP) { float angle_cos; - if (BM_elem_flag_test(l2->f, BM_ELEM_TAG) || - BM_elem_flag_test(l2->f, BM_ELEM_HIDDEN)) { + if (BM_elem_flag_test(l2->f, BM_ELEM_TAG) || BM_elem_flag_test(l2->f, BM_ELEM_HIDDEN)) + { continue; } @@ -4636,7 +4652,8 @@ static int edbm_select_non_manifold_exec(bContext *C, wmOperator *op) if (!BM_elem_flag_test(e, BM_ELEM_HIDDEN)) { if ((use_wire && BM_edge_is_wire(e)) || (use_boundary && BM_edge_is_boundary(e)) || (use_non_contiguous && (BM_edge_is_manifold(e) && !BM_edge_is_contiguous(e))) || - (use_multi_face && BM_edge_face_count_is_over(e, 2))) { + (use_multi_face && BM_edge_face_count_is_over(e, 2))) + { /* check we never select perfect edge (in test above) */ BLI_assert(!(BM_edge_is_manifold(e) && BM_edge_is_contiguous(e))); diff --git a/source/blender/editors/mesh/editmesh_select_similar.c b/source/blender/editors/mesh/editmesh_select_similar.c index a9c2cd4236b..88e5f5614d6 100644 --- a/source/blender/editors/mesh/editmesh_select_similar.c +++ b/source/blender/editors/mesh/editmesh_select_similar.c @@ -435,7 +435,8 @@ static int similar_face_select_exec(bContext *C, wmOperator *op) if (BLI_kdtree_4d_find_nearest(tree_4d, plane, &nearest) != -1) { if (nearest.dist <= thresh) { if ((fabsf(plane[3] - nearest.co[3]) <= thresh) && - (angle_v3v3(plane, nearest.co) <= thresh_radians)) { + (angle_v3v3(plane, nearest.co) <= thresh_radians)) + { select = true; } } @@ -459,7 +460,8 @@ static int similar_face_select_exec(bContext *C, wmOperator *op) fface = CustomData_bmesh_get(&bm->pdata, face->head.data, CD_FREESTYLE_FACE); if (((fface != NULL) && (fface->flag & FREESTYLE_FACE_MARK)) == - ((face_data_value & SIMFACE_DATA_TRUE) != 0)) { + ((face_data_value & SIMFACE_DATA_TRUE) != 0)) + { select = true; } break; @@ -888,7 +890,8 @@ static int similar_edge_select_exec(bContext *C, wmOperator *op) fedge = CustomData_bmesh_get(&bm->edata, edge->head.data, CD_FREESTYLE_EDGE); if (((fedge != NULL) && (fedge->flag & FREESTYLE_EDGE_MARK)) == - ((edge_data_value & SIMEDGE_DATA_TRUE) != 0)) { + ((edge_data_value & SIMEDGE_DATA_TRUE) != 0)) + { select = true; } break; @@ -1393,7 +1396,8 @@ static bool edbm_select_similar_poll_property(const bContext *UNUSED(C), SIMFACE_AREA, SIMFACE_PERIMETER, SIMFACE_NORMAL, - SIMFACE_COPLANAR)) { + SIMFACE_COPLANAR)) + { return false; } } diff --git a/source/blender/editors/mesh/editmesh_tools.cc b/source/blender/editors/mesh/editmesh_tools.cc index 7411bd4a4f8..6c486cda58b 100644 --- a/source/blender/editors/mesh/editmesh_tools.cc +++ b/source/blender/editors/mesh/editmesh_tools.cc @@ -316,7 +316,8 @@ static int edbm_subdivide_edge_ring_exec(bContext *C, wmOperator *op) op_props.cuts, op_props.smooth, op_props.profile_shape, - op_props.profile_shape_factor)) { + op_props.profile_shape_factor)) + { continue; } @@ -490,8 +491,8 @@ static int edbm_delete_exec(bContext *C, wmOperator *op) continue; } BM_custom_loop_normals_to_vector_layer(em->bm); - if (!EDBM_op_callf( - em, op, "delete geom=%hef context=%i", BM_ELEM_SELECT, DEL_EDGESFACES)) { + if (!EDBM_op_callf(em, op, "delete geom=%hef context=%i", BM_ELEM_SELECT, DEL_EDGESFACES)) + { continue; } break; @@ -812,7 +813,8 @@ static BMElem *edbm_add_edge_face_exec__tricky_extend_sel(BMesh *bm) ((edbm_add_edge_face_exec__vert_edge_lookup( v, nullptr, ed_pair, 3, BM_edge_is_boundary) == 2) && - (BM_edge_share_face_check(ed_pair[0], ed_pair[1]) == false))) { + (BM_edge_share_face_check(ed_pair[0], ed_pair[1]) == false))) + { BMEdge *e_other = BM_edge_exists(BM_edge_other_vert(ed_pair[0], v), BM_edge_other_vert(ed_pair[1], v)); BM_edge_select_set(bm, ed_pair[0], true); @@ -865,7 +867,8 @@ static BMElem *edbm_add_edge_face_exec__tricky_extend_sel(BMesh *bm) (edbm_add_edge_face_exec__vert_edge_lookup( e->v2, e, ed_pair_v2, 2, BM_edge_is_boundary) == 1) && (BM_edge_share_face_check(e, ed_pair_v1[0]) == false) && - (BM_edge_share_face_check(e, ed_pair_v2[0]) == false))) { + (BM_edge_share_face_check(e, ed_pair_v2[0]) == false))) + { BMVert *v1_other = BM_edge_other_vert(ed_pair_v1[0], e->v1); BMVert *v2_other = BM_edge_other_vert(ed_pair_v2[0], e->v2); BMEdge *e_other = (v1_other != v2_other) ? BM_edge_exists(v1_other, v2_other) : nullptr; @@ -960,7 +963,8 @@ static int edbm_add_edge_face_exec(bContext *C, wmOperator *op) "contextual_create geom=%hfev mat_nr=%i use_smooth=%b", BM_ELEM_SELECT, em->mat_nr, - use_smooth)) { + use_smooth)) + { continue; } @@ -976,7 +980,8 @@ static int edbm_add_edge_face_exec(bContext *C, wmOperator *op) * but being able to press F many times to add geometry is too useful! */ if (ele_desel && (BMO_slot_buffer_len(bmop.slots_out, "faces.out") == 1) && (ele_desel_face = static_cast( - BMO_slot_buffer_get_first(bmop.slots_out, "faces.out")))) { + BMO_slot_buffer_get_first(bmop.slots_out, "faces.out")))) + { edbm_add_edge_face_exec__tricky_finalize_sel(em->bm, ele_desel, ele_desel_face); } else @@ -1231,9 +1236,8 @@ static bool edbm_connect_vert_pair(BMEditMesh *em, Mesh *me, wmOperator *op) } if (BM_vert_pair_share_face_check_cb( - verts[0], - verts[1], - BM_elem_cb_check_hflag_disabled_simple(BMFace *, BM_ELEM_HIDDEN))) { + verts[0], verts[1], BM_elem_cb_check_hflag_disabled_simple(BMFace *, BM_ELEM_HIDDEN))) + { check_degenerate = false; is_pair = false; } @@ -1247,7 +1251,8 @@ static bool edbm_connect_vert_pair(BMEditMesh *em, Mesh *me, wmOperator *op) verts, verts_len, BM_ELEM_HIDDEN, - BM_ELEM_HIDDEN)) { + BM_ELEM_HIDDEN)) + { checks_succeded = false; } } @@ -1259,7 +1264,8 @@ static bool edbm_connect_vert_pair(BMEditMesh *em, Mesh *me, wmOperator *op) verts, verts_len, BM_ELEM_HIDDEN, - check_degenerate)) { + check_degenerate)) + { checks_succeded = false; } } @@ -1362,7 +1368,8 @@ static bool bm_vert_is_select_history_open(BMesh *bm) if ((BM_iter_elem_count_flag(BM_EDGES_OF_VERT, (BMVert *)ele_a->ele, BM_ELEM_SELECT, true) == 1) && (BM_iter_elem_count_flag(BM_EDGES_OF_VERT, (BMVert *)ele_b->ele, BM_ELEM_SELECT, true) == - 1)) { + 1)) + { return true; } } @@ -1671,7 +1678,8 @@ static int edbm_vert_connect_concave_exec(bContext *C, wmOperator *op) } if (!EDBM_op_call_and_selectf( - em, op, "faces.out", true, "connect_verts_concave faces=%hf", BM_ELEM_SELECT)) { + em, op, "faces.out", true, "connect_verts_concave faces=%hf", BM_ELEM_SELECT)) + { continue; } EDBMUpdate_Params params{}; @@ -1729,7 +1737,8 @@ static int edbm_vert_connect_nonplaner_exec(bContext *C, wmOperator *op) true, "connect_verts_nonplanar faces=%hf angle_limit=%f", BM_ELEM_SELECT, - angle_limit)) { + angle_limit)) + { continue; } @@ -1798,12 +1807,9 @@ static int edbm_face_make_planar_exec(bContext *C, wmOperator *op) continue; } - if (!EDBM_op_callf(em, - op, - "planar_faces faces=%hf iterations=%i factor=%f", - BM_ELEM_SELECT, - repeat, - fac)) { + if (!EDBM_op_callf( + em, op, "planar_faces faces=%hf iterations=%i factor=%f", BM_ELEM_SELECT, repeat, fac)) + { continue; } @@ -1887,9 +1893,9 @@ static bool edbm_edge_split_selected_verts(wmOperator *op, Object *obedit, BMEdi BM_ITER_MESH (eed, &iter, bm, BM_EDGES_OF_MESH) { BM_elem_flag_disable(eed, BM_ELEM_TAG); if (eed->l != nullptr) { - if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && - (BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) || - BM_elem_flag_test(eed->v2, BM_ELEM_SELECT))) { + if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && (BM_elem_flag_test(eed->v1, BM_ELEM_SELECT) || + BM_elem_flag_test(eed->v2, BM_ELEM_SELECT))) + { BM_elem_flag_enable(eed, BM_ELEM_TAG); } /* Store selection in loop tags. */ @@ -1905,7 +1911,8 @@ static bool edbm_edge_split_selected_verts(wmOperator *op, Object *obedit, BMEdi "split_edges edges=%he verts=%hv use_verts=%b", BM_ELEM_TAG, BM_ELEM_SELECT, - true)) { + true)) + { return false; } @@ -2736,7 +2743,8 @@ static int edbm_do_smooth_vertex_exec(bContext *C, wmOperator *op) clip_dist, xaxis, yaxis, - zaxis)) { + zaxis)) + { continue; } } @@ -2842,7 +2850,8 @@ static int edbm_do_smooth_laplacian_vertex_exec(bContext *C, wmOperator *op) usex, usey, usez, - preserve_volume)) { + preserve_volume)) + { failed_repeat_loop = true; break; } @@ -3333,13 +3342,14 @@ static bool merge_firstlast(BMEditMesh *em, if (use_uvmerge) { if (!EDBM_op_callf( - em, wmop, "pointmerge_facedata verts=%hv vert_snap=%e", BM_ELEM_SELECT, mergevert)) { + em, wmop, "pointmerge_facedata verts=%hv vert_snap=%e", BM_ELEM_SELECT, mergevert)) + { return false; } } - if (!EDBM_op_callf( - em, wmop, "pointmerge verts=%hv merge_co=%v", BM_ELEM_SELECT, mergevert->co)) { + if (!EDBM_op_callf(em, wmop, "pointmerge verts=%hv merge_co=%v", BM_ELEM_SELECT, mergevert->co)) + { return false; } @@ -3507,7 +3517,8 @@ static const EnumPropertyItem *merge_type_itemf(bContext *C, if (em->selectmode & SCE_SELECT_VERTEX) { if (em->bm->selected.first && em->bm->selected.last && ((BMEditSelection *)em->bm->selected.first)->htype == BM_VERT && - ((BMEditSelection *)em->bm->selected.last)->htype == BM_VERT) { + ((BMEditSelection *)em->bm->selected.last)->htype == BM_VERT) + { RNA_enum_items_add_value(&item, &totitem, merge_type_items, MESH_MERGE_FIRST); RNA_enum_items_add_value(&item, &totitem, merge_type_items, MESH_MERGE_LAST); } @@ -3893,7 +3904,8 @@ static const EnumPropertyItem *shape_itemf(bContext *C, int totitem = 0; if ((obedit && obedit->type == OB_MESH) && (em = BKE_editmesh_from_object(obedit)) && - CustomData_has_layer(&em->bm->vdata, CD_SHAPEKEY)) { + CustomData_has_layer(&em->bm->vdata, CD_SHAPEKEY)) + { EnumPropertyItem tmp = {0, "", 0, "", ""}; int a; @@ -3987,8 +3999,8 @@ static int edbm_solidify_exec(bContext *C, wmOperator *op) BMOperator bmop; - if (!EDBM_op_init( - em, &bmop, op, "solidify geom=%hf thickness=%f", BM_ELEM_SELECT, thickness)) { + if (!EDBM_op_init(em, &bmop, op, "solidify geom=%hf thickness=%f", BM_ELEM_SELECT, thickness)) + { continue; } @@ -4281,7 +4293,8 @@ static int edbm_knife_cut_exec(bContext *C, wmOperator *op) BM_ITER_MESH_INDEX (bv, &iter, bm, BM_VERTS_OF_MESH, i) { if (ED_view3d_project_float_object(region, bv->co, *sco, V3D_PROJ_TEST_CLIP_NEAR) != - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { copy_v2_fl(*sco, FLT_MAX); /* set error value */ } BM_elem_index_set(bv, i); /* set_inline */ @@ -4874,7 +4887,8 @@ static int edbm_fill_exec(bContext *C, wmOperator *op) BMOperator bmop; if (!EDBM_op_init( - em, &bmop, op, "triangle_fill edges=%he use_beauty=%b", BM_ELEM_SELECT, use_beauty)) { + em, &bmop, op, "triangle_fill edges=%he use_beauty=%b", BM_ELEM_SELECT, use_beauty)) + { continue; } @@ -5016,7 +5030,8 @@ static bool edbm_fill_grid_prepare(BMesh *bm, int offset, int *span_p, const boo int i; if (v_act && (v_act_link = static_cast( - BLI_findptr(verts, v_act, offsetof(LinkData, data))))) { + BLI_findptr(verts, v_act, offsetof(LinkData, data))))) + { /* pass */ } else { @@ -5081,7 +5096,8 @@ static bool edbm_fill_grid_prepare(BMesh *bm, int offset, int *span_p, const boo /* now find the first... */ for (v_link = static_cast(verts->first), i = 0; i < verts_len / 2; - v_link = v_link->next, i++) { + v_link = v_link->next, i++) + { BMVert *v = static_cast(v_link->data); if (BM_elem_flag_test(v, BM_ELEM_TAG)) { if (v != v_act) { @@ -5146,7 +5162,8 @@ static int edbm_fill_grid_exec(bContext *C, wmOperator *op) /* Only reuse on redo because these settings need to match the current selection. * We never want to use them on other geometry, repeat last for eg, see: #60777. */ if (((op->flag & OP_IS_INVOKE) || (op->flag & OP_IS_REPEAT_LAST) == 0) && - RNA_property_is_set(op->ptr, prop_span)) { + RNA_property_is_set(op->ptr, prop_span)) + { span = RNA_property_int_get(op->ptr, prop_span); calc_span = false; } @@ -5173,7 +5190,8 @@ static int edbm_fill_grid_exec(bContext *C, wmOperator *op) use_prepare ? BM_ELEM_TAG : BM_ELEM_SELECT, em->mat_nr, use_smooth, - use_interp_simple)) { + use_interp_simple)) + { continue; } @@ -5271,7 +5289,8 @@ static int edbm_fill_holes_exec(bContext *C, wmOperator *op) } if (!EDBM_op_call_and_selectf( - em, op, "faces.out", true, "holes_fill edges=%he sides=%i", BM_ELEM_SELECT, sides)) { + em, op, "faces.out", true, "holes_fill edges=%he sides=%i", BM_ELEM_SELECT, sides)) + { continue; } @@ -5353,13 +5372,9 @@ static int edbm_beautify_fill_exec(bContext *C, wmOperator *op) hflag = BM_ELEM_TAG; } - if (!EDBM_op_call_and_selectf(em, - op, - "geom.out", - true, - "beautify_fill faces=%hf edges=%he", - BM_ELEM_SELECT, - hflag)) { + if (!EDBM_op_call_and_selectf( + em, op, "geom.out", true, "beautify_fill faces=%hf edges=%he", BM_ELEM_SELECT, hflag)) + { continue; } @@ -5673,7 +5688,8 @@ static int edbm_tris_convert_to_quads_exec(bContext *C, wmOperator *op) do_sharp, do_uvs, do_vcols, - do_materials)) { + do_materials)) + { continue; } @@ -6007,7 +6023,8 @@ static int edbm_dissolve_verts_exec(bContext *C, wmOperator *op) "dissolve_verts verts=%hv use_face_split=%b use_boundary_tear=%b", BM_ELEM_SELECT, use_face_split, - use_boundary_tear)) { + use_boundary_tear)) + { continue; } @@ -6073,7 +6090,8 @@ static int edbm_dissolve_edges_exec(bContext *C, wmOperator *op) "dissolve_edges edges=%he use_verts=%b use_face_split=%b", BM_ELEM_SELECT, use_verts, - use_face_split)) { + use_face_split)) + { continue; } @@ -6139,7 +6157,8 @@ static int edbm_dissolve_faces_exec(bContext *C, wmOperator *op) true, "dissolve_faces faces=%hf use_verts=%b", BM_ELEM_SELECT, - use_verts)) { + use_verts)) + { continue; } @@ -6475,7 +6494,8 @@ static int edbm_delete_edgeloop_exec(bContext *C, wmOperator *op) "dissolve_edges edges=%he use_verts=%b use_face_split=%b", BM_ELEM_SELECT, true, - use_face_split)) { + use_face_split)) + { continue; } @@ -7139,7 +7159,8 @@ static int edbm_sort_elements_exec(bContext *C, wmOperator *op) if (!((elem_types & BM_VERT && bm->totvertsel > 0) || (elem_types & BM_EDGE && bm->totedgesel > 0) || - (elem_types & BM_FACE && bm->totfacesel > 0))) { + (elem_types & BM_FACE && bm->totfacesel > 0))) + { continue; } @@ -7782,7 +7803,8 @@ static int edbm_convex_hull_exec(bContext *C, wmOperator *op) &bmop, "geom.out", angle_face_threshold, - angle_shape_threshold)) { + angle_shape_threshold)) + { EDBM_op_finish(em, &bmop, op, true); continue; } @@ -7983,7 +8005,8 @@ static int mesh_symmetry_snap_exec(bContext *C, wmOperator *op) BM_ITER_MESH_INDEX (v, &iter, bm, BM_VERTS_OF_MESH, i) { if ((BM_elem_flag_test(v, BM_ELEM_SELECT) != false) && - (BM_elem_flag_test(v, BM_ELEM_TAG) == false)) { + (BM_elem_flag_test(v, BM_ELEM_TAG) == false)) + { int i_mirr = index[i]; if (i_mirr != -1) { @@ -8952,7 +8975,8 @@ static void normals_split(BMesh *bm) do { if (BM_elem_flag_test(l_curr->v, BM_ELEM_SELECT) && (!BM_elem_flag_test(l_curr->e, BM_ELEM_TAG) || - (!BM_elem_flag_test(l_curr, BM_ELEM_TAG) && BM_loop_check_cyclic_smooth_fan(l_curr)))) { + (!BM_elem_flag_test(l_curr, BM_ELEM_TAG) && BM_loop_check_cyclic_smooth_fan(l_curr)))) + { if (!BM_elem_flag_test(l_curr->e, BM_ELEM_TAG) && !BM_elem_flag_test(l_curr->prev->e, BM_ELEM_TAG)) { const int loop_index = BM_elem_index_get(l_curr); @@ -9182,8 +9206,8 @@ static int edbm_average_normals_exec(bContext *C, wmOperator *op) do { if (BM_elem_flag_test(l_curr->v, BM_ELEM_SELECT) && (!BM_elem_flag_test(l_curr->e, BM_ELEM_TAG) || - (!BM_elem_flag_test(l_curr, BM_ELEM_TAG) && - BM_loop_check_cyclic_smooth_fan(l_curr)))) { + (!BM_elem_flag_test(l_curr, BM_ELEM_TAG) && BM_loop_check_cyclic_smooth_fan(l_curr)))) + { if (!BM_elem_flag_test(l_curr->e, BM_ELEM_TAG) && !BM_elem_flag_test(l_curr->prev->e, BM_ELEM_TAG)) { const int loop_index = BM_elem_index_get(l_curr); diff --git a/source/blender/editors/mesh/editmesh_undo.cc b/source/blender/editors/mesh/editmesh_undo.cc index 6f23f9b3dd6..f828dcb6560 100644 --- a/source/blender/editors/mesh/editmesh_undo.cc +++ b/source/blender/editors/mesh/editmesh_undo.cc @@ -686,8 +686,9 @@ static UndoMesh **mesh_undostep_reference_elems_from_objects(Object **object, in UndoMesh *um_iter = static_cast(um_arraystore.local_links.last); while (um_iter && (uuid_map_len != 0)) { UndoMesh **um_p; - if ((um_p = static_cast(BLI_ghash_popkey( - uuid_map, POINTER_FROM_INT(um_iter->me.id.session_uuid), nullptr)))) { + if ((um_p = static_cast( + BLI_ghash_popkey(uuid_map, POINTER_FROM_INT(um_iter->me.id.session_uuid), nullptr)))) + { *um_p = um_iter; uuid_map_len--; } diff --git a/source/blender/editors/mesh/editmesh_utils.c b/source/blender/editors/mesh/editmesh_utils.c index a661a82500f..8b068dd5308 100644 --- a/source/blender/editors/mesh/editmesh_utils.c +++ b/source/blender/editors/mesh/editmesh_utils.c @@ -913,7 +913,8 @@ static bool seam_connected_recursive(BMEdge *edge, const float *luv_far = BM_ELEM_CD_GET_FLOAT_P(loop->prev, cd_loop_uv_offset); if (seam_connected_recursive( - loop->prev->e, luv_anchor, luv_far, needle, visited, cd_loop_uv_offset)) { + loop->prev->e, luv_anchor, luv_far, needle, visited, cd_loop_uv_offset)) + { return true; } } @@ -929,7 +930,8 @@ static bool seam_connected_recursive(BMEdge *edge, const float *luv_far = BM_ELEM_CD_GET_FLOAT_P(loop->next->next, cd_loop_uv_offset); if (seam_connected_recursive( - loop->next->e, luv_anchor, luv_far, needle, visited, cd_loop_uv_offset)) { + loop->next->e, luv_anchor, luv_far, needle, visited, cd_loop_uv_offset)) + { return true; } } @@ -1429,7 +1431,8 @@ BMEdge *EDBM_verts_mirror_get_edge(BMEditMesh *em, BMEdge *e) if ((v1_mirr = EDBM_verts_mirror_get(em, e->v1)) && (v2_mirr = EDBM_verts_mirror_get(em, e->v2)) && /* While highly unlikely, a zero length central edges vertices can match, see #89342. */ - LIKELY(v1_mirr != v2_mirr)) { + LIKELY(v1_mirr != v2_mirr)) + { return BM_edge_exists(v1_mirr, v2_mirr); } @@ -1957,7 +1960,8 @@ void EDBM_project_snap_verts( NULL, NULL, co_proj, - NULL)) { + NULL)) + { mul_v3_m4v3(eve->co, obedit->world_to_object, co_proj); } } diff --git a/source/blender/editors/mesh/mesh_data.cc b/source/blender/editors/mesh/mesh_data.cc index 95741378530..9c0a393d52a 100644 --- a/source/blender/editors/mesh/mesh_data.cc +++ b/source/blender/editors/mesh/mesh_data.cc @@ -441,7 +441,8 @@ bool ED_mesh_color_ensure(Mesh *me, const char *name) char unique_name[MAX_CUSTOMDATA_LAYER_NAME]; BKE_id_attribute_calc_unique_name(&me->id, name, unique_name); if (!me->attributes_for_write().add( - unique_name, ATTR_DOMAIN_CORNER, CD_PROP_BYTE_COLOR, bke::AttributeInitDefaultValue())) { + unique_name, ATTR_DOMAIN_CORNER, CD_PROP_BYTE_COLOR, bke::AttributeInitDefaultValue())) + { return false; } @@ -473,7 +474,8 @@ int ED_mesh_sculpt_color_add(Mesh *me, const char *name, const bool do_init, Rep } if (const CustomDataLayer *layer = BKE_id_attribute_find( - &me->id, me->active_color_attribute, CD_PROP_COLOR, ATTR_DOMAIN_POINT)) { + &me->id, me->active_color_attribute, CD_PROP_COLOR, ATTR_DOMAIN_POINT)) + { int dummy; const CustomData *data = mesh_customdata_get_type(me, BM_LOOP, &dummy); return CustomData_get_named_layer(data, CD_PROP_BYTE_COLOR, layer->name); diff --git a/source/blender/editors/mesh/mesh_mirror.cc b/source/blender/editors/mesh/mesh_mirror.cc index 43945ad3a6f..3215cd8c92e 100644 --- a/source/blender/editors/mesh/mesh_mirror.cc +++ b/source/blender/editors/mesh/mesh_mirror.cc @@ -147,7 +147,8 @@ bool ED_mesh_mirrtopo_recalc_check(BMEditMesh *em, Mesh *me, MirrTopoStore_t *me if ((mesh_topo_store->index_lookup == nullptr) || (mesh_topo_store->prev_is_editmode != is_editmode) || - (totvert != mesh_topo_store->prev_vert_tot) || (totedge != mesh_topo_store->prev_edge_tot)) { + (totvert != mesh_topo_store->prev_vert_tot) || (totedge != mesh_topo_store->prev_edge_tot)) + { return true; } return false; diff --git a/source/blender/editors/mesh/meshtools.cc b/source/blender/editors/mesh/meshtools.cc index 9bcdf03cc04..279a02d4c38 100644 --- a/source/blender/editors/mesh/meshtools.cc +++ b/source/blender/editors/mesh/meshtools.cc @@ -1238,7 +1238,8 @@ static void ed_mesh_pick_face_vert__mpoly_find( float sco[2]; const int v_idx = corner_verts[poly[j]]; if (ED_view3d_project_float_object(region, vert_positions[v_idx], sco, V3D_PROJ_TEST_NOP) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { const float len_test = len_manhattan_v2v2(mval, sco); if (len_test < *r_len_best) { *r_len_best = len_test; @@ -1348,7 +1349,8 @@ static void ed_mesh_pick_vert__mapFunc(void *userData, } float sco[2]; if (ED_view3d_project_float_object(data->region, co, sco, V3D_PROJ_TEST_CLIP_DEFAULT) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { const float len = len_manhattan_v2v2(data->mval_f, sco); if (len < data->len_best) { data->len_best = len; diff --git a/source/blender/editors/object/object_add.cc b/source/blender/editors/object/object_add.cc index 7e26d156208..108c74e11ae 100644 --- a/source/blender/editors/object/object_add.cc +++ b/source/blender/editors/object/object_add.cc @@ -688,7 +688,8 @@ static int object_add_exec(bContext *C, wmOperator *op) float loc[3], rot[3], radius; WM_operator_view3d_unit_defaults(C, op); if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) { + C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } radius = RNA_float_get(op->ptr, "radius"); @@ -757,7 +758,8 @@ static int lightprobe_add_exec(bContext *C, wmOperator *op) float loc[3], rot[3]; WM_operator_view3d_unit_defaults(C, op); if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) { + C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } int type = RNA_enum_get(op->ptr, "type"); @@ -849,7 +851,8 @@ static int effector_add_exec(bContext *C, wmOperator *op) float loc[3], rot[3]; WM_operator_view3d_unit_defaults(C, op); if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) { + C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } const ePFieldType type = static_cast(RNA_enum_get(op->ptr, "type")); @@ -928,7 +931,8 @@ static int object_camera_add_exec(bContext *C, wmOperator *op) bool enter_editmode; float loc[3], rot[3]; if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) { + C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } Object *ob = ED_object_add_type(C, OB_CAMERA, nullptr, loc, rot, false, local_view_bits); @@ -989,7 +993,8 @@ static int object_metaball_add_exec(bContext *C, wmOperator *op) float loc[3], rot[3]; WM_operator_view3d_unit_defaults(C, op); if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) { + C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } @@ -1061,7 +1066,8 @@ static int object_add_text_exec(bContext *C, wmOperator *op) WM_operator_view3d_unit_defaults(C, op); if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) { + C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } if (obedit && obedit->type == OB_FONT) { @@ -1116,7 +1122,8 @@ static int object_armature_add_exec(bContext *C, wmOperator *op) WM_operator_view3d_unit_defaults(C, op); if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) { + C, op, 'Z', loc, rot, nullptr, &enter_editmode, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } if ((obedit == nullptr) || (obedit->type != OB_ARMATURE)) { @@ -1178,7 +1185,8 @@ static int object_empty_add_exec(bContext *C, wmOperator *op) WM_operator_view3d_unit_defaults(C, op); if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) { + C, op, 'Z', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } ob = ED_object_add_type(C, OB_EMPTY, nullptr, loc, rot, false, local_view_bits); @@ -1239,7 +1247,8 @@ static int empty_drop_named_image_invoke(bContext *C, wmOperator *op, const wmEv float rot[3]; if (!ED_object_add_generic_get_opts( - C, op, 'Z', nullptr, rot, nullptr, nullptr, &local_view_bits, nullptr)) { + C, op, 'Z', nullptr, rot, nullptr, nullptr, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } ob = ED_object_add_type(C, OB_EMPTY, nullptr, nullptr, rot, false, local_view_bits); @@ -1333,7 +1342,8 @@ static int object_gpencil_add_exec(bContext *C, wmOperator *op) /* NOTE: We use 'Y' here (not 'Z'), as. */ WM_operator_view3d_unit_defaults(C, op); if (!ED_object_add_generic_get_opts( - C, op, 'Y', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) { + C, op, 'Y', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } /* Add new object if not currently editing a GP object. */ @@ -1592,7 +1602,8 @@ static int object_light_add_exec(bContext *C, wmOperator *op) WM_operator_view3d_unit_defaults(C, op); if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) { + C, op, 'Z', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } ob = ED_object_add_type(C, OB_LAMP, get_light_defname(type), loc, rot, false, local_view_bits); @@ -1705,7 +1716,8 @@ static std::optional collection_add_info_get_from_op(bContext nullptr, nullptr, &add_info.local_view_bits, - nullptr)) { + nullptr)) + { return std::nullopt; } @@ -1938,7 +1950,8 @@ static int object_data_instance_add_exec(bContext *C, wmOperator *op) } if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) { + C, op, 'Z', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } @@ -1986,7 +1999,8 @@ static int object_speaker_add_exec(bContext *C, wmOperator *op) ushort local_view_bits; float loc[3], rot[3]; if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) { + C, op, 'Z', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } Object *ob = ED_object_add_type(C, OB_SPEAKER, nullptr, loc, rot, false, local_view_bits); @@ -2046,7 +2060,8 @@ static int object_curves_random_add_exec(bContext *C, wmOperator *op) ushort local_view_bits; float loc[3], rot[3]; if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) { + C, op, 'Z', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } @@ -2081,7 +2096,8 @@ static int object_curves_empty_hair_add_exec(bContext *C, wmOperator *op) ushort local_view_bits; if (!ED_object_add_generic_get_opts( - C, op, 'Z', nullptr, nullptr, nullptr, nullptr, &local_view_bits, nullptr)) { + C, op, 'Z', nullptr, nullptr, nullptr, nullptr, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } @@ -2163,7 +2179,8 @@ static int object_pointcloud_add_exec(bContext *C, wmOperator *op) ushort local_view_bits; float loc[3], rot[3]; if (!ED_object_add_generic_get_opts( - C, op, 'Z', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) { + C, op, 'Z', loc, rot, nullptr, nullptr, &local_view_bits, nullptr)) + { return OPERATOR_CANCELLED; } @@ -2199,7 +2216,8 @@ void OBJECT_OT_pointcloud_add(wmOperatorType *ot) void ED_object_base_free_and_unlink(Main *bmain, Scene *scene, Object *ob) { if (ID_REAL_USERS(ob) <= 1 && ID_EXTRA_USERS(ob) == 0 && - BKE_library_ID_is_indirectly_used(bmain, ob)) { + BKE_library_ID_is_indirectly_used(bmain, ob)) + { /* We cannot delete indirectly used object... */ printf( "WARNING, undeletable object '%s', should have been caught before reaching this " @@ -2259,7 +2277,8 @@ static int object_delete_exec(bContext *C, wmOperator *op) } if (ID_REAL_USERS(ob) <= 1 && ID_EXTRA_USERS(ob) == 0 && - BKE_library_ID_is_indirectly_used(bmain, ob)) { + BKE_library_ID_is_indirectly_used(bmain, ob)) + { BKE_reportf(op->reports, RPT_WARNING, "Cannot delete object '%s' from scene '%s', indirectly used objects need at " @@ -2509,8 +2528,8 @@ static void make_object_duplilist_real(bContext *C, Object *object_eval = DEG_get_evaluated_object(depsgraph, base->object); - if (!(base->object->transflag & OB_DUPLI) && - !BKE_object_has_geometry_set_instances(object_eval)) { + if (!(base->object->transflag & OB_DUPLI) && !BKE_object_has_geometry_set_instances(object_eval)) + { return; } @@ -2821,7 +2840,8 @@ static bool object_convert_poll(bContext *C) Object *obact = base_act ? base_act->object : nullptr; if (obact == nullptr || obact->data == nullptr || ID_IS_LINKED(obact) || - ID_IS_OVERRIDE_LIBRARY(obact) || ID_IS_OVERRIDE_LIBRARY(obact->data)) { + ID_IS_OVERRIDE_LIBRARY(obact) || ID_IS_OVERRIDE_LIBRARY(obact->data)) + { return false; } @@ -2949,7 +2969,8 @@ static int object_convert_exec(bContext *C, wmOperator *op) * But at the very least, do not do that with linked IDs! */ if ((!BKE_id_is_editable(bmain, &ob->id) || (ob->data && !BKE_id_is_editable(bmain, static_cast(ob->data)))) && - !keep_original) { + !keep_original) + { keep_original = true; BKE_report(op->reports, RPT_INFO, @@ -3225,7 +3246,8 @@ static int object_convert_exec(bContext *C, wmOperator *op) /* other users */ if (ID_REAL_USERS(&cu->id) > 1) { for (ob1 = static_cast(bmain->objects.first); ob1; - ob1 = static_cast(ob1->id.next)) { + ob1 = static_cast(ob1->id.next)) + { if (ob1->data == ob->data) { ob1->type = OB_CURVES_LEGACY; DEG_id_tag_update(&ob1->id, @@ -3455,7 +3477,8 @@ static int object_convert_exec(bContext *C, wmOperator *op) if (ob_mball->type == OB_MBALL) { Object *ob_basis = nullptr; if (!BKE_mball_is_basis(ob_mball) && - ((ob_basis = BKE_mball_basis_find(scene, ob_mball)) && (ob_basis->flag & OB_DONE))) { + ((ob_basis = BKE_mball_basis_find(scene, ob_mball)) && (ob_basis->flag & OB_DONE))) + { ED_object_base_free_and_unlink(bmain, scene, ob_mball); } } @@ -4107,7 +4130,8 @@ static bool object_join_poll(bContext *C) Object *ob = CTX_data_active_object(C); if (ob == nullptr || ob->data == nullptr || ID_IS_LINKED(ob) || ID_IS_OVERRIDE_LIBRARY(ob) || - ID_IS_OVERRIDE_LIBRARY(ob->data)) { + ID_IS_OVERRIDE_LIBRARY(ob->data)) + { return false; } @@ -4213,7 +4237,8 @@ static bool join_shapes_poll(bContext *C) Object *ob = CTX_data_active_object(C); if (ob == nullptr || ob->data == nullptr || ID_IS_LINKED(ob) || ID_IS_OVERRIDE_LIBRARY(ob) || - ID_IS_OVERRIDE_LIBRARY(ob->data)) { + ID_IS_OVERRIDE_LIBRARY(ob->data)) + { return false; } diff --git a/source/blender/editors/object/object_bake_api.cc b/source/blender/editors/object/object_bake_api.cc index 49cc126c6a6..774c2507961 100644 --- a/source/blender/editors/object/object_bake_api.cc +++ b/source/blender/editors/object/object_bake_api.cc @@ -550,11 +550,13 @@ static bool bake_pass_filter_check(eScenePassType pass_type, } if (((pass_filter & R_BAKE_PASS_FILTER_DIRECT) != 0) || - ((pass_filter & R_BAKE_PASS_FILTER_INDIRECT) != 0)) { + ((pass_filter & R_BAKE_PASS_FILTER_INDIRECT) != 0)) + { if (((pass_filter & R_BAKE_PASS_FILTER_DIFFUSE) != 0) || ((pass_filter & R_BAKE_PASS_FILTER_GLOSSY) != 0) || ((pass_filter & R_BAKE_PASS_FILTER_TRANSM) != 0) || - ((pass_filter & R_BAKE_PASS_FILTER_SUBSURFACE) != 0)) { + ((pass_filter & R_BAKE_PASS_FILTER_SUBSURFACE) != 0)) + { return true; } @@ -576,7 +578,8 @@ static bool bake_pass_filter_check(eScenePassType pass_type, case SCE_PASS_SUBSURFACE_COLOR: if (((pass_filter & R_BAKE_PASS_FILTER_COLOR) != 0) || ((pass_filter & R_BAKE_PASS_FILTER_DIRECT) != 0) || - ((pass_filter & R_BAKE_PASS_FILTER_INDIRECT) != 0)) { + ((pass_filter & R_BAKE_PASS_FILTER_INDIRECT) != 0)) + { return true; } else { @@ -1430,7 +1433,8 @@ static int bake(const BakeAPIRender *bkr, /* for multires bake, use linear UV subdivision to match low res UVs */ if (bkr->pass_type == SCE_PASS_NORMAL && bkr->normal_space == R_BAKE_SPACE_TANGENT && - !bkr->is_selected_to_active) { + !bkr->is_selected_to_active) + { mmd_low = (MultiresModifierData *)BKE_modifiers_findby_type(ob_low, eModifierType_Multires); if (mmd_low) { mmd_flags_low = mmd_low->flags; @@ -1466,7 +1470,8 @@ static int bake(const BakeAPIRender *bkr, if (ob_cage) { me_cage_eval = bake_mesh_new_from_object(depsgraph, ob_cage_eval, preserve_origindex); if ((me_low_eval->totpoly != me_cage_eval->totpoly) || - (me_low_eval->totloop != me_cage_eval->totloop)) { + (me_low_eval->totloop != me_cage_eval->totloop)) + { BKE_report(reports, RPT_ERROR, "Invalid cage object, the cage mesh must have the same number " @@ -1565,7 +1570,8 @@ static int bake(const BakeAPIRender *bkr, bkr->max_ray_distance, ob_low_eval->object_to_world, (ob_cage ? ob_cage->object_to_world : ob_low_eval->object_to_world), - me_cage_eval)) { + me_cage_eval)) + { BKE_report(reports, RPT_ERROR, "Error handling selected objects"); goto cleanup; } @@ -1616,7 +1622,8 @@ static int bake(const BakeAPIRender *bkr, case R_BAKE_SPACE_WORLD: { /* Cycles internal format */ if ((bkr->normal_swizzle[0] == R_BAKE_POSX) && (bkr->normal_swizzle[1] == R_BAKE_POSY) && - (bkr->normal_swizzle[2] == R_BAKE_POSZ)) { + (bkr->normal_swizzle[2] == R_BAKE_POSZ)) + { break; } RE_bake_normal_world_to_world(pixel_array_low, @@ -1801,7 +1808,8 @@ static void bake_init_api_data(wmOperator *op, bContext *C, BakeAPIRender *bkr) } if (((bkr->pass_type == SCE_PASS_NORMAL) && (bkr->normal_space == R_BAKE_SPACE_TANGENT)) || - bkr->pass_type == SCE_PASS_UV) { + bkr->pass_type == SCE_PASS_UV) + { bkr->margin_type = R_BAKE_EXTEND; } } @@ -1835,7 +1843,8 @@ static int bake_exec(bContext *C, wmOperator *op) &bkr.selected_objects, bkr.reports, bkr.is_selected_to_active, - bkr.target)) { + bkr.target)) + { goto finally; } @@ -1854,7 +1863,8 @@ static int bake_exec(bContext *C, wmOperator *op) CollectionPointerLink *link; bkr.is_clear = bkr.is_clear && BLI_listbase_is_single(&bkr.selected_objects); for (link = static_cast(bkr.selected_objects.first); link; - link = link->next) { + link = link->next) + { Object *ob_iter = static_cast(link->ptr.data); result = bake(&bkr, ob_iter, nullptr, bkr.reports); } @@ -1890,7 +1900,8 @@ static void bake_startjob(void *bkv, bool * /*stop*/, bool *do_update, float *pr &bkr->selected_objects, bkr->reports, bkr->is_selected_to_active, - bkr->target)) { + bkr->target)) + { bkr->result = OPERATOR_CANCELLED; return; } @@ -1908,7 +1919,8 @@ static void bake_startjob(void *bkv, bool * /*stop*/, bool *do_update, float *pr CollectionPointerLink *link; bkr->is_clear = bkr->is_clear && BLI_listbase_is_single(&bkr->selected_objects); for (link = static_cast(bkr->selected_objects.first); link; - link = link->next) { + link = link->next) + { Object *ob_iter = static_cast(link->ptr.data); bkr->result = bake(bkr, ob_iter, nullptr, bkr->reports); diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c index 8d96dce3fc8..23c14078867 100644 --- a/source/blender/editors/object/object_collection.c +++ b/source/blender/editors/object/object_collection.c @@ -578,7 +578,8 @@ static int collection_unlink_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } if (ID_IS_OVERRIDE_LIBRARY(collection) && - collection->id.override_library->hierarchy_root != &collection->id) { + collection->id.override_library->hierarchy_root != &collection->id) + { BKE_report(op->reports, RPT_ERROR, "Cannot unlink a library override collection which is not the root of its override " diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 19e51bfa2d4..94747b73c6d 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -522,8 +522,8 @@ static void test_constraint( if (ct->tar->type != OB_ARMATURE) { con->flag |= CONSTRAINT_DISABLE; } - else if (!BKE_armature_find_bone_name(BKE_armature_from_object(ct->tar), - ct->subtarget)) { + else if (!BKE_armature_find_bone_name(BKE_armature_from_object(ct->tar), ct->subtarget)) + { /* bone must exist in armature... */ con->flag |= CONSTRAINT_DISABLE; } @@ -719,7 +719,8 @@ static bool edit_constraint_invoke_properties(bContext *C, ListBase *list; if (RNA_struct_property_is_set(op->ptr, "constraint") && - RNA_struct_property_is_set(op->ptr, "owner")) { + RNA_struct_property_is_set(op->ptr, "owner")) + { return true; } @@ -1064,7 +1065,8 @@ static int followpath_path_animate_exec(bContext *C, wmOperator *op) Curve *cu = (Curve *)data->tar->data; if (ELEM(NULL, cu->adt, cu->adt->action) || - (BKE_fcurve_find(&cu->adt->action->curves, "eval_time", 0) == NULL)) { + (BKE_fcurve_find(&cu->adt->action->curves, "eval_time", 0) == NULL)) + { /* create F-Curve for path animation */ act = ED_id_action_ensure(bmain, &cu->id); fcu = ED_action_fcurve_ensure(bmain, act, NULL, NULL, "eval_time", 0); @@ -2275,8 +2277,8 @@ static bool get_new_constraint_target( /* for armatures in pose mode, look inside the armature for the active bone * so that we set up cross-armature constraints with less effort */ - if ((ob->type == OB_ARMATURE) && (ob->mode & OB_MODE_POSE) && - (!only_curve && !only_mesh)) { + if ((ob->type == OB_ARMATURE) && (ob->mode & OB_MODE_POSE) && (!only_curve && !only_mesh)) + { /* Only use the object & bone if the bone is visible & selected * since we may have multiple objects in pose mode at once. */ diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c index 4da6d6df959..e51faafe33c 100644 --- a/source/blender/editors/object/object_data_transfer.c +++ b/source/blender/editors/object/object_data_transfer.c @@ -519,7 +519,8 @@ static int data_transfer_exec(bContext *C, wmOperator *op) mix_factor, NULL, false, - op->reports)) { + op->reports)) + { if (data_type == DT_TYPE_LNOR && use_create) { ((Mesh *)ob_dst->data)->flag |= ME_AUTOSMOOTH; diff --git a/source/blender/editors/object/object_data_transform.cc b/source/blender/editors/object/object_data_transform.cc index ff670681c31..5cf026393fe 100644 --- a/source/blender/editors/object/object_data_transform.cc +++ b/source/blender/editors/object/object_data_transform.cc @@ -155,7 +155,8 @@ static void edit_armature_coords_and_quats_get(const bArmature *arm, ElemData_Ar { ElemData_Armature *elem = elem_array; for (EditBone *ebone = static_cast(arm->edbo->first); ebone; - ebone = ebone->next, elem++) { + ebone = ebone->next, elem++) + { #define COPY_PTR(member) memcpy(elem->member, ebone->member, sizeof(ebone->member)) #define COPY_VAL(member) memcpy(&elem->member, &ebone->member, sizeof(ebone->member)) @@ -179,7 +180,8 @@ static void edit_armature_coords_and_quats_apply_with_mat4(bArmature *arm, { const ElemData_Armature *elem = elem_array; for (EditBone *ebone = static_cast(arm->edbo->first); ebone; - ebone = ebone->next, elem++) { + ebone = ebone->next, elem++) + { #define COPY_PTR(member) memcpy(ebone->member, elem->member, sizeof(ebone->member)) #define COPY_VAL(member) memcpy(&ebone->member, &elem->member, sizeof(ebone->member)) @@ -220,7 +222,8 @@ static void metaball_coords_and_quats_get(const MetaBall *mb, struct ElemData_Me { struct ElemData_MetaBall *elem = elem_array; for (const MetaElem *ml = static_cast(mb->elems.first); ml; - ml = ml->next, elem++) { + ml = ml->next, elem++) + { copy_v3_v3(elem->co, &ml->x); copy_qt_qt(elem->quat, ml->quat); copy_v3_v3(elem->exp, &ml->expx); diff --git a/source/blender/editors/object/object_edit.cc b/source/blender/editors/object/object_edit.cc index 9bc7b3a3320..2e79d4d59ef 100644 --- a/source/blender/editors/object/object_edit.cc +++ b/source/blender/editors/object/object_edit.cc @@ -171,7 +171,8 @@ Object **ED_object_array_in_mode_or_selected(bContext *C, ob = ob_active; } else if (ob_active && (ob_active->mode & - (OB_MODE_ALL_PAINT | OB_MODE_ALL_SCULPT | OB_MODE_ALL_PAINT_GPENCIL))) { + (OB_MODE_ALL_PAINT | OB_MODE_ALL_SCULPT | OB_MODE_ALL_PAINT_GPENCIL))) + { /* When painting, limit to active. */ ob = ob_active; } @@ -796,7 +797,8 @@ bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, Object *ob, int flag bool ok = false; if (ELEM(nullptr, ob, ob->data) || ID_IS_LINKED(ob) || ID_IS_OVERRIDE_LIBRARY(ob) || - ID_IS_OVERRIDE_LIBRARY(ob->data)) { + ID_IS_OVERRIDE_LIBRARY(ob->data)) + { return false; } @@ -958,7 +960,8 @@ static bool editmode_toggle_poll(bContext *C) /* Covers liboverrides too. */ if (ELEM(nullptr, ob, ob->data) || ID_IS_LINKED(ob->data) || ID_IS_OVERRIDE_LIBRARY(ob) || - ID_IS_OVERRIDE_LIBRARY(ob->data)) { + ID_IS_OVERRIDE_LIBRARY(ob->data)) + { return false; } @@ -1045,7 +1048,8 @@ static int posemode_exec(bContext *C, wmOperator *op) const View3D *v3d = CTX_wm_view3d(C); FOREACH_SELECTED_OBJECT_BEGIN (view_layer, v3d, ob) { if ((ob != obact) && (ob->type == OB_ARMATURE) && (ob->mode == OB_MODE_OBJECT) && - BKE_id_is_editable(bmain, &ob->id)) { + BKE_id_is_editable(bmain, &ob->id)) + { ED_object_posemode_enter_ex(bmain, ob); } } @@ -1091,7 +1095,8 @@ void ED_object_check_force_modifiers(Main *bmain, Scene *scene, Object *object) /* add/remove modifier as needed */ if (!md) { if (pd && (pd->shape == PFIELD_SHAPE_SURFACE) && - !ELEM(pd->forcefield, 0, PFIELD_GUIDE, PFIELD_TEXTURE)) { + !ELEM(pd->forcefield, 0, PFIELD_GUIDE, PFIELD_TEXTURE)) + { if (ELEM(object->type, OB_MESH, OB_SURF, OB_FONT, OB_CURVES_LEGACY)) { ED_object_modifier_add(nullptr, bmain, scene, object, nullptr, eModifierType_Surface); } @@ -1099,7 +1104,8 @@ void ED_object_check_force_modifiers(Main *bmain, Scene *scene, Object *object) } else { if (!pd || (pd->shape != PFIELD_SHAPE_SURFACE) || - ELEM(pd->forcefield, 0, PFIELD_GUIDE, PFIELD_TEXTURE)) { + ELEM(pd->forcefield, 0, PFIELD_GUIDE, PFIELD_TEXTURE)) + { ED_object_modifier_remove(nullptr, bmain, scene, object, md); } } @@ -1632,7 +1638,8 @@ static bool shade_poll(bContext *C) if (obact != nullptr) { /* Doesn't handle edit-data, sculpt dynamic-topology, or their undo systems. */ if (obact->mode & (OB_MODE_EDIT | OB_MODE_SCULPT) || obact->data == nullptr || - ID_IS_OVERRIDE_LIBRARY(obact) || ID_IS_OVERRIDE_LIBRARY(obact->data)) { + ID_IS_OVERRIDE_LIBRARY(obact) || ID_IS_OVERRIDE_LIBRARY(obact->data)) + { return false; } } diff --git a/source/blender/editors/object/object_hook.c b/source/blender/editors/object/object_hook.c index 11973901ad7..868bc12fe46 100644 --- a/source/blender/editors/object/object_hook.c +++ b/source/blender/editors/object/object_hook.c @@ -669,7 +669,8 @@ static int object_add_hook_newob_exec(bContext *C, wmOperator *op) Object *obedit = CTX_data_edit_object(C); if (add_hook_object( - C, bmain, scene, view_layer, v3d, obedit, NULL, OBJECT_ADDHOOK_NEWOB, op->reports)) { + C, bmain, scene, view_layer, v3d, obedit, NULL, OBJECT_ADDHOOK_NEWOB, op->reports)) + { DEG_id_tag_update(&scene->id, ID_RECALC_SELECT); WM_event_add_notifier(C, NC_SCENE | ND_OB_SELECT, scene); WM_event_add_notifier(C, NC_OBJECT | ND_MODIFIER, obedit); diff --git a/source/blender/editors/object/object_modes.cc b/source/blender/editors/object/object_modes.cc index 36ff752e60d..66ecf468f70 100644 --- a/source/blender/editors/object/object_modes.cc +++ b/source/blender/editors/object/object_modes.cc @@ -109,7 +109,8 @@ bool ED_object_mode_compat_test(const Object *ob, eObjectMode mode) switch (ob->type) { case OB_MESH: if (mode & (OB_MODE_EDIT | OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | - OB_MODE_TEXTURE_PAINT)) { + OB_MODE_TEXTURE_PAINT)) + { return true; } if (mode & OB_MODE_PARTICLE_EDIT) { diff --git a/source/blender/editors/object/object_modifier.cc b/source/blender/editors/object/object_modifier.cc index ca9ae5e255d..4306722b071 100644 --- a/source/blender/editors/object/object_modifier.cc +++ b/source/blender/editors/object/object_modifier.cc @@ -272,7 +272,8 @@ bool ED_object_iter_other(Main *bmain, int totfound = include_orig ? 0 : 1; for (ob = static_cast(bmain->objects.first); ob && totfound < users; - ob = reinterpret_cast(ob->id.next)) { + ob = reinterpret_cast(ob->id.next)) + { if (((ob != orig_ob) || include_orig) && (ob->data == orig_ob->data)) { if (callback(ob, callback_data)) { return true; @@ -365,7 +366,8 @@ static bool object_modifier_remove( } if (ELEM(md->type, eModifierType_Softbody, eModifierType_Cloth) && - BLI_listbase_is_empty(&ob->particlesystem)) { + BLI_listbase_is_empty(&ob->particlesystem)) + { ob->mode &= ~OB_MODE_PARTICLE_EDIT; } @@ -782,7 +784,8 @@ static Mesh *create_applied_mesh_for_modifier(Depsgraph *depsgraph, for (ModifierData *md_eval_virt = BKE_modifiers_get_virtual_modifierlist(ob_eval, &virtualModifierData); md_eval_virt && (md_eval_virt != ob_eval->modifiers.first); - md_eval_virt = md_eval_virt->next) { + md_eval_virt = md_eval_virt->next) + { if (!BKE_modifier_is_enabled(scene, md_eval_virt, eModifierMode_Realtime)) { continue; } @@ -935,12 +938,14 @@ static void remove_invalid_attribute_strings(Mesh &mesh) bke::AttributeAccessor attributes = mesh.attributes(); if (!meta_data_matches(attributes.lookup_meta_data(mesh.active_color_attribute), ATTR_DOMAIN_MASK_COLOR, - CD_MASK_COLOR_ALL)) { + CD_MASK_COLOR_ALL)) + { MEM_SAFE_FREE(mesh.active_color_attribute); } if (!meta_data_matches(attributes.lookup_meta_data(mesh.default_color_attribute), ATTR_DOMAIN_MASK_COLOR, - CD_MASK_COLOR_ALL)) { + CD_MASK_COLOR_ALL)) + { MEM_SAFE_FREE(mesh.default_color_attribute); } } @@ -1147,7 +1152,8 @@ bool ED_object_modifier_apply(Main *bmain, return false; } if ((ob->mode & OB_MODE_SCULPT) && find_multires_modifier_before(scene, md) && - (BKE_modifier_is_same_topology(md) == false)) { + (BKE_modifier_is_same_topology(md) == false)) + { BKE_report(reports, RPT_ERROR, "Constructive modifier cannot be applied to multi-res data in sculpt mode"); @@ -1172,7 +1178,8 @@ bool ED_object_modifier_apply(Main *bmain, * * The idea is to create a dependency graph which does not perform those optimizations. */ if ((ob_eval->base_flag & BASE_ENABLED_VIEWPORT) == 0 || - (md_eval->mode & eModifierMode_Realtime) == 0) { + (md_eval->mode & eModifierMode_Realtime) == 0) + { ViewLayer *view_layer = DEG_get_input_view_layer(depsgraph); local_depsgraph = DEG_graph_new(bmain, scene, view_layer, DAG_EVAL_VIEWPORT); @@ -1716,7 +1723,8 @@ static bool modifier_apply_poll(bContext *C) } if (md != nullptr) { if ((ob->mode & OB_MODE_SCULPT) && find_multires_modifier_before(scene, md) && - (BKE_modifier_is_same_topology(md) == false)) { + (BKE_modifier_is_same_topology(md) == false)) + { CTX_wm_operator_poll_msg_set( C, "Constructive modifier cannot be applied to multi-res data in sculpt mode"); return false; @@ -1762,12 +1770,14 @@ static int modifier_apply_exec_ex(bContext *C, wmOperator *op, int apply_as, boo } if (!ED_object_modifier_apply( - bmain, op->reports, depsgraph, scene, ob, md, apply_as, keep_modifier)) { + bmain, op->reports, depsgraph, scene, ob, md, apply_as, keep_modifier)) + { return OPERATOR_CANCELLED; } if (ob->type == OB_MESH && do_merge_customdata && - (mti->type & (eModifierTypeType_Constructive | eModifierTypeType_Nonconstructive))) { + (mti->type & (eModifierTypeType_Constructive | eModifierTypeType_Nonconstructive))) + { BKE_mesh_merge_customdata_for_apply_modifier((Mesh *)ob->data); } @@ -1919,7 +1929,8 @@ static int modifier_convert_exec(bContext *C, wmOperator *op) ModifierData *md = edit_modifier_property_get(op, ob, 0); if (!md || !ED_object_modifier_convert_psys_to_mesh( - op->reports, bmain, depsgraph, scene, view_layer, ob, md)) { + op->reports, bmain, depsgraph, scene, view_layer, ob, md)) + { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 396db04aded..6cfd47adf27 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -823,7 +823,8 @@ static bool parent_set_nonvertex_parent(bContext *C, struct ParentingContext *pa parenting_context->partype, parenting_context->xmirror, parenting_context->keep_transform, - NULL)) { + NULL)) + { return false; } } @@ -854,7 +855,8 @@ static bool parent_set_vertex_parent_with_kdtree(bContext *C, parenting_context->partype, parenting_context->xmirror, parenting_context->keep_transform, - vert_par)) { + vert_par)) + { return false; } } @@ -1431,7 +1433,8 @@ static bool allow_make_links_data(const int type, Object *ob_src, Object *ob_dst /* Linking non-grease-pencil materials to a grease-pencil object causes issues. * We make sure that if one of the objects is a grease-pencil object, the other must be * as well. */ - ((ob_src->type == OB_GPENCIL_LEGACY) == (ob_dst->type == OB_GPENCIL_LEGACY))) { + ((ob_src->type == OB_GPENCIL_LEGACY) == (ob_dst->type == OB_GPENCIL_LEGACY))) + { return true; } break; @@ -1449,8 +1452,8 @@ static bool allow_make_links_data(const int type, Object *ob_src, Object *ob_dst } break; case MAKE_LINKS_FONTS: - if ((ob_src->data != ob_dst->data) && (ob_src->type == OB_FONT) && - (ob_dst->type == OB_FONT)) { + if ((ob_src->data != ob_dst->data) && (ob_src->type == OB_FONT) && (ob_dst->type == OB_FONT)) + { return true; } break; @@ -2289,7 +2292,8 @@ static int make_override_library_exec(bContext *C, wmOperator *op) bool user_overrides_from_selected_objects = false; if (!ID_IS_LINKED(obact) && obact->instance_collection != NULL && - ID_IS_LINKED(obact->instance_collection)) { + ID_IS_LINKED(obact->instance_collection)) + { if (!ID_IS_OVERRIDABLE_LIBRARY(obact->instance_collection)) { BKE_reportf(op->reports, RPT_ERROR_INVALID_INPUT, @@ -2385,7 +2389,8 @@ static int make_override_library_exec(bContext *C, wmOperator *op) } LISTBASE_FOREACH (CollectionObject *, coll_ob_iter, &coll_iter->gobject) { if (BLI_gset_haskey(user_overrides_objects_uids, - POINTER_FROM_UINT(coll_ob_iter->ob->id.session_uuid))) { + POINTER_FROM_UINT(coll_ob_iter->ob->id.session_uuid))) + { /* Tag for remapping when creating overrides. */ coll_iter->id.tag |= LIB_TAG_DOIT; break; @@ -2411,11 +2416,13 @@ static int make_override_library_exec(bContext *C, wmOperator *op) ID *id_iter; FOREACH_MAIN_ID_BEGIN (bmain, id_iter) { if (ID_IS_LINKED(id_iter) || !ID_IS_OVERRIDE_LIBRARY_REAL(id_iter) || - id_iter->override_library->hierarchy_root != id_hierarchy_root_override) { + id_iter->override_library->hierarchy_root != id_hierarchy_root_override) + { continue; } if (BLI_gset_haskey(user_overrides_objects_uids, - POINTER_FROM_UINT(id_iter->override_library->reference->session_uuid))) { + POINTER_FROM_UINT(id_iter->override_library->reference->session_uuid))) + { id_iter->override_library->flag &= ~IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED; } } @@ -2438,7 +2445,8 @@ static int make_override_library_exec(bContext *C, wmOperator *op) LISTBASE_FOREACH_MUTABLE ( CollectionParent *, collection_parent, &collection_root->runtime.parents) { if (ID_IS_LINKED(collection_parent->collection) || - !BKE_view_layer_has_collection(view_layer, collection_parent->collection)) { + !BKE_view_layer_has_collection(view_layer, collection_parent->collection)) + { continue; } BKE_collection_child_remove(bmain, collection_parent->collection, collection_root); @@ -2479,7 +2487,8 @@ static int make_override_library_invoke(bContext *C, wmOperator *op, const wmEve if ((!ID_IS_LINKED(obact) && obact->instance_collection != NULL && ID_IS_OVERRIDABLE_LIBRARY(obact->instance_collection)) || - make_override_library_object_overridable_check(bmain, obact)) { + make_override_library_object_overridable_check(bmain, obact)) + { return make_override_library_exec(C, op); } @@ -2496,7 +2505,8 @@ static int make_override_library_invoke(bContext *C, wmOperator *op, const wmEve LISTBASE_FOREACH (Collection *, collection, &bmain->collections) { /* Only check for directly linked collections. */ if (!ID_IS_LINKED(&collection->id) || (collection->id.tag & LIB_TAG_INDIRECT) != 0 || - !BKE_view_layer_has_collection(view_layer, collection)) { + !BKE_view_layer_has_collection(view_layer, collection)) + { continue; } if (BKE_collection_has_object_recursive(collection, obact)) { @@ -2637,7 +2647,8 @@ static int clear_override_library_exec(bContext *C, wmOperator *UNUSED(op)) FOREACH_SELECTED_OBJECT_END; for (todo_object_iter = todo_objects; todo_object_iter != NULL; - todo_object_iter = todo_object_iter->next) { + todo_object_iter = todo_object_iter->next) + { Object *ob_iter = todo_object_iter->link; if (BKE_lib_override_library_is_hierarchy_leaf(bmain, &ob_iter->id)) { bool do_remap_active = false; diff --git a/source/blender/editors/object/object_remesh.cc b/source/blender/editors/object/object_remesh.cc index a9ee1d32803..b403c16e8a3 100644 --- a/source/blender/editors/object/object_remesh.cc +++ b/source/blender/editors/object/object_remesh.cc @@ -388,7 +388,8 @@ static int voxel_size_edit_modal(bContext *C, wmOperator *op, const wmEvent *eve /* Cancel modal operator */ if ((event->type == EVT_ESCKEY && event->val == KM_PRESS) || - (event->type == RIGHTMOUSE && event->val == KM_PRESS)) { + (event->type == RIGHTMOUSE && event->val == KM_PRESS)) + { voxel_size_edit_cancel(C, op); ED_region_tag_redraw(region); return OPERATOR_FINISHED; @@ -397,7 +398,8 @@ static int voxel_size_edit_modal(bContext *C, wmOperator *op, const wmEvent *eve /* Finish modal operator */ if ((event->type == LEFTMOUSE && event->val == KM_RELEASE) || (event->type == EVT_RETKEY && event->val == KM_PRESS) || - (event->type == EVT_PADENTER && event->val == KM_PRESS)) { + (event->type == EVT_PADENTER && event->val == KM_PRESS)) + { ED_region_draw_cb_exit(region->type, cd->draw_handle); mesh->remesh_voxel_size = cd->voxel_size; MEM_freeN(op->customdata); diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index d99cf32f650..3e5963b6f7b 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -822,7 +822,8 @@ static bool select_grouped_collection(bContext *C, Object *ob) for (collection = bmain->collections.first; collection && (collection_count < COLLECTION_MENU_MAX); - collection = collection->id.next) { + collection = collection->id.next) + { if (BKE_collection_has_object(collection, ob)) { ob_collections[collection_count] = collection; collection_count++; diff --git a/source/blender/editors/object/object_transform.cc b/source/blender/editors/object/object_transform.cc index e006afc430a..67efc54f9d6 100644 --- a/source/blender/editors/object/object_transform.cc +++ b/source/blender/editors/object/object_transform.cc @@ -144,7 +144,8 @@ static void object_clear_rot(Object *ob, const bool clear_delta) ob->rotAxis[1] = 1.0f; } if (IS_EQF(ob->drotAxis[0], ob->drotAxis[1]) && IS_EQF(ob->drotAxis[1], ob->drotAxis[2]) && - clear_delta) { + clear_delta) + { ob->drotAxis[1] = 1.0f; } } @@ -712,7 +713,8 @@ static int apply_objects_internal(bContext *C, OB_FONT, OB_GPENCIL_LEGACY, OB_CURVES, - OB_POINTCLOUD)) { + OB_POINTCLOUD)) + { ID *obdata = static_cast(ob->data); if (!do_multi_user && ID_REAL_USERS(obdata) > 1) { BKE_reportf(reports, @@ -1397,7 +1399,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if (ob->data == nullptr) { /* Special support for instanced collections. */ if ((ob->transflag & OB_DUPLICOLLECTION) && ob->instance_collection && - (ob->instance_collection->id.tag & LIB_TAG_DOIT) == 0) { + (ob->instance_collection->id.tag & LIB_TAG_DOIT) == 0) + { if (!BKE_id_is_editable(bmain, &ob->instance_collection->id)) { tot_lib_error++; } @@ -1677,7 +1680,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) Curves &curves_id = *static_cast(ob->data); bke::CurvesGeometry &curves = curves_id.geometry.wrap(); if (ELEM(centermode, ORIGIN_TO_CENTER_OF_MASS_SURFACE, ORIGIN_TO_CENTER_OF_MASS_VOLUME) || - !ELEM(around, V3D_AROUND_CENTER_BOUNDS, V3D_AROUND_CENTER_MEDIAN)) { + !ELEM(around, V3D_AROUND_CENTER_BOUNDS, V3D_AROUND_CENTER_MEDIAN)) + { BKE_report( op->reports, RPT_WARNING, "Curves Object does not support this set origin operation"); continue; @@ -1712,7 +1716,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) bke::SpanAttributeWriter positions = attributes.lookup_or_add_for_write_span( "position", ATTR_DOMAIN_POINT); if (ELEM(centermode, ORIGIN_TO_CENTER_OF_MASS_SURFACE, ORIGIN_TO_CENTER_OF_MASS_VOLUME) || - !ELEM(around, V3D_AROUND_CENTER_BOUNDS, V3D_AROUND_CENTER_MEDIAN)) { + !ELEM(around, V3D_AROUND_CENTER_BOUNDS, V3D_AROUND_CENTER_MEDIAN)) + { BKE_report(op->reports, RPT_WARNING, "Point cloud object does not support this set origin operation"); @@ -1774,7 +1779,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op) if ((ob_other->flag & OB_DONE) == 0 && ((ob->data && (ob->data == ob_other->data)) || (ob->instance_collection == ob_other->instance_collection && - (ob->transflag | ob_other->transflag) & OB_DUPLICOLLECTION))) { + (ob->transflag | ob_other->transflag) & OB_DUPLICOLLECTION))) + { ob_other->flag |= OB_DONE; DEG_id_tag_update(&ob_other->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); @@ -2287,7 +2293,8 @@ static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const else { for (XFormAxisItem &item : xfd->object_data) { if (object_orient_to_location( - item.ob, item.rot_mat, item.rot_mat[2], location_world, item.is_z_flip)) { + item.ob, item.rot_mat, item.rot_mat[2], location_world, item.is_z_flip)) + { DEG_id_tag_update(&item.ob->id, ID_RECALC_TRANSFORM); WM_event_add_notifier(C, NC_OBJECT | ND_TRANSFORM, item.ob); } diff --git a/source/blender/editors/object/object_vgroup.cc b/source/blender/editors/object/object_vgroup.cc index 55e7e71b9e2..5c33228726d 100644 --- a/source/blender/editors/object/object_vgroup.cc +++ b/source/blender/editors/object/object_vgroup.cc @@ -98,7 +98,8 @@ static bool vertex_group_use_vert_sel(Object *ob) return true; } if ((ob->type == OB_MESH) && - ((Mesh *)ob->data)->editflag & (ME_EDIT_PAINT_VERT_SEL | ME_EDIT_PAINT_FACE_SEL)) { + ((Mesh *)ob->data)->editflag & (ME_EDIT_PAINT_VERT_SEL | ME_EDIT_PAINT_FACE_SEL)) + { return true; } return false; @@ -274,7 +275,8 @@ void ED_vgroup_parray_mirror_sync(Object *ob, /* get an array of all verts, not only selected */ if (ED_vgroup_parray_alloc( - static_cast(ob->data), &dvert_array_all, &dvert_tot_all, false) == false) { + static_cast(ob->data), &dvert_array_all, &dvert_tot_all, false) == false) + { BLI_assert(0); return; } @@ -314,7 +316,8 @@ void ED_vgroup_parray_mirror_assign(Object *ob, MDeformVert **dvert_array, const /* get an array of all verts, not only selected */ if (ED_vgroup_parray_alloc( - static_cast(ob->data), &dvert_array_all, &dvert_tot_all, false) == false) { + static_cast(ob->data), &dvert_array_all, &dvert_tot_all, false) == false) + { BLI_assert(0); return; } @@ -399,13 +402,15 @@ bool ED_vgroup_array_copy(Object *ob, Object *ob_from) ED_vgroup_parray_alloc(static_cast(ob->data), &dvert_array, &dvert_tot, false); if ((dvert_array == nullptr) && (dvert_array_from != nullptr) && - BKE_object_defgroup_data_create(static_cast(ob->data))) { + BKE_object_defgroup_data_create(static_cast(ob->data))) + { ED_vgroup_parray_alloc(static_cast(ob->data), &dvert_array, &dvert_tot, false); new_vgroup = true; } if (dvert_tot == 0 || (dvert_tot != dvert_tot_from) || dvert_array_from == nullptr || - dvert_array == nullptr) { + dvert_array == nullptr) + { if (dvert_array) { MEM_freeN(dvert_array); } @@ -2030,7 +2035,8 @@ void ED_vgroup_mirror(Object *ob, const ListBase *defbase = BKE_object_defgroup_list(ob); if ((mirror_weights == false && flip_vgroups == false) || - (BLI_findlink(defbase, def_nr) == nullptr)) { + (BLI_findlink(defbase, def_nr) == nullptr)) + { return; } @@ -3577,7 +3583,8 @@ static char *vgroup_init_remap(Object *ob) name = name_array; for (const bDeformGroup *def = static_cast(defbase->first); def; - def = def->next) { + def = def->next) + { BLI_strncpy(name, def->name, MAX_VGROUP_NAME); name += MAX_VGROUP_NAME; } diff --git a/source/blender/editors/physics/particle_edit.c b/source/blender/editors/physics/particle_edit.c index f6209976d8a..6afd2f34dcc 100644 --- a/source/blender/editors/physics/particle_edit.c +++ b/source/blender/editors/physics/particle_edit.c @@ -622,7 +622,8 @@ static bool key_inside_circle(const PEData *data, float rad, const float co[3], /* TODO: should this check V3D_PROJ_TEST_CLIP_BB too? */ if (ED_view3d_project_int_global(data->vc.region, co, screen_co, V3D_PROJ_TEST_CLIP_WIN) != - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { return 0; } @@ -650,12 +651,14 @@ static bool key_inside_rect(PEData *data, const float co[3]) int screen_co[2]; if (ED_view3d_project_int_global(data->vc.region, co, screen_co, V3D_PROJ_TEST_CLIP_WIN) != - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { return 0; } if (screen_co[0] > data->rect->xmin && screen_co[0] < data->rect->xmax && - screen_co[1] > data->rect->ymin && screen_co[1] < data->rect->ymax) { + screen_co[1] > data->rect->ymin && screen_co[1] < data->rect->ymax) + { return key_test_depth(data, co, screen_co); } @@ -1264,7 +1267,8 @@ static void pe_deflect_emitter(Scene *scene, Object *ob, PTCacheEdit *edit) const float dist = ED_view3d_select_dist_px() * 0.01f; if (edit == NULL || edit->psys == NULL || (pset->flag & PE_DEFLECT_EMITTER) == 0 || - (edit->psys->flag & PSYS_GLOBAL_HAIR)) { + (edit->psys->flag & PSYS_GLOBAL_HAIR)) + { return; } @@ -3769,7 +3773,8 @@ static void brush_cut(PEData *data, int pa_index) } if (ED_view3d_project_int_global(region, key->co, screen_co, V3D_PROJ_TEST_CLIP_NEAR) != - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { return; } @@ -3797,7 +3802,8 @@ static void brush_cut(PEData *data, int pa_index) if ((ED_view3d_project_int_global(region, key->co, screen_co, V3D_PROJ_TEST_CLIP_NEAR) != V3D_PROJ_RET_OK) || - key_test_depth(data, key->co, screen_co) == 0) { + key_test_depth(data, key->co, screen_co) == 0) + { x0 = (float)screen_co[0]; x1 = (float)screen_co[1]; @@ -4347,7 +4353,8 @@ static void brush_add_count_iter(void *__restrict iter_data_v, 0, 0, 0, - 0)) { + 0)) + { if (psys->part->use_modifier_stack && !BKE_mesh_is_deformed_only(psmd_eval->mesh_final)) { add_pars[iter].num = add_pars[iter].num_dmcache; add_pars[iter].num_dmcache = DMCACHE_ISCHILD; @@ -4761,7 +4768,8 @@ static void brush_edit_apply(bContext *C, wmOperator *op, PointerRNA *itemptr) if (((pset->brushtype == PE_BRUSH_ADD) ? (sqrtf(dx * dx + dy * dy) > pset->brush[PE_BRUSH_ADD].step) : (dx != 0 || dy != 0)) || - bedit->first) { + bedit->first) + { PEData data = bedit->data; data.context = C; /* TODO(mai): why isn't this set in bedit->data? */ diff --git a/source/blender/editors/physics/particle_object.c b/source/blender/editors/physics/particle_object.c index 0a2e4f53620..54e2afc4711 100644 --- a/source/blender/editors/physics/particle_object.c +++ b/source/blender/editors/physics/particle_object.c @@ -773,7 +773,8 @@ static bool remap_hair_emitter(Depsgraph *depsgraph, int i; for (i = 0, tpa = target_psys->particles, pa = psys->particles; i < target_psys->totpart; - i++, tpa++, pa++) { + i++, tpa++, pa++) + { float from_co[3]; BVHTreeNearest nearest; @@ -857,7 +858,8 @@ static bool remap_hair_emitter(Depsgraph *depsgraph, if (edit_point) { for (k = 0, key = pa->hair, tkey = tpa->hair, ekey = edit_point->keys; k < tpa->totkey; - k++, key++, tkey++, ekey++) { + k++, key++, tkey++, ekey++) + { float co_orig[3]; if (from_global) { @@ -1128,8 +1130,8 @@ static bool copy_particle_systems_to_object(const bContext *C, psys_start = totpsys > 0 ? tmp_psys[0] : NULL; /* now append psys to the object and make modifiers */ - for (i = 0, psys_from = PSYS_FROM_FIRST; i < totpsys; - ++i, psys_from = PSYS_FROM_NEXT(psys_from)) { + for (i = 0, psys_from = PSYS_FROM_FIRST; i < totpsys; ++i, psys_from = PSYS_FROM_NEXT(psys_from)) + { ParticleSystemModifierData *psmd; psys = tmp_psys[i]; @@ -1164,7 +1166,8 @@ static bool copy_particle_systems_to_object(const bContext *C, * the remapping otherwise makes final_dm invalid! */ for (psys = psys_start, psys_from = PSYS_FROM_FIRST, i = 0; psys; - psys = psys->next, psys_from = PSYS_FROM_NEXT(psys_from), i++) { + psys = psys->next, psys_from = PSYS_FROM_NEXT(psys_from), i++) + { float(*from_mat)[4], (*to_mat)[4]; switch (space) { diff --git a/source/blender/editors/physics/physics_fluid.c b/source/blender/editors/physics/physics_fluid.c index 2383a3b85c9..2c95f9e932b 100644 --- a/source/blender/editors/physics/physics_fluid.c +++ b/source/blender/editors/physics/physics_fluid.c @@ -617,7 +617,8 @@ static int fluid_free_exec(struct bContext *C, struct wmOperator *op) /* Cannot free data if other bakes currently working */ if (fmd->domain->cache_flag & (FLUID_DOMAIN_BAKING_DATA | FLUID_DOMAIN_BAKING_NOISE | - FLUID_DOMAIN_BAKING_MESH | FLUID_DOMAIN_BAKING_PARTICLES)) { + FLUID_DOMAIN_BAKING_MESH | FLUID_DOMAIN_BAKING_PARTICLES)) + { BKE_report(op->reports, RPT_ERROR, "Bake free failed: pending bake jobs found"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/physics/rigidbody_constraint.c b/source/blender/editors/physics/rigidbody_constraint.c index d411465f251..a27e3e23270 100644 --- a/source/blender/editors/physics/rigidbody_constraint.c +++ b/source/blender/editors/physics/rigidbody_constraint.c @@ -46,7 +46,8 @@ static bool operator_rigidbody_constraints_editable_poll(Scene *scene) if (scene == NULL || ID_IS_LINKED(scene) || ID_IS_OVERRIDE_LIBRARY(scene) || (scene->rigidbody_world != NULL && scene->rigidbody_world->constraints != NULL && (ID_IS_LINKED(scene->rigidbody_world->constraints) || - ID_IS_OVERRIDE_LIBRARY(scene->rigidbody_world->constraints)))) { + ID_IS_OVERRIDE_LIBRARY(scene->rigidbody_world->constraints)))) + { return false; } return true; diff --git a/source/blender/editors/physics/rigidbody_object.c b/source/blender/editors/physics/rigidbody_object.c index 8e919170649..2a4d668ba9b 100644 --- a/source/blender/editors/physics/rigidbody_object.c +++ b/source/blender/editors/physics/rigidbody_object.c @@ -49,7 +49,8 @@ static bool operator_rigidbody_editable_poll(Scene *scene) if (scene == NULL || ID_IS_LINKED(scene) || ID_IS_OVERRIDE_LIBRARY(scene) || (scene->rigidbody_world != NULL && scene->rigidbody_world->group != NULL && (ID_IS_LINKED(scene->rigidbody_world->group) || - ID_IS_OVERRIDE_LIBRARY(scene->rigidbody_world->group)))) { + ID_IS_OVERRIDE_LIBRARY(scene->rigidbody_world->group)))) + { return false; } return true; diff --git a/source/blender/editors/render/render_internal.cc b/source/blender/editors/render/render_internal.cc index 30d918866f5..a577eaf57a9 100644 --- a/source/blender/editors/render/render_internal.cc +++ b/source/blender/editors/render/render_internal.cc @@ -528,10 +528,12 @@ static void render_image_update_pass_and_layer(RenderJob *rj, RenderResult *rr, /* image window, compo node users */ for (wm = static_cast(rj->main->wm.first); wm && matched_area == nullptr; - wm = static_cast(wm->id.next)) { /* only 1 wm */ + wm = static_cast(wm->id.next)) + { /* only 1 wm */ wmWindow *win; for (win = static_cast(wm->windows.first); win && matched_area == nullptr; - win = win->next) { + win = win->next) + { const bScreen *screen = WM_window_get_active_screen(win); LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { @@ -623,7 +625,8 @@ static void image_rect_update(void *rjv, RenderResult *rr, rcti *renrect) * operate with. */ if (!rj->supports_glsl_draw || ibuf->channels == 1 || - ED_draw_imbuf_method(ibuf) != IMAGE_DRAW_METHOD_GLSL) { + ED_draw_imbuf_method(ibuf) != IMAGE_DRAW_METHOD_GLSL) + { image_buffer_rect_update(rj, rr, ibuf, &rj->iuser, &tile_rect, offset_x, offset_y, viewname); } ImageTile *image_tile = BKE_image_get_tile(ima, 0); @@ -694,7 +697,8 @@ static void render_image_restore_layer(RenderJob *rj) /* image window, compo node users */ for (wm = static_cast(rj->main->wm.first); wm; - wm = static_cast(wm->id.next)) { /* only 1 wm */ + wm = static_cast(wm->id.next)) + { /* only 1 wm */ wmWindow *win; for (win = static_cast(wm->windows.first); win; win = win->next) { const bScreen *screen = WM_window_get_active_screen(win); @@ -900,7 +904,8 @@ static void clean_viewport_memory(Main *bmain, Scene *scene) /* Go over all the visible objects. */ for (wmWindowManager *wm = static_cast(bmain->wm.first); wm; - wm = static_cast(wm->id.next)) { + wm = static_cast(wm->id.next)) + { LISTBASE_FOREACH (wmWindow *, win, &wm->windows) { ViewLayer *view_layer = WM_window_get_active_view_layer(win); BKE_view_layer_synced_ensure(scene, view_layer); diff --git a/source/blender/editors/render/render_opengl.cc b/source/blender/editors/render/render_opengl.cc index 0fb21720b54..e1582bf23f4 100644 --- a/source/blender/editors/render/render_opengl.cc +++ b/source/blender/editors/render/render_opengl.cc @@ -495,8 +495,8 @@ static void screen_opengl_render_apply(const bContext *C, OGLRender *oglrender) } rr = RE_AcquireResultRead(oglrender->re); - for (rv = static_cast(rr->views.first), view_id = 0; rv; - rv = rv->next, view_id++) { + for (rv = static_cast(rr->views.first), view_id = 0; rv; rv = rv->next, view_id++) + { BLI_assert(view_id < oglrender->views_len); RE_SetActiveRenderView(oglrender->re, rv->name); oglrender->view_id = view_id; @@ -1002,7 +1002,8 @@ static bool screen_opengl_render_anim_init(bContext *C, wmOperator *op) oglrender->sizey, oglrender->reports, PRVRANGEON != 0, - suffix)) { + suffix)) + { screen_opengl_render_end(C, oglrender); return false; } @@ -1082,7 +1083,8 @@ static void write_result(TaskPool *__restrict pool, WriteTaskData *task_data) if (reports.list.first != nullptr) { BLI_spin_lock(&oglrender->reports_lock); for (Report *report = static_cast(reports.list.first); report != nullptr; - report = report->next) { + report = report->next) + { BKE_report(oglrender->reports, static_cast(report->type), report->message); } BLI_spin_unlock(&oglrender->reports_lock); @@ -1186,7 +1188,8 @@ static bool screen_opengl_render_anim_step(bContext *C, wmOperator *op) } if (oglrender->render_frames == nullptr || - BLI_BITMAP_TEST_BOOL(oglrender->render_frames, scene->r.cfra - PSFRA)) { + BLI_BITMAP_TEST_BOOL(oglrender->render_frames, scene->r.cfra - PSFRA)) + { /* render into offscreen buffer */ screen_opengl_render_apply(C, oglrender); } diff --git a/source/blender/editors/render/render_preview.cc b/source/blender/editors/render/render_preview.cc index ebc3998333f..585118b749f 100644 --- a/source/blender/editors/render/render_preview.cc +++ b/source/blender/editors/render/render_preview.cc @@ -744,7 +744,8 @@ void ED_preview_draw(const bContext *C, void *idp, void *parentp, void *slotp, r * or if the job is running and the size of preview changed */ if ((sbuts != nullptr && sbuts->preview) || (!ok && !WM_jobs_test(wm, area, WM_JOB_TYPE_RENDER_PREVIEW)) || - (sp && (abs(sp->sizex - newx) >= 2 || abs(sp->sizey - newy) > 2))) { + (sp && (abs(sp->sizex - newx) >= 2 || abs(sp->sizey - newy) > 2))) + { if (sbuts != nullptr) { sbuts->preview = 0; } @@ -1576,7 +1577,8 @@ static void icon_preview_startjob_all_sizes(void *customdata, IconPreviewSize *cur_size; for (cur_size = static_cast(ip->sizes.first); cur_size; - cur_size = cur_size->next) { + cur_size = cur_size->next) + { PreviewImage *prv = static_cast(ip->owner); /* Is this a render job or a deferred loading job? */ const ePreviewRenderMethod pr_method = (prv->tag & PRV_TAG_DEFFERED) ? PR_ICON_DEFERRED : @@ -1599,7 +1601,8 @@ static void icon_preview_startjob_all_sizes(void *customdata, * necessary to know here what happens inside lower-level functions. */ const bool use_solid_render_mode = (ip->id != nullptr) && ELEM(GS(ip->id->name), ID_OB, ID_AC); if (!use_solid_render_mode && preview_method_is_render(pr_method) && - !check_engine_supports_preview(ip->scene)) { + !check_engine_supports_preview(ip->scene)) + { continue; } @@ -1810,7 +1813,8 @@ void PreviewLoadJob::run_fn(void *customdata, bool *stop, bool *do_update, float IMB_thumb_locks_acquire(); while (RequestedPreview *request = static_cast( - BLI_thread_queue_pop_timeout(job_data->todo_queue_, 100))) { + BLI_thread_queue_pop_timeout(job_data->todo_queue_, 100))) + { if (*stop) { break; } @@ -1865,7 +1869,8 @@ void PreviewLoadJob::update_fn(void *customdata) PreviewLoadJob *job_data = static_cast(customdata); for (auto request_it = job_data->requested_previews_.begin(); - request_it != job_data->requested_previews_.end();) { + request_it != job_data->requested_previews_.end();) + { RequestedPreview &requested = *request_it; /* Skip items that are not done loading yet. */ if (requested.preview->tag & PRV_TAG_DEFFERED_RENDERING) { diff --git a/source/blender/editors/render/render_shading.cc b/source/blender/editors/render/render_shading.cc index f075ffc2e54..2c7ca3f13bc 100644 --- a/source/blender/editors/render/render_shading.cc +++ b/source/blender/editors/render/render_shading.cc @@ -1248,7 +1248,8 @@ static int view_layer_add_used_lightgroups_exec(bContext *C, wmOperator * /*op*/ GSet *used_lightgroups = get_used_lightgroups(scene); GSET_FOREACH_BEGIN (const char *, used_lightgroup, used_lightgroups) { if (!BLI_findstring( - &view_layer->lightgroups, used_lightgroup, offsetof(ViewLayerLightgroup, name))) { + &view_layer->lightgroups, used_lightgroup, offsetof(ViewLayerLightgroup, name))) + { BKE_view_layer_add_lightgroup(view_layer, used_lightgroup); } } diff --git a/source/blender/editors/render/render_update.cc b/source/blender/editors/render/render_update.cc index 074c78e716a..835698e9fd1 100644 --- a/source/blender/editors/render/render_update.cc +++ b/source/blender/editors/render/render_update.cc @@ -171,7 +171,8 @@ void ED_render_engine_changed(Main *bmain, const bool update_scene_data) { /* on changing the render engine type, clear all running render engines */ for (bScreen *screen = static_cast(bmain->screens.first); screen; - screen = static_cast(screen->id.next)) { + screen = static_cast(screen->id.next)) + { LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { ED_render_engine_area_exit(bmain, area); } @@ -181,7 +182,8 @@ void ED_render_engine_changed(Main *bmain, const bool update_scene_data) DEGEditorUpdateContext update_ctx = {nullptr}; update_ctx.bmain = bmain; for (Scene *scene = static_cast(bmain->scenes.first); scene; - scene = static_cast(scene->id.next)) { + scene = static_cast(scene->id.next)) + { update_ctx.scene = scene; LISTBASE_FOREACH (ViewLayer *, view_layer, &scene->view_layers) { /* TDODO(sergey): Iterate over depsgraphs instead? */ @@ -248,10 +250,12 @@ static void texture_changed(Main *bmain, Tex *tex) BKE_icon_changed(BKE_icon_id_ensure(&tex->id)); for (scene = static_cast(bmain->scenes.first); scene; - scene = static_cast(scene->id.next)) { + scene = static_cast(scene->id.next)) + { /* paint overlays */ for (view_layer = static_cast(scene->view_layers.first); view_layer; - view_layer = view_layer->next) { + view_layer = view_layer->next) + { BKE_paint_invalidate_overlay_tex(scene, view_layer, tex); } /* find compositing nodes */ diff --git a/source/blender/editors/render/render_view.cc b/source/blender/editors/render/render_view.cc index 5cfcac3d4ee..c4cd1c1ef3d 100644 --- a/source/blender/editors/render/render_view.cc +++ b/source/blender/editors/render/render_view.cc @@ -156,7 +156,8 @@ ScrArea *render_view_open(bContext *C, int mx, int my, ReportList *reports) true, false, true, - WIN_ALIGN_LOCATION_CENTER) == nullptr) { + WIN_ALIGN_LOCATION_CENTER) == nullptr) + { BKE_report(reports, RPT_ERROR, "Failed to open window!"); return nullptr; } @@ -326,7 +327,8 @@ static int render_view_show_invoke(bContext *C, wmOperator *op, const wmEvent *e if ((WM_window_is_temp_screen(win) && ((ScrArea *)screen->areabase.first)->spacetype == SPACE_IMAGE) || - (win == winshow && winshow != wincur)) { + (win == winshow && winshow != wincur)) + { wm_window_raise(win); return OPERATOR_FINISHED; } diff --git a/source/blender/editors/scene/scene_edit.c b/source/blender/editors/scene/scene_edit.c index 0e4ab60a457..b4599ae8112 100644 --- a/source/blender/editors/scene/scene_edit.c +++ b/source/blender/editors/scene/scene_edit.c @@ -175,8 +175,8 @@ static bool view_layer_remove_poll(const Scene *scene, const ViewLayer *layer) if (act == -1) { return false; } - if ((scene->view_layers.first == scene->view_layers.last) && - (scene->view_layers.first == layer)) { + if ((scene->view_layers.first == scene->view_layers.last) && (scene->view_layers.first == layer)) + { /* ensure 1 layer is kept */ return false; } diff --git a/source/blender/editors/screen/area.cc b/source/blender/editors/screen/area.cc index 3bb43bcb975..57f2a4403ef 100644 --- a/source/blender/editors/screen/area.cc +++ b/source/blender/editors/screen/area.cc @@ -453,7 +453,8 @@ void ED_area_do_mgs_subscribe_for_tool_ui(const wmRegionMessageSubscribeParams * /* Check if a tool category panel is pinned and visible in another category. */ LISTBASE_FOREACH (Panel *, panel, ®ion->panels) { if (UI_panel_is_active(panel) && panel->flag & PNL_PIN && - STREQ(panel->type->category, panel_category_tool)) { + STREQ(panel->type->category, panel_category_tool)) + { update_region = true; break; } @@ -608,8 +609,8 @@ void ED_region_do_draw(bContext *C, ARegion *region) * * This covers most cases and avoids copy-paste similar code for each space type. */ - if (ELEM( - region->regiontype, RGN_TYPE_WINDOW, RGN_TYPE_CHANNELS, RGN_TYPE_UI, RGN_TYPE_TOOLS)) { + if (ELEM(region->regiontype, RGN_TYPE_WINDOW, RGN_TYPE_CHANNELS, RGN_TYPE_UI, RGN_TYPE_TOOLS)) + { SpaceLink *sl = static_cast(area->spacedata.first); PointerRNA ptr; @@ -881,7 +882,8 @@ static void area_azone_init(wmWindow *win, const bScreen *screen, ScrArea *area) #ifdef __APPLE__ if (!WM_window_is_fullscreen(win) && ((coords[i][0] == 0 && coords[i][1] == 0) || - (coords[i][0] == WM_window_pixels_x(win) && coords[i][1] == 0))) { + (coords[i][0] == WM_window_pixels_x(win) && coords[i][1] == 0))) + { continue; } #else @@ -1221,7 +1223,8 @@ static void region_overlap_fix(ScrArea *area, ARegion *region) if (region_iter->overlap && (region_iter->alignment & RGN_SPLIT_PREV) == 0) { if ((region_iter->alignment != align) && - BLI_rcti_isect(®ion_iter->winrct, ®ion->winrct, nullptr)) { + BLI_rcti_isect(®ion_iter->winrct, ®ion->winrct, nullptr)) + { /* Left overlapping right or vice-versa, forbid this! */ region->flag |= RGN_FLAG_TOO_SMALL; return; @@ -1247,7 +1250,8 @@ bool ED_region_is_overlap(int spacetype, int regiontype) RGN_TYPE_UI, RGN_TYPE_TOOL_PROPS, RGN_TYPE_FOOTER, - RGN_TYPE_TOOL_HEADER)) { + RGN_TYPE_TOOL_HEADER)) + { return true; } } @@ -1368,13 +1372,13 @@ static void region_rect_recursive( winrct_test.ymax = region->winrct.ymin + size_min[1]; BLI_rcti_isect(&winrct_test, &overlap_remainder_margin, &winrct_test); - if (BLI_rcti_size_x(&winrct_test) < size_min[0] || - BLI_rcti_size_y(&winrct_test) < size_min[1]) { + if (BLI_rcti_size_x(&winrct_test) < size_min[0] || BLI_rcti_size_y(&winrct_test) < size_min[1]) + { region->flag |= RGN_FLAG_TOO_SMALL; } } - else if (rct_fits(remainder, SCREEN_AXIS_V, 1) < 0 || - rct_fits(remainder, SCREEN_AXIS_H, 1) < 0) { + else if (rct_fits(remainder, SCREEN_AXIS_V, 1) < 0 || rct_fits(remainder, SCREEN_AXIS_H, 1) < 0) + { /* remainder is too small for any usage */ region->flag |= RGN_FLAG_TOO_SMALL; } @@ -2233,7 +2237,8 @@ static short region_alignment_from_header_and_tool_header_state( /* Don't prioritize the tool-header if both are hidden (behave as if both are visible). * Without this, switching to a space with headers hidden will flip the alignment * upon switching to a space with visible headers. */ - (header_hidden && tool_header_hidden))) { + (header_hidden && tool_header_hidden))) + { return tool_header_alignment; } if (header_alignment != -1) { @@ -2299,7 +2304,8 @@ static void region_align_info_to_area_for_headers(const RegionTypeAlignInfo *reg * Simply copy the values. */ if (((header_alignment_src != -1) == (header_alignment_dst != -1)) && ((tool_header_alignment_src != -1) == (tool_header_alignment_dst != -1)) && - (tool_header_hidden_src == tool_header_hidden_dst)) { + (tool_header_hidden_src == tool_header_hidden_dst)) + { if (header_alignment_dst != -1) { header_alignment_sync = header_alignment_src; } @@ -2393,7 +2399,8 @@ static void region_align_info_to_area( region_align_info_from_area(area, ®ion_align_info_dst); if ((region_by_type[RGN_TYPE_HEADER] != nullptr) || - (region_by_type[RGN_TYPE_TOOL_HEADER] != nullptr)) { + (region_by_type[RGN_TYPE_TOOL_HEADER] != nullptr)) + { region_align_info_to_area_for_headers( region_align_info_src, ®ion_align_info_dst, region_by_type); } @@ -3007,8 +3014,8 @@ void ED_region_panels_layout_ex(const bContext *C, if (!(panel->type->flag & PANEL_TYPE_INSTANCED)) { continue; } - if (use_category_tabs && panel->type->category[0] && - !STREQ(category, panel->type->category)) { + if (use_category_tabs && panel->type->category[0] && !STREQ(category, panel->type->category)) + { continue; } const int width = panel_draw_width_from_max_width_get(region, panel->type, max_panel_width); @@ -3123,8 +3130,8 @@ void ED_region_panels_draw(const bContext *C, ARegion *region) /* scrollers */ bool use_mask = false; rcti mask; - if (region->runtime.category && - (RGN_ALIGN_ENUM_FROM_MASK(region->alignment) == RGN_ALIGN_RIGHT)) { + if (region->runtime.category && (RGN_ALIGN_ENUM_FROM_MASK(region->alignment) == RGN_ALIGN_RIGHT)) + { use_mask = true; UI_view2d_mask_from_win(v2d, &mask); mask.xmax -= UI_PANEL_CATEGORY_MARGIN_WIDTH; diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 88762a19778..0b8a5880147 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -386,7 +386,8 @@ static bool screen_areas_can_align(bScreen *screen, ScrArea *sa1, ScrArea *sa2, continue; } if (area->v3->vec.x - area->v1->vec.x < tolerance && - (area->v1->vec.x == xmin || area->v3->vec.x == xmax)) { + (area->v1->vec.x == xmin || area->v3->vec.x == xmax)) + { /* There is a narrow vertical area sharing an edge of the combined bounds. */ return false; } @@ -400,7 +401,8 @@ static bool screen_areas_can_align(bScreen *screen, ScrArea *sa1, ScrArea *sa2, continue; } if (area->v3->vec.y - area->v1->vec.y < tolerance && - (area->v1->vec.y == ymin || area->v3->vec.y == ymax)) { + (area->v1->vec.y == ymin || area->v3->vec.y == ymax)) + { /* There is a narrow horizontal area sharing an edge of the combined bounds. */ return false; } @@ -925,9 +927,11 @@ void ED_screen_set_active_region(bContext *C, wmWindow *win, const int xy[2]) ED_screen_areas_iter (win, screen, area_iter) { if (xy[0] > (area_iter->totrct.xmin + BORDERPADDING) && - xy[0] < (area_iter->totrct.xmax - BORDERPADDING)) { + xy[0] < (area_iter->totrct.xmax - BORDERPADDING)) + { if (xy[1] > (area_iter->totrct.ymin + BORDERPADDING) && - xy[1] < (area_iter->totrct.ymax - BORDERPADDING)) { + xy[1] < (area_iter->totrct.ymax - BORDERPADDING)) + { if (ED_area_azones_update(area_iter, xy) == NULL) { area = area_iter; break; @@ -1479,7 +1483,8 @@ static bScreen *screen_state_to_nonnormal(bContext *C, RGN_TYPE_FOOTER, RGN_TYPE_TOOLS, RGN_TYPE_NAV_BAR, - RGN_TYPE_EXECUTE)) { + RGN_TYPE_EXECUTE)) + { region->flag |= RGN_FLAG_HIDDEN; } } @@ -1631,7 +1636,8 @@ ScrArea *ED_screen_temp_space_open(bContext *C, false, dialog, true, - WIN_ALIGN_LOCATION_CENTER)) { + WIN_ALIGN_LOCATION_CENTER)) + { area = CTX_wm_area(C); } break; diff --git a/source/blender/editors/screen/screen_geometry.c b/source/blender/editors/screen/screen_geometry.c index 309bedda4fd..81f01222f5e 100644 --- a/source/blender/editors/screen/screen_geometry.c +++ b/source/blender/editors/screen/screen_geometry.c @@ -177,7 +177,8 @@ static bool screen_geom_vertices_scale_pass(const wmWindow *win, /* Keep timeline small in video edit workspace. */ LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { if (area->spacetype == SPACE_ACTION && area->v1->vec.y == screen_rect->ymin && - screen_geom_area_height(area) <= headery * facy + 1) { + screen_geom_area_height(area) <= headery * facy + 1) + { ScrEdge *se = BKE_screen_find_edge(screen, area->v2, area->v3); if (se) { const int yval = area->v1->vec.y + headery - 1; diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c index 1f7a162c37d..2cf9c6ebe8f 100644 --- a/source/blender/editors/screen/screen_ops.c +++ b/source/blender/editors/screen/screen_ops.c @@ -778,7 +778,8 @@ static bool azone_clipped_rect_calc(const AZone *az, rcti *r_rect_clip) if (az->type == AZONE_REGION) { if (region->overlap && (region->v2d.keeptot != V2D_KEEPTOT_STRICT) && /* Only when this isn't hidden (where it's displayed as an button that expands). */ - ((az->region->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) == 0)) { + ((az->region->flag & (RGN_FLAG_HIDDEN | RGN_FLAG_TOO_SMALL)) == 0)) + { /* A floating region to be resized, clip by the visible region. */ switch (az->edge) { case AE_TOP_TO_BOTTOMRIGHT: @@ -823,7 +824,8 @@ static AZone *area_actionzone_refresh_xy(ScrArea *area, const int xy[2], const b rcti az_rect_clip; if (BLI_rcti_isect_pt_v(&az->rect, xy) && /* Check clipping if this is clipped */ - (!azone_clipped_rect_calc(az, &az_rect_clip) || BLI_rcti_isect_pt_v(&az_rect_clip, xy))) { + (!azone_clipped_rect_calc(az, &az_rect_clip) || BLI_rcti_isect_pt_v(&az_rect_clip, xy))) + { if (az->type == AZONE_AREA) { break; @@ -881,7 +883,8 @@ static AZone *area_actionzone_refresh_xy(ScrArea *area, const int xy[2], const b /* Check if we even have scroll bars. */ if (((az->direction == AZ_SCROLL_HOR) && !(scroll_flag & V2D_SCROLL_HORIZONTAL)) || - ((az->direction == AZ_SCROLL_VERT) && !(scroll_flag & V2D_SCROLL_VERTICAL))) { + ((az->direction == AZ_SCROLL_VERT) && !(scroll_flag & V2D_SCROLL_VERTICAL))) + { /* No scroll-bars, do nothing. */ } else if (test_only) { @@ -1109,7 +1112,8 @@ static int actionzone_modal(bContext *C, wmOperator *op, const wmEvent *event) /* Have we dragged off the zone and are not on an edge? */ if ((ED_area_actionzone_find_xy(sad->sa1, event->xy) != sad->az) && (screen_geom_area_map_find_active_scredge( - AREAMAP_FROM_SCREEN(screen), &screen_rect, event->xy[0], event->xy[1]) == NULL)) { + AREAMAP_FROM_SCREEN(screen), &screen_rect, event->xy[0], event->xy[1]) == NULL)) + { /* What area are we now in? */ ScrArea *area = BKE_screen_find_area_xy(screen, SPACE_TYPE_ANY, event->xy); @@ -2086,7 +2090,8 @@ static bool area_split_allowed(const ScrArea *area, const eScreenAxis dir_axis) } if ((dir_axis == SCREEN_AXIS_V && area->winx <= 2 * AREAMINX * UI_SCALE_FAC) || - (dir_axis == SCREEN_AXIS_H && area->winy <= 2 * ED_area_headersize())) { + (dir_axis == SCREEN_AXIS_H && area->winy <= 2 * ED_area_headersize())) + { /* Must be at least double minimum sizes to split into two. */ return false; } @@ -2650,14 +2655,14 @@ static int area_max_regionsize(ScrArea *area, ARegion *scale_region, AZEdge edge } else if (scale_region->alignment == RGN_ALIGN_TOP && (region->alignment == RGN_ALIGN_BOTTOM || - ELEM( - region->regiontype, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER, RGN_TYPE_FOOTER))) { + ELEM(region->regiontype, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER, RGN_TYPE_FOOTER))) + { dist -= region->winy; } else if (scale_region->alignment == RGN_ALIGN_BOTTOM && (region->alignment == RGN_ALIGN_TOP || - ELEM( - region->regiontype, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER, RGN_TYPE_FOOTER))) { + ELEM(region->regiontype, RGN_TYPE_HEADER, RGN_TYPE_TOOL_HEADER, RGN_TYPE_FOOTER))) + { dist -= region->winy; } } @@ -2704,7 +2709,8 @@ static int region_scale_invoke(bContext *C, wmOperator *op, const wmEvent *event * the parent region if the azone edge is not the edge splitting * both regions */ if ((az->region->alignment & RGN_SPLIT_PREV) && az->region->prev && - !is_split_edge(RGN_ALIGN_ENUM_FROM_MASK(az->region->alignment), az->edge)) { + !is_split_edge(RGN_ALIGN_ENUM_FROM_MASK(az->region->alignment), az->edge)) + { rmd->region = az->region->prev; } else { @@ -2779,7 +2785,8 @@ static void region_scale_toggle_hidden(bContext *C, RegionMoveData *rmd) ARegion *region_tool_header = BKE_area_find_region_type(rmd->area, RGN_TYPE_TOOL_HEADER); if (region_tool_header != NULL) { if ((region_tool_header->flag & RGN_FLAG_HIDDEN_BY_USER) == 0 && - (region_tool_header->flag & RGN_FLAG_HIDDEN) != 0) { + (region_tool_header->flag & RGN_FLAG_HIDDEN) != 0) + { region_toggle_hidden(C, region_tool_header, 0); } } @@ -2941,12 +2948,13 @@ static void areas_do_frame_follow(bContext *C, bool middle) if (screen_ctx->redraws_flag & TIME_FOLLOW) { if ((region->regiontype == RGN_TYPE_WINDOW && ELEM(area->spacetype, SPACE_SEQ, SPACE_GRAPH, SPACE_ACTION, SPACE_NLA)) || - (area->spacetype == SPACE_CLIP && region->regiontype == RGN_TYPE_PREVIEW)) { + (area->spacetype == SPACE_CLIP && region->regiontype == RGN_TYPE_PREVIEW)) + { float w = BLI_rctf_size_x(®ion->v2d.cur); if (middle) { - if ((scene->r.cfra < region->v2d.cur.xmin) || - (scene->r.cfra > region->v2d.cur.xmax)) { + if ((scene->r.cfra < region->v2d.cur.xmin) || (scene->r.cfra > region->v2d.cur.xmax)) + { region->v2d.cur.xmax = scene->r.cfra + (w / 2); region->v2d.cur.xmin = scene->r.cfra - (w / 2); } @@ -4537,7 +4545,8 @@ static void screen_animation_region_tag_redraw( { /* Do follow time here if editor type supports it */ if ((redraws & TIME_FOLLOW) && - screen_animation_region_supports_time_follow(area->spacetype, region->regiontype)) { + screen_animation_region_supports_time_follow(area->spacetype, region->regiontype)) + { float w = BLI_rctf_size_x(®ion->v2d.cur); if (scene->r.cfra < region->v2d.cur.xmin) { region->v2d.cur.xmax = scene->r.cfra; @@ -4637,7 +4646,8 @@ static int screen_animation_step_invoke(bContext *C, wmOperator *UNUSED(op), con * dependency graph update. */ } else if ((scene->audio.flag & AUDIO_SYNC) && (sad->flag & ANIMPLAY_FLAG_REVERSE) == false && - isfinite(time = BKE_sound_sync_scene(scene_eval))) { + isfinite(time = BKE_sound_sync_scene(scene_eval))) + { double newfra = time * FPS; /* give some space here to avoid jumps */ @@ -5097,7 +5107,8 @@ static int userpref_show_exec(bContext *C, wmOperator *op) false, false, true, - WIN_ALIGN_LOCATION_CENTER) != NULL) { + WIN_ALIGN_LOCATION_CENTER) != NULL) + { /* The header only contains the editor switcher and looks empty. * So hiding in the temp window makes sense. */ ScrArea *area = CTX_wm_area(C); @@ -5169,7 +5180,8 @@ static int drivers_editor_show_exec(bContext *C, wmOperator *op) false, false, true, - WIN_ALIGN_LOCATION_CENTER) != NULL) { + WIN_ALIGN_LOCATION_CENTER) != NULL) + { ED_drivers_editor_init(C, CTX_wm_area(C)); /* activate driver F-Curve for the property under the cursor */ @@ -5238,7 +5250,8 @@ static int info_log_show_exec(bContext *C, wmOperator *op) false, false, true, - WIN_ALIGN_LOCATION_CENTER) != NULL) { + WIN_ALIGN_LOCATION_CENTER) != NULL) + { return OPERATOR_FINISHED; } BKE_report(op->reports, RPT_ERROR, "Failed to open window!"); diff --git a/source/blender/editors/screen/screen_user_menu.c b/source/blender/editors/screen/screen_user_menu.c index 06d00fbc017..6ba0c1ceba3 100644 --- a/source/blender/editors/screen/screen_user_menu.c +++ b/source/blender/editors/screen/screen_user_menu.c @@ -103,7 +103,8 @@ bUserMenuItem_Op *ED_screen_user_menu_item_find_operator(ListBase *lb, if (umi->type == USER_MENU_TYPE_OPERATOR) { bUserMenuItem_Op *umi_op = (bUserMenuItem_Op *)umi; if (STREQ(ot->idname, umi_op->op_idname) && (opcontext == umi_op->opcontext) && - IDP_EqualsProperties(prop, umi_op->prop)) { + IDP_EqualsProperties(prop, umi_op->prop)) + { return umi_op; } } @@ -134,7 +135,8 @@ struct bUserMenuItem_Prop *ED_screen_user_menu_item_find_prop(struct ListBase *l if (umi->type == USER_MENU_TYPE_PROP) { bUserMenuItem_Prop *umi_pr = (bUserMenuItem_Prop *)umi; if (STREQ(context_data_path, umi_pr->context_data_path) && STREQ(prop_id, umi_pr->prop_id) && - (prop_index == umi_pr->prop_index)) { + (prop_index == umi_pr->prop_index)) + { return umi_pr; } } @@ -270,8 +272,8 @@ static void screen_user_menu_draw(const bContext *C, Menu *menu) if (ptr.type != NULL) { PropertyRNA *prop = NULL; PointerRNA prop_ptr = ptr; - if ((data_path == NULL) || - RNA_path_resolve_full(&ptr, data_path, &prop_ptr, NULL, NULL)) { + if ((data_path == NULL) || RNA_path_resolve_full(&ptr, data_path, &prop_ptr, NULL, NULL)) + { prop = RNA_struct_find_property(&prop_ptr, umi_pr->prop_id); if (prop) { ok = true; diff --git a/source/blender/editors/screen/screendump.c b/source/blender/editors/screen/screendump.c index 4d44999f1f3..f8f252c935e 100644 --- a/source/blender/editors/screen/screendump.c +++ b/source/blender/editors/screen/screendump.c @@ -127,7 +127,8 @@ static int screenshot_exec(bContext *C, wmOperator *op) } if ((scd->im_format.planes == R_IMF_PLANES_BW) && - (scd->im_format.imtype != R_IMF_IMTYPE_MULTILAYER)) { + (scd->im_format.imtype != R_IMF_IMTYPE_MULTILAYER)) + { /* bw screenshot? - users will notice if it fails! */ IMB_color_to_bw(ibuf); } diff --git a/source/blender/editors/screen/workspace_edit.c b/source/blender/editors/screen/workspace_edit.c index 03808acc709..4acc384db0f 100644 --- a/source/blender/editors/screen/workspace_edit.c +++ b/source/blender/editors/screen/workspace_edit.c @@ -342,7 +342,8 @@ static int workspace_append_activate_exec(bContext *C, wmOperator *op) char idname[MAX_ID_NAME - 2], filepath[FILE_MAX]; if (!RNA_struct_property_is_set(op->ptr, "idname") || - !RNA_struct_property_is_set(op->ptr, "filepath")) { + !RNA_struct_property_is_set(op->ptr, "filepath")) + { return OPERATOR_CANCELLED; } RNA_string_get(op->ptr, "idname", idname); @@ -480,7 +481,8 @@ static void workspace_add_menu(bContext *UNUSED(C), uiLayout *layout, void *temp LISTBASE_FOREACH (WorkSpace *, workspace, &builtin_config->workspaces) { if (startup_config && - BLI_findstring(&startup_config->workspaces, workspace->id.name, offsetof(ID, name))) { + BLI_findstring(&startup_config->workspaces, workspace->id.name, offsetof(ID, name))) + { continue; } diff --git a/source/blender/editors/screen/workspace_listen.cc b/source/blender/editors/screen/workspace_listen.cc index 84326007d66..d0a0192c2b2 100644 --- a/source/blender/editors/screen/workspace_listen.cc +++ b/source/blender/editors/screen/workspace_listen.cc @@ -21,7 +21,8 @@ static void validate_viewer_paths(bContext &C, WorkSpace &workspace) const std::optional parsed_path = blender::ed::viewer_path::parse_geometry_nodes_viewer(workspace.viewer_path); if (parsed_path.has_value() && - blender::ed::viewer_path::is_active_geometry_nodes_viewer(C, *parsed_path)) { + blender::ed::viewer_path::is_active_geometry_nodes_viewer(C, *parsed_path)) + { /* The current viewer path is still valid and active. */ return; } diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_add.cc b/source/blender/editors/sculpt_paint/curves_sculpt_add.cc index 36dbda9fe55..db637e15660 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_add.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_add.cc @@ -233,7 +233,8 @@ struct AddOperationExecutor { add_inputs.corner_normals_su = corner_normals_su; if (add_inputs.interpolate_length || add_inputs.interpolate_shape || - add_inputs.interpolate_point_count || add_inputs.interpolate_resolution) { + add_inputs.interpolate_point_count || add_inputs.interpolate_resolution) + { this->ensure_curve_roots_kdtree(); add_inputs.old_roots_kdtree = self_->curve_roots_kdtree_; } diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_brush.cc b/source/blender/editors/sculpt_paint/curves_sculpt_brush.cc index c3d7734dd36..374d6b380f1 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_brush.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_brush.cc @@ -216,7 +216,8 @@ std::optional sample_curves_3d_brush(const Depsgraph &depsgraph, if (center_ray_hit.index >= 0) { const float3 hit_position_su = center_ray_hit.co; if (math::distance(center_ray_start_su, center_ray_end_su) > - math::distance(center_ray_start_su, hit_position_su)) { + math::distance(center_ray_start_su, hit_position_su)) + { center_ray_end_su = hit_position_su; center_ray_end_wo = math::transform_point(surface_to_world_mat, center_ray_end_su); } diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc b/source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc index bb733f8453e..b53b1ba161f 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_grow_shrink.cc @@ -305,7 +305,8 @@ struct CurvesEffectOperationExecutor { *ctx_.rv3d, *object_, stroke_extension.mouse_position, - brush_radius_base_re_)) { + brush_radius_base_re_)) + { self.brush_3d_ = *brush_3d; } } diff --git a/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc b/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc index 0da248ea175..594e6f3533e 100644 --- a/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc +++ b/source/blender/editors/sculpt_paint/curves_sculpt_slide.cc @@ -374,7 +374,8 @@ struct SlideOperationExecutor { ray_direction_su, old_first_pos_eval_su, looptri_index_eval, - hit_pos_eval_su)) { + hit_pos_eval_su)) + { continue; } diff --git a/source/blender/editors/sculpt_paint/paint_canvas.cc b/source/blender/editors/sculpt_paint/paint_canvas.cc index 22e1ecbedd7..1214aa28dac 100644 --- a/source/blender/editors/sculpt_paint/paint_canvas.cc +++ b/source/blender/editors/sculpt_paint/paint_canvas.cc @@ -107,7 +107,8 @@ eV3DShadingColorType ED_paint_shading_color_override(bContext *C, */ if (!ED_paint_tool_use_canvas(C, nullptr) && !(paint_tool_shading_color_follows_last_used_tool(C, ob) && - ob->sculpt->sticky_shading_color)) { + ob->sculpt->sticky_shading_color)) + { return orig_color_type; } diff --git a/source/blender/editors/sculpt_paint/paint_cursor.cc b/source/blender/editors/sculpt_paint/paint_cursor.cc index 20eefa6f2af..3a8a207fa86 100644 --- a/source/blender/editors/sculpt_paint/paint_cursor.cc +++ b/source/blender/editors/sculpt_paint/paint_cursor.cc @@ -524,7 +524,8 @@ static int project_brush_radius(ViewContext *vc, float radius, const float locat if ((ED_view3d_project_float_global(vc->region, location, p1, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) && (ED_view3d_project_float_global(vc->region, offset, p2, V3D_PROJ_TEST_NOP) == - V3D_PROJ_RET_OK)) { + V3D_PROJ_RET_OK)) + { /* The distance between these points is the size of the projected brush in pixels. */ return len_v2v2(p1, p2); } @@ -562,7 +563,8 @@ static bool paint_draw_tex_overlay(UnifiedPaintSettings *ups, if (!(mtex->tex) || !((mtex->brush_map_mode == MTEX_MAP_MODE_STENCIL) || - (valid && ELEM(mtex->brush_map_mode, MTEX_MAP_MODE_VIEW, MTEX_MAP_MODE_TILED)))) { + (valid && ELEM(mtex->brush_map_mode, MTEX_MAP_MODE_VIEW, MTEX_MAP_MODE_TILED)))) + { return false; } @@ -1312,7 +1314,8 @@ static bool paint_cursor_context_init(bContext *C, /* There is currently no way to check if the direction is inverted before starting the stroke, * so this does not reflect the state of the brush in the UI. */ if (((pcontext->ups->draw_inverted == 0) ^ ((pcontext->brush->flag & BRUSH_DIR_IN) == 0)) && - BKE_brush_sculpt_has_secondary_color(pcontext->brush)) { + BKE_brush_sculpt_has_secondary_color(pcontext->brush)) + { copy_v3_v3(pcontext->outline_col, pcontext->brush->sub_col); } else { @@ -1685,7 +1688,8 @@ static void paint_cursor_draw_3d_view_brush_cursor_inactive(PaintCursorContext * /* Drawing Cursor overlays in 3D object space. */ if (is_brush_tool && brush->sculpt_tool == SCULPT_TOOL_GRAB && - (brush->flag & BRUSH_GRAB_ACTIVE_VERTEX)) { + (brush->flag & BRUSH_GRAB_ACTIVE_VERTEX)) + { SCULPT_geometry_preview_lines_update(pcontext->C, pcontext->ss, pcontext->radius); sculpt_geometry_preview_lines_draw( pcontext->pos, pcontext->brush, pcontext->is_multires, pcontext->ss); @@ -1712,7 +1716,8 @@ static void paint_cursor_draw_3d_view_brush_cursor_inactive(PaintCursorContext * /* Cloth brush local simulation areas. */ if (is_brush_tool && brush->sculpt_tool == SCULPT_TOOL_CLOTH && - brush->cloth_simulation_area_type != BRUSH_CLOTH_SIMULATION_AREA_GLOBAL) { + brush->cloth_simulation_area_type != BRUSH_CLOTH_SIMULATION_AREA_GLOBAL) + { const float white[3] = {1.0f, 1.0f, 1.0f}; const float zero_v[3] = {0.0f}; /* This functions sets its own drawing space in order to draw the simulation limits when the @@ -1791,12 +1796,14 @@ static void paint_cursor_cursor_draw_3d_view_brush_cursor_active(PaintCursorCont pcontext->pos, ss, pcontext->outline_col, pcontext->outline_alpha); } else if (brush->cloth_force_falloff_type == BRUSH_CLOTH_FORCE_FALLOFF_RADIAL && - brush->cloth_simulation_area_type == BRUSH_CLOTH_SIMULATION_AREA_LOCAL) { + brush->cloth_simulation_area_type == BRUSH_CLOTH_SIMULATION_AREA_LOCAL) + { /* Display the simulation limits if sculpting outside them. */ /* This does not makes much sense of plane falloff as the falloff is infinite or global. */ if (len_v3v3(ss->cache->true_location, ss->cache->true_initial_location) > - ss->cache->radius * (1.0f + brush->cloth_sim_limit)) { + ss->cache->radius * (1.0f + brush->cloth_sim_limit)) + { const float red[3] = {1.0f, 0.2f, 0.2f}; SCULPT_cloth_simulation_limits_draw(pcontext->pos, brush, @@ -1846,7 +1853,8 @@ static bool paint_cursor_is_brush_cursor_enabled(PaintCursorContext *pcontext) { if (pcontext->paint->flags & PAINT_SHOW_BRUSH) { if (ELEM(pcontext->mode, PAINT_MODE_TEXTURE_2D, PAINT_MODE_TEXTURE_3D) && - pcontext->brush->imagepaint_tool == PAINT_TOOL_FILL) { + pcontext->brush->imagepaint_tool == PAINT_TOOL_FILL) + { return false; } return true; diff --git a/source/blender/editors/sculpt_paint/paint_image_2d.c b/source/blender/editors/sculpt_paint/paint_image_2d.c index b7ce4b2973c..996bd6a6252 100644 --- a/source/blender/editors/sculpt_paint/paint_image_2d.c +++ b/source/blender/editors/sculpt_paint/paint_image_2d.c @@ -739,7 +739,8 @@ static void brush_painter_2d_refresh_cache(ImagePaintState *s, } if (diameter != cache->lastdiameter || (mask_rotation != cache->last_mask_rotation) || - renew_maxmask) { + renew_maxmask) + { MEM_SAFE_FREE(cache->tex_mask); brush_painter_2d_tex_mapping( @@ -760,7 +761,8 @@ static void brush_painter_2d_refresh_cache(ImagePaintState *s, /* detect if we need to recreate image brush buffer */ if (diameter != cache->lastdiameter || (tex_rotation != cache->last_tex_rotation) || do_random || - update_color) { + update_color) + { if (cache->ibuf) { IMB_freeImBuf(cache->ibuf); cache->ibuf = NULL; @@ -817,7 +819,8 @@ static bool paint_2d_ensure_tile_canvas(ImagePaintState *s, int i) s->tiles[i].state = PAINT2D_TILE_MISSING; } else if ((s->tiles[0].canvas->rect && !ibuf->rect) || - (s->tiles[0].canvas->rect_float && !ibuf->rect_float)) { + (s->tiles[0].canvas->rect_float && !ibuf->rect_float)) + { s->tiles[i].state = PAINT2D_TILE_MISSING; } else { @@ -1496,7 +1499,8 @@ void paint_2d_stroke(void *ps, sub_v2_v2v2(local_new_uv, new_uv, tile->uv_origin); sub_v2_v2v2(local_old_uv, old_uv, tile->uv_origin); if (!(is_inside_tile(uv_size, local_new_uv, uv_brush_size) || - is_inside_tile(uv_size, local_old_uv, uv_brush_size))) { + is_inside_tile(uv_size, local_old_uv, uv_brush_size))) + { continue; } @@ -1519,7 +1523,8 @@ void paint_2d_stroke(void *ps, const float pixel_brush_size[] = {(s->symmetry & PAINT_TILE_X) ? FLT_MAX : size, (s->symmetry & PAINT_TILE_Y) ? FLT_MAX : size}; if (!(is_inside_tile(tile->size, new_coord, pixel_brush_size) || - is_inside_tile(tile->size, old_coord, pixel_brush_size))) { + is_inside_tile(tile->size, old_coord, pixel_brush_size))) + { continue; } diff --git a/source/blender/editors/sculpt_paint/paint_image_proj.cc b/source/blender/editors/sculpt_paint/paint_image_proj.cc index c5b38d0f049..292fd03aa6c 100644 --- a/source/blender/editors/sculpt_paint/paint_image_proj.cc +++ b/source/blender/editors/sculpt_paint/paint_image_proj.cc @@ -1191,11 +1191,13 @@ static bool check_seam(const ProjPaintState *ps, /* first test if they have the same image */ if ((orig_tpage == tpage) && (orig_tile == tile) && cmp_uv(orig_lt_tri_uv[orig_i1_fidx], lt_tri_uv[i1_fidx]) && - cmp_uv(orig_lt_tri_uv[orig_i2_fidx], lt_tri_uv[i2_fidx])) { + cmp_uv(orig_lt_tri_uv[orig_i2_fidx], lt_tri_uv[i2_fidx])) + { /* if faces don't have the same winding in uv space, * they are on the same side so edge is boundary */ if ((ps->faceWindingFlags[tri_index] & PROJ_FACE_WINDING_CW) != - (ps->faceWindingFlags[orig_face] & PROJ_FACE_WINDING_CW)) { + (ps->faceWindingFlags[orig_face] & PROJ_FACE_WINDING_CW)) + { return true; } @@ -1456,9 +1458,11 @@ static void project_face_seams_init(const ProjPaintState *ps, do { if (init_all || (ps->corner_verts_eval[lt->tri[fidx[0]]] == vert_index) || - (ps->corner_verts_eval[lt->tri[fidx[1]]] == vert_index)) { + (ps->corner_verts_eval[lt->tri[fidx[1]]] == vert_index)) + { if ((ps->faceSeamFlags[tri_index] & - (PROJ_FACE_SEAM0 << fidx[0] | PROJ_FACE_NOSEAM0 << fidx[0])) == 0) { + (PROJ_FACE_SEAM0 << fidx[0] | PROJ_FACE_NOSEAM0 << fidx[0])) == 0) + { if (check_seam(ps, tri_index, fidx[0], fidx[1], &other_face, &other_fidx)) { ps->faceSeamFlags[tri_index] |= PROJ_FACE_SEAM0 << fidx[0]; insert_seam_vert_array(ps, arena, tri_index, fidx[0], ibuf_x, ibuf_y); @@ -2139,7 +2143,8 @@ static bool line_clip_rect2f(const rctf *cliprect, /* top/bottom */ if (line_isect_y(l1, l2, rect->ymin, &isect) && (isect >= cliprect->xmin) && - (isect <= cliprect->xmax)) { + (isect <= cliprect->xmax)) + { if (l1[1] < l2[1]) { /* line 1 is outside */ l1_clip[0] = isect; l1_clip[1] = rect->ymin; @@ -2157,7 +2162,8 @@ static bool line_clip_rect2f(const rctf *cliprect, } if (line_isect_y(l1, l2, rect->ymax, &isect) && (isect >= cliprect->xmin) && - (isect <= cliprect->xmax)) { + (isect <= cliprect->xmax)) + { if (l1[1] > l2[1]) { /* line 1 is outside */ l1_clip[0] = isect; l1_clip[1] = rect->ymax; @@ -2176,7 +2182,8 @@ static bool line_clip_rect2f(const rctf *cliprect, /* left/right */ if (line_isect_x(l1, l2, rect->xmin, &isect) && (isect >= cliprect->ymin) && - (isect <= cliprect->ymax)) { + (isect <= cliprect->ymax)) + { if (l1[0] < l2[0]) { /* line 1 is outside */ l1_clip[0] = rect->xmin; l1_clip[1] = isect; @@ -2194,7 +2201,8 @@ static bool line_clip_rect2f(const rctf *cliprect, } if (line_isect_x(l1, l2, rect->xmax, &isect) && (isect >= cliprect->ymin) && - (isect <= cliprect->ymax)) { + (isect <= cliprect->ymax)) + { if (l1[0] > l2[0]) { /* line 1 is outside */ l1_clip[0] = rect->xmax; l1_clip[1] = isect; @@ -2273,7 +2281,8 @@ static bool project_bucket_isect_circle(const float cent[2], #endif if ((bucket_bounds->xmin <= cent[0] && bucket_bounds->xmax >= cent[0]) || - (bucket_bounds->ymin <= cent[1] && bucket_bounds->ymax >= cent[1])) { + (bucket_bounds->ymin <= cent[1] && bucket_bounds->ymax >= cent[1])) + { return true; } @@ -2513,7 +2522,8 @@ static void project_bucket_clip_face(const bool is_ortho, * smooth shading it's a possibility */ if (min_fff(dist_squared_to_line_v2(v1coSS, v2coSS, v3coSS), dist_squared_to_line_v2(v2coSS, v3coSS, v1coSS), - dist_squared_to_line_v2(v3coSS, v1coSS, v2coSS)) < PROJ_PIXEL_TOLERANCE) { + dist_squared_to_line_v2(v3coSS, v1coSS, v2coSS)) < PROJ_PIXEL_TOLERANCE) + { collinear = true; } @@ -2806,7 +2816,8 @@ static void project_bucket_clip_face(const bool is_ortho, for (int i = 0; i < (*tot); i++) { if (fabsf(isectVCosSS[(i + 1) % *tot][0] - isectVCosSS[i][0]) < PROJ_PIXEL_TOLERANCE && - fabsf(isectVCosSS[(i + 1) % *tot][1] - isectVCosSS[i][1]) < PROJ_PIXEL_TOLERANCE) { + fabsf(isectVCosSS[(i + 1) % *tot][1] - isectVCosSS[i][1]) < PROJ_PIXEL_TOLERANCE) + { for (int j = i; j < (*tot) - 1; j++) { isectVCosSS[j][0] = isectVCosSS[j + 1][0]; isectVCosSS[j][1] = isectVCosSS[j + 1][1]; @@ -3120,7 +3131,8 @@ static void project_paint_face_init(const ProjPaintState *ps, /* Note about IsectPoly2Df_twoside, checking the face or uv flipping doesn't work, * could check the poly direction but better to do this */ if ((do_backfacecull == true && IsectPoly2Df(uv, uv_clip, uv_clip_tot)) || - (do_backfacecull == false && IsectPoly2Df_twoside(uv, uv_clip, uv_clip_tot))) { + (do_backfacecull == false && IsectPoly2Df_twoside(uv, uv_clip, uv_clip_tot))) + { has_x_isect = has_isect = 1; @@ -3151,7 +3163,8 @@ static void project_paint_face_init(const ProjPaintState *ps, /* project_paint_PickFace is less complex, use for testing */ // if (project_paint_PickFace(ps, pixelScreenCo, w, &side) == tri_index) { if ((ps->do_occlude == false) || - !project_bucket_point_occluded(ps, bucketFaceNodes, tri_index, pixelScreenCo)) { + !project_bucket_point_occluded(ps, bucketFaceNodes, tri_index, pixelScreenCo)) + { mask = project_paint_uvpixel_mask(ps, tri_index, w); if (mask > 0.0f) { @@ -3196,7 +3209,8 @@ static void project_paint_face_init(const ProjPaintState *ps, /* are any of our edges un-initialized? */ if ((face_seam_flag & PROJ_FACE_SEAM_INIT0) == 0 || (face_seam_flag & PROJ_FACE_SEAM_INIT1) == 0 || - (face_seam_flag & PROJ_FACE_SEAM_INIT2) == 0) { + (face_seam_flag & PROJ_FACE_SEAM_INIT2) == 0) + { project_face_seams_init(ps, arena, tri_index, 0, true, ibuf->x, ibuf->y); face_seam_flag = ps->faceSeamFlags[tri_index]; # if 0 @@ -3251,7 +3265,8 @@ static void project_paint_face_init(const ProjPaintState *ps, if ((ps->faceSeamFlags[tri_index] & PROJ_FACE_SEAM0) || (ps->faceSeamFlags[tri_index] & PROJ_FACE_SEAM1) || - (ps->faceSeamFlags[tri_index] & PROJ_FACE_SEAM2)) { + (ps->faceSeamFlags[tri_index] & PROJ_FACE_SEAM2)) + { uv_image_outset(ps, lt_uv_pxoffset, lt_puv, tri_index, ibuf->x, ibuf->y); } @@ -3283,7 +3298,8 @@ static void project_paint_face_init(const ProjPaintState *ps, vCoSS[fidx1], vCoSS[fidx2], bucket_clip_edges[0], - bucket_clip_edges[1])) { + bucket_clip_edges[1])) + { /* Avoid div by zero. */ if (len_squared_v2v2(vCoSS[fidx1], vCoSS[fidx2]) > FLT_EPSILON) { uint loop_idx = ps->looptris_eval[tri_index].tri[fidx1]; @@ -3341,13 +3357,15 @@ static void project_paint_face_init(const ProjPaintState *ps, if ((seam_data->corner_dist_sq[0] > 0.0f) && (len_squared_v2v2(puv, seam_data->seam_puvs[0]) < seam_data->corner_dist_sq[0]) && - (len_squared_v2v2(puv, lt_puv[fidx1]) > ps->seam_bleed_px_sq)) { + (len_squared_v2v2(puv, lt_puv[fidx1]) > ps->seam_bleed_px_sq)) + { in_bounds = false; } else if ((seam_data->corner_dist_sq[1] > 0.0f) && (len_squared_v2v2(puv, seam_data->seam_puvs[1]) < seam_data->corner_dist_sq[1]) && - (len_squared_v2v2(puv, lt_puv[fidx2]) > ps->seam_bleed_px_sq)) { + (len_squared_v2v2(puv, lt_puv[fidx2]) > ps->seam_bleed_px_sq)) + { in_bounds = false; } } @@ -3384,7 +3402,8 @@ static void project_paint_face_init(const ProjPaintState *ps, if ((ps->do_occlude == false) || !project_bucket_point_occluded( - ps, bucketFaceNodes, tri_index, pixel_on_edge)) { + ps, bucketFaceNodes, tri_index, pixel_on_edge)) + { /* A pity we need to get the world-space pixel location here * because it is a relatively expensive operation. */ if (do_clip || do_3d_mapping) { @@ -3615,7 +3634,8 @@ static bool project_bucket_face_isect(ProjPaintState *ps, (isect_seg_seg_v2(p1, p2, v1, v2) || isect_seg_seg_v2(p1, p2, v2, v3)) || (isect_seg_seg_v2(p2, p3, v1, v2) || isect_seg_seg_v2(p2, p3, v2, v3)) || (isect_seg_seg_v2(p3, p4, v1, v2) || isect_seg_seg_v2(p3, p4, v2, v3)) || - (isect_seg_seg_v2(p4, p1, v1, v2) || isect_seg_seg_v2(p4, p1, v2, v3))) { + (isect_seg_seg_v2(p4, p1, v1, v2) || isect_seg_seg_v2(p4, p1, v2, v3))) + { return true; } @@ -4155,7 +4175,8 @@ static bool project_paint_clone_face_skip(ProjPaintState *ps, if (lc->slot_clone != lc->slot_last_clone) { if (!lc->slot_clone->uvname || !(lc->mloopuv_clone_base = static_cast(CustomData_get_layer_named( - &ps->me_eval->ldata, CD_PROP_FLOAT2, lc->slot_clone->uvname)))) { + &ps->me_eval->ldata, CD_PROP_FLOAT2, lc->slot_clone->uvname)))) + { lc->mloopuv_clone_base = static_cast( CustomData_get_layer(&ps->me_eval->ldata, CD_PROP_FLOAT2)); } @@ -4198,7 +4219,8 @@ static bool project_paint_check_face_paintable(const ProjPaintState *ps, int orig_index; if ((face_lookup->index_mp_to_orig != nullptr) && - ((orig_index = (face_lookup->index_mp_to_orig[lt->poly])) != ORIGINDEX_NONE)) { + ((orig_index = (face_lookup->index_mp_to_orig[lt->poly])) != ORIGINDEX_NONE)) + { return face_lookup->select_poly_orig && face_lookup->select_poly_orig[orig_index]; } return ps->select_poly_eval && ps->select_poly_eval[lt->poly]; @@ -4207,7 +4229,8 @@ static bool project_paint_check_face_paintable(const ProjPaintState *ps, int orig_index; if ((face_lookup->index_mp_to_orig != nullptr) && - ((orig_index = (face_lookup->index_mp_to_orig[lt->poly])) != ORIGINDEX_NONE)) { + ((orig_index = (face_lookup->index_mp_to_orig[lt->poly])) != ORIGINDEX_NONE)) + { return !(face_lookup->hide_poly_orig && face_lookup->hide_poly_orig[orig_index]); } return !(ps->hide_poly_eval && ps->hide_poly_eval[lt->poly]); @@ -4280,7 +4303,8 @@ static void project_paint_build_proj_ima(ProjPaintState *ps, BLI_memarena_alloc(arena, sizeof(ProjPaintImage) * ps->image_tot)); for (entry = static_cast(used_images->first), i = 0; entry; - entry = entry->next, i++, projIma++) { + entry = entry->next, i++, projIma++) + { projIma->iuser = entry->iuser; int size; projIma->ima = entry->ima; @@ -4343,7 +4367,8 @@ static void project_paint_prepare_all_faces(ProjPaintState *ps, if (slot != slot_last) { if (!slot->uvname || !(mloopuv_base = static_cast(CustomData_get_layer_named( - &ps->me_eval->ldata, CD_PROP_FLOAT2, slot->uvname)))) { + &ps->me_eval->ldata, CD_PROP_FLOAT2, slot->uvname)))) + { mloopuv_base = static_cast( CustomData_get_layer(&ps->me_eval->ldata, CD_PROP_FLOAT2)); } @@ -4432,7 +4457,8 @@ static void project_paint_prepare_all_faces(ProjPaintState *ps, if (tpage_last != tpage || tile_last != tile) { image_index = 0; for (PrepareImageEntry *e = static_cast(used_images.first); e; - e = e->next, image_index++) { + e = e->next, image_index++) + { if (e->ima == tpage && e->iuser.tile == tile) { break; } @@ -4791,7 +4817,8 @@ static bool project_bucket_iter_next(ProjPaintState *ps, const int max_bucket_idx = ps->bucketMax[0] + (ps->bucketMax[1] - 1) * ps->buckets_x; for (int bidx = atomic_fetch_and_add_int32(&ps->context_bucket_index, 1); bidx < max_bucket_idx; - bidx = atomic_fetch_and_add_int32(&ps->context_bucket_index, 1)) { + bidx = atomic_fetch_and_add_int32(&ps->context_bucket_index, 1)) + { const int bucket_y = bidx / ps->buckets_x; const int bucket_x = bidx - (bucket_y * ps->buckets_x); @@ -4801,7 +4828,8 @@ static bool project_bucket_iter_next(ProjPaintState *ps, project_bucket_bounds(ps, bucket_x, bucket_y, bucket_bounds); if ((ps->source != PROJ_SRC_VIEW) || - project_bucket_isect_circle(mval, float(diameter * diameter), bucket_bounds)) { + project_bucket_isect_circle(mval, float(diameter * diameter), bucket_bounds)) + { *bucket_index = bidx; return true; @@ -5778,7 +5806,8 @@ static void paint_proj_stroke_ps(const bContext * /*C*/, ps->stencil_value = brush->weight; if ((ps->mode == BRUSH_STROKE_INVERT) ^ - ((scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_STENCIL_INV) != 0)) { + ((scene->toolsettings->imapaint.flag & IMAGEPAINT_PROJECT_LAYER_STENCIL_INV) != 0)) + { ps->stencil_value = 1.0f - ps->stencil_value; } } @@ -6121,7 +6150,8 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) ps.reproject_ibuf = BKE_image_acquire_ibuf(image, nullptr, nullptr); if ((ps.reproject_ibuf == nullptr) || - ((ps.reproject_ibuf->rect || ps.reproject_ibuf->rect_float) == false)) { + ((ps.reproject_ibuf->rect || ps.reproject_ibuf->rect_float) == false)) + { BKE_report(op->reports, RPT_ERROR, "Image data could not be found"); return OPERATOR_CANCELLED; } @@ -6133,7 +6163,8 @@ static int texture_paint_camera_project_exec(bContext *C, wmOperator *op) /* type check to make sure its ok */ if (view_data != nullptr && - (view_data->len != PROJ_VIEW_DATA_SIZE || view_data->subtype != IDP_FLOAT)) { + (view_data->len != PROJ_VIEW_DATA_SIZE || view_data->subtype != IDP_FLOAT)) + { BKE_report(op->reports, RPT_ERROR, "Image project data invalid"); return OPERATOR_CANCELLED; } @@ -6415,7 +6446,8 @@ bool ED_paint_proj_mesh_data_check( if (ma->texpaintslot != nullptr && (ma->texpaintslot[ma->paint_active_slot].ima == nullptr || !ID_IS_LINKED(ma->texpaintslot[ma->paint_active_slot].ima) || - !ID_IS_OVERRIDE_LIBRARY(ma->texpaintslot[ma->paint_active_slot].ima))) { + !ID_IS_OVERRIDE_LIBRARY(ma->texpaintslot[ma->paint_active_slot].ima))) + { hastex = true; break; } diff --git a/source/blender/editors/sculpt_paint/paint_ops.cc b/source/blender/editors/sculpt_paint/paint_ops.cc index 124250c44c9..99e5a84f93a 100644 --- a/source/blender/editors/sculpt_paint/paint_ops.cc +++ b/source/blender/editors/sculpt_paint/paint_ops.cc @@ -362,7 +362,8 @@ static bool palette_poll(bContext *C) Paint *paint = BKE_paint_get_active_from_context(C); if (paint && paint->palette != nullptr && !ID_IS_LINKED(paint->palette) && - !ID_IS_OVERRIDE_LIBRARY(paint->palette)) { + !ID_IS_OVERRIDE_LIBRARY(paint->palette)) + { return true; } @@ -811,7 +812,8 @@ static Brush *brush_tool_cycle(Main *bmain, Paint *paint, Brush *brush_orig, con brush = first_brush; do { if ((brush->ob_mode & paint->runtime.ob_mode) && - (brush_tool(brush, paint->runtime.tool_offset) == tool)) { + (brush_tool(brush, paint->runtime.tool_offset) == tool)) + { return brush; } @@ -892,7 +894,8 @@ static bool brush_generic_tool_set(bContext *C, } if (((brush == nullptr) && create_missing) && - ((brush_orig == nullptr) || brush_tool(brush_orig, paint->runtime.tool_offset) != tool)) { + ((brush_orig == nullptr) || brush_tool(brush_orig, paint->runtime.tool_offset) != tool)) + { brush = BKE_brush_add(bmain, tool_name, eObjectMode(paint->runtime.ob_mode)); id_us_min(&brush->id); /* fake user only */ brush_tool_set(brush, paint->runtime.tool_offset, tool); diff --git a/source/blender/editors/sculpt_paint/paint_stroke.cc b/source/blender/editors/sculpt_paint/paint_stroke.cc index e042abbf1e1..6015f39fede 100644 --- a/source/blender/editors/sculpt_paint/paint_stroke.cc +++ b/source/blender/editors/sculpt_paint/paint_stroke.cc @@ -220,7 +220,8 @@ static bool paint_tool_require_location(Brush *brush, ePaintMode mode) SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_ROTATE, SCULPT_TOOL_SNAKE_HOOK, - SCULPT_TOOL_THUMB)) { + SCULPT_TOOL_THUMB)) + { return false; } else if (SCULPT_is_cloth_deform_brush(brush)) { @@ -268,7 +269,8 @@ static bool paint_tool_require_inbetween_mouse_events(Brush *brush, ePaintMode m SCULPT_TOOL_ELASTIC_DEFORM, SCULPT_TOOL_CLOTH, SCULPT_TOOL_BOUNDARY, - SCULPT_TOOL_POSE)) { + SCULPT_TOOL_POSE)) + { return false; } else { @@ -372,7 +374,8 @@ static bool paint_brush_update(bContext *C, if (ELEM(brush->mask_mtex.brush_map_mode, MTEX_MAP_MODE_VIEW, MTEX_MAP_MODE_AREA, - MTEX_MAP_MODE_RANDOM)) { + MTEX_MAP_MODE_RANDOM)) + { do_random_mask = true; } @@ -562,7 +565,8 @@ static void paint_brush_stroke_add_step( float world_space_position[3]; if (SCULPT_stroke_get_location( - C, world_space_position, stroke->last_mouse_position, stroke->original)) { + C, world_space_position, stroke->last_mouse_position, stroke->original)) + { copy_v3_v3(stroke->last_world_space_position, world_space_position); mul_m4_v3(stroke->vc.obact->object_to_world, stroke->last_world_space_position); } @@ -1041,7 +1045,8 @@ bool paint_space_stroke_enabled(Brush *br, ePaintMode mode) } if (mode == PAINT_MODE_SCULPT_CURVES && - !curves_sculpt_brush_uses_spacing(eBrushCurvesSculptTool(br->curves_sculpt_tool))) { + !curves_sculpt_brush_uses_spacing(eBrushCurvesSculptTool(br->curves_sculpt_tool))) + { return false; } @@ -1093,7 +1098,8 @@ bool paint_supports_dynamic_size(Brush *br, ePaintMode mode) bool paint_supports_smooth_stroke(Brush *br, ePaintMode mode) { if (!(br->flag & BRUSH_SMOOTH_STROKE) || - (br->flag & (BRUSH_ANCHORED | BRUSH_DRAG_DOT | BRUSH_LINE))) { + (br->flag & (BRUSH_ANCHORED | BRUSH_DRAG_DOT | BRUSH_LINE))) + { return false; } @@ -1341,7 +1347,8 @@ static bool paint_stroke_curve_end(bContext *C, wmOperator *op, PaintStroke *str } if ((br->mtex.brush_angle_mode & MTEX_ANGLE_RAKE) || - (br->mask_mtex.brush_angle_mode & MTEX_ANGLE_RAKE)) { + (br->mask_mtex.brush_angle_mode & MTEX_ANGLE_RAKE)) + { do_rake = true; for (j = 0; j < 2; j++) { BKE_curve_forward_diff_tangent_bezier(pcp->bez.vec[1][j], @@ -1559,7 +1566,8 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event, PaintS if (stroke->stroke_started && (first_modal || ISMOUSE_MOTION(event->type))) { if ((br->mtex.brush_angle_mode & MTEX_ANGLE_RAKE) || - (br->mask_mtex.brush_angle_mode & MTEX_ANGLE_RAKE)) { + (br->mask_mtex.brush_angle_mode & MTEX_ANGLE_RAKE)) + { copy_v2_v2(stroke->ups->last_rake, stroke->last_mouse_position); } paint_calculate_rake_rotation(stroke->ups, br, mouse, mode); @@ -1570,7 +1578,8 @@ int paint_stroke_modal(bContext *C, wmOperator *op, const wmEvent *event, PaintS (!(br->flag & BRUSH_AIRBRUSH) && ISMOUSE_MOTION(event->type)) || /* airbrush */ ((br->flag & BRUSH_AIRBRUSH) && event->type == TIMER && - event->customdata == stroke->timer)) { + event->customdata == stroke->timer)) + { if (paint_smooth_stroke(stroke, &sample_average, mode, mouse, &pressure)) { if (stroke->stroke_started) { if (paint_space_stroke_enabled(br, mode)) { @@ -1695,7 +1704,8 @@ bool PAINT_brush_tool_poll(bContext *C) if (p && ob && BKE_paint_brush(p) && (area && ELEM(area->spacetype, SPACE_VIEW3D, SPACE_IMAGE)) && - (region && region->regiontype == RGN_TYPE_WINDOW)) { + (region && region->regiontype == RGN_TYPE_WINDOW)) + { /* Check the current tool is a brush. */ bToolRef *tref = area->runtime.tool; if (tref && tref->runtime && tref->runtime->data_block[0]) { diff --git a/source/blender/editors/sculpt_paint/paint_utils.c b/source/blender/editors/sculpt_paint/paint_utils.c index 4be49922fe5..e8f81c736aa 100644 --- a/source/blender/editors/sculpt_paint/paint_utils.c +++ b/source/blender/editors/sculpt_paint/paint_utils.c @@ -315,7 +315,8 @@ static void imapaint_pick_uv( if (!(slot && slot->uvname && (mloopuv = CustomData_get_layer_named( - &me_eval->ldata, CD_PROP_FLOAT2, slot->uvname)))) { + &me_eval->ldata, CD_PROP_FLOAT2, slot->uvname)))) + { mloopuv = CustomData_get_layer(&me_eval->ldata, CD_PROP_FLOAT2); } } diff --git a/source/blender/editors/sculpt_paint/paint_vertex.cc b/source/blender/editors/sculpt_paint/paint_vertex.cc index 0f313aa6029..8cf3875ac65 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex.cc @@ -291,7 +291,8 @@ static bool weight_paint_poll_ex(bContext *C, bool check_tool) if ((ob != nullptr) && (ob->mode & OB_MODE_WEIGHT_PAINT) && (BKE_paint_brush(&CTX_data_tool_settings(C)->wpaint->paint) != nullptr) && - (area = CTX_wm_area(C)) && (area->spacetype == SPACE_VIEW3D)) { + (area = CTX_wm_area(C)) && (area->spacetype == SPACE_VIEW3D)) + { ARegion *region = CTX_wm_region(C); if (ELEM(region->regiontype, RGN_TYPE_WINDOW, RGN_TYPE_HUD)) { if (!check_tool || WM_toolsystem_active_tool_is_brush(C)) { @@ -382,8 +383,8 @@ static Color vpaint_blend(const VPaint *vp, } } - if ((brush->flag & BRUSH_LOCK_ALPHA) && - !ELEM(blend, IMB_BLEND_ERASE_ALPHA, IMB_BLEND_ADD_ALPHA)) { + if ((brush->flag & BRUSH_LOCK_ALPHA) && !ELEM(blend, IMB_BLEND_ERASE_ALPHA, IMB_BLEND_ADD_ALPHA)) + { Value *cp, *cc; cp = (Value *)&color_blend; cc = (Value *)&color_curr; @@ -450,7 +451,8 @@ static void paint_and_tex_color_alpha_intern(VPaint *vp, vc->region, co, co_ss, - (eV3DProjTest)(V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR)) == V3D_PROJ_RET_OK) { + (eV3DProjTest)(V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR)) == V3D_PROJ_RET_OK) + { const float co_ss_3d[3] = {co_ss[0], co_ss[1], 0.0f}; /* we need a 3rd empty value */ BKE_brush_sample_tex_3d(vc->scene, brush, mtex, co_ss_3d, r_rgba, 0, nullptr); } @@ -1689,8 +1691,8 @@ static void vwpaint_update_cache_variants(bContext *C, VPaint *vp, Object *ob, P BKE_brush_unprojected_radius_set(scene, brush, cache->initial_radius); } - if (BKE_brush_use_size_pressure(brush) && - paint_supports_dynamic_size(brush, PAINT_MODE_SCULPT)) { + if (BKE_brush_use_size_pressure(brush) && paint_supports_dynamic_size(brush, PAINT_MODE_SCULPT)) + { cache->radius = cache->initial_radius * cache->pressure; } else { @@ -1797,7 +1799,8 @@ static bool wpaint_stroke_test_start(bContext *C, wmOperator *op, const float mo BKE_object_defgroup_check_lock_relative( wpd->lock_flags, wpd->vgroup_validmap, wpd->active.index) && (!wpd->do_multipaint || BKE_object_defgroup_check_lock_relative_multi( - defbase_tot, wpd->lock_flags, defbase_sel, defbase_tot_sel))) { + defbase_tot, wpd->lock_flags, defbase_sel, defbase_tot_sel))) + { wpd->do_lock_relative = true; } @@ -1990,7 +1993,8 @@ static void do_wpaint_brush_blur_task_cb_ex(void *__restrict userdata, if (((brush->flag & BRUSH_FRONTFACE) == 0 || (angle_cos > 0.0f)) && ((brush->flag & BRUSH_FRONTFACE_FALLOFF) == 0 || view_angle_limits_apply_falloff( - &data->wpd->normal_angle_precalc, angle_cos, &brush_strength))) { + &data->wpd->normal_angle_precalc, angle_cos, &brush_strength))) + { const float brush_fade = BKE_brush_curve_strength( brush, sqrtf(test.dist), cache->radius); const float final_alpha = brush_fade * brush_strength * grid_alpha * @@ -2074,7 +2078,8 @@ static void do_wpaint_brush_smear_task_cb_ex(void *__restrict userdata, if (((brush->flag & BRUSH_FRONTFACE) == 0 || (angle_cos > 0.0f)) && ((brush->flag & BRUSH_FRONTFACE_FALLOFF) == 0 || view_angle_limits_apply_falloff( - &data->wpd->normal_angle_precalc, angle_cos, &brush_strength))) { + &data->wpd->normal_angle_precalc, angle_cos, &brush_strength))) + { bool do_color = false; /* Minimum dot product between brush direction and current * to neighbor direction is 0.0, meaning orthogonal. */ @@ -2180,7 +2185,8 @@ static void do_wpaint_brush_draw_task_cb_ex(void *__restrict userdata, if (((brush->flag & BRUSH_FRONTFACE) == 0 || (angle_cos > 0.0f)) && ((brush->flag & BRUSH_FRONTFACE_FALLOFF) == 0 || view_angle_limits_apply_falloff( - &data->wpd->normal_angle_precalc, angle_cos, &brush_strength))) { + &data->wpd->normal_angle_precalc, angle_cos, &brush_strength))) + { const float brush_fade = BKE_brush_curve_strength( brush, sqrtf(test.dist), cache->radius); const float final_alpha = brush_fade * brush_strength * grid_alpha * @@ -2239,7 +2245,8 @@ static void do_wpaint_brush_calc_average_weight_cb_ex(void *__restrict userdata, const float angle_cos = (use_normal && vd.no) ? dot_v3v3(sculpt_normal_frontface, vd.no) : 1.0f; if (angle_cos > 0.0 && - BKE_brush_curve_strength(data->brush, sqrtf(test.dist), cache->radius) > 0.0) { + BKE_brush_curve_strength(data->brush, sqrtf(test.dist), cache->radius) > 0.0) + { const int v_index = has_grids ? ss->corner_verts[vd.grid_indices[vd.g]] : vd.vert_indices[vd.i]; @@ -3003,7 +3010,8 @@ static void do_vpaint_brush_blur_loops(bContext *C, if (((brush->flag & BRUSH_FRONTFACE) == 0 || (angle_cos > 0.0f)) && ((brush->flag & BRUSH_FRONTFACE_FALLOFF) == 0 || view_angle_limits_apply_falloff( - &vpd->normal_angle_precalc, angle_cos, &brush_strength))) { + &vpd->normal_angle_precalc, angle_cos, &brush_strength))) + { const float brush_fade = BKE_brush_curve_strength( brush, sqrtf(test.dist), cache->radius); @@ -3146,7 +3154,8 @@ static void do_vpaint_brush_blur_verts(bContext *C, if (((brush->flag & BRUSH_FRONTFACE) == 0 || (angle_cos > 0.0f)) && ((brush->flag & BRUSH_FRONTFACE_FALLOFF) == 0 || view_angle_limits_apply_falloff( - &vpd->normal_angle_precalc, angle_cos, &brush_strength))) { + &vpd->normal_angle_precalc, angle_cos, &brush_strength))) + { const float brush_fade = BKE_brush_curve_strength( brush, sqrtf(test.dist), cache->radius); @@ -3299,7 +3308,8 @@ static void do_vpaint_brush_smear(bContext *C, if (((brush->flag & BRUSH_FRONTFACE) == 0 || (angle_cos > 0.0f)) && ((brush->flag & BRUSH_FRONTFACE_FALLOFF) == 0 || view_angle_limits_apply_falloff( - &vpd->normal_angle_precalc, angle_cos, &brush_strength))) { + &vpd->normal_angle_precalc, angle_cos, &brush_strength))) + { const float brush_fade = BKE_brush_curve_strength( brush, sqrtf(test.dist), cache->radius); @@ -3582,7 +3592,8 @@ static void vpaint_do_draw(bContext *C, if (((brush->flag & BRUSH_FRONTFACE) == 0 || (angle_cos > 0.0f)) && ((brush->flag & BRUSH_FRONTFACE_FALLOFF) == 0 || view_angle_limits_apply_falloff( - &vpd->normal_angle_precalc, angle_cos, &brush_strength))) { + &vpd->normal_angle_precalc, angle_cos, &brush_strength))) + { const float brush_fade = BKE_brush_curve_strength( brush, sqrtf(test.dist), cache->radius); diff --git a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc index 53172b0bd13..d1615cb3499 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex_color_ops.cc @@ -200,8 +200,8 @@ static void face_corner_color_equalize_verts(Mesh &mesh, const IndexMask selecti static bool vertex_color_smooth(Object *ob) { Mesh *me; - if (((me = BKE_mesh_from_object(ob)) == nullptr) || - (ED_mesh_color_ensure(me, nullptr) == false)) { + if (((me = BKE_mesh_from_object(ob)) == nullptr) || (ED_mesh_color_ensure(me, nullptr) == false)) + { return false; } @@ -346,7 +346,8 @@ static int vertex_color_brightness_contrast_exec(bContext *C, wmOperator *op) Mesh *me; if (((me = BKE_mesh_from_object(obact)) == nullptr) || - (ED_mesh_color_ensure(me, nullptr) == false)) { + (ED_mesh_color_ensure(me, nullptr) == false)) + { return OPERATOR_CANCELLED; } @@ -392,7 +393,8 @@ static int vertex_color_hsv_exec(bContext *C, wmOperator *op) Mesh *me; if (((me = BKE_mesh_from_object(obact)) == nullptr) || - (ED_mesh_color_ensure(me, nullptr) == false)) { + (ED_mesh_color_ensure(me, nullptr) == false)) + { return OPERATOR_CANCELLED; } @@ -442,7 +444,8 @@ static int vertex_color_invert_exec(bContext *C, wmOperator *op) Mesh *me; if (((me = BKE_mesh_from_object(obact)) == nullptr) || - (ED_mesh_color_ensure(me, nullptr) == false)) { + (ED_mesh_color_ensure(me, nullptr) == false)) + { return OPERATOR_CANCELLED; } @@ -479,7 +482,8 @@ static int vertex_color_levels_exec(bContext *C, wmOperator *op) Mesh *me; if (((me = BKE_mesh_from_object(obact)) == nullptr) || - (ED_mesh_color_ensure(me, nullptr) == false)) { + (ED_mesh_color_ensure(me, nullptr) == false)) + { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/sculpt_paint/paint_vertex_proj.c b/source/blender/editors/sculpt_paint/paint_vertex_proj.c index d5a7a704cb1..49bb00a5c2e 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_proj.c +++ b/source/blender/editors/sculpt_paint/paint_vertex_proj.c @@ -113,7 +113,8 @@ static void vpaint_proj_dm_map_cosnos_update__map_cb(void *userData, if (ED_view3d_project_float_object( vp_update->region, co, co_ss, V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { const float dist_sq = len_squared_v2v2(vp_update->mval_fl, co_ss); if (dist_sq > vp_handle->dists_sq[index]) { /* bail out! */ diff --git a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc index 10f9cb9a722..c349c36341b 100644 --- a/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc +++ b/source/blender/editors/sculpt_paint/paint_vertex_weight_ops.cc @@ -185,12 +185,12 @@ static int weight_sample_invoke(bContext *C, wmOperator *op, const wmEvent *even } } else { - if (ED_mesh_pick_face_vert( - C, vc.obact, event->mval, ED_MESH_PICK_DEFAULT_FACE_DIST, &index)) { + if (ED_mesh_pick_face_vert(C, vc.obact, event->mval, ED_MESH_PICK_DEFAULT_FACE_DIST, &index)) + { v_idx_best = index; } - else if (ED_mesh_pick_face( - C, vc.obact, event->mval, ED_MESH_PICK_DEFAULT_FACE_DIST, &index)) { + else if (ED_mesh_pick_face(C, vc.obact, event->mval, ED_MESH_PICK_DEFAULT_FACE_DIST, &index)) + { /* This relies on knowing the internal workings of #ED_mesh_pick_face_vert() */ BKE_report( op->reports, RPT_WARNING, "The modifier used does not support deformed locations"); @@ -364,7 +364,8 @@ static const EnumPropertyItem *weight_paint_sample_enum_itemf(bContext *C, bDeformGroup *dg; for (dg = static_cast(me->vertex_group_names.first); dg && i < defbase_tot; - i++, dg = dg->next) { + i++, dg = dg->next) + { if (groups[i]) { item_tmp.identifier = item_tmp.name = dg->name; item_tmp.value = i; @@ -615,7 +616,8 @@ static void gradientVert_update(WPGradient_userData *grad_data, int index) /* Optionally restrict to assigned vertices only. */ if (grad_data->use_vgroup_restrict && - ((vs->flag & WPGradient_vertStore::VGRAD_STORE_DW_EXIST) == 0)) { + ((vs->flag & WPGradient_vertStore::VGRAD_STORE_DW_EXIST) == 0)) + { /* In this case the vertex will never have been touched. */ BLI_assert((vs->flag & WPGradient_vertStore::VGRAD_STORE_IS_MODIFIED) == 0); return; @@ -705,7 +707,8 @@ static void gradientVertInit__mapFunc(void *userData, if (ED_view3d_project_float_object( grad_data->region, co, vs->sco, V3D_PROJ_TEST_CLIP_BB | V3D_PROJ_TEST_CLIP_NEAR) != - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { copy_v2_fl(vs->sco, FLT_MAX); return; } diff --git a/source/blender/editors/sculpt_paint/sculpt.cc b/source/blender/editors/sculpt_paint/sculpt.cc index 576dcaced74..ca8f1f86ac0 100644 --- a/source/blender/editors/sculpt_paint/sculpt.cc +++ b/source/blender/editors/sculpt_paint/sculpt.cc @@ -1074,7 +1074,8 @@ static void do_nearest_vertex_get_task_cb(void *__restrict userdata, BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { float distance_squared = len_squared_v3v3(vd.co, data->nearest_vertex_search_co); if (distance_squared < nvtd->nearest_vertex_distance_squared && - distance_squared < data->max_distance_squared) { + distance_squared < data->max_distance_squared) + { nvtd->nearest_vertex = vd.vertex; nvtd->nearest_vertex_distance_squared = distance_squared; } @@ -2075,7 +2076,8 @@ static void calc_area_normal_and_center_task_cb(void *__restrict userdata, /* Layer brush produces artifacts with normal and area radius */ /* Enable area radius control only on Scrape for now */ if (ELEM(data->brush->sculpt_tool, SCULPT_TOOL_SCRAPE, SCULPT_TOOL_FILL) && - data->brush->area_radius_factor > 0.0f) { + data->brush->area_radius_factor > 0.0f) + { test_radius *= data->brush->area_radius_factor; if (ss->cache && data->brush->flag2 & BRUSH_AREA_RADIUS_PRESSURE) { test_radius *= ss->cache->pressure; @@ -2953,7 +2955,8 @@ static void update_sculpt_normal(Sculpt *sd, Object *ob, Span nodes) !(brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK && cache->normal_weight > 0.0f); if (cache->mirror_symmetry_pass == 0 && cache->radial_symmetry_pass == 0 && - (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(cache) || update_normal)) { + (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(cache) || update_normal)) + { calc_sculpt_normal(sd, ob, nodes, cache->sculpt_normal); if (brush->falloff_shape == PAINT_FALLOFF_SHAPE_TUBE) { project_plane_v3_v3v3(cache->sculpt_normal, cache->sculpt_normal, cache->view_normal); @@ -3203,7 +3206,8 @@ void SCULPT_calc_brush_plane( if (SCULPT_stroke_is_main_symmetry_pass(ss->cache) && (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(ss->cache) || - !(brush->flag & BRUSH_ORIGINAL_PLANE) || !(brush->flag & BRUSH_ORIGINAL_NORMAL))) { + !(brush->flag & BRUSH_ORIGINAL_PLANE) || !(brush->flag & BRUSH_ORIGINAL_NORMAL))) + { switch (brush->sculpt_plane) { case SCULPT_DISP_DIR_VIEW: copy_v3_v3(r_area_no, ss->cache->true_view_normal); @@ -3241,7 +3245,8 @@ void SCULPT_calc_brush_plane( /* For area normal. */ if (!SCULPT_stroke_is_first_brush_step_of_symmetry_pass(ss->cache) && - (brush->flag & BRUSH_ORIGINAL_NORMAL)) { + (brush->flag & BRUSH_ORIGINAL_NORMAL)) + { copy_v3_v3(r_area_no, ss->cache->sculpt_normal); } else { @@ -3250,7 +3255,8 @@ void SCULPT_calc_brush_plane( /* For flatten center. */ if (!SCULPT_stroke_is_first_brush_step_of_symmetry_pass(ss->cache) && - (brush->flag & BRUSH_ORIGINAL_PLANE)) { + (brush->flag & BRUSH_ORIGINAL_PLANE)) + { copy_v3_v3(r_area_co, ss->cache->last_center); } else { @@ -3590,7 +3596,8 @@ static void do_brush_action(Sculpt *sd, /* It also assigns the paint_face_set here as it needs to be done regardless of the stroke type * and the number of nodes under the brush influence. */ if (brush->sculpt_tool == SCULPT_TOOL_DRAW_FACE_SETS && - SCULPT_stroke_is_first_brush_step(ss->cache) && !ss->cache->alt_smooth) { + SCULPT_stroke_is_first_brush_step(ss->cache) && !ss->cache->alt_smooth) + { if (ss->cache->invert) { /* When inverting the brush, pick the paint face mask ID from the mesh. */ ss->cache->paint_face_set = SCULPT_active_face_set_get(ss); @@ -3604,7 +3611,8 @@ static void do_brush_action(Sculpt *sd, /* For anchored brushes with spherical falloff, we start off with zero radius, thus we have no * PBVH nodes on the first brush step. */ if (!nodes.is_empty() || - ((brush->falloff_shape == PAINT_FALLOFF_SHAPE_SPHERE) && (brush->flag & BRUSH_ANCHORED))) { + ((brush->falloff_shape == PAINT_FALLOFF_SHAPE_SPHERE) && (brush->flag & BRUSH_ANCHORED))) + { if (SCULPT_stroke_is_first_brush_step(ss->cache)) { /* Initialize auto-masking cache. */ if (SCULPT_is_automasking_enabled(sd, ss, brush)) { @@ -3614,7 +3622,8 @@ static void do_brush_action(Sculpt *sd, } /* Initialize surface smooth cache. */ if ((brush->sculpt_tool == SCULPT_TOOL_SMOOTH) && - (brush->smooth_deform_type == BRUSH_SMOOTH_DEFORM_SURFACE)) { + (brush->smooth_deform_type == BRUSH_SMOOTH_DEFORM_SURFACE)) + { BLI_assert(ss->cache->surface_smooth_laplacian_disp == nullptr); ss->cache->surface_smooth_laplacian_disp = static_cast( MEM_callocN(sizeof(float[3]) * SCULPT_vertex_count_get(ss), "HC smooth laplacian b")); @@ -3776,7 +3785,8 @@ static void do_brush_action(Sculpt *sd, } if (!ELEM(brush->sculpt_tool, SCULPT_TOOL_SMOOTH, SCULPT_TOOL_MASK) && - brush->autosmooth_factor > 0) { + brush->autosmooth_factor > 0) + { if (brush->flag & BRUSH_INVERSE_SMOOTH_PRESSURE) { SCULPT_smooth(sd, ob, nodes, brush->autosmooth_factor * (1.0f - ss->cache->pressure), false); } @@ -3790,16 +3800,17 @@ static void do_brush_action(Sculpt *sd, } if (!SCULPT_tool_can_reuse_automask(brush->sculpt_tool) || - (ss->cache->supports_gravity && sd->gravity_factor > 0.0f)) { + (ss->cache->supports_gravity && sd->gravity_factor > 0.0f)) + { /* Clear cavity mask cache. */ ss->last_automasking_settings_hash = 0; } /* The cloth brush adds the gravity as a regular force and it is processed in the solver. */ - if (ss->cache->supports_gravity && !ELEM(brush->sculpt_tool, - SCULPT_TOOL_CLOTH, - SCULPT_TOOL_DRAW_FACE_SETS, - SCULPT_TOOL_BOUNDARY)) { + if (ss->cache->supports_gravity && + !ELEM( + brush->sculpt_tool, SCULPT_TOOL_CLOTH, SCULPT_TOOL_DRAW_FACE_SETS, SCULPT_TOOL_BOUNDARY)) + { do_gravity(sd, ob, nodes, sd->gravity_factor); } @@ -4381,7 +4392,8 @@ static void smooth_brush_toggle_on(const bContext *C, Paint *paint, StrokeCache SCULPT_TOOL_SLIDE_RELAX, SCULPT_TOOL_DRAW_FACE_SETS, SCULPT_TOOL_PAINT, - SCULPT_TOOL_SMEAR)) { + SCULPT_TOOL_SMEAR)) + { /* Do nothing, this tool has its own smooth mode. */ } else { @@ -4415,7 +4427,8 @@ static void smooth_brush_toggle_off(const bContext *C, Paint *paint, StrokeCache SCULPT_TOOL_SLIDE_RELAX, SCULPT_TOOL_DRAW_FACE_SETS, SCULPT_TOOL_PAINT, - SCULPT_TOOL_SMEAR)) { + SCULPT_TOOL_SMEAR)) + { /* Do nothing. */ } else { @@ -4571,7 +4584,8 @@ static void sculpt_update_cache_invariants( /* Original coordinates require the sculpt undo system, which isn't used * for image brushes. It's also not necessary, just disable it. */ if (brush && brush->sculpt_tool == SCULPT_TOOL_PAINT && - SCULPT_use_image_paint_brush(&tool_settings->paint_mode, ob)) { + SCULPT_use_image_paint_brush(&tool_settings->paint_mode, ob)) + { cache->accum = true; } @@ -4614,7 +4628,8 @@ static bool sculpt_needs_delta_from_anchored_origin(Brush *brush) SCULPT_TOOL_POSE, SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_THUMB, - SCULPT_TOOL_ELASTIC_DEFORM)) { + SCULPT_TOOL_ELASTIC_DEFORM)) + { return true; } if (brush->sculpt_tool == SCULPT_TOOL_CLOTH && @@ -4665,7 +4680,8 @@ static void sculpt_update_brush_delta(UnifiedPaintSettings *ups, Object *ob, Bru SCULPT_TOOL_BOUNDARY, SCULPT_TOOL_SMEAR, SCULPT_TOOL_THUMB) && - !sculpt_brush_use_topology_rake(ss, brush)) { + !sculpt_brush_use_topology_rake(ss, brush)) + { return; } float grab_location[3], imat[4][4], delta[3], loc[3]; @@ -4681,7 +4697,8 @@ static void sculpt_update_brush_delta(UnifiedPaintSettings *ups, Object *ob, Bru } else if (tool == SCULPT_TOOL_SNAKE_HOOK || (tool == SCULPT_TOOL_CLOTH && - brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_SNAKE_HOOK)) { + brush->cloth_deform_type == BRUSH_CLOTH_DEFORM_SNAKE_HOOK)) + { add_v3_v3(cache->true_location, cache->grab_delta); } @@ -4853,7 +4870,8 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, Po if (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(ss->cache) || !((brush->flag & BRUSH_ANCHORED) || (brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK) || - (brush->sculpt_tool == SCULPT_TOOL_ROTATE) || SCULPT_is_cloth_deform_brush(brush))) { + (brush->sculpt_tool == SCULPT_TOOL_ROTATE) || SCULPT_is_cloth_deform_brush(brush))) + { RNA_float_get_array(ptr, "location", cache->true_location); } @@ -4898,8 +4916,8 @@ static void sculpt_update_cache_variants(bContext *C, Sculpt *sd, Object *ob, Po } } - if (BKE_brush_use_size_pressure(brush) && - paint_supports_dynamic_size(brush, PAINT_MODE_SCULPT)) { + if (BKE_brush_use_size_pressure(brush) && paint_supports_dynamic_size(brush, PAINT_MODE_SCULPT)) + { cache->radius = sculpt_brush_dynamic_size_get(brush, cache, cache->initial_radius); cache->dyntopo_pixel_radius = sculpt_brush_dynamic_size_get( brush, cache, ups->initial_pixel_radius); @@ -4978,7 +4996,8 @@ void SCULPT_stroke_modifiers_check(const bContext *C, Object *ob, const Brush *b bool need_pmap = sculpt_needs_connectivity_info(sd, brush, ss, 0); if (ss->shapekey_active || ss->deform_modifiers_active || - (!BKE_sculptsession_use_pbvh_draw(ob, rv3d) && need_pmap)) { + (!BKE_sculptsession_use_pbvh_draw(ob, rv3d) && need_pmap)) + { Depsgraph *depsgraph = CTX_data_depsgraph_pointer(C); BKE_sculpt_update_object_for_edit( depsgraph, ob, need_pmap, false, SCULPT_tool_is_paint(brush->sculpt_tool)); @@ -5016,7 +5035,8 @@ static void sculpt_raycast_cb(PBVHNode *node, void *data_v, float *tmin) &srd->depth, &srd->active_vertex, &srd->active_face_grid_index, - srd->face_normal)) { + srd->face_normal)) + { srd->hit = true; *tmin = srd->depth; } @@ -5050,7 +5070,8 @@ static void sculpt_find_nearest_to_ray_cb(PBVHNode *node, void *data_v, float *t srd->ray_start, srd->ray_normal, &srd->depth, - &srd->dist_sq_to_ray)) { + &srd->dist_sq_to_ray)) + { srd->hit = true; *tmin = srd->dist_sq_to_ray; } @@ -5082,7 +5103,8 @@ float SCULPT_raycast_init(ViewContext *vc, if ((rv3d->is_persp == false) && /* If the ray is clipped, don't adjust its start/end. */ - !RV3D_CLIPPING_ENABLED(v3d, rv3d)) { + !RV3D_CLIPPING_ENABLED(v3d, rv3d)) + { BKE_pbvh_raycast_project_ray_root(ob->sculpt->pbvh, original, ray_start, ray_end, ray_normal); /* rRecalculate the normal. */ @@ -5348,7 +5370,8 @@ static void sculpt_brush_stroke_init(bContext *C, wmOperator *op) } if (brush->sculpt_tool == SCULPT_TOOL_CLOTH || - brush->deform_target == BRUSH_DEFORM_TARGET_CLOTH_SIM) { + brush->deform_target == BRUSH_DEFORM_TARGET_CLOTH_SIM) + { need_mask = true; } @@ -5387,7 +5410,8 @@ static void sculpt_restore_mesh(Sculpt *sd, Object *ob) if ((brush->flag & BRUSH_ANCHORED) || (ELEM(brush->sculpt_tool, SCULPT_TOOL_GRAB, SCULPT_TOOL_ELASTIC_DEFORM) && BKE_brush_use_size_pressure(brush)) || - (brush->flag & BRUSH_DRAG_DOT)) { + (brush->flag & BRUSH_DRAG_DOT)) + { paint_mesh_restore_co(sd, ob); @@ -5597,7 +5621,8 @@ static void sculpt_stroke_undo_begin(const bContext *C, wmOperator *op) /* Setup the correct undo system. Image painting and sculpting are mutual exclusive. * Color attributes are part of the sculpting undo system. */ if (brush && brush->sculpt_tool == SCULPT_TOOL_PAINT && - SCULPT_use_image_paint_brush(&tool_settings->paint_mode, ob)) { + SCULPT_use_image_paint_brush(&tool_settings->paint_mode, ob)) + { ED_image_undo_push_begin(op->type->name, PAINT_MODE_SCULPT); } else { @@ -5611,7 +5636,8 @@ static void sculpt_stroke_undo_end(const bContext *C, Brush *brush) ToolSettings *tool_settings = CTX_data_tool_settings(C); if (brush && brush->sculpt_tool == SCULPT_TOOL_PAINT && - SCULPT_use_image_paint_brush(&tool_settings->paint_mode, ob)) { + SCULPT_use_image_paint_brush(&tool_settings->paint_mode, ob)) + { ED_image_undo_push_end(); } else { @@ -5653,7 +5679,8 @@ static bool sculpt_stroke_test_start(bContext *C, wmOperator *op, const float mv /* NOTE: This should be removed when paint mode is available. Paint mode can force based on the * canvas it is painting on. (ref. use_sculpt_texture_paint). */ if (brush && SCULPT_tool_is_paint(brush->sculpt_tool) && - !SCULPT_use_image_paint_brush(&tool_settings->paint_mode, ob)) { + !SCULPT_use_image_paint_brush(&tool_settings->paint_mode, ob)) + { View3D *v3d = CTX_wm_view3d(C); if (v3d->shading.type == OB_SOLID) { v3d->shading.color_type = V3D_SHADING_VERTEX_COLOR; @@ -5849,7 +5876,8 @@ static int sculpt_brush_stroke_invoke(bContext *C, wmOperator *op, const wmEvent SculptSession *ss = ob->sculpt; if (SCULPT_tool_is_paint(brush->sculpt_tool) && - !SCULPT_handles_colors_report(ob->sculpt, op->reports)) { + !SCULPT_handles_colors_report(ob->sculpt, op->reports)) + { return OPERATOR_CANCELLED; } if (SCULPT_tool_is_mask(brush->sculpt_tool)) { @@ -6046,10 +6074,12 @@ static void do_fake_neighbor_search_task_cb(void *__restrict userdata, BKE_pbvh_vertex_iter_begin (ss->pbvh, data->nodes[n], vd, PBVH_ITER_UNIQUE) { int vd_topology_id = SCULPT_vertex_island_get(ss, vd.vertex); if (vd_topology_id != nvtd->current_topology_id && - ss->fake_neighbors.fake_neighbor_index[vd.index] == FAKE_NEIGHBOR_NONE) { + ss->fake_neighbors.fake_neighbor_index[vd.index] == FAKE_NEIGHBOR_NONE) + { float distance_squared = len_squared_v3v3(vd.co, data->nearest_vertex_search_co); if (distance_squared < nvtd->nearest_vertex_distance_squared && - distance_squared < data->max_distance_squared) { + distance_squared < data->max_distance_squared) + { nvtd->nearest_vertex = vd.vertex; nvtd->nearest_vertex_distance_squared = distance_squared; } @@ -6341,8 +6371,8 @@ void SCULPT_topology_islands_ensure(Object *ob) { SculptSession *ss = ob->sculpt; - if (ss->attrs.topology_island_key && ss->islands_valid && - BKE_pbvh_type(ss->pbvh) != PBVH_BMESH) { + if (ss->attrs.topology_island_key && ss->islands_valid && BKE_pbvh_type(ss->pbvh) != PBVH_BMESH) + { return; } diff --git a/source/blender/editors/sculpt_paint/sculpt_automasking.cc b/source/blender/editors/sculpt_paint/sculpt_automasking.cc index 5dd24d01728..01583af78ec 100644 --- a/source/blender/editors/sculpt_paint/sculpt_automasking.cc +++ b/source/blender/editors/sculpt_paint/sculpt_automasking.cc @@ -200,12 +200,14 @@ static bool SCULPT_automasking_needs_factors_cache(const Sculpt *sd, const Brush const int automasking_flags = sculpt_automasking_mode_effective_bits(sd, brush); if (automasking_flags & BRUSH_AUTOMASKING_TOPOLOGY && brush && - sculpt_automasking_is_constrained_by_radius(brush)) { + sculpt_automasking_is_constrained_by_radius(brush)) + { return true; } if (automasking_flags & (BRUSH_AUTOMASKING_BOUNDARY_EDGES | - BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS | BRUSH_AUTOMASKING_VIEW_NORMAL)) { + BRUSH_AUTOMASKING_BOUNDARY_FACE_SETS | BRUSH_AUTOMASKING_VIEW_NORMAL)) + { return brush && brush->automasking_boundary_edges_propagation_steps != 1; } return false; @@ -507,7 +509,8 @@ static float sculpt_automasking_cavity_factor(AutomaskingCache *automasking, bool inverted = automasking->settings.flags & BRUSH_AUTOMASKING_CAVITY_INVERTED; if ((automasking->settings.flags & BRUSH_AUTOMASKING_CAVITY_ALL) && - (automasking->settings.flags & BRUSH_AUTOMASKING_CAVITY_USE_CURVE)) { + (automasking->settings.flags & BRUSH_AUTOMASKING_CAVITY_USE_CURVE)) + { factor = inverted ? 1.0f - factor : factor; factor = BKE_curvemapping_evaluateF(automasking->settings.cavity_curve, 0, factor); factor = inverted ? 1.0f - factor : factor; @@ -530,7 +533,8 @@ float SCULPT_automasking_factor_get(AutomaskingCache *automasking, /* Since brush normal mode depends on the current mirror symmetry pass * it is not folded into the factor cache (when it exists). */ if ((ss->cache || ss->filter_cache) && - (automasking->settings.flags & BRUSH_AUTOMASKING_BRUSH_NORMAL)) { + (automasking->settings.flags & BRUSH_AUTOMASKING_BRUSH_NORMAL)) + { mask *= automasking_brush_normal_factor(automasking, ss, vert, automask_data); } @@ -555,13 +559,15 @@ float SCULPT_automasking_factor_get(AutomaskingCache *automasking, (BRUSH_AUTOMASKING_VIEW_OCCLUSION | BRUSH_AUTOMASKING_VIEW_NORMAL)) == (BRUSH_AUTOMASKING_VIEW_OCCLUSION | BRUSH_AUTOMASKING_VIEW_NORMAL); if (do_occlusion && - automasking_view_occlusion_factor(automasking, ss, vert, stroke_id, automask_data)) { + automasking_view_occlusion_factor(automasking, ss, vert, stroke_id, automask_data)) + { return automasking_factor_end(ss, automasking, vert, 0.0f); } if (!automasking->settings.topology_use_brush_limit && automasking->settings.flags & BRUSH_AUTOMASKING_TOPOLOGY && - SCULPT_vertex_island_get(ss, vert) != automasking->settings.initial_island_nr) { + SCULPT_vertex_island_get(ss, vert) != automasking->settings.initial_island_nr) + { return 0.0f; } @@ -588,7 +594,8 @@ float SCULPT_automasking_factor_get(AutomaskingCache *automasking, } if ((ss->cache || ss->filter_cache) && - (automasking->settings.flags & BRUSH_AUTOMASKING_VIEW_NORMAL)) { + (automasking->settings.flags & BRUSH_AUTOMASKING_VIEW_NORMAL)) + { mask *= automasking_view_normal_factor(automasking, ss, vert, automask_data); } diff --git a/source/blender/editors/sculpt_paint/sculpt_boundary.cc b/source/blender/editors/sculpt_paint/sculpt_boundary.cc index ce47e6c97cf..d5aa6910bd6 100644 --- a/source/blender/editors/sculpt_paint/sculpt_boundary.cc +++ b/source/blender/editors/sculpt_paint/sculpt_boundary.cc @@ -267,11 +267,13 @@ static void sculpt_boundary_indices_init(SculptSession *ss, /* Check if the boundary loops into itself and add the extra preview edge to close the loop. */ if (fdata.last_visited_vertex.i != BOUNDARY_VERTEX_NONE && - sculpt_boundary_is_vertex_in_editable_boundary(ss, fdata.last_visited_vertex)) { + sculpt_boundary_is_vertex_in_editable_boundary(ss, fdata.last_visited_vertex)) + { SculptVertexNeighborIter ni; SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, fdata.last_visited_vertex, ni) { if (BLI_gset_haskey(included_verts, POINTER_FROM_INT(ni.index)) && - sculpt_boundary_is_vertex_in_editable_boundary(ss, ni.vertex)) { + sculpt_boundary_is_vertex_in_editable_boundary(ss, ni.vertex)) + { sculpt_boundary_preview_edge_add(boundary, fdata.last_visited_vertex, ni.vertex); boundary->forms_loop = true; } @@ -394,7 +396,8 @@ static void sculpt_boundary_edit_data_init(SculptSession *ss, /* Check the distance using the vertex that was propagated from the initial vertex that * was used to initialize the boundary. */ if (boundary->edit_info[from_v_i].original_vertex_i == - BKE_pbvh_vertex_to_index(ss->pbvh, initial_vertex)) { + BKE_pbvh_vertex_to_index(ss->pbvh, initial_vertex)) + { boundary->pivot_vertex = ni.vertex; copy_v3_v3(boundary->initial_pivot_position, SCULPT_vertex_co_get(ss, ni.vertex)); accum_distance += len_v3v3(SCULPT_vertex_co_get(ss, from_v), @@ -439,7 +442,8 @@ static void sculpt_boundary_falloff_factor_init(SculptSession *ss, } if (boundary->edit_info[i].original_vertex_i == - BKE_pbvh_vertex_to_index(ss->pbvh, boundary->initial_vertex)) { + BKE_pbvh_vertex_to_index(ss->pbvh, boundary->initial_vertex)) + { /* All vertices that are propagated from the original vertex won't be affected by the * boundary falloff, so there is no need to calculate anything else. */ continue; @@ -679,8 +683,8 @@ static void do_boundary_brush_bend_task_cb_ex(void *__restrict userdata, SCULPT_automasking_node_update(ss, &automask_data, &vd); SCULPT_orig_vert_data_update(&orig_data, &vd); - if (!SCULPT_check_vertex_pivot_symmetry( - orig_data.co, boundary->initial_vertex_position, symm)) { + if (!SCULPT_check_vertex_pivot_symmetry(orig_data.co, boundary->initial_vertex_position, symm)) + { continue; } @@ -732,8 +736,8 @@ static void do_boundary_brush_slide_task_cb_ex(void *__restrict userdata, SCULPT_automasking_node_update(ss, &automask_data, &vd); SCULPT_orig_vert_data_update(&orig_data, &vd); - if (!SCULPT_check_vertex_pivot_symmetry( - orig_data.co, boundary->initial_vertex_position, symm)) { + if (!SCULPT_check_vertex_pivot_symmetry(orig_data.co, boundary->initial_vertex_position, symm)) + { continue; } @@ -783,8 +787,8 @@ static void do_boundary_brush_inflate_task_cb_ex(void *__restrict userdata, SCULPT_automasking_node_update(ss, &automask_data, &vd); SCULPT_orig_vert_data_update(&orig_data, &vd); - if (!SCULPT_check_vertex_pivot_symmetry( - orig_data.co, boundary->initial_vertex_position, symm)) { + if (!SCULPT_check_vertex_pivot_symmetry(orig_data.co, boundary->initial_vertex_position, symm)) + { continue; } @@ -832,8 +836,8 @@ static void do_boundary_brush_grab_task_cb_ex(void *__restrict userdata, SCULPT_automasking_node_update(ss, &automask_data, &vd); SCULPT_orig_vert_data_update(&orig_data, &vd); - if (!SCULPT_check_vertex_pivot_symmetry( - orig_data.co, boundary->initial_vertex_position, symm)) { + if (!SCULPT_check_vertex_pivot_symmetry(orig_data.co, boundary->initial_vertex_position, symm)) + { continue; } @@ -888,8 +892,8 @@ static void do_boundary_brush_twist_task_cb_ex(void *__restrict userdata, SCULPT_automasking_node_update(ss, &automask_data, &vd); SCULPT_orig_vert_data_update(&orig_data, &vd); - if (!SCULPT_check_vertex_pivot_symmetry( - orig_data.co, boundary->initial_vertex_position, symm)) { + if (!SCULPT_check_vertex_pivot_symmetry(orig_data.co, boundary->initial_vertex_position, symm)) + { continue; } @@ -935,8 +939,8 @@ static void do_boundary_brush_smooth_task_cb_ex(void *__restrict userdata, } SCULPT_orig_vert_data_update(&orig_data, &vd); - if (!SCULPT_check_vertex_pivot_symmetry( - orig_data.co, boundary->initial_vertex_position, symm)) { + if (!SCULPT_check_vertex_pivot_symmetry(orig_data.co, boundary->initial_vertex_position, symm)) + { continue; } diff --git a/source/blender/editors/sculpt_paint/sculpt_brush_types.cc b/source/blender/editors/sculpt_paint/sculpt_brush_types.cc index 457f7e0a62e..de494130a6e 100644 --- a/source/blender/editors/sculpt_paint/sculpt_brush_types.cc +++ b/source/blender/editors/sculpt_paint/sculpt_brush_types.cc @@ -96,7 +96,8 @@ static void calc_sculpt_plane( if (SCULPT_stroke_is_main_symmetry_pass(ss->cache) && (SCULPT_stroke_is_first_brush_step_of_symmetry_pass(ss->cache) || - !(brush->flag & BRUSH_ORIGINAL_PLANE) || !(brush->flag & BRUSH_ORIGINAL_NORMAL))) { + !(brush->flag & BRUSH_ORIGINAL_PLANE) || !(brush->flag & BRUSH_ORIGINAL_NORMAL))) + { switch (brush->sculpt_plane) { case SCULPT_DISP_DIR_VIEW: copy_v3_v3(r_area_no, ss->cache->true_view_normal); @@ -134,7 +135,8 @@ static void calc_sculpt_plane( /* For area normal. */ if (!SCULPT_stroke_is_first_brush_step_of_symmetry_pass(ss->cache) && - (brush->flag & BRUSH_ORIGINAL_NORMAL)) { + (brush->flag & BRUSH_ORIGINAL_NORMAL)) + { copy_v3_v3(r_area_no, ss->cache->sculpt_normal); } else { @@ -143,7 +145,8 @@ static void calc_sculpt_plane( /* For flatten center. */ if (!SCULPT_stroke_is_first_brush_step_of_symmetry_pass(ss->cache) && - (brush->flag & BRUSH_ORIGINAL_PLANE)) { + (brush->flag & BRUSH_ORIGINAL_PLANE)) + { copy_v3_v3(r_area_co, ss->cache->last_center); } else { @@ -269,7 +272,8 @@ static void do_draw_brush_task_cb_ex(void *__restrict userdata, /* Offset vertex. */ if (ss->cache->brush->flag2 & BRUSH_USE_COLOR_AS_DISPLACEMENT && - (brush->mtex.brush_map_mode == MTEX_MAP_MODE_AREA)) { + (brush->mtex.brush_map_mode == MTEX_MAP_MODE_AREA)) + { float r_rgba[4]; SCULPT_brush_strength_color(ss, brush, @@ -2421,7 +2425,8 @@ void SCULPT_relax_vertex(SculptSession *ss, SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, vd->vertex, ni) { neighbor_count++; if (!filter_boundary_face_sets || - (filter_boundary_face_sets && !SCULPT_vertex_has_unique_face_set(ss, ni.vertex))) { + (filter_boundary_face_sets && !SCULPT_vertex_has_unique_face_set(ss, ni.vertex))) + { /* When the vertex to relax is boundary, use only connected boundary vertices for the average * position. */ diff --git a/source/blender/editors/sculpt_paint/sculpt_cloth.cc b/source/blender/editors/sculpt_paint/sculpt_cloth.cc index c2da182d45b..ba5ead18feb 100644 --- a/source/blender/editors/sculpt_paint/sculpt_cloth.cc +++ b/source/blender/editors/sculpt_paint/sculpt_cloth.cc @@ -356,7 +356,8 @@ static void do_cloth_brush_build_constraints_task_cb_ex(void *__restrict userdat for (int c_i = 0; c_i < tot_indices; c_i++) { for (int c_j = 0; c_j < tot_indices; c_j++) { if (c_i != c_j && !cloth_brush_sim_has_length_constraint( - data->cloth_sim, build_indices[c_i], build_indices[c_j])) { + data->cloth_sim, build_indices[c_i], build_indices[c_j])) + { cloth_brush_add_length_constraint(ss, data->cloth_sim, node_index, @@ -670,7 +671,8 @@ static void cloth_brush_solve_collision(Object *object, for (collider_cache = static_cast(cloth_sim->collider_list->first); collider_cache; - collider_cache = collider_cache->next) { + collider_cache = collider_cache->next) + { float ray_start[3], ray_normal[3]; float pos_world_space[3], prev_pos_world_space[3]; @@ -974,7 +976,8 @@ static void cloth_brush_apply_brush_foces(Sculpt *sd, Object *ob, Spancloth_deform_type == BRUSH_CLOTH_DEFORM_PINCH_PERPENDICULAR || - brush->cloth_force_falloff_type == BRUSH_CLOTH_FORCE_FALLOFF_PLANE) { + brush->cloth_force_falloff_type == BRUSH_CLOTH_FORCE_FALLOFF_PLANE) + { SCULPT_calc_brush_plane(sd, ob, nodes, area_no, area_co); /* Initialize stroke local space matrix. */ diff --git a/source/blender/editors/sculpt_paint/sculpt_detail.cc b/source/blender/editors/sculpt_paint/sculpt_detail.cc index 1fb308850d8..9bfed87380a 100644 --- a/source/blender/editors/sculpt_paint/sculpt_detail.cc +++ b/source/blender/editors/sculpt_paint/sculpt_detail.cc @@ -108,7 +108,8 @@ static int sculpt_detail_flood_fill_exec(bContext *C, wmOperator *op) SCULPT_undo_push_node(ob, nullptr, SCULPT_UNDO_COORDS); while (BKE_pbvh_bmesh_update_topology( - ss->pbvh, PBVH_Collapse | PBVH_Subdivide, center, nullptr, size, false, false)) { + ss->pbvh, PBVH_Collapse | PBVH_Subdivide, center, nullptr, size, false, false)) + { for (PBVHNode *node : nodes) { BKE_pbvh_node_mark_topology_update(node); } @@ -191,7 +192,8 @@ static void sculpt_raycast_detail_cb(PBVHNode *node, void *data_v, float *tmin) if (BKE_pbvh_node_get_tmin(node) < *tmin) { SculptDetailRaycastData *srd = static_cast(data_v); if (BKE_pbvh_bmesh_node_raycast_detail( - node, srd->ray_start, &srd->isect_precalc, &srd->depth, &srd->edge_length)) { + node, srd->ray_start, &srd->isect_precalc, &srd->depth, &srd->edge_length)) + { srd->hit = true; *tmin = srd->depth; } @@ -635,7 +637,8 @@ static int dyntopo_detail_size_edit_modal(bContext *C, wmOperator *op, const wmE /* Cancel modal operator */ if ((event->type == EVT_ESCKEY && event->val == KM_PRESS) || - (event->type == RIGHTMOUSE && event->val == KM_PRESS)) { + (event->type == RIGHTMOUSE && event->val == KM_PRESS)) + { dyntopo_detail_size_edit_cancel(C, op); ED_region_tag_redraw(region); return OPERATOR_FINISHED; @@ -644,7 +647,8 @@ static int dyntopo_detail_size_edit_modal(bContext *C, wmOperator *op, const wmE /* Finish modal operator */ if ((event->type == LEFTMOUSE && event->val == KM_RELEASE) || (event->type == EVT_RETKEY && event->val == KM_PRESS) || - (event->type == EVT_PADENTER && event->val == KM_PRESS)) { + (event->type == EVT_PADENTER && event->val == KM_PRESS)) + { ED_region_draw_cb_exit(region->type, cd->draw_handle); sd->constant_detail = cd->detail_size; ss->draw_faded_cursor = false; diff --git a/source/blender/editors/sculpt_paint/sculpt_expand.cc b/source/blender/editors/sculpt_paint/sculpt_expand.cc index 523fcbae2c5..59e735a077d 100644 --- a/source/blender/editors/sculpt_paint/sculpt_expand.cc +++ b/source/blender/editors/sculpt_paint/sculpt_expand.cc @@ -1008,7 +1008,8 @@ static void sculpt_expand_initialize_from_face_set_boundary(Object *ob, PBVHVertRef vertex = BKE_pbvh_index_to_vertex(ss->pbvh, i); if (!(SCULPT_vertex_has_face_set(ss, vertex, active_face_set) && - SCULPT_vertex_has_unique_face_set(ss, vertex))) { + SCULPT_vertex_has_unique_face_set(ss, vertex))) + { continue; } expand_cache->vert_falloff[i] *= -1.0f; @@ -1278,7 +1279,8 @@ static void sculpt_expand_mask_update_task_cb(void *__restrict userdata, const bool enabled = sculpt_expand_state_get(ss, expand_cache, vd.vertex); if (expand_cache->check_islands && - !sculpt_expand_is_vert_in_active_component(ss, expand_cache, vd.vertex)) { + !sculpt_expand_is_vert_in_active_component(ss, expand_cache, vd.vertex)) + { continue; } @@ -1844,7 +1846,8 @@ static int sculpt_expand_modal(bContext *C, wmOperator *op, const wmEvent *event copy_v2_v2(expand_cache->initial_mouse_move, mval_fl); copy_v2_v2(expand_cache->original_mouse_move, expand_cache->initial_mouse); if (expand_cache->falloff_type == SCULPT_EXPAND_FALLOFF_GEODESIC && - SCULPT_vertex_count_get(ss) > expand_cache->max_geodesic_move_preview) { + SCULPT_vertex_count_get(ss) > expand_cache->max_geodesic_move_preview) + { /* Set to spherical falloff for preview in high poly meshes as it is the fastest one. * In most cases it should match closely the preview from geodesic. */ expand_cache->move_preview_falloff_type = SCULPT_EXPAND_FALLOFF_SPHERICAL; @@ -2201,7 +2204,8 @@ static int sculpt_expand_invoke(bContext *C, wmOperator *op, const wmEvent *even /* Face Set operations are not supported in dyntopo. */ if (ss->expand_cache->target == SCULPT_EXPAND_TARGET_FACE_SETS && - BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) { + BKE_pbvh_type(ss->pbvh) == PBVH_BMESH) + { sculpt_expand_cache_free(ss); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/sculpt_paint/sculpt_face_set.cc b/source/blender/editors/sculpt_paint/sculpt_face_set.cc index fb635f3ed5a..aa5b88a03f2 100644 --- a/source/blender/editors/sculpt_paint/sculpt_face_set.cc +++ b/source/blender/editors/sculpt_paint/sculpt_face_set.cc @@ -370,8 +370,8 @@ static int sculpt_face_set_create_exec(bContext *C, wmOperator *op) for (int i = 0; i < tot_vert; i++) { PBVHVertRef vertex = BKE_pbvh_index_to_vertex(ss->pbvh, i); - if (SCULPT_vertex_mask_get(ss, vertex) >= threshold && - SCULPT_vertex_visible_get(ss, vertex)) { + if (SCULPT_vertex_mask_get(ss, vertex) >= threshold && SCULPT_vertex_visible_get(ss, vertex)) + { SCULPT_vertex_face_set_set(ss, vertex, next_face_set); } } diff --git a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.cc b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.cc index ef512c55641..1beb13a2fc2 100644 --- a/source/blender/editors/sculpt_paint/sculpt_filter_mesh.cc +++ b/source/blender/editors/sculpt_paint/sculpt_filter_mesh.cc @@ -205,7 +205,8 @@ void SCULPT_filter_cache_init(bContext *C, nodes = blender::bke::pbvh::search_gather(pbvh, SCULPT_search_sphere_cb, &search_data2); if (BKE_paint_brush(&sd->paint) && - SCULPT_pbvh_calc_area_normal(brush, ob, nodes, true, ss->filter_cache->initial_normal)) { + SCULPT_pbvh_calc_area_normal(brush, ob, nodes, true, ss->filter_cache->initial_normal)) + { copy_v3_v3(ss->last_normal, ss->filter_cache->initial_normal); } else { @@ -402,7 +403,8 @@ static void mesh_filter_task_cb(void *__restrict userdata, } if (ELEM(filter_type, MESH_FILTER_RELAX, MESH_FILTER_RELAX_FACE_SETS) || - ss->filter_cache->no_orig_co) { + ss->filter_cache->no_orig_co) + { copy_v3_v3(orig_co, vd.co); } else { @@ -645,7 +647,8 @@ static void mesh_filter_sharpen_init(SculptSession *ss, /* Smooth the calculated factors and directions to remove high frequency detail. */ for (int smooth_iterations = 0; smooth_iterations < filter_cache->sharpen_curvature_smooth_iterations; - smooth_iterations++) { + smooth_iterations++) + { for (int i = 0; i < totvert; i++) { PBVHVertRef vertex = BKE_pbvh_index_to_vertex(ss->pbvh, i); diff --git a/source/blender/editors/sculpt_paint/sculpt_geodesic.cc b/source/blender/editors/sculpt_paint/sculpt_geodesic.cc index 0c9a0a01ad8..537abb5ef0a 100644 --- a/source/blender/editors/sculpt_paint/sculpt_geodesic.cc +++ b/source/blender/editors/sculpt_paint/sculpt_geodesic.cc @@ -195,7 +195,8 @@ static float *SCULPT_geodesic_mesh_create(Object *ob, } if (e_other != e && !BLI_BITMAP_TEST(edge_tag, e_other) && - (ss->epmap[e_other].count == 0 || dists[ev_other] != FLT_MAX)) { + (ss->epmap[e_other].count == 0 || dists[ev_other] != FLT_MAX)) + { if (BLI_BITMAP_TEST(affected_vertex, v_other) || BLI_BITMAP_TEST(affected_vertex, ev_other)) { BLI_BITMAP_ENABLE(edge_tag, e_other); diff --git a/source/blender/editors/sculpt_paint/sculpt_intern.hh b/source/blender/editors/sculpt_paint/sculpt_intern.hh index fa5a16b36d7..63fd2b77fb1 100644 --- a/source/blender/editors/sculpt_paint/sculpt_intern.hh +++ b/source/blender/editors/sculpt_paint/sculpt_intern.hh @@ -1026,7 +1026,8 @@ void SCULPT_vertex_neighbors_get(SculptSession *ss, #define SCULPT_VERTEX_DUPLICATES_AND_NEIGHBORS_ITER_BEGIN(ss, v_index, neighbor_iterator) \ SCULPT_vertex_neighbors_get(ss, v_index, true, &neighbor_iterator); \ for (neighbor_iterator.i = neighbor_iterator.size - 1; neighbor_iterator.i >= 0; \ - neighbor_iterator.i--) { \ + neighbor_iterator.i--) \ + { \ neighbor_iterator.vertex = neighbor_iterator.neighbors[neighbor_iterator.i]; \ neighbor_iterator.index = neighbor_iterator.neighbor_indices[neighbor_iterator.i]; \ neighbor_iterator.is_duplicate = (neighbor_iterator.i >= \ @@ -1168,7 +1169,8 @@ BLI_INLINE bool SCULPT_tool_needs_all_pbvh_nodes(const Brush *brush) } if (brush->sculpt_tool == SCULPT_TOOL_SNAKE_HOOK && - brush->snake_hook_deform_type == BRUSH_SNAKE_HOOK_DEFORM_ELASTIC) { + brush->snake_hook_deform_type == BRUSH_SNAKE_HOOK_DEFORM_ELASTIC) + { /* Snake hook in elastic deform type has same requirements as the elastic deform tool. */ return true; } diff --git a/source/blender/editors/sculpt_paint/sculpt_mask_expand.cc b/source/blender/editors/sculpt_paint/sculpt_mask_expand.cc index 303c9b5937b..edbded835c7 100644 --- a/source/blender/editors/sculpt_paint/sculpt_mask_expand.cc +++ b/source/blender/editors/sculpt_paint/sculpt_mask_expand.cc @@ -175,7 +175,8 @@ static int sculpt_mask_expand_modal(bContext *C, wmOperator *op, const wmEvent * } if ((event->type == EVT_ESCKEY && event->val == KM_PRESS) || - (event->type == RIGHTMOUSE && event->val == KM_PRESS)) { + (event->type == RIGHTMOUSE && event->val == KM_PRESS)) + { /* Returning OPERATOR_CANCELLED will leak memory due to not finishing * undo. Better solution could be to make paint_mesh_restore_co work * for this case. */ @@ -185,7 +186,8 @@ static int sculpt_mask_expand_modal(bContext *C, wmOperator *op, const wmEvent * if ((event->type == LEFTMOUSE && event->val == KM_RELEASE) || (event->type == EVT_RETKEY && event->val == KM_PRESS) || - (event->type == EVT_PADENTER && event->val == KM_PRESS)) { + (event->type == EVT_PADENTER && event->val == KM_PRESS)) + { /* Smooth iterations. */ BKE_sculpt_update_object_for_edit(depsgraph, ob, true, false, false); diff --git a/source/blender/editors/sculpt_paint/sculpt_ops.cc b/source/blender/editors/sculpt_paint/sculpt_ops.cc index e7acc968524..d590b73fcff 100644 --- a/source/blender/editors/sculpt_paint/sculpt_ops.cc +++ b/source/blender/editors/sculpt_paint/sculpt_ops.cc @@ -349,8 +349,8 @@ void ED_object_sculptmode_enter_ex(Main *bmain, sculpt_init_session(bmain, depsgraph, scene, ob); - if (!(fabsf(ob->scale[0] - ob->scale[1]) < 1e-4f && - fabsf(ob->scale[1] - ob->scale[2]) < 1e-4f)) { + if (!(fabsf(ob->scale[0] - ob->scale[1]) < 1e-4f && fabsf(ob->scale[1] - ob->scale[2]) < 1e-4f)) + { BKE_report( reports, RPT_WARNING, "Object has non-uniform scale, sculpting may be unpredictable"); } diff --git a/source/blender/editors/sculpt_paint/sculpt_pose.cc b/source/blender/editors/sculpt_paint/sculpt_pose.cc index e3ccddd7e40..bb4f3a5494a 100644 --- a/source/blender/editors/sculpt_paint/sculpt_pose.cc +++ b/source/blender/editors/sculpt_paint/sculpt_pose.cc @@ -404,12 +404,14 @@ static bool pose_topology_floodfill_cb( } if (len_squared_v3v3(data->pose_initial_co, data->fallback_floodfill_origin) < - len_squared_v3v3(data->pose_initial_co, co)) { + len_squared_v3v3(data->pose_initial_co, co)) + { copy_v3_v3(data->fallback_floodfill_origin, co); } if (sculpt_pose_brush_is_vertex_inside_brush_radius( - co, data->pose_initial_co, data->radius, data->symm)) { + co, data->pose_initial_co, data->radius, data->symm)) + { return true; } if (SCULPT_check_vertex_pivot_symmetry(co, data->pose_initial_co, data->symm)) { @@ -444,7 +446,8 @@ static bool pose_face_sets_floodfill_cb( BLI_BITMAP_ENABLE(data->is_weighted, index); if (sculpt_pose_brush_is_vertex_inside_brush_radius( - co, data->pose_initial_co, data->radius, data->symm)) { + co, data->pose_initial_co, data->radius, data->symm)) + { const int visited_face_set = SCULPT_vertex_face_set_get(ss, vertex); BLI_gset_add(data->visited_face_sets, POINTER_FROM_INT(visited_face_set)); } @@ -500,7 +503,8 @@ static bool pose_face_sets_floodfill_cb( /* Check if we can get a valid face set for the next iteration from this neighbor. */ if (SCULPT_vertex_has_unique_face_set(ss, ni.vertex) && - !BLI_gset_haskey(data->visited_face_sets, POINTER_FROM_INT(next_face_set_candidate))) { + !BLI_gset_haskey(data->visited_face_sets, POINTER_FROM_INT(next_face_set_candidate))) + { if (!data->next_face_set_found) { data->next_face_set = next_face_set_candidate; data->next_vertex = ni.vertex; @@ -638,7 +642,8 @@ static int pose_brush_num_effective_segments(const Brush *brush) * artifacts in the areas affected by multiple segments. */ if (ELEM(brush->pose_deform_type, BRUSH_POSE_DEFORM_SCALE_TRASLATE, - BRUSH_POSE_DEFORM_SQUASH_STRETCH)) { + BRUSH_POSE_DEFORM_SQUASH_STRETCH)) + { return 1; } return brush->pose_ik_segments; @@ -815,7 +820,8 @@ static bool pose_face_sets_fk_find_masked_floodfill_cb( if (!BLI_gset_haskey(data->visited_face_sets, POINTER_FROM_INT(to_face_set))) { if (SCULPT_vertex_has_unique_face_set(ss, to_v) && !SCULPT_vertex_has_unique_face_set(ss, from_v) && - SCULPT_vertex_has_face_set(ss, from_v, to_face_set)) { + SCULPT_vertex_has_face_set(ss, from_v, to_face_set)) + { BLI_gset_add(data->visited_face_sets, POINTER_FROM_INT(to_face_set)); @@ -881,7 +887,8 @@ static SculptPoseIKChain *pose_ik_chain_init_face_sets_fk( if (fdata.floodfill_it[i] != 0 && SCULPT_vertex_has_face_set(ss, vertex, fdata.initial_face_set) && - SCULPT_vertex_has_face_set(ss, vertex, fdata.masked_face_set)) { + SCULPT_vertex_has_face_set(ss, vertex, fdata.masked_face_set)) + { add_v3_v3(origin_acc, SCULPT_vertex_co_get(ss, vertex)); origin_count++; } @@ -895,7 +902,8 @@ static SculptPoseIKChain *pose_ik_chain_init_face_sets_fk( if (fdata.floodfill_it[i] != 0 && SCULPT_vertex_has_face_set(ss, vertex, fdata.initial_face_set) && - SCULPT_vertex_has_face_set(ss, vertex, fdata.target_face_set)) { + SCULPT_vertex_has_face_set(ss, vertex, fdata.target_face_set)) + { add_v3_v3(target_acc, SCULPT_vertex_co_get(ss, vertex)); target_count++; } diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.cc b/source/blender/editors/sculpt_paint/sculpt_undo.cc index 9b9c66540ee..b42d8a71c31 100644 --- a/source/blender/editors/sculpt_paint/sculpt_undo.cc +++ b/source/blender/editors/sculpt_paint/sculpt_undo.cc @@ -947,8 +947,8 @@ static void sculpt_undo_restore_list(bContext *C, Depsgraph *depsgraph, ListBase } } else if (unode->maxgrid && subdiv_ccg != nullptr) { - if ((subdiv_ccg->num_grids != unode->maxgrid) || - (subdiv_ccg->grid_size != unode->gridsize)) { + if ((subdiv_ccg->num_grids != unode->maxgrid) || (subdiv_ccg->grid_size != unode->gridsize)) + { continue; } @@ -1742,7 +1742,8 @@ static void sculpt_save_active_attribute(Object *ob, SculptAttrRef *attr) return; } if (!(ATTR_DOMAIN_AS_MASK(meta_data->domain) & ATTR_DOMAIN_MASK_COLOR) || - !(CD_TYPE_AS_MASK(meta_data->data_type) & CD_MASK_COLOR_ALL)) { + !(CD_TYPE_AS_MASK(meta_data->data_type) & CD_MASK_COLOR_ALL)) + { return; } attr->domain = meta_data->domain; @@ -1854,7 +1855,8 @@ static void sculpt_undo_set_active_layer(struct bContext *C, SculptAttrRef *attr layer = BKE_id_attribute_search(&me->id, attr->name, CD_MASK_PROP_ALL, ATTR_DOMAIN_MASK_ALL); if (layer) { if (ED_geometry_attribute_convert( - me, attr->name, eCustomDataType(attr->type), attr->domain, nullptr)) { + me, attr->name, eCustomDataType(attr->type), attr->domain, nullptr)) + { layer = BKE_id_attribute_find(&me->id, attr->name, attr->type, attr->domain); } } diff --git a/source/blender/editors/space_action/action_draw.cc b/source/blender/editors/space_action/action_draw.cc index 8b5d49549ae..37ba92045d2 100644 --- a/source/blender/editors/space_action/action_draw.cc +++ b/source/blender/editors/space_action/action_draw.cc @@ -75,7 +75,8 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region) float ymax = ANIM_UI_get_first_channel_top(v2d); for (ale = static_cast(anim_data.first); ale; - ale = ale->next, ymax -= channel_step, channel_index++) { + ale = ale->next, ymax -= channel_step, channel_index++) + { const float ymin = ymax - ANIM_UI_get_channel_height(); /* check if visible */ @@ -92,7 +93,8 @@ void draw_channel_names(bContext *C, bAnimContext *ac, ARegion *region) float ymax = ANIM_UI_get_first_channel_top(v2d); for (ale = static_cast(anim_data.first); ale; - ale = ale->next, ymax -= channel_step, channel_index++) { + ale = ale->next, ymax -= channel_step, channel_index++) + { const float ymin = ymax - ANIM_UI_get_channel_height(); /* check if visible */ @@ -136,7 +138,8 @@ static void draw_channel_action_ranges(ListBase *anim_data, View2D *v2d) float ymin = ymax - ystep; for (bAnimListElem *ale = static_cast(anim_data->first); ale; - ale = ale->next, ymax = ymin, ymin -= ystep) { + ale = ale->next, ymax = ymin, ymin -= ystep) + { bAction *action = nullptr; AnimData *adt = nullptr; @@ -226,7 +229,8 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region float ymax = ANIM_UI_get_first_channel_top(v2d); const float channel_step = ANIM_UI_get_channel_step(); for (ale = static_cast(anim_data.first); ale; - ale = ale->next, ymax -= channel_step) { + ale = ale->next, ymax -= channel_step) + { const float ymin = ymax - ANIM_UI_get_channel_height(); /* check if visible */ @@ -386,7 +390,8 @@ void draw_channel_strips(bAnimContext *ac, SpaceAction *saction, ARegion *region const float scale_factor = ANIM_UI_get_keyframe_scale_factor(); for (ale = static_cast(anim_data.first); ale; - ale = ale->next, ymax -= channel_step) { + ale = ale->next, ymax -= channel_step) + { const float ymin = ymax - ANIM_UI_get_channel_height(); float ycenter = (ymin + ymax) / 2.0f; diff --git a/source/blender/editors/space_action/action_edit.cc b/source/blender/editors/space_action/action_edit.cc index ddaaf217b1f..82bf3d1fc4e 100644 --- a/source/blender/editors/space_action/action_edit.cc +++ b/source/blender/editors/space_action/action_edit.cc @@ -192,7 +192,8 @@ static bool get_keyframe_extents(bAnimContext *ac, float *min, float *max, const /* Find mask layer which is less than or equal to current-frame. */ for (masklay_shape = static_cast(masklay->splines_shapes.first); masklay_shape; - masklay_shape = masklay_shape->next) { + masklay_shape = masklay_shape->next) + { const float framenum = float(masklay_shape->frame); *min = min_ff(*min, framenum); *max = max_ff(*max, framenum); @@ -327,12 +328,14 @@ static bool actkeys_channels_get_selected_extents(bAnimContext *ac, float *r_min float ymax = ANIM_UI_get_first_channel_top(&ac->region->v2d); const float channel_step = ANIM_UI_get_channel_step(); for (ale = static_cast(anim_data.first); ale; - ale = ale->next, ymax -= channel_step) { + ale = ale->next, ymax -= channel_step) + { const bAnimChannelType *acf = ANIM_channel_get_typeinfo(ale); /* must be selected... */ if (acf && acf->has_setting(ac, ale, ACHANNEL_SETTING_SELECT) && - ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT)) { + ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT)) + { /* update best estimate */ *r_min = ymax - ANIM_UI_get_channel_height(); *r_max = ymax; @@ -547,7 +550,8 @@ static eKeyPasteError paste_action_keys(bAnimContext *ac, ANIMFILTER_FCURVESONLY | ANIMFILTER_NODUPLIS); if (ANIM_animdata_filter( - ac, &anim_data, filter | ANIMFILTER_SEL, ac->data, eAnimCont_Types(ac->datatype)) == 0) { + ac, &anim_data, filter | ANIMFILTER_SEL, ac->data, eAnimCont_Types(ac->datatype)) == 0) + { ANIM_animdata_filter(ac, &anim_data, filter, ac->data, eAnimCont_Types(ac->datatype)); } diff --git a/source/blender/editors/space_action/action_select.cc b/source/blender/editors/space_action/action_select.cc index abed2e4aa43..0db2363fdb6 100644 --- a/source/blender/editors/space_action/action_select.cc +++ b/source/blender/editors/space_action/action_select.cc @@ -274,7 +274,8 @@ static void deselect_action_keys(bAnimContext *ac, short test, short sel) } else { if (ANIM_fcurve_keyframes_loop( - &ked, static_cast(ale->key_data), nullptr, test_cb, nullptr)) { + &ked, static_cast(ale->key_data), nullptr, test_cb, nullptr)) + { sel = SELECT_SUBTRACT; break; } @@ -493,7 +494,8 @@ static void box_select_action(bAnimContext *ac, const rcti rect, short mode, sho /* loop over data, doing box select */ for (ale = static_cast(anim_data.first); ale; - ale = ale->next, ymax -= channel_step) { + ale = ale->next, ymax -= channel_step) + { AnimData *adt = ANIM_nla_mapping_get(ac, ale); /* get new vertical minimum extent of channel */ @@ -759,7 +761,8 @@ static void region_select_action_keys( /* loop over data, doing region select */ for (ale = static_cast(anim_data.first); ale; - ale = ale->next, ymax -= channel_step) { + ale = ale->next, ymax -= channel_step) + { AnimData *adt = ANIM_nla_mapping_get(ac, ale); /* get new vertical minimum extent of channel */ @@ -1472,7 +1475,8 @@ static void actkeys_select_leftright(bAnimContext *ac, short leftright, short se for (marker = static_cast(markers->first); marker; marker = marker->next) { if (((leftright == ACTKEYS_LRSEL_LEFT) && (marker->frame < scene->r.cfra)) || - ((leftright == ACTKEYS_LRSEL_RIGHT) && (marker->frame >= scene->r.cfra))) { + ((leftright == ACTKEYS_LRSEL_RIGHT) && (marker->frame >= scene->r.cfra))) + { marker->flag |= SELECT; } else { diff --git a/source/blender/editors/space_action/space_action.cc b/source/blender/editors/space_action/space_action.cc index d67bd5670ee..57d074e7051 100644 --- a/source/blender/editors/space_action/space_action.cc +++ b/source/blender/editors/space_action/space_action.cc @@ -549,7 +549,8 @@ static void action_listener(const wmSpaceTypeListenerParams *params) * (assume for now that if just adding these works, that will be fine). */ else if (((wmn->data == ND_KEYFRAME) && ELEM(wmn->action, NA_ADDED, NA_REMOVED)) || - ((wmn->data == ND_ANIMCHAN) && (wmn->action != NA_SELECTED))) { + ((wmn->data == ND_ANIMCHAN) && (wmn->action != NA_SELECTED))) + { ED_area_tag_refresh(area); } /* for simple edits to the curve data though (or just plain selections), diff --git a/source/blender/editors/space_buttons/buttons_context.c b/source/blender/editors/space_buttons/buttons_context.c index d275c8b9fce..f9bdd02d6f7 100644 --- a/source/blender/editors/space_buttons/buttons_context.c +++ b/source/blender/editors/space_buttons/buttons_context.c @@ -232,7 +232,8 @@ static bool buttons_context_path_data(ButsContextPath *path, int type) return true; } if (RNA_struct_is_a(ptr->type, &RNA_Curve) && - (type == -1 || ELEM(type, OB_CURVES_LEGACY, OB_SURF, OB_FONT))) { + (type == -1 || ELEM(type, OB_CURVES_LEGACY, OB_SURF, OB_FONT))) + { return true; } if (RNA_struct_is_a(ptr->type, &RNA_Armature) && ELEM(type, -1, OB_ARMATURE)) { @@ -300,7 +301,8 @@ static bool buttons_context_path_modifier(ButsContextPath *path) OB_GPENCIL_LEGACY, OB_CURVES, OB_POINTCLOUD, - OB_VOLUME)) { + OB_VOLUME)) + { ModifierData *md = BKE_object_active_modifier(ob); if (md != NULL) { RNA_pointer_create(&ob->id, &RNA_Modifier, md, &path->ptr[path->len]); @@ -565,7 +567,8 @@ static bool buttons_context_path( BCONTEXT_RENDER, BCONTEXT_OUTPUT, BCONTEXT_VIEW_LAYER, - BCONTEXT_WORLD)) { + BCONTEXT_WORLD)) + { RNA_pointer_create(NULL, &RNA_ViewLayer, view_layer, &path->ptr[path->len]); path->len++; } @@ -1194,7 +1197,8 @@ static void buttons_panel_context_draw(const bContext *C, Panel *panel) BCONTEXT_SCENE, BCONTEXT_VIEW_LAYER, BCONTEXT_WORLD) && - ptr->type == &RNA_Scene) { + ptr->type == &RNA_Scene) + { continue; } if (!ELEM(sbuts->mainb, @@ -1203,7 +1207,8 @@ static void buttons_panel_context_draw(const bContext *C, Panel *panel) BCONTEXT_SCENE, BCONTEXT_VIEW_LAYER, BCONTEXT_WORLD) && - ptr->type == &RNA_ViewLayer) { + ptr->type == &RNA_ViewLayer) + { continue; } diff --git a/source/blender/editors/space_buttons/space_buttons.c b/source/blender/editors/space_buttons/space_buttons.c index 8e14c85587c..9c793253095 100644 --- a/source/blender/editors/space_buttons/space_buttons.c +++ b/source/blender/editors/space_buttons/space_buttons.c @@ -860,7 +860,8 @@ static void buttons_id_remap(ScrArea *UNUSED(area), SpaceProperties *sbuts = (SpaceProperties *)slink; if (BKE_id_remapper_apply(mappings, &sbuts->pinid, ID_REMAP_APPLY_DEFAULT) == - ID_REMAP_RESULT_SOURCE_UNASSIGNED) { + ID_REMAP_RESULT_SOURCE_UNASSIGNED) + { sbuts->flag &= ~SB_PIN_CONTEXT; } diff --git a/source/blender/editors/space_clip/clip_dopesheet_draw.cc b/source/blender/editors/space_clip/clip_dopesheet_draw.cc index fbd20f5be63..42a43271446 100644 --- a/source/blender/editors/space_clip/clip_dopesheet_draw.cc +++ b/source/blender/editors/space_clip/clip_dopesheet_draw.cc @@ -73,7 +73,8 @@ static void clip_draw_dopesheet_background(ARegion *region, MovieClip *clip, uin MovieTrackingDopesheet *dopesheet = &tracking->dopesheet; LISTBASE_FOREACH ( - MovieTrackingDopesheetCoverageSegment *, coverage_segment, &dopesheet->coverage_segments) { + MovieTrackingDopesheetCoverageSegment *, coverage_segment, &dopesheet->coverage_segments) + { if (coverage_segment->coverage < TRACKING_COVERAGE_OK) { int start_frame = BKE_movieclip_remap_clip_to_scene_frame(clip, coverage_segment->start_frame); diff --git a/source/blender/editors/space_clip/clip_draw.cc b/source/blender/editors/space_clip/clip_draw.cc index a321dc1bebd..cb9a93b064b 100644 --- a/source/blender/editors/space_clip/clip_draw.cc +++ b/source/blender/editors/space_clip/clip_draw.cc @@ -165,7 +165,8 @@ static void draw_movieclip_cache(SpaceClip *sc, ARegion *region, MovieClip *clip } if (a < markersnr - 1 && - generic_track_get_marker_framenr(active_track, active_plane_track, a + 1) > i) { + generic_track_get_marker_framenr(active_track, active_plane_track, a + 1) > i) + { break; } @@ -322,7 +323,8 @@ static void draw_movieclip_buffer(const bContext *C, /* non-scaled proxy shouldn't use filtering */ if ((clip->flag & MCLIP_USE_PROXY) == 0 || - ELEM(sc->user.render_size, MCLIP_PROXY_RENDER_SIZE_FULL, MCLIP_PROXY_RENDER_SIZE_100)) { + ELEM(sc->user.render_size, MCLIP_PROXY_RENDER_SIZE_FULL, MCLIP_PROXY_RENDER_SIZE_100)) + { use_filter = false; } @@ -602,7 +604,8 @@ static void draw_marker_outline(SpaceClip *sc, marker->pattern_corners[0], marker->pattern_corners[1], marker->pattern_corners[2], - marker->pattern_corners[3])) { + marker->pattern_corners[3])) + { GPU_point_size(tiny ? 3.0f : 4.0f); immBegin(GPU_PRIM_POINTS, 1); @@ -776,7 +779,8 @@ static void draw_marker_areas(SpaceClip *sc, marker->pattern_corners[0], marker->pattern_corners[1], marker->pattern_corners[2], - marker->pattern_corners[3])) { + marker->pattern_corners[3])) + { GPU_point_size(tiny ? 1.0f : 2.0f); immUniform1f("udash_factor", 2.0f); /* Solid "line" */ @@ -1054,7 +1058,8 @@ static void draw_marker_texts(SpaceClip *sc, } if ((sc->flag & SC_SHOW_MARKER_SEARCH) && - ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0)) { + ((marker->flag & MARKER_DISABLED) == 0 || (sc->flag & SC_SHOW_MARKER_PATTERN) == 0)) + { dx = marker->search_min[0]; dy = marker->search_min[1]; } diff --git a/source/blender/editors/space_clip/clip_editor.cc b/source/blender/editors/space_clip/clip_editor.cc index 36dbf8d4dfe..3febebe043e 100644 --- a/source/blender/editors/space_clip/clip_editor.cc +++ b/source/blender/editors/space_clip/clip_editor.cc @@ -779,7 +779,8 @@ static uchar *prefetch_thread_next_frame(PrefetchQueue *queue, BLI_spin_lock(&queue->spin); if (!*queue->stop && !check_prefetch_break() && - IN_RANGE_INCL(queue->current_frame, queue->start_frame, queue->end_frame)) { + IN_RANGE_INCL(queue->current_frame, queue->start_frame, queue->end_frame)) + { int current_frame; if (queue->forward) { @@ -1163,7 +1164,8 @@ void ED_clip_view_lock_state_store(const bContext *C, ClipViewLockState *state) } if (!clip_view_calculate_view_selection( - C, false, &state->offset_x, &state->offset_y, &state->zoom)) { + C, false, &state->offset_x, &state->offset_y, &state->zoom)) + { return; } diff --git a/source/blender/editors/space_clip/clip_graph_ops.cc b/source/blender/editors/space_clip/clip_graph_ops.cc index 96ed093fce8..cab428b584a 100644 --- a/source/blender/editors/space_clip/clip_graph_ops.cc +++ b/source/blender/editors/space_clip/clip_graph_ops.cc @@ -184,7 +184,8 @@ static bool mouse_select_knot(bContext *C, const float co[2], bool extend) if (UI_view2d_view_to_region_clip(v2d, co[0], co[1], &x1, &y1) && UI_view2d_view_to_region_clip(v2d, userdata.min_co[0], userdata.min_co[1], &x2, &y2) && - (abs(x2 - x1) <= delta && abs(y2 - y1) <= delta)) { + (abs(x2 - x1) <= delta && abs(y2 - y1) <= delta)) + { if (!extend) { SelectUserData selectdata = {SEL_DESELECT}; diff --git a/source/blender/editors/space_clip/tracking_ops.cc b/source/blender/editors/space_clip/tracking_ops.cc index 48782a51145..7085b3df5cd 100644 --- a/source/blender/editors/space_clip/tracking_ops.cc +++ b/source/blender/editors/space_clip/tracking_ops.cc @@ -219,8 +219,8 @@ static int delete_track_exec(bContext *C, wmOperator * /*op*/) bool changed = false; /* Delete selected plane tracks. */ - LISTBASE_FOREACH_MUTABLE ( - MovieTrackingPlaneTrack *, plane_track, &tracking_object->plane_tracks) { + LISTBASE_FOREACH_MUTABLE (MovieTrackingPlaneTrack *, plane_track, &tracking_object->plane_tracks) + { if (PLANE_TRACK_VIEW_SELECTED(plane_track)) { clip_delete_plane_track(C, clip, plane_track); changed = true; @@ -282,8 +282,8 @@ static int delete_marker_exec(bContext *C, wmOperator * /*op*/) } } - LISTBASE_FOREACH_MUTABLE ( - MovieTrackingPlaneTrack *, plane_track, &tracking_object->plane_tracks) { + LISTBASE_FOREACH_MUTABLE (MovieTrackingPlaneTrack *, plane_track, &tracking_object->plane_tracks) + { if (PLANE_TRACK_VIEW_SELECTED(plane_track)) { MovieTrackingPlaneMarker *plane_marker = BKE_tracking_plane_marker_get_exact(plane_track, framenr); @@ -462,7 +462,8 @@ static MovieTrackingTrack *tracking_marker_check_slide( const PointTrackPick track_pick = ed_tracking_pick_point_track(&options, C, co); if (ed_tracking_point_track_pick_empty(&track_pick) || - !ed_tracking_point_track_pick_can_slide(space_clip, &track_pick)) { + !ed_tracking_point_track_pick_can_slide(space_clip, &track_pick)) + { return nullptr; } @@ -1103,8 +1104,8 @@ static int frame_jump_exec(bContext *C, wmOperator *op) } delta = pos == 1 ? 1 : -1; - while (sc->user.framenr + delta >= scene->r.sfra && - sc->user.framenr + delta <= scene->r.efra) { + while (sc->user.framenr + delta >= scene->r.sfra && sc->user.framenr + delta <= scene->r.efra) + { int framenr = BKE_movieclip_remap_scene_to_clip_frame(clip, sc->user.framenr + delta); MovieTrackingMarker *marker = BKE_tracking_marker_get_exact(active_track, framenr); @@ -2130,7 +2131,8 @@ static bool update_image_from_plane_marker_poll(bContext *C) MovieTrackingObject *tracking_object = BKE_tracking_object_get_active(tracking); if (tracking_object->active_plane_track == nullptr || - tracking_object->active_plane_track->image == nullptr) { + tracking_object->active_plane_track->image == nullptr) + { return false; } diff --git a/source/blender/editors/space_clip/tracking_ops_plane.cc b/source/blender/editors/space_clip/tracking_ops_plane.cc index 2cacab4c81b..dcf70c4ff83 100644 --- a/source/blender/editors/space_clip/tracking_ops_plane.cc +++ b/source/blender/editors/space_clip/tracking_ops_plane.cc @@ -110,7 +110,8 @@ static MovieTrackingPlaneTrack *tracking_plane_marker_check_slide(bContext *C, const PlaneTrackPick track_pick = ed_tracking_pick_plane_track(&options, C, co); if (ed_tracking_plane_track_pick_empty(&track_pick) || - !ed_tracking_plane_track_pick_can_slide(&track_pick)) { + !ed_tracking_plane_track_pick_can_slide(&track_pick)) + { return nullptr; } diff --git a/source/blender/editors/space_clip/tracking_ops_solve.cc b/source/blender/editors/space_clip/tracking_ops_solve.cc index 8e1acbc3af5..64379b8cf7a 100644 --- a/source/blender/editors/space_clip/tracking_ops_solve.cc +++ b/source/blender/editors/space_clip/tracking_ops_solve.cc @@ -146,7 +146,8 @@ static void solve_camera_freejob(void *scv) /* Set blender camera focal length so result would look fine there. */ if (scene->camera != nullptr && scene->camera->data && - GS(((ID *)scene->camera->data)->name) == ID_CA) { + GS(((ID *)scene->camera->data)->name) == ID_CA) + { Camera *camera = (Camera *)scene->camera->data; int width, height; BKE_movieclip_get_size(clip, &scj->user, &width, &height); diff --git a/source/blender/editors/space_clip/tracking_select.cc b/source/blender/editors/space_clip/tracking_select.cc index 0484ddbec0f..19110034fa3 100644 --- a/source/blender/editors/space_clip/tracking_select.cc +++ b/source/blender/editors/space_clip/tracking_select.cc @@ -868,7 +868,8 @@ static int do_lasso_select_marker(bContext *C, if (BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) && BLI_lasso_is_point_inside( - mcoords, mcoords_len, screen_co[0], screen_co[1], V2D_IS_CLIPPED)) { + mcoords, mcoords_len, screen_co[0], screen_co[1], V2D_IS_CLIPPED)) + { if (select) { BKE_tracking_track_flag_set(track, TRACK_AREA_ALL, SELECT); } @@ -897,7 +898,8 @@ static int do_lasso_select_marker(bContext *C, if (BLI_rcti_isect_pt(&rect, screen_co[0], screen_co[1]) && BLI_lasso_is_point_inside( - mcoords, mcoords_len, screen_co[0], screen_co[1], V2D_IS_CLIPPED)) { + mcoords, mcoords_len, screen_co[0], screen_co[1], V2D_IS_CLIPPED)) + { if (select) { plane_track->flag |= SELECT; } @@ -1030,7 +1032,8 @@ static int circle_select_exec(bContext *C, wmOperator *op) const MovieTrackingMarker *marker = BKE_tracking_marker_get(track, framenr); if (ED_space_clip_marker_is_visible(sc, tracking_object, track, marker) && - marker_inside_ellipse(marker, offset, ellipse)) { + marker_inside_ellipse(marker, offset, ellipse)) + { if (select) { BKE_tracking_track_flag_set(track, TRACK_AREA_ALL, SELECT); } diff --git a/source/blender/editors/space_file/asset_catalog_tree_view.cc b/source/blender/editors/space_file/asset_catalog_tree_view.cc index 052c6b22332..94189841747 100644 --- a/source/blender/editors/space_file/asset_catalog_tree_view.cc +++ b/source/blender/editors/space_file/asset_catalog_tree_view.cc @@ -718,7 +718,8 @@ bool file_set_asset_catalog_filter_settings( } if (filter_settings->asset_catalog_visibility == FILE_SHOW_ASSETS_FROM_CATALOG && - !BLI_uuid_equal(filter_settings->asset_catalog_id, catalog_id)) { + !BLI_uuid_equal(filter_settings->asset_catalog_id, catalog_id)) + { filter_settings->asset_catalog_id = catalog_id; needs_update = true; } diff --git a/source/blender/editors/space_file/file_draw.cc b/source/blender/editors/space_file/file_draw.cc index bf2c7e7cb39..09f18d20d25 100644 --- a/source/blender/editors/space_file/file_draw.cc +++ b/source/blender/editors/space_file/file_draw.cc @@ -373,7 +373,8 @@ static void file_draw_preview(const FileDirEntry *file, ui_imby = imb->y * UI_SCALE_FAC; /* Unlike thumbnails, icons are not scaled up. */ if (((ui_imbx > layout->prv_w) || (ui_imby > layout->prv_h)) || - (!is_icon && ((ui_imbx < layout->prv_w) || (ui_imby < layout->prv_h)))) { + (!is_icon && ((ui_imbx < layout->prv_w) || (ui_imby < layout->prv_h)))) + { if (imb->x > imb->y) { scaledx = float(layout->prv_w); scaledy = (float(imb->y) / float(imb->x)) * layout->prv_w; @@ -826,7 +827,8 @@ static const char *filelist_get_details_column_string( break; case COLUMN_SIZE: if ((file->typeflag & (FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP)) || - !(file->typeflag & (FILE_TYPE_DIR | FILE_TYPE_BLENDERLIB))) { + !(file->typeflag & (FILE_TYPE_DIR | FILE_TYPE_BLENDERLIB))) + { if ((file->draw_data.size_str[0] == '\0') || update_stat_strings) { BLI_filelist_entry_size_to_string( nullptr, file->size, small_size, file->draw_data.size_str); @@ -1007,7 +1009,8 @@ void file_draw_list(const bContext *C, ARegion *region) if (!(file_selflag & FILE_SEL_EDITING)) { if ((params->highlight_file == i) || (file_selflag & FILE_SEL_HIGHLIGHTED) || - (file_selflag & FILE_SEL_SELECTED)) { + (file_selflag & FILE_SEL_SELECTED)) + { int colorid = (file_selflag & FILE_SEL_SELECTED) ? TH_HILITE : TH_BACK; int shade = (params->highlight_file == i) || (file_selflag & FILE_SEL_HIGHLIGHTED) ? 35 : 0; @@ -1240,7 +1243,8 @@ bool file_draw_hint_if_invalid(const bContext *C, const SpaceFile *sfile, ARegio } /* Check if the library exists. */ if ((asset_params->asset_library_ref.type == ASSET_LIBRARY_LOCAL) || - filelist_is_dir(sfile->files, asset_params->base_params.dir)) { + filelist_is_dir(sfile->files, asset_params->base_params.dir)) + { return false; } diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index baafd46ae32..99b7f1671cf 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -171,7 +171,8 @@ static FileSelect file_select_do(bContext *C, int selected_idx, bool do_diropen) /* make the selected file active */ if ((selected_idx >= 0) && (selected_idx < numfiles) && - (file = filelist_file(sfile->files, selected_idx))) { + (file = filelist_file(sfile->files, selected_idx))) + { params->highlight_file = selected_idx; params->active_file = selected_idx; @@ -314,7 +315,8 @@ static void file_ensure_selection_inside_viewbounds(ARegion *region, const FileLayout *layout = ED_fileselect_get_layout(sfile, region); if (((layout->flag & FILE_LAYOUT_HOR) && region->winx <= (1.2f * layout->tile_w)) && - ((layout->flag & FILE_LAYOUT_VER) && region->winy <= (2.0f * layout->tile_h))) { + ((layout->flag & FILE_LAYOUT_VER) && region->winy <= (2.0f * layout->tile_h))) + { return; } @@ -421,7 +423,8 @@ static int file_box_select_find_last_selected(SpaceFile *sfile, /* are first and last in the same column (horizontal layout)/row (vertical layout)? */ if ((layout->flag & FILE_LAYOUT_HOR && bounds_first.xmin == bounds_last.xmin) || - (layout->flag & FILE_LAYOUT_VER && bounds_first.ymin != bounds_last.ymin)) { + (layout->flag & FILE_LAYOUT_VER && bounds_first.ymin != bounds_last.ymin)) + { /* use vertical distance */ const int my_loc = (int)mouseco_view[1]; dist_first = BLI_rcti_length_y(&bounds_first, my_loc); @@ -731,7 +734,8 @@ static bool file_walk_select_selection_set(struct bContext *C, if (has_selection) { if (extend && filelist_entry_select_index_get(files, active_old, CHECK_ALL) && - filelist_entry_select_index_get(files, active_new, CHECK_ALL)) { + filelist_entry_select_index_get(files, active_new, CHECK_ALL)) + { /* conditions for deselecting: initial file is selected, new file is * selected and either other_side isn't selected/found or we use fill */ deselect = (fill || other_site == -1 || @@ -850,22 +854,26 @@ static bool file_walk_select_do(bContext *C, const int idx_shift = (layout->flag & FILE_LAYOUT_HOR) ? layout->rows : layout->flow_columns; if ((layout->flag & FILE_LAYOUT_HOR && direction == UI_SELECT_WALK_UP) || - (layout->flag & FILE_LAYOUT_VER && direction == UI_SELECT_WALK_LEFT)) { + (layout->flag & FILE_LAYOUT_VER && direction == UI_SELECT_WALK_LEFT)) + { active_new = active_old - 1; other_site = active_old + 1; } else if ((layout->flag & FILE_LAYOUT_HOR && direction == UI_SELECT_WALK_DOWN) || - (layout->flag & FILE_LAYOUT_VER && direction == UI_SELECT_WALK_RIGHT)) { + (layout->flag & FILE_LAYOUT_VER && direction == UI_SELECT_WALK_RIGHT)) + { active_new = active_old + 1; other_site = active_old - 1; } else if ((layout->flag & FILE_LAYOUT_HOR && direction == UI_SELECT_WALK_LEFT) || - (layout->flag & FILE_LAYOUT_VER && direction == UI_SELECT_WALK_UP)) { + (layout->flag & FILE_LAYOUT_VER && direction == UI_SELECT_WALK_UP)) + { active_new = active_old - idx_shift; other_site = active_old + idx_shift; } else if ((layout->flag & FILE_LAYOUT_HOR && direction == UI_SELECT_WALK_RIGHT) || - (layout->flag & FILE_LAYOUT_VER && direction == UI_SELECT_WALK_DOWN)) { + (layout->flag & FILE_LAYOUT_VER && direction == UI_SELECT_WALK_DOWN)) + { active_new = active_old + idx_shift; other_site = active_old - idx_shift; @@ -1481,7 +1489,8 @@ static int file_column_sort_ui_context_invoke(bContext *C, SpaceFile *sfile = CTX_wm_space_file(C); if (file_attribute_column_header_is_inside( - ®ion->v2d, sfile->layout, event->mval[0], event->mval[1])) { + ®ion->v2d, sfile->layout, event->mval[0], event->mval[1])) + { FileSelectParams *params = ED_fileselect_get_active_params(sfile); const FileAttributeColumnType column_type = file_attribute_column_type_find_isect( ®ion->v2d, params, sfile->layout, event->mval[0]); @@ -1826,8 +1835,8 @@ static int file_external_operation_exec(bContext *C, wmOperator *op) PointerRNA op_props; WM_operator_properties_create_ptr(&op_props, ot); RNA_string_set(&op_props, "filepath", filepath); - if (WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &op_props, NULL) == - OPERATOR_FINISHED) { + if (WM_operator_name_call_ptr(C, ot, WM_OP_INVOKE_DEFAULT, &op_props, NULL) == OPERATOR_FINISHED) + { WM_cursor_set(CTX_wm_window(C), WM_CURSOR_DEFAULT); return OPERATOR_FINISHED; } @@ -2140,7 +2149,8 @@ static int file_execute_mouse_invoke(bContext *C, wmOperator *UNUSED(op), const SpaceFile *sfile = CTX_wm_space_file(C); if (!ED_fileselect_layout_is_inside_pt( - sfile->layout, ®ion->v2d, event->mval[0], event->mval[1])) { + sfile->layout, ®ion->v2d, event->mval[0], event->mval[1])) + { return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH; } @@ -2353,7 +2363,8 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), const w * so we also have to handle switching to rename mode here. */ FileSelectParams *params = ED_fileselect_get_active_params(sfile); if ((params->rename_flag & - (FILE_PARAMS_RENAME_PENDING | FILE_PARAMS_RENAME_POSTSCROLL_PENDING)) != 0) { + (FILE_PARAMS_RENAME_PENDING | FILE_PARAMS_RENAME_POSTSCROLL_PENDING)) != 0) + { file_params_renamefile_activate(sfile, params); } @@ -2361,7 +2372,8 @@ static int file_smoothscroll_invoke(bContext *C, wmOperator *UNUSED(op), const w int edit_idx = -1; for (i = 0; i < numfiles; i++) { if (filelist_entry_select_index_get(sfile->files, i, CHECK_ALL) & - (FILE_SEL_EDITING | FILE_SEL_HIGHLIGHTED)) { + (FILE_SEL_EDITING | FILE_SEL_HIGHLIGHTED)) + { edit_idx = i; break; } @@ -2646,7 +2658,8 @@ static int file_directory_new_exec(bContext *C, wmOperator *op) if (!BLI_dir_create_recursive(path) || /* Should no more be needed, * now that BLI_dir_create_recursive returns a success state - but kept just in case. */ - !BLI_exists(path)) { + !BLI_exists(path)) + { BKE_reportf(op->reports, RPT_ERROR, "Could not create new folder: %s", @@ -3043,7 +3056,8 @@ static void file_rename_state_activate(SpaceFile *sfile, int file_idx, bool requ FileDirEntry *file = filelist_file(sfile->files, file_idx); if ((require_selected == false) || - (filelist_entry_select_get(sfile->files, file, CHECK_ALL) & FILE_SEL_SELECTED)) { + (filelist_entry_select_get(sfile->files, file, CHECK_ALL) & FILE_SEL_SELECTED)) + { FileSelectParams *params = ED_fileselect_get_active_params(sfile); filelist_entry_select_index_set( diff --git a/source/blender/editors/space_file/filelist.cc b/source/blender/editors/space_file/filelist.cc index 6cdeb23a7d2..2f0b467afc8 100644 --- a/source/blender/editors/space_file/filelist.cc +++ b/source/blender/editors/space_file/filelist.cc @@ -680,7 +680,8 @@ static bool is_filtered_hidden(const char *filename, #endif /* For data-blocks (but not the group directories), check the asset-only filter. */ if (!(file->typeflag & FILE_TYPE_DIR) && (file->typeflag & FILE_TYPE_BLENDERLIB) && - (filter->flags & FLF_ASSETS_ONLY) && !(file->typeflag & FILE_TYPE_ASSET)) { + (filter->flags & FLF_ASSETS_ONLY) && !(file->typeflag & FILE_TYPE_ASSET)) + { return true; } @@ -836,8 +837,9 @@ static bool is_filtered_asset(FileListInternEntry *file, FileListFilter *filter) const AssetMetaData *asset_data = filelist_file_internal_get_asset_data(file); /* Not used yet for the asset view template. */ - if (filter->asset_catalog_filter && !file_is_asset_visible_in_catalog_filter_settings( - filter->asset_catalog_filter, asset_data)) { + if (filter->asset_catalog_filter && + !file_is_asset_visible_in_catalog_filter_settings(filter->asset_catalog_filter, asset_data)) + { return false; } @@ -1200,7 +1202,8 @@ static int filelist_geticon_ex(const FileList *filelist, const eFileSel_File_Types typeflag = (eFileSel_File_Types)file->typeflag; if ((typeflag & FILE_TYPE_DIR) && - !(ignore_libdir && (typeflag & (FILE_TYPE_BLENDERLIB | FILE_TYPE_BLENDER)))) { + !(ignore_libdir && (typeflag & (FILE_TYPE_BLENDERLIB | FILE_TYPE_BLENDER)))) + { if (FILENAME_IS_PARENT(file->relpath)) { return is_main ? ICON_FILE_PARENT : ICON_NONE; } @@ -1490,8 +1493,8 @@ static void filelist_cache_preview_runf(TaskPool *__restrict pool, void *taskdat if (preview->flags & FILE_TYPE_IMAGE) { source = THB_SOURCE_IMAGE; } - else if (preview->flags & - (FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP | FILE_TYPE_BLENDERLIB)) { + else if (preview->flags & (FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP | FILE_TYPE_BLENDERLIB)) + { source = THB_SOURCE_BLEND; } else if (preview->flags & FILE_TYPE_MOVIE) { @@ -1551,7 +1554,8 @@ static void filelist_cache_previews_clear(FileListEntryCache *cache) FileListEntryPreview *preview; while ((preview = static_cast( - BLI_thread_queue_pop_timeout(cache->previews_done, 0)))) { + BLI_thread_queue_pop_timeout(cache->previews_done, 0)))) + { // printf("%s: DONE %d - %s - %p\n", __func__, preview->index, preview->path, // preview->img); if (preview->icon_id) { @@ -1597,7 +1601,8 @@ static void filelist_cache_previews_push(FileList *filelist, FileDirEntry *entry } if (!(entry->typeflag & (FILE_TYPE_IMAGE | FILE_TYPE_MOVIE | FILE_TYPE_FTFONT | - FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP | FILE_TYPE_BLENDERLIB))) { + FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP | FILE_TYPE_BLENDERLIB))) + { return; } @@ -2078,7 +2083,8 @@ static FileDirEntry *filelist_file_create_entry(FileList *filelist, const int in ret->asset = reinterpret_cast<::AssetRepresentation *>(entry->asset); /* For some file types the preview is already available. */ if (entry->local_data.preview_image && - BKE_previewimg_is_finished(entry->local_data.preview_image, ICON_SIZE_PREVIEW)) { + BKE_previewimg_is_finished(entry->local_data.preview_image, ICON_SIZE_PREVIEW)) + { ImBuf *ibuf = BKE_previewimg_to_imbuf(entry->local_data.preview_image, ICON_SIZE_PREVIEW); if (ibuf) { ret->preview_icon_id = BKE_icon_imbuf_create(ibuf); @@ -2114,7 +2120,8 @@ FileDirEntry *filelist_file_ex(FileList *filelist, const int index, const bool u } if ((ret = static_cast( - BLI_ghash_lookup(cache->misc_entries, POINTER_FROM_INT(index))))) { + BLI_ghash_lookup(cache->misc_entries, POINTER_FROM_INT(index))))) + { return ret; } @@ -2128,7 +2135,8 @@ FileDirEntry *filelist_file_ex(FileList *filelist, const int index, const bool u ret = filelist_file_create_entry(filelist, index); old_index = cache->misc_entries_indices[cache->misc_cursor]; if ((old = static_cast( - BLI_ghash_popkey(cache->misc_entries, POINTER_FROM_INT(old_index), nullptr)))) { + BLI_ghash_popkey(cache->misc_entries, POINTER_FROM_INT(old_index), nullptr)))) + { BLI_ghash_remove(cache->uids, POINTER_FROM_UINT(old->uid), nullptr, nullptr); filelist_file_release_entry(filelist, old); } @@ -2254,7 +2262,8 @@ static bool filelist_file_cache_block_create(FileList *filelist, /* That entry might have already been requested and stored in misc cache... */ if ((entry = static_cast( - BLI_ghash_popkey(cache->misc_entries, POINTER_FROM_INT(idx), nullptr))) == nullptr) { + BLI_ghash_popkey(cache->misc_entries, POINTER_FROM_INT(idx), nullptr))) == nullptr) + { entry = filelist_file_create_entry(filelist, idx); BLI_ghash_insert(cache->uids, POINTER_FROM_UINT(entry->uid), entry); } @@ -2317,9 +2326,11 @@ bool filelist_file_cache_block(FileList *filelist, const int index) /* If we have something to (re)cache... */ if (full_refresh || (start_index != cache->block_start_index) || - (end_index != cache->block_end_index)) { + (end_index != cache->block_end_index)) + { if (full_refresh || (start_index >= cache->block_end_index) || - (end_index <= cache->block_start_index)) { + (end_index <= cache->block_start_index)) + { int size1 = cache->block_end_index - cache->block_start_index; int size2 = 0; int idx1 = cache->block_cursor, idx2 = 0; @@ -2645,7 +2656,8 @@ int ED_path_extension_type(const char *path) ".app", /* Safari in-progress/paused download */ ".download", - nullptr)) { + nullptr)) + { return FILE_TYPE_BUNDLE; } #endif @@ -2662,11 +2674,13 @@ int ED_path_extension_type(const char *path) ".mcr", ".inc", ".fountain", - nullptr)) { + nullptr)) + { return FILE_TYPE_TEXT; } if (BLI_path_extension_check_n( - path, ".ttf", ".ttc", ".pfb", ".otf", ".otc", ".woff", ".woff2", nullptr)) { + path, ".ttf", ".ttc", ".pfb", ".otf", ".otc", ".woff", ".woff2", nullptr)) + { return FILE_TYPE_FTFONT; } if (BLI_path_extension_check(path, ".btx")) { @@ -2687,17 +2701,9 @@ int ED_path_extension_type(const char *path) if (BLI_path_extension_check(path, ".zip")) { return FILE_TYPE_ARCHIVE; } - if (BLI_path_extension_check_n(path, - ".obj", - ".mtl", - ".3ds", - ".fbx", - ".glb", - ".gltf", - ".svg", - ".ply", - ".stl", - nullptr)) { + if (BLI_path_extension_check_n( + path, ".obj", ".mtl", ".3ds", ".fbx", ".glb", ".gltf", ".svg", ".ply", ".stl", nullptr)) + { return FILE_TYPE_OBJECT_IO; } if (BLI_path_extension_check_array(path, imb_ext_image)) { @@ -2775,7 +2781,8 @@ uint filelist_entry_select_set(const FileList *filelist, BLI_assert(ELEM(check, CHECK_DIRS, CHECK_FILES, CHECK_ALL)); if ((check == CHECK_ALL) || ((check == CHECK_DIRS) && (entry->typeflag & FILE_TYPE_DIR)) || - ((check == CHECK_FILES) && !(entry->typeflag & FILE_TYPE_DIR))) { + ((check == CHECK_FILES) && !(entry->typeflag & FILE_TYPE_DIR))) + { switch (select) { case FILE_SEL_REMOVE: entry_flag &= ~flag; @@ -2829,7 +2836,8 @@ void filelist_entries_select_index_range_set(FileList *filelist, { /* select all valid files between first and last indicated */ if ((sel->first >= 0) && (sel->first < filelist->filelist.entries_filtered_num) && - (sel->last >= 0) && (sel->last < filelist->filelist.entries_filtered_num)) { + (sel->last >= 0) && (sel->last < filelist->filelist.entries_filtered_num)) + { int current_file; for (current_file = sel->first; current_file <= sel->last; current_file++) { filelist_entry_select_index_set(filelist, current_file, select, flag, check); @@ -2845,7 +2853,8 @@ eDirEntry_SelectFlag filelist_entry_select_get(FileList *filelist, BLI_assert(ELEM(check, CHECK_DIRS, CHECK_FILES, CHECK_ALL)); if ((check == CHECK_ALL) || ((check == CHECK_DIRS) && (entry->typeflag & FILE_TYPE_DIR)) || - ((check == CHECK_FILES) && !(entry->typeflag & FILE_TYPE_DIR))) { + ((check == CHECK_FILES) && !(entry->typeflag & FILE_TYPE_DIR))) + { /* Default nullptr pointer if not found is fine here! */ return eDirEntry_SelectFlag(POINTER_AS_UINT( BLI_ghash_lookup(filelist->selection_state, POINTER_FROM_UINT(entry->uid)))); @@ -3022,7 +3031,8 @@ static int filelist_readjob_list_dir(FileListReadJob *job_params, #ifdef __APPLE__ && !(ED_path_extension_type(full_path) & FILE_TYPE_BUNDLE) #endif - ) { + ) + { entry->typeflag = FILE_TYPE_DIR; } @@ -3553,7 +3563,8 @@ static bool filelist_readjob_should_recurse_into_entry(const int max_recursion, /* Show entries when recursion is set to `Blend file` even when `current_recursion_level` * exceeds `max_recursion`. */ if (!is_lib && (current_recursion_level >= max_recursion) && - ((entry->typeflag & (FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP)) == 0)) { + ((entry->typeflag & (FILE_TYPE_BLENDER | FILE_TYPE_BLENDER_BACKUP)) == 0)) + { return false; } if (entry->typeflag & FILE_TYPE_BLENDERLIB) { diff --git a/source/blender/editors/space_file/filesel.cc b/source/blender/editors/space_file/filesel.cc index dd7ce444e64..3a7ab6d0203 100644 --- a/source/blender/editors/space_file/filesel.cc +++ b/source/blender/editors/space_file/filesel.cc @@ -208,8 +208,8 @@ static FileSelectParams *fileselect_ensure_updated_file_params(SpaceFile *sfile) } params->flag = 0; - if (is_directory == true && is_filename == false && is_filepath == false && - is_files == false) { + if (is_directory == true && is_filename == false && is_filepath == false && is_files == false) + { params->flag |= FILE_DIRSEL_ONLY; } if ((prop = RNA_struct_find_property(op->ptr, "check_existing"))) { @@ -783,7 +783,8 @@ FileSelection ED_fileselect_layout_offset_rect(FileLayout *layout, const rcti *r rowmax = (rect->ymax - layout->offset_top) / (layout->tile_h + 2 * layout->tile_border_y); if (is_inside(colmin, rowmin, layout->flow_columns, layout->rows) || - is_inside(colmax, rowmax, layout->flow_columns, layout->rows)) { + is_inside(colmax, rowmax, layout->flow_columns, layout->rows)) + { CLAMP(colmin, 0, layout->flow_columns - 1); CLAMP(rowmin, 0, layout->rows - 1); CLAMP(colmax, 0, layout->flow_columns - 1); @@ -931,7 +932,8 @@ FileAttributeColumnType file_attribute_column_type_find_isect(const View2D *v2d, for (FileAttributeColumnType column = FileAttributeColumnType(0); column < ATTRIBUTE_COLUMN_MAX; - column = FileAttributeColumnType(int(column) + 1)) { + column = FileAttributeColumnType(int(column) + 1)) + { if (!file_attribute_column_type_enabled(params, column)) { continue; } @@ -995,9 +997,10 @@ static void file_attribute_columns_widths(const FileSelectParams *params, FileLa for (FileAttributeColumnType column_type = FileAttributeColumnType(int(ATTRIBUTE_COLUMN_MAX) - 1); column_type >= 0; - column_type = FileAttributeColumnType(int(column_type) - 1)) { - if ((column_type == COLUMN_NAME) || - !file_attribute_column_type_enabled(params, column_type)) { + column_type = FileAttributeColumnType(int(column_type) - 1)) + { + if ((column_type == COLUMN_NAME) || !file_attribute_column_type_enabled(params, column_type)) + { continue; } remwidth -= columns[column_type].width; @@ -1377,7 +1380,8 @@ void file_params_renamefile_activate(SpaceFile *sfile, FileSelectParams *params) BLI_assert(params->rename_flag != 0); if ((params->rename_flag & (FILE_PARAMS_RENAME_ACTIVE | FILE_PARAMS_RENAME_POSTSCROLL_ACTIVE)) != - 0) { + 0) + { return; } diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index 41b78ff3562..51b92c37592 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -233,7 +233,8 @@ FSMenuEntry *ED_fsmenu_get_entry(struct FSMenu *fsmenu, FSMenuCategory category, FSMenuEntry *fsm_iter; for (fsm_iter = ED_fsmenu_get_category(fsmenu, category); fsm_iter && idx; - fsm_iter = fsm_iter->next) { + fsm_iter = fsm_iter->next) + { idx--; } @@ -356,7 +357,8 @@ short fsmenu_can_save(struct FSMenu *fsmenu, FSMenuCategory category, int idx) FSMenuEntry *fsm_iter; for (fsm_iter = ED_fsmenu_get_category(fsmenu, category); fsm_iter && idx; - fsm_iter = fsm_iter->next) { + fsm_iter = fsm_iter->next) + { idx--; } @@ -533,7 +535,8 @@ bool fsmenu_write_file(struct FSMenu *fsmenu, const char *filepath) bool has_error = false; has_error |= (fprintf(fp, "[Bookmarks]\n") < 0); for (fsm_iter = ED_fsmenu_get_category(fsmenu, FS_CATEGORY_BOOKMARKS); fsm_iter; - fsm_iter = fsm_iter->next) { + fsm_iter = fsm_iter->next) + { if (fsm_iter->path && fsm_iter->save) { fsmenu_entry_generate_name(fsm_iter, fsm_name, sizeof(fsm_name)); if (fsm_iter->name[0] && !STREQ(fsm_iter->name, fsm_name)) { @@ -545,7 +548,8 @@ bool fsmenu_write_file(struct FSMenu *fsmenu, const char *filepath) has_error = (fprintf(fp, "[Recent]\n") < 0); for (fsm_iter = ED_fsmenu_get_category(fsmenu, FS_CATEGORY_RECENT); fsm_iter && (nwritten < FSMENU_RECENT_MAX); - fsm_iter = fsm_iter->next, nwritten++) { + fsm_iter = fsm_iter->next, nwritten++) + { if (fsm_iter->path && fsm_iter->save) { fsmenu_entry_generate_name(fsm_iter, fsm_name, sizeof(fsm_name)); if (fsm_iter->name[0] && !STREQ(fsm_iter->name, fsm_name)) { @@ -889,7 +893,8 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks) CFStringRef pathString = CFURLCopyFileSystemPath(cfURL, kCFURLPOSIXPathStyle); if (pathString == NULL || - !CFStringGetCString(pathString, line, sizeof(line), kCFStringEncodingUTF8)) { + !CFStringGetCString(pathString, line, sizeof(line), kCFStringEncodingUTF8)) + { continue; } diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 84d5dc43985..5ad31740b48 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -204,7 +204,8 @@ static void file_refresh(const bContext *C, ScrArea *area) folder_history_list_ensure_for_active_browse_mode(sfile); if (sfile->files && (sfile->tags & FILE_TAG_REBUILD_MAIN_FILES) && - filelist_needs_reset_on_main_changes(sfile->files)) { + filelist_needs_reset_on_main_changes(sfile->files)) + { filelist_tag_force_reset_mainfiles(sfile->files); } sfile->tags &= ~FILE_TAG_REBUILD_MAIN_FILES; @@ -508,7 +509,8 @@ static bool file_main_region_needs_refresh_before_draw(SpaceFile *sfile) /* File reading tagged the space because main data changed that may require a filelist reset. */ if (filelist_needs_reset_on_main_changes(sfile->files) && - (sfile->tags & FILE_TAG_REBUILD_MAIN_FILES)) { + (sfile->tags & FILE_TAG_REBUILD_MAIN_FILES)) + { return true; } diff --git a/source/blender/editors/space_graph/graph_buttons.c b/source/blender/editors/space_graph/graph_buttons.c index 3ebebceb9e8..48e9d13853f 100644 --- a/source/blender/editors/space_graph/graph_buttons.c +++ b/source/blender/editors/space_graph/graph_buttons.c @@ -895,7 +895,8 @@ static void graph_panel_driverVar__transChan(uiLayout *layout, ID *id, DriverVar DTAR_TRANSCHAN_ROTX, DTAR_TRANSCHAN_ROTY, DTAR_TRANSCHAN_ROTZ, - DTAR_TRANSCHAN_ROTW)) { + DTAR_TRANSCHAN_ROTW)) + { uiItemR(sub, &dtar_ptr, "rotation_mode", 0, IFACE_("Mode"), ICON_NONE); } @@ -1256,7 +1257,8 @@ static void graph_draw_driver_settings_panel(uiLayout *layout, DTAR_TRANSCHAN_ROTY, DTAR_TRANSCHAN_ROTZ, DTAR_TRANSCHAN_ROTW) && - dvar->targets[0].rotation_mode != DTAR_ROTMODE_QUATERNION)) { + dvar->targets[0].rotation_mode != DTAR_ROTMODE_QUATERNION)) + { BLI_snprintf( valBuf, sizeof(valBuf), "%.3f (%4.1f°)", dvar->curval, RAD2DEGF(dvar->curval)); } diff --git a/source/blender/editors/space_graph/graph_draw.c b/source/blender/editors/space_graph/graph_draw.c index 791f08e66d7..4d099fb1c61 100644 --- a/source/blender/editors/space_graph/graph_draw.c +++ b/source/blender/editors/space_graph/graph_draw.c @@ -273,14 +273,16 @@ static void draw_fcurve_selected_handle_vertices( if ((!prevbezt && (bezt->ipo == BEZT_IPO_BEZ)) || (prevbezt && (prevbezt->ipo == BEZT_IPO_BEZ))) { if ((bezt->f1 & SELECT) == sel - /* && v2d->cur.xmin < bezt->vec[0][0] < v2d->cur.xmax) */) { + /* && v2d->cur.xmin < bezt->vec[0][0] < v2d->cur.xmax) */) + { immVertex2fv(pos, bezt->vec[0]); } } if (bezt->ipo == BEZT_IPO_BEZ) { if ((bezt->f3 & SELECT) == sel - /* && v2d->cur.xmin < bezt->vec[2][0] < v2d->cur.xmax) */) { + /* && v2d->cur.xmin < bezt->vec[2][0] < v2d->cur.xmax) */) + { immVertex2fv(pos, bezt->vec[2]); } } @@ -389,7 +391,8 @@ static bool draw_fcurve_handles_check(SpaceGraph *sipo, FCurve *fcu) (fcu->flag & FCURVE_INT_VALUES) || #endif /* group that curve belongs to is not editable */ - ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED))) { + ((fcu->grp) && (fcu->grp->flag & AGRP_PROTECTED))) + { return false; } return true; @@ -457,7 +460,8 @@ static void draw_fcurve_handles(SpaceGraph *sipo, FCurve *fcu) else { /* only draw first handle if previous segment was had handles, and selection is ok */ if (((bezt->f1 & SELECT) == sel) && ((!prevbezt && (bezt->ipo == BEZT_IPO_BEZ)) || - (prevbezt && (prevbezt->ipo == BEZT_IPO_BEZ)))) { + (prevbezt && (prevbezt->ipo == BEZT_IPO_BEZ)))) + { UI_GetThemeColor3ubv(basecol + bezt->h1, col); col[3] = fcurve_display_alpha(fcu) * 255; immAttr4ubv(color, col); @@ -739,7 +743,8 @@ static void draw_fcurve_curve_samples(bAnimContext *ac, /* y-value depends on the interpolation */ if ((fcu->extend == FCURVE_EXTRAPOLATE_CONSTANT) || (fcu->flag & FCURVE_INT_VALUES) || - (fcu->totvert == 1)) { + (fcu->totvert == 1)) + { /* just extend across the first keyframe's value */ v[1] = prevfpt->vec[1]; } @@ -773,7 +778,8 @@ static void draw_fcurve_curve_samples(bAnimContext *ac, /* y-value depends on the interpolation */ if ((fcu->extend == FCURVE_EXTRAPOLATE_CONSTANT) || (fcu->flag & FCURVE_INT_VALUES) || - (fcu->totvert == 1)) { + (fcu->totvert == 1)) + { /* based on last keyframe's value */ v[1] = prevfpt->vec[1]; } @@ -848,7 +854,8 @@ static void draw_fcurve_curve_bezts( /* y-value depends on the interpolation */ if ((fcu->extend == FCURVE_EXTRAPOLATE_CONSTANT) || (prevbezt->ipo == BEZT_IPO_CONST) || - (prevbezt->ipo == BEZT_IPO_LIN && fcu->totvert == 1)) { + (prevbezt->ipo == BEZT_IPO_LIN && fcu->totvert == 1)) + { /* just extend across the first keyframe's value */ v1[1] = prevbezt->vec[1][1]; } @@ -967,8 +974,8 @@ static void draw_fcurve_curve_bezts( /* y-value depends on the interpolation */ if ((fcu->extend == FCURVE_EXTRAPOLATE_CONSTANT) || (fcu->flag & FCURVE_INT_VALUES) || - (prevbezt->ipo == BEZT_IPO_CONST) || - (prevbezt->ipo == BEZT_IPO_LIN && fcu->totvert == 1)) { + (prevbezt->ipo == BEZT_IPO_CONST) || (prevbezt->ipo == BEZT_IPO_LIN && fcu->totvert == 1)) + { /* based on last keyframe's value */ v1[1] = prevbezt->vec[1][1]; } @@ -1018,7 +1025,8 @@ static void draw_fcurve(bAnimContext *ac, SpaceGraph *sipo, ARegion *region, bAn /* 1) draw curve line */ if (((fcu->modifiers.first) || (fcu->flag & FCURVE_INT_VALUES)) || - (((fcu->bezt) || (fcu->fpt)) && (fcu->totvert))) { + (((fcu->bezt) || (fcu->fpt)) && (fcu->totvert))) + { /* set color/drawing style for curve itself */ /* draw active F-Curve thicker than the rest to make it stand out */ if (fcu->flag & FCURVE_ACTIVE) { diff --git a/source/blender/editors/space_graph/graph_select.c b/source/blender/editors/space_graph/graph_select.c index df3b572442d..aaf25f29651 100644 --- a/source/blender/editors/space_graph/graph_select.c +++ b/source/blender/editors/space_graph/graph_select.c @@ -115,7 +115,8 @@ static void nearest_fcurve_vert_store(ListBase *matches, &screen_co[0], &screen_co[1]) && /* check if distance from mouse cursor to vert in screen space is within tolerance */ - ((dist = len_v2v2_int(mval, screen_co)) <= GVERTSEL_TOL)) { + ((dist = len_v2v2_int(mval, screen_co)) <= GVERTSEL_TOL)) + { tNearestVertInfo *nvi = (tNearestVertInfo *)matches->last; bool replace = false; @@ -172,9 +173,9 @@ static void get_nearest_fcurve_verts_list(bAnimContext *ac, const int mval[2], L */ filter = (ANIMFILTER_DATA_VISIBLE | ANIMFILTER_CURVE_VISIBLE | ANIMFILTER_FCURVESONLY | ANIMFILTER_NODUPLIS | ANIMFILTER_FCURVESONLY); - if (U.animation_flag & - USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS) { /* FIXME: this should really be check for by the - * filtering code. */ + if (U.animation_flag & USER_ANIM_ONLY_SHOW_SELECTED_CURVE_KEYS) + { /* FIXME: this should really be check for by the + * filtering code. */ filter |= ANIMFILTER_SEL; } mapping_flag |= ANIM_get_normalization_flags(ac); diff --git a/source/blender/editors/space_graph/space_graph.c b/source/blender/editors/space_graph/space_graph.c index 5678b4c89fe..2805b87f169 100644 --- a/source/blender/editors/space_graph/space_graph.c +++ b/source/blender/editors/space_graph/space_graph.c @@ -617,7 +617,8 @@ static void graph_listener(const wmSpaceTypeListenerParams *params) break; case NC_WINDOW: if (sipo->runtime.flag & - (SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC | SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR)) { + (SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC | SIPO_RUNTIME_FLAG_NEED_CHAN_SYNC_COLOR)) + { /* force redraw/refresh after undo/redo - prevents "black curve" problem */ ED_area_tag_refresh(area); } diff --git a/source/blender/editors/space_image/image_buttons.c b/source/blender/editors/space_image/image_buttons.c index db795b254e1..aea180bb64e 100644 --- a/source/blender/editors/space_image/image_buttons.c +++ b/source/blender/editors/space_image/image_buttons.c @@ -654,7 +654,8 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, /* view */ if (BLI_listbase_count_at_most(&rr->views, 2) > 1 && - ((!show_stereo) || !RE_RenderResult_is_stereo(rr))) { + ((!show_stereo) || !RE_RenderResult_is_stereo(rr))) + { rview = BLI_findlink(&rr->views, iuser->view); display_name = rview ? rview->name : ""; @@ -676,7 +677,8 @@ static void uiblock_layer_pass_buttons(uiLayout *layout, /* stereo image */ else if ((BKE_image_is_stereo(image) && (!show_stereo)) || - (BKE_image_is_multiview(image) && !BKE_image_is_stereo(image))) { + (BKE_image_is_multiview(image) && !BKE_image_is_stereo(image))) + { ImageView *iv; int nr = 0; @@ -994,7 +996,8 @@ void uiTemplateImageSettings(uiLayout *layout, PointerRNA *imfptr, bool color_ma R_IMF_CHAN_DEPTH_12, R_IMF_CHAN_DEPTH_16, R_IMF_CHAN_DEPTH_24, - R_IMF_CHAN_DEPTH_32) == 0) { + R_IMF_CHAN_DEPTH_32) == 0) + { uiItemR(uiLayoutRow(col, true), imfptr, "color_depth", UI_ITEM_R_EXPAND, NULL, ICON_NONE); } diff --git a/source/blender/editors/space_image/image_edit.c b/source/blender/editors/space_image/image_edit.c index 3d4f9fab69d..8f702a0049c 100644 --- a/source/blender/editors/space_image/image_edit.c +++ b/source/blender/editors/space_image/image_edit.c @@ -82,7 +82,8 @@ void ED_space_image_sync(struct Main *bmain, struct Image *image, bool ignore_re continue; } if (ignore_render_viewer && sima->image && - ELEM(sima->image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) { + ELEM(sima->image->type, IMA_TYPE_R_RESULT, IMA_TYPE_COMPOSITE)) + { continue; } ED_space_image_set(bmain, sima, image, true); diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c index e1d2e317c07..cc0996c3630 100644 --- a/source/blender/editors/space_image/image_ops.c +++ b/source/blender/editors/space_image/image_ops.c @@ -2174,7 +2174,8 @@ static int image_save_invoke(bContext *C, wmOperator *op, const wmEvent *event) /* Not writable formats or images without a file-path will go to "Save As". */ if (!BKE_image_has_packedfile(ima) && - (!BKE_image_has_filepath(ima) || !image_file_format_writable(ima, iuser))) { + (!BKE_image_has_filepath(ima) || !image_file_format_writable(ima, iuser))) + { WM_operator_name_call(C, "IMAGE_OT_save_as", WM_OP_INVOKE_DEFAULT, NULL, event); return OPERATOR_CANCELLED; } @@ -2307,7 +2308,8 @@ static bool image_should_be_saved_when_modified(Image *ima) static bool image_should_be_saved(Image *ima, bool *is_format_writable) { if (BKE_image_is_dirty_writable(ima, is_format_writable) && - ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_SRC_TILED)) { + ELEM(ima->source, IMA_SRC_FILE, IMA_SRC_GENERATED, IMA_SRC_TILED)) + { return image_should_be_saved_when_modified(ima); } return false; @@ -3901,7 +3903,8 @@ static int render_border_exec(bContext *C, wmOperator *op) /* Drawing a border surrounding the entire camera view switches off border rendering * or the border covers no pixels. */ if ((border.xmin <= 0.0f && border.xmax >= 1.0f && border.ymin <= 0.0f && border.ymax >= 1.0f) || - (border.xmin == border.xmax || border.ymin == border.ymax)) { + (border.xmin == border.xmax || border.ymin == border.ymax)) + { scene->r.mode &= ~R_BORDER; } else { diff --git a/source/blender/editors/space_image/image_sequence.c b/source/blender/editors/space_image/image_sequence.c index a7976eeecbe..5bf71c6a4cc 100644 --- a/source/blender/editors/space_image/image_sequence.c +++ b/source/blender/editors/space_image/image_sequence.c @@ -60,7 +60,8 @@ static void image_sequence_get_frame_ranges(wmOperator *op, ListBase *ranges) /* still in the same sequence */ if (do_frame_range && (range != NULL) && STREQLEN(base_head, head, FILE_MAX) && - STREQLEN(base_tail, tail, FILE_MAX)) { + STREQLEN(base_tail, tail, FILE_MAX)) + { /* Set filepath to first frame in the range. */ if (frame->framenr < range_first_frame) { BLI_path_join(range->filepath, sizeof(range->filepath), dir, filename); @@ -149,7 +150,8 @@ ListBase ED_image_filesel_detect_sequences(Main *bmain, wmOperator *op, const bo /* File browser. */ if (RNA_struct_property_is_set(op->ptr, "directory") && - RNA_struct_property_is_set(op->ptr, "files")) { + RNA_struct_property_is_set(op->ptr, "files")) + { const bool was_relative = BLI_path_is_rel(filepath); image_sequence_get_frame_ranges(op, &ranges); diff --git a/source/blender/editors/space_image/image_undo.cc b/source/blender/editors/space_image/image_undo.cc index db78ef857dc..04af832f6ac 100644 --- a/source/blender/editors/space_image/image_undo.cc +++ b/source/blender/editors/space_image/image_undo.cc @@ -514,7 +514,8 @@ static void ubuf_ensure_compat_ibuf(const UndoImageBuf *ubuf, ImBuf *ibuf) } if (ibuf->x == ubuf->image_dims[0] && ibuf->y == ubuf->image_dims[1] && - (ubuf->image_state.use_float ? (void *)ibuf->rect_float : (void *)ibuf->rect)) { + (ubuf->image_state.use_float ? (void *)ibuf->rect_float : (void *)ibuf->rect)) + { return; } @@ -748,7 +749,8 @@ static UndoImageBuf *ubuf_lookup_from_reference(ImageUndoStep *us_prev, if (ubuf_reference) { ubuf_reference = ubuf_reference->post; if ((ubuf_reference->image_dims[0] == ubuf->image_dims[0]) && - (ubuf_reference->image_dims[1] == ubuf->image_dims[1])) { + (ubuf_reference->image_dims[1] == ubuf->image_dims[1])) + { return ubuf_reference; } } @@ -837,7 +839,8 @@ static bool image_undosys_step_encode(struct bContext *C, struct Main * /*bmain* UndoImageBuf *ubuf_post = ubuf_pre->post; if (ubuf_pre->image_dims[0] != ubuf_post->image_dims[0] || - ubuf_pre->image_dims[1] != ubuf_post->image_dims[1]) { + ubuf_pre->image_dims[1] != ubuf_post->image_dims[1]) + { ubuf_from_image_all_tiles(ubuf_post, ibuf); } else { @@ -857,7 +860,8 @@ static bool image_undosys_step_encode(struct bContext *C, struct Main * /*bmain* ((ubuf_pre->tiles[i] == nullptr) || /* In this case the paint stroke as has added a tile * which we have a duplicate reference available. */ - (ubuf_pre->tiles[i]->users == 1))) { + (ubuf_pre->tiles[i]->users == 1))) + { if (ubuf_pre->tiles[i] != nullptr) { /* If we have a reference, re-use this single use tile for the post state. */ BLI_assert(ubuf_pre->tiles[i]->users == 1); diff --git a/source/blender/editors/space_info/info_ops.c b/source/blender/editors/space_info/info_ops.c index 43c57227b2f..3a4a89967d2 100644 --- a/source/blender/editors/space_info/info_ops.c +++ b/source/blender/editors/space_info/info_ops.c @@ -576,7 +576,8 @@ static int update_reports_display_invoke(bContext *C, wmOperator *UNUSED(op), co if ((reports->reporttimer == NULL) || (reports->reporttimer != event->customdata) || ((report = BKE_reports_last_displayable(reports)) == NULL) /* may have been deleted */ - ) { + ) + { return OPERATOR_PASS_THROUGH; } diff --git a/source/blender/editors/space_info/info_stats.cc b/source/blender/editors/space_info/info_stats.cc index 56e98aa7625..f62af1191f3 100644 --- a/source/blender/editors/space_info/info_stats.cc +++ b/source/blender/editors/space_info/info_stats.cc @@ -231,7 +231,8 @@ static void stats_object_edit(Object *obedit, SceneStats *stats) /* if this is a connected child and its parent is being moved, remove our root */ if ((ebo->flag & BONE_CONNECTED) && (ebo->flag & BONE_ROOTSEL) && ebo->parent && - (ebo->parent->flag & BONE_TIPSEL)) { + (ebo->parent->flag & BONE_TIPSEL)) + { stats->totvertsel--; } diff --git a/source/blender/editors/space_nla/nla_draw.c b/source/blender/editors/space_nla/nla_draw.c index d49cd4af6a8..47b51657831 100644 --- a/source/blender/editors/space_nla/nla_draw.c +++ b/source/blender/editors/space_nla/nla_draw.c @@ -488,7 +488,8 @@ static void nla_draw_strip(SpaceNla *snla, /* draw 'inside' of strip itself */ if (solo && is_nlastrip_enabled(adt, nlt, strip) && - !(strip->flag & NLASTRIP_FLAG_INVALID_LOCATION)) { + !(strip->flag & NLASTRIP_FLAG_INVALID_LOCATION)) + { immUnbindProgram(); /* strip is in normal track */ @@ -761,14 +762,16 @@ static ListBase get_visible_nla_strips(NlaTrack *nlt, View2D *v2d) NlaStrip *first_strip = nlt->strips.first; NlaStrip *last_strip = nlt->strips.last; if (first_strip && v2d->cur.xmax < first_strip->start && - first_strip->extendmode == NLASTRIP_EXTEND_HOLD) { + first_strip->extendmode == NLASTRIP_EXTEND_HOLD) + { /* The view is to the left of all strips and the first strip has an * extendmode that should be drawn. */ first = last = first_strip; } else if (last_strip && v2d->cur.xmin > last_strip->end && - last_strip->extendmode != NLASTRIP_EXTEND_NOTHING) { + last_strip->extendmode != NLASTRIP_EXTEND_NOTHING) + { /* The view is to the right of all strips and the last strip has an * extendmode that should be drawn. */ diff --git a/source/blender/editors/space_nla/nla_edit.c b/source/blender/editors/space_nla/nla_edit.c index aa8f079bc5a..230e1b94ef9 100644 --- a/source/blender/editors/space_nla/nla_edit.c +++ b/source/blender/editors/space_nla/nla_edit.c @@ -450,7 +450,8 @@ static bool nla_channels_get_selected_extents(bAnimContext *ac, float *r_min, fl /* must be selected... */ if (acf && acf->has_setting(ac, ale, ACHANNEL_SETTING_SELECT) && - ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT)) { + ANIM_channel_setting_get(ac, ale, ACHANNEL_SETTING_SELECT)) + { /* update best estimate */ *r_min = ymax - NLACHANNEL_HEIGHT(snla); *r_max = ymax; @@ -1634,7 +1635,8 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op) NlaStrip *mstrip = (NlaStrip *)nlt->strips.first; if ((mstrip->flag & NLASTRIP_FLAG_TEMP_META) && - (BLI_listbase_count_at_most(&mstrip->strips, 3) == 2)) { + (BLI_listbase_count_at_most(&mstrip->strips, 3) == 2)) + { /* remove this temp meta, so that we can see the strips inside */ BKE_nlastrips_clear_metas(&nlt->strips, 0, 1); } @@ -1701,7 +1703,8 @@ static int nlaedit_swap_exec(bContext *C, wmOperator *op) /* check if the track has room for the strips to be swapped */ if (BKE_nlastrips_has_space(&nlt->strips, nsa[0], nsa[1]) && - BKE_nlastrips_has_space(&nlt->strips, nsb[0], nsb[1])) { + BKE_nlastrips_has_space(&nlt->strips, nsb[0], nsb[1])) + { /* set new extents for strips then */ area->start = nsa[0]; area->end = nsa[1]; @@ -1809,7 +1812,8 @@ static int nlaedit_move_up_exec(bContext *C, wmOperator *UNUSED(op)) } if (BKE_nlatrack_is_nonlocal_in_liboverride(ale->id, nlt) || - BKE_nlatrack_is_nonlocal_in_liboverride(ale->id, nltn)) { + BKE_nlatrack_is_nonlocal_in_liboverride(ale->id, nltn)) + { /* No moving of strips in non-local tracks of override data. */ continue; } @@ -1901,7 +1905,8 @@ static int nlaedit_move_down_exec(bContext *C, wmOperator *UNUSED(op)) } if (BKE_nlatrack_is_nonlocal_in_liboverride(ale->id, nlt) || - BKE_nlatrack_is_nonlocal_in_liboverride(ale->id, nltp)) { + BKE_nlatrack_is_nonlocal_in_liboverride(ale->id, nltp)) + { /* No moving of strips in non-local tracks of override data. */ continue; } diff --git a/source/blender/editors/space_node/clipboard.cc b/source/blender/editors/space_node/clipboard.cc index a0bab859025..68f2f988bcb 100644 --- a/source/blender/editors/space_node/clipboard.cc +++ b/source/blender/editors/space_node/clipboard.cc @@ -212,8 +212,8 @@ static int node_clipboard_paste_exec(bContext *C, wmOperator *op) for (NodeClipboardItem &item : clipboard.nodes) { const bNode &node = *item.node; const char *disabled_hint = nullptr; - if (node.typeinfo->poll_instance && - node.typeinfo->poll_instance(&node, &tree, &disabled_hint)) { + if (node.typeinfo->poll_instance && node.typeinfo->poll_instance(&node, &tree, &disabled_hint)) + { bNode *new_node = bke::node_copy_with_mapping( &tree, node, LIB_ID_COPY_DEFAULT, true, socket_map); node_map.add_new(&node, new_node); diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc index 4eb1dffd880..7c8de13ca69 100644 --- a/source/blender/editors/space_node/drawnode.cc +++ b/source/blender/editors/space_node/drawnode.cc @@ -345,7 +345,8 @@ static void node_buts_image_user(uiLayout *layout, } if (show_layer_selection && RNA_enum_get(imaptr, "type") == IMA_TYPE_MULTILAYER && - RNA_boolean_get(ptr, "has_layers")) { + RNA_boolean_get(ptr, "has_layers")) + { col = uiLayoutColumn(layout, false); uiItemR(col, ptr, "layer", DEFAULT_FLAGS, nullptr, ICON_NONE); } @@ -1564,7 +1565,8 @@ void draw_nodespace_back_pix(const bContext &C, } if ((snode.nodetree->flag & NTREE_VIEWER_BORDER) && - viewer_border->xmin < viewer_border->xmax && viewer_border->ymin < viewer_border->ymax) { + viewer_border->xmin < viewer_border->xmax && viewer_border->ymin < viewer_border->ymax) + { rcti pixel_border; BLI_rcti_init(&pixel_border, x + snode.zoom * viewer_border->xmin * ibuf->x, @@ -2057,7 +2059,8 @@ static NodeLinkDrawConfig nodelink_get_draw_config(const bContext &C, UI_GetThemeColor4fv(th_col3, draw_config.outline_color); if (snode.overlay.flag & SN_OVERLAY_SHOW_OVERLAYS && - snode.overlay.flag & SN_OVERLAY_SHOW_WIRE_COLORS) { + snode.overlay.flag & SN_OVERLAY_SHOW_WIRE_COLORS) + { PointerRNA from_node_ptr, to_node_ptr; RNA_pointer_create((ID *)&node_tree, &RNA_Node, link.fromnode, &from_node_ptr); RNA_pointer_create((ID *)&node_tree, &RNA_Node, link.tonode, &to_node_ptr); @@ -2208,7 +2211,8 @@ void node_draw_link(const bContext &C, /* Links from field to non-field sockets are not allowed. */ if (snode.edittree->type == NTREE_GEOMETRY) { if ((link.fromsock && link.fromsock->display_shape == SOCK_DISPLAY_SHAPE_DIAMOND) && - (link.tosock && link.tosock->display_shape == SOCK_DISPLAY_SHAPE_CIRCLE)) { + (link.tosock && link.tosock->display_shape == SOCK_DISPLAY_SHAPE_CIRCLE)) + { th_col1 = th_col2 = th_col3 = TH_REDALERT; } } diff --git a/source/blender/editors/space_node/node_add.cc b/source/blender/editors/space_node/node_add.cc index 6ff47505e1d..72bd8940dac 100644 --- a/source/blender/editors/space_node/node_add.cc +++ b/source/blender/editors/space_node/node_add.cc @@ -746,7 +746,8 @@ static int node_add_file_invoke(bContext *C, wmOperator *op, const wmEvent *even snode->runtime->cursor[1] /= UI_SCALE_FAC; if (WM_operator_properties_id_lookup_is_set(op->ptr) || - RNA_struct_property_is_set(op->ptr, "filepath")) { + RNA_struct_property_is_set(op->ptr, "filepath")) + { return node_add_file_exec(C, op); } return WM_operator_filesel(C, op, event); diff --git a/source/blender/editors/space_node/node_draw.cc b/source/blender/editors/space_node/node_draw.cc index f1d9200ef6f..34ab80edb5d 100644 --- a/source/blender/editors/space_node/node_draw.cc +++ b/source/blender/editors/space_node/node_draw.cc @@ -745,7 +745,8 @@ static void node_socket_draw(const bNodeSocket &sock, if (ELEM(sock.display_shape, SOCK_DISPLAY_SHAPE_DIAMOND_DOT, SOCK_DISPLAY_SHAPE_SQUARE_DOT, - SOCK_DISPLAY_SHAPE_CIRCLE_DOT)) { + SOCK_DISPLAY_SHAPE_CIRCLE_DOT)) + { flags |= GPU_KEYFRAME_SHAPE_INNER_DOT; } @@ -1078,20 +1079,24 @@ static std::optional create_socket_inspection_string(TreeDrawContex ValueLog *value_log = tree_draw_ctx.geo_tree_log->find_socket_value_log(socket); std::stringstream ss; if (const geo_log::GenericValueLog *generic_value_log = - dynamic_cast(value_log)) { + dynamic_cast(value_log)) + { create_inspection_string_for_generic_value(socket, generic_value_log->value, ss); } else if (const geo_log::FieldInfoLog *gfield_value_log = - dynamic_cast(value_log)) { + dynamic_cast(value_log)) + { create_inspection_string_for_field_info(socket, *gfield_value_log, ss); } else if (const geo_log::GeometryInfoLog *geo_value_log = - dynamic_cast(value_log)) { + dynamic_cast(value_log)) + { create_inspection_string_for_geometry_info(*geo_value_log, ss); } if (const nodes::decl::Geometry *socket_decl = dynamic_cast( - socket.runtime->declaration)) { + socket.runtime->declaration)) + { const bool after_log = value_log != nullptr; create_inspection_string_for_geometry_socket(ss, socket_decl, after_log); } @@ -1725,7 +1730,8 @@ static void node_add_error_message_button(const TreeDrawContext &tree_draw_ctx, float &icon_offset) { if (tree_draw_ctx.used_by_realtime_compositor && - node.typeinfo->realtime_compositor_unsupported_message) { + node.typeinfo->realtime_compositor_unsupported_message) + { node_add_unsupported_compositor_operation_error_message_button(node, block, rect, icon_offset); return; } @@ -1792,8 +1798,8 @@ static std::optional node_get_execution_time( } } else { - if (const geo_log::GeoNodeLog *node_log = tree_log->nodes.lookup_ptr_as( - tnode->identifier)) { + if (const geo_log::GeoNodeLog *node_log = tree_log->nodes.lookup_ptr_as(tnode->identifier)) + { found_node = true; run_time += node_log->run_time; } @@ -1934,7 +1940,8 @@ static std::optional node_get_accessed_attributes_row( if (ELEM(node.type, GEO_NODE_STORE_NAMED_ATTRIBUTE, GEO_NODE_REMOVE_ATTRIBUTE, - GEO_NODE_INPUT_NAMED_ATTRIBUTE)) { + GEO_NODE_INPUT_NAMED_ATTRIBUTE)) + { /* Only show the overlay when the name is passed in from somewhere else. */ for (const bNodeSocket *socket : node.input_sockets()) { if (STREQ(socket->name, "Name")) { @@ -1965,7 +1972,8 @@ static Vector node_get_extra_info(TreeDrawContext &tree_draw_c } if (snode.overlay.flag & SN_OVERLAY_SHOW_NAMED_ATTRIBUTES && - snode.edittree->type == NTREE_GEOMETRY) { + snode.edittree->type == NTREE_GEOMETRY) + { if (std::optional row = node_get_accessed_attributes_row(tree_draw_ctx, node)) { rows.append(std::move(*row)); @@ -1974,7 +1982,8 @@ static Vector node_get_extra_info(TreeDrawContext &tree_draw_c if (snode.overlay.flag & SN_OVERLAY_SHOW_TIMINGS && snode.edittree->type == NTREE_GEOMETRY && (ELEM(node.typeinfo->nclass, NODE_CLASS_GEOMETRY, NODE_CLASS_GROUP, NODE_CLASS_ATTRIBUTE) || - ELEM(node.type, NODE_FRAME, NODE_GROUP_OUTPUT))) { + ELEM(node.type, NODE_FRAME, NODE_GROUP_OUTPUT))) + { NodeExtraInfoRow row; row.text = node_get_execution_time_label(tree_draw_ctx, snode, node); if (!row.text.empty()) { @@ -2961,7 +2970,8 @@ static void reroute_node_draw( /* Skip if out of view. */ const rctf &rct = node.runtime->totr; if (rct.xmax < region.v2d.cur.xmin || rct.xmin > region.v2d.cur.xmax || - rct.ymax < region.v2d.cur.ymin || node.runtime->totr.ymin > region.v2d.cur.ymax) { + rct.ymax < region.v2d.cur.ymin || node.runtime->totr.ymin > region.v2d.cur.ymax) + { UI_block_end(&C, &block); return; } diff --git a/source/blender/editors/space_node/node_edit.cc b/source/blender/editors/space_node/node_edit.cc index 0c26af81f17..30a0fabe672 100644 --- a/source/blender/editors/space_node/node_edit.cc +++ b/source/blender/editors/space_node/node_edit.cc @@ -656,7 +656,8 @@ void snode_set_context(const bContext &C) } if (snode->nodetree != ntree || snode->id != id || snode->from != from || - (snode->treepath.last == nullptr && ntree)) { + (snode->treepath.last == nullptr && ntree)) + { ED_node_tree_start(snode, ntree, id, from); } } @@ -700,7 +701,8 @@ void ED_node_set_active( SH_NODE_OUTPUT_MATERIAL, SH_NODE_OUTPUT_WORLD, SH_NODE_OUTPUT_LIGHT, - SH_NODE_OUTPUT_LINESTYLE)) { + SH_NODE_OUTPUT_LINESTYLE)) + { for (bNode *node_iter : ntree->all_nodes()) { if (node_iter->type == node->type) { node_iter->flag &= ~NODE_DO_OUTPUT; @@ -1291,7 +1293,8 @@ static int node_duplicate_exec(bContext *C, wmOperator *op) /* This creates new links between copied nodes. If keep_inputs is set, also copies input links * from unselected (when fromnode is null)! */ if (link->tonode && (link->tonode->flag & NODE_SELECT) && - (keep_inputs || (link->fromnode && (link->fromnode->flag & NODE_SELECT)))) { + (keep_inputs || (link->fromnode && (link->fromnode->flag & NODE_SELECT)))) + { bNodeLink *newlink = MEM_cnew("bNodeLink"); newlink->flag = link->flag; newlink->tonode = node_map.lookup(link->tonode); @@ -1389,7 +1392,8 @@ static int node_read_viewlayers_exec(bContext *C, wmOperator * /*op*/) for (bNode *node : edit_tree.all_nodes()) { if ((node->type == CMP_NODE_R_LAYERS) || - (node->type == CMP_NODE_CRYPTOMATTE && node->custom1 == CMP_CRYPTOMATTE_SRC_RENDER)) { + (node->type == CMP_NODE_CRYPTOMATTE && node->custom1 == CMP_CRYPTOMATTE_SRC_RENDER)) + { ID *id = node->id; if (id == nullptr) { continue; @@ -1491,7 +1495,8 @@ static void node_flag_toggle_exec(SpaceNode *snode, int toggle_flag) continue; } if (toggle_flag == NODE_OPTIONS && - !(node->typeinfo->draw_buttons || node->typeinfo->draw_buttons_ex)) { + !(node->typeinfo->draw_buttons || node->typeinfo->draw_buttons_ex)) + { continue; } @@ -1510,7 +1515,8 @@ static void node_flag_toggle_exec(SpaceNode *snode, int toggle_flag) continue; } if (toggle_flag == NODE_OPTIONS && - !(node->typeinfo->draw_buttons || node->typeinfo->draw_buttons_ex)) { + !(node->typeinfo->draw_buttons || node->typeinfo->draw_buttons_ex)) + { continue; } diff --git a/source/blender/editors/space_node/node_group.cc b/source/blender/editors/space_node/node_group.cc index 50cabb412a9..be31abb57df 100644 --- a/source/blender/editors/space_node/node_group.cc +++ b/source/blender/editors/space_node/node_group.cc @@ -75,7 +75,8 @@ static bool node_group_operator_active_poll(bContext *C) "ShaderNodeTree", "CompositorNodeTree", "TextureNodeTree", - "GeometryNodeTree")) { + "GeometryNodeTree")) + { return true; } } @@ -91,7 +92,8 @@ static bool node_group_operator_editable(bContext *C) * Disabled otherwise to allow python-nodes define their own operators * with same key-map. */ if (ED_node_is_shader(snode) || ED_node_is_compositor(snode) || ED_node_is_texture(snode) || - ED_node_is_geometry(snode)) { + ED_node_is_geometry(snode)) + { return true; } } @@ -322,7 +324,8 @@ static bool node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode) /* find external links to this input */ for (bNodeLink *tlink = (bNodeLink *)ntree->links.first; tlink != glinks_first->next; - tlink = tlink->next) { + tlink = tlink->next) + { if (tlink->tonode == gnode && STREQ(tlink->tosock->identifier, identifier)) { nodeAddLink(ntree, tlink->fromnode, tlink->fromsock, link->tonode, link->tosock); num_external_links++; @@ -349,7 +352,8 @@ static bool node_group_ungroup(Main *bmain, bNodeTree *ntree, bNode *gnode) /* output links */ for (bNodeLink *link = (bNodeLink *)ntree->links.first; link != glinks_first->next; - link = link->next) { + link = link->next) + { if (link->fromnode == gnode) { const char *identifier = link->fromsock->identifier; int num_internal_links = 0; @@ -694,7 +698,8 @@ static bool node_group_make_test_selected(bNodeTree &ntree, return false; }; if (sockets_connected_to_group(node->input_sockets()) && - sockets_connected_to_group(node->output_sockets())) { + sockets_connected_to_group(node->output_sockets())) + { return false; } } diff --git a/source/blender/editors/space_node/node_relationships.cc b/source/blender/editors/space_node/node_relationships.cc index 7d65292ae90..dd4de20fb82 100644 --- a/source/blender/editors/space_node/node_relationships.cc +++ b/source/blender/editors/space_node/node_relationships.cc @@ -2066,12 +2066,14 @@ static bNode *get_selected_node_for_insertion(bNodeTree &node_tree) } if (std::any_of(selected_node->input_sockets().begin(), selected_node->input_sockets().end(), - [&](const bNodeSocket *socket) { return socket->is_directly_linked(); })) { + [&](const bNodeSocket *socket) { return socket->is_directly_linked(); })) + { return nullptr; } if (std::any_of(selected_node->output_sockets().begin(), selected_node->output_sockets().end(), - [&](const bNodeSocket *socket) { return socket->is_directly_linked(); })) { + [&](const bNodeSocket *socket) { return socket->is_directly_linked(); })) + { return nullptr; }; return selected_node; @@ -2166,12 +2168,14 @@ void node_insert_on_link_flags(Main &bmain, SpaceNode &snode) /* Ignore main sockets when the types don't match. */ if (best_input != nullptr && ntree.typeinfo->validate_link != nullptr && !ntree.typeinfo->validate_link(static_cast(old_link->fromsock->type), - static_cast(best_input->type))) { + static_cast(best_input->type))) + { best_input = nullptr; } if (best_output != nullptr && ntree.typeinfo->validate_link != nullptr && !ntree.typeinfo->validate_link(static_cast(best_output->type), - static_cast(old_link->tosock->type))) { + static_cast(old_link->tosock->type))) + { best_output = nullptr; } } @@ -2443,7 +2447,8 @@ static void node_link_insert_offset_ntree(NodeInsertOfsData *iofsd, * without actually making it a part of the frame (because mouse isn't intersecting it) * - logic here is similar to node_find_frame_to_attach. */ if (!insert.parent || - (prev->parent && (prev->parent == next->parent) && (prev->parent != insert.parent))) { + (prev->parent && (prev->parent == next->parent) && (prev->parent != insert.parent))) + { bNode *frame; rctf totr_frame; @@ -2458,9 +2463,11 @@ static void node_link_insert_offset_ntree(NodeInsertOfsData *iofsd, node_to_updated_rect(*frame, totr_frame); if (BLI_rctf_isect_x(&totr_frame, totr_insert.xmin) && - BLI_rctf_isect_x(&totr_frame, totr_insert.xmax)) { + BLI_rctf_isect_x(&totr_frame, totr_insert.xmax)) + { if (BLI_rctf_isect_y(&totr_frame, totr_insert.ymin) || - BLI_rctf_isect_y(&totr_frame, totr_insert.ymax)) { + BLI_rctf_isect_y(&totr_frame, totr_insert.ymax)) + { /* frame isn't insert.parent actually, but this is needed to make offsetting * nodes work correctly for above checked cases (it is restored later) */ insert.parent = frame; @@ -2495,7 +2502,8 @@ static void node_link_insert_offset_ntree(NodeInsertOfsData *iofsd, if (needs_alignment) { bNode *offs_node = right_alignment ? next : prev; if (!offs_node->parent || offs_node->parent == insert.parent || - nodeIsParentAndChild(offs_node->parent, &insert)) { + nodeIsParentAndChild(offs_node->parent, &insert)) + { node_offset_apply(*offs_node, addval); } else if (!insert.parent && offs_node->parent) { @@ -2536,8 +2544,8 @@ static int node_insert_offset_modal(bContext *C, wmOperator *op, const wmEvent * NodeInsertOfsData *iofsd = static_cast(op->customdata); bool redraw = false; - if (!snode || event->type != TIMER || iofsd == nullptr || - iofsd->anim_timer != event->customdata) { + if (!snode || event->type != TIMER || iofsd == nullptr || iofsd->anim_timer != event->customdata) + { return OPERATOR_PASS_THROUGH; } diff --git a/source/blender/editors/space_node/node_select.cc b/source/blender/editors/space_node/node_select.cc index b6b009550eb..e07aadbe57d 100644 --- a/source/blender/editors/space_node/node_select.cc +++ b/source/blender/editors/space_node/node_select.cc @@ -114,7 +114,8 @@ static bool node_frame_select_isect_mouse(const bNode &node, const float2 &mouse * would prevent e.g. box selection of nodes inside that frame). */ const rctf frame_inside = node_frame_rect_inside(node); if (BLI_rctf_isect_pt(&node.runtime->totr, mouse.x, mouse.y) && - !BLI_rctf_isect_pt(&frame_inside, mouse.x, mouse.y)) { + !BLI_rctf_isect_pt(&frame_inside, mouse.x, mouse.y)) + { return true; } @@ -386,7 +387,8 @@ static bool node_select_grouped_name(bNodeTree &node_tree, bNode &node_act, cons if ((from_right && STREQ(suf_act, suf_curr)) || (!from_right && (pref_len_act == pref_len_curr) && - STREQLEN(node_act.name, node->name, pref_len_act))) { + STREQLEN(node_act.name, node->name, pref_len_act))) + { nodeSetSelected(node, true); changed = true; } @@ -667,7 +669,8 @@ static bool node_mouse_select(bContext *C, ED_node_set_active_viewer_key(&snode); node_sort(node_tree); if ((active_texture_changed && has_workbench_in_texture_color(wm, scene, ob)) || - viewer_node_changed) { + viewer_node_changed) + { DEG_id_tag_update(&snode.edittree->id, ID_RECALC_COPY_ON_WRITE); } @@ -777,7 +780,8 @@ static int node_box_select_exec(bContext *C, wmOperator *op) * nodes - would prevent selection of other nodes inside that frame. */ const rctf frame_inside = node_frame_rect_inside(*node); if (BLI_rctf_isect(&rectf, &node->runtime->totr, nullptr) && - !BLI_rctf_inside_rctf(&frame_inside, &rectf)) { + !BLI_rctf_inside_rctf(&frame_inside, &rectf)) + { nodeSetSelected(node, select); is_inside = true; } @@ -882,7 +886,8 @@ static int node_circleselect_exec(bContext *C, wmOperator *op) const float radius_adjusted = float(radius) / zoom; BLI_rctf_pad(&frame_inside, -2.0f * radius_adjusted, -2.0f * radius_adjusted); if (BLI_rctf_isect_circle(&node->runtime->totr, offset, radius_adjusted) && - !BLI_rctf_isect_circle(&frame_inside, offset, radius_adjusted)) { + !BLI_rctf_isect_circle(&frame_inside, offset, radius_adjusted)) + { nodeSetSelected(node, select); } break; @@ -976,7 +981,8 @@ static bool do_lasso_select_node(bContext *C, UI_view2d_region_to_view_rctf(®ion->v2d, &rectf, &rectf); const rctf frame_inside = node_frame_rect_inside(*node); if (BLI_rctf_isect(&rectf, &node->runtime->totr, nullptr) && - !BLI_rctf_inside_rctf(&frame_inside, &rectf)) { + !BLI_rctf_inside_rctf(&frame_inside, &rectf)) + { nodeSetSelected(node, select); changed = true; } @@ -991,7 +997,8 @@ static bool do_lasso_select_node(bContext *C, if (UI_view2d_view_to_region_clip( ®ion->v2d, center.x, center.y, &screen_co.x, &screen_co.y) && BLI_rcti_isect_pt(&rect, screen_co.x, screen_co.y) && - BLI_lasso_is_point_inside(mcoords, mcoords_len, screen_co.x, screen_co.y, INT_MAX)) { + BLI_lasso_is_point_inside(mcoords, mcoords_len, screen_co.x, screen_co.y, INT_MAX)) + { nodeSetSelected(node, select); changed = true; } diff --git a/source/blender/editors/space_node/node_templates.cc b/source/blender/editors/space_node/node_templates.cc index cb69800e515..a9dae4612f5 100644 --- a/source/blender/editors/space_node/node_templates.cc +++ b/source/blender/editors/space_node/node_templates.cc @@ -214,7 +214,8 @@ static void node_socket_add_replace(const bContext *C, if (node_from) { if (node_from->inputs.first || node_from->typeinfo->draw_buttons || - node_from->typeinfo->draw_buttons_ex) { + node_from->typeinfo->draw_buttons_ex) + { node_from = nullptr; } } @@ -277,7 +278,8 @@ static void node_socket_add_replace(const bContext *C, if (node_from->typeinfo->nclass == NODE_CLASS_TEXTURE && node_prev->typeinfo->nclass == NODE_CLASS_TEXTURE && /* White noise texture node does not have NodeTexBase. */ - node_from->storage != nullptr && node_prev->storage != nullptr) { + node_from->storage != nullptr && node_prev->storage != nullptr) + { memcpy(node_from->storage, node_prev->storage, sizeof(NodeTexBase)); } @@ -321,20 +323,22 @@ static Vector ui_node_link_items(NodeLinkArg *arg, int i; for (ngroup = (bNodeTree *)arg->bmain->nodetrees.first; ngroup; - ngroup = (bNodeTree *)ngroup->id.next) { + ngroup = (bNodeTree *)ngroup->id.next) + { const char *disabled_hint; - if ((ngroup->type != arg->ntree->type) || - !nodeGroupPoll(arg->ntree, ngroup, &disabled_hint)) { + if ((ngroup->type != arg->ntree->type) || !nodeGroupPoll(arg->ntree, ngroup, &disabled_hint)) + { continue; } } i = 0; for (ngroup = (bNodeTree *)arg->bmain->nodetrees.first; ngroup; - ngroup = (bNodeTree *)ngroup->id.next) { + ngroup = (bNodeTree *)ngroup->id.next) + { const char *disabled_hint; - if ((ngroup->type != arg->ntree->type) || - !nodeGroupPoll(arg->ntree, ngroup, &disabled_hint)) { + if ((ngroup->type != arg->ntree->type) || !nodeGroupPoll(arg->ntree, ngroup, &disabled_hint)) + { continue; } diff --git a/source/blender/editors/space_node/space_node.cc b/source/blender/editors/space_node/space_node.cc index 80f08fda3e5..3185e723177 100644 --- a/source/blender/editors/space_node/space_node.cc +++ b/source/blender/editors/space_node/space_node.cc @@ -198,7 +198,8 @@ void ED_node_set_active_viewer_key(SpaceNode *snode) /* A change in active viewer may result in the change of the output node used by the * compositor, so we need to get notified about such changes. */ if (snode->nodetree->active_viewer_key.value != path->parent_key.value && - snode->nodetree->type == NTREE_COMPOSIT) { + snode->nodetree->type == NTREE_COMPOSIT) + { DEG_id_tag_update(&snode->nodetree->id, ID_RECALC_NTREE_OUTPUT); WM_main_add_notifier(NC_NODE, nullptr); } diff --git a/source/blender/editors/space_outliner/outliner_collections.cc b/source/blender/editors/space_outliner/outliner_collections.cc index 9a557627abb..0e214d2cdf4 100644 --- a/source/blender/editors/space_outliner/outliner_collections.cc +++ b/source/blender/editors/space_outliner/outliner_collections.cc @@ -52,10 +52,9 @@ bool outliner_is_collection_tree_element(const TreeElement *te) return false; } - if (ELEM(tselem->type, - TSE_LAYER_COLLECTION, - TSE_SCENE_COLLECTION_BASE, - TSE_VIEW_COLLECTION_BASE)) { + if (ELEM( + tselem->type, TSE_LAYER_COLLECTION, TSE_SCENE_COLLECTION_BASE, TSE_VIEW_COLLECTION_BASE)) + { return true; } if ((tselem->type == TSE_SOME_ID) && te->idcode == ID_GR) { @@ -114,8 +113,8 @@ TreeTraversalAction outliner_collect_selected_objects(TreeElement *te, void *cus return TRAVERSE_CONTINUE; } - if ((tselem->type != TSE_SOME_ID) || (tselem->id == nullptr) || - (GS(tselem->id->name) != ID_OB)) { + if ((tselem->type != TSE_SOME_ID) || (tselem->id == nullptr) || (GS(tselem->id->name) != ID_OB)) + { return TRAVERSE_SKIP_CHILDS; } @@ -239,7 +238,8 @@ static int collection_new_exec(bContext *C, wmOperator *op) } if (data.collection == nullptr || ID_IS_LINKED(data.collection) || - ID_IS_OVERRIDE_LIBRARY(data.collection)) { + ID_IS_OVERRIDE_LIBRARY(data.collection)) + { data.collection = scene->master_collection; } @@ -699,7 +699,8 @@ static int collection_link_exec(bContext *C, wmOperator *op) if ((ID_IS_LINKED(active_collection) || ID_IS_OVERRIDE_LIBRARY(active_collection)) || ((active_collection->flag & COLLECTION_IS_MASTER) && - (ID_IS_LINKED(scene) || ID_IS_OVERRIDE_LIBRARY(scene)))) { + (ID_IS_LINKED(scene) || ID_IS_OVERRIDE_LIBRARY(scene)))) + { BKE_report( op->reports, RPT_ERROR, "Cannot add a collection to a linked/override collection/scene"); return OPERATOR_CANCELLED; diff --git a/source/blender/editors/space_outliner/outliner_dragdrop.cc b/source/blender/editors/space_outliner/outliner_dragdrop.cc index 2569670a8d3..06cab393097 100644 --- a/source/blender/editors/space_outliner/outliner_dragdrop.cc +++ b/source/blender/editors/space_outliner/outliner_dragdrop.cc @@ -139,7 +139,8 @@ static TreeElement *outliner_drop_insert_find(bContext *C, if (view_mval[1] < (te_hovered->ys + margin)) { if (TSELEM_OPEN(TREESTORE(te_hovered), space_outliner) && - !BLI_listbase_is_empty(&te_hovered->subtree)) { + !BLI_listbase_is_empty(&te_hovered->subtree)) + { /* inserting after a open item means we insert into it, but as first child */ if (BLI_listbase_is_empty(&te_hovered->subtree)) { *r_insert_type = TE_INSERT_INTO; @@ -385,7 +386,8 @@ static void parent_drop_set_parents(bContext *C, } if (ED_object_parent_set( - reports, C, scene, object, parent, parent_type, false, keep_transform, nullptr)) { + reports, C, scene, object, parent, parent_type, false, keep_transform, nullptr)) + { parent_set = true; } } @@ -724,7 +726,8 @@ static bool datastack_drop_init(bContext *C, const wmEvent *event, StackDropData TSE_CONSTRAINT, TSE_CONSTRAINT_BASE, TSE_GPENCIL_EFFECT, - TSE_GPENCIL_EFFECT_BASE)) { + TSE_GPENCIL_EFFECT_BASE)) + { return false; } @@ -762,7 +765,8 @@ static bool datastack_drop_init(bContext *C, const wmEvent *event, StackDropData if (ELEM(drop_data->drag_tselem->type, TSE_MODIFIER_BASE, TSE_CONSTRAINT_BASE, - TSE_GPENCIL_EFFECT_BASE)) { + TSE_GPENCIL_EFFECT_BASE)) + { drop_data->insert_type = TE_INSERT_INTO; drop_data->drop_action = DATA_STACK_DROP_LINK; @@ -821,7 +825,8 @@ static bool datastack_drop_are_types_valid(StackDropData *drop_data) if (tselem->type == TSE_CONSTRAINT) { } else if ((drop_data->pchan_parent && tselem->type != TSE_POSE_CHANNEL) || - (!drop_data->pchan_parent && tselem->type == TSE_POSE_CHANNEL)) { + (!drop_data->pchan_parent && tselem->type == TSE_POSE_CHANNEL)) + { return false; } diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc index 3f2f466a1e5..37001b067c2 100644 --- a/source/blender/editors/space_outliner/outliner_draw.cc +++ b/source/blender/editors/space_outliner/outliner_draw.cc @@ -277,7 +277,8 @@ static void outliner_object_set_flag_recursive_fn(bContext *C, Object *ob_parent = ob ? ob : base->object; for (Object *ob_iter = static_cast(bmain->objects.first); ob_iter; - ob_iter = static_cast(ob_iter->id.next)) { + ob_iter = static_cast(ob_iter->id.next)) + { if (BKE_object_is_child_recursive(ob_parent, ob_iter)) { if (ob) { RNA_id_pointer_create(&ob_iter->id, &ptr); @@ -438,7 +439,8 @@ static bool outliner_collection_is_isolated(Scene *scene, else if (collection_ensure == collection_ensure_cmp) { } else if (BKE_collection_has_collection(collection_ensure, (Collection *)collection_ensure_cmp) || - BKE_collection_has_collection((Collection *)collection_ensure_cmp, collection_ensure)) { + BKE_collection_has_collection((Collection *)collection_ensure_cmp, collection_ensure)) + { /* This collection is either a parent or a child of the collection. * We expect it to be set "visible" already. */ if (value != value_cmp) { @@ -469,7 +471,8 @@ static bool outliner_collection_is_isolated(Scene *scene, value_cmp, layer_or_collection_prop, layer_collection_iter, - collection_iter)) { + collection_iter)) + { return false; } } @@ -1097,7 +1100,8 @@ static void outliner_draw_restrictbuts(uiBlock *block, restrict_offsets.select = (++restrict_column_offset) * UI_UNIT_X + V2D_SCROLL_WIDTH; } if (space_outliner->outlinevis == SO_VIEW_LAYER && - space_outliner->show_restrict_flags & SO_RESTRICT_ENABLE) { + space_outliner->show_restrict_flags & SO_RESTRICT_ENABLE) + { restrict_offsets.enable = (++restrict_column_offset) * UI_UNIT_X + V2D_SCROLL_WIDTH; } @@ -1139,7 +1143,8 @@ static void outliner_draw_restrictbuts(uiBlock *block, } } else if (((tselem->type == TSE_SOME_ID) && (te->idcode == ID_OB)) && - (te->flag & TE_CHILD_NOT_IN_COLLECTION)) { + (te->flag & TE_CHILD_NOT_IN_COLLECTION)) + { /* Don't show restrict columns for children that are not directly inside the collection. */ } else if ((tselem->type == TSE_SOME_ID) && (te->idcode == ID_OB)) { @@ -1488,7 +1493,8 @@ static void outliner_draw_restrictbuts(uiBlock *block, PointerRNA layer_collection_ptr; if (outliner_restrict_properties_collection_set( - scene, te, &collection_ptr, &layer_collection_ptr, &props, &props_active)) { + scene, te, &collection_ptr, &layer_collection_ptr, &props, &props_active)) + { LayerCollection *layer_collection = (tselem->type == TSE_LAYER_COLLECTION) ? static_cast(te->directdata) : @@ -1843,7 +1849,8 @@ static void outliner_draw_overrides_rna_buts(uiBlock *block, } if (const TreeElementOverridesPropertyOperation *override_op_elem = - tree_element_cast(te)) { + tree_element_cast(te)) + { StringRefNull op_label = override_op_elem->getOverrideOperationLabel(); uiDefBut(block, UI_BTYPE_LABEL, @@ -2034,7 +2041,8 @@ static void outliner_draw_rnabuts(uiBlock *block, } } else if (TreeElementRNAArrayElement *te_rna_array_elem = - tree_element_cast(te)) { + tree_element_cast(te)) + { ptr = te_rna_array_elem->getPointerRNA(); prop = te_rna_array_elem->getPropertyRNA(); @@ -2203,7 +2211,8 @@ static void outliner_draw_mode_column_toggle(uiBlock *block, if (ID_IS_LINKED(&ob->id) || (ID_IS_OVERRIDE_LIBRARY_REAL(ob) && - (ob->id.override_library->flag & IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED) != 0)) { + (ob->id.override_library->flag & IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED) != 0)) + { UI_but_disable(but, TIP_("Can't edit library or non-editable override data")); } } @@ -3070,7 +3079,8 @@ static void outliner_draw_iconrow(bContext *C, * collection). */ const bool is_bone = ELEM(tselem->type, TSE_BONE, TSE_EBONE, TSE_POSE_CHANNEL); if ((level < 1) || ((tselem->type == TSE_SOME_ID) && (te->idcode == ID_OB)) || - (in_bone_hierarchy && is_bone)) { + (in_bone_hierarchy && is_bone)) + { /* active blocks get white circle */ if (tselem->type == TSE_SOME_ID) { if (te->idcode == ID_OB) { @@ -3100,7 +3110,8 @@ static void outliner_draw_iconrow(bContext *C, TSE_EBONE, TSE_POSE_CHANNEL, TSE_POSEGRP, - TSE_DEFGROUP)) { + TSE_DEFGROUP)) + { outliner_draw_iconrow_doit(block, te, xmax, offsx, ys, alpha_fac, active, 1); } else { @@ -3308,7 +3319,8 @@ static void outliner_draw_tree_element(bContext *C, /* Scene collection in view layer can't expand/collapse. */ } else if (te->subtree.first || ((tselem->type == TSE_SOME_ID) && (te->idcode == ID_SCE)) || - (te->flag & TE_PRETEND_HAS_CHILDREN)) { + (te->flag & TE_PRETEND_HAS_CHILDREN)) + { /* Open/close icon, only when sub-levels, except for scene. */ int icon_x = startx; @@ -3338,7 +3350,8 @@ static void outliner_draw_tree_element(bContext *C, te, (tselem->flag & TSE_HIGHLIGHTED_ICON) ? alpha_fac + 0.5f : alpha_fac, true, - 1)) { + 1)) + { offsx += UI_UNIT_X + 4 * ufac; } else { @@ -3347,7 +3360,8 @@ static void outliner_draw_tree_element(bContext *C, const TreeElementRNAStruct *te_rna_struct = tree_element_cast(te); if (ELEM(tselem->type, TSE_SOME_ID, TSE_LAYER_COLLECTION) || - (te_rna_struct && RNA_struct_is_ID(te_rna_struct->getPointerRNA().type))) { + (te_rna_struct && RNA_struct_is_ID(te_rna_struct->getPointerRNA().type))) + { const BIFIconID lib_icon = (BIFIconID)UI_icon_from_library(tselem->id); if (lib_icon != ICON_NONE) { UI_icon_draw_alpha( @@ -3868,7 +3882,8 @@ void draw_outliner(const bContext *C) SO_OVERRIDES_LIBRARY, SO_DATA_API, SO_ID_ORPHANS) && - space_outliner->flag & SO_SYNC_SELECT) { + space_outliner->flag & SO_SYNC_SELECT) + { outliner_sync_selection(C, space_outliner); } diff --git a/source/blender/editors/space_outliner/outliner_edit.cc b/source/blender/editors/space_outliner/outliner_edit.cc index 96b200f9ec1..af9cfdf5a80 100644 --- a/source/blender/editors/space_outliner/outliner_edit.cc +++ b/source/blender/editors/space_outliner/outliner_edit.cc @@ -110,7 +110,8 @@ static int outliner_highlight_update(bContext *C, wmOperator * /*op*/, const wmE bool changed = false; if (!hovered_te || !is_over_icon || !(hovered_te->store_elem->flag & TSE_HIGHLIGHTED) || - !(icon_te->store_elem->flag & TSE_HIGHLIGHTED_ICON)) { + !(icon_te->store_elem->flag & TSE_HIGHLIGHTED_ICON)) + { /* Clear highlights when nothing is hovered or when a new item is hovered. */ changed = outliner_flag_set(*space_outliner, TSE_HIGHLIGHTED_ANY | TSE_DRAG_ANY, false); if (hovered_te) { @@ -298,7 +299,8 @@ static void do_item_rename(ARegion *region, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM, TSE_ID_BASE, - TSE_SCENE_OBJECTS_BASE)) { + TSE_SCENE_OBJECTS_BASE)) + { /* do nothing */ } else if (ELEM(tselem->type, @@ -313,7 +315,8 @@ static void do_item_rename(ARegion *region, TSE_R_LAYER_BASE, TSE_SCENE_COLLECTION_BASE, TSE_VIEW_COLLECTION_BASE, - TSE_LIBRARY_OVERRIDE_BASE)) { + TSE_LIBRARY_OVERRIDE_BASE)) + { BKE_report(reports, RPT_WARNING, "Cannot edit builtin name"); } else if (ELEM(tselem->type, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP)) { @@ -462,7 +465,8 @@ static void id_delete_tag(bContext *C, ReportList *reports, TreeElement *te, Tre if (ID_IS_OVERRIDE_LIBRARY(id)) { if (!ID_IS_OVERRIDE_LIBRARY_REAL(id) || - (id->override_library->flag & IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY) == 0) { + (id->override_library->flag & IDOVERRIDE_LIBRARY_FLAG_NO_HIERARCHY) == 0) + { BKE_reportf(reports, RPT_WARNING, "Cannot delete library override id '%s', it is part of an override hierarchy", @@ -1524,7 +1528,8 @@ static void tree_element_show_hierarchy(Scene *scene, SpaceOutliner *space_outli TSE_SOME_ID, TSE_SCENE_OBJECTS_BASE, TSE_VIEW_COLLECTION_BASE, - TSE_LAYER_COLLECTION)) { + TSE_LAYER_COLLECTION)) + { if (te->idcode == ID_SCE) { if (tselem->id != (ID *)scene) { tselem->flag |= TSE_CLOSED; diff --git a/source/blender/editors/space_outliner/outliner_select.cc b/source/blender/editors/space_outliner/outliner_select.cc index f77272f79f5..3dac091f055 100644 --- a/source/blender/editors/space_outliner/outliner_select.cc +++ b/source/blender/editors/space_outliner/outliner_select.cc @@ -194,7 +194,8 @@ void outliner_item_mode_toggle(bContext *C, /* Hidden objects can be removed from the mode. */ if (!base || (!(base->flag & BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT) && - (ob->mode != tvc->obact->mode))) { + (ob->mode != tvc->obact->mode))) + { return; } @@ -245,7 +246,8 @@ static void do_outliner_object_select_recursive(const Scene *scene, LISTBASE_FOREACH (Base *, base, BKE_view_layer_object_bases_get(view_layer)) { Object *ob = base->object; if (((base->flag & BASE_ENABLED_AND_MAYBE_VISIBLE_IN_VIEWPORT) != 0) && - BKE_object_is_child_recursive(ob_parent, ob)) { + BKE_object_is_child_recursive(ob_parent, ob)) + { ED_object_base_select(base, select ? BA_SELECT : BA_DESELECT); } } @@ -366,7 +368,8 @@ static void tree_element_object_activate(bContext *C, * see #55246. */ if ((scene->toolsettings->object_flag & SCE_OBJECT_MODE_LOCK) ? (ob->mode == OB_MODE_OBJECT) : - true) { + true) + { BKE_view_layer_base_deselect_all(scene, view_layer); } ED_object_base_select(base, BA_SELECT); @@ -564,7 +567,8 @@ static void tree_element_bone_activate(bContext *C, if (set != OL_SETSEL_EXTEND) { /* single select forces all other bones to get unselected */ for (Bone *bone_iter = static_cast(arm->bonebase.first); bone_iter != nullptr; - bone_iter = bone_iter->next) { + bone_iter = bone_iter->next) + { bone_iter->flag &= ~(BONE_TIPSEL | BONE_SELECTED | BONE_ROOTSEL); do_outliner_bone_select_recursive(arm, bone_iter, false); } @@ -1400,7 +1404,8 @@ static void do_outliner_item_activate_tree_element(bContext *C, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP, TSE_EBONE, - TSE_LAYER_COLLECTION)) { + TSE_LAYER_COLLECTION)) + { /* Note about TSE_EBONE: In case of a same ID_AR datablock shared among several * objects, we do not want to switch out of edit mode (see #48328 for details). */ } @@ -1641,7 +1646,8 @@ static int outliner_item_do_activate_from_cursor(bContext *C, } /* Don't allow toggle on scene collection */ else if ((TREESTORE(te)->type != TSE_VIEW_COLLECTION_BASE) && - outliner_item_is_co_within_close_toggle(te, view_mval[0])) { + outliner_item_is_co_within_close_toggle(te, view_mval[0])) + { return OPERATOR_CANCELLED | OPERATOR_PASS_THROUGH; } else { diff --git a/source/blender/editors/space_outliner/outliner_sync.cc b/source/blender/editors/space_outliner/outliner_sync.cc index a1991c6a762..c594559f7db 100644 --- a/source/blender/editors/space_outliner/outliner_sync.cc +++ b/source/blender/editors/space_outliner/outliner_sync.cc @@ -78,7 +78,8 @@ void ED_outliner_select_sync_flag_outliners(const bContext *C) wmWindowManager *wm = CTX_wm_manager(C); for (bScreen *screen = static_cast(bmain->screens.first); screen; - screen = static_cast(screen->id.next)) { + screen = static_cast(screen->id.next)) + { LISTBASE_FOREACH (ScrArea *, area, &screen->areabase) { LISTBASE_FOREACH (SpaceLink *, sl, &area->spacedata) { if (sl->spacetype == SPACE_OUTLINER) { @@ -351,7 +352,8 @@ void ED_outliner_select_sync_from_outliner(bContext *C, SpaceOutliner *space_out SO_LIBRARIES, SO_OVERRIDES_LIBRARY, SO_DATA_API, - SO_ID_ORPHANS)) { + SO_ID_ORPHANS)) + { return; } diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index 608a32ffef6..dce90348b2d 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -571,7 +571,8 @@ static void outliner_do_libdata_operation_selection_set(bContext *C, bool is_selected = tselem->flag & TSE_SELECTED; if ((is_selected && do_selected) || (has_parent_selected && do_content)) { if (((tselem->type == TSE_SOME_ID) && (element->idcode != 0)) || - tselem->type == TSE_LAYER_COLLECTION) { + tselem->type == TSE_LAYER_COLLECTION) + { TreeStoreElem *tsep = element->parent ? TREESTORE(element->parent) : nullptr; operation_fn(C, reports, scene, element, tsep, tselem, user_data); } @@ -906,7 +907,8 @@ static void outliner_object_delete_fn(bContext *C, ReportList *reports, Scene *s return; } if (ID_REAL_USERS(ob) <= 1 && ID_EXTRA_USERS(ob) == 0 && - BKE_library_ID_is_indirectly_used(bmain, ob)) { + BKE_library_ID_is_indirectly_used(bmain, ob)) + { BKE_reportf(reports, RPT_WARNING, "Cannot delete object '%s' from scene '%s', indirectly used objects need at " @@ -1036,7 +1038,8 @@ static void id_override_library_create_hierarchy_pre_process_fn(bContext *C, ID *id_root_reference = tselem->id; if (!BKE_idtype_idcode_is_linkable(GS(id_root_reference->name)) || - (id_root_reference->flag & (LIB_EMBEDDED_DATA | LIB_EMBEDDED_DATA_LIB_OVERRIDE)) != 0) { + (id_root_reference->flag & (LIB_EMBEDDED_DATA | LIB_EMBEDDED_DATA_LIB_OVERRIDE)) != 0) + { return; } @@ -1065,7 +1068,8 @@ static void id_override_library_create_hierarchy_pre_process_fn(bContext *C, ID *id_instance_hint = nullptr; bool is_override_instancing_object = false; if (tsep != nullptr && tsep->type == TSE_SOME_ID && tsep->id != nullptr && - GS(tsep->id->name) == ID_OB && !ID_IS_OVERRIDE_LIBRARY(tsep->id)) { + GS(tsep->id->name) == ID_OB && !ID_IS_OVERRIDE_LIBRARY(tsep->id)) + { Object *ob = reinterpret_cast(tsep->id); if (ob->type == OB_EMPTY && &ob->instance_collection->id == id_root_reference) { BLI_assert(GS(id_root_reference->name) == ID_GR); @@ -1077,7 +1081,8 @@ static void id_override_library_create_hierarchy_pre_process_fn(bContext *C, } if (!ID_IS_OVERRIDABLE_LIBRARY(id_root_reference) && - !(ID_IS_LINKED(id_root_reference) && do_hierarchy)) { + !(ID_IS_LINKED(id_root_reference) && do_hierarchy)) + { return; } @@ -1107,8 +1112,8 @@ static void id_override_library_create_hierarchy_pre_process_fn(bContext *C, * access its hierarchy root directly. */ if (!ID_IS_LINKED(id_current_hierarchy_root) && ID_IS_OVERRIDE_LIBRARY_REAL(id_current_hierarchy_root) && - id_current_hierarchy_root->override_library->reference->lib == - id_root_reference->lib) { + id_current_hierarchy_root->override_library->reference->lib == id_root_reference->lib) + { id_hierarchy_root_reference = id_current_hierarchy_root->override_library->hierarchy_root; BLI_assert(ID_IS_OVERRIDE_LIBRARY_REAL(id_hierarchy_root_reference)); @@ -1157,7 +1162,8 @@ static void id_override_library_create_hierarchy_pre_process_fn(bContext *C, (!ID_IS_LINKED(id_hierarchy_root_reference) && ID_IS_OVERRIDE_LIBRARY_REAL(id_hierarchy_root_reference) && id_hierarchy_root_reference->override_library->reference->lib == - id_root_reference->lib))) { + id_root_reference->lib))) + { BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false); BKE_reportf(reports, RPT_WARNING, @@ -1322,7 +1328,8 @@ static void id_override_library_create_hierarchy_process(bContext *C, continue; } if (data.selected_id_uid.contains(id_iter->override_library->reference->session_uuid) || - data.selected_id_uid.contains(id_iter->session_uuid)) { + data.selected_id_uid.contains(id_iter->session_uuid)) + { id_iter->override_library->flag &= ~IDOVERRIDE_LIBRARY_FLAG_SYSTEM_DEFINED; } } @@ -2180,7 +2187,8 @@ static void outliner_batch_delete_object_tag(ReportList *reports, /* FIXME: This code checking object user-count won't work as expected if a same object belongs to * more than one collection in the scene. */ if (ID_REAL_USERS(object) <= 1 && ID_EXTRA_USERS(object) == 0 && - BKE_library_ID_is_indirectly_used(bmain, object)) { + BKE_library_ID_is_indirectly_used(bmain, object)) + { BKE_reportf(reports, RPT_WARNING, "Cannot delete object '%s' from scene '%s', indirectly used objects need at least " @@ -2205,12 +2213,14 @@ static void outliner_batch_delete_object_hierarchy_tag( * deletable. */ for (Base *base_iter = static_cast(BKE_view_layer_object_bases_get(view_layer)->first); base_iter != nullptr; - base_iter = base_iter->next) { + base_iter = base_iter->next) + { Object *parent_ob_iter; for (parent_ob_iter = base_iter->object->parent; (parent_ob_iter != nullptr && parent_ob_iter != object && (parent_ob_iter->id.tag & LIB_TAG_DOIT) == 0); - parent_ob_iter = parent_ob_iter->parent) { + parent_ob_iter = parent_ob_iter->parent) + { /* pass */ } if (parent_ob_iter != nullptr) { @@ -2223,7 +2233,8 @@ static void outliner_batch_delete_object_hierarchy_tag( for (parent_ob_iter = base_iter->object; (parent_ob_iter != nullptr && parent_ob_iter != object && (parent_ob_iter->id.tag & LIB_TAG_DOIT) == 0); - parent_ob_iter = parent_ob_iter->parent) { + parent_ob_iter = parent_ob_iter->parent) + { outliner_batch_delete_object_tag(reports, bmain, scene, parent_ob_iter); } } @@ -2454,8 +2465,8 @@ static TreeTraversalAction outliner_collect_objects_to_delete(TreeElement *te, v return TRAVERSE_CONTINUE; } - if ((tselem->type != TSE_SOME_ID) || (tselem->id == nullptr) || - (GS(tselem->id->name) != ID_OB)) { + if ((tselem->type != TSE_SOME_ID) || (tselem->id == nullptr) || (GS(tselem->id->name) != ID_OB)) + { return TRAVERSE_SKIP_CHILDS; } diff --git a/source/blender/editors/space_outliner/outliner_tree.cc b/source/blender/editors/space_outliner/outliner_tree.cc index d363ec4e8ea..06a2fa8aa25 100644 --- a/source/blender/editors/space_outliner/outliner_tree.cc +++ b/source/blender/editors/space_outliner/outliner_tree.cc @@ -701,7 +701,8 @@ static void outliner_add_id_contents(SpaceOutliner *space_outliner, /* do not extend Armature when we have posemode */ tselem = TREESTORE(te->parent); if (TSE_IS_REAL_ID(tselem) && GS(tselem->id->name) == ID_OB && - ((Object *)tselem->id)->mode & OB_MODE_POSE) { + ((Object *)tselem->id)->mode & OB_MODE_POSE) + { /* pass */ } else { @@ -869,7 +870,8 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner, else if (ELEM(type, TSE_LIBRARY_OVERRIDE_BASE, TSE_LIBRARY_OVERRIDE, - TSE_LIBRARY_OVERRIDE_OPERATION)) { + TSE_LIBRARY_OVERRIDE_OPERATION)) + { if (!te->abstract_element) { BLI_assert_msg(0, "Expected override types to be ported to new Outliner tree-element design"); @@ -912,7 +914,8 @@ TreeElement *outliner_add_element(SpaceOutliner *space_outliner, TSE_SEQUENCE, TSE_SEQ_STRIP, TSE_SEQUENCE_DUP, - TSE_GENERIC_LABEL)) { + TSE_GENERIC_LABEL)) + { BLI_assert_msg(false, "Element type should already use new AbstractTreeElement design"); } @@ -992,8 +995,8 @@ static int treesort_alpha_ob(const void *v1, const void *v2) if (comp == 3) { /* Among objects first come the ones in the collection, followed by the ones not on it. * This way we can have the dashed lines in a separate style connecting the former. */ - if ((x1->te->flag & TE_CHILD_NOT_IN_COLLECTION) != - (x2->te->flag & TE_CHILD_NOT_IN_COLLECTION)) { + if ((x1->te->flag & TE_CHILD_NOT_IN_COLLECTION) != (x2->te->flag & TE_CHILD_NOT_IN_COLLECTION)) + { return (x1->te->flag & TE_CHILD_NOT_IN_COLLECTION) ? 1 : -1; } @@ -1093,7 +1096,8 @@ static void outliner_sort(ListBase *lb) /* Sorting rules; only object lists, ID lists, or deform-groups. */ if (ELEM(last_tselem->type, TSE_DEFGROUP, TSE_ID_BASE) || - ((last_tselem->type == TSE_SOME_ID) && (last_te->idcode == ID_OB))) { + ((last_tselem->type == TSE_SOME_ID) && (last_te->idcode == ID_OB))) + { int totelem = BLI_listbase_count(lb); if (totelem > 1) { @@ -1288,7 +1292,8 @@ static TreeElement *outliner_find_first_desired_element_at_y(const SpaceOutliner bool (*callback_test)(TreeElement *); if ((space_outliner->outlinevis == SO_VIEW_LAYER) && - (space_outliner->filter & SO_FILTER_NO_COLLECTION)) { + (space_outliner->filter & SO_FILTER_NO_COLLECTION)) + { callback_test = test_object_callback; } else { @@ -1493,14 +1498,16 @@ static bool outliner_element_visible_get(const Scene *scene, } if ((te->parent != nullptr) && (TREESTORE(te->parent)->type == TSE_SOME_ID) && - (te->parent->idcode == ID_OB)) { + (te->parent->idcode == ID_OB)) + { if (exclude_filter & SO_FILTER_NO_CHILDREN) { return false; } } } else if ((te->parent != nullptr) && (TREESTORE(te->parent)->type == TSE_SOME_ID) && - (te->parent->idcode == ID_OB)) { + (te->parent->idcode == ID_OB)) + { if (exclude_filter & SO_FILTER_NO_OB_CONTENT) { return false; } @@ -1602,8 +1609,8 @@ static int outliner_filter_subtree(SpaceOutliner *space_outliner, if (!TSELEM_OPEN(tselem, space_outliner) || outliner_filter_subtree( - space_outliner, scene, view_layer, &te->subtree, search_string, exclude_filter) == - 0) { + space_outliner, scene, view_layer, &te->subtree, search_string, exclude_filter) == 0) + { outliner_free_tree_element(te, lb); } } @@ -1681,7 +1688,8 @@ void outliner_build_tree(Main *mainvar, } if (space_outliner->runtime->tree_hash && (space_outliner->storeflag & SO_TREESTORE_REBUILD) && - space_outliner->treestore) { + space_outliner->treestore) + { space_outliner->runtime->tree_hash->rebuild_from_treestore(*space_outliner->treestore); } space_outliner->storeflag &= ~SO_TREESTORE_REBUILD; diff --git a/source/blender/editors/space_outliner/outliner_utils.cc b/source/blender/editors/space_outliner/outliner_utils.cc index 73ace155033..3b3e451f055 100644 --- a/source/blender/editors/space_outliner/outliner_utils.cc +++ b/source/blender/editors/space_outliner/outliner_utils.cc @@ -52,7 +52,8 @@ void outliner_viewcontext_init(const bContext *C, TreeViewContext *tvc) if ((tvc->obact->type == OB_ARMATURE) || /* This could be made into its own function. */ - ((tvc->obact->type == OB_MESH) && tvc->obact->mode & OB_MODE_WEIGHT_PAINT)) { + ((tvc->obact->type == OB_MESH) && tvc->obact->mode & OB_MODE_WEIGHT_PAINT)) + { tvc->ob_pose = BKE_object_pose_armature_get(tvc->obact); } } @@ -294,7 +295,8 @@ bool outliner_tree_traverse(const SpaceOutliner *space_outliner, /* skip */ } else if (!outliner_tree_traverse( - space_outliner, &subtree, filter_te_flag, filter_tselem_flag, func, customdata)) { + space_outliner, &subtree, filter_te_flag, filter_tselem_flag, func, customdata)) + { return false; } } diff --git a/source/blender/editors/space_outliner/space_outliner.cc b/source/blender/editors/space_outliner/space_outliner.cc index 3fddd96c004..54a9fc506a4 100644 --- a/source/blender/editors/space_outliner/space_outliner.cc +++ b/source/blender/editors/space_outliner/space_outliner.cc @@ -261,7 +261,8 @@ static void outliner_main_region_listener(const wmRegionListenerParams *params) break; case NC_NODE: if (ELEM(wmn->action, NA_ADDED, NA_REMOVED) && - ELEM(space_outliner->outlinevis, SO_LIBRARIES, SO_DATA_API)) { + ELEM(space_outliner->outlinevis, SO_LIBRARIES, SO_DATA_API)) + { ED_region_tag_redraw(region); } break; diff --git a/source/blender/editors/space_outliner/tree/tree_display_override_library_hierarchies.cc b/source/blender/editors/space_outliner/tree/tree_display_override_library_hierarchies.cc index 2150d2b211a..73537d736bc 100644 --- a/source/blender/editors/space_outliner/tree/tree_display_override_library_hierarchies.cc +++ b/source/blender/editors/space_outliner/tree/tree_display_override_library_hierarchies.cc @@ -55,7 +55,8 @@ ListBase TreeDisplayOverrideLibraryHierarchies::buildTree(const TreeSourceData & /* Second step: Build hierarchies for external libraries. */ for (Library *lib = (Library *)source_data.bmain->libraries.first; lib; - lib = (Library *)lib->id.next) { + lib = (Library *)lib->id.next) + { TreeElement *tenlib = outliner_add_element( &space_outliner_, &tree, lib, nullptr, TSE_SOME_ID, 0); build_hierarchy_for_lib_or_main(source_data.bmain, *tenlib, lib); @@ -264,7 +265,8 @@ static void foreach_natural_hierarchy_child(const MainIDRelations &id_relations, /* Iterate over all IDs used by the parent ID (e.g. the child-collections of a collection). */ for (MainIDRelationsEntryItem *to_id_entry = relations_of_id->to_ids; to_id_entry; - to_id_entry = to_id_entry->next) { + to_id_entry = to_id_entry->next) + { /* An ID pointed to (used) by the ID to recurse into. */ ID &target_id = **to_id_entry->id_pointer.to; @@ -293,7 +295,8 @@ static void foreach_natural_hierarchy_child(const MainIDRelations &id_relations, /* If the ID is an object, find and iterate over any child objects. */ if (GS(parent_id.name) == ID_OB) { for (MainIDRelationsEntryItem *from_id_entry = relations_of_id->from_ids; from_id_entry; - from_id_entry = from_id_entry->next) { + from_id_entry = from_id_entry->next) + { ID &potential_child_id = *from_id_entry->id_pointer.from; if (GS(potential_child_id.name) != ID_OB) { diff --git a/source/blender/editors/space_outliner/tree/tree_display_view_layer.cc b/source/blender/editors/space_outliner/tree/tree_display_view_layer.cc index 441ba3c85d0..29ebdb0c4d1 100644 --- a/source/blender/editors/space_outliner/tree/tree_display_view_layer.cc +++ b/source/blender/editors/space_outliner/tree/tree_display_view_layer.cc @@ -261,7 +261,8 @@ void ObjectsChildrenBuilder::make_object_parent_hierarchy_collections() parent_ob_collection_tree_element = parent_ob_tree_element->parent; while (!ELEM(TREESTORE(parent_ob_collection_tree_element)->type, TSE_VIEW_COLLECTION_BASE, - TSE_LAYER_COLLECTION)) { + TSE_LAYER_COLLECTION)) + { parent_ob_collection_tree_element = parent_ob_collection_tree_element->parent; } diff --git a/source/blender/editors/space_outliner/tree/tree_element_overrides.cc b/source/blender/editors/space_outliner/tree/tree_element_overrides.cc index 11067d37966..4136764605f 100644 --- a/source/blender/editors/space_outliner/tree/tree_element_overrides.cc +++ b/source/blender/editors/space_outliner/tree/tree_element_overrides.cc @@ -60,7 +60,8 @@ TreeElementOverridesBase::TreeElementOverridesBase(TreeElement &legacy_te, ID &i { BLI_assert(legacy_te.store_elem->type == TSE_LIBRARY_OVERRIDE_BASE); if (legacy_te.parent != nullptr && - ELEM(legacy_te.parent->store_elem->type, TSE_SOME_ID, TSE_LAYER_COLLECTION)) { + ELEM(legacy_te.parent->store_elem->type, TSE_SOME_ID, TSE_LAYER_COLLECTION)) + { legacy_te.name = IFACE_("Library Overrides"); } else { @@ -92,7 +93,8 @@ static void iterate_properties_to_display(ID &id, RNA_id_pointer_create(&id, &idpoin); for (IDOverrideLibraryProperty *override_prop : - ListBaseWrapper(id.override_library->properties)) { + ListBaseWrapper(id.override_library->properties)) + { int rnaprop_index = 0; const bool is_rna_path_valid = BKE_lib_override_rna_property_find( &idpoin, override_prop, &override_rna_ptr, &override_rna_prop, &rnaprop_index); @@ -105,9 +107,11 @@ static void iterate_properties_to_display(ID &id, /* Matching ID pointers are considered as system overrides. */ if (ELEM(override_prop->rna_prop_type, PROP_POINTER, PROP_COLLECTION) && - RNA_struct_is_ID(RNA_property_pointer_type(&override_rna_ptr, override_rna_prop))) { + RNA_struct_is_ID(RNA_property_pointer_type(&override_rna_ptr, override_rna_prop))) + { for (IDOverrideLibraryPropertyOperation *override_prop_op : - ListBaseWrapper(override_prop->operations)) { + ListBaseWrapper(override_prop->operations)) + { if ((override_prop_op->flag & IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE) == 0) { do_skip = false; break; @@ -118,7 +122,8 @@ static void iterate_properties_to_display(ID &id, /* Animated/driven properties are considered as system overrides. */ if (!is_system_override && !BKE_lib_override_library_property_is_animated( - &id, override_prop, override_rna_prop, rnaprop_index)) { + &id, override_prop, override_rna_prop, rnaprop_index)) + { do_skip = false; } @@ -225,7 +230,8 @@ StringRefNull TreeElementOverridesPropertyOperation::getOverrideOperationLabel() { if (ELEM(operation_->operation, IDOVERRIDE_LIBRARY_OP_INSERT_AFTER, - IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE)) { + IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE)) + { return TIP_("Added through override"); } @@ -248,7 +254,8 @@ std::optional TreeElementOverridesPropertyOperation::get_collection_ if (RNA_property_collection_lookup_int(const_cast(&override_rna_ptr), &override_rna_prop, operation_->subitem_local_index, - &col_item_ptr)) { + &col_item_ptr)) + { return col_item_ptr; } diff --git a/source/blender/editors/space_sequencer/sequencer_add.c b/source/blender/editors/space_sequencer/sequencer_add.c index 87b733168bf..7dbb52e714d 100644 --- a/source/blender/editors/space_sequencer/sequencer_add.c +++ b/source/blender/editors/space_sequencer/sequencer_add.c @@ -202,7 +202,8 @@ static int sequencer_generic_invoke_xy_guess_channel(bContext *C, int type) for (seq = ed->seqbasep->first; seq; seq = seq->next) { const int strip_end = SEQ_time_right_handle_frame_get(scene, seq); if (ELEM(type, -1, seq->type) && (strip_end <= timeline_frame) && - (timeline_frame - strip_end < proximity)) { + (timeline_frame - strip_end < proximity)) + { tgt = seq; proximity = timeline_frame - strip_end; } @@ -303,17 +304,20 @@ static void load_data_init_from_operator(SeqLoadData *load_data, bContext *C, wm } if ((prop = RNA_struct_find_property(op->ptr, "use_framerate")) && - RNA_property_boolean_get(op->ptr, prop)) { + RNA_property_boolean_get(op->ptr, prop)) + { load_data->flags |= SEQ_LOAD_MOVIE_SYNC_FPS; } if ((prop = RNA_struct_find_property(op->ptr, "set_view_transform")) && - RNA_property_boolean_get(op->ptr, prop)) { + RNA_property_boolean_get(op->ptr, prop)) + { load_data->flags |= SEQ_LOAD_SET_VIEW_TRANSFORM; } if ((prop = RNA_struct_find_property(op->ptr, "use_multiview")) && - RNA_property_boolean_get(op->ptr, prop)) { + RNA_property_boolean_get(op->ptr, prop)) + { if (op->customdata) { SequencerAddData *sad = op->customdata; ImageFormatData *imf = &sad->im_format; @@ -340,7 +344,8 @@ static void seq_load_apply_generic_options(bContext *C, wmOperator *op, Sequence } if (RNA_boolean_get(op->ptr, "overlap") == true || - !SEQ_transform_test_overlap(scene, ed->seqbasep, seq)) { + !SEQ_transform_test_overlap(scene, ed->seqbasep, seq)) + { /* No overlap should be handled or the strip is not overlapping, exit early. */ return; } @@ -996,7 +1001,8 @@ static int sequencer_add_movie_strip_invoke(bContext *C, /* This is for drag and drop. */ if ((RNA_struct_property_is_set(op->ptr, "files") && !RNA_collection_is_empty(op->ptr, "files")) || - RNA_struct_property_is_set(op->ptr, "filepath")) { + RNA_struct_property_is_set(op->ptr, "filepath")) + { sequencer_generic_invoke_xy__internal(C, op, SEQPROP_NOPATHS, SEQ_TYPE_MOVIE); return sequencer_add_movie_strip_exec(C, op); } @@ -1153,7 +1159,8 @@ static int sequencer_add_sound_strip_invoke(bContext *C, /* This is for drag and drop. */ if ((RNA_struct_property_is_set(op->ptr, "files") && !RNA_collection_is_empty(op->ptr, "files")) || - RNA_struct_property_is_set(op->ptr, "filepath")) { + RNA_struct_property_is_set(op->ptr, "filepath")) + { sequencer_generic_invoke_xy__internal(C, op, SEQPROP_NOPATHS, SEQ_TYPE_SOUND_RAM); return sequencer_add_sound_strip_exec(C, op); } diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c index c650ebf27f7..b9c9bd6423f 100644 --- a/source/blender/editors/space_sequencer/sequencer_draw.c +++ b/source/blender/editors/space_sequencer/sequencer_draw.c @@ -100,7 +100,8 @@ void color3ubv_from_seq(const Scene *curscene, ListBase *channels = SEQ_channels_displayed_get(ed); if (show_strip_color_tag && (uint)seq->color_tag < SEQUENCE_COLOR_TOT && - seq->color_tag != SEQUENCE_COLOR_NONE) { + seq->color_tag != SEQUENCE_COLOR_NONE) + { bTheme *btheme = UI_GetTheme(); const ThemeStripColor *strip_color = &btheme->strip_color[seq->color_tag]; copy_v3_v3_uchar(r_col, strip_color->color); @@ -693,7 +694,8 @@ static void draw_seq_handle(const Scene *scene, /* Draw numbers for start and end of the strip next to its handles. */ if (y_threshold && - (((seq->flag & SELECT) && (G.moving & G_TRANSFORM_SEQ)) || (seq->flag & whichsel))) { + (((seq->flag & SELECT) && (G.moving & G_TRANSFORM_SEQ)) || (seq->flag & whichsel))) + { char numstr[64]; size_t numstr_len; @@ -1253,8 +1255,8 @@ static void draw_seq_fcurve_overlay( float prev_val = INT_MIN; bool skip = false; - for (int timeline_frame = eval_start; timeline_frame <= eval_end; - timeline_frame += eval_step) { + for (int timeline_frame = eval_start; timeline_frame <= eval_end; timeline_frame += eval_step) + { curve_val = evaluate_fcurve(fcu, timeline_frame); CLAMP(curve_val, 0.0f, 1.0f); @@ -1330,7 +1332,8 @@ static void draw_seq_strip(const bContext *C, bool y_threshold; if ((sseq->timeline_overlay.flag & SEQ_TIMELINE_SHOW_STRIP_NAME) || (sseq->timeline_overlay.flag & SEQ_TIMELINE_SHOW_STRIP_SOURCE) || - (sseq->timeline_overlay.flag & SEQ_TIMELINE_SHOW_STRIP_DURATION)) { + (sseq->timeline_overlay.flag & SEQ_TIMELINE_SHOW_STRIP_DURATION)) + { /* Calculate height needed for drawing text on strip. */ text_margin_y = y2 - min_ff(0.40f, 20 * UI_SCALE_FAC * pixely); @@ -1368,19 +1371,21 @@ static void draw_seq_strip(const bContext *C, x2 = SEQ_time_right_handle_frame_get(scene, seq); if ((seq->type == SEQ_TYPE_META) || - ((seq->type == SEQ_TYPE_SCENE) && (seq->flag & SEQ_SCENE_STRIPS))) { + ((seq->type == SEQ_TYPE_SCENE) && (seq->flag & SEQ_SCENE_STRIPS))) + { drawmeta_contents(scene, seq, x1, y1, x2, y2, show_strip_color_tag); } if ((sseq->flag & SEQ_SHOW_OVERLAY) && (sseq->timeline_overlay.flag & SEQ_TIMELINE_SHOW_THUMBNAILS) && - ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE)) { + ELEM(seq->type, SEQ_TYPE_MOVIE, SEQ_TYPE_IMAGE)) + { draw_seq_strip_thumbnail( v2d, C, scene, seq, y1, y_threshold ? text_margin_y : y2, pixelx, pixely); } - if ((sseq->flag & SEQ_SHOW_OVERLAY) && - (sseq->timeline_overlay.flag & SEQ_TIMELINE_SHOW_FCURVES)) { + if ((sseq->flag & SEQ_SHOW_OVERLAY) && (sseq->timeline_overlay.flag & SEQ_TIMELINE_SHOW_FCURVES)) + { draw_seq_fcurve_overlay(scene, v2d, seq, x1, y1, x2, y2, pixelx); } @@ -1419,7 +1424,8 @@ static void draw_seq_strip(const bContext *C, if (seq->type == SEQ_TYPE_SOUND_RAM) { if (!y_threshold && (sseq->timeline_overlay.flag & SEQ_TIMELINE_NO_WAVEFORMS) == 0 && ((sseq->timeline_overlay.flag & SEQ_TIMELINE_ALL_WAVEFORMS) || - (seq->flag & SEQ_AUDIO_DRAW_WAVEFORM))) { + (seq->flag & SEQ_AUDIO_DRAW_WAVEFORM))) + { return; } } @@ -2079,7 +2085,8 @@ static void seq_draw_image_origin_and_outline(const bContext *C, Sequence *seq, return; } if ((sseq->flag & SEQ_SHOW_OVERLAY) == 0 || - (sseq->preview_overlay.flag & SEQ_PREVIEW_SHOW_OUTLINE_SELECTED) == 0) { + (sseq->preview_overlay.flag & SEQ_PREVIEW_SHOW_OUTLINE_SELECTED) == 0) + { return; } if (ELEM(sseq->mainb, SEQ_DRAW_IMG_WAVEFORM, SEQ_DRAW_IMG_VECTORSCOPE, SEQ_DRAW_IMG_HISTOGRAM)) { @@ -2184,7 +2191,8 @@ void sequencer_draw_preview(const bContext *C, /* Draw background. */ if (!draw_backdrop && - (!draw_overlay || (sseq->overlay_frame_type == SEQ_OVERLAY_FRAME_TYPE_REFERENCE))) { + (!draw_overlay || (sseq->overlay_frame_type == SEQ_OVERLAY_FRAME_TYPE_REFERENCE))) + { sequencer_preview_clear(); if (sseq->flag & SEQ_USE_ALPHA) { @@ -2286,11 +2294,13 @@ static void draw_seq_strips(const bContext *C, Editing *ed, ARegion *region) continue; } if (min_ii(SEQ_time_left_handle_frame_get(scene, seq), SEQ_time_start_frame_get(seq)) > - v2d->cur.xmax) { + v2d->cur.xmax) + { continue; } if (max_ii(SEQ_time_right_handle_frame_get(scene, seq), - SEQ_time_content_end_frame_get(scene, seq)) < v2d->cur.xmin) { + SEQ_time_content_end_frame_get(scene, seq)) < v2d->cur.xmin) + { continue; } if (seq->machine + 1.0f < v2d->cur.ymin) { @@ -2488,7 +2498,8 @@ static bool draw_cache_view_iter_fn(void *userdata, vert_count = &drawdata->raw_vert_count; } else if ((cache_type & SEQ_CACHE_STORE_PREPROCESSED) && - (drawdata->cache_flag & SEQ_CACHE_VIEW_PREPROCESSED)) { + (drawdata->cache_flag & SEQ_CACHE_VIEW_PREPROCESSED)) + { stripe_ofs_y = drawdata->stripe_ofs_y; stripe_ht = drawdata->stripe_ht; stripe_bot = seq->machine + SEQ_STRIP_OFSBOTTOM + (stripe_ofs_y + stripe_ht) + stripe_ofs_y; @@ -2497,7 +2508,8 @@ static bool draw_cache_view_iter_fn(void *userdata, vert_count = &drawdata->preprocessed_vert_count; } else if ((cache_type & SEQ_CACHE_STORE_COMPOSITE) && - (drawdata->cache_flag & SEQ_CACHE_VIEW_COMPOSITE)) { + (drawdata->cache_flag & SEQ_CACHE_VIEW_COMPOSITE)) + { stripe_ofs_y = drawdata->stripe_ofs_y; stripe_ht = drawdata->stripe_ht; stripe_top = seq->machine + SEQ_STRIP_OFSTOP - stripe_ofs_y; @@ -2575,7 +2587,8 @@ static void draw_cache_view(const bContext *C) } if (SEQ_time_left_handle_frame_get(scene, seq) > v2d->cur.xmax || - SEQ_time_right_handle_frame_get(scene, seq) < v2d->cur.xmin) { + SEQ_time_right_handle_frame_get(scene, seq) < v2d->cur.xmin) + { continue; } diff --git a/source/blender/editors/space_sequencer/sequencer_edit.c b/source/blender/editors/space_sequencer/sequencer_edit.c index feccd21cf79..02f9b7a3e67 100644 --- a/source/blender/editors/space_sequencer/sequencer_edit.c +++ b/source/blender/editors/space_sequencer/sequencer_edit.c @@ -219,7 +219,8 @@ bool sequencer_view_has_preview_poll(bContext *C) return false; } if (!(ELEM(sseq->view, SEQ_VIEW_PREVIEW, SEQ_VIEW_SEQUENCE_PREVIEW) && - (sseq->mainb == SEQ_DRAW_IMG_IMBUF))) { + (sseq->mainb == SEQ_DRAW_IMG_IMBUF))) + { return false; } ARegion *region = CTX_wm_region(C); @@ -372,7 +373,8 @@ static int sequencer_snap_exec(bContext *C, wmOperator *op) /* Check meta-strips. */ for (seq = ed->seqbasep->first; seq; seq = seq->next) { if (seq->flag & SELECT && !SEQ_transform_is_locked(channels, seq) && - SEQ_transform_sequence_can_be_translated(seq)) { + SEQ_transform_sequence_can_be_translated(seq)) + { if ((seq->flag & (SEQ_LEFTSEL + SEQ_RIGHTSEL)) == 0) { SEQ_transform_translate_sequence(scene, seq, (snap_frame - seq->startofs) - seq->start); } @@ -1256,14 +1258,16 @@ static int sequencer_reassign_inputs_exec(bContext *C, wmOperator *op) if (!seq_effect_find_selected( scene, last_seq, last_seq->type, &seq1, &seq2, &seq3, &error_msg) || - SEQ_effect_get_num_inputs(last_seq->type) == 0) { + SEQ_effect_get_num_inputs(last_seq->type) == 0) + { BKE_report(op->reports, RPT_ERROR, error_msg); return OPERATOR_CANCELLED; } /* Check if reassigning would create recursivity. */ if (SEQ_relations_render_loop_check(seq1, last_seq) || SEQ_relations_render_loop_check(seq2, last_seq) || - SEQ_relations_render_loop_check(seq3, last_seq)) { + SEQ_relations_render_loop_check(seq3, last_seq)) + { BKE_report(op->reports, RPT_ERROR, "Cannot reassign inputs: recursion detected"); return OPERATOR_CANCELLED; } @@ -2220,7 +2224,8 @@ static Sequence *find_next_prev_sequence(Scene *scene, Sequence *test, int lr, i seq = ed->seqbasep->first; while (seq) { if ((seq != test) && (test->machine == seq->machine) && - ((sel == -1) || (sel == (seq->flag & SELECT)))) { + ((sel == -1) || (sel == (seq->flag & SELECT)))) + { dist = MAXFRAME * 2; switch (lr) { @@ -2278,11 +2283,13 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op) /* Disallow effect strips. */ if (SEQ_effect_get_num_inputs(seq->type) >= 1 && - (seq->effectdata || seq->seq1 || seq->seq2 || seq->seq3)) { + (seq->effectdata || seq->seq1 || seq->seq2 || seq->seq3)) + { return OPERATOR_CANCELLED; } if ((SEQ_effect_get_num_inputs(active_seq->type) >= 1) && - (active_seq->effectdata || active_seq->seq1 || active_seq->seq2 || active_seq->seq3)) { + (active_seq->effectdata || active_seq->seq1 || active_seq->seq2 || active_seq->seq3)) + { return OPERATOR_CANCELLED; } @@ -2298,7 +2305,8 @@ static int sequencer_swap_exec(bContext *C, wmOperator *op) /* Do this in a new loop since both effects need to be calculated first. */ for (iseq = seqbase->first; iseq; iseq = iseq->next) { if ((iseq->type & SEQ_TYPE_EFFECT) && - (seq_is_parent(iseq, active_seq) || seq_is_parent(iseq, seq))) { + (seq_is_parent(iseq, active_seq) || seq_is_parent(iseq, seq))) + { /* This may now overlap. */ if (SEQ_transform_test_overlap(scene, seqbase, iseq)) { SEQ_transform_seqbase_shuffle(seqbase, iseq, scene); @@ -3152,7 +3160,8 @@ static bool seq_get_text_strip_cb(Sequence *seq, void *user_data) ListBase *channels = SEQ_channels_displayed_get(ed); /* Only text strips that are not muted and don't end with negative frame. */ if ((seq->type == SEQ_TYPE_TEXT) && !SEQ_render_is_muted(channels, seq) && - (SEQ_time_right_handle_frame_get(cd->scene, seq) > cd->scene->r.sfra)) { + (SEQ_time_right_handle_frame_get(cd->scene, seq) > cd->scene->r.sfra)) + { BLI_addtail(cd->text_seq, MEM_dupallocN(seq)); } return true; diff --git a/source/blender/editors/space_sequencer/sequencer_gizmo_retime_type.cc b/source/blender/editors/space_sequencer/sequencer_gizmo_retime_type.cc index d622b624fa8..ece8557782e 100644 --- a/source/blender/editors/space_sequencer/sequencer_gizmo_retime_type.cc +++ b/source/blender/editors/space_sequencer/sequencer_gizmo_retime_type.cc @@ -380,7 +380,8 @@ static void retime_speed_text_draw(const bContext *C, int next_handle_index = SEQ_retiming_handle_index_get(seq, handle) + 1; const SeqRetimingHandle *next_handle = &SEQ_retiming_handles_get(seq)[next_handle_index]; if (handle_x_get(scene, seq, next_handle) < start_frame || - handle_x_get(scene, seq, handle) > end_frame) { + handle_x_get(scene, seq, handle) > end_frame) + { return; /* Label out of strip bounds. */ } @@ -456,7 +457,8 @@ static int gizmo_retime_handle_test_select(bContext *C, wmGizmo *gz, const int m } if (handle_x_get(scene, seq, handle) == SEQ_time_left_handle_frame_get(scene, seq) || - handle_index == 0) { + handle_index == 0) + { return -1; } @@ -532,7 +534,8 @@ static int gizmo_retime_remove_test_select(bContext *C, wmGizmo *gz, const int m } if (handle_x_get(scene, seq, handle) == SEQ_time_left_handle_frame_get(scene, seq) || - handle_index == 0) { + handle_index == 0) + { return -1; /* Ignore first handle. */ } diff --git a/source/blender/editors/space_sequencer/sequencer_select.c b/source/blender/editors/space_sequencer/sequencer_select.c index 6971d8dd06b..036afc4f428 100644 --- a/source/blender/editors/space_sequencer/sequencer_select.c +++ b/source/blender/editors/space_sequencer/sequencer_select.c @@ -271,8 +271,8 @@ Sequence *find_neighboring_sequence(Scene *scene, Sequence *test, int lr, int se for (seq = ed->seqbasep->first; seq; seq = seq->next) { if ((seq != test) && (test->machine == seq->machine) && - ((sel == -1) || (sel && (seq->flag & SELECT)) || - (sel == 0 && (seq->flag & SELECT) == 0))) { + ((sel == -1) || (sel && (seq->flag & SELECT)) || (sel == 0 && (seq->flag & SELECT) == 0))) + { switch (lr) { case SEQ_SIDE_LEFT: if (SEQ_time_left_handle_frame_get(scene, test) == @@ -322,7 +322,8 @@ Sequence *find_nearest_seq(Scene *scene, View2D *v2d, int *hand, const int mval[ ((SEQ_time_left_handle_frame_get(scene, seq) > SEQ_time_right_handle_frame_get(scene, seq)) && (SEQ_time_left_handle_frame_get(scene, seq) >= x && - SEQ_time_right_handle_frame_get(scene, seq) <= x))) { + SEQ_time_right_handle_frame_get(scene, seq) <= x))) + { if (SEQ_transform_sequence_can_be_translated(seq)) { /* Clamp handles to defined size in pixel space. */ @@ -592,7 +593,8 @@ static void sequencer_select_side_of_frame(const bContext *C, if (((x < scene->r.cfra) && (SEQ_time_right_handle_frame_get(scene, seq_iter) <= scene->r.cfra)) || ((x >= scene->r.cfra) && - (SEQ_time_left_handle_frame_get(scene, seq_iter) >= scene->r.cfra))) { + (SEQ_time_left_handle_frame_get(scene, seq_iter) >= scene->r.cfra))) + { /* Select left or right. */ seq_iter->flag |= SELECT; recurs_sel_seq(seq_iter); @@ -606,7 +608,8 @@ static void sequencer_select_side_of_frame(const bContext *C, for (tmarker = scene->markers.first; tmarker; tmarker = tmarker->next) { if (((x < scene->r.cfra) && (tmarker->frame <= scene->r.cfra)) || - ((x >= scene->r.cfra) && (tmarker->frame >= scene->r.cfra))) { + ((x >= scene->r.cfra) && (tmarker->frame >= scene->r.cfra))) + { tmarker->flag |= SELECT; } else { @@ -1874,8 +1877,8 @@ static bool select_grouped_type_effect(SeqCollection *strips, Sequence *seq; SEQ_ITERATOR_FOREACH (seq, strips) { - if (SEQ_CHANNEL_CHECK(seq, channel) && - (is_effect ? SEQ_IS_EFFECT(seq) : !SEQ_IS_EFFECT(seq))) { + if (SEQ_CHANNEL_CHECK(seq, channel) && (is_effect ? SEQ_IS_EFFECT(seq) : !SEQ_IS_EFFECT(seq))) + { seq->flag |= SELECT; changed = true; } @@ -1901,7 +1904,8 @@ static bool select_grouped_data(SeqCollection *strips, if (SEQ_HAS_PATH(actseq) && dir) { SEQ_ITERATOR_FOREACH (seq, strips) { if (SEQ_CHANNEL_CHECK(seq, channel) && SEQ_HAS_PATH(seq) && seq->strip && - STREQ(seq->strip->dir, dir)) { + STREQ(seq->strip->dir, dir)) + { seq->flag |= SELECT; changed = true; } @@ -1919,8 +1923,8 @@ static bool select_grouped_data(SeqCollection *strips, else if (actseq->type == SEQ_TYPE_MOVIECLIP) { MovieClip *clip = actseq->clip; SEQ_ITERATOR_FOREACH (seq, strips) { - if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == SEQ_TYPE_MOVIECLIP && - seq->clip == clip) { + if (SEQ_CHANNEL_CHECK(seq, channel) && seq->type == SEQ_TYPE_MOVIECLIP && seq->clip == clip) + { seq->flag |= SELECT; changed = true; } @@ -1954,7 +1958,8 @@ static bool select_grouped_effect(SeqCollection *strips, Sequence *seq; SEQ_ITERATOR_FOREACH (seq, strips) { if (SEQ_CHANNEL_CHECK(seq, channel) && (seq->type & SEQ_TYPE_EFFECT) && - SEQ_relation_is_effect_of_strip(seq, actseq)) { + SEQ_relation_is_effect_of_strip(seq, actseq)) + { effects[seq->type] = true; } } @@ -1989,7 +1994,8 @@ static bool select_grouped_time_overlap(const Scene *scene, if (SEQ_time_left_handle_frame_get(scene, seq) < SEQ_time_right_handle_frame_get(scene, actseq) && SEQ_time_right_handle_frame_get(scene, seq) > - SEQ_time_left_handle_frame_get(scene, actseq)) { + SEQ_time_left_handle_frame_get(scene, actseq)) + { seq->flag |= SELECT; changed = true; } @@ -2011,7 +2017,8 @@ static void query_lower_channel_strips(const Scene *scene, if (SEQ_time_right_handle_frame_get(scene, seq_test) <= SEQ_time_left_handle_frame_get(scene, seq_reference) || SEQ_time_left_handle_frame_get(scene, seq_test) >= - SEQ_time_right_handle_frame_get(scene, seq_reference)) { + SEQ_time_right_handle_frame_get(scene, seq_reference)) + { continue; /* Not intersecting in time. */ } SEQ_collection_append_strip(seq_test, collection); diff --git a/source/blender/editors/space_sequencer/sequencer_thumbnails.c b/source/blender/editors/space_sequencer/sequencer_thumbnails.c index 954465e590d..c20717dd386 100644 --- a/source/blender/editors/space_sequencer/sequencer_thumbnails.c +++ b/source/blender/editors/space_sequencer/sequencer_thumbnails.c @@ -75,11 +75,13 @@ static bool check_seq_need_thumbnails(const Scene *scene, Sequence *seq, rctf *v return false; } if (min_ii(SEQ_time_left_handle_frame_get(scene, seq), SEQ_time_start_frame_get(seq)) > - view_area->xmax) { + view_area->xmax) + { return false; } if (max_ii(SEQ_time_right_handle_frame_get(scene, seq), - SEQ_time_content_end_frame_get(scene, seq)) < view_area->xmin) { + SEQ_time_content_end_frame_get(scene, seq)) < view_area->xmin) + { return false; } if (seq->machine + 1.0f < view_area->ymin) { @@ -293,13 +295,15 @@ static void sequencer_thumbnail_start_job_if_necessary( /* Job start requested, but over area which has been processed. Unless `thumbnail_is_missing` is * true, ignore this request as all images are in view. */ if (v2d->cur.xmax == sseq->runtime.last_thumbnail_area.xmax && - v2d->cur.ymax == sseq->runtime.last_thumbnail_area.ymax && !thumbnail_is_missing) { + v2d->cur.ymax == sseq->runtime.last_thumbnail_area.ymax && !thumbnail_is_missing) + { return; } /* Stop the job first as view has changed. Pointless to continue old job. */ if (v2d->cur.xmax != sseq->runtime.last_thumbnail_area.xmax || - v2d->cur.ymax != sseq->runtime.last_thumbnail_area.ymax) { + v2d->cur.ymax != sseq->runtime.last_thumbnail_area.ymax) + { WM_jobs_stop(CTX_wm_manager(C), NULL, thumbnail_start_job); } diff --git a/source/blender/editors/space_sequencer/space_sequencer.c b/source/blender/editors/space_sequencer/space_sequencer.c index 25d1313f1a0..15d2e557957 100644 --- a/source/blender/editors/space_sequencer/space_sequencer.c +++ b/source/blender/editors/space_sequencer/space_sequencer.c @@ -274,7 +274,8 @@ static void sequencer_refresh(const bContext *C, ScrArea *area) } /* Final check that both preview and main height are reasonable. */ if (region_preview->sizey < 10 || region_main->sizey < 10 || - region_preview->sizey + region_main->sizey > height) { + region_preview->sizey + region_main->sizey > height) + { region_preview->sizey = roundf(height * 0.4f); region_main->sizey = (int)(height - region_preview->sizey); view_changed = true; @@ -751,7 +752,8 @@ static bool is_cursor_visible(const SpaceSeq *sseq) } if ((sseq->flag & SEQ_SHOW_OVERLAY) && - (sseq->preview_overlay.flag & SEQ_PREVIEW_SHOW_2D_CURSOR) != 0) { + (sseq->preview_overlay.flag & SEQ_PREVIEW_SHOW_2D_CURSOR) != 0) + { return true; } return false; @@ -783,8 +785,8 @@ static void sequencer_preview_region_draw(const bContext *C, ARegion *region) over_cfra = scene->r.cfra + scene->ed->overlay_frame_ofs; } - if ((over_cfra != scene->r.cfra) || - (sseq->overlay_frame_type != SEQ_OVERLAY_FRAME_TYPE_RECT)) { + if ((over_cfra != scene->r.cfra) || (sseq->overlay_frame_type != SEQ_OVERLAY_FRAME_TYPE_RECT)) + { sequencer_draw_preview( C, scene, region, sseq, scene->r.cfra, over_cfra - scene->r.cfra, true, false); } diff --git a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc index 7b39b39c78b..5ea179dcd9a 100644 --- a/source/blender/editors/space_spreadsheet/space_spreadsheet.cc +++ b/source/blender/editors/space_spreadsheet/space_spreadsheet.cc @@ -297,7 +297,8 @@ Object *spreadsheet_get_object_eval(const SpaceSpreadsheet *sspreadsheet, OB_VOLUME, OB_CURVES_LEGACY, OB_FONT, - OB_CURVES)) { + OB_CURVES)) + { return nullptr; } diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc index c20f6ac2f6a..24542f0c833 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc +++ b/source/blender/editors/space_spreadsheet/spreadsheet_data_source_geometry.cc @@ -235,7 +235,8 @@ std::unique_ptr GeometryDataSource::get_column_values( if (component_->type() == GEO_COMPONENT_TYPE_INSTANCES) { if (const bke::Instances *instances = - static_cast(*component_).get_for_read()) { + static_cast(*component_).get_for_read()) + { if (STREQ(column_id.name, "Name")) { Span reference_handles = instances->reference_handles(); Span references = instances->references(); @@ -265,7 +266,8 @@ std::unique_ptr GeometryDataSource::get_column_values( const MeshComponent &component = static_cast(*component_); if (const Mesh *mesh = component.get_for_read()) { if (std::unique_ptr values = build_mesh_debug_columns( - *mesh, domain_, column_id.name)) { + *mesh, domain_, column_id.name)) + { return values; } } @@ -525,7 +527,8 @@ GeometrySet spreadsheet_get_display_geometry_set(const SpaceSpreadsheet *sspread else { if (const ViewerNodeLog *viewer_log = nodes::geo_eval_log::GeoModifierLog::find_viewer_node_log_for_path( - sspreadsheet->viewer_path)) { + sspreadsheet->viewer_path)) + { geometry_set = viewer_log->geometry; } } diff --git a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc index 5007e859a0f..7d1dfc50cd2 100644 --- a/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc +++ b/source/blender/editors/space_spreadsheet/spreadsheet_row_filter_ui.cc @@ -134,7 +134,8 @@ static void spreadsheet_filter_panel_draw_header(const bContext *C, Panel *panel const SpreadsheetColumn *column = lookup_visible_column_for_filter(*sspreadsheet, column_name); if (!(sspreadsheet->filter_flag & SPREADSHEET_FILTER_ENABLE) || - (column == nullptr && !column_name.is_empty())) { + (column == nullptr && !column_name.is_empty())) + { uiLayoutSetActive(layout, false); } @@ -180,7 +181,8 @@ static void spreadsheet_filter_panel_draw(const bContext *C, Panel *panel) const SpreadsheetColumn *column = lookup_visible_column_for_filter(*sspreadsheet, column_name); if (!(sspreadsheet->filter_flag & SPREADSHEET_FILTER_ENABLE) || !(filter->flag & SPREADSHEET_ROW_FILTER_ENABLED) || - (column == nullptr && !column_name.is_empty())) { + (column == nullptr && !column_name.is_empty())) + { uiLayoutSetActive(layout, false); } diff --git a/source/blender/editors/space_text/space_text.c b/source/blender/editors/space_text/space_text.c index 9fc856c6d5a..fd939965531 100644 --- a/source/blender/editors/space_text/space_text.c +++ b/source/blender/editors/space_text/space_text.c @@ -289,7 +289,8 @@ static void text_cursor(wmWindow *win, ScrArea *area, ARegion *region) if (st->text && BLI_rcti_isect_pt(&st->runtime.scroll_region_handle, win->eventstate->xy[0] - region->winrct.xmin, - st->runtime.scroll_region_handle.ymin)) { + st->runtime.scroll_region_handle.ymin)) + { wmcursor = WM_CURSOR_DEFAULT; } diff --git a/source/blender/editors/space_text/text_autocomplete.c b/source/blender/editors/space_text/text_autocomplete.c index f6cf5bb771e..c37a1f86119 100644 --- a/source/blender/editors/space_text/text_autocomplete.c +++ b/source/blender/editors/space_text/text_autocomplete.c @@ -163,12 +163,14 @@ static GHash *text_autocomplete_build(Text *text) i_pos = i_start; while ((i_start < linep->len) && !text_check_identifier_nodigit_unicode( - BLI_str_utf8_as_unicode_step(linep->line, linep->len, &i_pos))) { + BLI_str_utf8_as_unicode_step(linep->line, linep->len, &i_pos))) + { i_start = i_pos; } i_pos = i_end = i_start; while ((i_end < linep->len) && text_check_identifier_unicode(BLI_str_utf8_as_unicode_step( - linep->line, linep->len, &i_pos))) { + linep->line, linep->len, &i_pos))) + { i_end = i_pos; } @@ -176,12 +178,14 @@ static GHash *text_autocomplete_build(Text *text) /* Check we're at the beginning of a line or that the previous char is not an * identifier this prevents digits from being added. */ ((i_start < 1) || - !text_check_identifier_unicode(BLI_str_utf8_as_unicode(&linep->line[i_start - 1])))) { + !text_check_identifier_unicode(BLI_str_utf8_as_unicode(&linep->line[i_start - 1])))) + { char *str_sub = &linep->line[i_start]; const int choice_len = i_end - i_start; if ((choice_len > seek_len) && (seek_len == 0 || STREQLEN(seek, str_sub, seek_len)) && - (seek != str_sub)) { + (seek != str_sub)) + { // printf("Adding: %s\n", s); char str_sub_last = str_sub[choice_len]; str_sub[choice_len] = '\0'; diff --git a/source/blender/editors/space_text/text_draw.c b/source/blender/editors/space_text/text_draw.c index 5d3cd03ebb1..f43ab6ed56b 100644 --- a/source/blender/editors/space_text/text_draw.c +++ b/source/blender/editors/space_text/text_draw.c @@ -933,7 +933,8 @@ static void calc_text_rcts(SpaceText *st, ARegion *region, rcti *scroll, rcti *b (pix_bardiff * (lhlstart - st->top) / st->runtime.viewlines); } else if (lhlstart > st->top + st->runtime.viewlines && hlstart < barstart + barheight && - hlstart > barstart) { + hlstart > barstart) + { /* push hl start down */ hlstart = barstart + barheight; } @@ -947,8 +948,8 @@ static void calc_text_rcts(SpaceText *st, ARegion *region, rcti *scroll, rcti *b } /* the end of the highlight is in the current viewport */ - if (st->runtime.viewlines && lhlend >= st->top && - lhlend <= st->top + st->runtime.viewlines) { + if (st->runtime.viewlines && lhlend >= st->top && lhlend <= st->top + st->runtime.viewlines) + { /* Speed the progression of the end of the highlight through the scroll-bar. */ hlend = (((pix_available - pix_bardiff) * lhlend) / ltexth) + (pix_bardiff * (lhlend - st->top) / st->runtime.viewlines); @@ -958,7 +959,8 @@ static void calc_text_rcts(SpaceText *st, ARegion *region, rcti *scroll, rcti *b hlend = barstart; } else if (lhlend > st->top + st->runtime.viewlines && - lhlstart < st->top + st->runtime.viewlines && hlend < barstart + barheight) { + lhlstart < st->top + st->runtime.viewlines && hlend < barstart + barheight) + { /* fill out end */ hlend = barstart + barheight; } @@ -1453,7 +1455,8 @@ static void draw_brackets(const SpaceText *st, const TextDrawContext *tdc, ARegi /* Don't highlight brackets if syntax HL is off or bracket in string or comment. */ if (!linep->format || linep->format[fc] == FMT_TYPE_STRING || - linep->format[fc] == FMT_TYPE_COMMENT) { + linep->format[fc] == FMT_TYPE_COMMENT) + { return; } diff --git a/source/blender/editors/space_text/text_format_lua.c b/source/blender/editors/space_text/text_format_lua.c index f2dff82306d..bfa6552d0e9 100644 --- a/source/blender/editors/space_text/text_format_lua.c +++ b/source/blender/editors/space_text/text_format_lua.c @@ -270,7 +270,8 @@ static void txtfmt_lua_format_line(SpaceText *st, TextLine *line, const bool do_ } /* Numbers (digits not part of an identifier and periods followed by digits) */ else if ((prev != FMT_TYPE_DEFAULT && text_check_digit(*str)) || - (*str == '.' && text_check_digit(*(str + 1)))) { + (*str == '.' && text_check_digit(*(str + 1)))) + { *fmt = FMT_TYPE_NUMERAL; } /* Booleans */ diff --git a/source/blender/editors/space_text/text_format_osl.c b/source/blender/editors/space_text/text_format_osl.c index fa041697f01..2bef924ed95 100644 --- a/source/blender/editors/space_text/text_format_osl.c +++ b/source/blender/editors/space_text/text_format_osl.c @@ -291,7 +291,8 @@ static void txtfmt_osl_format_line(SpaceText *st, TextLine *line, const bool do_ } /* Numbers (digits not part of an identifier and periods followed by digits) */ else if ((prev != FMT_TYPE_DEFAULT && text_check_digit(*str)) || - (*str == '.' && text_check_digit(*(str + 1)))) { + (*str == '.' && text_check_digit(*(str + 1)))) + { *fmt = FMT_TYPE_NUMERAL; } /* Punctuation */ diff --git a/source/blender/editors/space_text/text_format_pov.c b/source/blender/editors/space_text/text_format_pov.c index 746e939752b..70e8fb5c8b6 100644 --- a/source/blender/editors/space_text/text_format_pov.c +++ b/source/blender/editors/space_text/text_format_pov.c @@ -863,7 +863,8 @@ static void txtfmt_pov_format_line(SpaceText *st, TextLine *line, const bool do_ } /* Numbers (digits not part of an identifier and periods followed by digits) */ else if ((prev != FMT_TYPE_DEFAULT && text_check_digit(*str)) || - (*str == '.' && text_check_digit(*(str + 1)))) { + (*str == '.' && text_check_digit(*(str + 1)))) + { *fmt = FMT_TYPE_NUMERAL; } /* Booleans */ diff --git a/source/blender/editors/space_text/text_format_pov_ini.c b/source/blender/editors/space_text/text_format_pov_ini.c index 60e37700efe..cdc0cd8d0ef 100644 --- a/source/blender/editors/space_text/text_format_pov_ini.c +++ b/source/blender/editors/space_text/text_format_pov_ini.c @@ -441,7 +441,8 @@ static void txtfmt_pov_ini_format_line(SpaceText *st, TextLine *line, const bool } /* Numbers (digits not part of an identifier and periods followed by digits) */ else if ((prev != FMT_TYPE_DEFAULT && text_check_digit(*str)) || - (*str == '.' && text_check_digit(*(str + 1)))) { + (*str == '.' && text_check_digit(*(str + 1)))) + { *fmt = FMT_TYPE_NUMERAL; } /* Booleans */ diff --git a/source/blender/editors/space_text/text_format_py.c b/source/blender/editors/space_text/text_format_py.c index 9237e831da9..0b6ab32236f 100644 --- a/source/blender/editors/space_text/text_format_py.c +++ b/source/blender/editors/space_text/text_format_py.c @@ -302,7 +302,8 @@ static int txtfmt_py_literal_numeral(const char *string, char prev_fmt) } } else if ((prev_fmt != FMT_TYPE_DEFAULT) && - (text_check_digit(first) || (first == '.' && text_check_digit(second)))) { + (text_check_digit(first) || (first == '.' && text_check_digit(second)))) + { /* New numeral, starting with a digit or a decimal point followed by a digit. */ return txtfmt_py_find_numeral_inner(string); } @@ -446,7 +447,8 @@ static void txtfmt_py_format_line(SpaceText *st, TextLine *line, const bool do_n } else if (((ELEM(*str, 'f', 'F') && ELEM(*(str + 1), 'r', 'R')) || (ELEM(*str, 'r', 'R') && ELEM(*(str + 1), 'f', 'F'))) && - ELEM(*(str + 2), '"', '\'')) { + ELEM(*(str + 2), '"', '\'')) + { /* Strings with two letter prefixes (raw f-strings). * Format the prefix as part of the string. */ *fmt = FMT_TYPE_STRING; diff --git a/source/blender/editors/space_text/text_ops.c b/source/blender/editors/space_text/text_ops.c index 7239d2b73b4..fa6a7469141 100644 --- a/source/blender/editors/space_text/text_ops.c +++ b/source/blender/editors/space_text/text_ops.c @@ -2445,7 +2445,8 @@ static int text_delete_exec(bContext *C, wmOperator *op) if (*curr != '\0') { const char *prev = BLI_str_find_prev_char_utf8(curr, text->curl->line); if ((curr != prev) && /* When back-spacing from the start of the line. */ - (*curr == text_closing_character_pair_get(*prev))) { + (*curr == text_closing_character_pair_get(*prev))) + { txt_move_right(text, false); txt_backspace_char(text); } @@ -2711,7 +2712,8 @@ static void text_scroll_apply(bContext *C, wmOperator *op, const wmEvent *event) if (scroll_ofs_new[0] != st->left || scroll_ofs_new[1] != st->top || /* Horizontal sub-pixel offset currently isn't used. */ /* scroll_ofs_px_new[0] != st->scroll_ofs_px[0] || */ - scroll_ofs_px_new[1] != st->runtime.scroll_ofs_px[1]) { + scroll_ofs_px_new[1] != st->runtime.scroll_ofs_px[1]) + { st->left = scroll_ofs_new[0]; st->top = scroll_ofs_new[1]; @@ -2882,9 +2884,11 @@ static int text_scroll_bar_invoke(bContext *C, wmOperator *op, const wmEvent *ev /* verify we are in the right zone */ if (mval[0] > st->runtime.scroll_region_handle.xmin && - mval[0] < st->runtime.scroll_region_handle.xmax) { + mval[0] < st->runtime.scroll_region_handle.xmax) + { if (mval[1] >= st->runtime.scroll_region_handle.ymin && - mval[1] <= st->runtime.scroll_region_handle.ymax) { + mval[1] <= st->runtime.scroll_region_handle.ymax) + { /* mouse inside scroll handle */ zone = SCROLLHANDLE_BAR; } @@ -3042,7 +3046,8 @@ static void text_cursor_set_to_pos_wrapped( char ch; for (j = 0; !found && ((ch = linep->line[j]) != '\0'); - j += BLI_str_utf8_size_safe(linep->line + j)) { + j += BLI_str_utf8_size_safe(linep->line + j)) + { int chars; int columns = BLI_str_utf8_char_width_safe(linep->line + j); /* = 1 for tab */ @@ -3419,7 +3424,8 @@ static int text_line_number_invoke(bContext *C, wmOperator *UNUSED(op), const wm if (!(mval[0] > 2 && mval[0] < (TXT_NUMCOL_WIDTH(st) + (TXT_BODY_LPAD * st->runtime.cwidth_px)) && - mval[1] > 2 && mval[1] < region->winy - 2)) { + mval[1] > 2 && mval[1] < region->winy - 2)) + { return OPERATOR_PASS_THROUGH; } diff --git a/source/blender/editors/space_view3d/space_view3d.cc b/source/blender/editors/space_view3d/space_view3d.cc index 3e1d3566506..e5c9ab67b80 100644 --- a/source/blender/editors/space_view3d/space_view3d.cc +++ b/source/blender/editors/space_view3d/space_view3d.cc @@ -119,7 +119,8 @@ bool ED_view3d_context_user_region(bContext *C, View3D **r_v3d, ARegion **r_regi RegionView3D *rv3d; if ((region->regiontype == RGN_TYPE_WINDOW) && (rv3d = static_cast(region->regiondata)) && - (rv3d->viewlock & RV3D_LOCK_ROTATION) == 0) { + (rv3d->viewlock & RV3D_LOCK_ROTATION) == 0) + { *r_v3d = v3d; *r_region = region; return true; @@ -2004,7 +2005,8 @@ static int view3d_context(const bContext *C, const char *member, bContextDataRes static void view3d_id_remap_v3d_ob_centers(View3D *v3d, const struct IDRemapper *mappings) { if (BKE_id_remapper_apply(mappings, (ID **)&v3d->ob_center, ID_REMAP_APPLY_DEFAULT) == - ID_REMAP_RESULT_SOURCE_UNASSIGNED) { + ID_REMAP_RESULT_SOURCE_UNASSIGNED) + { /* Otherwise, bone-name may remain valid... * We could be smart and check this, too? */ v3d->ob_center_bone[0] = '\0'; @@ -2019,7 +2021,8 @@ static void view3d_id_remap_v3d(ScrArea *area, { ARegion *region; if (BKE_id_remapper_apply(mappings, (ID **)&v3d->camera, ID_REMAP_APPLY_DEFAULT) == - ID_REMAP_RESULT_SOURCE_UNASSIGNED) { + ID_REMAP_RESULT_SOURCE_UNASSIGNED) + { /* 3D view might be inactive, in that case needs to use slink->regionbase */ ListBase *regionbase = (slink == area->spacedata.first) ? &area->regionbase : &slink->regionbase; @@ -2038,8 +2041,9 @@ static void view3d_id_remap_v3d(ScrArea *area, static void view3d_id_remap(ScrArea *area, SpaceLink *slink, const struct IDRemapper *mappings) { - if (!BKE_id_remapper_has_mapping_for( - mappings, FILTER_ID_OB | FILTER_ID_MA | FILTER_ID_IM | FILTER_ID_MC)) { + if (!BKE_id_remapper_has_mapping_for(mappings, + FILTER_ID_OB | FILTER_ID_MA | FILTER_ID_IM | FILTER_ID_MC)) + { return; } diff --git a/source/blender/editors/space_view3d/view3d_buttons.c b/source/blender/editors/space_view3d/view3d_buttons.c index badb6f65397..921ade101c7 100644 --- a/source/blender/editors/space_view3d/view3d_buttons.c +++ b/source/blender/editors/space_view3d/view3d_buttons.c @@ -117,7 +117,8 @@ static void *editmesh_partial_update_begin_fn(struct bContext *UNUSED(C), { const int retval_test = B_TRANSFORM_PANEL_MEDIAN; if (BLI_array_findindex( - params->unique_retval_ids, params->unique_retval_ids_len, &retval_test) == -1) { + params->unique_retval_ids, params->unique_retval_ids_len, &retval_test) == -1) + { return NULL; } @@ -969,7 +970,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float if ((ob->type == OB_MESH) && (apply_vcos || median_basis.mesh.bv_weight || median_basis.mesh.v_crease || median_basis.mesh.skin[0] || median_basis.mesh.skin[1] || median_basis.mesh.be_weight || - median_basis.mesh.e_crease)) { + median_basis.mesh.e_crease)) + { const TransformMedian_Mesh *median = &median_basis.mesh, *ve_median = &ve_median_basis.mesh; Mesh *me = ob->data; BMEditMesh *em = me->edit_mesh; @@ -1101,7 +1103,8 @@ static void v3d_editvertex_buts(uiLayout *layout, View3D *v3d, Object *ob, float } else if (ELEM(ob->type, OB_CURVES_LEGACY, OB_SURF) && (apply_vcos || median_basis.curve.b_weight || median_basis.curve.weight || - median_basis.curve.radius || median_basis.curve.tilt)) { + median_basis.curve.radius || median_basis.curve.tilt)) + { const TransformMedian_Curve *median = &median_basis.curve, *ve_median = &ve_median_basis.curve; Curve *cu = ob->data; @@ -1769,8 +1772,8 @@ static void view3d_panel_transform(const bContext *C, Panel *panel) v3d_transform_butsR(col, &obptr); /* Dimensions and editmode are mostly the same check. */ - if (OB_TYPE_SUPPORT_EDITMODE(ob->type) || - ELEM(ob->type, OB_VOLUME, OB_CURVES, OB_POINTCLOUD)) { + if (OB_TYPE_SUPPORT_EDITMODE(ob->type) || ELEM(ob->type, OB_VOLUME, OB_CURVES, OB_POINTCLOUD)) + { View3D *v3d = CTX_wm_view3d(C); v3d_object_dimension_buts(NULL, col, v3d, ob); } diff --git a/source/blender/editors/space_view3d/view3d_cursor_snap.c b/source/blender/editors/space_view3d/view3d_cursor_snap.c index cf3841f2b1c..141222c746c 100644 --- a/source/blender/editors/space_view3d/view3d_cursor_snap.c +++ b/source/blender/editors/space_view3d/view3d_cursor_snap.c @@ -533,7 +533,8 @@ static bool v3d_cursor_is_snap_invert(SnapCursorDataIntern *data_intern, const w if ((ELEM(kmi->type, EVT_LEFTCTRLKEY, EVT_RIGHTCTRLKEY) && (event->modifier & KM_CTRL)) || (ELEM(kmi->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY) && (event->modifier & KM_SHIFT)) || (ELEM(kmi->type, EVT_LEFTALTKEY, EVT_RIGHTALTKEY) && (event->modifier & KM_ALT)) || - ((kmi->type == EVT_OSKEY) && (event->modifier & KM_OSKEY))) { + ((kmi->type == EVT_OSKEY) && (event->modifier & KM_OSKEY))) + { return true; } } @@ -769,7 +770,8 @@ static void v3d_cursor_snap_update(V3DSnapCursorState *state, snap_elem_index[0] = index; } else if (snap_elem & - (SCE_SNAP_MODE_EDGE | SCE_SNAP_MODE_EDGE_MIDPOINT | SCE_SNAP_MODE_EDGE_PERPENDICULAR)) { + (SCE_SNAP_MODE_EDGE | SCE_SNAP_MODE_EDGE_MIDPOINT | SCE_SNAP_MODE_EDGE_PERPENDICULAR)) + { snap_elem_index[1] = index; } else if (snap_elem == SCE_SNAP_MODE_FACE_RAYCAST) { diff --git a/source/blender/editors/space_view3d/view3d_draw.cc b/source/blender/editors/space_view3d/view3d_draw.cc index ae4598f649e..c2d718641d9 100644 --- a/source/blender/editors/space_view3d/view3d_draw.cc +++ b/source/blender/editors/space_view3d/view3d_draw.cc @@ -233,7 +233,8 @@ static bool view3d_stereo3d_active(wmWindow *win, return false; } if (((scene->r.views_format & SCE_VIEWS_FORMAT_MULTIVIEW) != 0) && - !BKE_scene_multiview_is_stereo3d(&scene->r)) { + !BKE_scene_multiview_is_stereo3d(&scene->r)) + { return false; } break; @@ -359,7 +360,8 @@ void ED_view3d_draw_setup_view(const wmWindowManager *wm, } else #endif - if (view3d_stereo3d_active(win, scene, v3d, rv3d)) { + if (view3d_stereo3d_active(win, scene, v3d, rv3d)) + { view3d_stereo3d_setup(depsgraph, scene, v3d, region, rect); } else { @@ -1475,7 +1477,8 @@ void view3d_draw_region_info(const bContext *C, ARegion *region) #ifdef WITH_INPUT_NDOF if ((U.ndof_flag & NDOF_SHOW_GUIDE) && ((RV3D_LOCK_FLAGS(rv3d) & RV3D_LOCK_ROTATION) == 0) && - (rv3d->persp != RV3D_CAMOB)) { + (rv3d->persp != RV3D_CAMOB)) + { /* TODO: draw something else (but not this) during fly mode */ draw_rotation_guide(rv3d); } @@ -1712,7 +1715,8 @@ void ED_view3d_draw_offscreen(Depsgraph *depsgraph, GPU_matrix_identity_set(); if ((viewname != nullptr && viewname[0] != '\0') && (viewmat == nullptr) && - rv3d->persp == RV3D_CAMOB && v3d->camera) { + rv3d->persp == RV3D_CAMOB && v3d->camera) + { view3d_stereo3d_setup_offscreen(depsgraph, scene, v3d, region, winmat, viewname); } else { @@ -2175,7 +2179,8 @@ static void validate_object_select_id(struct Depsgraph *depsgraph, UNUSED_VARS_NDEBUG(region); if (obact_eval && (obact_eval->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT) || - BKE_paint_select_face_test(obact_eval))) { + BKE_paint_select_face_test(obact_eval))) + { /* do nothing */ } /* texture paint mode sampling */ diff --git a/source/blender/editors/space_view3d/view3d_edit.c b/source/blender/editors/space_view3d/view3d_edit.c index 39b6dcd385f..74ba05dd837 100644 --- a/source/blender/editors/space_view3d/view3d_edit.c +++ b/source/blender/editors/space_view3d/view3d_edit.c @@ -925,7 +925,8 @@ void ED_view3d_cursor3d_position_rotation(bContext *C, NULL, &ob_dummy, obmat, - NULL) != 0) { + NULL) != 0) + { if (use_depth) { copy_v3_v3(cursor_co, ray_co); } @@ -1025,7 +1026,8 @@ void ED_view3d_cursor3d_update(bContext *C, if ((ED_view3d_project_float_global( region, cursor_prev.location, co_2d_prev, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK) && (ED_view3d_project_float_global( - region, cursor_curr->location, co_2d_curr, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK)) { + region, cursor_curr->location, co_2d_curr, V3D_PROJ_TEST_NOP) == V3D_PROJ_RET_OK)) + { rv3d->ofs_lock[0] += (co_2d_curr[0] - co_2d_prev[0]) / (region->winx * 0.5f); rv3d->ofs_lock[1] += (co_2d_curr[1] - co_2d_prev[1]) / (region->winy * 0.5f); } @@ -1198,7 +1200,8 @@ static int toggle_xray_exec(bContext *C, wmOperator *op) Object *obact = CTX_data_active_object(C); if (obact && ((obact->mode & OB_MODE_POSE) || - ((obact->mode & OB_MODE_WEIGHT_PAINT) && BKE_object_pose_armature_get(obact)))) { + ((obact->mode & OB_MODE_WEIGHT_PAINT) && BKE_object_pose_armature_get(obact)))) + { v3d->overlay.flag ^= V3D_OVERLAY_BONE_SELECT; } else { diff --git a/source/blender/editors/space_view3d/view3d_gizmo_camera.c b/source/blender/editors/space_view3d/view3d_gizmo_camera.c index db201466e51..bf26aeda95e 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_camera.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_camera.c @@ -51,7 +51,8 @@ static bool WIDGETGROUP_camera_poll(const bContext *C, wmGizmoGroupType *UNUSED( return false; } if ((v3d->gizmo_show_camera & V3D_GIZMO_SHOW_CAMERA_LENS) == 0 && - (v3d->gizmo_show_camera & V3D_GIZMO_SHOW_CAMERA_DOF_DIST) == 0) { + (v3d->gizmo_show_camera & V3D_GIZMO_SHOW_CAMERA_DOF_DIST) == 0) + { return false; } diff --git a/source/blender/editors/space_view3d/view3d_gizmo_navigate.c b/source/blender/editors/space_view3d/view3d_gizmo_navigate.c index f58f39d87a2..7ea80ef3d9b 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_navigate.c +++ b/source/blender/editors/space_view3d/view3d_gizmo_navigate.c @@ -113,7 +113,8 @@ static bool WIDGETGROUP_navigate_poll(const bContext *C, wmGizmoGroupType *UNUSE View3D *v3d = CTX_wm_view3d(C); if ((((U.uiflag & USER_SHOW_GIZMO_NAVIGATE) == 0) && (U.mini_axis_type != USER_MINI_AXIS_TYPE_GIZMO)) || - (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_NAVIGATE))) { + (v3d->gizmo_flag & (V3D_GIZMO_HIDE | V3D_GIZMO_HIDE_NAVIGATE))) + { return false; } return true; @@ -239,7 +240,8 @@ static void WIDGETGROUP_navigate_draw_prepare(const bContext *C, wmGizmoGroup *g (navgroup->state.rect_visible.ymax == rect_visible->ymax) && (navgroup->state.rv3d.is_persp == rv3d->is_persp) && (navgroup->state.rv3d.is_camera == (rv3d->persp == RV3D_CAMOB)) && - (navgroup->state.rv3d.viewlock == RV3D_LOCK_FLAGS(rv3d))) { + (navgroup->state.rv3d.viewlock == RV3D_LOCK_FLAGS(rv3d))) + { return; } diff --git a/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.cc b/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.cc index d912f279b59..d4a7d87d7de 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.cc +++ b/source/blender/editors/space_view3d/view3d_gizmo_preselect_type.cc @@ -161,7 +161,8 @@ static int gizmo_preselect_elem_test_select(bContext *C, wmGizmo *gz, const int &base_index_face, &eve_test, &eed_test, - &efa_test)) { + &efa_test)) + { if (EDBM_preselect_action_get(gz_ele->psel) == PRESELECT_ACTION_DELETE) { /* Delete action */ if (efa_test) { @@ -193,7 +194,8 @@ static int gizmo_preselect_elem_test_select(bContext *C, wmGizmo *gz, const int best.base_index = base_index_vert; } if (!BM_vert_is_boundary(vert) && - EDBM_preselect_action_get(gz_ele->psel) != PRESELECT_ACTION_DELETE) { + EDBM_preselect_action_get(gz_ele->psel) != PRESELECT_ACTION_DELETE) + { best.ele = (BMElem *)eve_test; best.base_index = base_index_vert; } @@ -358,7 +360,8 @@ static int gizmo_preselect_edgering_test_select(bContext *C, wmGizmo *gz, const View3D *v3d = CTX_wm_view3d(C); BKE_view_layer_synced_ensure(scene, view_layer); if ((gz_ring->bases) == nullptr || - (gz_ring->bases[0] != BKE_view_layer_active_base_get(view_layer))) { + (gz_ring->bases[0] != BKE_view_layer_active_base_get(view_layer))) + { MEM_SAFE_FREE(gz_ring->bases); gz_ring->bases = BKE_view_layer_array_from_bases_in_edit_mode( scene, view_layer, v3d, &gz_ring->bases_len); diff --git a/source/blender/editors/space_view3d/view3d_gizmo_ruler.cc b/source/blender/editors/space_view3d/view3d_gizmo_ruler.cc index 8851c662cbe..22aa3e592a1 100644 --- a/source/blender/editors/space_view3d/view3d_gizmo_ruler.cc +++ b/source/blender/editors/space_view3d/view3d_gizmo_ruler.cc @@ -532,7 +532,8 @@ static bool view3d_ruler_to_gpencil(bContext *C, wmGizmoGroup *gzgroup) BKE_gpencil_free_strokes(gpf); for (ruler_item = gzgroup_ruler_item_first_get(gzgroup); ruler_item; - ruler_item = (RulerItem *)ruler_item->gz.next) { + ruler_item = (RulerItem *)ruler_item->gz.next) + { bGPDspoint *pt; int j; @@ -946,7 +947,8 @@ static void gizmo_ruler_draw(const bContext *C, wmGizmo *gz) const float len = len_v2v2(co_ss[0], co_ss[2]); if ((len < (numstr_size[1] * 2.5f)) || - ((len < (numstr_size[0] + bg_margin + bg_margin)) && (fabs(rot_90_vec[0]) < 0.5f))) { + ((len < (numstr_size[0] + bg_margin + bg_margin)) && (fabs(rot_90_vec[0]) < 0.5f))) + { /* Super short, or quite short and also shallow angle. Position below line.*/ posit[1] = MIN2(co_ss[0][1], co_ss[2][1]) - numstr_size[1] - bg_margin - bg_margin; } @@ -1066,7 +1068,8 @@ static int gizmo_ruler_modal(bContext *C, if (ruler_info->state == RULER_STATE_DRAG) { struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); if (view3d_ruler_item_mousemove( - C, depsgraph, ruler_info, ruler_item, event->mval, do_thickness, do_snap)) { + C, depsgraph, ruler_info, ruler_item, event->mval, do_thickness, do_snap)) + { do_draw = true; } } @@ -1282,7 +1285,8 @@ static bool view3d_ruler_poll(bContext *C) { bToolRef_Runtime *tref_rt = WM_toolsystem_runtime_from_context((bContext *)C); if ((tref_rt == nullptr) || !STREQ(view3d_gzgt_ruler_id, tref_rt->gizmo_group) || - CTX_wm_region_view3d(C) == nullptr) { + CTX_wm_region_view3d(C) == nullptr) + { return false; } return true; @@ -1316,7 +1320,8 @@ static int view3d_ruler_add_invoke(bContext *C, wmOperator *op, const wmEvent *e WM_gizmo_highlight_set(gzmap, &ruler_item->gz); if (WM_operator_name_call( C, "GIZMOGROUP_OT_gizmo_tweak", WM_OP_INVOKE_REGION_WIN, nullptr, event) == - OPERATOR_RUNNING_MODAL) { + OPERATOR_RUNNING_MODAL) + { RulerInfo *ruler_info = static_cast(gzgroup->customdata); RulerInteraction *inter = static_cast(ruler_item->gz.interaction_data); struct Depsgraph *depsgraph = CTX_data_ensure_evaluated_depsgraph(C); diff --git a/source/blender/editors/space_view3d/view3d_iterators.cc b/source/blender/editors/space_view3d/view3d_iterators.cc index 3cd9d3c9d52..fd2eb73c717 100644 --- a/source/blender/editors/space_view3d/view3d_iterators.cc +++ b/source/blender/editors/space_view3d/view3d_iterators.cc @@ -144,15 +144,16 @@ static bool view3d_project_segment_to_screen_with_content_clip_planes( /* Simple cases have been ruled out, clip by viewport planes, then re-project. */ float v_a_clip[3], v_b_clip[3]; - if (!clip_segment_v3_plane_n( - v_a, v_b, content_planes, content_planes_len, v_a_clip, v_b_clip)) { + if (!clip_segment_v3_plane_n(v_a, v_b, content_planes, content_planes_len, v_a_clip, v_b_clip)) + { return false; } if ((ED_view3d_project_float_object(region, v_a_clip, r_screen_co_a, clip_flag_nowin) != V3D_PROJ_RET_OK) || (ED_view3d_project_float_object(region, v_b_clip, r_screen_co_b, clip_flag_nowin) != - V3D_PROJ_RET_OK)) { + V3D_PROJ_RET_OK)) + { return false; } @@ -272,7 +273,8 @@ static void meshobject_foreachScreenVert__mapFunc(void *userData, float screen_co[2]; if (ED_view3d_project_float_object(data->vc.region, co, screen_co, data->clip_flag) != - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { return; } @@ -324,7 +326,8 @@ static void mesh_foreachScreenVert__mapFunc(void *userData, float screen_co[2]; if (ED_view3d_project_float_object(data->vc.region, co, screen_co, data->clip_flag) != - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { return; } @@ -385,7 +388,8 @@ static void mesh_foreachScreenEdge__mapFunc(void *userData, data->content_planes, data->content_planes_len, screen_co_a, - screen_co_b)) { + screen_co_b)) + { return; } @@ -474,7 +478,8 @@ static void mesh_foreachScreenEdge_clip_bb_segment__mapFunc(void *userData, data->content_planes, data->content_planes_len, screen_co_a, - screen_co_b)) { + screen_co_b)) + { return; } @@ -549,7 +554,8 @@ static void mesh_foreachScreenFace__mapFunc(void *userData, float screen_co[2]; if (ED_view3d_project_float_object(data->vc.region, cent, screen_co, data->clip_flag) != - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { return; } @@ -633,8 +639,8 @@ void nurbs_foreachScreenVert(ViewContext *vc, vc->region, bezt->vec[1], screen_co, - eV3DProjTest(V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN)) == - V3D_PROJ_RET_OK) { + eV3DProjTest(V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN)) == V3D_PROJ_RET_OK) + { func(userData, nu, nullptr, bezt, 1, false, screen_co); } } @@ -643,24 +649,24 @@ void nurbs_foreachScreenVert(ViewContext *vc, vc->region, bezt->vec[0], screen_co, - eV3DProjTest(V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN)) == - V3D_PROJ_RET_OK) { + eV3DProjTest(V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN)) == V3D_PROJ_RET_OK) + { func(userData, nu, nullptr, bezt, 0, true, screen_co); } if (ED_view3d_project_float_object( vc->region, bezt->vec[1], screen_co, - eV3DProjTest(V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN)) == - V3D_PROJ_RET_OK) { + eV3DProjTest(V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN)) == V3D_PROJ_RET_OK) + { func(userData, nu, nullptr, bezt, 1, true, screen_co); } if (ED_view3d_project_float_object( vc->region, bezt->vec[2], screen_co, - eV3DProjTest(V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN)) == - V3D_PROJ_RET_OK) { + eV3DProjTest(V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN)) == V3D_PROJ_RET_OK) + { func(userData, nu, nullptr, bezt, 2, true, screen_co); } } @@ -677,7 +683,8 @@ void nurbs_foreachScreenVert(ViewContext *vc, vc->region, bp->vec, screen_co, - eV3DProjTest(V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN)) == V3D_PROJ_RET_OK) { + eV3DProjTest(V3D_PROJ_RET_CLIP_BB | V3D_PROJ_RET_CLIP_WIN)) == V3D_PROJ_RET_OK) + { func(userData, nu, bp, nullptr, -1, false, screen_co); } } @@ -742,7 +749,8 @@ void lattice_foreachScreenVert(ViewContext *vc, if (bp->hide == 0) { float screen_co[2]; if (ED_view3d_project_float_object(vc->region, dl ? co : bp->vec, screen_co, clip_flag) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { func(userData, bp, screen_co); } } @@ -800,13 +808,15 @@ void armature_foreachScreenBone(ViewContext *vc, content_planes, content_planes_len, screen_co_a, - screen_co_b)) { + screen_co_b)) + { continue; } } else { if (!view3d_project_segment_to_screen_with_clip_tag( - vc->region, v_a, v_b, clip_flag, screen_co_a, screen_co_b)) { + vc->region, v_a, v_b, clip_flag, screen_co_a, screen_co_b)) + { continue; } } @@ -871,13 +881,15 @@ void pose_foreachScreenBone(ViewContext *vc, content_planes, content_planes_len, screen_co_a, - screen_co_b)) { + screen_co_b)) + { continue; } } else { if (!view3d_project_segment_to_screen_with_clip_tag( - vc->region, v_a, v_b, clip_flag, screen_co_a, screen_co_b)) { + vc->region, v_a, v_b, clip_flag, screen_co_a, screen_co_b)) + { continue; } } diff --git a/source/blender/editors/space_view3d/view3d_navigate.cc b/source/blender/editors/space_view3d/view3d_navigate.cc index a7f8486ae9a..c57c6b9bb2a 100644 --- a/source/blender/editors/space_view3d/view3d_navigate.cc +++ b/source/blender/editors/space_view3d/view3d_navigate.cc @@ -432,7 +432,8 @@ bool view3d_orbit_calc_center(bContext *C, float r_dyn_ofs[3]) if (ob_act && (ob_act->mode & OB_MODE_ALL_PAINT) && /* with weight-paint + pose-mode, fall through to using calculateTransformCenter */ - ((ob_act->mode & OB_MODE_WEIGHT_PAINT) && BKE_object_pose_armature_get(ob_act)) == 0) { + ((ob_act->mode & OB_MODE_WEIGHT_PAINT) && BKE_object_pose_armature_get(ob_act)) == 0) + { BKE_paint_stroke_get_average(scene, ob_act_eval, lastofs); is_set = true; } @@ -936,7 +937,8 @@ static bool view3d_object_skip_minmax(const View3D *v3d, } if ((ob->type == OB_EMPTY) && (ob->empty_drawtype == OB_EMPTY_IMAGE) && - !BKE_object_empty_image_frame_is_visible_in_view3d(ob, rv3d)) { + !BKE_object_empty_image_frame_is_visible_in_view3d(ob, rv3d)) + { *r_only_center = true; return false; } @@ -1209,7 +1211,8 @@ static int viewselected_exec(bContext *C, wmOperator *op) * active/selection callback interface once... */ Base *base_eval; for (base_eval = (Base *)BKE_view_layer_object_bases_get(view_layer_eval)->first; base_eval; - base_eval = base_eval->next) { + base_eval = base_eval->next) + { if (BASE_SELECTED_EDITABLE(v3d, base_eval)) { if (base_eval->object->type == OB_ARMATURE) { if (base_eval->object->mode & OB_MODE_POSE) { @@ -1260,14 +1263,16 @@ static int viewselected_exec(bContext *C, wmOperator *op) else if (obedit) { /* only selected */ FOREACH_OBJECT_IN_MODE_BEGIN ( - scene_eval, view_layer_eval, v3d, obedit->type, obedit->mode, ob_eval_iter) { + scene_eval, view_layer_eval, v3d, obedit->type, obedit->mode, ob_eval_iter) + { ok |= ED_view3d_minmax_verts(ob_eval_iter, min, max); } FOREACH_OBJECT_IN_MODE_END; } else if (ob_eval && (ob_eval->mode & OB_MODE_POSE)) { FOREACH_OBJECT_IN_MODE_BEGIN ( - scene_eval, view_layer_eval, v3d, ob_eval->type, ob_eval->mode, ob_eval_iter) { + scene_eval, view_layer_eval, v3d, ob_eval->type, ob_eval->mode, ob_eval_iter) + { ok |= BKE_pose_minmax(ob_eval_iter, min, max, true, true); } FOREACH_OBJECT_IN_MODE_END; @@ -1279,7 +1284,8 @@ static int viewselected_exec(bContext *C, wmOperator *op) ok = PE_minmax(depsgraph, scene, CTX_data_view_layer(C), min, max); } else if (ob_eval && (ob_eval->mode & (OB_MODE_SCULPT | OB_MODE_VERTEX_PAINT | - OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))) { + OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT))) + { BKE_paint_stroke_get_average(scene, ob_eval, min); copy_v3_v3(max, min); ok = true; diff --git a/source/blender/editors/space_view3d/view3d_navigate_fly.c b/source/blender/editors/space_view3d/view3d_navigate_fly.c index 3e83f8085c7..b9420275aff 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_fly.c +++ b/source/blender/editors/space_view3d/view3d_navigate_fly.c @@ -817,7 +817,8 @@ static int flyApply(bContext *C, FlyInfo *fly, bool is_confirm) /* Should we redraw? */ if ((fly->speed != 0.0f) || moffset[0] || moffset[1] || (fly->zlock != FLY_AXISLOCK_STATE_OFF) || (fly->xlock != FLY_AXISLOCK_STATE_OFF) || - dvec[0] || dvec[1] || dvec[2]) { + dvec[0] || dvec[1] || dvec[2]) + { float dvec_tmp[3]; /* time how fast it takes for us to redraw, @@ -1095,7 +1096,8 @@ static int fly_modal(bContext *C, wmOperator *op, const wmEvent *event) } else #endif /* WITH_INPUT_NDOF */ - if (event->type == TIMER && event->customdata == fly->timer) { + if (event->type == TIMER && event->customdata == fly->timer) + { flyApply(C, fly, false); } diff --git a/source/blender/editors/space_view3d/view3d_navigate_smoothview.c b/source/blender/editors/space_view3d/view3d_navigate_smoothview.c index 9b4e652ad63..d3dead3011f 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_smoothview.c +++ b/source/blender/editors/space_view3d/view3d_navigate_smoothview.c @@ -270,7 +270,8 @@ void ED_view3d_smooth_view_ex( (sms.dst.lens == v3d->lens) && /* Lens. */ equals_v3v3(sms.dst.ofs, rv3d->ofs) && /* Offset. */ equals_v4v4(sms.dst.quat, rv3d->viewquat) /* Rotation. */ - ) { + ) + { /* Early return if nothing changed. */ return; } diff --git a/source/blender/editors/space_view3d/view3d_navigate_walk.c b/source/blender/editors/space_view3d/view3d_navigate_walk.c index 9aa8328287b..28b38c062a4 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_walk.c +++ b/source/blender/editors/space_view3d/view3d_navigate_walk.c @@ -499,7 +499,8 @@ static bool initWalkInfo(bContext *C, WalkInfo *walk, wmOperator *op, const int } if (walk->rv3d->persp == RV3D_CAMOB && - !BKE_id_is_editable(CTX_data_main(C), &walk->v3d->camera->id)) { + !BKE_id_is_editable(CTX_data_main(C), &walk->v3d->camera->id)) + { BKE_report(op->reports, RPT_ERROR, "Cannot navigate a camera from an external library or non-editable override"); @@ -820,7 +821,8 @@ static void walkEvent(WalkInfo *walk, const wmEvent *event) case WALK_MODAL_JUMP: if ((walk->navigation_mode == WALK_MODE_GRAVITY) && (walk->gravity_state == WALK_GRAVITY_STATE_OFF) && - (walk->teleport.state == WALK_TELEPORT_STATE_OFF)) { + (walk->teleport.state == WALK_TELEPORT_STATE_OFF)) + { /* no need to check for ground, * walk->gravity wouldn't be off * if we were over a hole */ @@ -968,7 +970,8 @@ static int walkApply(bContext *C, WalkInfo *walk, bool is_confirm) if ((walk->active_directions) || moffset[0] || moffset[1] || walk->zlock == WALK_AXISLOCK_STATE_ACTIVE || walk->gravity_state != WALK_GRAVITY_STATE_OFF || - walk->teleport.state == WALK_TELEPORT_STATE_ON || is_confirm) { + walk->teleport.state == WALK_TELEPORT_STATE_ON || is_confirm) + { float dvec_tmp[3]; /* time how fast it takes for us to redraw, @@ -1181,7 +1184,8 @@ static int walkApply(bContext *C, WalkInfo *walk, bool is_confirm) /* stick to the floor */ if (walk->navigation_mode == WALK_MODE_GRAVITY && - ELEM(walk->gravity_state, WALK_GRAVITY_STATE_OFF, WALK_GRAVITY_STATE_START)) { + ELEM(walk->gravity_state, WALK_GRAVITY_STATE_OFF, WALK_GRAVITY_STATE_START)) + { bool ret; float ray_distance; @@ -1404,7 +1408,8 @@ static int walk_modal(bContext *C, wmOperator *op, const wmEvent *event) } else #endif /* WITH_INPUT_NDOF */ - if (event->type == TIMER && event->customdata == walk->timer) { + if (event->type == TIMER && event->customdata == walk->timer) + { walkApply(C, walk, false); } diff --git a/source/blender/editors/space_view3d/view3d_navigate_zoom.c b/source/blender/editors/space_view3d/view3d_navigate_zoom.c index b6a1769ebf2..4168f0cd90b 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_zoom.c +++ b/source/blender/editors/space_view3d/view3d_navigate_zoom.c @@ -336,7 +336,8 @@ static void viewzoom_apply(ViewOpsData *vod, const bool zoom_to_pos = (vod->viewops_flag & VIEWOPS_FLAG_ZOOM_TO_MOUSE) != 0; if ((vod->rv3d->persp == RV3D_CAMOB) && - (vod->rv3d->is_persp && ED_view3d_camera_lock_check(vod->v3d, vod->rv3d)) == 0) { + (vod->rv3d->is_persp && ED_view3d_camera_lock_check(vod->v3d, vod->rv3d)) == 0) + { viewzoom_apply_camera(vod, xy, viewzoom, zoom_invert, zoom_to_pos); } else { diff --git a/source/blender/editors/space_view3d/view3d_navigate_zoom_border.c b/source/blender/editors/space_view3d/view3d_navigate_zoom_border.c index fe83bbb7c59..d70c5a1ea1e 100644 --- a/source/blender/editors/space_view3d/view3d_navigate_zoom_border.c +++ b/source/blender/editors/space_view3d/view3d_navigate_zoom_border.c @@ -97,7 +97,8 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) } /* convert border to 3d coordinates */ if (!ED_view3d_unproject_v3(region, cent[0], cent[1], depth_close, p) || - !ED_view3d_unproject_v3(region, rect.xmin, rect.ymin, depth_close, p_corner)) { + !ED_view3d_unproject_v3(region, rect.xmin, rect.ymin, depth_close, p_corner)) + { return OPERATOR_CANCELLED; } @@ -120,8 +121,8 @@ static int view3d_zoom_border_exec(bContext *C, wmOperator *op) new_dist = rv3d->dist; /* convert the drawn rectangle into 3d space */ - if (depth_close != FLT_MAX && - ED_view3d_unproject_v3(region, cent[0], cent[1], depth_close, p)) { + if (depth_close != FLT_MAX && ED_view3d_unproject_v3(region, cent[0], cent[1], depth_close, p)) + { negate_v3_v3(new_ofs, p); } else { diff --git a/source/blender/editors/space_view3d/view3d_placement.c b/source/blender/editors/space_view3d/view3d_placement.c index 23b5ff58175..a62364e41d3 100644 --- a/source/blender/editors/space_view3d/view3d_placement.c +++ b/source/blender/editors/space_view3d/view3d_placement.c @@ -470,7 +470,8 @@ static bool calc_bbox(struct InteractivePlaceData *ipd, BoundBox *bounds) } if ((ipd->step_index == STEP_DEPTH) && - (compare_v3v3(ipd->step[0].co_dst, ipd->step[1].co_dst, FLT_EPSILON) == false)) { + (compare_v3v3(ipd->step[0].co_dst, ipd->step[1].co_dst, FLT_EPSILON) == false)) + { for (int i = 0; i < ARRAY_SIZE(quad_base); i++) { add_v3_v3v3(quad_secondary[i], quad_base[i], delta_local); @@ -605,7 +606,8 @@ static void draw_primitive_view_impl(const struct bContext *C, } else if (ELEM(ipd->primitive_type, PLACE_PRIMITIVE_TYPE_SPHERE_UV, - PLACE_PRIMITIVE_TYPE_SPHERE_ICO)) { + PLACE_PRIMITIVE_TYPE_SPHERE_ICO)) + { /* See bound-box diagram for reference. */ /* Primary Side. */ @@ -783,7 +785,8 @@ static void view3d_interactive_add_begin(bContext *C, wmOperator *op, const wmEv } if (ipd->step[STEP_BASE].is_degenerate_view_align || - ipd->step[STEP_DEPTH].is_degenerate_view_align) { + ipd->step[STEP_DEPTH].is_degenerate_view_align) + { RegionView3D *rv3d = ipd->region->regiondata; float axis_view[3]; add_v3_v3v3(axis_view, rv3d->viewinv[0], rv3d->viewinv[1]); @@ -1148,11 +1151,12 @@ static int view3d_interactive_add_modal(bContext *C, wmOperator *op, const wmEve if (ELEM(ipd->primitive_type, PLACE_PRIMITIVE_TYPE_CYLINDER, PLACE_PRIMITIVE_TYPE_SPHERE_UV, - PLACE_PRIMITIVE_TYPE_SPHERE_ICO)) { + PLACE_PRIMITIVE_TYPE_SPHERE_ICO)) + { RNA_float_set(&op_props, "radius", 1.0f); } - if (ELEM( - ipd->primitive_type, PLACE_PRIMITIVE_TYPE_CYLINDER, PLACE_PRIMITIVE_TYPE_CONE)) { + if (ELEM(ipd->primitive_type, PLACE_PRIMITIVE_TYPE_CYLINDER, PLACE_PRIMITIVE_TYPE_CONE)) + { RNA_float_set(&op_props, "depth", 2.0f); } if (ipd->primitive_type == PLACE_PRIMITIVE_TYPE_CONE) { @@ -1198,13 +1202,15 @@ static int view3d_interactive_add_modal(bContext *C, wmOperator *op, const wmEve ipd->step[STEP_BASE].plane, mval_fl, ipd->step[STEP_BASE].is_degenerate_view_align ? ipd->view_plane : NULL, - ipd->step[STEP_BASE].co_dst)) { + ipd->step[STEP_BASE].co_dst)) + { /* pass */ } if (ipd->use_snap && (ipd->snap_to == PLACE_SNAP_TO_DEFAULT)) { if (idp_snap_calc_incremental( - ipd->scene, ipd->v3d, ipd->region, ipd->co_src, ipd->step[STEP_BASE].co_dst)) { + ipd->scene, ipd->v3d, ipd->region, ipd->co_src, ipd->step[STEP_BASE].co_dst)) + { } } } @@ -1220,13 +1226,15 @@ static int view3d_interactive_add_modal(bContext *C, wmOperator *op, const wmEve ipd->step[STEP_DEPTH].plane, mval_fl, ipd->step[STEP_DEPTH].is_degenerate_view_align ? ipd->view_plane : NULL, - ipd->step[STEP_DEPTH].co_dst)) { + ipd->step[STEP_DEPTH].co_dst)) + { /* pass */ } if (ipd->use_snap && (ipd->snap_to == PLACE_SNAP_TO_DEFAULT)) { if (idp_snap_calc_incremental( - ipd->scene, ipd->v3d, ipd->region, ipd->co_src, ipd->step[STEP_DEPTH].co_dst)) { + ipd->scene, ipd->v3d, ipd->region, ipd->co_src, ipd->step[STEP_DEPTH].co_dst)) + { } } } diff --git a/source/blender/editors/space_view3d/view3d_project.c b/source/blender/editors/space_view3d/view3d_project.c index 1a9a80ba764..84247b07ba4 100644 --- a/source/blender/editors/space_view3d/view3d_project.c +++ b/source/blender/editors/space_view3d/view3d_project.c @@ -139,7 +139,8 @@ static eV3DProjStatus ed_view3d_project__internal(const ARegion *region, const float fy = ((float)region->winy / 2.0f) * (1.0f + (vec4[1] * scalar)); if ((flag & V3D_PROJ_TEST_CLIP_WIN) && - (fx <= 0.0f || fy <= 0.0f || fx >= (float)region->winx || fy >= (float)region->winy)) { + (fx <= 0.0f || fy <= 0.0f || fx >= (float)region->winx || fy >= (float)region->winy)) + { return V3D_PROJ_RET_CLIP_WIN; } @@ -159,8 +160,8 @@ eV3DProjStatus ED_view3d_project_short_ex(const ARegion *region, float tvec[2]; eV3DProjStatus ret = ed_view3d_project__internal(region, perspmat, is_local, co, tvec, flag); if (ret == V3D_PROJ_RET_OK) { - if ((tvec[0] > -32700.0f && tvec[0] < 32700.0f) && - (tvec[1] > -32700.0f && tvec[1] < 32700.0f)) { + if ((tvec[0] > -32700.0f && tvec[0] < 32700.0f) && (tvec[1] > -32700.0f && tvec[1] < 32700.0f)) + { r_co[0] = (short)floorf(tvec[0]); r_co[1] = (short)floorf(tvec[1]); } @@ -182,7 +183,8 @@ eV3DProjStatus ED_view3d_project_int_ex(const ARegion *region, eV3DProjStatus ret = ed_view3d_project__internal(region, perspmat, is_local, co, tvec, flag); if (ret == V3D_PROJ_RET_OK) { if ((tvec[0] > -2140000000.0f && tvec[0] < 2140000000.0f) && - (tvec[1] > -2140000000.0f && tvec[1] < 2140000000.0f)) { + (tvec[1] > -2140000000.0f && tvec[1] < 2140000000.0f)) + { r_co[0] = (int)floorf(tvec[0]); r_co[1] = (int)floorf(tvec[1]); } @@ -357,7 +359,8 @@ static void view3d_win_to_ray_segment(const struct Depsgraph *depsgraph, bool ED_view3d_clip_segment(const RegionView3D *rv3d, float ray_start[3], float ray_end[3]) { if ((rv3d->rflag & RV3D_CLIPPING) && - (clip_segment_v3_plane_n(ray_start, ray_end, rv3d->clip, 6, ray_start, ray_end) == false)) { + (clip_segment_v3_plane_n(ray_start, ray_end, rv3d->clip, 6, ray_start, ray_end) == false)) + { return false; } return true; diff --git a/source/blender/editors/space_view3d/view3d_select.cc b/source/blender/editors/space_view3d/view3d_select.cc index 4828ef03679..d195884ee62 100644 --- a/source/blender/editors/space_view3d/view3d_select.cc +++ b/source/blender/editors/space_view3d/view3d_select.cc @@ -461,7 +461,8 @@ static bool view3d_selectable_data(bContext *C) } else { if ((ob->mode & (OB_MODE_VERTEX_PAINT | OB_MODE_WEIGHT_PAINT | OB_MODE_TEXTURE_PAINT)) && - !BKE_paint_select_elem_test(ob)) { + !BKE_paint_select_elem_test(ob)) + { return false; } } @@ -528,7 +529,8 @@ static void do_lasso_select_pose__do_tag(void *userData, if (BLI_rctf_isect_segment(data->rect_fl, screen_co_a, screen_co_b) && BLI_lasso_is_edge_inside( - data->mcoords, data->mcoords_len, UNPACK2(screen_co_a), UNPACK2(screen_co_b), INT_MAX)) { + data->mcoords, data->mcoords_len, UNPACK2(screen_co_a), UNPACK2(screen_co_b), INT_MAX)) + { pchan->bone->flag |= BONE_DONE; data->is_changed = true; } @@ -610,7 +612,8 @@ static blender::Vector do_pose_tag_select_op_prepare(ViewContext *vc) blender::Vector bases; FOREACH_BASE_IN_MODE_BEGIN ( - vc->scene, vc->view_layer, vc->v3d, OB_ARMATURE, OB_MODE_POSE, base_iter) { + vc->scene, vc->view_layer, vc->v3d, OB_ARMATURE, OB_MODE_POSE, base_iter) + { Object *ob_iter = base_iter->object; bArmature *arm = static_cast(ob_iter->data); LISTBASE_FOREACH (bPoseChannel *, pchan, &ob_iter->pose->chanbase) { @@ -1021,8 +1024,8 @@ static void do_lasso_select_armature__doSelectBone(void *userData, if (screen_co_a[0] != IS_CLIPPED) { if (BLI_rcti_isect_pt(data->rect, UNPACK2(screen_co_a)) && - BLI_lasso_is_point_inside( - data->mcoords, data->mcoords_len, UNPACK2(screen_co_a), INT_MAX)) { + BLI_lasso_is_point_inside(data->mcoords, data->mcoords_len, UNPACK2(screen_co_a), INT_MAX)) + { is_inside_flag |= BONESEL_ROOT; } } @@ -1032,8 +1035,8 @@ static void do_lasso_select_armature__doSelectBone(void *userData, if (screen_co_b[0] != IS_CLIPPED) { if (BLI_rcti_isect_pt(data->rect, UNPACK2(screen_co_b)) && - BLI_lasso_is_point_inside( - data->mcoords, data->mcoords_len, UNPACK2(screen_co_b), INT_MAX)) { + BLI_lasso_is_point_inside(data->mcoords, data->mcoords_len, UNPACK2(screen_co_b), INT_MAX)) + { is_inside_flag |= BONESEL_TIP; } } @@ -1043,11 +1046,9 @@ static void do_lasso_select_armature__doSelectBone(void *userData, if (is_ignore_flag == 0) { if (is_inside_flag == (BONE_ROOTSEL | BONE_TIPSEL) || - BLI_lasso_is_edge_inside(data->mcoords, - data->mcoords_len, - UNPACK2(screen_co_a), - UNPACK2(screen_co_b), - INT_MAX)) { + BLI_lasso_is_edge_inside( + data->mcoords, data->mcoords_len, UNPACK2(screen_co_a), UNPACK2(screen_co_b), INT_MAX)) + { is_inside_flag |= BONESEL_BONE; } } @@ -1076,7 +1077,8 @@ static void do_lasso_select_armature__doSelectBone_clip_content(void *userData, } if (BLI_lasso_is_edge_inside( - data->mcoords, data->mcoords_len, UNPACK2(screen_co_a), UNPACK2(screen_co_b), INT_MAX)) { + data->mcoords, data->mcoords_len, UNPACK2(screen_co_a), UNPACK2(screen_co_b), INT_MAX)) + { is_inside_flag |= BONESEL_BONE; } @@ -1339,8 +1341,8 @@ static bool view3d_lasso_select(bContext *C, } } else { /* Edit Mode */ - FOREACH_OBJECT_IN_MODE_BEGIN ( - vc->scene, vc->view_layer, vc->v3d, ob->type, ob->mode, ob_iter) { + FOREACH_OBJECT_IN_MODE_BEGIN (vc->scene, vc->view_layer, vc->v3d, ob->type, ob->mode, ob_iter) + { ED_view3d_viewcontext_init_object(vc, ob_iter); bool changed = false; @@ -2259,7 +2261,8 @@ static Base *mouse_select_eval_buffer(ViewContext *vc, const int select_id_active = base->object->runtime.select_id; for (int i_next = 0, i_prev = hits - 1; i_next < hits; i_prev = i_next++) { if ((select_id_active == (buffer[i_prev].id & 0xFFFF)) && - (select_id_active != (buffer[i_next].id & 0xFFFF))) { + (select_id_active != (buffer[i_next].id & 0xFFFF))) + { hit_index = i_next; break; } @@ -2323,7 +2326,8 @@ static Base *mouse_select_object_center(ViewContext *vc, Base *startbase, const float screen_co[2]; if (ED_view3d_project_float_global( region, base->object->object_to_world[3], screen_co, V3D_PROJ_TEST_CLIP_DEFAULT) == - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { float dist_test = len_manhattan_v2v2(mval_fl, screen_co); if (base == oldbasact) { dist_test += penalty_dist; @@ -2689,7 +2693,8 @@ static bool ed_object_select_pick(bContext *C, /* Select pose-bones or camera-tracks. */ if (((gpu->hits > 0) && gpu->has_bones) || /* Special case, even when there are no hits, pose logic may de-select all bones. */ - ((gpu->hits == 0) && has_pose_old)) { + ((gpu->hits == 0) && has_pose_old)) + { if (basact && (gpu->has_bones && (basact->object->type == OB_CAMERA))) { MovieClip *clip = BKE_object_movieclip_get(scene, basact->object, false); @@ -2717,7 +2722,8 @@ static bool ed_object_select_pick(bContext *C, gpu->buffer, gpu->hits, params, - gpu->do_nearest)) { + gpu->do_nearest)) + { changed_pose = true; @@ -2794,7 +2800,8 @@ static bool ed_object_select_pick(bContext *C, * special exception for edit-mode - vertex-parent operator. */ if (basact && oldbasact) { if ((oldbasact->object->mode != basact->object->mode) && - (oldbasact->object->mode & basact->object->mode) == 0) { + (oldbasact->object->mode & basact->object->mode) == 0) + { basact = nullptr; } } @@ -3089,7 +3096,8 @@ static int view3d_select_exec(bContext *C, wmOperator *op) Object *obact = CTX_data_active_object(C); if (obact && obact->type == OB_GPENCIL_LEGACY && GPENCIL_ANY_MODE((bGPdata *)obact->data) && - (BKE_object_pose_armature_get_with_wpaint_check(obact) == nullptr)) { + (BKE_object_pose_armature_get_with_wpaint_check(obact) == nullptr)) + { /* Prevent acting on Grease Pencil (when not in object mode -- or not in weight-paint + pose * selection), it implements its own selection operator in other modes. We might still fall * trough to here (because that operator uses OPERATOR_PASS_THROUGH to make tweak work) but if @@ -3900,7 +3908,8 @@ static bool do_object_box_select(bContext *C, qsort(buffer, hits, sizeof(GPUSelectResult), opengl_bone_select_buffer_cmp); for (const GPUSelectResult *buf_iter = buffer, *buf_end = buf_iter + hits; buf_iter < buf_end; - buf_iter++) { + buf_iter++) + { bPoseChannel *pchan_dummy; Base *base = ED_armature_base_and_pchan_from_select_buffer( bases.data(), bases.size(), buf_iter->id, &pchan_dummy); @@ -3963,7 +3972,8 @@ static bool do_pose_box_select(bContext *C, qsort(buffer, hits, sizeof(GPUSelectResult), opengl_bone_select_buffer_cmp); for (const GPUSelectResult *buf_iter = buffer, *buf_end = buf_iter + hits; buf_iter < buf_end; - buf_iter++) { + buf_iter++) + { Bone *bone; Base *base = ED_armature_base_and_bone_from_select_buffer( bases.data(), bases.size(), buf_iter->id, &bone); @@ -4033,7 +4043,8 @@ static int view3d_box_select_exec(bContext *C, wmOperator *op) if (vc.obedit) { FOREACH_OBJECT_IN_MODE_BEGIN ( - vc.scene, vc.view_layer, vc.v3d, vc.obedit->type, vc.obedit->mode, ob_iter) { + vc.scene, vc.view_layer, vc.v3d, vc.obedit->type, vc.obedit->mode, ob_iter) + { ED_view3d_viewcontext_init_object(&vc, ob_iter); bool changed = false; @@ -4587,7 +4598,8 @@ static void do_circle_select_pose__doSelectBone(void *userData, * It works nicer to only do this if the head or tail are not in the circle, * otherwise there is no way to circle select joints alone */ if ((is_point_done == false) && (points_proj_tot == 2) && - edge_inside_circle(data->mval_fl, data->radius, screen_co_a, screen_co_b)) { + edge_inside_circle(data->mval_fl, data->radius, screen_co_a, screen_co_b)) + { if (data->select) { pchan->bone->flag |= BONE_SELECTED; } @@ -4701,7 +4713,8 @@ static void do_circle_select_armature__doSelectBone(void *userData, * It works nicer to only do this if the head or tail are not in the circle, * otherwise there is no way to circle select joints alone */ if ((is_point_done == false) && (points_proj_tot == 2) && - edge_inside_circle(data->mval_fl, data->radius, screen_co_a, screen_co_b)) { + edge_inside_circle(data->mval_fl, data->radius, screen_co_a, screen_co_b)) + { SET_FLAG_FROM_TEST(ebone->flag, data->select, BONE_SELECTED | BONE_TIPSEL | BONE_ROOTSEL); is_edge_done = true; data->is_changed = true; @@ -4896,7 +4909,8 @@ static bool object_circle_select(ViewContext *vc, if (ED_view3d_project_float_global(vc->region, base->object->object_to_world[3], screen_co, - V3D_PROJ_TEST_CLIP_DEFAULT) == V3D_PROJ_RET_OK) { + V3D_PROJ_TEST_CLIP_DEFAULT) == V3D_PROJ_RET_OK) + { if (len_squared_v2v2(mval_fl, screen_co) <= radius_squared) { ED_object_base_select(base, select ? BA_SELECT : BA_DESELECT); changed = true; @@ -4920,7 +4934,8 @@ static void view3d_circle_select_recalc(void *user_data) ViewContext vc; em_setup_viewcontext(C, &vc); FOREACH_OBJECT_IN_MODE_BEGIN ( - vc.scene, vc.view_layer, vc.v3d, vc.obact->type, vc.obact->mode, ob_iter) { + vc.scene, vc.view_layer, vc.v3d, vc.obact->type, vc.obact->mode, ob_iter) + { ED_view3d_viewcontext_init_object(&vc, ob_iter); BM_mesh_select_mode_flush_ex( vc.em->bm, vc.em->selectmode, BM_SELECT_LEN_FLUSH_RECALC_ALL); diff --git a/source/blender/editors/space_view3d/view3d_snap.c b/source/blender/editors/space_view3d/view3d_snap.c index c1f8ac1fd6c..585ceb4b547 100644 --- a/source/blender/editors/space_view3d/view3d_snap.c +++ b/source/blender/editors/space_view3d/view3d_snap.c @@ -395,7 +395,8 @@ static bool snap_selected_to_location(bContext *C, /* if the bone has a parent and is connected to the parent, * don't do anything - will break chain unless we do auto-ik. */ - (pchan->bone->flag & BONE_CONNECTED) == 0) { + (pchan->bone->flag & BONE_CONNECTED) == 0) + { pchan->bone->flag |= BONE_TRANSFORM; } else { @@ -407,7 +408,8 @@ static bool snap_selected_to_location(bContext *C, if ((pchan->bone->flag & BONE_TRANSFORM) && /* check that our parents not transformed (if we have one) */ ((pchan->bone->parent && - BKE_armature_bone_flag_test_recursive(pchan->bone->parent, BONE_TRANSFORM)) == 0)) { + BKE_armature_bone_flag_test_recursive(pchan->bone->parent, BONE_TRANSFORM)) == 0)) + { /* Get position in pchan (pose) space. */ float cursor_pose[3]; diff --git a/source/blender/editors/space_view3d/view3d_utils.c b/source/blender/editors/space_view3d/view3d_utils.c index ed5d962b837..4a06f78b427 100644 --- a/source/blender/editors/space_view3d/view3d_utils.c +++ b/source/blender/editors/space_view3d/view3d_utils.c @@ -346,7 +346,8 @@ bool ED_view3d_clipping_clamp_minmax(const RegionView3D *rv3d, float min[3], flo const float eps_coplanar = 1e-4f; const float eps_isect = 1e-6f; if (isect_planes_v3_fn( - planes, planes_len, eps_coplanar, eps_isect, points_in_planes_minmax_fn, &user_data)) { + planes, planes_len, eps_coplanar, eps_isect, points_in_planes_minmax_fn, &user_data)) + { copy_v3_v3(min, user_data.min); copy_v3_v3(max, user_data.max); return true; @@ -577,7 +578,8 @@ bool ED_view3d_camera_lock_sync(const Depsgraph *depsgraph, View3D *v3d, RegionV Object *root_parent; if (v3d->camera->transflag & OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK && - (root_parent = v3d->camera->parent)) { + (root_parent = v3d->camera->parent)) + { Object *ob_update; float tmat[4][4]; float imat[4][4]; @@ -675,7 +677,8 @@ bool ED_view3d_camera_lock_autokey(View3D *v3d, ID *id_key; Object *root_parent; if (v3d->camera->transflag & OB_TRANSFORM_ADJUST_ROOT_PARENT_FOR_VIEW_LOCK && - (root_parent = v3d->camera->parent)) { + (root_parent = v3d->camera->parent)) + { while (root_parent->parent) { root_parent = root_parent->parent; } @@ -871,7 +874,8 @@ static void view3d_boxview_sync_axis(RegionView3D *rv3d_dst, RegionView3D *rv3d_ /* we could use rv3d->viewinv, but better not depend on view matrix being updated */ if (UNLIKELY(ED_view3d_quat_from_axis_view(rv3d_src->view, rv3d_src->view_axis_roll, viewinv) == - false)) { + false)) + { return; } invert_qt_normalized(viewinv); @@ -879,7 +883,8 @@ static void view3d_boxview_sync_axis(RegionView3D *rv3d_dst, RegionView3D *rv3d_ mul_qt_v3(viewinv, view_src_y); if (UNLIKELY(ED_view3d_quat_from_axis_view(rv3d_dst->view, rv3d_dst->view_axis_roll, viewinv) == - false)) { + false)) + { return; } invert_qt_normalized(viewinv); @@ -889,7 +894,8 @@ static void view3d_boxview_sync_axis(RegionView3D *rv3d_dst, RegionView3D *rv3d_ /* check source and dest have a matching axis */ for (i = 0; i < 3; i++) { if (((fabsf(view_src_x[i]) > axis_eps) || (fabsf(view_src_y[i]) > axis_eps)) && - ((fabsf(view_dst_x[i]) > axis_eps) || (fabsf(view_dst_y[i]) > axis_eps))) { + ((fabsf(view_dst_x[i]) > axis_eps) || (fabsf(view_dst_y[i]) > axis_eps))) + { rv3d_dst->ofs[i] = rv3d_src->ofs[i]; } } @@ -1450,9 +1456,11 @@ bool ED_view3d_quat_to_axis_view(const float quat[4], /* Under 45 degrees, just pick the closest value. */ for (int view = RV3D_VIEW_FRONT; view <= RV3D_VIEW_BOTTOM; view++) { for (int view_axis_roll = RV3D_VIEW_AXIS_ROLL_0; view_axis_roll <= RV3D_VIEW_AXIS_ROLL_270; - view_axis_roll++) { + view_axis_roll++) + { if (fabsf(angle_signed_qtqt( - quat, view3d_quat_axis[view - RV3D_VIEW_FRONT][view_axis_roll])) < epsilon) { + quat, view3d_quat_axis[view - RV3D_VIEW_FRONT][view_axis_roll])) < epsilon) + { *r_view = view; *r_view_axis_roll = view_axis_roll; return true; @@ -1465,7 +1473,8 @@ bool ED_view3d_quat_to_axis_view(const float quat[4], float delta_best = FLT_MAX; for (int view = RV3D_VIEW_FRONT; view <= RV3D_VIEW_BOTTOM; view++) { for (int view_axis_roll = RV3D_VIEW_AXIS_ROLL_0; view_axis_roll <= RV3D_VIEW_AXIS_ROLL_270; - view_axis_roll++) { + view_axis_roll++) + { const float delta_test = fabsf( angle_signed_qtqt(quat, view3d_quat_axis[view - RV3D_VIEW_FRONT][view_axis_roll])); if (delta_best > delta_test) { @@ -1616,7 +1625,8 @@ static bool view3d_camera_to_view_selected_impl(struct Main *bmain, float scale; /* only for ortho cameras */ if (BKE_camera_view_frame_fit_to_scene( - depsgraph, scene, camera_ob_eval, co, &scale, r_clip_start, r_clip_end)) { + depsgraph, scene, camera_ob_eval, co, &scale, r_clip_start, r_clip_end)) + { ObjectTfmProtectedChannels obtfm; float obmat_new[4][4]; bool is_ortho_camera = false; @@ -1663,7 +1673,8 @@ bool ED_view3d_camera_to_view_selected_with_set_clipping(struct Main *bmain, float clip_start; float clip_end; if (view3d_camera_to_view_selected_impl( - bmain, depsgraph, scene, camera_ob, &clip_start, &clip_end)) { + bmain, depsgraph, scene, camera_ob, &clip_start, &clip_end)) + { ((Camera *)camera_ob->data)->clip_start = clip_start; ((Camera *)camera_ob->data)->clip_end = clip_end; diff --git a/source/blender/editors/space_view3d/view3d_view.c b/source/blender/editors/space_view3d/view3d_view.c index bd17c673dc8..74ba3c7794e 100644 --- a/source/blender/editors/space_view3d/view3d_view.c +++ b/source/blender/editors/space_view3d/view3d_view.c @@ -170,7 +170,8 @@ static void sync_viewport_camera_smoothview(bContext *C, for (bScreen *screen = bmain->screens.first; screen != NULL; screen = screen->id.next) { for (ScrArea *area = screen->areabase.first; area != NULL; area = area->next) { for (SpaceLink *space_link = area->spacedata.first; space_link != NULL; - space_link = space_link->next) { + space_link = space_link->next) + { if (space_link->spacetype == SPACE_VIEW3D) { View3D *other_v3d = (View3D *)space_link; if (other_v3d == v3d) { @@ -513,7 +514,8 @@ eV3DSelectObjectFilter ED_view3d_select_filter_from_mode(const Scene *scene, con { if (scene->toolsettings->object_flag & SCE_OBJECT_MODE_LOCK) { if (obact && (obact->mode & OB_MODE_ALL_WEIGHT_PAINT) && - BKE_object_pose_armature_get((Object *)obact)) { + BKE_object_pose_armature_get((Object *)obact)) + { return VIEW3D_SELECT_FILTER_WPAINT_POSE_MODE_LOCK; } return VIEW3D_SELECT_FILTER_OBJECT_MODE_LOCK; diff --git a/source/blender/editors/transform/transform.c b/source/blender/editors/transform/transform.c index 71497b178d6..77ed865159c 100644 --- a/source/blender/editors/transform/transform.c +++ b/source/blender/editors/transform/transform.c @@ -75,7 +75,8 @@ bool transdata_check_local_islands(TransInfo *t, short around) void setTransformViewMatrices(TransInfo *t) { if (!(t->options & CTX_PAINT_CURVE) && (t->spacetype == SPACE_VIEW3D) && t->region && - (t->region->regiontype == RGN_TYPE_WINDOW)) { + (t->region->regiontype == RGN_TYPE_WINDOW)) + { RegionView3D *rv3d = t->region->regiondata; copy_m4_m4(t->viewmat, rv3d->viewmat); @@ -372,7 +373,8 @@ void projectFloatView(TransInfo *t, const float vec[3], float adr[2]) void applyAspectRatio(TransInfo *t, float vec[2]) { if ((t->spacetype == SPACE_IMAGE) && (t->mode == TFM_TRANSLATION) && - !(t->options & CTX_PAINT_CURVE)) { + !(t->options & CTX_PAINT_CURVE)) + { SpaceImage *sima = t->area->spacedata.first; if ((sima->flag & SI_COORDFLOATS) == 0) { @@ -647,7 +649,8 @@ static bool transform_modal_item_poll(const wmOperator *op, int value) * `Move` operation. * * Ideally we should check if it really uses the same key. */ - t->mode != TFM_TRANSLATION)) { + t->mode != TFM_TRANSLATION)) + { return false; } if (value == TFM_MODAL_TRACKBALL && @@ -660,7 +663,8 @@ static bool transform_modal_item_poll(const wmOperator *op, int value) * `Rotate` operation. * * Ideally we should check if it really uses the same key. */ - t->mode != TFM_ROTATION) { + t->mode != TFM_ROTATION) + { return false; } if (value == TFM_MODAL_ROTATE_NORMALS) { @@ -925,7 +929,8 @@ int transformEvent(TransInfo *t, const wmEvent *event) /* Handle modal numinput events first, if already activated. */ if (((event->val == KM_PRESS) || (event->type == EVT_MODAL_MAP)) && hasNumInput(&t->num) && - handleNumInput(t->context, &(t->num), event)) { + handleNumInput(t->context, &(t->num), event)) + { t->redraw |= TREDRAW_HARD; handled = true; } @@ -970,7 +975,8 @@ int transformEvent(TransInfo *t, const wmEvent *event) } if ((event->val == TFM_MODAL_TRANSLATE && t->mode == TFM_TRANSLATION) || - (event->val == TFM_MODAL_RESIZE && t->mode == TFM_RESIZE)) { + (event->val == TFM_MODAL_RESIZE && t->mode == TFM_RESIZE)) + { if (t->data_type == &TransConvertType_Tracking) { restoreTransObjects(t); @@ -985,7 +991,8 @@ int transformEvent(TransInfo *t, const wmEvent *event) (event->val == TFM_MODAL_TRACKBALL && t->mode == TFM_TRACKBALL) || (event->val == TFM_MODAL_ROTATE_NORMALS && t->mode == TFM_NORMAL_ROTATION) || (event->val == TFM_MODAL_VERT_EDGE_SLIDE && - ELEM(t->mode, TFM_VERT_SLIDE, TFM_EDGE_SLIDE))) { + ELEM(t->mode, TFM_VERT_SLIDE, TFM_EDGE_SLIDE))) + { break; } @@ -1177,7 +1184,8 @@ int transformEvent(TransInfo *t, const wmEvent *event) case TFM_MODAL_AUTOCONSTRAINT: case TFM_MODAL_AUTOCONSTRAINTPLANE: if ((t->flag & T_RELEASE_CONFIRM) && (event->prev_val == KM_RELEASE) && - event->prev_type == t->launch_event) { + event->prev_type == t->launch_event) + { /* Confirm transform if launch key is released after mouse move. */ t->state = TRANS_CONFIRM; } @@ -1326,13 +1334,15 @@ int transformEvent(TransInfo *t, const wmEvent *event) /* Per transform event, if present */ if (t->handleEvent && (!handled || /* Needed for vertex slide, see #38756. */ - (event->type == MOUSEMOVE))) { + (event->type == MOUSEMOVE))) + { t->redraw |= t->handleEvent(t, event); } /* Try to init modal numinput now, if possible. */ if (!(handled || t->redraw) && ((event->val == KM_PRESS) || (event->type == EVT_MODAL_MAP)) && - handleNumInput(t->context, &(t->num), event)) { + handleNumInput(t->context, &(t->num), event)) + { t->redraw |= TREDRAW_HARD; handled = true; } @@ -1534,7 +1544,8 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) if ((t->flag & T_MODAL) || (op->flag & OP_IS_REPEAT)) { /* save settings if not set in operator */ if ((prop = RNA_struct_find_property(op->ptr, "use_proportional_edit")) && - !RNA_property_is_set(op->ptr, prop)) { + !RNA_property_is_set(op->ptr, prop)) + { BKE_view_layer_synced_ensure(t->scene, t->view_layer); const Object *obact = BKE_view_layer_active_object_get(t->view_layer); @@ -1567,7 +1578,8 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) } if ((prop = RNA_struct_find_property(op->ptr, "proportional_edit_falloff")) && - !RNA_property_is_set(op->ptr, prop)) { + !RNA_property_is_set(op->ptr, prop)) + { ts->prop_mode = t->prop_mode; } } @@ -1695,7 +1707,8 @@ void saveTransform(bContext *C, TransInfo *t, wmOperator *op) } if ((prop = RNA_struct_find_property(op->ptr, "orient_matrix_type")) && - !RNA_property_is_set(op->ptr, prop)) { + !RNA_property_is_set(op->ptr, prop)) + { /* Set the first time to register on redo. */ RNA_property_enum_set(op->ptr, prop, orient_type_set); RNA_float_set_array(op->ptr, "orient_matrix", &t->spacemtx[0][0]); @@ -1791,28 +1804,32 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve t->state = TRANS_STARTING; if ((prop = RNA_struct_find_property(op->ptr, "cursor_transform")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { if (RNA_property_boolean_get(op->ptr, prop)) { options |= CTX_CURSOR; } } if ((prop = RNA_struct_find_property(op->ptr, "texture_space")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { if (RNA_property_boolean_get(op->ptr, prop)) { options |= CTX_TEXTURE_SPACE; } } if ((prop = RNA_struct_find_property(op->ptr, "gpencil_strokes")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { if (RNA_property_boolean_get(op->ptr, prop)) { options |= CTX_GPENCIL_STROKES; } } if ((prop = RNA_struct_find_property(op->ptr, "view2d_edge_pan")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { if (RNA_property_boolean_get(op->ptr, prop)) { options |= CTX_VIEW2D_EDGE_PAN; } @@ -1844,7 +1861,8 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve SPACE_NODE, SPACE_GRAPH, SPACE_ACTION, - SPACE_SEQ)) { + SPACE_SEQ)) + { t->draw_handle_view = ED_region_draw_cb_activate( t->region->type, drawTransformView, t, REGION_DRAW_POST_VIEW); t->draw_handle_cursor = WM_paint_cursor_activate( @@ -1901,7 +1919,8 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve (ELEM(kmi->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY) && (event->modifier & KM_SHIFT)) || (ELEM(kmi->type, EVT_LEFTALTKEY, EVT_RIGHTALTKEY) && (event->modifier & KM_ALT)) || - ((kmi->type == EVT_OSKEY) && (event->modifier & KM_OSKEY))) { + ((kmi->type == EVT_OSKEY) && (event->modifier & KM_OSKEY))) + { t->modifiers |= MOD_SNAP_INVERT; } break; @@ -1923,7 +1942,8 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve (ELEM(kmi->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY) && (event->modifier & KM_SHIFT)) || (ELEM(kmi->type, EVT_LEFTALTKEY, EVT_RIGHTALTKEY) && (event->modifier & KM_ALT)) || - ((kmi->type == EVT_OSKEY) && (event->modifier & KM_OSKEY))) { + ((kmi->type == EVT_OSKEY) && (event->modifier & KM_OSKEY))) + { t->modifiers &= ~MOD_NODE_ATTACH; } break; @@ -1952,7 +1972,8 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve /* Initialize accurate transform to settings requested by keymap. */ bool use_accurate = false; if ((prop = RNA_struct_find_property(op->ptr, "use_accurate")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { if (RNA_property_boolean_get(op->ptr, prop)) { use_accurate = true; } @@ -1977,11 +1998,13 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve /* Transformation axis from operator */ if ((prop = RNA_struct_find_property(op->ptr, "orient_axis")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { t->orient_axis = RNA_property_enum_get(op->ptr, prop); } if ((prop = RNA_struct_find_property(op->ptr, "orient_axis_ortho")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { t->orient_axis_ortho = RNA_property_enum_get(op->ptr, prop); } @@ -2108,7 +2131,8 @@ bool checkUseAxisMatrix(TransInfo *t) /* currently only checks for editmode */ if (t->flag & T_EDIT) { if ((t->around == V3D_AROUND_LOCAL_ORIGINS) && - ELEM(t->obedit_type, OB_MESH, OB_CURVES_LEGACY, OB_MBALL, OB_ARMATURE)) { + ELEM(t->obedit_type, OB_MESH, OB_CURVES_LEGACY, OB_MBALL, OB_ARMATURE)) + { /* not all editmode supports axis-matrix */ return true; } diff --git a/source/blender/editors/transform/transform_constraints.c b/source/blender/editors/transform/transform_constraints.c index 25034e0bb08..3b94adc3bb8 100644 --- a/source/blender/editors/transform/transform_constraints.c +++ b/source/blender/editors/transform/transform_constraints.c @@ -304,7 +304,8 @@ void transform_constraint_snap_axis_to_edge(const TransInfo *t, const float *edge_dir = t->tsnap.snapNormal; bool is_aligned = fabsf(dot_v3v3(axis, edge_dir)) > (1.0f - CONSTRAIN_EPSILON); if (!is_aligned && - isect_ray_ray_v3(t->tsnap.snap_source, axis, edge_snap_point, edge_dir, &lambda, NULL)) { + isect_ray_ray_v3(t->tsnap.snap_source, axis, edge_snap_point, edge_dir, &lambda, NULL)) + { mul_v3_v3fl(r_out, axis, lambda); } } @@ -576,7 +577,8 @@ static void constraints_rotation_impl(const TransInfo *t, } /* don't flip axis if asked to or if num input */ if (r_angle && - !((mode & CON_NOFLIP) || hasNumInput(&t->num) || (t->flag & T_INPUT_IS_VALUES_FINAL))) { + !((mode & CON_NOFLIP) || hasNumInput(&t->num) || (t->flag & T_INPUT_IS_VALUES_FINAL))) + { float view_vector[3]; view_vector_calc(t, t->center_global, view_vector); if (dot_v3v3(r_axis, view_vector) > 0.0f) { diff --git a/source/blender/editors/transform/transform_convert.c b/source/blender/editors/transform/transform_convert.c index 889895148ad..7ce18b1fa74 100644 --- a/source/blender/editors/transform/transform_convert.c +++ b/source/blender/editors/transform/transform_convert.c @@ -560,7 +560,8 @@ bool constraints_list_needinv(TransInfo *t, ListBase *list) CONSTRAINT_TYPE_CLAMPTO, CONSTRAINT_TYPE_ARMATURE, CONSTRAINT_TYPE_OBJECTSOLVER, - CONSTRAINT_TYPE_FOLLOWTRACK)) { + CONSTRAINT_TYPE_FOLLOWTRACK)) + { return true; } @@ -588,7 +589,8 @@ bool constraints_list_needinv(TransInfo *t, ListBase *list) bTransLikeConstraint *data = (bTransLikeConstraint *)con->data; if (ELEM(data->mix_mode, TRANSLIKE_MIX_BEFORE, TRANSLIKE_MIX_BEFORE_FULL) && - ELEM(t->mode, TFM_ROTATION, TFM_TRANSLATION)) { + ELEM(t->mode, TFM_ROTATION, TFM_TRANSLATION)) + { return true; } if (ELEM(data->mix_mode, TRANSLIKE_MIX_BEFORE_SPLIT) && ELEM(t->mode, TFM_ROTATION)) { @@ -600,7 +602,8 @@ bool constraints_list_needinv(TransInfo *t, ListBase *list) bActionConstraint *data = (bActionConstraint *)con->data; if (ELEM(data->mix_mode, ACTCON_MIX_BEFORE, ACTCON_MIX_BEFORE_FULL) && - ELEM(t->mode, TFM_ROTATION, TFM_TRANSLATION)) { + ELEM(t->mode, TFM_ROTATION, TFM_TRANSLATION)) + { return true; } if (ELEM(data->mix_mode, ACTCON_MIX_BEFORE_SPLIT) && ELEM(t->mode, TFM_ROTATION)) { @@ -686,7 +689,8 @@ static int countAndCleanTransDataContainer(TransInfo *t) for (TransDataContainer *th_end = t->data_container - 1, *tc = &t->data_container[t->data_container_len - 1]; tc != th_end; - tc--) { + tc--) + { if (tc->data_len == 0) { uint index = tc - t->data_container; if (index + 1 != t->data_container_len) { @@ -726,7 +730,8 @@ static void init_proportional_edit(TransInfo *t) &TransConvertType_MeshVertCData, &TransConvertType_Node, &TransConvertType_Object, - &TransConvertType_Particle)) { + &TransConvertType_Particle)) + { /* Disable proportional editing */ t->options |= CTX_NO_PET; t->flag &= ~T_PROP_EDIT_ALL; @@ -747,7 +752,8 @@ static void init_proportional_edit(TransInfo *t) else if (ELEM(t->data_type, &TransConvertType_Mesh, &TransConvertType_MeshSkin, - &TransConvertType_MeshVertCData)) { + &TransConvertType_MeshVertCData)) + { if (t->flag & T_PROP_CONNECTED) { /* Already calculated by transform_convert_mesh_connectivity_distance. */ } @@ -793,7 +799,8 @@ static void init_TransDataContainers(TransInfo *t, &TransConvertType_MeshEdge, &TransConvertType_MeshSkin, &TransConvertType_MeshUV, - &TransConvertType_MeshVertCData)) { + &TransConvertType_MeshVertCData)) + { /* Does not support Multi object editing. */ return; } @@ -802,7 +809,8 @@ static void init_TransDataContainers(TransInfo *t, const short object_type = obact ? obact->type : -1; if ((object_mode & OB_MODE_EDIT) || (t->data_type == &TransConvertType_GPencil) || - ((object_mode & OB_MODE_POSE) && (object_type == OB_ARMATURE))) { + ((object_mode & OB_MODE_POSE) && (object_type == OB_ARMATURE))) + { if (t->data_container) { MEM_freeN(t->data_container); } @@ -886,7 +894,8 @@ static TransConvertTypeInfo *convert_type_get(const TransInfo *t, Object **r_obj return &TransConvertType_Cursor3D; } if (!(t->options & CTX_PAINT_CURVE) && (t->spacetype == SPACE_VIEW3D) && ob && - (ob->mode == OB_MODE_SCULPT) && ob->sculpt) { + (ob->mode == OB_MODE_SCULPT) && ob->sculpt) + { return &TransConvertType_Sculpt; } if (t->options & CTX_TEXTURE_SPACE) { @@ -981,7 +990,8 @@ static TransConvertTypeInfo *convert_type_get(const TransInfo *t, Object **r_obj return NULL; } if (ob && (ob->mode & OB_MODE_PARTICLE_EDIT) && - PE_start_edit(PE_get_current(t->depsgraph, t->scene, ob))) { + PE_start_edit(PE_get_current(t->depsgraph, t->scene, ob))) + { return &TransConvertType_Particle; } if (ob && ((ob->mode & OB_MODE_ALL_PAINT) || (ob->mode & OB_MODE_SCULPT_CURVES))) { @@ -1170,7 +1180,8 @@ void animrecord_check_state(TransInfo *t, struct ID *id) * - the option to add new actions for each round is not enabled */ if (IS_AUTOKEY_FLAG(scene, INSERTAVAIL) == 0 && - (scene->toolsettings->autokey_flag & ANIMRECORD_FLAG_WITHNLA)) { + (scene->toolsettings->autokey_flag & ANIMRECORD_FLAG_WITHNLA)) + { /* if playback has just looped around, * we need to add a new NLA track+strip to allow a clean pass to occur */ if ((sad) && (sad->flag & ANIMPLAY_FLAG_JUMPED)) { diff --git a/source/blender/editors/transform/transform_convert_action.c b/source/blender/editors/transform/transform_convert_action.c index 6afe4c62aa7..4b01d087bdc 100644 --- a/source/blender/editors/transform/transform_convert_action.c +++ b/source/blender/editors/transform/transform_convert_action.c @@ -115,7 +115,8 @@ static int count_masklayer_frames(MaskLayer *masklay, char side, float cfra, boo /* only include points that occur on the right side of cfra */ for (masklayer_shape = masklay->splines_shapes.first; masklayer_shape; - masklayer_shape = masklayer_shape->next) { + masklayer_shape = masklayer_shape->next) + { if (FrameOnMouseSide(side, (float)masklayer_shape->frame, cfra)) { if (masklayer_shape->flag & MASK_SHAPE_SELECT) { count++; @@ -268,7 +269,8 @@ static int MaskLayerToTransData(TransData *td, /* check for select frames on right side of current frame */ for (masklay_shape = masklay->splines_shapes.first; masklay_shape; - masklay_shape = masklay_shape->next) { + masklay_shape = masklay_shape->next) + { if (is_prop_edit || (masklay_shape->flag & MASK_SHAPE_SELECT)) { if (FrameOnMouseSide(side, (float)masklay_shape->frame, cfra)) { tfd->val = (float)masklay_shape->frame; @@ -486,7 +488,8 @@ static void createTransActionData(bContext *C, TransInfo *t) MaskLayerShape *masklay_shape; for (masklay_shape = masklay->splines_shapes.first; masklay_shape; - masklay_shape = masklay_shape->next) { + masklay_shape = masklay_shape->next) + { if (FrameOnMouseSide(t->frame_side, (float)masklay_shape->frame, cfra)) { if (masklay_shape->flag & MASK_SHAPE_SELECT) { td->dist = td->rdist = 0.0f; @@ -674,7 +677,8 @@ static void posttrans_mask_clean(Mask *mask) if (is_double) { for (masklay_shape = masklay->splines_shapes.first; masklay_shape; - masklay_shape = masklay_shape_next) { + masklay_shape = masklay_shape_next) + { masklay_shape_next = masklay_shape->next; if (masklay_shape_next && masklay_shape->frame == masklay_shape_next->frame) { BKE_mask_layer_shape_unlink(masklay, masklay_shape); @@ -684,7 +688,8 @@ static void posttrans_mask_clean(Mask *mask) #ifdef DEBUG for (masklay_shape = masklay->splines_shapes.first; masklay_shape; - masklay_shape = masklay_shape->next) { + masklay_shape = masklay_shape->next) + { BLI_assert(!masklay_shape->next || masklay_shape->frame < masklay_shape->next->frame); } #endif diff --git a/source/blender/editors/transform/transform_convert_armature.c b/source/blender/editors/transform/transform_convert_armature.c index 7d191969c47..74f126e293e 100644 --- a/source/blender/editors/transform/transform_convert_armature.c +++ b/source/blender/editors/transform/transform_convert_armature.c @@ -111,7 +111,8 @@ static void autokeyframe_pose( for (pchan = pose->chanbase.first; pchan; pchan = pchan->next) { if ((pchan->bone->flag & BONE_TRANSFORM) == 0 && - !((pose->flag & POSE_MIRROR_EDIT) && (pchan->bone->flag & BONE_TRANSFORM_MIRROR))) { + !((pose->flag & POSE_MIRROR_EDIT) && (pchan->bone->flag & BONE_TRANSFORM_MIRROR))) + { continue; } @@ -170,9 +171,8 @@ static void autokeyframe_pose( } } else if (ELEM(tmode, TFM_ROTATION, TFM_TRACKBALL)) { - if (ELEM(scene->toolsettings->transform_pivot_point, - V3D_AROUND_CURSOR, - V3D_AROUND_ACTIVE)) { + if (ELEM(scene->toolsettings->transform_pivot_point, V3D_AROUND_CURSOR, V3D_AROUND_ACTIVE)) + { do_loc = true; } @@ -181,9 +181,8 @@ static void autokeyframe_pose( } } else if (tmode == TFM_RESIZE) { - if (ELEM(scene->toolsettings->transform_pivot_point, - V3D_AROUND_CURSOR, - V3D_AROUND_ACTIVE)) { + if (ELEM(scene->toolsettings->transform_pivot_point, V3D_AROUND_CURSOR, V3D_AROUND_ACTIVE)) + { do_loc = true; } @@ -263,7 +262,8 @@ static bKinematicConstraint *has_targetless_ik(bPoseChannel *pchan) for (; con; con = con->next) { if (con->type == CONSTRAINT_TYPE_KINEMATIC && (con->flag & CONSTRAINT_OFF) == 0 && - (con->enforce != 0.0f)) { + (con->enforce != 0.0f)) + { bKinematicConstraint *data = con->data; if (data->tar == NULL) { @@ -632,8 +632,8 @@ static void add_pose_transdata(TransInfo *t, bPoseChannel *pchan, Object *ob, Tr /* exceptional case: rotate the pose bone which also applies transformation * when a parentless bone has BONE_NO_LOCAL_LOCATION [] */ - if (!ELEM(t->mode, TFM_TRANSLATION, TFM_RESIZE) && - (pchan->bone->flag & BONE_NO_LOCAL_LOCATION)) { + if (!ELEM(t->mode, TFM_TRANSLATION, TFM_RESIZE) && (pchan->bone->flag & BONE_NO_LOCAL_LOCATION)) + { if (pchan->parent) { /* same as td->smtx but without pchan->bone->bone_mat */ td->flag |= TD_PBONE_LOCAL_MTX_C; @@ -1056,7 +1056,8 @@ static void createTransArmatureVerts(bContext *UNUSED(C), TransInfo *t) * However, in rotation mode, we want to keep that 'rotate bone around root with * only its tip selected' behavior (see #46325). */ if ((t->around == V3D_AROUND_LOCAL_ORIGINS) && - ((t->mode == TFM_ROTATION) || (ebo->flag & BONE_ROOTSEL))) { + ((t->mode == TFM_ROTATION) || (ebo->flag & BONE_ROOTSEL))) + { copy_v3_v3(td->center, ebo->head); } else { @@ -1509,7 +1510,8 @@ static void bone_children_clear_transflag(int mode, short around, ListBase *lb) bone->flag |= BONE_HINGE_CHILD_TRANSFORM; } else if ((bone->flag & BONE_TRANSFORM) && ELEM(mode, TFM_ROTATION, TFM_TRACKBALL) && - (around == V3D_AROUND_LOCAL_ORIGINS)) { + (around == V3D_AROUND_LOCAL_ORIGINS)) + { bone->flag |= BONE_TRANSFORM_CHILD; } else { diff --git a/source/blender/editors/transform/transform_convert_graph.c b/source/blender/editors/transform/transform_convert_graph.c index 68c3479fb5d..42c78951869 100644 --- a/source/blender/editors/transform/transform_convert_graph.c +++ b/source/blender/editors/transform/transform_convert_graph.c @@ -538,7 +538,8 @@ static void createTransGraphEditData(bContext *C, TransInfo *t) * - If so, change them auto-handles to aligned handles so that handles get affected too */ if (ELEM(bezt->h1, HD_AUTO, HD_AUTO_ANIM) && ELEM(bezt->h2, HD_AUTO, HD_AUTO_ANIM) && - ELEM(t->mode, TFM_ROTATION, TFM_RESIZE)) { + ELEM(t->mode, TFM_ROTATION, TFM_RESIZE)) + { if (hdata && (sel_left) && (sel_right)) { bezt->h1 = HD_ALIGN; bezt->h2 = HD_ALIGN; @@ -654,7 +655,8 @@ static void flushTransGraphData(TransInfo *t) /* flush to 2d vector from internally used 3d vector */ for (a = 0, td = tc->data, td2d = tc->data_2d, tdg = tc->custom.type.data; a < tc->data_len; - a++, td++, td2d++, tdg++) { + a++, td++, td2d++, tdg++) + { /* pointers to relevant AnimData blocks are stored in the td->extra pointers */ AnimData *adt = (AnimData *)td->extra; @@ -758,7 +760,8 @@ static void sort_time_beztmaps(BeztMap *bezms, int totvert) */ if (bezm->swapHs == 0) { if ((bezm->bezt->vec[0][0] > bezm->bezt->vec[1][0]) && - (bezm->bezt->vec[2][0] < bezm->bezt->vec[1][0])) { + (bezm->bezt->vec[2][0] < bezm->bezt->vec[1][0])) + { /* handles need to be swapped */ bezm->swapHs = 1; } diff --git a/source/blender/editors/transform/transform_convert_mesh.c b/source/blender/editors/transform/transform_convert_mesh.c index 902b995680f..3ea7048f9f0 100644 --- a/source/blender/editors/transform/transform_convert_mesh.c +++ b/source/blender/editors/transform/transform_convert_mesh.c @@ -193,7 +193,8 @@ static BMFace *tc_mesh_customdatacorrect_find_best_face_substitute(BMFace *f) /* Check the loops edge isn't selected. */ if (!BM_elem_flag_test(l_radial_next->v, BM_ELEM_SELECT) && - !BM_elem_flag_test(l_radial_next->next->v, BM_ELEM_SELECT)) { + !BM_elem_flag_test(l_radial_next->next->v, BM_ELEM_SELECT)) + { /* Prefer edges with unselected vertices. * Useful for extrude. */ best_face = f_test; @@ -273,7 +274,8 @@ static void tc_mesh_customdatacorrect_init_vert(struct TransCustomDataLayer *tcl if (tcld->use_merge_group) { if ((l_prev = BM_loop_find_prev_nodouble(l, l->next, FLT_EPSILON)) && - (l_next = BM_loop_find_next_nodouble(l, l_prev, FLT_EPSILON))) { + (l_next = BM_loop_find_next_nodouble(l, l_prev, FLT_EPSILON))) + { loop_weights[j] = angle_v3v3v3(l_prev->v->co, l->v->co, l_next->v->co); } else { @@ -456,7 +458,8 @@ void transform_convert_mesh_customdatacorrect_init(TransInfo *t) TFM_SHRINKFATTEN, TFM_TRACKBALL, TFM_PUSHPULL, - TFM_ALIGN)) { + TFM_ALIGN)) + { { if (!(t->settings->uvcalc_flag & UVCALC_TRANSFORM_CORRECT)) { /* No custom-data correction. */ @@ -559,13 +562,15 @@ static void tc_mesh_customdatacorrect_apply_vert(struct TransCustomDataLayer *tc * 'sv->co_orig_3d', see: #45096. */ project_plane_normalized_v3_v3v3(v_proj[0], co_prev, v_proj_axis); while (UNLIKELY(((co_prev_ok = (len_squared_v3v3(v_proj[1], v_proj[0]) > eps)) == false) && - ((l_prev = l_prev->prev) != l->next))) { + ((l_prev = l_prev->prev) != l->next))) + { co_prev = tc_mesh_vert_orig_co_get(tcld, l_prev->v); project_plane_normalized_v3_v3v3(v_proj[0], co_prev, v_proj_axis); } project_plane_normalized_v3_v3v3(v_proj[2], co_next, v_proj_axis); while (UNLIKELY(((co_next_ok = (len_squared_v3v3(v_proj[1], v_proj[2]) > eps)) == false) && - ((l_next = l_next->next) != l->prev))) { + ((l_next = l_next->next) != l->prev))) + { co_next = tc_mesh_vert_orig_co_get(tcld, l_next->v); project_plane_normalized_v3_v3v3(v_proj[2], co_next, v_proj_axis); } @@ -919,8 +924,8 @@ static bool bmesh_test_dist_add(BMVert *v0, int *index, const float mtx[3][3]) { - if ((BM_elem_flag_test(v0, BM_ELEM_SELECT) == 0) && - (BM_elem_flag_test(v0, BM_ELEM_HIDDEN) == 0)) { + if ((BM_elem_flag_test(v0, BM_ELEM_SELECT) == 0) && (BM_elem_flag_test(v0, BM_ELEM_HIDDEN) == 0)) + { const int i0 = BM_elem_index_get(v0); const int i1 = BM_elem_index_get(v1); @@ -1079,7 +1084,8 @@ void transform_convert_mesh_connectivity_distance(struct BMesh *bm, BM_ITER_ELEM (e_other, &eiter, v2, BM_EDGES_OF_VERT) { if (e_other != e && BM_elem_flag_test(e_other, tag_queued) == 0 && !BM_elem_flag_test(e_other, BM_ELEM_HIDDEN) && - (BM_elem_flag_test(e, tag_loose) || BM_elem_flag_test(e_other, tag_loose))) { + (BM_elem_flag_test(e, tag_loose) || BM_elem_flag_test(e_other, tag_loose))) + { BM_elem_flag_enable(e_other, tag_queued); BLI_LINKSTACK_PUSH(queue_next, e_other); } @@ -1111,7 +1117,8 @@ void transform_convert_mesh_connectivity_distance(struct BMesh *bm, if (e_other != e && BM_elem_flag_test(e_other, tag_queued) == 0 && !BM_elem_flag_test(e_other, BM_ELEM_HIDDEN) && (BM_elem_flag_test(e_other, tag_loose) || - dists[BM_elem_index_get(BM_edge_other_vert(e_other, v_other))] != FLT_MAX)) { + dists[BM_elem_index_get(BM_edge_other_vert(e_other, v_other))] != FLT_MAX)) + { BM_elem_flag_enable(e_other, tag_queued); BLI_LINKSTACK_PUSH(queue_next, e_other); } @@ -1430,7 +1437,8 @@ static void VertsToTransData(TransInfo *t, copy_v3_v3(td->iloc, td->loc); if ((t->mode == TFM_SHRINKFATTEN) && (em->selectmode & SCE_SELECT_FACE) && - BM_elem_flag_test(eve, BM_ELEM_SELECT) && BM_vert_calc_normal_ex(eve, BM_ELEM_SELECT, _no)) { + BM_elem_flag_test(eve, BM_ELEM_SELECT) && BM_vert_calc_normal_ex(eve, BM_ELEM_SELECT, _no)) + { no = _no; } else { @@ -1747,8 +1755,8 @@ static BMPartialUpdate *tc_mesh_partial_ensure(TransInfo *t, BLI_bitmap *verts_mask = NULL; int verts_mask_count = 0; /* Number of elements enabled in `verts_mask`. */ - if ((partial_type == PARTIAL_TYPE_GROUP) && - ((t->flag & T_PROP_EDIT) || tc->use_mirror_axis_any)) { + if ((partial_type == PARTIAL_TYPE_GROUP) && ((t->flag & T_PROP_EDIT) || tc->use_mirror_axis_any)) + { verts_group = MEM_callocN(sizeof(*verts_group) * em->bm->totvert, __func__); int i; TransData *td; @@ -1823,7 +1831,8 @@ static BMPartialUpdate *tc_mesh_partial_ensure(TransInfo *t, for (i = 0; i < tc->data_mirror_len; i++, td_mirror++) { BMVert *v_mirr = (BMVert *)POINTER_OFFSET(td_mirror->loc_src, -offsetof(BMVert, co)); if (!BLI_BITMAP_TEST(verts_mask, BM_elem_index_get(v_mirr)) && - equals_v3v3(td_mirror->loc, td_mirror->iloc)) { + equals_v3v3(td_mirror->loc, td_mirror->iloc)) + { continue; } @@ -1913,7 +1922,8 @@ static void tc_mesh_partial_types_calc(TransInfo *t, struct PartialTypeState *r_ * Uniform negative scale can keep normals as-is since the faces are flipped, * normals remain unchanged. */ if ((t->con.mode & CON_APPLY) || - (t->values_final[0] != t->values_final[1] || t->values_final[0] != t->values_final[2])) { + (t->values_final[0] != t->values_final[1] || t->values_final[0] != t->values_final[2])) + { partial_for_normals = PARTIAL_TYPE_ALL; } break; @@ -1958,7 +1968,8 @@ static void tc_mesh_partial_update(TransInfo *t, partial_state_prev->for_normals); if ((partial_for_looptri == PARTIAL_TYPE_ALL) && (partial_for_normals == PARTIAL_TYPE_ALL) && - (em->bm->totvert == em->bm->totvertsel)) { + (em->bm->totvert == em->bm->totvertsel)) + { /* The additional cost of generating the partial connectivity data isn't justified * when all data needs to be updated. * diff --git a/source/blender/editors/transform/transform_convert_mesh_edge.c b/source/blender/editors/transform/transform_convert_mesh_edge.c index e5c2c90f957..6ad5c260b85 100644 --- a/source/blender/editors/transform/transform_convert_mesh_edge.c +++ b/source/blender/editors/transform/transform_convert_mesh_edge.c @@ -84,7 +84,8 @@ static void createTransEdge(bContext *UNUSED(C), TransInfo *t) BM_ITER_MESH (eed, &iter, em->bm, BM_EDGES_OF_MESH) { if (!BM_elem_flag_test(eed, BM_ELEM_HIDDEN) && - (BM_elem_flag_test(eed, BM_ELEM_SELECT) || is_prop_edit)) { + (BM_elem_flag_test(eed, BM_ELEM_SELECT) || is_prop_edit)) + { float *fl_ptr; /* need to set center for center calculations */ mid_v3_v3v3(td->center, eed->v1->co, eed->v2->co); diff --git a/source/blender/editors/transform/transform_convert_nla.c b/source/blender/editors/transform/transform_convert_nla.c index 532e1edc825..c7ba989f37b 100644 --- a/source/blender/editors/transform/transform_convert_nla.c +++ b/source/blender/editors/transform/transform_convert_nla.c @@ -184,12 +184,14 @@ static void nlastrip_flag_overlaps(NlaStrip *strip) NlaStrip *adj_strip = strip->prev; if (adj_strip != NULL && !(adj_strip->flag & NLASTRIP_FLAG_SELECT) && - nlastrip_is_overlap(strip, 0, adj_strip, 0)) { + nlastrip_is_overlap(strip, 0, adj_strip, 0)) + { strip->flag |= NLASTRIP_FLAG_INVALID_LOCATION; } adj_strip = strip->next; if (adj_strip != NULL && !(adj_strip->flag & NLASTRIP_FLAG_SELECT) && - nlastrip_is_overlap(strip, 0, adj_strip, 0)) { + nlastrip_is_overlap(strip, 0, adj_strip, 0)) + { strip->flag |= NLASTRIP_FLAG_INVALID_LOCATION; } } @@ -590,7 +592,8 @@ static void recalcData_nla(TransInfo *t) for (track = tdn->nlt->next, n = 0; (track) && (n < delta); track = track->next, n++) { /* check if space in this track for the strip */ if (BKE_nlatrack_has_space(track, strip->start, strip->end) && - !BKE_nlatrack_is_nonlocal_in_liboverride(tdn->id, track)) { + !BKE_nlatrack_is_nonlocal_in_liboverride(tdn->id, track)) + { /* move strip to this track */ BKE_nlatrack_remove_strip(tdn->nlt, strip); BKE_nlatrack_add_strip(track, strip, is_liboverride); @@ -610,7 +613,8 @@ static void recalcData_nla(TransInfo *t) for (track = tdn->nlt->prev, n = 0; (track) && (n < delta); track = track->prev, n++) { /* check if space in this track for the strip */ if (BKE_nlatrack_has_space(track, strip->start, strip->end) && - !BKE_nlatrack_is_nonlocal_in_liboverride(tdn->id, track)) { + !BKE_nlatrack_is_nonlocal_in_liboverride(tdn->id, track)) + { /* move strip to this track */ BKE_nlatrack_remove_strip(tdn->nlt, strip); BKE_nlatrack_add_strip(track, strip, is_liboverride); diff --git a/source/blender/editors/transform/transform_convert_node.cc b/source/blender/editors/transform/transform_convert_node.cc index 65ad2579af9..196873b3926 100644 --- a/source/blender/editors/transform/transform_convert_node.cc +++ b/source/blender/editors/transform/transform_convert_node.cc @@ -161,7 +161,8 @@ static void node_snap_grid_apply(TransInfo *t) using namespace blender; if (!(transform_snap_is_active(t) && - (t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID)))) { + (t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID)))) + { return; } diff --git a/source/blender/editors/transform/transform_convert_object.c b/source/blender/editors/transform/transform_convert_object.c index 5945ebc2860..4abd8535b45 100644 --- a/source/blender/editors/transform/transform_convert_object.c +++ b/source/blender/editors/transform/transform_convert_object.c @@ -382,8 +382,8 @@ static void set_trans_object_base_flags(TransInfo *t) } if (parsel != NULL) { /* Rotation around local centers are allowed to propagate. */ - if ((t->around == V3D_AROUND_LOCAL_ORIGINS) && - ELEM(t->mode, TFM_ROTATION, TFM_TRACKBALL)) { + if ((t->around == V3D_AROUND_LOCAL_ORIGINS) && ELEM(t->mode, TFM_ROTATION, TFM_TRACKBALL)) + { base->flag_legacy |= BA_TRANSFORM_CHILD; } else { @@ -444,7 +444,8 @@ static int count_proportional_objects(TransInfo *t) /* all base not already selected or marked that is editable */ if ((base->object->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 && (base->flag & BASE_SELECTED) == 0 && - (BASE_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base))) { + (BASE_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base))) + { mark_children(base->object); } } @@ -457,7 +458,8 @@ static int count_proportional_objects(TransInfo *t) */ if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 && (base->flag & BASE_SELECTED) == 0 && - (BASE_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base))) { + (BASE_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base))) + { flush_trans_object_base_deps_flag(depsgraph, ob); total += 1; } @@ -577,7 +579,8 @@ static void createTransObject(bContext *C, TransInfo *t) * or not a child of selection and it is editable and selectable */ if ((ob->flag & (BA_TRANSFORM_CHILD | BA_TRANSFORM_PARENT)) == 0 && (base->flag & BASE_SELECTED) == 0 && BASE_EDITABLE(v3d, base) && - BASE_SELECTABLE(v3d, base)) { + BASE_SELECTABLE(v3d, base)) + { td->protectflag = ob->protectflag; td->ext = tx; td->ext->rotOrder = ob->rotmode; @@ -610,7 +613,8 @@ static void createTransObject(bContext *C, TransInfo *t) /* if base is not selected, not a parent of selection * or not a child of selection and it is editable and selectable */ if ((base->flag_legacy & BA_WAS_SEL) && (base->flag & BASE_SELECTED) == 0 && - BASE_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base)) { + BASE_EDITABLE(v3d, base) && BASE_SELECTABLE(v3d, base)) + { Object *ob_parent = ob->parent; if (ob_parent != NULL) { @@ -657,7 +661,8 @@ static void createTransObject(bContext *C, TransInfo *t) Object *ob = base->object; if (ob->parent != NULL) { if (ob->parent && !BLI_gset_haskey(objects_in_transdata, ob->parent) && - !BLI_gset_haskey(objects_in_transdata, ob)) { + !BLI_gset_haskey(objects_in_transdata, ob)) + { if ((base->flag_legacy & BA_WAS_SEL) && (base->flag & BASE_SELECTED) == 0) { Base *base_parent = BKE_view_layer_base_find(view_layer, ob->parent); if (base_parent && !BASE_XFORM_INDIRECT(base_parent)) { diff --git a/source/blender/editors/transform/transform_convert_sequencer.c b/source/blender/editors/transform/transform_convert_sequencer.c index 8a42ac8a73d..eae733a9044 100644 --- a/source/blender/editors/transform/transform_convert_sequencer.c +++ b/source/blender/editors/transform/transform_convert_sequencer.c @@ -376,7 +376,8 @@ static Sequence *effect_input_get(const Scene *scene, Sequence *effect, SeqInput if (effect->seq2 && (SEQ_time_left_handle_frame_get(scene, effect->seq2) - SEQ_time_left_handle_frame_get(scene, effect->seq1)) * side > - 0) { + 0) + { input = effect->seq2; } return input; diff --git a/source/blender/editors/transform/transform_convert_tracking.c b/source/blender/editors/transform/transform_convert_tracking.c index deb39e8c092..1d9ec136ae1 100644 --- a/source/blender/editors/transform/transform_convert_tracking.c +++ b/source/blender/editors/transform/transform_convert_tracking.c @@ -461,7 +461,8 @@ static void flushTransTracking(TransInfo *t) /* flush to 2d vector from internally used 3d vector */ for (td_index = 0, td = tc->data, td2d = tc->data_2d, tdt = tc->custom.type.data; td_index < tc->data_len; - td_index++, td2d++, td++, tdt++) { + td_index++, td2d++, td++, tdt++) + { if (tdt->mode == transDataTracking_ModeTracks) { float loc2d[2]; diff --git a/source/blender/editors/transform/transform_convert_tracking_curves.c b/source/blender/editors/transform/transform_convert_tracking_curves.c index d11487c4e22..ebc20c4616b 100644 --- a/source/blender/editors/transform/transform_convert_tracking_curves.c +++ b/source/blender/editors/transform/transform_convert_tracking_curves.c @@ -247,7 +247,8 @@ static void flushTransTrackingCurves(TransInfo *t) /* flush to 2d vector from internally used 3d vector */ for (td_index = 0, td = tc->data, td2d = tc->data_2d, tdt = tc->custom.type.data; td_index < tc->data_len; - td_index++, td2d++, td++, tdt++) { + td_index++, td2d++, td++, tdt++) + { { td2d->loc2d[tdt->coord] = tdt->prev_pos[tdt->coord] + td2d->loc[1] * tdt->scale; } diff --git a/source/blender/editors/transform/transform_generics.c b/source/blender/editors/transform/transform_generics.c index c13eca2532e..f7238eac67e 100644 --- a/source/blender/editors/transform/transform_generics.c +++ b/source/blender/editors/transform/transform_generics.c @@ -147,7 +147,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve t->flag = 0; if (obact && !(t->options & (CTX_CURSOR | CTX_TEXTURE_SPACE)) && - ELEM(object_mode, OB_MODE_EDIT, OB_MODE_EDIT_GPENCIL)) { + ELEM(object_mode, OB_MODE_EDIT, OB_MODE_EDIT_GPENCIL)) + { t->obedit_type = obact->type; } else { @@ -210,7 +211,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve t->remove_on_cancel = false; if (op && (prop = RNA_struct_find_property(op->ptr, "remove_on_cancel")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { if (RNA_property_boolean_get(op->ptr, prop)) { t->remove_on_cancel = true; } @@ -316,7 +318,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve setTransformViewAspect(t, t->aspect); if (op && (prop = RNA_struct_find_property(op->ptr, "center_override")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { RNA_property_float_get_array(op->ptr, prop, t->center_global); mul_v3_v3(t->center_global, t->aspect); t->flag |= T_OVERRIDE_CENTER; @@ -339,7 +342,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve bool t_values_set_is_array = false; if (op && (prop = RNA_struct_find_property(op->ptr, "value")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { float values[4] = {0}; /* in case value isn't length 4, avoid uninitialized memory. */ if (RNA_property_array_check(prop)) { RNA_property_float_get_array(op->ptr, prop, values); @@ -405,7 +409,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve } if (op && ((prop = RNA_struct_find_property(op->ptr, "orient_type")) && - RNA_property_is_set(op->ptr, prop))) { + RNA_property_is_set(op->ptr, prop))) + { orient_type_set = RNA_property_enum_get(op->ptr, prop); if (orient_type_set >= V3D_ORIENT_CUSTOM + BIF_countTransformOrientation(C)) { orient_type_set = V3D_ORIENT_GLOBAL; @@ -429,11 +434,13 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve * changes. */ if (op && !(op->flag & OP_IS_REPEAT_LAST) && ((prop = RNA_struct_find_property(op->ptr, "orient_matrix")) && - RNA_property_is_set(op->ptr, prop))) { + RNA_property_is_set(op->ptr, prop))) + { RNA_property_float_get_array(op->ptr, prop, &custom_matrix[0][0]); if ((prop = RNA_struct_find_property(op->ptr, "orient_matrix_type")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { orient_type_matrix_set = RNA_property_enum_get(op->ptr, prop); } else if (orient_type_set == -1) { @@ -515,7 +522,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve } if (op && ((prop = RNA_struct_find_property(op->ptr, "release_confirm")) && - RNA_property_is_set(op->ptr, prop))) { + RNA_property_is_set(op->ptr, prop))) + { if (RNA_property_boolean_get(op->ptr, prop)) { t->flag |= T_RELEASE_CONFIRM; } @@ -523,14 +531,16 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve else { /* Release confirms preference should not affect node editor (#69288, #70504). */ if (ISMOUSE_BUTTON(t->launch_event) && - ((U.flag & USER_RELEASECONFIRM) || (t->spacetype == SPACE_NODE))) { + ((U.flag & USER_RELEASECONFIRM) || (t->spacetype == SPACE_NODE))) + { /* Global "release confirm" on mouse bindings */ t->flag |= T_RELEASE_CONFIRM; } } - if (op && ((prop = RNA_struct_find_property(op->ptr, "mirror")) && - RNA_property_is_set(op->ptr, prop))) { + if (op && + ((prop = RNA_struct_find_property(op->ptr, "mirror")) && RNA_property_is_set(op->ptr, prop))) + { if (!RNA_property_boolean_get(op->ptr, prop)) { t->flag |= T_NO_MIRROR; } @@ -592,7 +602,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve } if (op && ((prop = RNA_struct_find_property(op->ptr, "proportional_size")) && - RNA_property_is_set(op->ptr, prop))) { + RNA_property_is_set(op->ptr, prop))) + { t->prop_size = RNA_property_float_get(op->ptr, prop); } else { @@ -606,7 +617,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve } if (op && ((prop = RNA_struct_find_property(op->ptr, "proportional_edit_falloff")) && - RNA_property_is_set(op->ptr, prop))) { + RNA_property_is_set(op->ptr, prop))) + { t->prop_mode = RNA_property_enum_get(op->ptr, prop); } else { @@ -619,7 +631,8 @@ void initTransInfo(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve if (t->obedit_type == OB_MESH) { if (op && (prop = RNA_struct_find_property(op->ptr, "use_automerge_and_split")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { if (RNA_property_boolean_get(op->ptr, prop)) { t->flag |= T_AUTOMERGE | T_AUTOSPLIT; } @@ -714,7 +727,8 @@ void postTrans(bContext *C, TransInfo *t) FOREACH_TRANS_DATA_CONTAINER (t, tc) { /* free data malloced per trans-data */ if (ELEM(t->obedit_type, OB_CURVES_LEGACY, OB_SURF, OB_GPENCIL_LEGACY) || - (t->spacetype == SPACE_GRAPH)) { + (t->spacetype == SPACE_GRAPH)) + { TransData *td = tc->data; for (int a = 0; a < tc->data_len; a++, td++) { if (td->flag & TD_BEZTRIPLE) { @@ -880,7 +894,8 @@ void calculateCenterCursor(TransInfo *t, float r_center[3]) /* If edit or pose mode, move cursor in local space */ if (t->options & CTX_PAINT_CURVE) { if (ED_view3d_project_float_global(t->region, cursor, r_center, V3D_PROJ_TEST_NOP) != - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { r_center[0] = t->region->winx / 2.0f; r_center[1] = t->region->winy / 2.0f; } @@ -1221,7 +1236,8 @@ void calculatePropRatio(TransInfo *t) td->factor = 1.0f; } else if ((connected && (td->flag & TD_NOTCONNECTED || td->dist > t->prop_size)) || - (connected == 0 && td->rdist > t->prop_size)) { + (connected == 0 && td->rdist > t->prop_size)) + { td->factor = 0.0f; restoreElement(td); } diff --git a/source/blender/editors/transform/transform_gizmo_3d.cc b/source/blender/editors/transform/transform_gizmo_3d.cc index 76dd627c9ba..8b5780ab91b 100644 --- a/source/blender/editors/transform/transform_gizmo_3d.cc +++ b/source/blender/editors/transform/transform_gizmo_3d.cc @@ -250,7 +250,8 @@ static bool gizmo_is_axis_visible(const RegionView3D *rv3d, if ((axis_type == MAN_AXES_TRANSLATE && !(twtype & V3D_GIZMO_SHOW_OBJECT_TRANSLATE)) || (axis_type == MAN_AXES_ROTATE && !(twtype & V3D_GIZMO_SHOW_OBJECT_ROTATE)) || - (axis_type == MAN_AXES_SCALE && !(twtype & V3D_GIZMO_SHOW_OBJECT_SCALE))) { + (axis_type == MAN_AXES_SCALE && !(twtype & V3D_GIZMO_SHOW_OBJECT_SCALE))) + { return false; } @@ -649,7 +650,8 @@ static int gizmo_3d_foreach_selected(const bContext *C, if ((ebo->flag & BONE_ROOTSEL) && /* don't include same point multiple times */ ((ebo->flag & BONE_CONNECTED) && (ebo->parent != nullptr) && - (ebo->parent->flag & BONE_TIPSEL) && EBONE_VISIBLE(arm, ebo->parent)) == 0) { + (ebo->parent->flag & BONE_TIPSEL) && EBONE_VISIBLE(arm, ebo->parent)) == 0) + { run_coord_with_matrix(ebo->head, use_mat_local, mat_local); totsel++; @@ -872,7 +874,8 @@ static int gizmo_3d_foreach_selected(const bContext *C, } for (base = static_cast(BKE_view_layer_object_bases_get(view_layer)->first); base; - base = base->next) { + base = base->next) + { if (!BASE_SELECTED_EDITABLE(v3d, base)) { continue; } @@ -1192,8 +1195,8 @@ void gizmo_xform_message_subscribe(wmGizmoGroup *gzgroup, } } - if ((ts->transform_pivot_point == V3D_AROUND_CURSOR) || - (orient_slot->type == V3D_ORIENT_CURSOR)) { + if ((ts->transform_pivot_point == V3D_AROUND_CURSOR) || (orient_slot->type == V3D_ORIENT_CURSOR)) + { /* We could be more specific here, for now subscribe to any cursor change. */ PointerRNA cursor_ptr; RNA_pointer_create(&scene->id, &RNA_View3DCursor, &scene->cursor, &cursor_ptr); @@ -2130,7 +2133,8 @@ static void WIDGETGROUP_gizmo_invoke_prepare(const bContext *C, const TransformOrientationSlot *orient_slot = BKE_scene_orientation_slot_get_from_flag( scene, ggd->twtype_init); if ((gz == ggd->gizmos[MAN_AXIS_ROT_C]) || - (orient_slot == &scene->orientation_slots[SCE_ORIENT_DEFAULT])) { + (orient_slot == &scene->orientation_slots[SCE_ORIENT_DEFAULT])) + { /* #MAN_AXIS_ROT_C always uses the #V3D_ORIENT_VIEW orientation, * optionally we could set this orientation instead of unset the property. */ RNA_property_unset(ptr, prop_orient_type); @@ -2204,7 +2208,8 @@ static bool WIDGETGROUP_gizmo_poll_context(const bContext *C, wmGizmoGroupType * return false; } if ((v3d->gizmo_show_object & (V3D_GIZMO_SHOW_OBJECT_TRANSLATE | V3D_GIZMO_SHOW_OBJECT_ROTATE | - V3D_GIZMO_SHOW_OBJECT_SCALE)) == 0) { + V3D_GIZMO_SHOW_OBJECT_SCALE)) == 0) + { return false; } @@ -2332,7 +2337,8 @@ void transform_gizmo_3d_model_from_constraint_and_mode_init(TransInfo *t) nullptr; if (!gizmo_modal_current || !ELEM(gizmo_modal_current->parent_gzgroup->type, g_GGT_xform_gizmo, - g_GGT_xform_gizmo_context)) { + g_GGT_xform_gizmo_context)) + { t->flag |= T_NO_GIZMO; } } diff --git a/source/blender/editors/transform/transform_gizmo_3d_cage.cc b/source/blender/editors/transform/transform_gizmo_3d_cage.cc index 67e7fcfb922..3619a2904e1 100644 --- a/source/blender/editors/transform/transform_gizmo_3d_cage.cc +++ b/source/blender/editors/transform/transform_gizmo_3d_cage.cc @@ -112,7 +112,8 @@ static void WIDGETGROUP_xform_cage_refresh(const bContext *C, wmGizmoGroup *gzgr calc_params.use_local_axis = true; calc_params.orientation_index = orient_index + 1; if ((ED_transform_calc_gizmo_stats(C, &calc_params, &tbounds, rv3d) == 0) || - equals_v3v3(rv3d->tw_axis_min, rv3d->tw_axis_max)) { + equals_v3v3(rv3d->tw_axis_min, rv3d->tw_axis_max)) + { WM_gizmo_set_flag(gz, WM_GIZMO_HIDDEN, true); } else { diff --git a/source/blender/editors/transform/transform_gizmo_extrude_3d.c b/source/blender/editors/transform/transform_gizmo_extrude_3d.c index a622ea365d3..643500cb837 100644 --- a/source/blender/editors/transform/transform_gizmo_extrude_3d.c +++ b/source/blender/editors/transform/transform_gizmo_extrude_3d.c @@ -257,7 +257,8 @@ static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *gzgroup) .orientation_index = V3D_ORIENT_NORMAL + 1, }, &tbounds_normal, - rv3d)) { + rv3d)) + { unit_m3(tbounds_normal.axis); } copy_m3_m3(ggd->data.normal_mat3, tbounds_normal.axis); @@ -269,7 +270,8 @@ static void gizmo_mesh_extrude_refresh(const bContext *C, wmGizmoGroup *gzgroup) .orientation_index = ggd->data.orientation_index + 1, }, &tbounds, - rv3d)) { + rv3d)) + { return; } diff --git a/source/blender/editors/transform/transform_input.c b/source/blender/editors/transform/transform_input.c index 1295486550a..bba57ff9602 100644 --- a/source/blender/editors/transform/transform_input.c +++ b/source/blender/editors/transform/transform_input.c @@ -57,8 +57,8 @@ static void InputSpringFlip(TransInfo *t, MouseInput *mi, const double mval[2], /* flip scale */ /* values can become really big when zoomed in so use longs #26598. */ if (((int64_t)((int)mi->center[0] - mval[0]) * (int64_t)((int)mi->center[0] - mi->imval[0]) + - (int64_t)((int)mi->center[1] - mval[1]) * (int64_t)((int)mi->center[1] - mi->imval[1])) < - 0) { + (int64_t)((int)mi->center[1] - mval[1]) * (int64_t)((int)mi->center[1] - mi->imval[1])) < 0) + { output[0] *= -1.0f; } } diff --git a/source/blender/editors/transform/transform_mode.c b/source/blender/editors/transform/transform_mode.c index 1fa00aaed5b..1ced9904179 100644 --- a/source/blender/editors/transform/transform_mode.c +++ b/source/blender/editors/transform/transform_mode.c @@ -951,7 +951,8 @@ void ElementResize(const TransInfo *t, &TransConvertType_Sculpt, &TransConvertType_Object, &TransConvertType_ObjectTexSpace, - &TransConvertType_Pose)) { + &TransConvertType_Pose)) + { float obsizemat[3][3]; /* Reorient the size mat to fit the oriented object. */ mul_m3_m3m3(obsizemat, tmat, td->axismtx); @@ -1245,7 +1246,8 @@ void transform_mode_default_modal_orientation_set(TransInfo *t, int type) View3D *v3d = NULL; RegionView3D *rv3d = NULL; if ((type == V3D_ORIENT_VIEW) && (t->spacetype == SPACE_VIEW3D) && t->region && - (t->region->regiontype == RGN_TYPE_WINDOW)) { + (t->region->regiontype == RGN_TYPE_WINDOW)) + { v3d = t->view; rv3d = t->region->regiondata; } diff --git a/source/blender/editors/transform/transform_mode_curveshrinkfatten.c b/source/blender/editors/transform/transform_mode_curveshrinkfatten.c index 276827d1b4c..ce411ec25b6 100644 --- a/source/blender/editors/transform/transform_mode_curveshrinkfatten.c +++ b/source/blender/editors/transform/transform_mode_curveshrinkfatten.c @@ -104,7 +104,8 @@ void initCurveShrinkFatten(TransInfo *t) float scale_factor = 0.0f; if (((t->spacetype == SPACE_VIEW3D) && (t->region->regiontype == RGN_TYPE_WINDOW) && (t->data_len_all == 1)) || - (t->data_len_all == 3 && TRANS_DATA_CONTAINER_FIRST_OK(t)->data[0].val == NULL)) { + (t->data_len_all == 3 && TRANS_DATA_CONTAINER_FIRST_OK(t)->data[0].val == NULL)) + { /* For cases where only one point on the curve is being transformed and the radius of that * point is zero, use the factor to multiply the offset of the ratio and allow scaling. * Note that for bezier curves, 3 TransData equals 1 point in most cases. */ diff --git a/source/blender/editors/transform/transform_mode_edge_slide.c b/source/blender/editors/transform/transform_mode_edge_slide.c index f54624c1a1b..4f4c75b63e3 100644 --- a/source/blender/editors/transform/transform_mode_edge_slide.c +++ b/source/blender/editors/transform/transform_mode_edge_slide.c @@ -444,7 +444,8 @@ static void calcEdgeSlide_mval_range(TransInfo *t, if (is_visible) { if ((dist_best_sq == -1.0f) || /* intentionally use 2d size on 3d vector */ - (dist_sq < dist_best_sq && (len_squared_v2v2(sco_b, sco_a) > 0.1f))) { + (dist_sq < dist_best_sq && (len_squared_v2v2(sco_b, sco_a) > 0.1f))) + { dist_best_sq = dist_sq; sub_v3_v3v3(mval_dir, sco_b, sco_a); } @@ -994,7 +995,8 @@ static EdgeSlideData *createEdgeSlideVerts_single_side(TransInfo *t, TransDataCo if ((BM_elem_flag_test(e_step, BM_ELEM_SELECT) && BM_elem_flag_test(v_other, BM_ELEM_SELECT)) && - (endpoint == 0)) { + (endpoint == 0)) + { /* scan down the list */ TransDataEdgeSlideVert *sv; BLI_assert(sv_table[BM_elem_index_get(v_other)] == -1); diff --git a/source/blender/editors/transform/transform_mode_rotate.c b/source/blender/editors/transform/transform_mode_rotate.c index 713902f6c62..ca3fd92b3e1 100644 --- a/source/blender/editors/transform/transform_mode_rotate.c +++ b/source/blender/editors/transform/transform_mode_rotate.c @@ -120,7 +120,8 @@ static void transdata_elem_rotate(const TransInfo *t, if (is_large_rotation && td->ext != NULL && td->ext->rotOrder == ROT_MODE_EUL) { copy_v3_v3(td->ext->rot, td->ext->irot); for (float angle_progress = angle_step; fabsf(angle_progress) < fabsf(angle_final); - angle_progress += angle_step) { + angle_progress += angle_step) + { axis_angle_normalized_to_mat3(rmc->mat, axis_final, angle_progress); ElementRotation(t, tc, td, rmc->mat, t->around); } diff --git a/source/blender/editors/transform/transform_mode_translate.c b/source/blender/editors/transform/transform_mode_translate.c index 18812bc9671..1abef353de5 100644 --- a/source/blender/editors/transform/transform_mode_translate.c +++ b/source/blender/editors/transform/transform_mode_translate.c @@ -622,7 +622,8 @@ static void applyTranslation(TransInfo *t, const int UNUSED(mval[2])) float incr_dir[3]; copy_v3_v3(incr_dir, global_dir); if (!(transform_snap_is_active(t) && validSnap(t)) && - transform_snap_increment_ex(t, (t->con.mode & CON_APPLY) != 0, incr_dir)) { + transform_snap_increment_ex(t, (t->con.mode & CON_APPLY) != 0, incr_dir)) + { /* Test for mixed snap with grid. */ float snap_dist_sq = FLT_MAX; diff --git a/source/blender/editors/transform/transform_orientations.c b/source/blender/editors/transform/transform_orientations.c index 64bd87cbf79..34c63b34d8d 100644 --- a/source/blender/editors/transform/transform_orientations.c +++ b/source/blender/editors/transform/transform_orientations.c @@ -1177,7 +1177,8 @@ int getTransformOrientation_ex(const Scene *scene, if (flag) { float tvec[3]; if ((around == V3D_AROUND_LOCAL_ORIGINS) || - ELEM(flag, SEL_F2, SEL_F1 | SEL_F3, SEL_F1 | SEL_F2 | SEL_F3)) { + ELEM(flag, SEL_F2, SEL_F1 | SEL_F3, SEL_F1 | SEL_F2 | SEL_F3)) + { BKE_nurb_bezt_calc_normal(nu, bezt, tvec); add_v3_v3(normal, tvec); } @@ -1301,10 +1302,10 @@ int getTransformOrientation_ex(const Scene *scene, add_v3_v3(plane, tmat[1]); ok = true; } - else if ((ok == false) && - ((ebone->flag & BONE_TIPSEL) || - ((ebone->flag & BONE_ROOTSEL) && - (ebone->parent && ebone->flag & BONE_CONNECTED) == false))) { + else if ((ok == false) && ((ebone->flag & BONE_TIPSEL) || + ((ebone->flag & BONE_ROOTSEL) && + (ebone->parent && ebone->flag & BONE_CONNECTED) == false))) + { ED_armature_ebone_to_mat3(ebone, tmat); add_v3_v3(fallback_normal, tmat[2]); add_v3_v3(fallback_plane, tmat[1]); diff --git a/source/blender/editors/transform/transform_snap.cc b/source/blender/editors/transform/transform_snap.cc index be900cf41b8..a1fc4ba75f2 100644 --- a/source/blender/editors/transform/transform_snap.cc +++ b/source/blender/editors/transform/transform_snap.cc @@ -101,7 +101,8 @@ static bool snap_use_backface_culling(const TransInfo *t) } if (v3d->shading.type == OB_RENDER && (t->scene->display.shading.flag & V3D_SHADING_BACKFACE_CULLING) && - BKE_scene_uses_blender_workbench(t->scene)) { + BKE_scene_uses_blender_workbench(t->scene)) + { return true; } if (t->settings->snap_flag & SCE_SNAP_BACKFACE_CULLING) { @@ -584,7 +585,8 @@ bool validSnappingNormal(const TransInfo *t) static bool bm_edge_is_snap_target(BMEdge *e, void * /*user_data*/) { if (BM_elem_flag_test(e, BM_ELEM_SELECT | BM_ELEM_HIDDEN) || - BM_elem_flag_test(e->v1, BM_ELEM_SELECT) || BM_elem_flag_test(e->v2, BM_ELEM_SELECT)) { + BM_elem_flag_test(e->v1, BM_ELEM_SELECT) || BM_elem_flag_test(e->v2, BM_ELEM_SELECT)) + { return false; } @@ -643,7 +645,8 @@ static eSnapMode snap_mode_from_spacetype(TransInfo *t) if (t->spacetype == SPACE_IMAGE) { eSnapMode snap_mode = eSnapMode(ts->snap_uv_mode); if ((snap_mode & SCE_SNAP_MODE_INCREMENT) && (ts->snap_uv_flag & SCE_SNAP_ABS_GRID) && - (t->mode == TFM_TRANSLATION)) { + (t->mode == TFM_TRANSLATION)) + { snap_mode &= ~SCE_SNAP_MODE_INCREMENT; snap_mode |= SCE_SNAP_MODE_GRID; } @@ -661,7 +664,8 @@ static eSnapMode snap_mode_from_spacetype(TransInfo *t) eSnapMode snap_mode = eSnapMode(ts->snap_mode); if ((snap_mode & SCE_SNAP_MODE_INCREMENT) && (ts->snap_flag & SCE_SNAP_ABS_GRID) && - (t->mode == TFM_TRANSLATION)) { + (t->mode == TFM_TRANSLATION)) + { /* Special case in which snap to increments is transformed to snap to grid. */ snap_mode &= ~SCE_SNAP_MODE_INCREMENT; snap_mode |= SCE_SNAP_MODE_GRID; @@ -742,7 +746,8 @@ static void initSnappingMode(TransInfo *t) if ((t->spacetype != SPACE_VIEW3D) || !(t->tsnap.mode & (SCE_SNAP_MODE_FACE_RAYCAST | SCE_SNAP_MODE_FACE_NEAREST)) || - (t->flag & T_NO_PROJECT)) { + (t->flag & T_NO_PROJECT)) + { /* Force project off when not supported. */ t->tsnap.flag &= ~SCE_SNAP_PROJECT; } @@ -805,7 +810,8 @@ void initSnapping(TransInfo *t, wmOperator *op) t->modifiers |= MOD_SNAP; if ((prop = RNA_struct_find_property(op->ptr, "snap_elements")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { t->tsnap.mode = eSnapMode(RNA_property_enum_get(op->ptr, prop)); } @@ -813,7 +819,8 @@ void initSnapping(TransInfo *t, wmOperator *op) * "target" (now, "source" is geometry to be moved and "target" is geometry to which moved * geometry is snapped). */ if ((prop = RNA_struct_find_property(op->ptr, "snap_target")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { snap_source = eSnapSourceOP(RNA_property_enum_get(op->ptr, prop)); } @@ -835,35 +842,40 @@ void initSnapping(TransInfo *t, wmOperator *op) } if ((prop = RNA_struct_find_property(op->ptr, "use_snap_project")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { SET_FLAG_FROM_TEST( t->tsnap.flag, RNA_property_boolean_get(op->ptr, prop), SCE_SNAP_PROJECT); } /* use_snap_self is misnamed and should be use_snap_active */ if ((prop = RNA_struct_find_property(op->ptr, "use_snap_self")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { SET_FLAG_FROM_TEST(t->tsnap.target_operation, !RNA_property_boolean_get(op->ptr, prop), SCE_SNAP_TARGET_NOT_ACTIVE); } if ((prop = RNA_struct_find_property(op->ptr, "use_snap_edit")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { SET_FLAG_FROM_TEST(t->tsnap.target_operation, !RNA_property_boolean_get(op->ptr, prop), SCE_SNAP_TARGET_NOT_EDITED); } if ((prop = RNA_struct_find_property(op->ptr, "use_snap_nonedit")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { SET_FLAG_FROM_TEST(t->tsnap.target_operation, !RNA_property_boolean_get(op->ptr, prop), SCE_SNAP_TARGET_NOT_NONEDITED); } if ((prop = RNA_struct_find_property(op->ptr, "use_snap_selectable")) && - RNA_property_is_set(op->ptr, prop)) { + RNA_property_is_set(op->ptr, prop)) + { SET_FLAG_FROM_TEST(t->tsnap.target_operation, RNA_property_boolean_get(op->ptr, prop), SCE_SNAP_TARGET_ONLY_SELECTABLE); @@ -997,7 +1009,8 @@ eRedrawFlag updateSelectedSnapPoint(TransInfo *t) float dist_sq; if (ED_view3d_project_float_global(t->region, p->co, screen_loc, V3D_PROJ_TEST_NOP) != - V3D_PROJ_RET_OK) { + V3D_PROJ_RET_OK) + { continue; } @@ -1124,7 +1137,8 @@ static void snap_target_uv_fn(TransInfo *t, float * /*vec*/) t->mval, t->tsnap.target_operation & SCE_SNAP_TARGET_NOT_SELECTED, &dist_sq, - t->tsnap.snap_target)) { + t->tsnap.snap_target)) + { t->tsnap.snap_target[0] *= t->aspect[0]; t->tsnap.snap_target[1] *= t->aspect[1]; @@ -1431,7 +1445,8 @@ bool peelObjectsTransform(TransInfo *t, /* if peeling objects, take the first and last from each object */ hit_max = hit_min; for (SnapObjectHitDepth *iter = static_cast(depths_peel.first); iter; - iter = iter->next) { + iter = iter->next) + { if ((iter->depth > hit_max->depth) && (iter->ob_uuid == hit_min->ob_uuid)) { hit_max = iter; } @@ -1440,7 +1455,8 @@ bool peelObjectsTransform(TransInfo *t, else { /* otherwise, pair first with second and so on */ for (SnapObjectHitDepth *iter = static_cast(depths_peel.first); iter; - iter = iter->next) { + iter = iter->next) + { if ((iter != hit_min) && (iter->ob_uuid == hit_min->ob_uuid)) { if (hit_max == nullptr) { hit_max = iter; @@ -1689,7 +1705,8 @@ bool transform_snap_increment(const TransInfo *t, float *r_val) float transform_snap_increment_get(const TransInfo *t) { if (transform_snap_is_active(t) && - (t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID))) { + (t->tsnap.mode & (SCE_SNAP_MODE_INCREMENT | SCE_SNAP_MODE_GRID))) + { return (t->modifiers & MOD_PRECISION) ? t->snap[1] : t->snap[0]; } diff --git a/source/blender/editors/transform/transform_snap_object.cc b/source/blender/editors/transform/transform_snap_object.cc index 146acc78c81..87872227936 100644 --- a/source/blender/editors/transform/transform_snap_object.cc +++ b/source/blender/editors/transform/transform_snap_object.cc @@ -228,7 +228,8 @@ static void snap_editmesh_minmax(SnapObjectContext *sctx, BM_ITER_MESH (v, &iter, bm, BM_VERTS_OF_MESH) { if (sctx->callbacks.edit_mesh.test_vert_fn && - !sctx->callbacks.edit_mesh.test_vert_fn(v, sctx->callbacks.edit_mesh.user_data)) { + !sctx->callbacks.edit_mesh.test_vert_fn(v, sctx->callbacks.edit_mesh.user_data)) + { continue; } minmax_v3v3_v3(r_min, r_max, v->co); @@ -306,17 +307,20 @@ static SnapData_EditMesh *snap_object_data_editmesh_get(SnapObjectContext *sctx, } } else if (sod->treedata_editmesh.tree && sod->treedata_editmesh.cached && - !bvhcache_has_tree(sod->mesh_runtime->bvh_cache, sod->treedata_editmesh.tree)) { + !bvhcache_has_tree(sod->mesh_runtime->bvh_cache, sod->treedata_editmesh.tree)) + { /* The tree is owned by the EditMesh and may have been freed since we last used! */ is_dirty = true; } else if (sod->bvhtree[0] && sod->cached[0] && - !bvhcache_has_tree(sod->mesh_runtime->bvh_cache, sod->bvhtree[0])) { + !bvhcache_has_tree(sod->mesh_runtime->bvh_cache, sod->bvhtree[0])) + { /* The tree is owned by the EditMesh and may have been freed since we last used! */ is_dirty = true; } else if (sod->bvhtree[1] && sod->cached[1] && - !bvhcache_has_tree(sod->mesh_runtime->bvh_cache, sod->bvhtree[1])) { + !bvhcache_has_tree(sod->mesh_runtime->bvh_cache, sod->bvhtree[1])) + { /* The tree is owned by the EditMesh and may have been freed since we last used! */ is_dirty = true; } @@ -413,7 +417,8 @@ static bool snap_object_is_snappable(const SnapObjectContext *sctx, } if ((snap_target_select == SCE_SNAP_TARGET_ALL) || - (base->flag_legacy & BA_TRANSFORM_LOCKED_IN_PLACE)) { + (base->flag_legacy & BA_TRANSFORM_LOCKED_IN_PLACE)) + { return true; } @@ -493,7 +498,8 @@ static eSnapMode iter_snap_objects(SnapObjectContext *sctx, dupli_ob->mat, is_object_active, false, - data)) != SCE_SNAP_MODE_NONE) { + data)) != SCE_SNAP_MODE_NONE) + { ret = tmp; } } @@ -509,7 +515,8 @@ static eSnapMode iter_snap_objects(SnapObjectContext *sctx, obj_eval->object_to_world, is_object_active, use_hide, - data)) != SCE_SNAP_MODE_NONE) { + data)) != SCE_SNAP_MODE_NONE) + { ret = tmp; } } @@ -719,7 +726,8 @@ static bool raycastMesh(SnapObjectContext *sctx, if (bb) { /* was BKE_boundbox_ray_hit_check, see: cf6ca226fa58 */ if (!isect_ray_aabb_v3_simple( - ray_start_local, ray_normal_local, bb->vec[0], bb->vec[6], &len_diff, nullptr)) { + ray_start_local, ray_normal_local, bb->vec[0], bb->vec[6], &len_diff, nullptr)) + { return retval; } } @@ -781,7 +789,8 @@ static bool raycastMesh(SnapObjectContext *sctx, params->use_backface_culling ? mesh_looptri_raycast_backface_culling_cb : treedata.raycast_callback, - &treedata) != -1) { + &treedata) != -1) + { hit.dist += len_diff; hit.dist /= local_scale; if (hit.dist <= *ray_depth) { @@ -855,7 +864,8 @@ static bool raycastEditMesh(SnapObjectContext *sctx, /* was BKE_boundbox_ray_hit_check, see: cf6ca226fa58 */ if (!isect_ray_aabb_v3_simple( - ray_start_local, ray_normal_local, sod->min, sod->max, &len_diff, nullptr)) { + ray_start_local, ray_normal_local, sod->min, sod->max, &len_diff, nullptr)) + { return retval; } @@ -916,7 +926,8 @@ static bool raycastEditMesh(SnapObjectContext *sctx, params->use_backface_culling ? editmesh_looptri_raycast_backface_culling_cb : treedata->raycast_callback, - treedata) != -1) { + treedata) != -1) + { hit.dist += len_diff; hit.dist /= local_scale; if (hit.dist <= *ray_depth) { @@ -1002,7 +1013,8 @@ static eSnapMode raycast_obj_fn(SnapObjectContext *sctx, sctx->ret.loc, sctx->ret.no, &sctx->ret.index, - sctx->ret.hit_list)) { + sctx->ret.hit_list)) + { retval = true; is_edit = true; } @@ -1296,7 +1308,8 @@ static eSnapMode nearest_world_object_fn(SnapObjectContext *sctx, &sctx->ret.dist_sq, sctx->ret.loc, sctx->ret.no, - &sctx->ret.index)) { + &sctx->ret.index)) + { retval = true; is_edit = true; } @@ -1579,13 +1592,9 @@ static void cb_snap_vert(void *userdata, const float *co; data->get_vert_co(index, data, &co); - if (test_projected_vert_dist(precalc, - clip_plane, - clip_plane_len, - data->is_persp, - co, - &nearest->dist_sq, - nearest->co)) { + if (test_projected_vert_dist( + precalc, clip_plane, clip_plane_len, data->is_persp, co, &nearest->dist_sq, nearest->co)) + { data->copy_vert_no(index, data, nearest->no); nearest->index = index; } @@ -1614,7 +1623,8 @@ static void cb_snap_edge(void *userdata, v_pair[0], v_pair[1], &nearest->dist_sq, - nearest->co)) { + nearest->co)) + { sub_v3_v3v3(nearest->no, v_pair[0], v_pair[1]); nearest->index = index; } @@ -1943,7 +1953,8 @@ static eSnapMode snap_mesh_edge_verts_mixed(SnapObjectContext *sctx, neasrest_precalc.ray_direction, v_pair[0], v_pair[1], - &lambda)) { + &lambda)) + { /* Do nothing. */ } else { @@ -1963,7 +1974,8 @@ static eSnapMode snap_mesh_edge_verts_mixed(SnapObjectContext *sctx, nearest2d.is_persp, v_pair[v_id], &nearest.dist_sq, - nearest.co)) { + nearest.co)) + { nearest.index = vindex[v_id]; elem = SCE_SNAP_MODE_VERTEX; { @@ -1989,7 +2001,8 @@ static eSnapMode snap_mesh_edge_verts_mixed(SnapObjectContext *sctx, nearest2d.is_persp, vmid, &nearest.dist_sq, - nearest.co)) { + nearest.co)) + { nearest.index = sctx->ret.index; elem = SCE_SNAP_MODE_EDGE_MIDPOINT; } @@ -2016,7 +2029,8 @@ static eSnapMode snap_mesh_edge_verts_mixed(SnapObjectContext *sctx, nearest2d.is_persp, v_near, &nearest.dist_sq, - nearest.co)) { + nearest.co)) + { nearest.index = sctx->ret.index; elem = SCE_SNAP_MODE_EDGE_PERPENDICULAR; } @@ -2071,12 +2085,10 @@ static eSnapMode snapArmature(SnapObjectContext *sctx, if (is_editmode == false) { /* Test BoundBox. */ const BoundBox *bb = BKE_armature_boundbox_get(ob_eval); - if (bb && !snap_bound_box_check_dist(bb->vec[0], - bb->vec[6], - lpmat, - sctx->runtime.win_size, - sctx->runtime.mval, - dist_px_sq)) { + if (bb && + !snap_bound_box_check_dist( + bb->vec[0], bb->vec[6], lpmat, sctx->runtime.win_size, sctx->runtime.mval, dist_px_sq)) + { return retval; } } @@ -2135,7 +2147,8 @@ static eSnapMode snapArmature(SnapObjectContext *sctx, eBone->head, eBone->tail, &dist_px_sq, - r_loc)) { + r_loc)) + { retval = SCE_SNAP_MODE_EDGE; } } @@ -2187,7 +2200,8 @@ static eSnapMode snapArmature(SnapObjectContext *sctx, head_vec, tail_vec, &dist_px_sq, - r_loc)) { + r_loc)) + { retval = SCE_SNAP_MODE_EDGE; } } @@ -2240,12 +2254,10 @@ static eSnapMode snapCurve(SnapObjectContext *sctx, if (use_obedit == false) { /* Test BoundBox */ BoundBox *bb = BKE_curve_boundbox_get(ob_eval); - if (bb && !snap_bound_box_check_dist(bb->vec[0], - bb->vec[6], - lpmat, - sctx->runtime.win_size, - sctx->runtime.mval, - dist_px_sq)) { + if (bb && + !snap_bound_box_check_dist( + bb->vec[0], bb->vec[6], lpmat, sctx->runtime.win_size, sctx->runtime.mval, dist_px_sq)) + { return SCE_SNAP_MODE_NONE; } } @@ -2412,7 +2424,8 @@ static eSnapMode snap_object_center(const SnapObjectContext *sctx, is_persp, obmat[3], &dist_px_sq, - r_loc)) { + r_loc)) + { *dist_px = sqrtf(dist_px_sq); retval = SCE_SNAP_MODE_VERTEX; } @@ -2502,7 +2515,8 @@ static eSnapMode snapCamera(const SnapObjectContext *sctx, is_persp, bundle_pos, &dist_px_sq, - r_loc)) { + r_loc)) + { retval = SCE_SNAP_MODE_VERTEX; } } @@ -2550,12 +2564,9 @@ static eSnapMode snapMesh(SnapObjectContext *sctx, /* Test BoundBox */ if (ob_eval->data == me_eval) { const BoundBox *bb = BKE_object_boundbox_get(ob_eval); - if (!snap_bound_box_check_dist(bb->vec[0], - bb->vec[6], - lpmat, - sctx->runtime.win_size, - sctx->runtime.mval, - dist_px_sq)) { + if (!snap_bound_box_check_dist( + bb->vec[0], bb->vec[6], lpmat, sctx->runtime.win_size, sctx->runtime.mval, dist_px_sq)) + { return SCE_SNAP_MODE_NONE; } } @@ -2726,7 +2737,8 @@ static eSnapMode snapEditMesh(SnapObjectContext *sctx, /* Was BKE_boundbox_ray_hit_check, see: cf6ca226fa58. */ if (!snap_bound_box_check_dist( - sod->min, sod->max, lpmat, sctx->runtime.win_size, sctx->runtime.mval, dist_px_sq)) { + sod->min, sod->max, lpmat, sctx->runtime.win_size, sctx->runtime.mval, dist_px_sq)) + { return SCE_SNAP_MODE_NONE; } @@ -3280,7 +3292,8 @@ static eSnapMode transform_snap_context_project_view3d_mixed_impl(SnapObjectCont if ((snap_to_flag & SCE_SNAP_MODE_FACE_RAYCAST) || use_occlusion_test) { float ray_start[3], ray_normal[3]; if (!ED_view3d_win_to_ray_clipped_ex( - depsgraph, region, v3d, mval, nullptr, ray_normal, ray_start, true)) { + depsgraph, region, v3d, mval, nullptr, ray_normal, ray_start, true)) + { return retval; } @@ -3314,7 +3327,8 @@ static eSnapMode transform_snap_context_project_view3d_mixed_impl(SnapObjectCont } if (snap_to_flag & (SCE_SNAP_MODE_VERTEX | SCE_SNAP_MODE_EDGE | SCE_SNAP_MODE_EDGE_MIDPOINT | - SCE_SNAP_MODE_EDGE_PERPENDICULAR)) { + SCE_SNAP_MODE_EDGE_PERPENDICULAR)) + { eSnapMode elem_test, elem = SCE_SNAP_MODE_NONE; float dist_px_tmp = *dist_px; @@ -3378,8 +3392,9 @@ static eSnapMode transform_snap_context_project_view3d_mixed_impl(SnapObjectCont } if ((elem == SCE_SNAP_MODE_EDGE) && - (snap_to_flag & (SCE_SNAP_MODE_VERTEX | SCE_SNAP_MODE_EDGE_MIDPOINT | - SCE_SNAP_MODE_EDGE_PERPENDICULAR))) { + (snap_to_flag & + (SCE_SNAP_MODE_VERTEX | SCE_SNAP_MODE_EDGE_MIDPOINT | SCE_SNAP_MODE_EDGE_PERPENDICULAR))) + { sctx->runtime.snap_to_flag = snap_to_flag; elem = snap_mesh_edge_verts_mixed(sctx, params, *dist_px, prev_co, &dist_px_tmp); } @@ -3487,7 +3502,8 @@ bool ED_transform_snap_object_project_all_view3d_ex(SnapObjectContext *sctx, float ray_start[3], ray_normal[3]; if (!ED_view3d_win_to_ray_clipped_ex( - depsgraph, region, v3d, mval, nullptr, ray_normal, ray_start, true)) { + depsgraph, region, v3d, mval, nullptr, ray_normal, ray_start, true)) + { return false; } diff --git a/source/blender/editors/undo/ed_undo.cc b/source/blender/editors/undo/ed_undo.cc index dfd1f4c6860..8f04d9a924f 100644 --- a/source/blender/editors/undo/ed_undo.cc +++ b/source/blender/editors/undo/ed_undo.cc @@ -683,7 +683,8 @@ int ED_undo_operator_repeat(bContext *C, wmOperator *op) * (which copy their data), won't stop redo, see #29579. * * NOTE: WM_operator_check_ui_enabled() jobs test _must_ stay in sync with this. */ - (WM_jobs_test(wm, scene, WM_JOB_TYPE_ANY) == 0)) { + (WM_jobs_test(wm, scene, WM_JOB_TYPE_ANY) == 0)) + { int retval; if (G.debug & G_DEBUG) { @@ -833,7 +834,8 @@ void ED_undo_object_editmode_restore_helper(struct bContext *C, } Object **ob_p = object_array; for (uint i = 0; i < object_array_len; - i++, ob_p = static_cast(POINTER_OFFSET(ob_p, object_array_stride))) { + i++, ob_p = static_cast(POINTER_OFFSET(ob_p, object_array_stride))) + { Object *obedit = *ob_p; ED_object_editmode_enter_ex(bmain, scene, obedit, EM_NO_CONTEXT); ((ID *)obedit->data)->tag &= ~LIB_TAG_DOIT; @@ -910,7 +912,8 @@ Object **ED_undo_editmode_objects_from_view_layer(const Scene *scene, for (Base *base = baseact, *base_next = static_cast(BKE_view_layer_object_bases_get(view_layer)->first); base; - base = base_next, base_next = base_next ? base_next->next : nullptr) { + base = base_next, base_next = base_next ? base_next->next : nullptr) + { Object *ob = base->object; if ((ob->type == object_type) && (ob->mode & OB_MODE_EDIT)) { ID *id = static_cast(ob->data); @@ -945,7 +948,8 @@ Base **ED_undo_editmode_bases_from_view_layer(const Scene *scene, for (Base *base = BKE_view_layer_active_base_get(view_layer), *base_next = static_cast(BKE_view_layer_object_bases_get(view_layer)->first); base; - base = base_next, base_next = base_next ? base_next->next : nullptr) { + base = base_next, base_next = base_next ? base_next->next : nullptr) + { Object *ob = base->object; if ((ob->type == object_type) && (ob->mode & OB_MODE_EDIT)) { ID *id = static_cast(ob->data); diff --git a/source/blender/editors/util/ed_util.cc b/source/blender/editors/util/ed_util.cc index b04ba65edd0..ac4eee6eccf 100644 --- a/source/blender/editors/util/ed_util.cc +++ b/source/blender/editors/util/ed_util.cc @@ -131,7 +131,8 @@ void ED_editors_init(bContext *C) } /* Object mode is enforced for non-editable data (or their obdata). */ if (!BKE_id_is_editable(bmain, &ob->id) || - (ob_data != nullptr && !BKE_id_is_editable(bmain, ob_data))) { + (ob_data != nullptr && !BKE_id_is_editable(bmain, ob_data))) + { continue; } @@ -146,7 +147,8 @@ void ED_editors_init(bContext *C) * modes like Sculpt. * Ref. #98225. */ if (!BKE_collection_has_object_recursive(scene->master_collection, ob) || - !BKE_scene_has_object(scene, ob) || (ob->visibility_flag & OB_HIDE_VIEWPORT) != 0) { + !BKE_scene_has_object(scene, ob) || (ob->visibility_flag & OB_HIDE_VIEWPORT) != 0) + { continue; } diff --git a/source/blender/editors/util/ed_util_ops.cc b/source/blender/editors/util/ed_util_ops.cc index 0b3a8fe463b..2ea4b1fc72b 100644 --- a/source/blender/editors/util/ed_util_ops.cc +++ b/source/blender/editors/util/ed_util_ops.cc @@ -229,7 +229,8 @@ static int lib_id_fake_user_toggle_exec(bContext *C, wmOperator *op) ID *id = (ID *)idptr.data; if (!BKE_id_is_editable(CTX_data_main(C), id) || - ELEM(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_TXT, ID_OB, ID_WS)) { + ELEM(GS(id->name), ID_GR, ID_SCE, ID_SCR, ID_TXT, ID_OB, ID_WS)) + { BKE_report(op->reports, RPT_ERROR, "Data-block type does not support fake user"); return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/util/numinput.c b/source/blender/editors/util/numinput.c index 0e9f6dce6b9..f535b91ec0e 100644 --- a/source/blender/editors/util/numinput.c +++ b/source/blender/editors/util/numinput.c @@ -323,7 +323,8 @@ bool handleNumInput(bContext *C, NumInput *n, const wmEvent *event) #endif { if (((event->modifier & (KM_CTRL | KM_ALT)) == 0) && (event_ascii != '\0') && - strchr("01234567890@%^&*-+/{}()[]<>.|", event_ascii)) { + strchr("01234567890@%^&*-+/{}()[]<>.|", event_ascii)) + { if (!(n->flag & NUM_EDIT_FULL)) { n->flag |= NUM_EDITED; n->flag |= NUM_EDIT_FULL; diff --git a/source/blender/editors/uvedit/uvedit_clipboard.cc b/source/blender/editors/uvedit/uvedit_clipboard.cc index 71ca1d52215..6a43e15b7f2 100644 --- a/source/blender/editors/uvedit/uvedit_clipboard.cc +++ b/source/blender/editors/uvedit/uvedit_clipboard.cc @@ -254,7 +254,8 @@ bool UV_ClipboardBuffer::find_isomorphism(UvElementMap *dest_element_map, graph[source_island_index], cd_loop_uv_offset, r_label, - r_search_abandoned)) { + r_search_abandoned)) + { const int island_total_unique_uvs = dest_element_map->island_total_unique_uvs[dest_island_index]; const int island_offset = offset[source_island_index]; diff --git a/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.cc b/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.cc index edf48d9522e..d61a7d914c1 100644 --- a/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.cc +++ b/source/blender/editors/uvedit/uvedit_clipboard_graph_iso.cc @@ -191,7 +191,8 @@ static void generate_next_domains(uint8_t domains[][BDS], int bound = 0; uint8_t *bd; for (i = *bd_pos - 1, bd = &domains[i][L]; i >= 0 && bd[P] == cur_pos - 1; - i--, bd = &domains[i][L]) { + i--, bd = &domains[i][L]) + { uint8_t l_len = partition(left, bd[L], bd[LL], adjmat0[v]); uint8_t r_len = partition(right, bd[R], bd[RL], adjmat1[w]); @@ -256,7 +257,8 @@ static void select_bidomain( int best = INT_MAX; uint8_t *bd; for (i = bd_pos - 1, bd = &domains[i][L]; i >= 0 && bd[P] == current_matching_size; - i--, bd = &domains[i][L]) { + i--, bd = &domains[i][L]) + { if (connected && current_matching_size > 0 && !bd[ADJ]) { continue; } diff --git a/source/blender/editors/uvedit/uvedit_path.c b/source/blender/editors/uvedit/uvedit_path.c index 7941d492a78..018f0f17051 100644 --- a/source/blender/editors/uvedit/uvedit_path.c +++ b/source/blender/editors/uvedit/uvedit_path.c @@ -217,7 +217,8 @@ static int mouse_mesh_uv_shortest_path_vert(Scene *scene, node = path; do { if ((is_path_ordered == false) || - WM_operator_properties_checker_interval_test(&op_params->interval_params, depth)) { + WM_operator_properties_checker_interval_test(&op_params->interval_params, depth)) + { verttag_set_cb((BMLoop *)node->link, !all_set, &user_data); if (is_path_ordered) { l_dst_last = node->link; @@ -337,7 +338,8 @@ static int mouse_mesh_uv_shortest_path_edge(Scene *scene, node = path; do { if ((is_path_ordered == false) || - WM_operator_properties_checker_interval_test(&op_params->interval_params, depth)) { + WM_operator_properties_checker_interval_test(&op_params->interval_params, depth)) + { edgetag_set_cb((BMLoop *)node->link, !all_set, &user_data); if (is_path_ordered) { l_dst_last = node->link; @@ -453,7 +455,8 @@ static int mouse_mesh_uv_shortest_path_face(Scene *scene, node = path; do { if ((is_path_ordered == false) || - WM_operator_properties_checker_interval_test(&op_params->interval_params, depth)) { + WM_operator_properties_checker_interval_test(&op_params->interval_params, depth)) + { facetag_set_cb((BMFace *)node->link, !all_set, &user_data); if (is_path_ordered) { f_dst_last = node->link; @@ -623,7 +626,8 @@ static int uv_shortest_path_pick_invoke(bContext *C, wmOperator *op, const wmEve l_src = ED_uvedit_active_edge_loop_get(bm); if (l_src != NULL) { if (!uvedit_uv_select_test(scene, l_src, offsets) && - !uvedit_uv_select_test(scene, l_src->next, offsets)) { + !uvedit_uv_select_test(scene, l_src->next, offsets)) + { l_src = NULL; } ele_src = (BMElem *)l_src; @@ -717,7 +721,8 @@ static int uv_shortest_path_pick_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } if (!(ele_src = (BMElem *)BM_mesh_active_face_get(bm, false, false)) || - !(ele_dst = (BMElem *)BM_face_at_index_find_or_table(bm, index))) { + !(ele_dst = (BMElem *)BM_face_at_index_find_or_table(bm, index))) + { return OPERATOR_CANCELLED; } } @@ -726,7 +731,8 @@ static int uv_shortest_path_pick_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } if (!(ele_src = (BMElem *)ED_uvedit_active_edge_loop_get(bm)) || - !(ele_dst = (BMElem *)BM_loop_at_index_find(bm, index))) { + !(ele_dst = (BMElem *)BM_loop_at_index_find(bm, index))) + { return OPERATOR_CANCELLED; } } @@ -735,7 +741,8 @@ static int uv_shortest_path_pick_exec(bContext *C, wmOperator *op) return OPERATOR_CANCELLED; } if (!(ele_src = (BMElem *)ED_uvedit_active_vert_loop_get(bm)) || - !(ele_dst = (BMElem *)BM_loop_at_index_find(bm, index))) { + !(ele_dst = (BMElem *)BM_loop_at_index_find(bm, index))) + { return OPERATOR_CANCELLED; } } @@ -749,7 +756,8 @@ static int uv_shortest_path_pick_exec(bContext *C, wmOperator *op) op_params.track_active = true; if (!uv_shortest_path_pick_ex( - scene, depsgraph, obedit, &op_params, ele_src, ele_dst, aspect_y, offsets)) { + scene, depsgraph, obedit, &op_params, ele_src, ele_dst, aspect_y, offsets)) + { return OPERATOR_CANCELLED; } diff --git a/source/blender/editors/uvedit/uvedit_rip.c b/source/blender/editors/uvedit/uvedit_rip.c index 7517a526722..100f7957dbf 100644 --- a/source/blender/editors/uvedit/uvedit_rip.c +++ b/source/blender/editors/uvedit/uvedit_rip.c @@ -105,7 +105,8 @@ static BMLoop *bm_loop_find_other_radial_loop_with_visible_face(BMLoop *l_src, if (l_iter != l_src) { do { if (BM_elem_flag_test(l_iter->f, BM_ELEM_TAG) && UL(l_iter)->is_select_edge && - BM_loop_uv_share_edge_check(l_src, l_iter, cd_loop_uv_offset)) { + BM_loop_uv_share_edge_check(l_src, l_iter, cd_loop_uv_offset)) + { /* Check UVs are contiguous. */ if (l_other == NULL) { l_other = l_iter; @@ -131,7 +132,8 @@ static BMLoop *bm_loop_find_other_fan_loop_with_visible_face(BMLoop *l_src, if (l_iter != l_src) { do { if (BM_elem_flag_test(l_iter->f, BM_ELEM_TAG) && - BM_loop_uv_share_edge_check(l_src, l_iter, cd_loop_uv_offset)) { + BM_loop_uv_share_edge_check(l_src, l_iter, cd_loop_uv_offset)) + { /* Check UVs are contiguous. */ if (l_other == NULL) { l_other = l_iter; @@ -371,7 +373,8 @@ static UVRipSingle *uv_rip_single_from_loop(BMLoop *l_init_orig, BMEdge *e_prev = i ? l_init->e : l_init->prev->e; BMLoop *l_iter = l_init; while (((l_iter = bm_vert_step_fan_loop_uv(l_iter, &e_prev, cd_loop_uv_offset)) != l_init) && - (l_iter != NULL) && (UL(l_iter)->side == 0)) { + (l_iter != NULL) && (UL(l_iter)->side == 0)) + { uv_fan_count_contiguous += 1; /* Keep. */ UL(l_iter)->side = 1; @@ -621,7 +624,8 @@ static UVRipPairs *uv_rip_pairs_from_loop(BMLoop *l_init, else { if (UL(l_other)->side != side) { if ((UL(l_other)->side_was_swapped == false) && - uv_rip_pairs_loop_change_sides_test(l_other, l_step, aspect_y, cd_loop_uv_offset)) { + uv_rip_pairs_loop_change_sides_test(l_other, l_step, aspect_y, cd_loop_uv_offset)) + { UV_SET_SIDE_AND_REMOVE_FROM_RAIL(l_other, side); } } @@ -651,7 +655,8 @@ static UVRipPairs *uv_rip_pairs_from_loop(BMLoop *l_init, if (UL(l_other)->side != side) { if ((UL(l_other)->side_was_swapped == false) && uv_rip_pairs_loop_change_sides_test( - l_other, l_step, aspect_y, cd_loop_uv_offset)) { + l_other, l_step, aspect_y, cd_loop_uv_offset)) + { UV_SET_SIDE_AND_REMOVE_FROM_RAIL(l_other, side); } } diff --git a/source/blender/editors/uvedit/uvedit_select.c b/source/blender/editors/uvedit/uvedit_select.c index ef8deaf18f3..e12456b014c 100644 --- a/source/blender/editors/uvedit/uvedit_select.c +++ b/source/blender/editors/uvedit/uvedit_select.c @@ -480,8 +480,8 @@ void uvedit_edge_select_set_noflush(const Scene *scene, BMLoop *l_iter = l; do { if (uvedit_face_visible_test(scene, l_iter->f)) { - if ((sticky_flag == SI_STICKY_VERTEX) || - BM_loop_uv_share_edge_check(l, l_iter, offsets.uv)) { + if ((sticky_flag == SI_STICKY_VERTEX) || BM_loop_uv_share_edge_check(l, l_iter, offsets.uv)) + { BM_ELEM_CD_SET_BOOL(l_iter, offsets.select_edge, select); } } @@ -743,7 +743,8 @@ static BMLoop *uvedit_loop_find_other_radial_loop_with_visible_face(const Scene if (l_iter != l_src) { do { if (uvedit_face_visible_test(scene, l_iter->f) && - BM_loop_uv_share_edge_check(l_src, l_iter, offsets.uv)) { + BM_loop_uv_share_edge_check(l_src, l_iter, offsets.uv)) + { /* Check UVs are contiguous. */ if (l_other == NULL) { l_other = l_iter; @@ -1174,7 +1175,8 @@ bool uvedit_vert_is_edge_select_any_other(const Scene *scene, BMLoop *l, const B * and #l_radial_iter for the actual edge selection test. */ l_other = (l_radial_iter->v != l->v) ? l_radial_iter->next : l_radial_iter; if (BM_loop_uv_share_vert_check(l, l_other, offsets.uv) && - uvedit_edge_select_test(scene, l_radial_iter, offsets)) { + uvedit_edge_select_test(scene, l_radial_iter, offsets)) + { return true; } } @@ -1194,7 +1196,8 @@ bool uvedit_vert_is_face_select_any_other(const Scene *scene, BMLoop *l, const B continue; } if (BM_loop_uv_share_vert_check(l, l_iter, offsets.uv) && - uvedit_face_select_test(scene, l_iter->f, offsets)) { + uvedit_face_select_test(scene, l_iter->f, offsets)) + { return true; } } @@ -1213,7 +1216,8 @@ bool uvedit_vert_is_all_other_faces_selected(const Scene *scene, continue; } if (BM_loop_uv_share_vert_check(l, l_iter, offsets.uv) && - !uvedit_face_select_test(scene, l_iter->f, offsets)) { + !uvedit_face_select_test(scene, l_iter->f, offsets)) + { return false; } } @@ -1302,7 +1306,8 @@ void uvedit_select_flush(const Scene *scene, BMEditMesh *em) } BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { if (BM_ELEM_CD_GET_BOOL(l, offsets.select_vert) && - BM_ELEM_CD_GET_BOOL(l->next, offsets.select_vert)) { + BM_ELEM_CD_GET_BOOL(l->next, offsets.select_vert)) + { BM_ELEM_CD_SET_BOOL(l, offsets.select_edge, true); } } @@ -1329,7 +1334,8 @@ void uvedit_deselect_flush(const Scene *scene, BMEditMesh *em) } BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { if (!BM_ELEM_CD_GET_BOOL(l, offsets.select_vert) || - !BM_ELEM_CD_GET_BOOL(l->next, offsets.select_vert)) { + !BM_ELEM_CD_GET_BOOL(l->next, offsets.select_vert)) + { BM_ELEM_CD_SET_BOOL(l, offsets.select_edge, false); } } @@ -1412,7 +1418,8 @@ static void uv_select_edgeloop_double_side_tag(const Scene *scene, !uvedit_face_visible_test(scene, l_step_pair[1]->f) || /* Check loops have not diverged. */ (uvedit_loop_find_other_radial_loop_with_visible_face(scene, l_step_pair[0], offsets) != - l_step_pair[1])) { + l_step_pair[1])) + { break; } @@ -1429,7 +1436,8 @@ static void uv_select_edgeloop_double_side_tag(const Scene *scene, } if ((l_step_pair[0] && BM_elem_flag_test(l_step_pair[0], BM_ELEM_TAG)) || - (l_step_pair[1] && BM_elem_flag_test(l_step_pair[1], BM_ELEM_TAG))) { + (l_step_pair[1] && BM_elem_flag_test(l_step_pair[1], BM_ELEM_TAG))) + { break; } v_from = v_from_next; @@ -1465,7 +1473,8 @@ static void uv_select_edgeloop_single_side_tag(const Scene *scene, if (!uvedit_face_visible_test(scene, l_step->f) || /* Check the boundary is still a boundary. */ - (uvedit_loop_find_other_radial_loop_with_visible_face(scene, l_step, offsets) != NULL)) { + (uvedit_loop_find_other_radial_loop_with_visible_face(scene, l_step, offsets) != NULL)) + { break; } @@ -1834,7 +1843,8 @@ static void uv_select_linked_multi(Scene *scene, BMLoop *l_other; BM_ITER_ELEM (l_other, &liter_other, l->v, BM_LOOPS_OF_VERT) { if ((l != l_other) && !BM_loop_uv_share_vert_check(l, l_other, offsets.uv) && - uvedit_face_select_test(scene, l_other->f, offsets)) { + uvedit_face_select_test(scene, l_other->f, offsets)) + { add_to_stack = false; break; } @@ -3914,8 +3924,8 @@ static bool do_lasso_select_mesh_uv_is_point_inside(const ARegion *region, if (UI_view2d_view_to_region_clip( ®ion->v2d, co_test[0], co_test[1], &co_screen[0], &co_screen[1]) && BLI_rcti_isect_pt_v(clip_rect, co_screen) && - BLI_lasso_is_point_inside( - mcoords, mcoords_len, co_screen[0], co_screen[1], V2D_IS_CLIPPED)) { + BLI_lasso_is_point_inside(mcoords, mcoords_len, co_screen[0], co_screen[1], V2D_IS_CLIPPED)) + { return true; } return false; @@ -3933,7 +3943,8 @@ static bool do_lasso_select_mesh_uv_is_edge_inside(const ARegion *region, ®ion->v2d, co_test_a, co_test_b, co_screen_a, co_screen_b) && BLI_rcti_isect_segment(clip_rect, co_screen_a, co_screen_b) && BLI_lasso_is_edge_inside( - mcoords, mcoords_len, UNPACK2(co_screen_a), UNPACK2(co_screen_b), V2D_IS_CLIPPED)) { + mcoords, mcoords_len, UNPACK2(co_screen_a), UNPACK2(co_screen_b), V2D_IS_CLIPPED)) + { return true; } return false; @@ -4023,7 +4034,8 @@ static bool do_lasso_select_mesh_uv(bContext *C, float *luv = BM_ELEM_CD_GET_FLOAT_P(l, offsets.uv); if (do_lasso_select_mesh_uv_is_point_inside(region, &rect, mcoords, mcoords_len, luv) && do_lasso_select_mesh_uv_is_point_inside( - region, &rect, mcoords, mcoords_len, luv_prev)) { + region, &rect, mcoords, mcoords_len, luv_prev)) + { uvedit_edge_select_set_with_sticky(scene, em, l_prev, select, false, offsets); do_second_pass = false; changed = true; @@ -4067,8 +4079,8 @@ static bool do_lasso_select_mesh_uv(bContext *C, BM_ITER_ELEM (l, &liter, efa, BM_LOOPS_OF_FACE) { if (select != uvedit_uv_select_test(scene, l, offsets)) { float *luv = BM_ELEM_CD_GET_FLOAT_P(l, offsets.uv); - if (do_lasso_select_mesh_uv_is_point_inside( - region, &rect, mcoords, mcoords_len, luv)) { + if (do_lasso_select_mesh_uv_is_point_inside(region, &rect, mcoords, mcoords_len, luv)) + { uvedit_uv_select_set(scene, em->bm, l, select, false, offsets); changed = true; BM_elem_flag_enable(l->v, BM_ELEM_TAG); @@ -4277,7 +4289,8 @@ static bool overlap_tri_tri_uv_test(const float t1[3][2], isect_seg_seg_v2_point_ex(t1[1], t1[2], t2[1], t2[2], endpoint_bias, vi) == 1 || isect_seg_seg_v2_point_ex(t1[1], t1[2], t2[2], t2[0], endpoint_bias, vi) == 1 || isect_seg_seg_v2_point_ex(t1[2], t1[0], t2[0], t2[1], endpoint_bias, vi) == 1 || - isect_seg_seg_v2_point_ex(t1[2], t1[0], t2[1], t2[2], endpoint_bias, vi) == 1) { + isect_seg_seg_v2_point_ex(t1[2], t1[0], t2[1], t2[2], endpoint_bias, vi) == 1) + { return true; } @@ -4458,7 +4471,8 @@ static int uv_select_overlap(bContext *C, const bool extend) /* Skip if both faces are already selected. */ if (uvedit_face_select_test(scene, face_a, offsets_a) && - uvedit_face_select_test(scene, face_b, offsets_b)) { + uvedit_face_select_test(scene, face_b, offsets_b)) + { continue; } diff --git a/source/blender/editors/uvedit/uvedit_smart_stitch.c b/source/blender/editors/uvedit/uvedit_smart_stitch.c index b5165f4f1de..fe9a182b3e0 100644 --- a/source/blender/editors/uvedit/uvedit_smart_stitch.c +++ b/source/blender/editors/uvedit/uvedit_smart_stitch.c @@ -359,7 +359,8 @@ static bool stitch_check_edges_stitchable(const int cd_loop_uv_offset, float *luv_iter2 = BM_ELEM_CD_GET_FLOAT_P(state->uvs[edge_iter->uv2]->l, cd_loop_uv_offset); if (fabsf(luv_orig1[0] - luv_iter1[0]) < limit && fabsf(luv_orig1[1] - luv_iter1[1]) < limit && - fabsf(luv_orig2[0] - luv_iter2[0]) < limit && fabsf(luv_orig2[1] - luv_iter2[1]) < limit) { + fabsf(luv_orig2[0] - luv_iter2[0]) < limit && fabsf(luv_orig2[1] - luv_iter2[1]) < limit) + { return 1; } return 0; @@ -373,7 +374,8 @@ static bool stitch_check_uvs_state_stitchable(const int cd_loop_uv_offset, StitchStateContainer *ssc) { if ((ssc->snap_islands && element->island == element_iter->island) || - (!ssc->midpoints && element->island == element_iter->island)) { + (!ssc->midpoints && element->island == element_iter->island)) + { return 0; } @@ -387,7 +389,8 @@ static bool stitch_check_edges_state_stitchable(const int cd_loop_uv_offset, StitchState *state) { if ((ssc->snap_islands && edge->element->island == edge_iter->element->island) || - (!ssc->midpoints && edge->element->island == edge_iter->element->island)) { + (!ssc->midpoints && edge->element->island == edge_iter->element->island)) + { return 0; } @@ -432,7 +435,8 @@ static void stitch_calculate_island_snapping(const int cd_loop_uv_offset, island_stitch_data[i].medianPoint[1] /= state->aspect; if ((island_stitch_data[i].rotation + island_stitch_data[i].rotation_neg < (float)M_PI_2) || island_stitch_data[i].num_rot_elements == 0 || - island_stitch_data[i].num_rot_elements_neg == 0) { + island_stitch_data[i].num_rot_elements_neg == 0) + { rotation = (island_stitch_data[i].rotation * island_stitch_data[i].num_rot_elements - island_stitch_data[i].rotation_neg * island_stitch_data[i].num_rot_elements_neg) / @@ -559,7 +563,8 @@ static void stitch_island_calculate_vert_rotation(const int cd_loop_uv_offset, UvElement *element_iter = BM_uv_element_get_head(state->element_map, element); for (; element_iter; element_iter = element_iter->next) { if (element_iter->separate && - stitch_check_uvs_state_stitchable(cd_loop_uv_offset, element, element_iter, ssc)) { + stitch_check_uvs_state_stitchable(cd_loop_uv_offset, element, element_iter, ssc)) + { float normal[2]; /* only calculate rotation against static island uv verts */ @@ -862,7 +867,8 @@ static void stitch_validate_edge_stitchability(const int cd_loop_uv_offset, } if (stitch_check_edges_state_stitchable(cd_loop_uv_offset, edge, edge_iter, ssc, state)) { if ((edge_iter->element->island == ssc->static_island) || - (edge->element->island == ssc->static_island)) { + (edge->element->island == ssc->static_island)) + { edge->flag |= STITCH_STITCHABLE; preview->num_stitchable++; stitch_setup_face_preview_for_uv_group( @@ -1277,14 +1283,14 @@ static int stitch_process_data(StitchStateContainer *ssc, state->uvs[edge->uv1]->flag |= STITCH_STITCHABLE; state->uvs[edge->uv2]->flag |= STITCH_STITCHABLE; - if (ssc->snap_islands && edge->element->island == ssc->static_island && - !stitch_midpoints) { + if (ssc->snap_islands && edge->element->island == ssc->static_island && !stitch_midpoints) + { continue; } for (edge_iter = edge->first; edge_iter; edge_iter = edge_iter->next) { - if (stitch_check_edges_state_stitchable( - cd_loop_uv_offset, edge, edge_iter, ssc, state)) { + if (stitch_check_edges_state_stitchable(cd_loop_uv_offset, edge, edge_iter, ssc, state)) + { l = state->uvs[edge_iter->uv1]->l; luv1 = BM_ELEM_CD_GET_FLOAT_P(l, cd_loop_uv_offset); l = state->uvs[edge_iter->uv2]->l; @@ -1343,7 +1349,8 @@ static int stitch_process_data(StitchStateContainer *ssc, for (i = 0; i < state->total_separate_edges; i++) { UvEdge *edge = state->edges + i; if ((edge->flag & STITCH_BOUNDARY) && (state->uvs[edge->uv1]->flag & STITCH_STITCHABLE) && - (state->uvs[edge->uv2]->flag & STITCH_STITCHABLE)) { + (state->uvs[edge->uv2]->flag & STITCH_STITCHABLE)) + { stitch_island_calculate_edge_rotation(cd_loop_uv_offset, edge, ssc, @@ -1360,7 +1367,8 @@ static int stitch_process_data(StitchStateContainer *ssc, for (i = 0; i < state->total_separate_edges; i++) { UvEdge *edge = state->edges + i; if ((state->uvs[edge->uv1]->flag & STITCH_STITCHABLE) && - (state->uvs[edge->uv2]->flag & STITCH_STITCHABLE)) { + (state->uvs[edge->uv2]->flag & STITCH_STITCHABLE)) + { BM_elem_flag_disable(edge->element->l->e, BM_ELEM_SEAM); } } @@ -2078,7 +2086,8 @@ static StitchState *stitch_init(bContext *C, BM_ITER_MESH (efa, &iter, em->bm, BM_FACES_OF_MESH) { if (!(ts->uv_flag & UV_SYNC_SELECTION) && - (BM_elem_flag_test(efa, BM_ELEM_HIDDEN) || !BM_elem_flag_test(efa, BM_ELEM_SELECT))) { + (BM_elem_flag_test(efa, BM_ELEM_HIDDEN) || !BM_elem_flag_test(efa, BM_ELEM_SELECT))) + { continue; } @@ -2227,7 +2236,8 @@ static int stitch_init_all(bContext *C, wmOperator *op) StitchStateInit *state_init = NULL; if (RNA_struct_property_is_set(op->ptr, "selection") && - RNA_struct_property_is_set(op->ptr, "objects_selection_count")) { + RNA_struct_property_is_set(op->ptr, "objects_selection_count")) + { /* Retrieve list of selected UVs, one list contains all selected UVs * for all objects. */ diff --git a/source/blender/editors/uvedit/uvedit_unwrap_ops.cc b/source/blender/editors/uvedit/uvedit_unwrap_ops.cc index bc529760ce6..3f1e3cedeee 100644 --- a/source/blender/editors/uvedit/uvedit_unwrap_ops.cc +++ b/source/blender/editors/uvedit/uvedit_unwrap_ops.cc @@ -668,7 +668,8 @@ static ParamHandle *construct_param_handle_subsurfed(const Scene *scene, } else { if (BM_elem_flag_test(origFace, BM_ELEM_HIDDEN) || - (options->only_selected_faces && !BM_elem_flag_test(origFace, BM_ELEM_SELECT))) { + (options->only_selected_faces && !BM_elem_flag_test(origFace, BM_ELEM_SELECT))) + { continue; } } @@ -1224,7 +1225,8 @@ static void uvedit_pack_islands_multi(const Scene *scene, if (original_selection) { /* Protect against degenerate source AABB. */ if ((selection_max_co[0] - selection_min_co[0]) * (selection_max_co[1] - selection_min_co[1]) > - 1e-40f) { + 1e-40f) + { params->target_aspect_y = (selection_max_co[0] - selection_min_co[0]) / (selection_max_co[1] - selection_min_co[1]); } @@ -2626,7 +2628,8 @@ static int smart_project_exec(bContext *C, wmOperator *op) /* Remove all zero area faces. */ while ((thick_faces_len > 0) && - !(thick_faces[thick_faces_len - 1].area > smart_uv_project_area_ignore)) { + !(thick_faces[thick_faces_len - 1].area > smart_uv_project_area_ignore)) + { /* Zero UVs so they don't overlap with other faces being unwrapped. */ BMIter liter; diff --git a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp index 424365b3bf3..9b24df6fc18 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp @@ -366,7 +366,8 @@ int BlenderFileLoader::testDegenerateTriangle(float v1[3], float v2[3], float v3 } if (dist_squared_to_line_segment_v3(v1, v2, v3) < eps_sq || dist_squared_to_line_segment_v3(v2, v1, v3) < eps_sq || - dist_squared_to_line_segment_v3(v3, v1, v2) < eps_sq) { + dist_squared_to_line_segment_v3(v3, v1, v2) < eps_sq) + { #if 0 if (verbose && G.debug & G_DEBUG_FREESTYLE) { printf("BlenderFileLoader::testDegenerateTriangle = 2\n"); @@ -591,7 +592,8 @@ void BlenderFileLoader::insertShapeNode(Object *ob, Mesh *me, int id) for (vector::iterator it = meshMaterials.begin(), itend = meshMaterials.end(); it != itend; - it++, i++) { + it++, i++) + { if (*it == mat) { ls.currentMIndex = i; found = true; @@ -650,7 +652,8 @@ void BlenderFileLoader::insertShapeNode(Object *ob, Mesh *me, int id) uint mindex = 0; for (vector::iterator m = meshFrsMaterials.begin(), mend = meshFrsMaterials.end(); m != mend; - ++m) { + ++m) + { marray[mindex] = new FrsMaterial(*m); ++mindex; } diff --git a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp index 3a8b25e5e75..9b8689aa67d 100644 --- a/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp +++ b/source/blender/freestyle/intern/blender_interface/BlenderStrokeRenderer.cpp @@ -452,7 +452,8 @@ void BlenderStrokeRenderer::RenderStrokeRepBasic(StrokeRep *iStrokeRep) const vector *groups = hasTex ? &self->texturedStrokeGroups : &self->strokeGroups; StrokeGroup *group; if (groups->empty() || !(groups->back()->totvert + totvert < MESH_MAX_VERTS && - groups->back()->materials.size() + 1 < MAXMAT)) { + groups->back()->materials.size() + 1 < MAXMAT)) + { group = new StrokeGroup; groups->push_back(group); } @@ -639,7 +640,8 @@ void BlenderStrokeRenderer::GenerateStrokeMesh(StrokeGroup *group, bool hasTex) for (vector::const_iterator it = group->strokes.begin(), itend = group->strokes.end(); it != itend; - ++it) { + ++it) + { const int matnr = group->materials.lookup_default((*it)->getMaterial(), 0); vector &strips = (*it)->getStrips(); diff --git a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp index a3c5cd5f806..5359dd945ab 100644 --- a/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp +++ b/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp @@ -277,8 +277,8 @@ static void prepare(Render *re, ViewLayer *view_layer, Depsgraph *depsgraph) re->i.infostr = TIP_("Freestyle: Mesh loading"); re->stats_draw(re->sdh, &re->i); re->i.infostr = nullptr; - if (controller->LoadMesh( - re, view_layer, depsgraph)) { // returns if scene cannot be loaded or if empty + if (controller->LoadMesh(re, view_layer, depsgraph)) + { // returns if scene cannot be loaded or if empty return; } if (re->test_break(re->tbh)) { @@ -300,7 +300,8 @@ static void prepare(Render *re, ViewLayer *view_layer, Depsgraph *depsgraph) } for (FreestyleModuleConfig *module_conf = (FreestyleModuleConfig *)config->modules.first; module_conf; - module_conf = module_conf->next) { + module_conf = module_conf->next) + { if (module_conf->script && module_conf->is_displayed) { const char *id_name = module_conf->script->id.name + 2; if (G.debug & G_DEBUG_FREESTYLE) { @@ -345,7 +346,8 @@ static void prepare(Render *re, ViewLayer *view_layer, Depsgraph *depsgraph) cout << "Linesets:" << endl; } for (FreestyleLineSet *lineset = (FreestyleLineSet *)config->linesets.first; lineset; - lineset = lineset->next) { + lineset = lineset->next) + { if (lineset->flags & FREESTYLE_LINESET_ENABLED) { if (G.debug & G_DEBUG_FREESTYLE) { cout << " " << layer_count + 1 << ": " << lineset->name << " - " @@ -387,21 +389,21 @@ static void prepare(Render *re, ViewLayer *view_layer, Depsgraph *depsgraph) logical_and = !logical_and; } if (test_edge_type_conditions( - conditions, num_edge_types, logical_and, FREESTYLE_FE_RIDGE_VALLEY, true)) { + conditions, num_edge_types, logical_and, FREESTYLE_FE_RIDGE_VALLEY, true)) + { ++use_ridges_and_valleys; } if (test_edge_type_conditions(conditions, num_edge_types, logical_and, FREESTYLE_FE_SUGGESTIVE_CONTOUR, - true)) { + true)) + { ++use_suggestive_contours; } - if (test_edge_type_conditions(conditions, - num_edge_types, - logical_and, - FREESTYLE_FE_MATERIAL_BOUNDARY, - true)) { + if (test_edge_type_conditions( + conditions, num_edge_types, logical_and, FREESTYLE_FE_MATERIAL_BOUNDARY, true)) + { ++use_material_boundaries; } } @@ -555,7 +557,8 @@ static int displayed_layer_count(ViewLayer *view_layer) for (FreestyleModuleConfig *module = (FreestyleModuleConfig *)view_layer->freestyle_config.modules.first; module; - module = module->next) { + module = module->next) + { if (module->script && module->is_displayed) { count++; } @@ -565,7 +568,8 @@ static int displayed_layer_count(ViewLayer *view_layer) for (FreestyleLineSet *lineset = (FreestyleLineSet *)view_layer->freestyle_config.linesets.first; lineset; - lineset = lineset->next) { + lineset = lineset->next) + { if (lineset->flags & FREESTYLE_LINESET_ENABLED) { count++; } diff --git a/source/blender/freestyle/intern/geometry/GeomUtils.cpp b/source/blender/freestyle/intern/geometry/GeomUtils.cpp index b8beeed5880..a66c94ae52e 100644 --- a/source/blender/freestyle/intern/geometry/GeomUtils.cpp +++ b/source/blender/freestyle/intern/geometry/GeomUtils.cpp @@ -38,7 +38,8 @@ bool intersect2dSeg2dArea(const Vec2r &min, const Vec2r &max, const Vec2r &A, co bool include2dSeg2dArea(const Vec2r &min, const Vec2r &max, const Vec2r &A, const Vec2r &B) { if ((((max[0] > A[0]) && (A[0] > min[0])) && ((max[0] > B[0]) && (B[0] > min[0]))) && - (((max[1] > A[1]) && (A[1] > min[1])) && ((max[1] > B[1]) && (B[1] > min[1])))) { + (((max[1] > A[1]) && (A[1] > min[1])) && ((max[1] > B[1]) && (B[1] > min[1])))) + { return true; } return false; diff --git a/source/blender/freestyle/intern/geometry/Grid.cpp b/source/blender/freestyle/intern/geometry/Grid.cpp index a2620aa25d7..33d747b992b 100644 --- a/source/blender/freestyle/intern/geometry/Grid.cpp +++ b/source/blender/freestyle/intern/geometry/Grid.cpp @@ -25,7 +25,8 @@ static bool inBox(const Vec3r &inter, const Vec3r &box_min, const Vec3r &box_max { if (((inter.x() >= box_min.x()) && (inter.x() < box_max.x())) && ((inter.y() >= box_min.y()) && (inter.y() < box_max.y())) && - ((inter.z() >= box_min.z()) && (inter.z() < box_max.z()))) { + ((inter.z() >= box_min.z()) && (inter.z() < box_max.z()))) + { return true; } return false; @@ -46,7 +47,8 @@ void firstIntersectionGridVisitor::examineOccluder(Polygon3r *occ) // Check whether the intersection is in the cell: if (inBox(ray_org_ + tmp_t * ray_dir_ / ray_dir_.norm(), current_cell_->getOrigin(), - current_cell_->getOrigin() + cell_size_)) { + current_cell_->getOrigin() + cell_size_)) + { #if 0 Vec3d bboxdiag(_scene3d->bbox().getMax() - _scene3d->bbox().getMin()); if ((t > 1.0e-06 * (min(min(bboxdiag.x(), bboxdiag.y()), bboxdiag.z()))) && diff --git a/source/blender/freestyle/intern/geometry/GridHelpers.h b/source/blender/freestyle/intern/geometry/GridHelpers.h index 06e96ddf6e6..e3d112e6ea7 100644 --- a/source/blender/freestyle/intern/geometry/GridHelpers.h +++ b/source/blender/freestyle/intern/geometry/GridHelpers.h @@ -118,7 +118,8 @@ inline bool insideProscenium(const real proscenium[4], const Polygon3r &polygon) Vec3r bbMin, bbMax; polygon.getBBox(bbMin, bbMax); if (bbMax[0] < proscenium[0] || bbMin[0] > proscenium[1] || bbMax[1] < proscenium[2] || - bbMin[1] > proscenium[3]) { + bbMin[1] > proscenium[3]) + { return false; } @@ -140,7 +141,8 @@ inline vector enumerateVertices(const vector &fedges) vector points; // Iterate over vertices, storing projections in points for (vector::const_iterator woe = fedges.begin(), woend = fedges.end(); woe != woend; - woe++) { + woe++) + { points.push_back((*woe)->GetaVertex()->GetVertex()); } diff --git a/source/blender/freestyle/intern/geometry/Polygon.h b/source/blender/freestyle/intern/geometry/Polygon.h index d9d5ff17b81..7eaef8759b8 100644 --- a/source/blender/freestyle/intern/geometry/Polygon.h +++ b/source/blender/freestyle/intern/geometry/Polygon.h @@ -45,7 +45,8 @@ template class Polygon { Point p; for (typename vector::const_iterator it = poly.getVertices().begin(); it != poly.getVertices().end(); - it++) { + it++) + { p = *it; _vertices.push_back(p); } @@ -103,8 +104,8 @@ template class Polygon { { _vertices.clear(); Point p; - for (typename vector::const_iterator it = vertices.begin(); it != vertices.end(); - it++) { + for (typename vector::const_iterator it = vertices.begin(); it != vertices.end(); it++) + { p = *it; _vertices.push_back(p); } diff --git a/source/blender/freestyle/intern/geometry/SweepLine.h b/source/blender/freestyle/intern/geometry/SweepLine.h index b5427170cea..69abb513453 100644 --- a/source/blender/freestyle/intern/geometry/SweepLine.h +++ b/source/blender/freestyle/intern/geometry/SweepLine.h @@ -196,7 +196,8 @@ template class SweepLine { for (typename vector> *>::iterator i = _Intersections.begin(), iend = _Intersections.end(); i != iend; - i++) { + i++) + { delete (*i); } } @@ -253,7 +254,8 @@ template class SweepLine { } for (typename std::list *>::iterator s = _set.begin(), send = _set.end(); s != send; - s++) { + s++) + { Segment *currentS = (*s); if (true != binrule(*S, *currentS)) { continue; @@ -276,7 +278,8 @@ template class SweepLine { } if (GeomUtils::intersect2dSeg2dSegParametric(v0, v1, v2, v3, t, u, epsilon) == - GeomUtils::DO_INTERSECT) { + GeomUtils::DO_INTERSECT) + { // create the intersection Intersection> *inter = new Intersection>( S, t, currentS, u); diff --git a/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.cpp b/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.cpp index 3f9e96ffa73..04d5721d4fa 100644 --- a/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.cpp +++ b/source/blender/freestyle/intern/python/BPy_BinaryPredicate0D.cpp @@ -89,14 +89,9 @@ static PyObject *BinaryPredicate0D___call__(BPy_BinaryPredicate0D *self, static const char *kwlist[] = {"inter1", "inter2", nullptr}; BPy_Interface0D *obj1, *obj2; - if (!PyArg_ParseTupleAndKeywords(args, - kwds, - "O!O!", - (char **)kwlist, - &Interface0D_Type, - &obj1, - &Interface0D_Type, - &obj2)) { + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "O!O!", (char **)kwlist, &Interface0D_Type, &obj1, &Interface0D_Type, &obj2)) + { return nullptr; } if (typeid(*(self->bp0D)) == typeid(BinaryPredicate0D)) { diff --git a/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp b/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp index bf4bf2d099a..38ebb60ab1b 100644 --- a/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp +++ b/source/blender/freestyle/intern/python/BPy_BinaryPredicate1D.cpp @@ -124,14 +124,9 @@ static PyObject *BinaryPredicate1D___call__(BPy_BinaryPredicate1D *self, static const char *kwlist[] = {"inter1", "inter2", nullptr}; BPy_Interface1D *obj1, *obj2; - if (!PyArg_ParseTupleAndKeywords(args, - kwds, - "O!O!", - (char **)kwlist, - &Interface1D_Type, - &obj1, - &Interface1D_Type, - &obj2)) { + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "O!O!", (char **)kwlist, &Interface1D_Type, &obj1, &Interface1D_Type, &obj2)) + { return nullptr; } if (typeid(*(self->bp1D)) == typeid(BinaryPredicate1D)) { diff --git a/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp b/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp index e076234f429..075c301e37c 100644 --- a/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp +++ b/source/blender/freestyle/intern/python/BPy_ContextFunctions.cpp @@ -104,7 +104,8 @@ static PyObject *ContextFunctions_load_map(PyObject * /*self*/, PyObject *args, float sigma = 1.0; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "ss|If", (char **)kwlist, &fileName, &mapName, &nbLevels, &sigma)) { + args, kwds, "ss|If", (char **)kwlist, &fileName, &mapName, &nbLevels, &sigma)) + { return nullptr; } ContextFunctions::LoadMapCF(fileName, mapName, nbLevels, sigma); @@ -139,8 +140,8 @@ static PyObject *ContextFunctions_read_map_pixel(PyObject * /*self*/, int level; uint x, y; - if (!PyArg_ParseTupleAndKeywords( - args, kwds, "siII", (char **)kwlist, &mapName, &level, &x, &y)) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, "siII", (char **)kwlist, &mapName, &level, &x, &y)) + { return nullptr; } return PyFloat_FromDouble(ContextFunctions::ReadMapPixelCF(mapName, level, x, y)); @@ -206,7 +207,8 @@ static PyObject *ContextFunctions_read_directional_view_map_pixel(PyObject * /*s uint x, y; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "iiII", (char **)kwlist, &orientation, &level, &x, &y)) { + args, kwds, "iiII", (char **)kwlist, &orientation, &level, &x, &y)) + { return nullptr; } return PyFloat_FromDouble( diff --git a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp index 60b924f0eb3..da0dc8138fd 100644 --- a/source/blender/freestyle/intern/python/BPy_Freestyle.cpp +++ b/source/blender/freestyle/intern/python/BPy_Freestyle.cpp @@ -168,7 +168,8 @@ static PyObject *Freestyle_blendRamp(PyObject * /*self*/, PyObject *args) 3, obj1, "argument 2 must be a 3D vector " - "(either a tuple/list of 3 elements or Vector)") == -1) { + "(either a tuple/list of 3 elements or Vector)") == -1) + { return nullptr; } if (mathutils_array_parse(b, @@ -176,7 +177,8 @@ static PyObject *Freestyle_blendRamp(PyObject * /*self*/, PyObject *args) 3, obj2, "argument 4 must be a 3D vector " - "(either a tuple/list of 3 elements or Vector)") == -1) { + "(either a tuple/list of 3 elements or Vector)") == -1) + { return nullptr; } ramp_blend(type, a, fac, b); diff --git a/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp b/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp index 7bc3f2ea05a..f781d22391c 100644 --- a/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp +++ b/source/blender/freestyle/intern/python/BPy_FrsMaterial.cpp @@ -105,7 +105,8 @@ static int FrsMaterial_init(BPy_FrsMaterial *self, PyObject *args, PyObject *kwd convert_v4, emission, &shininess, - &priority)) { + &priority)) + { self->m = new FrsMaterial(line, diffuse, ambient, specular, emission, shininess, priority); } else { diff --git a/source/blender/freestyle/intern/python/BPy_Id.cpp b/source/blender/freestyle/intern/python/BPy_Id.cpp index 7745bc11512..4db1c086418 100644 --- a/source/blender/freestyle/intern/python/BPy_Id.cpp +++ b/source/blender/freestyle/intern/python/BPy_Id.cpp @@ -61,7 +61,8 @@ static int Id_init(BPy_Id *self, PyObject *args, PyObject *kwds) self->id = new Id(*(((BPy_Id *)brother)->id)); } else if ((void)PyErr_Clear(), - PyArg_ParseTupleAndKeywords(args, kwds, "|ii", (char **)kwlist_2, &first, &second)) { + PyArg_ParseTupleAndKeywords(args, kwds, "|ii", (char **)kwlist_2, &first, &second)) + { self->id = new Id(first, second); } else { diff --git a/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp b/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp index b70058a0b66..181549ba221 100644 --- a/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp +++ b/source/blender/freestyle/intern/python/BPy_IntegrationType.cpp @@ -66,7 +66,8 @@ static PyObject *Integrator_integrate(PyObject * /*self*/, PyObject *args, PyObj &Interface0DIterator_Type, &obj3, &IntegrationType_Type, - &obj4)) { + &obj4)) + { return nullptr; } diff --git a/source/blender/freestyle/intern/python/BPy_Interface0D.cpp b/source/blender/freestyle/intern/python/BPy_Interface0D.cpp index 11ac078124a..342cff73f89 100644 --- a/source/blender/freestyle/intern/python/BPy_Interface0D.cpp +++ b/source/blender/freestyle/intern/python/BPy_Interface0D.cpp @@ -130,8 +130,8 @@ static PyObject *Interface0D_get_fedge(BPy_Interface0D *self, PyObject *args, Py static const char *kwlist[] = {"inter", nullptr}; PyObject *py_if0D; - if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &Interface0D_Type, &py_if0D)) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &Interface0D_Type, &py_if0D)) + { return nullptr; } FEdge *fe = self->if0D->getFEdge(*(((BPy_Interface0D *)py_if0D)->if0D)); diff --git a/source/blender/freestyle/intern/python/BPy_Operators.cpp b/source/blender/freestyle/intern/python/BPy_Operators.cpp index df2312c8680..9d2c3e8b7ab 100644 --- a/source/blender/freestyle/intern/python/BPy_Operators.cpp +++ b/source/blender/freestyle/intern/python/BPy_Operators.cpp @@ -125,7 +125,8 @@ static PyObject *Operators_chain(BPy_Operators * /*self*/, PyObject *args, PyObj &UnaryPredicate1D_Type, &obj2, &UnaryFunction1DVoid_Type, - &obj3)) { + &obj3)) + { return nullptr; } if (!((BPy_ChainingIterator *)obj1)->c_it) { @@ -140,7 +141,8 @@ static PyObject *Operators_chain(BPy_Operators * /*self*/, PyObject *args, PyObj } if (!obj3) { if (Operators::chain(*(((BPy_ChainingIterator *)obj1)->c_it), - *(((BPy_UnaryPredicate1D *)obj2)->up1D)) < 0) { + *(((BPy_UnaryPredicate1D *)obj2)->up1D)) < 0) + { if (!PyErr_Occurred()) { PyErr_SetString(PyExc_RuntimeError, "Operators.chain() failed"); } @@ -155,7 +157,8 @@ static PyObject *Operators_chain(BPy_Operators * /*self*/, PyObject *args, PyObj } if (Operators::chain(*(((BPy_ChainingIterator *)obj1)->c_it), *(((BPy_UnaryPredicate1D *)obj2)->up1D), - *(((BPy_UnaryFunction1DVoid *)obj3)->uf1D_void)) < 0) { + *(((BPy_UnaryFunction1DVoid *)obj3)->uf1D_void)) < 0) + { if (!PyErr_Occurred()) { PyErr_SetString(PyExc_RuntimeError, "Operators.chain() failed"); } @@ -203,7 +206,8 @@ static PyObject *Operators_bidirectional_chain(BPy_Operators * /*self*/, &ChainingIterator_Type, &obj1, &UnaryPredicate1D_Type, - &obj2)) { + &obj2)) + { return nullptr; } if (!((BPy_ChainingIterator *)obj1)->c_it) { @@ -228,7 +232,8 @@ static PyObject *Operators_bidirectional_chain(BPy_Operators * /*self*/, return nullptr; } if (Operators::bidirectionalChain(*(((BPy_ChainingIterator *)obj1)->c_it), - *(((BPy_UnaryPredicate1D *)obj2)->up1D)) < 0) { + *(((BPy_UnaryPredicate1D *)obj2)->up1D)) < 0) + { if (!PyErr_Occurred()) { PyErr_SetString(PyExc_RuntimeError, "Operators.bidirectional_chain() failed"); } @@ -286,7 +291,8 @@ static PyObject *Operators_sequential_split(BPy_Operators * /*self*/, &obj1, &UnaryPredicate0D_Type, &obj2, - &f)) { + &f)) + { if (!((BPy_UnaryPredicate0D *)obj1)->up0D) { PyErr_SetString( PyExc_TypeError, @@ -301,7 +307,8 @@ static PyObject *Operators_sequential_split(BPy_Operators * /*self*/, } if (Operators::sequentialSplit(*(((BPy_UnaryPredicate0D *)obj1)->up0D), *(((BPy_UnaryPredicate0D *)obj2)->up0D), - f) < 0) { + f) < 0) + { if (!PyErr_Occurred()) { PyErr_SetString(PyExc_RuntimeError, "Operators.sequential_split() failed"); } @@ -311,7 +318,8 @@ static PyObject *Operators_sequential_split(BPy_Operators * /*self*/, else if ((void)PyErr_Clear(), (void)(f = 0.0f), PyArg_ParseTupleAndKeywords( - args, kwds, "O!|f", (char **)kwlist_2, &UnaryPredicate0D_Type, &obj1, &f)) { + args, kwds, "O!|f", (char **)kwlist_2, &UnaryPredicate0D_Type, &obj1, &f)) + { if (!((BPy_UnaryPredicate0D *)obj1)->up0D) { PyErr_SetString( PyExc_TypeError, @@ -385,7 +393,8 @@ static PyObject *Operators_recursive_split(BPy_Operators * /*self*/, &obj1, &UnaryPredicate1D_Type, &obj2, - &f)) { + &f)) + { if (!((BPy_UnaryFunction0DDouble *)obj1)->uf0D_double) { PyErr_SetString( PyExc_TypeError, @@ -400,7 +409,8 @@ static PyObject *Operators_recursive_split(BPy_Operators * /*self*/, } if (Operators::recursiveSplit(*(((BPy_UnaryFunction0DDouble *)obj1)->uf0D_double), *(((BPy_UnaryPredicate1D *)obj2)->up1D), - f) < 0) { + f) < 0) + { if (!PyErr_Occurred()) { PyErr_SetString(PyExc_RuntimeError, "Operators.recursive_split() failed"); } @@ -419,7 +429,8 @@ static PyObject *Operators_recursive_split(BPy_Operators * /*self*/, &obj2, &UnaryPredicate1D_Type, &obj3, - &f)) { + &f)) + { if (!((BPy_UnaryFunction0DDouble *)obj1)->uf0D_double) { PyErr_SetString( PyExc_TypeError, @@ -441,7 +452,8 @@ static PyObject *Operators_recursive_split(BPy_Operators * /*self*/, if (Operators::recursiveSplit(*(((BPy_UnaryFunction0DDouble *)obj1)->uf0D_double), *(((BPy_UnaryPredicate0D *)obj2)->up0D), *(((BPy_UnaryPredicate1D *)obj3)->up1D), - f) < 0) { + f) < 0) + { if (!PyErr_Occurred()) { PyErr_SetString(PyExc_RuntimeError, "Operators.recursive_split() failed"); } @@ -504,14 +516,9 @@ static PyObject *Operators_create(BPy_Operators * /*self*/, PyObject *args, PyOb static const char *kwlist[] = {"pred", "shaders", nullptr}; PyObject *obj1 = nullptr, *obj2 = nullptr; - if (!PyArg_ParseTupleAndKeywords(args, - kwds, - "O!O!", - (char **)kwlist, - &UnaryPredicate1D_Type, - &obj1, - &PyList_Type, - &obj2)) { + if (!PyArg_ParseTupleAndKeywords( + args, kwds, "O!O!", (char **)kwlist, &UnaryPredicate1D_Type, &obj1, &PyList_Type, &obj2)) + { return nullptr; } if (!((BPy_UnaryPredicate1D *)obj1)->up1D) { diff --git a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp index ed2af40545a..c9df1ff8ef7 100644 --- a/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp +++ b/source/blender/freestyle/intern/python/BPy_StrokeAttribute.cpp @@ -80,7 +80,8 @@ static int StrokeAttribute_init(BPy_StrokeAttribute *self, PyObject *args, PyObj float red, green, blue, alpha, thickness_right, thickness_left, t; if (PyArg_ParseTupleAndKeywords( - args, kwds, "|O!", (char **)kwlist_1, &StrokeAttribute_Type, &obj1)) { + args, kwds, "|O!", (char **)kwlist_1, &StrokeAttribute_Type, &obj1)) + { if (!obj1) { self->sa = new StrokeAttribute(); } @@ -97,7 +98,8 @@ static int StrokeAttribute_init(BPy_StrokeAttribute *self, PyObject *args, PyObj &obj1, &StrokeAttribute_Type, &obj2, - &t)) { + &t)) + { self->sa = new StrokeAttribute( *(((BPy_StrokeAttribute *)obj1)->sa), *(((BPy_StrokeAttribute *)obj2)->sa), t); } @@ -111,7 +113,8 @@ static int StrokeAttribute_init(BPy_StrokeAttribute *self, PyObject *args, PyObj &blue, &alpha, &thickness_right, - &thickness_left)) { + &thickness_left)) + { self->sa = new StrokeAttribute(red, green, blue, alpha, thickness_right, thickness_left); } else { diff --git a/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.cpp b/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.cpp index 388f5d52ff0..8d6bd2e7d7d 100644 --- a/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.cpp +++ b/source/blender/freestyle/intern/python/BPy_UnaryPredicate0D.cpp @@ -102,7 +102,8 @@ static PyObject *UnaryPredicate0D___call__(BPy_UnaryPredicate0D *self, PyObject *py_if0D_it; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &py_if0D_it)) { + args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &py_if0D_it)) + { return nullptr; } diff --git a/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp b/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp index 9240b4ed3ea..27708692533 100644 --- a/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp +++ b/source/blender/freestyle/intern/python/BPy_UnaryPredicate1D.cpp @@ -159,8 +159,8 @@ static PyObject *UnaryPredicate1D___call__(BPy_UnaryPredicate1D *self, static const char *kwlist[] = {"inter", nullptr}; PyObject *py_if1D; - if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &Interface1D_Type, &py_if1D)) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &Interface1D_Type, &py_if1D)) + { return nullptr; } diff --git a/source/blender/freestyle/intern/python/BPy_ViewShape.cpp b/source/blender/freestyle/intern/python/BPy_ViewShape.cpp index 58c60e9b9fd..f5c2e547a44 100644 --- a/source/blender/freestyle/intern/python/BPy_ViewShape.cpp +++ b/source/blender/freestyle/intern/python/BPy_ViewShape.cpp @@ -73,7 +73,8 @@ static int ViewShape_init(BPy_ViewShape *self, PyObject *args, PyObject *kwds) } } else if ((void)PyErr_Clear(), - PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_2, &SShape_Type, &obj)) { + PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_2, &SShape_Type, &obj)) + { BPy_SShape *py_ss = (BPy_SShape *)obj; self->vs = new ViewShape(py_ss->ss); self->py_ss = (!py_ss->borrowed) ? py_ss : nullptr; diff --git a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp index fd0d2dcfebd..31e556ac5f5 100644 --- a/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp +++ b/source/blender/freestyle/intern/python/BinaryPredicate1D/BPy_ViewMapGradientNormBP1D.cpp @@ -63,7 +63,8 @@ static int ViewMapGradientNormBP1D___init__(BPy_ViewMapGradientNormBP1D *self, float f = 2.0; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "i|O!f", (char **)kwlist, &i, &IntegrationType_Type, &obj, &f)) { + args, kwds, "i|O!f", (char **)kwlist, &i, &IntegrationType_Type, &obj, &f)) + { return -1; } IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp index 655f9cdce1e..9e8d52a19ca 100644 --- a/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/BPy_CurvePoint.cpp @@ -80,7 +80,8 @@ static int CurvePoint_init(BPy_CurvePoint *self, PyObject *args, PyObject *kwds) &obj1, &SVertex_Type, &obj2, - &t2d)) { + &t2d)) + { self->cp = new CurvePoint(((BPy_SVertex *)obj1)->sv, ((BPy_SVertex *)obj2)->sv, t2d); } else if ((void)PyErr_Clear(), @@ -92,7 +93,8 @@ static int CurvePoint_init(BPy_CurvePoint *self, PyObject *args, PyObject *kwds) &obj1, &CurvePoint_Type, &obj2, - &t2d)) { + &t2d)) + { CurvePoint *cp1 = ((BPy_CurvePoint *)obj1)->cp; CurvePoint *cp2 = ((BPy_CurvePoint *)obj2)->cp; if (!cp1 || cp1->A() == nullptr || cp1->B() == nullptr) { diff --git a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp index 9d3089e2bc2..df48754d9a7 100644 --- a/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/BPy_SVertex.cpp @@ -59,7 +59,8 @@ static int SVertex_init(BPy_SVertex *self, PyObject *args, PyObject *kwds) } else if ((void)PyErr_Clear(), PyArg_ParseTupleAndKeywords( - args, kwds, "O&O!", (char **)kwlist_2, convert_v3, v, &Id_Type, &obj)) { + args, kwds, "O&O!", (char **)kwlist_2, convert_v3, v, &Id_Type, &obj)) + { Vec3r point_3d(v[0], v[1], v[2]); self->sv = new SVertex(point_3d, *(((BPy_Id *)obj)->id)); } diff --git a/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp b/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp index f6edde778d4..83be08179fa 100644 --- a/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp +++ b/source/blender/freestyle/intern/python/Interface0D/CurvePoint/BPy_StrokeVertex.cpp @@ -65,8 +65,8 @@ static int StrokeVertex_init(BPy_StrokeVertex *self, PyObject *args, PyObject *k PyObject *obj1 = nullptr, *obj2 = nullptr; float t3d; - if (PyArg_ParseTupleAndKeywords( - args, kwds, "|O!", (char **)kwlist_1, &StrokeVertex_Type, &obj1)) { + if (PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist_1, &StrokeVertex_Type, &obj1)) + { if (!obj1) { self->sv = new StrokeVertex(); } @@ -87,7 +87,8 @@ static int StrokeVertex_init(BPy_StrokeVertex *self, PyObject *args, PyObject *k &obj1, &StrokeVertex_Type, &obj2, - &t3d)) { + &t3d)) + { StrokeVertex *sv1 = ((BPy_StrokeVertex *)obj1)->sv; StrokeVertex *sv2 = ((BPy_StrokeVertex *)obj2)->sv; if (!sv1 || (sv1->A() == nullptr && sv1->B() == nullptr)) { @@ -102,7 +103,8 @@ static int StrokeVertex_init(BPy_StrokeVertex *self, PyObject *args, PyObject *k } else if ((void)PyErr_Clear(), PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist_3, &CurvePoint_Type, &obj1)) { + args, kwds, "O!", (char **)kwlist_3, &CurvePoint_Type, &obj1)) + { CurvePoint *cp = ((BPy_CurvePoint *)obj1)->cp; if (!cp || cp->A() == nullptr || cp->B() == nullptr) { PyErr_SetString(PyExc_TypeError, "argument 1 is an invalid CurvePoint object"); @@ -119,7 +121,8 @@ static int StrokeVertex_init(BPy_StrokeVertex *self, PyObject *args, PyObject *k &SVertex_Type, &obj1, &StrokeAttribute_Type, - &obj2)) { + &obj2)) + { if (!obj2) { self->sv = new StrokeVertex(((BPy_SVertex *)obj1)->sv); } diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp index 9684f96d586..8cb4b181abc 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_FEdge.cpp @@ -63,14 +63,9 @@ static int FEdge_init(BPy_FEdge *self, PyObject *args, PyObject *kwds) } } else if ((void)PyErr_Clear(), - PyArg_ParseTupleAndKeywords(args, - kwds, - "O!O!", - (char **)kwlist_2, - &SVertex_Type, - &obj1, - &SVertex_Type, - &obj2)) { + PyArg_ParseTupleAndKeywords( + args, kwds, "O!O!", (char **)kwlist_2, &SVertex_Type, &obj1, &SVertex_Type, &obj2)) + { self->fe = new FEdge(((BPy_SVertex *)obj1)->sv, ((BPy_SVertex *)obj2)->sv); } else { diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp index cc6e6cb7d53..84d74e20cb6 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_FrsCurve.cpp @@ -55,7 +55,8 @@ static int FrsCurve_init(BPy_FrsCurve *self, PyObject *args, PyObject *kwds) } } else if ((void)PyErr_Clear(), - PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_2, &Id_Type, &obj)) { + PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_2, &Id_Type, &obj)) + { self->c = new Curve(*(((BPy_Id *)obj)->id)); } else { diff --git a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp index 8acbfefa995..fd2be86fc05 100644 --- a/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/BPy_Stroke.cpp @@ -180,7 +180,8 @@ static PyObject *Stroke_insert_vertex(BPy_Stroke *self, PyObject *args, PyObject &StrokeVertex_Type, &py_sv, &StrokeVertexIterator_Type, - &py_sv_it)) { + &py_sv_it)) + { return nullptr; } @@ -207,8 +208,8 @@ static PyObject *Stroke_remove_vertex(BPy_Stroke *self, PyObject *args, PyObject static const char *kwlist[] = {"vertex", nullptr}; PyObject *py_sv = nullptr; - if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &StrokeVertex_Type, &py_sv)) { + if (!PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist, &StrokeVertex_Type, &py_sv)) + { return nullptr; } if (((BPy_StrokeVertex *)py_sv)->sv) { diff --git a/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp b/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp index e69572687ca..969f0f0597a 100644 --- a/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/Curve/BPy_Chain.cpp @@ -54,7 +54,8 @@ static int Chain_init(BPy_Chain *self, PyObject *args, PyObject *kwds) } } else if ((void)PyErr_Clear(), - PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_2, &Id_Type, &obj)) { + PyArg_ParseTupleAndKeywords(args, kwds, "O!", (char **)kwlist_2, &Id_Type, &obj)) + { self->c = new Chain(*(((BPy_Id *)obj)->id)); } else { @@ -84,7 +85,8 @@ static PyObject *Chain_push_viewedge_back(BPy_Chain *self, PyObject *args, PyObj PyObject *obj1 = nullptr, *obj2 = nullptr; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!O!", (char **)kwlist, &ViewEdge_Type, &obj1, &PyBool_Type, &obj2)) { + args, kwds, "O!O!", (char **)kwlist, &ViewEdge_Type, &obj1, &PyBool_Type, &obj2)) + { return nullptr; } ViewEdge *ve = ((BPy_ViewEdge *)obj1)->ve; @@ -110,7 +112,8 @@ static PyObject *Chain_push_viewedge_front(BPy_Chain *self, PyObject *args, PyOb PyObject *obj1 = nullptr, *obj2 = nullptr; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!O!", (char **)kwlist, &ViewEdge_Type, &obj1, &PyBool_Type, &obj2)) { + args, kwds, "O!O!", (char **)kwlist, &ViewEdge_Type, &obj1, &PyBool_Type, &obj2)) + { return nullptr; } ViewEdge *ve = ((BPy_ViewEdge *)obj1)->ve; diff --git a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp index bb8c8f42042..2535c67277a 100644 --- a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSharp.cpp @@ -60,14 +60,9 @@ static int FEdgeSharp_init(BPy_FEdgeSharp *self, PyObject *args, PyObject *kwds) } } else if ((void)PyErr_Clear(), - PyArg_ParseTupleAndKeywords(args, - kwds, - "O!O!", - (char **)kwlist_2, - &SVertex_Type, - &obj1, - &SVertex_Type, - &obj2)) { + PyArg_ParseTupleAndKeywords( + args, kwds, "O!O!", (char **)kwlist_2, &SVertex_Type, &obj1, &SVertex_Type, &obj2)) + { self->fes = new FEdgeSharp(((BPy_SVertex *)obj1)->sv, ((BPy_SVertex *)obj2)->sv); } else { diff --git a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp index 47f0aff8374..2051c85a99b 100644 --- a/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp +++ b/source/blender/freestyle/intern/python/Interface1D/FEdge/BPy_FEdgeSmooth.cpp @@ -48,8 +48,8 @@ static int FEdgeSmooth_init(BPy_FEdgeSmooth *self, PyObject *args, PyObject *kwd static const char *kwlist_2[] = {"first_vertex", "second_vertex", nullptr}; PyObject *obj1 = nullptr, *obj2 = nullptr; - if (PyArg_ParseTupleAndKeywords( - args, kwds, "|O!", (char **)kwlist_1, &FEdgeSmooth_Type, &obj1)) { + if (PyArg_ParseTupleAndKeywords(args, kwds, "|O!", (char **)kwlist_1, &FEdgeSmooth_Type, &obj1)) + { if (!obj1) { self->fes = new FEdgeSmooth(); } @@ -58,14 +58,9 @@ static int FEdgeSmooth_init(BPy_FEdgeSmooth *self, PyObject *args, PyObject *kwd } } else if ((void)PyErr_Clear(), - PyArg_ParseTupleAndKeywords(args, - kwds, - "O!O!", - (char **)kwlist_2, - &SVertex_Type, - &obj1, - &SVertex_Type, - &obj2)) { + PyArg_ParseTupleAndKeywords( + args, kwds, "O!O!", (char **)kwlist_2, &SVertex_Type, &obj1, &SVertex_Type, &obj2)) + { self->fes = new FEdgeSmooth(((BPy_SVertex *)obj1)->sv, ((BPy_SVertex *)obj2)->sv); } else { diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp index ba17a92ca0d..5953b6a6718 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_AdjacencyIterator.cpp @@ -54,7 +54,8 @@ static int AdjacencyIterator_init(BPy_AdjacencyIterator *self, PyObject *args, P PyObject *obj1 = nullptr, *obj2 = nullptr, *obj3 = nullptr; if (PyArg_ParseTupleAndKeywords( - args, kwds, "|O!", (char **)kwlist_1, &AdjacencyIterator_Type, &obj1)) { + args, kwds, "|O!", (char **)kwlist_1, &AdjacencyIterator_Type, &obj1)) + { if (!obj1) { self->a_it = new AdjacencyIterator(); self->at_start = true; @@ -75,7 +76,8 @@ static int AdjacencyIterator_init(BPy_AdjacencyIterator *self, PyObject *args, P &PyBool_Type, &obj2, &PyBool_Type, - &obj3)) { + &obj3)) + { bool restrictToSelection = (!obj2) ? true : bool_from_PyBool(obj2); bool restrictToUnvisited = (!obj3) ? true : bool_from_PyBool(obj3); self->a_it = new AdjacencyIterator( diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp index 4d35cdabee9..e08d3d1177c 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_ChainPredicateIterator.cpp @@ -93,7 +93,8 @@ static int ChainPredicateIterator_init(BPy_ChainPredicateIterator *self, *obj6 = nullptr; if (PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist_1, &ChainPredicateIterator_Type, &obj1)) { + args, kwds, "O!", (char **)kwlist_1, &ChainPredicateIterator_Type, &obj1)) + { self->cp_it = new ChainPredicateIterator(*(((BPy_ChainPredicateIterator *)obj1)->cp_it)); self->upred = ((BPy_ChainPredicateIterator *)obj1)->upred; self->bpred = ((BPy_ChainPredicateIterator *)obj1)->bpred; @@ -117,7 +118,8 @@ static int ChainPredicateIterator_init(BPy_ChainPredicateIterator *self, check_begin, &obj5, &PyBool_Type, - &obj6)) { + &obj6)) + { UnaryPredicate1D *up1D = ((BPy_UnaryPredicate1D *)obj1)->up1D; BinaryPredicate1D *bp1D = ((BPy_BinaryPredicate1D *)obj2)->bp1D; bool restrict_to_selection = (!obj3) ? true : bool_from_PyBool(obj3); diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp index ea4ab4b5a7b..6cf6027ed7b 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_ChainSilhouetteIterator.cpp @@ -72,7 +72,8 @@ static int ChainSilhouetteIterator_init(BPy_ChainSilhouetteIterator *self, PyObject *obj1 = nullptr, *obj2 = nullptr, *obj3 = nullptr; if (PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist_1, &ChainSilhouetteIterator_Type, &obj1)) { + args, kwds, "O!", (char **)kwlist_1, &ChainSilhouetteIterator_Type, &obj1)) + { self->cs_it = new ChainSilhouetteIterator(*(((BPy_ChainSilhouetteIterator *)obj1)->cs_it)); } else if ((void)PyErr_Clear(), @@ -86,7 +87,8 @@ static int ChainSilhouetteIterator_init(BPy_ChainSilhouetteIterator *self, check_begin, &obj2, &PyBool_Type, - &obj3)) { + &obj3)) + { bool restrict_to_selection = (!obj1) ? true : bool_from_PyBool(obj1); ViewEdge *begin = (!obj2 || obj2 == Py_None) ? nullptr : ((BPy_ViewEdge *)obj2)->ve; bool orientation = (!obj3) ? true : bool_from_PyBool(obj3); diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp index 3fde8abe1f9..a3f10d5f730 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_ChainingIterator.cpp @@ -72,7 +72,8 @@ static int ChainingIterator___init__(BPy_ChainingIterator *self, PyObject *args, PyObject *obj1 = nullptr, *obj2 = nullptr, *obj3 = nullptr, *obj4 = nullptr; if (PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist_1, &ChainingIterator_Type, &obj1)) { + args, kwds, "O!", (char **)kwlist_1, &ChainingIterator_Type, &obj1)) + { self->c_it = new ChainingIterator(*(((BPy_ChainingIterator *)obj1)->c_it)); } else if ((void)PyErr_Clear(), @@ -88,7 +89,8 @@ static int ChainingIterator___init__(BPy_ChainingIterator *self, PyObject *args, check_begin, &obj3, &PyBool_Type, - &obj4)) { + &obj4)) + { bool restrict_to_selection = (!obj1) ? true : bool_from_PyBool(obj1); bool restrict_to_unvisited = (!obj2) ? true : bool_from_PyBool(obj2); ViewEdge *begin = (!obj3 || obj3 == Py_None) ? nullptr : ((BPy_ViewEdge *)obj3)->ve; @@ -151,7 +153,8 @@ static PyObject *ChainingIterator_traverse(BPy_ChainingIterator *self, return nullptr; } if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &AdjacencyIterator_Type, &py_a_it)) { + args, kwds, "O!", (char **)kwlist, &AdjacencyIterator_Type, &py_a_it)) + { return nullptr; } if (((BPy_AdjacencyIterator *)py_a_it)->a_it) { diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp index 180a3e00a9b..63dcca1a834 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_CurvePointIterator.cpp @@ -48,7 +48,8 @@ static int CurvePointIterator_init(BPy_CurvePointIterator *self, PyObject *args, float step; if (PyArg_ParseTupleAndKeywords( - args, kwds, "|O!", (char **)kwlist_1, &CurvePointIterator_Type, &brother)) { + args, kwds, "|O!", (char **)kwlist_1, &CurvePointIterator_Type, &brother)) + { if (!brother) { self->cp_it = new CurveInternal::CurvePointIterator(); } @@ -58,7 +59,8 @@ static int CurvePointIterator_init(BPy_CurvePointIterator *self, PyObject *args, } } else if ((void)PyErr_Clear(), - PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist_2, &step)) { + PyArg_ParseTupleAndKeywords(args, kwds, "f", (char **)kwlist_2, &step)) + { self->cp_it = new CurveInternal::CurvePointIterator(step); } else { diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp index 9d12de9efb7..b1da748f9c8 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_Interface0DIterator.cpp @@ -60,21 +60,24 @@ static int Interface0DIterator_init(BPy_Interface0DIterator *self, PyObject *arg PyObject *brother, *inter; if (PyArg_ParseTupleAndKeywords( - args, kwds, "O&", (char **)kwlist_1, convert_nested_it, &nested_it)) { + args, kwds, "O&", (char **)kwlist_1, convert_nested_it, &nested_it)) + { self->if0D_it = new Interface0DIterator(nested_it->copy()); self->at_start = true; self->reversed = false; } else if ((void)PyErr_Clear(), PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist_2, &Interface1D_Type, &inter)) { + args, kwds, "O!", (char **)kwlist_2, &Interface1D_Type, &inter)) + { self->if0D_it = new Interface0DIterator(((BPy_Interface1D *)inter)->if1D->verticesBegin()); self->at_start = true; self->reversed = false; } else if ((void)PyErr_Clear(), PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist_3, &Interface0DIterator_Type, &brother)) { + args, kwds, "O!", (char **)kwlist_3, &Interface0DIterator_Type, &brother)) + { self->if0D_it = new Interface0DIterator(*(((BPy_Interface0DIterator *)brother)->if0D_it)); self->at_start = ((BPy_Interface0DIterator *)brother)->at_start; self->reversed = ((BPy_Interface0DIterator *)brother)->reversed; diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp index 78b8cd07fb4..046fd280ef6 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_SVertexIterator.cpp @@ -56,7 +56,8 @@ static int SVertexIterator_init(BPy_SVertexIterator *self, PyObject *args, PyObj float t; if (PyArg_ParseTupleAndKeywords( - args, kwds, "|O!", (char **)kwlist_1, &SVertexIterator_Type, &obj1)) { + args, kwds, "|O!", (char **)kwlist_1, &SVertexIterator_Type, &obj1)) + { if (!obj1) { self->sv_it = new ViewEdgeInternal::SVertexIterator(); } @@ -77,7 +78,8 @@ static int SVertexIterator_init(BPy_SVertexIterator *self, PyObject *args, PyObj &obj3, &FEdge_Type, &obj4, - &t)) { + &t)) + { self->sv_it = new ViewEdgeInternal::SVertexIterator(((BPy_SVertex *)obj1)->sv, ((BPy_SVertex *)obj2)->sv, ((BPy_FEdge *)obj3)->fe, diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp index abbaae19b9e..ab24350caa4 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_StrokeVertexIterator.cpp @@ -53,7 +53,8 @@ static int StrokeVertexIterator_init(BPy_StrokeVertexIterator *self, PyObject *brother = nullptr, *stroke = nullptr; if (PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist_1, &StrokeVertexIterator_Type, &brother)) { + args, kwds, "O!", (char **)kwlist_1, &StrokeVertexIterator_Type, &brother)) + { self->sv_it = new StrokeInternal::StrokeVertexIterator( *(((BPy_StrokeVertexIterator *)brother)->sv_it)); self->reversed = ((BPy_StrokeVertexIterator *)brother)->reversed; @@ -62,7 +63,8 @@ static int StrokeVertexIterator_init(BPy_StrokeVertexIterator *self, else if ((void)PyErr_Clear(), PyArg_ParseTupleAndKeywords( - args, kwds, "|O!", (char **)kwlist_2, &Stroke_Type, &stroke)) { + args, kwds, "|O!", (char **)kwlist_2, &Stroke_Type, &stroke)) + { if (!stroke) { self->sv_it = new StrokeInternal::StrokeVertexIterator(); } diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp index 7d1691d577f..0360072f76d 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_ViewEdgeIterator.cpp @@ -59,13 +59,15 @@ static int ViewEdgeIterator_init(BPy_ViewEdgeIterator *self, PyObject *args, PyO PyObject *obj1 = nullptr, *obj2 = nullptr; if (PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist_1, &ViewEdgeIterator_Type, &obj1)) { + args, kwds, "O!", (char **)kwlist_1, &ViewEdgeIterator_Type, &obj1)) + { self->ve_it = new ViewEdgeInternal::ViewEdgeIterator(*(((BPy_ViewEdgeIterator *)obj1)->ve_it)); } else if ((void)PyErr_Clear(), (void)(obj1 = obj2 = nullptr), PyArg_ParseTupleAndKeywords( - args, kwds, "|O&O!", (char **)kwlist_2, check_begin, &obj1, &PyBool_Type, &obj2)) { + args, kwds, "|O&O!", (char **)kwlist_2, check_begin, &obj1, &PyBool_Type, &obj2)) + { ViewEdge *begin = (!obj1 || obj1 == Py_None) ? nullptr : ((BPy_ViewEdge *)obj1)->ve; bool orientation = (!obj2) ? true : bool_from_PyBool(obj2); self->ve_it = new ViewEdgeInternal::ViewEdgeIterator(begin, orientation); diff --git a/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp b/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp index 7dad62818f4..09e2f7d50b0 100644 --- a/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp +++ b/source/blender/freestyle/intern/python/Iterator/BPy_orientedViewEdgeIterator.cpp @@ -43,7 +43,8 @@ static int orientedViewEdgeIterator_init(BPy_orientedViewEdgeIterator *self, PyObject *brother = nullptr; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "|O!", (char **)kwlist, &orientedViewEdgeIterator_Type, &brother)) { + args, kwds, "|O!", (char **)kwlist, &orientedViewEdgeIterator_Type, &brother)) + { return -1; } if (!brother) { diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp index 99e344ee24b..ac805000e85 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_CalligraphicShader.cpp @@ -62,7 +62,8 @@ static int CalligraphicShader___init__(BPy_CalligraphicShader *self, PyObject *obj4 = nullptr; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "ddO&O!", (char **)kwlist, &d1, &d2, convert_v2, f3, &PyBool_Type, &obj4)) { + args, kwds, "ddO&O!", (char **)kwlist, &d1, &d2, convert_v2, f3, &PyBool_Type, &obj4)) + { return -1; } Vec2f v(f3[0], f3[1]); diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp index d8f8ae84543..200ee6eadaa 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_IncreasingColorShader.cpp @@ -72,7 +72,8 @@ static int IncreasingColorShader___init__(BPy_IncreasingColorShader *self, float f1, f2, f3, f4, f5, f6, f7, f8; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "ffffffff", (char **)kwlist, &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8)) { + args, kwds, "ffffffff", (char **)kwlist, &f1, &f2, &f3, &f4, &f5, &f6, &f7, &f8)) + { return -1; } self->py_ss.ss = new StrokeShaders::IncreasingColorShader(f1, f2, f3, f4, f5, f6, f7, f8); diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp index b07a1f26a3e..a672e203a0a 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SmoothingShader.cpp @@ -74,7 +74,8 @@ static int SmoothingShader___init__(BPy_SmoothingShader *self, PyObject *args, P double d2 = 0.1, d3 = 0.0, d4 = 0.2, d5 = 0.0, d6 = 0.0, d7 = 0.0, d8 = 1.0; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "|iddddddd", (char **)kwlist, &i1, &d2, &d3, &d4, &d5, &d6, &d7, &d8)) { + args, kwds, "|iddddddd", (char **)kwlist, &i1, &d2, &d3, &d4, &d5, &d6, &d7, &d8)) + { return -1; } self->py_ss.ss = new SmoothingShader(i1, d2, d3, d4, d5, d6, d7, d8); diff --git a/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp b/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp index 04ea15d7b47..93606624b63 100644 --- a/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp +++ b/source/blender/freestyle/intern/python/StrokeShader/BPy_SpatialNoiseShader.cpp @@ -67,7 +67,8 @@ static int SpatialNoiseShader___init__(BPy_SpatialNoiseShader *self, &PyBool_Type, &obj4, &PyBool_Type, - &obj5)) { + &obj5)) + { return -1; } self->py_ss.ss = new SpatialNoiseShader( diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp index a8be9722cff..e3b5621320a 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DDouble.cpp @@ -150,7 +150,8 @@ static PyObject *UnaryFunction0DDouble___call__(BPy_UnaryFunction0DDouble *self, PyObject *obj; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) { + args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) + { return nullptr; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp index b1a1cf816d4..9cfcb0e8cc3 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DEdgeNature.cpp @@ -89,7 +89,8 @@ static PyObject *UnaryFunction0DEdgeNature___call__(BPy_UnaryFunction0DEdgeNatur PyObject *obj; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) { + args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) + { return nullptr; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp index 588959667c5..64da3ae5dde 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DFloat.cpp @@ -126,7 +126,8 @@ static PyObject *UnaryFunction0DFloat___call__(BPy_UnaryFunction0DFloat *self, PyObject *obj; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) { + args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) + { return nullptr; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp index f0a62995c6d..7c5df84f238 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DId.cpp @@ -85,7 +85,8 @@ static PyObject *UnaryFunction0DId___call__(BPy_UnaryFunction0DId *self, PyObject *obj; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) { + args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) + { return nullptr; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp index 0c8294ff8dc..bdecfac48f2 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DMaterial.cpp @@ -88,7 +88,8 @@ static PyObject *UnaryFunction0DMaterial___call__(BPy_UnaryFunction0DMaterial *s PyObject *obj; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) { + args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) + { return nullptr; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp index c6e7fed4424..6536148b156 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DUnsigned.cpp @@ -91,7 +91,8 @@ static PyObject *UnaryFunction0DUnsigned___call__(BPy_UnaryFunction0DUnsigned *s PyObject *obj; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) { + args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) + { return nullptr; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp index fda4536b252..4b9ff5627cd 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec2f.cpp @@ -94,7 +94,8 @@ static PyObject *UnaryFunction0DVec2f___call__(BPy_UnaryFunction0DVec2f *self, PyObject *obj; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) { + args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) + { return nullptr; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp index 5409bd94789..ba012461c97 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVec3f.cpp @@ -87,7 +87,8 @@ static PyObject *UnaryFunction0DVec3f___call__(BPy_UnaryFunction0DVec3f *self, PyObject *obj; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) { + args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) + { return nullptr; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp index 73049f8e0c2..5f5b51c9758 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp @@ -92,7 +92,8 @@ static PyObject *UnaryFunction0DVectorViewShape___call__(BPy_UnaryFunction0DVect PyObject *obj; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) { + args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) + { return nullptr; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp index 319087b5092..dd960c30a16 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DViewShape.cpp @@ -96,7 +96,8 @@ static PyObject *UnaryFunction0DViewShape___call__(BPy_UnaryFunction0DViewShape PyObject *obj; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) { + args, kwds, "O!", (char **)kwlist, &Interface0DIterator_Type, &obj)) + { return nullptr; } diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp index 34c222cae28..14702c17d10 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_DensityF1D.cpp @@ -61,7 +61,8 @@ static int DensityF1D___init__(BPy_DensityF1D *self, PyObject *args, PyObject *k float f = 2.0; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "|dO!f", (char **)kwlist, &d, &IntegrationType_Type, &obj, &f)) { + args, kwds, "|dO!f", (char **)kwlist, &d, &IntegrationType_Type, &obj, &f)) + { return -1; } IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp index 42ab6926557..0283ffbeec2 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetCompleteViewMapDensityF1D.cpp @@ -65,7 +65,8 @@ static int GetCompleteViewMapDensityF1D___init__(BPy_GetCompleteViewMapDensityF1 float f = 2.0; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "i|O!f", (char **)kwlist, &i, &IntegrationType_Type, &obj, &f)) { + args, kwds, "i|O!f", (char **)kwlist, &i, &IntegrationType_Type, &obj, &f)) + { return -1; } IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp index dcd5d2189bf..3c93598b1aa 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetDirectionalViewMapDensityF1D.cpp @@ -73,7 +73,8 @@ static int GetDirectionalViewMapDensityF1D___init__(BPy_GetDirectionalViewMapDen float f = 2.0; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "II|O!f", (char **)kwlist, &u1, &u2, &IntegrationType_Type, &obj, &f)) { + args, kwds, "II|O!f", (char **)kwlist, &u1, &u2, &IntegrationType_Type, &obj, &f)) + { return -1; } IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp index ad1a65f9f81..d2f8c89d367 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetSteerableViewMapDensityF1D.cpp @@ -62,7 +62,8 @@ static int GetSteerableViewMapDensityF1D___init__(BPy_GetSteerableViewMapDensity float f = 2.0; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "i|O!f", (char **)kwlist, &i, &IntegrationType_Type, &obj, &f)) { + args, kwds, "i|O!f", (char **)kwlist, &i, &IntegrationType_Type, &obj, &f)) + { return -1; } IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp index 90912e32747..8c3f558d590 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_GetViewMapGradientNormF1D.cpp @@ -62,7 +62,8 @@ static int GetViewMapGradientNormF1D___init__(BPy_GetViewMapGradientNormF1D *sel float f = 2.0; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "i|O!f", (char **)kwlist, &i, &IntegrationType_Type, &obj, &f)) { + args, kwds, "i|O!f", (char **)kwlist, &i, &IntegrationType_Type, &obj, &f)) + { return -1; } IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; diff --git a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp index df77dd26b38..ea90c8967c6 100644 --- a/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp +++ b/source/blender/freestyle/intern/python/UnaryFunction1D/UnaryFunction1D_double/BPy_LocalAverageDepthF1D.cpp @@ -57,7 +57,8 @@ static int LocalAverageDepthF1D___init__(BPy_LocalAverageDepthF1D *self, double d; if (!PyArg_ParseTupleAndKeywords( - args, kwds, "d|O!", (char **)kwlist, &d, &IntegrationType_Type, &obj)) { + args, kwds, "d|O!", (char **)kwlist, &d, &IntegrationType_Type, &obj)) + { return -1; } IntegrationType t = (obj) ? IntegrationType_from_BPy_IntegrationType(obj) : MEAN; diff --git a/source/blender/freestyle/intern/scene_graph/LineRep.h b/source/blender/freestyle/intern/scene_graph/LineRep.h index f11c23e89b3..5775d3507ae 100644 --- a/source/blender/freestyle/intern/scene_graph/LineRep.h +++ b/source/blender/freestyle/intern/scene_graph/LineRep.h @@ -102,8 +102,8 @@ class LineRep : public Rep { if (0 != _vertices.size()) { _vertices.clear(); } - for (vector::const_iterator v = iVertices.begin(), end = iVertices.end(); v != end; - ++v) { + for (vector::const_iterator v = iVertices.begin(), end = iVertices.end(); v != end; ++v) + { _vertices.push_back(*v); } } diff --git a/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp b/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp index 37f5fb5cfbb..33282e0658a 100644 --- a/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp +++ b/source/blender/freestyle/intern/stroke/AdvancedFunctions0D.cpp @@ -19,7 +19,8 @@ int DensityF0D::operator()(Interface0DIterator &iter) int bound = _filter.getBound(); if ((iter->getProjectedX() - bound < 0) || (iter->getProjectedX() + bound > canvas->width()) || - (iter->getProjectedY() - bound < 0) || (iter->getProjectedY() + bound > canvas->height())) { + (iter->getProjectedY() - bound < 0) || (iter->getProjectedY() + bound > canvas->height())) + { result = 0.0; return 0; } @@ -42,7 +43,8 @@ int LocalAverageDepthF0D::operator()(Interface0DIterator &iter) int bound = _filter.getBound(); if ((iter->getProjectedX() - bound < 0) || (iter->getProjectedX() + bound > iViewer->width()) || - (iter->getProjectedY() - bound < 0) || (iter->getProjectedY() + bound > iViewer->height())) { + (iter->getProjectedY() - bound < 0) || (iter->getProjectedY() + bound > iViewer->height())) + { result = 0.0; return 0; } diff --git a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp index e77ba63f3d6..f14070abbe5 100644 --- a/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp +++ b/source/blender/freestyle/intern/stroke/BasicStrokeShaders.cpp @@ -80,7 +80,8 @@ int IncreasingThicknessShader::shade(Stroke &stroke) const int n = stroke.strokeVerticesSize() - 1, i; StrokeInternal::StrokeVertexIterator v, vend; for (i = 0, v = stroke.strokeVerticesBegin(), vend = stroke.strokeVerticesEnd(); v != vend; - ++v, ++i) { + ++v, ++i) + { float t; if (i < float(n) / 2.0f) { t = (1.0 - float(i) / float(n)) * _ThicknessMin + float(i) / float(n) * _ThicknessMax; @@ -100,7 +101,8 @@ int ConstrainedIncreasingThicknessShader::shade(Stroke &stroke) const int n = stroke.strokeVerticesSize() - 1, i; StrokeInternal::StrokeVertexIterator v, vend; for (i = 0, v = stroke.strokeVerticesBegin(), vend = stroke.strokeVerticesEnd(); v != vend; - ++v, ++i) { + ++v, ++i) + { // XXX Why not using an if/else here? Else, if last condition is true, everything else is // computed for nothing! float t; @@ -213,7 +215,8 @@ int IncreasingColorShader::shade(Stroke &stroke) const int n = stroke.strokeVerticesSize() - 1, yo; float newcolor[4]; for (yo = 0, v = stroke.strokeVerticesBegin(), vend = stroke.strokeVerticesEnd(); v != vend; - ++v, ++yo) { + ++v, ++yo) + { for (int i = 0; i < 4; ++i) { newcolor[i] = (1.0 - float(yo) / float(n)) * _colorMin[i] + float(yo) / float(n) * _colorMax[i]; @@ -375,7 +378,8 @@ int BezierCurveShader::shade(Stroke &stroke) const ++v; for (vend = stroke.strokeVerticesEnd(); v != vend; ++v) { if (!((fabs(v->x() - (previous)->x()) < M_EPSILON) && - (fabs(v->y() - (previous)->y()) < M_EPSILON))) { + (fabs(v->y() - (previous)->y()) < M_EPSILON))) + { data.emplace_back(v->x(), v->y()); } previous = v; @@ -432,7 +436,8 @@ int BezierCurveShader::shade(Stroke &stroke) const itend = stroke.strokeVerticesEnd(), pend = CurveVertices.end(); (it != itend) && (p != pend); - ++it, ++p, ++n) { + ++it, ++p, ++n) + { it->setX(p->x()); it->setY(p->y()); last = p; @@ -463,7 +468,8 @@ int BezierCurveShader::shade(Stroke &stroke) const for (vector::iterator vr = verticesToRemove.begin(), vrend = verticesToRemove.end(); vr != vrend; - ++vr) { + ++vr) + { stroke.RemoveVertex(*vr); } @@ -473,7 +479,8 @@ int BezierCurveShader::shade(Stroke &stroke) const int index2 = index1 + nExtraVertex; for (it = stroke.strokeVerticesBegin(), itend = stroke.strokeVerticesEnd(); (it != itend) && (a != aend); - ++it) { + ++it) + { (it)->setAttribute(*a); if ((index <= index1) || (index > index2)) { ++a; @@ -650,7 +657,8 @@ int TipRemoverShader::shade(Stroke &stroke) const vector oldAttributes; for (v = stroke.strokeVerticesBegin(), vend = stroke.strokeVerticesEnd(); v != vend; ++v) { if ((v->curvilinearAbscissa() < _tipLength) || - (v->strokeLength() - v->curvilinearAbscissa() < _tipLength)) { + (v->strokeLength() - v->curvilinearAbscissa() < _tipLength)) + { verticesToRemove.push_back(&(*v)); } oldAttributes.push_back(v->attribute()); @@ -676,7 +684,8 @@ int TipRemoverShader::shade(Stroke &stroke) const vector::iterator a = oldAttributes.begin(), aend = oldAttributes.end(); for (v = stroke.strokeVerticesBegin(), vend = stroke.strokeVerticesEnd(); (v != vend) && (a != aend); - ++v, ++a) { + ++v, ++a) + { v->setAttribute(*a); } // we're done! diff --git a/source/blender/freestyle/intern/stroke/Canvas.cpp b/source/blender/freestyle/intern/stroke/Canvas.cpp index 4df4dae7f3d..00a7644bbde 100644 --- a/source/blender/freestyle/intern/stroke/Canvas.cpp +++ b/source/blender/freestyle/intern/stroke/Canvas.cpp @@ -130,7 +130,8 @@ void Canvas::Clear() if (!_StyleModules.empty()) { for (deque::iterator s = _StyleModules.begin(), send = _StyleModules.end(); s != send; - ++s) { + ++s) + { if (*s) { delete (*s); } @@ -188,7 +189,8 @@ void Canvas::RemoveStyleModule(uint index) if (!_StyleModules.empty()) { for (deque::iterator s = _StyleModules.begin(), send = _StyleModules.end(); s != send; - ++s, ++i) { + ++s, ++i) + { if (i == index) { // remove shader if (*s) { @@ -203,7 +205,8 @@ void Canvas::RemoveStyleModule(uint index) if (!_Layers.empty()) { i = 0; for (deque::iterator sl = _Layers.begin(), slend = _Layers.end(); sl != slend; - ++sl, ++i) { + ++sl, ++i) + { if (i == index) { // remove layer if (*sl) { @@ -234,7 +237,8 @@ void Canvas::ReplaceStyleModule(uint index, StyleModule *iStyleModule) uint i = 0; for (deque::iterator s = _StyleModules.begin(), send = _StyleModules.end(); s != send; - ++s, ++i) { + ++s, ++i) + { if (i == index) { if (*s) { delete *s; diff --git a/source/blender/freestyle/intern/stroke/Curve.cpp b/source/blender/freestyle/intern/stroke/Curve.cpp index ad6a72eaf80..0f1957ba7a1 100644 --- a/source/blender/freestyle/intern/stroke/Curve.cpp +++ b/source/blender/freestyle/intern/stroke/Curve.cpp @@ -57,7 +57,8 @@ CurvePoint::CurvePoint(CurvePoint *iA, CurvePoint *iB, float t3) float t1 = iA->t2d(); float t2 = iB->t2d(); if ((iA->A() == iB->A()) && (iA->B() == iB->B()) && (iA->A() != nullptr) && - (iA->B() != nullptr) && (iB->A() != nullptr) && (iB->B() != nullptr)) { + (iA->B() != nullptr) && (iB->A() != nullptr) && (iB->B() != nullptr)) + { __A = iA->A(); __B = iB->B(); _t2d = t1 + t2 * t3 - t1 * t3; @@ -120,15 +121,18 @@ CurvePoint::CurvePoint(CurvePoint *iA, CurvePoint *iB, float t3) } } else if (iA->A() != nullptr && iB->A() != nullptr && - (iA->A()->point3d() - iB->A()->point3d()).norm() < 1.0e-6) { + (iA->A()->point3d() - iB->A()->point3d()).norm() < 1.0e-6) + { goto iA_A_eq_iB_A; } else if (iA->B() != nullptr && iB->B() != nullptr && - (iA->B()->point3d() - iB->B()->point3d()).norm() < 1.0e-6) { + (iA->B()->point3d() - iB->B()->point3d()).norm() < 1.0e-6) + { goto iA_B_eq_iB_B; } else if (iA->B() != nullptr && iB->A() != nullptr && - (iA->B()->point3d() - iB->A()->point3d()).norm() < 1.0e-6) { + (iA->B()->point3d() - iB->A()->point3d()).norm() < 1.0e-6) + { goto iA_B_eq_iB_A; } @@ -195,7 +199,8 @@ FEdge *CurvePoint::getFEdge(Interface0D &inter) return nullptr; } if (((__A == iVertexB->__A) && (__B == iVertexB->__B)) || - ((__A == iVertexB->__B) && (__B == iVertexB->__A))) { + ((__A == iVertexB->__B) && (__B == iVertexB->__A))) + { return __A->getFEdge(*__B); } if (__B == nullptr) { diff --git a/source/blender/freestyle/intern/stroke/Operators.cpp b/source/blender/freestyle/intern/stroke/Operators.cpp index c55db18015b..a294527c24d 100644 --- a/source/blender/freestyle/intern/stroke/Operators.cpp +++ b/source/blender/freestyle/intern/stroke/Operators.cpp @@ -81,7 +81,8 @@ int Operators::chain(ViewEdgeInternal::ViewEdgeIterator &it, for (I1DContainer::iterator it_edge = _current_view_edges_set.begin(); it_edge != _current_view_edges_set.end(); - ++it_edge) { + ++it_edge) + { if (pred(**it_edge) < 0) { goto error; } @@ -147,7 +148,8 @@ int Operators::chain(ViewEdgeInternal::ViewEdgeIterator &it, UnaryPredicate1D &p for (I1DContainer::iterator it_edge = _current_view_edges_set.begin(); it_edge != _current_view_edges_set.end(); - ++it_edge) { + ++it_edge) + { if (pred(**it_edge) < 0) { goto error; } @@ -328,7 +330,8 @@ int Operators::bidirectionalChain(ChainingIterator &it, UnaryPredicate1D &pred) for (I1DContainer::iterator it_edge = _current_view_edges_set.begin(); it_edge != _current_view_edges_set.end(); - ++it_edge) { + ++it_edge) + { if (pred(**it_edge) < 0) { goto error; } @@ -431,7 +434,8 @@ int Operators::bidirectionalChain(ChainingIterator &it) for (I1DContainer::iterator it_edge = _current_view_edges_set.begin(); it_edge != _current_view_edges_set.end(); - ++it_edge) { + ++it_edge) + { if (pred_ts(**it_edge) < 0) { goto error; } @@ -745,7 +749,8 @@ static int __recursiveSplit(Chain *_curve, for (; (vit != vitend) && (vnext != vitend) && (vnext._CurvilinearLength < split._CurvilinearLength); - ++vit, ++vnext) { + ++vit, ++vnext) + { new_curve_a->push_vertex_back(&(*vit)); } if ((vit == vitend) || (vnext == vitend)) { @@ -928,7 +933,8 @@ static int __recursiveSplit(Chain *_curve, for (; (vit != vitend) && (vnext != vitend) && (vnext._CurvilinearLength < split._CurvilinearLength); - ++vit, ++vnext) { + ++vit, ++vnext) + { new_curve_a->push_vertex_back(&(*vit)); } if ((vit == vitend) || (vnext == vitend)) { @@ -1286,16 +1292,16 @@ int Operators::create(UnaryPredicate1D &pred, vector shaders) } } - for (StrokesContainer::iterator it = new_strokes_set.begin(); it != new_strokes_set.end(); - ++it) { + for (StrokesContainer::iterator it = new_strokes_set.begin(); it != new_strokes_set.end(); ++it) + { _current_strokes_set.push_back(*it); } new_strokes_set.clear(); return 0; error: - for (StrokesContainer::iterator it = new_strokes_set.begin(); it != new_strokes_set.end(); - ++it) { + for (StrokesContainer::iterator it = new_strokes_set.begin(); it != new_strokes_set.end(); ++it) + { delete (*it); } new_strokes_set.clear(); @@ -1311,7 +1317,8 @@ void Operators::reset(bool removeStrokes) } _current_view_edges_set.clear(); for (I1DContainer::iterator it = _current_chains_set.begin(); it != _current_chains_set.end(); - ++it) { + ++it) + { delete *it; } _current_chains_set.clear(); diff --git a/source/blender/freestyle/intern/stroke/Stroke.cpp b/source/blender/freestyle/intern/stroke/Stroke.cpp index 66a31d02a9b..af1f5b851c0 100644 --- a/source/blender/freestyle/intern/stroke/Stroke.cpp +++ b/source/blender/freestyle/intern/stroke/Stroke.cpp @@ -410,7 +410,8 @@ Stroke::Stroke(const Stroke &iBrother) : Interface1D(iBrother) for (vertex_container::const_iterator v = iBrother._Vertices.begin(), vend = iBrother._Vertices.end(); v != vend; - v++) { + v++) + { _Vertices.push_back(*v); } _Length = 0; @@ -436,8 +437,8 @@ Stroke::Stroke(const Stroke &iBrother) : Interface1D(iBrother) Stroke::~Stroke() { if (!_Vertices.empty()) { - for (vertex_container::iterator v = _Vertices.begin(), vend = _Vertices.end(); v != vend; - v++) { + for (vertex_container::iterator v = _Vertices.begin(), vend = _Vertices.end(); v != vend; v++) + { delete (*v); } _Vertices.clear(); @@ -459,7 +460,8 @@ Stroke &Stroke::operator=(const Stroke &iBrother) for (vertex_container::const_iterator v = iBrother._Vertices.begin(), vend = iBrother._Vertices.end(); v != vend; - v++) { + v++) + { _Vertices.push_back(*v); } _Length = iBrother._Length; @@ -560,7 +562,8 @@ int Stroke::Resample(int iNPoints) resampled = false; for (vector::iterator s = strokeSegments.begin(), send = strokeSegments.end(); s != send; - ++s) { + ++s) + { if (s->_sampling == 0.0f) { continue; } @@ -592,7 +595,8 @@ int Stroke::Resample(int iNPoints) // actually resample: for (vector::iterator s = strokeSegments.begin(), send = strokeSegments.end(); s != send; - ++s) { + ++s) + { newVertices.push_back(&*(s->_begin)); if (s->_sampling < _sampling) { _sampling = s->_sampling; diff --git a/source/blender/freestyle/intern/stroke/StrokeIO.cpp b/source/blender/freestyle/intern/stroke/StrokeIO.cpp index 578fcb31f73..8949ea4fa25 100644 --- a/source/blender/freestyle/intern/stroke/StrokeIO.cpp +++ b/source/blender/freestyle/intern/stroke/StrokeIO.cpp @@ -44,7 +44,8 @@ ostream &operator<<(ostream &out, const Stroke &iStroke) out << " medium type : " << iStroke.getMediumType() << endl; for (Stroke::const_vertex_iterator v = iStroke.vertices_begin(), vend = iStroke.vertices_end(); v != vend; - ++v) { + ++v) + { out << *(*v) << endl; } return out; diff --git a/source/blender/freestyle/intern/stroke/StrokeLayer.cpp b/source/blender/freestyle/intern/stroke/StrokeLayer.cpp index 96b0a089dff..b81fafa00c3 100644 --- a/source/blender/freestyle/intern/stroke/StrokeLayer.cpp +++ b/source/blender/freestyle/intern/stroke/StrokeLayer.cpp @@ -20,7 +20,8 @@ void StrokeLayer::ScaleThickness(float iFactor) { for (StrokeLayer::stroke_container::iterator s = _strokes.begin(), send = _strokes.end(); s != send; - ++s) { + ++s) + { (*s)->ScaleThickness(iFactor); } } @@ -29,7 +30,8 @@ void StrokeLayer::Render(const StrokeRenderer *iRenderer) { for (StrokeLayer::stroke_container::iterator s = _strokes.begin(), send = _strokes.end(); s != send; - ++s) { + ++s) + { (*s)->Render(iRenderer); } } @@ -38,7 +40,8 @@ void StrokeLayer::RenderBasic(const StrokeRenderer *iRenderer) { for (StrokeLayer::stroke_container::iterator s = _strokes.begin(), send = _strokes.end(); s != send; - ++s) { + ++s) + { (*s)->RenderBasic(iRenderer); } } diff --git a/source/blender/freestyle/intern/stroke/StrokeRep.cpp b/source/blender/freestyle/intern/stroke/StrokeRep.cpp index 89567d7e780..677864b9893 100644 --- a/source/blender/freestyle/intern/stroke/StrokeRep.cpp +++ b/source/blender/freestyle/intern/stroke/StrokeRep.cpp @@ -59,7 +59,8 @@ Strip::Strip(const Strip &iBrother) for (vertex_container::const_iterator v = iBrother._vertices.begin(), vend = iBrother._vertices.end(); v != vend; - ++v) { + ++v) + { _vertices.push_back(new StrokeVertexRep(**v)); } } @@ -69,8 +70,8 @@ Strip::Strip(const Strip &iBrother) Strip::~Strip() { if (!_vertices.empty()) { - for (vertex_container::iterator v = _vertices.begin(), vend = _vertices.end(); v != vend; - ++v) { + for (vertex_container::iterator v = _vertices.begin(), vend = _vertices.end(); v != vend; ++v) + { delete (*v); } _vertices.clear(); @@ -110,8 +111,8 @@ void Strip::createStrip(const vector &iStrokeVertices) } _vertices.reserve(2 * iStrokeVertices.size()); if (!_vertices.empty()) { - for (vertex_container::iterator v = _vertices.begin(), vend = _vertices.end(); v != vend; - ++v) { + for (vertex_container::iterator v = _vertices.begin(), vend = _vertices.end(); v != vend; ++v) + { delete (*v); } _vertices.clear(); @@ -275,14 +276,16 @@ void Strip::createStrip(const vector &iStrokeVertices) Vec2r vec_tmp(_vertices[i - 2]->point2d() - p); if ((vec_tmp.norm() > thickness[1] * MAX_RATIO_LENGTH_SINGU) || (dirNorm < ZERO) || (dirPrevNorm < ZERO) || notValid(_vertices[i - 2]->point2d()) || - (fabs(stripDir * dir) < EPS_SINGULARITY_RENDERER)) { + (fabs(stripDir * dir) < EPS_SINGULARITY_RENDERER)) + { _vertices[i - 2]->setPoint2d(p + thickness[1] * stripDir); } vec_tmp = _vertices[i - 1]->point2d() - p; if ((vec_tmp.norm() > thickness[0] * MAX_RATIO_LENGTH_SINGU) || (dirNorm < ZERO) || (dirPrevNorm < ZERO) || notValid(_vertices[i - 1]->point2d()) || - (fabs(stripDir * dir) < EPS_SINGULARITY_RENDERER)) { + (fabs(stripDir * dir) < EPS_SINGULARITY_RENDERER)) + { _vertices[i - 1]->setPoint2d(p - thickness[0] * stripDir); } } // end of for @@ -813,7 +816,8 @@ StrokeRep::StrokeRep(const StrokeRep &iBrother) } for (vector::const_iterator s = iBrother._strips.begin(), send = iBrother._strips.end(); s != send; - ++s) { + ++s) + { _strips.push_back(new Strip(**s)); } } diff --git a/source/blender/freestyle/intern/stroke/StyleModule.h b/source/blender/freestyle/intern/stroke/StyleModule.h index d1c36194ef9..72b0195bd82 100644 --- a/source/blender/freestyle/intern/stroke/StyleModule.h +++ b/source/blender/freestyle/intern/stroke/StyleModule.h @@ -68,7 +68,8 @@ class StyleModule { StrokeLayer *sl = new StrokeLayer; for (Operators::StrokesContainer::iterator it = strokes_set->begin(); it != strokes_set->end(); - ++it) { + ++it) + { sl->AddStroke(*it); } diff --git a/source/blender/freestyle/intern/system/StringUtils.cpp b/source/blender/freestyle/intern/system/StringUtils.cpp index 7626beffd30..0e0450033bc 100644 --- a/source/blender/freestyle/intern/system/StringUtils.cpp +++ b/source/blender/freestyle/intern/system/StringUtils.cpp @@ -24,7 +24,8 @@ void getPathName(const string &path, const string &base, vector &pathnam pathnames.push_back(base); for (uint pos = 0, sep = path.find(Config::PATH_SEP, pos); pos < size; - pos = sep + 1, sep = path.find(Config::PATH_SEP, pos)) { + pos = sep + 1, sep = path.find(Config::PATH_SEP, pos)) + { if (sep == uint(string::npos)) { sep = size; } diff --git a/source/blender/freestyle/intern/view_map/BoxGrid.cpp b/source/blender/freestyle/intern/view_map/BoxGrid.cpp index d2e760b6e6e..47e602d10e2 100644 --- a/source/blender/freestyle/intern/view_map/BoxGrid.cpp +++ b/source/blender/freestyle/intern/view_map/BoxGrid.cpp @@ -125,8 +125,8 @@ void BoxGrid::assignCells(OccluderSource & /*source*/, // Identify cells that will be used, and set the dimensions for each ViewMap::fedges_container &fedges = viewMap->FEdges(); - for (ViewMap::fedges_container::iterator f = fedges.begin(), fend = fedges.end(); f != fend; - ++f) { + for (ViewMap::fedges_container::iterator f = fedges.begin(), fend = fedges.end(); f != fend; ++f) + { if ((*f)->isInImage()) { Vec3r point = transform((*f)->center3d()); uint i, j; diff --git a/source/blender/freestyle/intern/view_map/BoxGrid.h b/source/blender/freestyle/intern/view_map/BoxGrid.h index f1b2ec218db..0b7c5852736 100644 --- a/source/blender/freestyle/intern/view_map/BoxGrid.h +++ b/source/blender/freestyle/intern/view_map/BoxGrid.h @@ -263,7 +263,8 @@ inline bool BoxGrid::Iterator::testOccluder(bool wantOccludee) Vec3r bbMin, bbMax; (*_current)->poly.getBBox(bbMin, bbMax); if (_target[0] < bbMin[0] || _target[0] > bbMax[0] || _target[1] < bbMin[1] || - _target[1] > bbMax[1]) { + _target[1] > bbMax[1]) + { #if BOX_GRID_LOGGING if (G.debug & G_DEBUG_FREESTYLE) { std::cout << "\t\tSkipping: bounding box violation" << std::endl; diff --git a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp index b7e805f8767..4a5c9d7d271 100644 --- a/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp +++ b/source/blender/freestyle/intern/view_map/FEdgeXDetector.cpp @@ -46,8 +46,8 @@ void FEdgeXDetector::processShapes(WingedEdge &we) #endif if (_changes) { vector &wfaces = wxs->GetFaceList(); - for (vector::iterator wf = wfaces.begin(), wfend = wfaces.end(); wf != wfend; - ++wf) { + for (vector::iterator wf = wfaces.begin(), wfend = wfaces.end(); wf != wfend; ++wf) + { WXFace *wxf = dynamic_cast(*wf); wxf->Clear(); } @@ -128,7 +128,8 @@ void FEdgeXDetector::preProcessShape(WXShape *iWShape) if (_computeRidgesAndValleys || _computeSuggestiveContours) { vector &wvertices = iWShape->getVertexList(); for (vector::iterator wv = wvertices.begin(), wvend = wvertices.end(); wv != wvend; - ++wv) { + ++wv) + { // Compute curvatures WXVertex *wxv = dynamic_cast(*wv); computeCurvatures(wxv); @@ -320,8 +321,8 @@ void FEdgeXDetector::ProcessSilhouetteEdge(WXEdge *iEdge) WXFace *fA = (WXFace *)iEdge->GetaOEdge()->GetaFace(); WXFace *fB = (WXFace *)iEdge->GetaOEdge()->GetbFace(); - if (fA->front() ^ - fB->front()) { // fA->visible XOR fB->visible (true if one is 0 and the other is 1) + if (fA->front() ^ fB->front()) + { // fA->visible XOR fB->visible (true if one is 0 and the other is 1) // The only edges we want to set as silhouette edges in this way are the ones with 2 different // normals for 1 vertex for these two faces //-------------------- @@ -695,7 +696,8 @@ void FEdgeXDetector::postProcessSuggestiveContourFace(WXFace *iFace) t = sc_edge->ta(); if (t * kr_derivatives[iFace->GetIndex(sc_oedge->GetaVertex())] + (1 - t) * kr_derivatives[iFace->GetIndex(sc_oedge->GetbVertex())] < - _kr_derivative_epsilon) { + _kr_derivative_epsilon) + { sc_layer->removeSmoothEdge(); return; } @@ -703,7 +705,8 @@ void FEdgeXDetector::postProcessSuggestiveContourFace(WXFace *iFace) t = sc_edge->tb(); if (t * kr_derivatives[iFace->GetIndex(sc_oedge->GetaVertex())] + (1 - t) * kr_derivatives[iFace->GetIndex(sc_oedge->GetbVertex())] < - _kr_derivative_epsilon) { + _kr_derivative_epsilon) + { sc_layer->removeSmoothEdge(); } } @@ -765,7 +768,8 @@ void FEdgeXDetector::buildSmoothEdges(WXShape *iShape) vector &faceLayers = ((WXFace *)(*f))->getSmoothLayers(); for (vector::iterator wxfl = faceLayers.begin(), wxflend = faceLayers.end(); wxfl != wxflend; - ++wxfl) { + ++wxfl) + { if ((*wxfl)->BuildSmoothEdge()) { hasSmoothEdges = true; } @@ -775,7 +779,8 @@ void FEdgeXDetector::buildSmoothEdges(WXShape *iShape) if (hasSmoothEdges && !_computeRidgesAndValleys && !_computeSuggestiveContours) { vector &wvertices = iShape->getVertexList(); for (vector::iterator wv = wvertices.begin(), wvend = wvertices.end(); wv != wvend; - ++wv) { + ++wv) + { // Compute curvatures WXVertex *wxv = dynamic_cast(*wv); computeCurvatures(wxv); diff --git a/source/blender/freestyle/intern/view_map/Silhouette.cpp b/source/blender/freestyle/intern/view_map/Silhouette.cpp index 2398e82aca7..49bc5e2196d 100644 --- a/source/blender/freestyle/intern/view_map/Silhouette.cpp +++ b/source/blender/freestyle/intern/view_map/Silhouette.cpp @@ -159,7 +159,8 @@ FEdge *SVertex::getFEdge(Interface0D &inter) vector::const_iterator fe = _FEdges.begin(), feend = _FEdges.end(); for (; fe != feend; ++fe) { if ((((*fe)->vertexA() == this) && ((*fe)->vertexB() == iVertexB)) || - (((*fe)->vertexB() == this) && ((*fe)->vertexA() == iVertexB))) { + (((*fe)->vertexB() == this) && ((*fe)->vertexA() == iVertexB))) + { result = (*fe); } } @@ -175,7 +176,8 @@ FEdge *SVertex::getFEdge(Interface0D &inter) const vector &fedges = brother->fedges(); for (fe = fedges.begin(), feend = fedges.end(); fe != feend; ++fe) { if ((((*fe)->vertexA() == brother) && ((*fe)->vertexB() == iVertexB)) || - (((*fe)->vertexB() == brother) && ((*fe)->vertexA() == iVertexB))) { + (((*fe)->vertexB() == brother) && ((*fe)->vertexA() == iVertexB))) + { result = (*fe); } } @@ -192,7 +194,8 @@ FEdge *SVertex::getFEdge(Interface0D &inter) } for (fe = _FEdges.begin(), feend = _FEdges.end(); fe != feend; ++fe) { if ((((*fe)->vertexA() == this) && ((*fe)->vertexB() == brother)) || - (((*fe)->vertexB() == this) && ((*fe)->vertexA() == brother))) { + (((*fe)->vertexB() == this) && ((*fe)->vertexA() == brother))) + { result = (*fe); } } diff --git a/source/blender/freestyle/intern/view_map/Silhouette.h b/source/blender/freestyle/intern/view_map/Silhouette.h index 18fc262a35b..c678ff6c2e8 100644 --- a/source/blender/freestyle/intern/view_map/Silhouette.h +++ b/source/blender/freestyle/intern/view_map/Silhouette.h @@ -1474,7 +1474,8 @@ class SShape { vector newfedgelist; for (vector::const_iterator fed = fedgeList.begin(), fedend = fedgeList.end(); fed != fedend; - fed++) { + fed++) + { FEdge *current = *fed; newfedgelist.push_back((FEdge *)current->userdata); } @@ -1601,7 +1602,8 @@ class SShape { real t, T; for (vector::const_iterator p = iParameters.begin(), pend = iParameters.end(); p != pend; - p++) { + p++) + { T = (*p)[0]; t = (*p)[1]; @@ -1628,7 +1630,8 @@ class SShape { for (vector::iterator sv = intersections.begin(), svend = intersections.end(); sv != svend; - sv++) { + sv++) + { // SVertex *svA = fe->vertexA(); SVertex *svB = fe->vertexB(); @@ -1812,8 +1815,8 @@ class SShape { inline void RemoveEdgeFromChain(FEdge *iEdge) { - for (vector::iterator fe = _chains.begin(), feend = _chains.end(); fe != feend; - fe++) { + for (vector::iterator fe = _chains.begin(), feend = _chains.end(); fe != feend; fe++) + { if (iEdge == (*fe)) { _chains.erase(fe); break; @@ -1824,7 +1827,8 @@ class SShape { inline void RemoveEdge(FEdge *iEdge) { for (vector::iterator fe = _edgesList.begin(), feend = _edgesList.end(); fe != feend; - fe++) { + fe++) + { if (iEdge == (*fe)) { _edgesList.erase(fe); break; diff --git a/source/blender/freestyle/intern/view_map/SphericalGrid.cpp b/source/blender/freestyle/intern/view_map/SphericalGrid.cpp index fb3b6bb546d..ba2708b84ff 100644 --- a/source/blender/freestyle/intern/view_map/SphericalGrid.cpp +++ b/source/blender/freestyle/intern/view_map/SphericalGrid.cpp @@ -122,8 +122,8 @@ void SphericalGrid::assignCells(OccluderSource & /*source*/, // Identify cells that will be used, and set the dimensions for each ViewMap::fedges_container &fedges = viewMap->FEdges(); - for (ViewMap::fedges_container::iterator f = fedges.begin(), fend = fedges.end(); f != fend; - ++f) { + for (ViewMap::fedges_container::iterator f = fedges.begin(), fend = fedges.end(); f != fend; ++f) + { if ((*f)->isInImage()) { Vec3r point = SphericalGrid::Transform::sphericalProjection((*f)->center3d()); uint i, j; diff --git a/source/blender/freestyle/intern/view_map/SphericalGrid.h b/source/blender/freestyle/intern/view_map/SphericalGrid.h index 9e2c2ae6ca9..fd43217ab7f 100644 --- a/source/blender/freestyle/intern/view_map/SphericalGrid.h +++ b/source/blender/freestyle/intern/view_map/SphericalGrid.h @@ -264,7 +264,8 @@ inline bool SphericalGrid::Iterator::testOccluder(bool wantOccludee) Vec3r bbMin, bbMax; (*_current)->poly.getBBox(bbMin, bbMax); if (_target[0] < bbMin[0] || _target[0] > bbMax[0] || _target[1] < bbMin[1] || - _target[1] > bbMax[1]) { + _target[1] > bbMax[1]) + { #if SPHERICAL_GRID_LOGGING if (G.debug & G_DEBUG_FREESTYLE) { std::cout << "\t\tSkipping: bounding box violation" << std::endl; diff --git a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp index 20472599835..e0ad5de1bf5 100644 --- a/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp +++ b/source/blender/freestyle/intern/view_map/SteerableViewMap.cpp @@ -79,8 +79,8 @@ void SteerableViewMap::Clear() _imagesPyramids = nullptr; } if (!_mapping.empty()) { - for (map::iterator m = _mapping.begin(), mend = _mapping.end(); m != mend; - ++m) { + for (map::iterator m = _mapping.begin(), mend = _mapping.end(); m != mend; ++m) + { delete[](*m).second; } _mapping.clear(); diff --git a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp index fcb157a4e60..6af4cb6ff51 100644 --- a/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp +++ b/source/blender/freestyle/intern/view_map/ViewEdgeXBuilder.cpp @@ -66,7 +66,8 @@ void ViewEdgeXBuilder::BuildViewEdges(WXShape *iWShape, vector &smoothLayers = wxf->getSmoothLayers(); for (vector::iterator sl = smoothLayers.begin(), slend = smoothLayers.end(); sl != slend; - ++sl) { + ++sl) + { if (!(*sl)->hasSmoothEdge()) { continue; } @@ -168,7 +169,8 @@ ViewEdge *ViewEdgeXBuilder::BuildSmoothViewEdge(const OWXFaceLayer &iFaceLayer) FEdge *fefirst = nullptr; FEdge *fe = nullptr; for (list::iterator fl = facesChain.begin(), flend = facesChain.end(); fl != flend; - ++fl) { + ++fl) + { fe = BuildSmoothFEdge(feprevious, (*fl)); if (feprevious && fe == feprevious) { continue; @@ -475,8 +477,8 @@ FEdge *ViewEdgeXBuilder::BuildSmoothFEdge(FEdge *feprevious, const OWXFaceLayer Vec3r normal; // Make the 2 Svertices - if (feprevious == - nullptr) { // that means that we don't have any vertex already built for that face + if (feprevious == nullptr) + { // that means that we don't have any vertex already built for that face Vec3r A1(woea->GetaVertex()->GetVertex()); Vec3r A2(woea->GetbVertex()->GetVertex()); Vec3r A(A1 + ta * (A2 - A1)); diff --git a/source/blender/freestyle/intern/view_map/ViewMap.cpp b/source/blender/freestyle/intern/view_map/ViewMap.cpp index c7e57a81408..767ceff9638 100644 --- a/source/blender/freestyle/intern/view_map/ViewMap.cpp +++ b/source/blender/freestyle/intern/view_map/ViewMap.cpp @@ -32,13 +32,15 @@ ViewMap::~ViewMap() // The view vertices must be deleted here as some of them are shared between two shapes: for (vector::iterator vv = _VVertices.begin(), vvend = _VVertices.end(); vv != vvend; - vv++) { + vv++) + { delete (*vv); } _VVertices.clear(); for (vector::iterator vs = _VShapes.begin(), vsend = _VShapes.end(); vs != vsend; - vs++) { + vs++) + { delete (*vs); } _VShapes.clear(); @@ -53,7 +55,8 @@ void ViewMap::Clean() vector tmpEdges; for (vector::iterator vs = _VShapes.begin(), vsend = _VShapes.end(); vs != vsend; - vs++) { + vs++) + { vector &edges = (*vs)->sshape()->getEdgeList(); for (vector::iterator it = edges.begin(), itend = edges.end(); it != itend; it++) { if ((*it)->isTemporary()) { @@ -63,10 +66,11 @@ void ViewMap::Clean() } } - for (vector::iterator it = tmpEdges.begin(), itend = tmpEdges.end(); it != itend; - it++) { + for (vector::iterator it = tmpEdges.begin(), itend = tmpEdges.end(); it != itend; it++) + { for (vector::iterator vs = _VShapes.begin(), vsend = _VShapes.end(); vs != vsend; - vs++) { + vs++) + { (*vs)->sshape()->RemoveEdge(*it); } (*it)->vertexA()->RemoveFEdge(*it); @@ -93,7 +97,8 @@ const FEdge *ViewMap::getClosestFEdge(real x, real y) const real minDist = DBL_MAX; FEdge *winner = nullptr; for (fedges_container::const_iterator fe = _FEdges.begin(), feend = _FEdges.end(); fe != feend; - fe++) { + fe++) + { Vec2d A((*fe)->vertexA()->point2D()[0], (*fe)->vertexA()->point2D()[1]); Vec2d B((*fe)->vertexB()->point2D()[0], (*fe)->vertexB()->point2D()[1]); real dist = GeomUtils::distPointSegment(Vec2r(x, y), A, B); @@ -112,7 +117,8 @@ const ViewEdge *ViewMap::getClosestViewEdge(real x, real y) const real minDist = DBL_MAX; FEdge *winner = nullptr; for (fedges_container::const_iterator fe = _FEdges.begin(), feend = _FEdges.end(); fe != feend; - fe++) { + fe++) + { Vec2d A((*fe)->vertexA()->point2D()[0], (*fe)->vertexA()->point2D()[1]); Vec2d B((*fe)->vertexB()->point2D()[0], (*fe)->vertexB()->point2D()[1]); real dist = GeomUtils::distPointSegment(Vec2r(x, y), A, B); @@ -451,7 +457,8 @@ ViewVertex::edge_iterator TVertex::edges_iterator(ViewEdge *iEdge) { for (edge_pointers_container::iterator it = _sortedEdges.begin(), itend = _sortedEdges.end(); it != itend; - it++) { + it++) + { if ((*it)->first == iEdge) { return edge_iterator(_sortedEdges.begin(), _sortedEdges.end(), it); } @@ -481,7 +488,8 @@ ViewVertex::const_edge_iterator TVertex::edges_iterator(ViewEdge *iEdge) const for (edge_pointers_container::const_iterator it = _sortedEdges.begin(), itend = _sortedEdges.end(); it != itend; - it++) { + it++) + { if ((*it)->first == iEdge) { return const_edge_iterator(_sortedEdges.begin(), _sortedEdges.end(), it); } @@ -522,7 +530,8 @@ ViewVertexInternal::orientedViewEdgeIterator TVertex::edgesIterator(ViewEdge *iE { for (edge_pointers_container::iterator it = _sortedEdges.begin(), itend = _sortedEdges.end(); it != itend; - it++) { + it++) + { if ((*it)->first == iEdge) { return ViewVertexInternal::orientedViewEdgeIterator( _sortedEdges.begin(), _sortedEdges.end(), it); @@ -596,7 +605,8 @@ ViewVertex::const_edge_iterator NonTVertex::edges_end() const ViewVertex::edge_iterator NonTVertex::edges_iterator(ViewEdge *iEdge) { for (edges_container::iterator it = _ViewEdges.begin(), itend = _ViewEdges.end(); it != itend; - it++) { + it++) + { if ((it)->first == iEdge) { return edge_iterator(_ViewEdges.begin(), _ViewEdges.end(), it); } @@ -608,7 +618,8 @@ ViewVertex::const_edge_iterator NonTVertex::edges_iterator(ViewEdge *iEdge) cons { for (edges_container::const_iterator it = _ViewEdges.begin(), itend = _ViewEdges.end(); it != itend; - it++) { + it++) + { if ((it)->first == iEdge) { return const_edge_iterator(_ViewEdges.begin(), _ViewEdges.end(), it); } @@ -631,7 +642,8 @@ ViewVertexInternal::orientedViewEdgeIterator NonTVertex::edgesEnd() ViewVertexInternal::orientedViewEdgeIterator NonTVertex::edgesIterator(ViewEdge *iEdge) { for (edges_container::iterator it = _ViewEdges.begin(), itend = _ViewEdges.end(); it != itend; - it++) { + it++) + { if ((it)->first == iEdge) { return ViewVertexInternal::orientedViewEdgeIterator( _ViewEdges.begin(), _ViewEdges.end(), it); @@ -800,7 +812,8 @@ void ViewShape::RemoveEdge(ViewEdge *iViewEdge) void ViewShape::RemoveVertex(ViewVertex *iViewVertex) { for (vector::iterator vv = _Vertices.begin(), vvend = _Vertices.end(); vv != vvend; - vv++) { + vv++) + { if (iViewVertex == (*vv)) { _Vertices.erase(vv); break; diff --git a/source/blender/freestyle/intern/view_map/ViewMap.h b/source/blender/freestyle/intern/view_map/ViewMap.h index 401bdf51b50..317b8d6f0e8 100644 --- a/source/blender/freestyle/intern/view_map/ViewMap.h +++ b/source/blender/freestyle/intern/view_map/ViewMap.h @@ -1224,7 +1224,8 @@ class ViewEdge : public Interface1D { iMin, iMax, Vec2r(current->vertexA()->point2D()[0], current->vertexA()->point2D()[1]), - Vec2r(current->vertexB()->point2D()[0], current->vertexB()->point2D()[1]))) { + Vec2r(current->vertexB()->point2D()[0], current->vertexB()->point2D()[1]))) + { return true; } current = current->nextEdge(); @@ -1243,7 +1244,8 @@ class ViewEdge : public Interface1D { iMin, iMax, Vec2r(current->vertexA()->point2D()[0], current->vertexA()->point2D()[1]), - Vec2r(current->vertexB()->point2D()[0], current->vertexB()->point2D()[1]))) { + Vec2r(current->vertexB()->point2D()[0], current->vertexB()->point2D()[1]))) + { return false; } current = current->nextEdge(); @@ -1463,7 +1465,8 @@ class ViewShape { for (vector::iterator ve = vedges.begin(), veend = vedges.end(); ve != veend; - ve++) { + ve++) + { ViewEdge *current = (ViewEdge *)((ve)->first)->userdata; newEdges.push_back(ViewVertex::directedViewEdge(current, ve->second)); } diff --git a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp index 183538ddd93..94339e7c619 100644 --- a/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp +++ b/source/blender/freestyle/intern/view_map/ViewMapBuilder.cpp @@ -91,7 +91,8 @@ static void findOccludee(FEdge *fe, for (vector::iterator fv = faceVertices.begin(), fvend = faceVertices.end(); fv != fvend; - ++fv) { + ++fv) + { if ((*fv)->isBoundary()) { continue; } @@ -121,7 +122,8 @@ static void findOccludee(FEdge *fe, //------------------------------------------------------------- // first let us compute the plane equation. if (GeomUtils::COINCIDENT == - GeomUtils::intersectRayPlane(origin, edgeDir, p->getNormal(), d, t, epsilon)) { + GeomUtils::intersectRayPlane(origin, edgeDir, p->getNormal(), d, t, epsilon)) + { #if LOGGING if (_global.debug & G_DEBUG_FREESTYLE) { cout << "\t\tRejecting occluder for target coincidence." << endl; @@ -275,7 +277,8 @@ static int computeVisibility(ViewMap *viewMap, for (vector::const_iterator woe = oface->getEdgeList().begin(), woend = oface->getEdgeList().end(); woe != woend; - woe++) { + woe++) + { points.push_back(Vec3r((*woe)->GetaVertex()->GetVertex())); } Polygon3r p1(points, oface->GetNormal()); @@ -310,7 +313,8 @@ static int computeVisibility(ViewMap *viewMap, for (vector::iterator fv = faceVertices.begin(), fvend = faceVertices.end(); fv != fvend; - ++fv) { + ++fv) + { if ((*fv)->isBoundary()) { continue; } @@ -348,7 +352,8 @@ static int computeVisibility(ViewMap *viewMap, //------------------------------------------------------------- // first let us compute the plane equation. if (GeomUtils::COINCIDENT == - GeomUtils::intersectRayPlane(origin, edgeDir, p->getNormal(), d, t, epsilon)) { + GeomUtils::intersectRayPlane(origin, edgeDir, p->getNormal(), d, t, epsilon)) + { #if LOGGING if (_global.debug & G_DEBUG_FREESTYLE) { cout << "\t\tRejecting occluder for target coincidence." << endl; @@ -596,7 +601,8 @@ static void computeCumulativeVisibility(ViewMap *ioViewMap, // its contents. Is there a reason why ViewEdge::_Occluders cannot be converted to a set<>? for (set::iterator o = foundOccluders.begin(), oend = foundOccluders.end(); o != oend; - ++o) { + ++o) + { (*ve)->AddOccluder(*o); } #if LOGGING @@ -787,7 +793,8 @@ static void computeDetailedVisibility(ViewMap *ioViewMap, // out its contents. Is there a reason why ViewEdge::_Occluders cannot be converted to a set<>? for (set::iterator o = foundOccluders.begin(), oend = foundOccluders.end(); o != oend; - ++o) { + ++o) + { (*ve)->AddOccluder(*o); } #if LOGGING @@ -926,7 +933,8 @@ static void computeFastVisibility(ViewMap *ioViewMap, G &grid, real epsilon) // occluders -- for (set::iterator o = foundOccluders.begin(), oend = foundOccluders.end(); o != oend; - ++o) { + ++o) + { (*ve)->AddOccluder(*o); } @@ -1658,8 +1666,8 @@ void ViewMapBuilder::ComputeRayCastingVisibility(ViewMap *ioViewMap, real epsilo // qi -- (*ve)->setQI(maxIndex); // occluders -- - for (set::iterator o = occluders.begin(), oend = occluders.end(); o != oend; - ++o) { + for (set::iterator o = occluders.begin(), oend = occluders.end(); o != oend; ++o) + { (*ve)->AddOccluder(*o); } #if LOGGING @@ -1936,7 +1944,8 @@ void ViewMapBuilder::FindOccludee(FEdge *fe, for (vector::iterator fv = faceVertices.begin(), fvend = faceVertices.end(); fv != fvend; - ++fv) { + ++fv) + { if ((*fv)->isBoundary()) { continue; } @@ -2051,7 +2060,8 @@ int ViewMapBuilder::ComputeRayCastingVisibility(FEdge *fe, if ((center.x() < gridOrigin.x()) || (center.y() < gridOrigin.y()) || (center.z() < gridOrigin.z()) || (center.x() > gridExtremity.x()) || - (center.y() > gridExtremity.y()) || (center.z() > gridExtremity.z())) { + (center.y() > gridExtremity.y()) || (center.z() > gridExtremity.z())) + { cerr << "Warning: point is out of the grid for fedge " << fe->getId() << endl; // return 0; } @@ -2148,7 +2158,8 @@ int ViewMapBuilder::ComputeRayCastingVisibility(FEdge *fe, for (vector::iterator fv = faceVertices.begin(), fvend = faceVertices.end(); fv != fvend; - ++fv) { + ++fv) + { if ((*fv)->isBoundary()) { continue; } @@ -2316,7 +2327,8 @@ struct silhouette_binary_rule : public binary_rule { FEdge *f2 = s2.edge(); if (!(((f1)->getNature() & Nature::SILHOUETTE) || ((f1)->getNature() & Nature::BORDER)) && - !(((f2)->getNature() & Nature::SILHOUETTE) || ((f2)->getNature() & Nature::BORDER))) { + !(((f2)->getNature() & Nature::SILHOUETTE) || ((f2)->getNature() & Nature::BORDER))) + { return false; } @@ -2372,7 +2384,8 @@ void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsi vector vsegments; for (vector::iterator sv = svertices.begin(), svend = svertices.end(); sv != svend; - sv++) { + sv++) + { if (_pRenderMonitor && _pRenderMonitor->testBreak()) { break; } @@ -2381,7 +2394,8 @@ void ViewMapBuilder::ComputeSweepLineIntersections(ViewMap *ioViewMap, real epsi for (vector::const_iterator sve = vedges.begin(), sveend = vedges.end(); sve != sveend; - sve++) { + sve++) + { vsegments.push_back((segment *)((*sve)->userdata)); } diff --git a/source/blender/freestyle/intern/winged_edge/Curvature.cpp b/source/blender/freestyle/intern/winged_edge/Curvature.cpp index 36c06fde78e..be962dc7d6c 100644 --- a/source/blender/freestyle/intern/winged_edge/Curvature.cpp +++ b/source/blender/freestyle/intern/winged_edge/Curvature.cpp @@ -391,7 +391,8 @@ void gts_vertex_principal_directions(WVertex *v, Vec3r Kh, real Kg, Vec3r &e1, V /* check for solvability of the linear system */ if (((aterm_da * bterm_db - aterm_db * bterm_da) != 0.0) && - ((const_da != 0.0) || (const_db != 0.0))) { + ((const_da != 0.0) || (const_db != 0.0))) + { linsolve(aterm_da, bterm_da, -const_da, aterm_db, bterm_db, -const_db, &a, &b); c = normKh - a; diff --git a/source/blender/freestyle/intern/winged_edge/Curvature.h b/source/blender/freestyle/intern/winged_edge/Curvature.h index 88eb74972ea..023e04dca43 100644 --- a/source/blender/freestyle/intern/winged_edge/Curvature.h +++ b/source/blender/freestyle/intern/winged_edge/Curvature.h @@ -86,7 +86,8 @@ class Face_Curvature_Info { for (vector::iterator ci = vec_curvature_info.begin(), ciend = vec_curvature_info.end(); ci != ciend; - ++ci) { + ++ci) + { delete (*ci); } vec_curvature_info.clear(); diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.cpp b/source/blender/freestyle/intern/winged_edge/WEdge.cpp index 677029feb4c..642507a81e7 100644 --- a/source/blender/freestyle/intern/winged_edge/WEdge.cpp +++ b/source/blender/freestyle/intern/winged_edge/WEdge.cpp @@ -635,7 +635,8 @@ WFace *WShape::MakeFace(vector &iVertexList, if (3 == iVertexList.size()) { if ((iVertexList[0] == iVertexList[1]) || (iVertexList[0] == iVertexList[2]) || - (iVertexList[2] == iVertexList[1])) { + (iVertexList[2] == iVertexList[1])) + { cerr << "Warning: degenerated triangle detected, correcting" << endl; return nullptr; } @@ -713,7 +714,8 @@ real WShape::ComputeMeanEdgeSize() const real meanEdgeSize = 0.0; for (vector::const_iterator it = _EdgeList.begin(), itend = _EdgeList.end(); it != itend; - it++) { + it++) + { meanEdgeSize += (*it)->GetaOEdge()->GetVec().norm(); } return meanEdgeSize / (real)_EdgeList.size(); diff --git a/source/blender/freestyle/intern/winged_edge/WEdge.h b/source/blender/freestyle/intern/winged_edge/WEdge.h index ed50142697f..dad2197accd 100644 --- a/source/blender/freestyle/intern/winged_edge/WEdge.h +++ b/source/blender/freestyle/intern/winged_edge/WEdge.h @@ -762,7 +762,8 @@ class WFace { int index = 0; for (vector::iterator woe = _OEdgeList.begin(), woend = _OEdgeList.end(); woe != woend; - woe++) { + woe++) + { if ((*woe)->GetaVertex() == iVertex) { return index; } @@ -775,7 +776,8 @@ class WFace { { for (vector::iterator woe = _OEdgeList.begin(), woend = _OEdgeList.end(); woe != woend; - woe++) { + woe++) + { oVertices.push_back((*woe)->GetaVertex()); } } @@ -784,7 +786,8 @@ class WFace { { for (vector::iterator woe = _OEdgeList.begin(), woend = _OEdgeList.end(); woe != woend; - woe++) { + woe++) + { WFace *af; if ((af = (*woe)->GetaFace())) { oWFaces.push_back(af); @@ -836,7 +839,8 @@ class WFace { int index = 0; for (vector::const_iterator woe = _OEdgeList.begin(), woend = _OEdgeList.end(); woe != woend; - woe++) { + woe++) + { if ((*woe)->GetaVertex() == iVertex) { index = i; break; @@ -887,7 +891,8 @@ class WFace { { for (vector::const_iterator woe = _OEdgeList.begin(), woeend = _OEdgeList.end(); woe != woeend; - ++woe) { + ++woe) + { if ((*woe)->GetOwner()->GetbOEdge() == 0) { return true; } diff --git a/source/blender/freestyle/intern/winged_edge/WXEdge.cpp b/source/blender/freestyle/intern/winged_edge/WXEdge.cpp index 6838060b44e..0cb578e9940 100644 --- a/source/blender/freestyle/intern/winged_edge/WXEdge.cpp +++ b/source/blender/freestyle/intern/winged_edge/WXEdge.cpp @@ -243,7 +243,8 @@ void WXFace::ComputeCenter() Vec3f center; for (vector::iterator wv = iVertexList.begin(), wvend = iVertexList.end(); wv != wvend; - ++wv) { + ++wv) + { center += (*wv)->GetVertex(); } center /= float(iVertexList.size()); @@ -270,7 +271,8 @@ WFace *WXShape::MakeFace(vector &iVertexList, Vec3f center; for (vector::iterator wv = iVertexList.begin(), wvend = iVertexList.end(); wv != wvend; - ++wv) { + ++wv) + { center += (*wv)->GetVertex(); } center /= float(iVertexList.size()); diff --git a/source/blender/freestyle/intern/winged_edge/WXEdge.h b/source/blender/freestyle/intern/winged_edge/WXEdge.h index 5cd27d96fca..f775eb82c5b 100644 --- a/source/blender/freestyle/intern/winged_edge/WXEdge.h +++ b/source/blender/freestyle/intern/winged_edge/WXEdge.h @@ -503,7 +503,8 @@ class WXFace : public WFace { for (vector::iterator wxf = iBrother._SmoothLayers.begin(), wxfend = iBrother._SmoothLayers.end(); wxf != wxfend; - ++wxf) { + ++wxf) + { _SmoothLayers.push_back(new WXFaceLayer(**wxf)); } } @@ -520,7 +521,8 @@ class WXFace : public WFace { for (vector::iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end(); wxf != wxfend; - ++wxf) { + ++wxf) + { delete (*wxf); } _SmoothLayers.clear(); @@ -559,7 +561,8 @@ class WXFace : public WFace { for (vector::const_iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end(); wxf != wxfend; - ++wxf) { + ++wxf) + { if ((*wxf)->hasSmoothEdge()) { return true; } @@ -577,7 +580,8 @@ class WXFace : public WFace { { for (vector::iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end(); wxf != wxfend; - ++wxf) { + ++wxf) + { if ((*wxf)->hasSmoothEdge() && ((*wxf)->_Nature & iNature)) { oSmoothEdges.push_back((*wxf)->_pSmoothEdge); } @@ -588,7 +592,8 @@ class WXFace : public WFace { { for (vector::iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end(); wxf != wxfend; - ++wxf) { + ++wxf) + { if ((*wxf)->hasSmoothEdge() && ((*wxf)->_Nature & iNature)) { oSmoothEdgesLayers.push_back((*wxf)); } @@ -599,7 +604,8 @@ class WXFace : public WFace { { for (vector::iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end(); wxf != wxfend; - ++wxf) { + ++wxf) + { if ((*wxf)->_Nature & iNature) { oSmoothLayers.push_back(*wxf); } @@ -645,7 +651,8 @@ class WXFace : public WFace { vector layersToKeep; for (vector::iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end(); wxf != wxfend; - ++wxf) { + ++wxf) + { if ((*wxf)->isViewDependant()) { delete (*wxf); } @@ -661,7 +668,8 @@ class WXFace : public WFace { { for (vector::iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end(); wxf != wxfend; - ++wxf) { + ++wxf) + { delete (*wxf); } _SmoothLayers.clear(); @@ -672,7 +680,8 @@ class WXFace : public WFace { WFace::ResetUserData(); for (vector::iterator wxf = _SmoothLayers.begin(), wxfend = _SmoothLayers.end(); wxf != wxfend; - ++wxf) { + ++wxf) + { (*wxf)->userdata = NULL; } } diff --git a/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp b/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp index ce6054830f3..20d02dc5330 100644 --- a/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp +++ b/source/blender/freestyle/intern/winged_edge/WingedEdgeBuilder.cpp @@ -201,7 +201,8 @@ bool WingedEdgeBuilder::buildWShape(WShape &shape, IndexedFaceSet &ifs) set normalsSet; vector &wvertices = shape.getVertexList(); for (vector::iterator wv = wvertices.begin(), wvend = wvertices.end(); wv != wvend; - ++wv) { + ++wv) + { if ((*wv)->isBoundary()) { continue; } diff --git a/source/blender/functions/FN_multi_function_builder.hh b/source/blender/functions/FN_multi_function_builder.hh index ec36dfd1282..5c112cc6cba 100644 --- a/source/blender/functions/FN_multi_function_builder.hh +++ b/source/blender/functions/FN_multi_function_builder.hh @@ -72,7 +72,8 @@ struct AllSpanOrSingle { } else if constexpr (ELEM(ParamTag::category, ParamCategory::SingleOutput, - ParamCategory::SingleMutable)) { + ParamCategory::SingleMutable)) + { T *ptr = std::get(loaded_params); return BasicDevirtualizer{ptr}; } @@ -106,7 +107,8 @@ template struct SomeSpanOrSingle { } else if constexpr (ELEM(ParamTag::category, ParamCategory::SingleOutput, - ParamCategory::SingleMutable)) { + ParamCategory::SingleMutable)) + { T *ptr = std::get(loaded_params); return BasicDevirtualizer{ptr}; } @@ -297,7 +299,8 @@ inline void execute_materialized(TypeSequence /* param_tags */, } else if constexpr (ELEM(ParamTag::category, ParamCategory::SingleOutput, - ParamCategory::SingleMutable)) { + ParamCategory::SingleMutable)) + { /* For outputs, just pass a pointer. This is important so that `__restrict` works. */ if (sliced_mask_is_range) { /* Can write into the caller-provided buffer directly. */ @@ -436,7 +439,8 @@ inline void execute_element_fn_as_multi_function(const ElementFn element_fn, } else if constexpr (ELEM(ParamTag::category, ParamCategory::SingleOutput, - ParamCategory::SingleMutable)) { + ParamCategory::SingleMutable)) + { T *ptr = std::get(loaded_params); return ptr; } diff --git a/source/blender/functions/intern/lazy_function_graph_executor.cc b/source/blender/functions/intern/lazy_function_graph_executor.cc index 6361c687693..7e677a5a6d0 100644 --- a/source/blender/functions/intern/lazy_function_graph_executor.cc +++ b/source/blender/functions/intern/lazy_function_graph_executor.cc @@ -1057,7 +1057,8 @@ class Executor { /* Forward the value to the outside of the graph. */ const int graph_output_index = self_.graph_outputs_.index_of_try(target_socket); if (graph_output_index != -1 && - params_->get_output_usage(graph_output_index) != ValueUsage::Unused) { + params_->get_output_usage(graph_output_index) != ValueUsage::Unused) + { void *dst_buffer = params_->get_output_data_ptr(graph_output_index); if (is_last_target) { type.move_construct(value_to_forward.get(), dst_buffer); @@ -1106,7 +1107,8 @@ class Executor { if (node_state.missing_required_inputs == 0 || (locked_node.node.is_function() && static_cast(locked_node.node) .function() - .allow_missing_requested_inputs())) { + .allow_missing_requested_inputs())) + { this->schedule_node(locked_node, current_task, false); } } diff --git a/source/blender/functions/intern/multi_function.cc b/source/blender/functions/intern/multi_function.cc index 7cf79cc4b81..712a7a3922f 100644 --- a/source/blender/functions/intern/multi_function.cc +++ b/source/blender/functions/intern/multi_function.cc @@ -25,7 +25,8 @@ static bool supports_threading_by_slicing_params(const MultiFunction &fn) const ParamType param_type = fn.param_type(i); if (ELEM(param_type.interface_type(), ParamType::InterfaceType::Mutable, - ParamType::InterfaceType::Output)) { + ParamType::InterfaceType::Output)) + { if (param_type.data_type().is_vector()) { return false; } diff --git a/source/blender/functions/intern/multi_function_procedure.cc b/source/blender/functions/intern/multi_function_procedure.cc index a785f69718d..d555cd2d13e 100644 --- a/source/blender/functions/intern/multi_function_procedure.cc +++ b/source/blender/functions/intern/multi_function_procedure.cc @@ -681,7 +681,8 @@ class ProcedureDotExport { } if (ELEM(instruction.prev()[0].type(), InstructionCursor::Type::Branch, - InstructionCursor::Type::Entry)) { + InstructionCursor::Type::Entry)) + { return true; } return false; @@ -739,7 +740,8 @@ class ProcedureDotExport { Vector instructions; const Instruction &begin = this->get_first_instruction_in_block(representative); for (const Instruction *current = &begin; current != nullptr; - current = this->get_next_instruction_in_block(*current, begin)) { + current = this->get_next_instruction_in_block(*current, begin)) + { instructions.append(current); } return instructions; diff --git a/source/blender/geometry/intern/fillet_curves.cc b/source/blender/geometry/intern/fillet_curves.cc index e43960db1e7..820e8ab2945 100644 --- a/source/blender/geometry/intern/fillet_curves.cc +++ b/source/blender/geometry/intern/fillet_curves.cc @@ -524,7 +524,8 @@ static bke::CurvesGeometry fillet_curves( dst_attributes, ATTR_DOMAIN_MASK_POINT, propagation_info, - {"position", "handle_type_left", "handle_type_right", "handle_right", "handle_left"})) { + {"position", "handle_type_left", "handle_type_right", "handle_right", "handle_left"})) + { duplicate_fillet_point_data(src_points_by_curve, dst_points_by_curve, curve_selection, @@ -536,7 +537,8 @@ static bke::CurvesGeometry fillet_curves( if (!unselected_ranges.is_empty()) { for (auto &attribute : bke::retrieve_attributes_for_transfer( - src_attributes, dst_attributes, ATTR_DOMAIN_MASK_POINT, propagation_info)) { + src_attributes, dst_attributes, ATTR_DOMAIN_MASK_POINT, propagation_info)) + { bke::curves::copy_point_data(src_points_by_curve, dst_points_by_curve, unselected_ranges, diff --git a/source/blender/geometry/intern/mesh_merge_by_distance.cc b/source/blender/geometry/intern/mesh_merge_by_distance.cc index 46ed855a7dc..9d9b6c352de 100644 --- a/source/blender/geometry/intern/mesh_merge_by_distance.cc +++ b/source/blender/geometry/intern/mesh_merge_by_distance.cc @@ -180,7 +180,8 @@ static void weld_assert_poly_and_loop_kill_len(WeldMesh *weld_mesh, corner_verts, corner_edges, weld_mesh->loop_map, - nullptr)) { + nullptr)) + { poly_kills++; continue; } @@ -1186,7 +1187,8 @@ static int poly_find_doubles(const OffsetIndices poly_corners_offsets, for (int corner_index = poly_corners_offsets[poly_index].last(); corner_index >= poly_corners_offsets[poly_index].first(); - corner_index--) { + corner_index--) + { const int elem_index = corners[corner_index]; linked_polys_buffer[--linked_polys_offset[elem_index]] = poly_index; } @@ -1660,7 +1662,8 @@ static Mesh *create_merged_mesh(const Mesh &mesh, src_corner_verts, src_corner_edges, weld_mesh.loop_map, - group_buffer.data())) { + group_buffer.data())) + { continue; } @@ -1692,7 +1695,8 @@ static Mesh *create_merged_mesh(const Mesh &mesh, src_corner_verts, src_corner_edges, weld_mesh.loop_map, - group_buffer.data())) { + group_buffer.data())) + { continue; } diff --git a/source/blender/geometry/intern/mesh_split_edges.cc b/source/blender/geometry/intern/mesh_split_edges.cc index 47dcabc9b59..af5c7af130a 100644 --- a/source/blender/geometry/intern/mesh_split_edges.cc +++ b/source/blender/geometry/intern/mesh_split_edges.cc @@ -54,11 +54,13 @@ static void add_new_vertices(Mesh &mesh, const Span new_to_old_verts_map) attribute.finish(); } if (float3 *orco = static_cast( - CustomData_get_layer_for_write(&mesh.vdata, CD_ORCO, mesh.totvert))) { + CustomData_get_layer_for_write(&mesh.vdata, CD_ORCO, mesh.totvert))) + { copy_to_new_verts({orco, mesh.totvert}, new_to_old_verts_map); } if (int *orig_indices = static_cast( - CustomData_get_layer_for_write(&mesh.vdata, CD_ORIGINDEX, mesh.totvert))) { + CustomData_get_layer_for_write(&mesh.vdata, CD_ORIGINDEX, mesh.totvert))) + { copy_to_new_verts({orig_indices, mesh.totvert}, new_to_old_verts_map); } } @@ -131,7 +133,8 @@ static void add_new_edges(Mesh &mesh, int *new_orig_indices = nullptr; if (const int *orig_indices = static_cast( - CustomData_get_layer(&mesh.edata, CD_ORIGINDEX))) { + CustomData_get_layer(&mesh.edata, CD_ORIGINDEX))) + { new_orig_indices = static_cast( MEM_malloc_arrayN(new_edges.size(), sizeof(int), __func__)); array_utils::gather(Span(orig_indices, mesh.totedge), diff --git a/source/blender/geometry/intern/resample_curves.cc b/source/blender/geometry/intern/resample_curves.cc index 1ea955be68b..5590f5f1ccf 100644 --- a/source/blender/geometry/intern/resample_curves.cc +++ b/source/blender/geometry/intern/resample_curves.cc @@ -57,7 +57,8 @@ static bool interpolate_attribute_to_curves(const bke::AttributeIDRef &attribute "handle_type_left", "handle_type_right", "handle_left", - "handle_right")) { + "handle_right")) + { return type_counts[CURVE_TYPE_BEZIER] != 0; } if (ELEM(attribute_id.name(), "nurbs_weight")) { diff --git a/source/blender/geometry/intern/subdivide_curves.cc b/source/blender/geometry/intern/subdivide_curves.cc index f2286d8f28c..9b4aa260ce1 100644 --- a/source/blender/geometry/intern/subdivide_curves.cc +++ b/source/blender/geometry/intern/subdivide_curves.cc @@ -342,7 +342,8 @@ bke::CurvesGeometry subdivide_curves( auto subdivide_catmull_rom = [&](IndexMask selection) { for (auto &attribute : bke::retrieve_attributes_for_transfer( - src_attributes, dst_attributes, ATTR_DOMAIN_MASK_POINT, propagation_info)) { + src_attributes, dst_attributes, ATTR_DOMAIN_MASK_POINT, propagation_info)) + { subdivide_attribute_catmull_rom(src_points_by_curve, dst_points_by_curve, selection, @@ -356,7 +357,8 @@ bke::CurvesGeometry subdivide_curves( auto subdivide_poly = [&](IndexMask selection) { for (auto &attribute : bke::retrieve_attributes_for_transfer( - src_attributes, dst_attributes, ATTR_DOMAIN_MASK_POINT, propagation_info)) { + src_attributes, dst_attributes, ATTR_DOMAIN_MASK_POINT, propagation_info)) + { subdivide_attribute_linear(src_points_by_curve, dst_points_by_curve, selection, @@ -402,15 +404,13 @@ bke::CurvesGeometry subdivide_curves( } }); - for (auto &attribute : bke::retrieve_attributes_for_transfer(src_attributes, - dst_attributes, - ATTR_DOMAIN_MASK_POINT, - propagation_info, - {"position", - "handle_type_left", - "handle_type_right", - "handle_right", - "handle_left"})) { + for (auto &attribute : bke::retrieve_attributes_for_transfer( + src_attributes, + dst_attributes, + ATTR_DOMAIN_MASK_POINT, + propagation_info, + {"position", "handle_type_left", "handle_type_right", "handle_right", "handle_left"})) + { subdivide_attribute_linear(src_points_by_curve, dst_points_by_curve, selection, @@ -435,7 +435,8 @@ bke::CurvesGeometry subdivide_curves( if (!unselected_ranges.is_empty()) { for (auto &attribute : bke::retrieve_attributes_for_transfer( - src_attributes, dst_attributes, ATTR_DOMAIN_MASK_POINT, propagation_info)) { + src_attributes, dst_attributes, ATTR_DOMAIN_MASK_POINT, propagation_info)) + { bke::curves::copy_point_data(src_points_by_curve, dst_points_by_curve, unselected_ranges, diff --git a/source/blender/geometry/intern/trim_curves.cc b/source/blender/geometry/intern/trim_curves.cc index 1f4ea939fa0..b022289b960 100644 --- a/source/blender/geometry/intern/trim_curves.cc +++ b/source/blender/geometry/intern/trim_curves.cc @@ -129,7 +129,8 @@ static bke::curves::CurvePoint lookup_point_bezier( const int num_curve_points) { if (bke::curves::bezier::has_vector_handles( - num_curve_points, evaluated_points_by_curve[curve_index].size(), cyclic, resolution)) { + num_curve_points, evaluated_points_by_curve[curve_index].size(), cyclic, resolution)) + { const Span bezier_offsets = src_curves.bezier_evaluated_offsets_for_curve(curve_index); return lookup_point_bezier( bezier_offsets, accumulated_lengths, sample_length, cyclic, num_curve_points); @@ -553,7 +554,8 @@ static void sample_interval_bezier(const Span src_positions, src_positions, src_handles_l, src_handles_r, end_point); if ((start_point.parameter >= end_point.parameter && end_point.index == start_point.index) || - (start_point.parameter == 0.0f && end_point.next_index == start_point.index)) { + (start_point.parameter == 0.0f && end_point.next_index == start_point.index)) + { /* Start point is next controlpoint. */ dst_handles_l[dst_range.first()] = end_point_insert.handle_next; /* No need to change handle type (remains the same). */ @@ -1071,7 +1073,8 @@ bke::CurvesGeometry trim_curves(const bke::CurvesGeometry &src_curves, Set copy_point_skip; if (!dst_curves.has_curve_with_type(CURVE_TYPE_NURBS) && - src_curves.has_curve_with_type(CURVE_TYPE_NURBS)) { + src_curves.has_curve_with_type(CURVE_TYPE_NURBS)) + { copy_point_skip.add("nurbs_weight"); } @@ -1080,7 +1083,8 @@ bke::CurvesGeometry trim_curves(const bke::CurvesGeometry &src_curves, dst_attributes, ATTR_DOMAIN_MASK_POINT, propagation_info, - copy_point_skip)) { + copy_point_skip)) + { bke::curves::copy_point_data(src_points_by_curve, dst_points_by_curve, unselected_ranges, diff --git a/source/blender/geometry/intern/uv_pack.cc b/source/blender/geometry/intern/uv_pack.cc index 090c571b5b1..b932e5b0f04 100644 --- a/source/blender/geometry/intern/uv_pack.cc +++ b/source/blender/geometry/intern/uv_pack.cc @@ -747,8 +747,8 @@ float2 PackIsland::get_diagonal_support(const float scale, return half_diagonal_ * scale + margin; } - if (rotation == DEG2RADF(-90.0f) || rotation == DEG2RADF(90.0f) || - rotation == DEG2RADF(270.0f)) { + if (rotation == DEG2RADF(-90.0f) || rotation == DEG2RADF(90.0f) || rotation == DEG2RADF(270.0f)) + { return float2(half_diagonal_.y / aspect_y, half_diagonal_.x * aspect_y) * scale + margin; } @@ -1105,7 +1105,8 @@ static void pack_island_xatlas(const Span island_indices, scan_line += 2; } if (scan_line < occupancy.bitmap_radix * - sqrtf(std::min(params.target_aspect_y, 1.0f / params.target_aspect_y))) { + sqrtf(std::min(params.target_aspect_y, 1.0f / params.target_aspect_y))) + { continue; /* Try again on next scan_line. */ } @@ -1128,7 +1129,8 @@ static void pack_island_xatlas(const Span island_indices, margin, r_phis, &max_u, - &max_v)) { + &max_v)) + { scan_line = 0; traced_islands = 0; occupancy.clear(); @@ -1455,7 +1457,8 @@ class OverlapMerger { a->triangle_vertices_[i + 2], b->triangle_vertices_[j + 0], b->triangle_vertices_[j + 1], - b->triangle_vertices_[j + 2])) { + b->triangle_vertices_[j + 2])) + { return true; /* Two triangles overlap => islands overlap. */ } } @@ -1566,7 +1569,8 @@ float pack_islands(const Span &islands, const UVPackIsland_Params finalize_geometry(islands, params); if (params.margin_method == ED_UVPACK_MARGIN_FRACTION && params.margin > 0.0f && - params.scale_to_fit) { + params.scale_to_fit) + { /* Uses a line search on scale. ~10x slower than other method. */ return pack_islands_margin_fraction(islands, params.margin, params); } diff --git a/source/blender/geometry/intern/uv_parametrizer.cc b/source/blender/geometry/intern/uv_parametrizer.cc index 278a6209e17..a01c4c2a305 100644 --- a/source/blender/geometry/intern/uv_parametrizer.cc +++ b/source/blender/geometry/intern/uv_parametrizer.cc @@ -2834,8 +2834,8 @@ static bool p_chart_symmetry_pins(PChart *chart, PEdge *outer, PVert **pin1, PVe nextbe = p_boundary_edge_next(be); - if ((be->vert->flag & PVERT_SPLIT) || - (lastbe->vert->flag & nextbe->vert->flag & PVERT_SPLIT)) { + if ((be->vert->flag & PVERT_SPLIT) || (lastbe->vert->flag & nextbe->vert->flag & PVERT_SPLIT)) + { if (!cure) { if (be == outer) { firste1 = be; diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_array.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_array.c index 19ca882ef40..4d243a8c43d 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_array.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_array.c @@ -143,7 +143,8 @@ static bool gpencil_data_selected_minmax(ArrayGpencilModifierData *mmd, mmd->flag & GP_ARRAY_INVERT_LAYER, mmd->flag & GP_ARRAY_INVERT_PASS, mmd->flag & GP_ARRAY_INVERT_LAYERPASS, - mmd->flag & GP_ARRAY_INVERT_MATERIAL)) { + mmd->flag & GP_ARRAY_INVERT_MATERIAL)) + { changed |= BKE_gpencil_stroke_minmax(gps, false, r_min, r_max); } } @@ -198,7 +199,8 @@ static void generate_geometry(GpencilModifierData *md, mmd->flag & GP_ARRAY_INVERT_LAYER, mmd->flag & GP_ARRAY_INVERT_PASS, mmd->flag & GP_ARRAY_INVERT_LAYERPASS, - mmd->flag & GP_ARRAY_INVERT_MATERIAL)) { + mmd->flag & GP_ARRAY_INVERT_MATERIAL)) + { tmpStrokes *tmp = MEM_callocN(sizeof(tmpStrokes), __func__); tmp->gpf = gpf; tmp->gps = gps; diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_build.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_build.c index 57d743809ee..b4b4f8d41b7 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_build.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_build.c @@ -418,8 +418,8 @@ static void build_sequential(Object *ob, float gp_build_speedfactor = mmd->speed_fac; /* If current frame can't be built before next frame, adjust gp_build_speedfactor. */ - if (gpf->next && - (gpf->framenum + sumtime * fps / gp_build_speedfactor) > gpf->next->framenum) { + if (gpf->next && (gpf->framenum + sumtime * fps / gp_build_speedfactor) > gpf->next->framenum) + { gp_build_speedfactor = sumtime * fps / (gpf->next->framenum - gpf->framenum); } /* Apply gp_build_speedfactor to all points & to sumtime. */ diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_color.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_color.c index 2ccd6518265..a6d4cade6ad 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_color.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_color.c @@ -91,7 +91,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_COLOR_INVERT_LAYER, mmd->flag & GP_COLOR_INVERT_PASS, mmd->flag & GP_COLOR_INVERT_LAYERPASS, - mmd->flag & GP_COLOR_INVERT_MATERIAL)) { + mmd->flag & GP_COLOR_INVERT_MATERIAL)) + { return; } @@ -102,8 +103,8 @@ static void deformStroke(GpencilModifierData *md, /* Fill */ if (mmd->modify_color != GP_MODIFY_COLOR_STROKE) { /* If not using Vertex Color, use the material color. */ - if ((gp_style != NULL) && (gps->vert_color_fill[3] == 0.0f) && - (gp_style->fill_rgba[3] > 0.0f)) { + if ((gp_style != NULL) && (gps->vert_color_fill[3] == 0.0f) && (gp_style->fill_rgba[3] > 0.0f)) + { copy_v4_v4(gps->vert_color_fill, gp_style->fill_rgba); gps->vert_color_fill[3] = 1.0f; } diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_dash.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_dash.c index cf8380d30e6..11099aa9aa1 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_dash.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_dash.c @@ -211,7 +211,8 @@ static void apply_dash_for_frame( dmd->flag & GP_LENGTH_INVERT_LAYER, dmd->flag & GP_LENGTH_INVERT_PASS, dmd->flag & GP_LENGTH_INVERT_LAYERPASS, - dmd->flag & GP_LENGTH_INVERT_MATERIAL)) { + dmd->flag & GP_LENGTH_INVERT_MATERIAL)) + { if (stroke_dash(gps, dmd, &result)) { BLI_remlink(&gpf->strokes, gps); BKE_gpencil_free_stroke(gps); diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_envelope.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_envelope.c index 3ce6ed33648..76d30ef2bfe 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_envelope.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_envelope.c @@ -319,7 +319,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_ENVELOPE_INVERT_LAYER, mmd->flag & GP_ENVELOPE_INVERT_PASS, mmd->flag & GP_ENVELOPE_INVERT_LAYERPASS, - mmd->flag & GP_ENVELOPE_INVERT_MATERIAL)) { + mmd->flag & GP_ENVELOPE_INVERT_MATERIAL)) + { return; } @@ -481,7 +482,8 @@ static void generate_geometry(GpencilModifierData *md, Object *ob, bGPDlayer *gp mmd->flag & GP_ENVELOPE_INVERT_LAYER, mmd->flag & GP_ENVELOPE_INVERT_PASS, mmd->flag & GP_ENVELOPE_INVERT_LAYERPASS, - mmd->flag & GP_ENVELOPE_INVERT_MATERIAL)) { + mmd->flag & GP_ENVELOPE_INVERT_MATERIAL)) + { continue; } diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_hook.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_hook.c index 7aa836c6740..f78754fe358 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_hook.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_hook.c @@ -208,7 +208,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_HOOK_INVERT_LAYER, mmd->flag & GP_HOOK_INVERT_PASS, mmd->flag & GP_HOOK_INVERT_LAYERPASS, - mmd->flag & GP_HOOK_INVERT_MATERIAL)) { + mmd->flag & GP_HOOK_INVERT_MATERIAL)) + { return; } bGPdata *gpd = ob->data; @@ -329,7 +330,8 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel) col = uiLayoutColumn(layout, false); uiItemR(col, ptr, "object", 0, NULL, ICON_NONE); if (!RNA_pointer_is_null(&hook_object_ptr) && - RNA_enum_get(&hook_object_ptr, "type") == OB_ARMATURE) { + RNA_enum_get(&hook_object_ptr, "type") == OB_ARMATURE) + { PointerRNA hook_object_data_ptr = RNA_pointer_get(&hook_object_ptr, "data"); uiItemPointerR( col, ptr, "subtarget", &hook_object_data_ptr, "bones", IFACE_("Bone"), ICON_NONE); diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_lattice.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_lattice.c index ccd3ab59e92..b532a60dac4 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_lattice.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_lattice.c @@ -81,7 +81,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_LATTICE_INVERT_LAYER, mmd->flag & GP_LATTICE_INVERT_PASS, mmd->flag & GP_LATTICE_INVERT_LAYERPASS, - mmd->flag & GP_LATTICE_INVERT_MATERIAL)) { + mmd->flag & GP_LATTICE_INVERT_MATERIAL)) + { return; } @@ -215,7 +216,8 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel) col = uiLayoutColumn(layout, false); uiItemR(col, ptr, "object", 0, NULL, ICON_NONE); if (!RNA_pointer_is_null(&hook_object_ptr) && - RNA_enum_get(&hook_object_ptr, "type") == OB_ARMATURE) { + RNA_enum_get(&hook_object_ptr, "type") == OB_ARMATURE) + { PointerRNA hook_object_data_ptr = RNA_pointer_get(&hook_object_ptr, "data"); uiItemPointerR( col, ptr, "subtarget", &hook_object_data_ptr, "bones", IFACE_("Bone"), ICON_NONE); diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_length.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_length.c index 0dca04f568b..3c9f68db787 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_length.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_length.c @@ -225,7 +225,8 @@ static void deformStroke(GpencilModifierData *md, lmd->flag & GP_LENGTH_INVERT_LAYER, lmd->flag & GP_LENGTH_INVERT_PASS, lmd->flag & GP_LENGTH_INVERT_LAYERPASS, - lmd->flag & GP_LENGTH_INVERT_MATERIAL)) { + lmd->flag & GP_LENGTH_INVERT_MATERIAL)) + { return; } if ((gps->flag & GP_STROKE_CYCLIC) != 0) { diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_lineart.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_lineart.c index 9d5074238c9..5d88e499574 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_lineart.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_lineart.c @@ -225,7 +225,8 @@ static void add_this_collection(Collection *c, FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN (c, ob, mode) { if (ELEM(ob->type, OB_MESH, OB_MBALL, OB_CURVES_LEGACY, OB_SURF, OB_FONT)) { if ((ob->lineart.usage == OBJECT_LRT_INHERIT && default_add) || - ob->lineart.usage != OBJECT_LRT_EXCLUDE) { + ob->lineart.usage != OBJECT_LRT_EXCLUDE) + { DEG_add_object_relation(ctx->node, ob, DEG_OB_COMP_GEOMETRY, "Line Art Modifier"); DEG_add_object_relation(ctx->node, ob, DEG_OB_COMP_TRANSFORM, "Line Art Modifier"); } diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_mirror.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_mirror.c index 6e3461d6833..3d9ccda92d1 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_mirror.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_mirror.c @@ -129,7 +129,8 @@ static void generate_geometry( mmd->flag & GP_MIRROR_INVERT_LAYER, mmd->flag & GP_MIRROR_INVERT_PASS, mmd->flag & GP_MIRROR_INVERT_LAYERPASS, - mmd->flag & GP_MIRROR_INVERT_MATERIAL)) { + mmd->flag & GP_MIRROR_INVERT_MATERIAL)) + { gps_new = BKE_gpencil_stroke_duplicate(gps, true, true); update_position(ob, mmd, gps_new, xi); if (update) { diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_multiply.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_multiply.c index bce0f02d6d7..fcf96745384 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_multiply.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_multiply.c @@ -195,7 +195,8 @@ static void generate_geometry(GpencilModifierData *md, Object *ob, bGPDlayer *gp mmd->flag & GP_MIRROR_INVERT_LAYER, mmd->flag & GP_MIRROR_INVERT_PASS, mmd->flag & GP_MIRROR_INVERT_LAYERPASS, - mmd->flag & GP_MIRROR_INVERT_MATERIAL)) { + mmd->flag & GP_MIRROR_INVERT_MATERIAL)) + { continue; } if (mmd->duplications > 0) { diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_noise.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_noise.c index 3be6aff0979..9ddf4739680 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_noise.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_noise.c @@ -135,7 +135,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_NOISE_INVERT_LAYER, mmd->flag & GP_NOISE_INVERT_PASS, mmd->flag & GP_NOISE_INVERT_LAYERPASS, - mmd->flag & GP_NOISE_INVERT_MATERIAL)) { + mmd->flag & GP_NOISE_INVERT_MATERIAL)) + { return; } diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_offset.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_offset.c index 5337ca62dd5..f27ae283a01 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_offset.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_offset.c @@ -86,7 +86,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_OFFSET_INVERT_LAYER, mmd->flag & GP_OFFSET_INVERT_PASS, mmd->flag & GP_OFFSET_INVERT_LAYERPASS, - mmd->flag & GP_OFFSET_INVERT_MATERIAL)) { + mmd->flag & GP_OFFSET_INVERT_MATERIAL)) + { return; } diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_opacity.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_opacity.c index 9901b4412c8..1eb087637f7 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_opacity.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_opacity.c @@ -92,7 +92,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_OPACITY_INVERT_LAYER, mmd->flag & GP_OPACITY_INVERT_PASS, mmd->flag & GP_OPACITY_INVERT_LAYERPASS, - mmd->flag & GP_OPACITY_INVERT_MATERIAL)) { + mmd->flag & GP_OPACITY_INVERT_MATERIAL)) + { return; } diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_outline.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_outline.c index 7332d2e0891..efbaa7b6b33 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_outline.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_outline.c @@ -99,7 +99,8 @@ static void convert_stroke(GpencilModifierData *md, mmd->flag & GP_OUTLINE_INVERT_LAYER, mmd->flag & GP_OUTLINE_INVERT_PASS, mmd->flag & GP_OUTLINE_INVERT_LAYERPASS, - mmd->flag & GP_OUTLINE_INVERT_MATERIAL)) { + mmd->flag & GP_OUTLINE_INVERT_MATERIAL)) + { return; } diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_shrinkwrap.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_shrinkwrap.c index 2900f51a29e..b7157d92ced 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_shrinkwrap.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_shrinkwrap.c @@ -84,7 +84,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_SHRINKWRAP_INVERT_LAYER, mmd->flag & GP_SHRINKWRAP_INVERT_PASS, mmd->flag & GP_SHRINKWRAP_INVERT_LAYERPASS, - mmd->flag & GP_SHRINKWRAP_INVERT_MATERIAL)) { + mmd->flag & GP_SHRINKWRAP_INVERT_MATERIAL)) + { return; } @@ -253,7 +254,8 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel) if (ELEM(wrap_method, MOD_SHRINKWRAP_PROJECT, MOD_SHRINKWRAP_NEAREST_SURFACE, - MOD_SHRINKWRAP_TARGET_PROJECT)) { + MOD_SHRINKWRAP_TARGET_PROJECT)) + { uiItemR(layout, ptr, "wrap_mode", 0, NULL, ICON_NONE); } diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_simplify.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_simplify.c index 713c4531043..16a26b69017 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_simplify.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_simplify.c @@ -71,7 +71,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_SIMPLIFY_INVERT_LAYER, mmd->flag & GP_SIMPLIFY_INVERT_PASS, mmd->flag & GP_SIMPLIFY_INVERT_LAYERPASS, - mmd->flag & GP_SIMPLIFY_INVERT_MATERIAL)) { + mmd->flag & GP_SIMPLIFY_INVERT_MATERIAL)) + { return; } bGPdata *gpd = ob->data; diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_smooth.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_smooth.c index 497622ab141..ab7170a3efd 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_smooth.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_smooth.c @@ -94,7 +94,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_SMOOTH_INVERT_LAYER, mmd->flag & GP_SMOOTH_INVERT_PASS, mmd->flag & GP_SMOOTH_INVERT_LAYERPASS, - mmd->flag & GP_SMOOTH_INVERT_MATERIAL)) { + mmd->flag & GP_SMOOTH_INVERT_MATERIAL)) + { return; } diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_subdiv.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_subdiv.c index bc5ea5a4cf4..7ce4c294cdc 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_subdiv.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_subdiv.c @@ -71,7 +71,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_SUBDIV_INVERT_LAYER, mmd->flag & GP_SUBDIV_INVERT_PASS, mmd->flag & GP_SUBDIV_INVERT_LAYERPASS, - mmd->flag & GP_SUBDIV_INVERT_MATERIAL)) { + mmd->flag & GP_SUBDIV_INVERT_MATERIAL)) + { return; } diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_texture.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_texture.c index b19f4f739cc..c6d8f3d3f74 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_texture.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_texture.c @@ -76,7 +76,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_TEX_INVERT_LAYER, mmd->flag & GP_TEX_INVERT_PASS, mmd->flag & GP_TEX_INVERT_LAYERPASS, - mmd->flag & GP_TEX_INVERT_MATERIAL)) { + mmd->flag & GP_TEX_INVERT_MATERIAL)) + { return; } if (ELEM(mmd->mode, FILL, STROKE_AND_FILL)) { diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_thick.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_thick.c index 1ebca18bcde..b6341a562cb 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_thick.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_thick.c @@ -97,7 +97,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_THICK_INVERT_LAYER, mmd->flag & GP_THICK_INVERT_PASS, mmd->flag & GP_THICK_INVERT_LAYERPASS, - mmd->flag & GP_THICK_INVERT_MATERIAL)) { + mmd->flag & GP_THICK_INVERT_MATERIAL)) + { return; } diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_tint.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_tint.c index 499d490d135..a30f11b77f5 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_tint.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_tint.c @@ -126,7 +126,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_TINT_INVERT_LAYER, mmd->flag & GP_TINT_INVERT_PASS, mmd->flag & GP_TINT_INVERT_LAYERPASS, - mmd->flag & GP_TINT_INVERT_MATERIAL)) { + mmd->flag & GP_TINT_INVERT_MATERIAL)) + { return; } MaterialGPencilStyle *gp_style = BKE_gpencil_material_settings(ob, gps->mat_nr + 1); diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_weight_angle.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_weight_angle.c index 916298e2f17..0814339989e 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_weight_angle.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_weight_angle.c @@ -76,7 +76,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_WEIGHT_INVERT_LAYER, mmd->flag & GP_WEIGHT_INVERT_PASS, mmd->flag & GP_WEIGHT_INVERT_LAYERPASS, - mmd->flag & GP_WEIGHT_INVERT_MATERIAL)) { + mmd->flag & GP_WEIGHT_INVERT_MATERIAL)) + { return; } diff --git a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_weight_proximity.c b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_weight_proximity.c index d1bfb65e6b7..93f7b3acbc5 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_weight_proximity.c +++ b/source/blender/gpencil_modifiers_legacy/intern/MOD_gpencil_legacy_weight_proximity.c @@ -102,7 +102,8 @@ static void deformStroke(GpencilModifierData *md, mmd->flag & GP_WEIGHT_INVERT_LAYER, mmd->flag & GP_WEIGHT_INVERT_PASS, mmd->flag & GP_WEIGHT_INVERT_LAYERPASS, - mmd->flag & GP_WEIGHT_INVERT_MATERIAL)) { + mmd->flag & GP_WEIGHT_INVERT_MATERIAL)) + { return; } diff --git a/source/blender/gpencil_modifiers_legacy/intern/lineart/MOD_lineart.h b/source/blender/gpencil_modifiers_legacy/intern/lineart/MOD_lineart.h index 562cac2c7bb..86ed62512ec 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/lineart/MOD_lineart.h +++ b/source/blender/gpencil_modifiers_legacy/intern/lineart/MOD_lineart.h @@ -681,12 +681,14 @@ BLI_INLINE int lineart_intersect_seg_seg(const double a1[2], if (LRT_DOUBLE_CLOSE_ENOUGH(x_diff2, 0)) { /* This means two segments are both vertical. */ if ((LRT_DOUBLE_CLOSE_ENOUGH(a2[0], b1[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a2[1], b1[1])) || - (LRT_DOUBLE_CLOSE_ENOUGH(a2[0], b2[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a2[1], b2[1]))) { + (LRT_DOUBLE_CLOSE_ENOUGH(a2[0], b2[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a2[1], b2[1]))) + { *r_aligned = true; *r_ratio = 1; } else if ((LRT_DOUBLE_CLOSE_ENOUGH(a1[0], b1[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a1[1], b1[1])) || - (LRT_DOUBLE_CLOSE_ENOUGH(a1[0], b2[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a1[1], b2[1]))) { + (LRT_DOUBLE_CLOSE_ENOUGH(a1[0], b2[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a1[1], b2[1]))) + { *r_aligned = true; *r_ratio = 0; } @@ -712,14 +714,15 @@ BLI_INLINE int lineart_intersect_seg_seg(const double a1[2], /* This means two segments are parallel. This also handles k==0 (both completely * horizontal) cases. */ if ((LRT_DOUBLE_CLOSE_ENOUGH(a2[0], b1[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a2[1], b1[1])) || - (LRT_DOUBLE_CLOSE_ENOUGH(a2[0], b2[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a2[1], b2[1]))) { + (LRT_DOUBLE_CLOSE_ENOUGH(a2[0], b2[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a2[1], b2[1]))) + { *r_aligned = true; *r_ratio = 1; } else if ((LRT_DOUBLE_CLOSE_ENOUGH(a1[0], b1[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a1[1], b1[1])) || - (LRT_DOUBLE_CLOSE_ENOUGH(a1[0], b2[0]) && - LRT_DOUBLE_CLOSE_ENOUGH(a1[1], b2[1]))) { + (LRT_DOUBLE_CLOSE_ENOUGH(a1[0], b2[0]) && LRT_DOUBLE_CLOSE_ENOUGH(a1[1], b2[1]))) + { *r_aligned = true; *r_ratio = 0; } diff --git a/source/blender/gpencil_modifiers_legacy/intern/lineart/lineart_chain.c b/source/blender/gpencil_modifiers_legacy/intern/lineart/lineart_chain.c index e3e37b222e9..371cdf826c9 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/lineart/lineart_chain.c +++ b/source/blender/gpencil_modifiers_legacy/intern/lineart/lineart_chain.c @@ -85,7 +85,8 @@ static bool lineart_point_overlapping(LineartEdgeChainItem *eci, return false; } if (((eci->pos[0] + threshold) >= x) && ((eci->pos[0] - threshold) <= x) && - ((eci->pos[1] + threshold) >= y) && ((eci->pos[1] - threshold) <= y)) { + ((eci->pos[1] + threshold) >= y) && ((eci->pos[1] - threshold) <= y)) + { return true; } return false; @@ -234,7 +235,8 @@ void MOD_lineart_chain_feature_lines(LineartData *ld) es->shadow_mask_bits, e->v1->index); while (ba && (new_e = lineart_line_get_connected( - ba, new_vt, &new_vt, e->flags, ec->intersection_mask, ec->object_ref))) { + ba, new_vt, &new_vt, e->flags, ec->intersection_mask, ec->object_ref))) + { new_e->flags |= LRT_EDGE_FLAG_CHAIN_PICKED; if (new_e->t1 || new_e->t2) { @@ -378,7 +380,8 @@ void MOD_lineart_chain_feature_lines(LineartData *ld) ba = MOD_lineart_get_bounding_area(ld, e->v2->fbcoord[0], e->v2->fbcoord[1]); new_vt = e->v2; while (ba && (new_e = lineart_line_get_connected( - ba, new_vt, &new_vt, e->flags, ec->intersection_mask, ec->object_ref))) { + ba, new_vt, &new_vt, e->flags, ec->intersection_mask, ec->object_ref))) + { new_e->flags |= LRT_EDGE_FLAG_CHAIN_PICKED; if (new_e->t1 || new_e->t2) { @@ -613,7 +616,8 @@ static bool lineart_chain_fix_ambiguous_segments(LineartEdgeChain *ec, break; } if (eci->material_mask_bits == fixed_mask && eci->occlusion == fixed_occ && - eci->shadow_mask_bits == fixed_shadow) { + eci->shadow_mask_bits == fixed_shadow) + { can_skip_to = eci; } } @@ -624,7 +628,8 @@ static bool lineart_chain_fix_ambiguous_segments(LineartEdgeChain *ec, for (LineartEdgeChainItem *eci = last_matching_eci->next; eci != can_skip_to; eci = next_eci) { next_eci = eci->next; if (eci->material_mask_bits == fixed_mask && eci->occlusion == fixed_occ && - eci->shadow_mask_bits == fixed_shadow) { + eci->shadow_mask_bits == fixed_shadow) + { continue; } if (preserve_details) { @@ -671,7 +676,8 @@ void MOD_lineart_chain_split_for_fixed_occlusion(LineartData *ld) for (eci = first_eci->next; eci; eci = next_eci) { next_eci = eci->next; if (eci->occlusion != fixed_occ || eci->material_mask_bits != fixed_mask || - eci->shadow_mask_bits != fixed_shadow) { + eci->shadow_mask_bits != fixed_shadow) + { if (next_eci) { if (lineart_point_overlapping(next_eci, eci->pos[0], eci->pos[1], 1e-5)) { continue; @@ -680,7 +686,8 @@ void MOD_lineart_chain_split_for_fixed_occlusion(LineartData *ld) eci->prev, ld->conf.chaining_image_threshold, ld->conf.chain_preserve_details, - &next_eci)) { + &next_eci)) + { continue; } } @@ -824,7 +831,8 @@ static LineartChainRegisterEntry *lineart_chain_get_closest_cre(LineartData *ld, } if (cre->ec == ec || (!cre->ec->chain.first) || (cre->ec->level != occlusion) || (cre->ec->material_mask_bits != material_mask_bits) || - (cre->ec->intersection_mask != isec_mask) || (cre->ec->shadow_mask_bits != shadow_mask)) { + (cre->ec->intersection_mask != isec_mask) || (cre->ec->shadow_mask_bits != shadow_mask)) + { continue; } if (!ld->conf.fuzzy_everything) { @@ -847,7 +855,8 @@ static LineartChainRegisterEntry *lineart_chain_get_closest_cre(LineartData *ld, * distance is small enough. This way we can better chain smaller loops and smooth them out * later. */ if (((cre->ec->loop_id == loop_id) && (new_len < dist)) || - ((cre->ec->loop_id != loop_id) && (new_len < dist / 10))) { + ((cre->ec->loop_id != loop_id) && (new_len < dist / 10))) + { closest_cre = cre; dist = new_len; if (result_new_len) { @@ -936,7 +945,8 @@ void MOD_lineart_chain_connect(LineartData *ld) eci_l = ec->chain.first; eci_r = ec->chain.last; while ((ba_l = lineart_bounding_area_get_end_point(ld, eci_l)) && - (ba_r = lineart_bounding_area_get_end_point(ld, eci_r))) { + (ba_r = lineart_bounding_area_get_end_point(ld, eci_r))) + { closest_cre_l = lineart_chain_get_closest_cre(ld, ba_l, ec, @@ -1067,7 +1077,8 @@ void MOD_lineart_finalize_chains(LineartData *ld) if (ELEM(ec->type, LRT_EDGE_FLAG_INTERSECTION, LRT_EDGE_FLAG_PROJECTED_SHADOW, - LRT_EDGE_FLAG_LIGHT_CONTOUR)) { + LRT_EDGE_FLAG_LIGHT_CONTOUR)) + { continue; } LineartElementLinkNode *eln = lineart_find_matching_eln_obj(&ld->geom.vertex_buffer_pointers, @@ -1088,8 +1099,8 @@ void MOD_lineart_smooth_chains(LineartData *ld, float tolerance) LISTBASE_FOREACH (LineartEdgeChain *, ec, &ld->chains) { /* Go through the chain two times, once from each direction. */ for (int times = 0; times < 2; times++) { - for (LineartEdgeChainItem *eci = ec->chain.first, *next_eci = eci->next; eci; - eci = next_eci) { + for (LineartEdgeChainItem *eci = ec->chain.first, *next_eci = eci->next; eci; eci = next_eci) + { LineartEdgeChainItem *eci2, *eci3, *eci4; if (!(eci2 = eci->next) || !(eci3 = eci2->next)) { diff --git a/source/blender/gpencil_modifiers_legacy/intern/lineart/lineart_cpu.cc b/source/blender/gpencil_modifiers_legacy/intern/lineart/lineart_cpu.cc index b2276d85f68..a31008d39f0 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/lineart/lineart_cpu.cc +++ b/source/blender/gpencil_modifiers_legacy/intern/lineart/lineart_cpu.cc @@ -324,7 +324,8 @@ void lineart_edge_cut(LineartData *ld, if (prev_seg && prev_seg->occlusion == seg->occlusion && prev_seg->material_mask_bits == seg->material_mask_bits && - prev_seg->shadow_mask_bits == seg->shadow_mask_bits) { + prev_seg->shadow_mask_bits == seg->shadow_mask_bits) + { BLI_remlink(&e->segments, seg); /* This puts the node back to the render buffer, if more cut happens, these unused nodes get * picked first. */ @@ -389,7 +390,8 @@ static void lineart_occlusion_single_line(LineartData *ld, LineartEdge *e, int t lineart_occlusion_is_adjacent_intersection(e, (LineartTriangle *)tri) || /* Or if this triangle isn't effectively occluding anything nor it's providing a * material flag. */ - ((!tri->base.mat_occlusion) && (!tri->base.material_mask_bits))) { + ((!tri->base.mat_occlusion) && (!tri->base.material_mask_bits))) + { continue; } tri->testing_e[thread_id] = e; @@ -403,7 +405,8 @@ static void lineart_occlusion_single_line(LineartData *ld, LineartEdge *e, int t ld->conf.shift_x, ld->conf.shift_y, &l, - &r)) { + &r)) + { lineart_edge_cut(ld, e, l, r, tri->base.material_mask_bits, tri->base.mat_occlusion, 0); if (e->min_occ > ld->conf.max_occlusion_level) { /* No need to calculate any longer on this line because no level more than set value is @@ -573,7 +576,8 @@ static LineartPointTri lineart_point_triangle_relation(double v[2], double cl, c; double r; if (lineart_point_on_line_segment(v, v0, v1) || lineart_point_on_line_segment(v, v1, v2) || - lineart_point_on_line_segment(v, v2, v0)) { + lineart_point_on_line_segment(v, v2, v0)) + { return LRT_ON_TRIANGLE; } @@ -1335,7 +1339,8 @@ void lineart_main_free_adjacent_data(LineartData *ld) { LinkData *link; while ((link = static_cast(BLI_pophead(&ld->geom.triangle_adjacent_pointers))) != - nullptr) { + nullptr) + { MEM_freeN(link->data); } LISTBASE_FOREACH (LineartElementLinkNode *, eln, &ld->geom.triangle_buffer_pointers) { @@ -1527,7 +1532,8 @@ static void lineart_identify_mlooptri_feature_edges(void *__restrict userdata, ff2 = ff1; } if (e_feat_data->ld->conf.filter_face_mark_boundaries ^ - e_feat_data->ld->conf.filter_face_mark_invert) { + e_feat_data->ld->conf.filter_face_mark_invert) + { if ((ff1->flag & FREESTYLE_FACE_MARK) || (ff2->flag & FREESTYLE_FACE_MARK)) { face_mark_filtered = true; } @@ -1632,7 +1638,8 @@ static void lineart_identify_mlooptri_feature_edges(void *__restrict userdata, bool do_crease = true; if (!ld->conf.force_crease && !e_feat_data->use_auto_smooth && (!e_feat_data->sharp_faces[looptris[f1].poly]) && - (!e_feat_data->sharp_faces[looptris[f2].poly])) { + (!e_feat_data->sharp_faces[looptris[f2].poly])) + { do_crease = false; } if (do_crease && (dot_v3v3_db(tri1->gn, tri2->gn) < e_feat_data->crease_threshold)) { @@ -1648,7 +1655,8 @@ static void lineart_identify_mlooptri_feature_edges(void *__restrict userdata, Material *m2 = BKE_object_material_get_eval(ob_eval, mat2 + 1); if (m1 && m2 && ((m1->lineart.mat_occlusion == 0 && m2->lineart.mat_occlusion != 0) || - (m2->lineart.mat_occlusion == 0 && m1->lineart.mat_occlusion != 0))) { + (m2->lineart.mat_occlusion == 0 && m1->lineart.mat_occlusion != 0))) + { if (ld->conf.use_contour) { edge_flag_result |= LRT_EDGE_FLAG_CONTOUR; } @@ -2216,7 +2224,8 @@ static void lineart_geometry_object_load(LineartObjectInfo *ob_info, OBJECT_LRT_INHERIT, OBJECT_LRT_INCLUDE, OBJECT_LRT_NO_INTERSECTION, - OBJECT_LRT_FORCE_INTERSECTION)) { + OBJECT_LRT_FORCE_INTERSECTION)) + { lineart_add_edge_to_array_thread(ob_info, la_edge); } @@ -2249,7 +2258,8 @@ static void lineart_geometry_object_load(LineartObjectInfo *ob_info, OBJECT_LRT_INHERIT, OBJECT_LRT_INCLUDE, OBJECT_LRT_NO_INTERSECTION, - OBJECT_LRT_FORCE_INTERSECTION)) { + OBJECT_LRT_FORCE_INTERSECTION)) + { lineart_add_edge_to_array_thread(ob_info, la_edge); if (shadow_eln) { LineartEdge *shadow_e = lineart_find_matching_edge(shadow_eln, la_edge->edge_identifier); @@ -2337,7 +2347,8 @@ static int lineart_usage_check(Collection *c, Object *ob, bool is_render) if (c->gobject.first) { if (BKE_collection_has_object(c, (Object *)(ob->id.orig_id))) { if ((is_render && (c->flag & COLLECTION_HIDE_RENDER)) || - ((!is_render) && (c->flag & COLLECTION_HIDE_VIEWPORT))) { + ((!is_render) && (c->flag & COLLECTION_HIDE_VIEWPORT))) + { return OBJECT_LRT_EXCLUDE; } if (ob->lineart.usage == OBJECT_LRT_INHERIT) { @@ -2482,7 +2493,8 @@ static void lineart_object_load_single_instance(LineartData *ld, } if (!lineart_geometry_check_visible( - obi->model_view_proj, ld->conf.shift_x, ld->conf.shift_y, use_mesh)) { + obi->model_view_proj, ld->conf.shift_x, ld->conf.shift_y, use_mesh)) + { return; } @@ -2697,14 +2709,16 @@ bool lineart_edge_from_triangle(const LineartTriangle *tri, const LineartEdge *use_e = e; if (e->flags & LRT_EDGE_FLAG_LIGHT_CONTOUR) { if (((e->target_reference & LRT_LIGHT_CONTOUR_TARGET) == tri->target_reference) || - (((e->target_reference >> 32) & LRT_LIGHT_CONTOUR_TARGET) == tri->target_reference)) { + (((e->target_reference >> 32) & LRT_LIGHT_CONTOUR_TARGET) == tri->target_reference)) + { return true; } } else { /* Normally we just determine from identifiers of adjacent triangles. */ if ((use_e->t1 && use_e->t1->target_reference == tri->target_reference) || - (use_e->t2 && use_e->t2->target_reference == tri->target_reference)) { + (use_e->t2 && use_e->t2->target_reference == tri->target_reference)) + { return true; } } @@ -2722,7 +2736,8 @@ bool lineart_edge_from_triangle(const LineartTriangle *tri, if ((LRT_TRI_SAME_POINT(tri, 0, e->v1) || LRT_TRI_SAME_POINT(tri, 1, e->v1) || LRT_TRI_SAME_POINT(tri, 2, e->v1)) && (LRT_TRI_SAME_POINT(tri, 0, e->v2) || LRT_TRI_SAME_POINT(tri, 1, e->v2) || - LRT_TRI_SAME_POINT(tri, 2, e->v2))) { + LRT_TRI_SAME_POINT(tri, 2, e->v2))) + { return true; } #undef LRT_TRI_SAME_POINT @@ -2820,7 +2835,8 @@ static bool lineart_triangle_edge_image_space_occlusion(const LineartTriangle *t (MIN3(FBC0[0], FBC1[0], FBC2[0]) > MAX2(LFBC[0], RFBC[0])) || (MAX3(FBC0[1], FBC1[1], FBC2[1]) < MIN2(LFBC[1], RFBC[1])) || (MIN3(FBC0[1], FBC1[1], FBC2[1]) > MAX2(LFBC[1], RFBC[1])) || - (MIN3(FBC0[3], FBC1[3], FBC2[3]) > MAX2(LFBC[3], RFBC[3]))) { + (MIN3(FBC0[3], FBC1[3], FBC2[3]) > MAX2(LFBC[3], RFBC[3]))) + { return false; } @@ -2853,7 +2869,8 @@ static bool lineart_triangle_edge_image_space_occlusion(const LineartTriangle *t if ((e->flags & LRT_EDGE_FLAG_PROJECTED_SHADOW) && (e->target_reference == tri->target_reference)) { if (((dot_f > 0) && (e->flags & LRT_EDGE_FLAG_SHADOW_FACING_LIGHT)) || - ((dot_f < 0) && !(e->flags & LRT_EDGE_FLAG_SHADOW_FACING_LIGHT))) { + ((dot_f < 0) && !(e->flags & LRT_EDGE_FLAG_SHADOW_FACING_LIGHT))) + { *from = 0.0f; *to = 1.0f; return true; @@ -2914,8 +2931,8 @@ static bool lineart_triangle_edge_image_space_occlusion(const LineartTriangle *t trans[0] -= cam_shift_x * 2; trans[1] -= cam_shift_y * 2; /* To accommodate `k=0` and `k=inf` (vertical) lines. here the cut is in image space. */ - if (fabs(e->v1->fbcoord[0] - e->v2->fbcoord[0]) > - fabs(e->v1->fbcoord[1] - e->v2->fbcoord[1])) { + if (fabs(e->v1->fbcoord[0] - e->v2->fbcoord[0]) > fabs(e->v1->fbcoord[1] - e->v2->fbcoord[1])) + { cut = ratiod(e->v1->fbcoord[0], e->v2->fbcoord[0], trans[0]); } else { @@ -2979,7 +2996,8 @@ static bool lineart_triangle_edge_image_space_occlusion(const LineartTriangle *t /* We could have the edge being completely parallel to the triangle where there isn't a * viable occlusion result. */ if ((LRT_PARALLEL(cross_v1) && !LRT_ISEC(cross_v1)) || - (LRT_PARALLEL(cross_v2) && !LRT_ISEC(cross_v2))) { + (LRT_PARALLEL(cross_v2) && !LRT_ISEC(cross_v2))) + { return false; } } @@ -3007,7 +3025,8 @@ static bool lineart_triangle_edge_image_space_occlusion(const LineartTriangle *t LRT_GUARD_NOT_FOUND /* The same logic applies as above case. */ if ((LRT_PARALLEL(cross_v1) && !LRT_ISEC(cross_v1)) || - (LRT_PARALLEL(cross_v2) && !LRT_ISEC(cross_v2))) { + (LRT_PARALLEL(cross_v2) && !LRT_ISEC(cross_v2))) + { return false; } } @@ -3077,37 +3096,43 @@ static bool lineart_triangle_share_edge(const LineartTriangle *l, const LineartT { if (l->v[0]->index == r->v[0]->index) { if (l->v[1]->index == r->v[1]->index || l->v[1]->index == r->v[2]->index || - l->v[2]->index == r->v[2]->index || l->v[2]->index == r->v[1]->index) { + l->v[2]->index == r->v[2]->index || l->v[2]->index == r->v[1]->index) + { return true; } } if (l->v[0]->index == r->v[1]->index) { if (l->v[1]->index == r->v[0]->index || l->v[1]->index == r->v[2]->index || - l->v[2]->index == r->v[2]->index || l->v[2]->index == r->v[0]->index) { + l->v[2]->index == r->v[2]->index || l->v[2]->index == r->v[0]->index) + { return true; } } if (l->v[0]->index == r->v[2]->index) { if (l->v[1]->index == r->v[1]->index || l->v[1]->index == r->v[0]->index || - l->v[2]->index == r->v[0]->index || l->v[2]->index == r->v[1]->index) { + l->v[2]->index == r->v[0]->index || l->v[2]->index == r->v[1]->index) + { return true; } } if (l->v[1]->index == r->v[0]->index) { if (l->v[2]->index == r->v[1]->index || l->v[2]->index == r->v[2]->index || - l->v[0]->index == r->v[2]->index || l->v[0]->index == r->v[1]->index) { + l->v[0]->index == r->v[2]->index || l->v[0]->index == r->v[1]->index) + { return true; } } if (l->v[1]->index == r->v[1]->index) { if (l->v[2]->index == r->v[0]->index || l->v[2]->index == r->v[2]->index || - l->v[0]->index == r->v[2]->index || l->v[0]->index == r->v[0]->index) { + l->v[0]->index == r->v[2]->index || l->v[0]->index == r->v[0]->index) + { return true; } } if (l->v[1]->index == r->v[2]->index) { if (l->v[2]->index == r->v[1]->index || l->v[2]->index == r->v[0]->index || - l->v[0]->index == r->v[0]->index || l->v[0]->index == r->v[1]->index) { + l->v[0]->index == r->v[0]->index || l->v[0]->index == r->v[1]->index) + { return true; } } @@ -3175,7 +3200,8 @@ static bool lineart_triangle_2v_intersection_math( /* Due to precision issue, we might end up with the same point as the one we already detected. */ if (last && LRT_DOUBLE_CLOSE_ENOUGH(last[0], gloc[0]) && - LRT_DOUBLE_CLOSE_ENOUGH(last[1], gloc[1]) && LRT_DOUBLE_CLOSE_ENOUGH(last[2], gloc[2])) { + LRT_DOUBLE_CLOSE_ENOUGH(last[1], gloc[1]) && LRT_DOUBLE_CLOSE_ENOUGH(last[2], gloc[2])) + { return false; } @@ -3392,7 +3418,8 @@ static void lineart_triangle_intersect_in_bounding_area(LineartTriangle *tri, if (!((testing_triangle->flags | tri->flags) & LRT_TRIANGLE_FORCE_INTERSECTION)) { if (((testing_triangle->flags | tri->flags) & LRT_TRIANGLE_NO_INTERSECTION) || - (testing_triangle->flags & tri->flags & LRT_TRIANGLE_INTERSECTION_ONLY)) { + (testing_triangle->flags & tri->flags & LRT_TRIANGLE_INTERSECTION_ONLY)) + { continue; } } @@ -3407,7 +3434,8 @@ static void lineart_triangle_intersect_in_bounding_area(LineartTriangle *tri, (MAX3(G0[0], G1[0], G2[0]) < MIN3(RG0[0], RG1[0], RG2[0])) || (MIN3(G0[1], G1[1], G2[1]) > MAX3(RG0[1], RG1[1], RG2[1])) || (MAX3(G0[1], G1[1], G2[1]) < MIN3(RG0[1], RG1[1], RG2[1])) || - lineart_triangle_share_edge(tri, testing_triangle)) { + lineart_triangle_share_edge(tri, testing_triangle)) + { continue; } @@ -3819,7 +3847,8 @@ static void lineart_bounding_areas_connect_new(LineartData *ld, LineartBoundingA * their original adjacent areas. */ LISTBASE_FOREACH (LinkData *, lip, &root->lp) { for (lip2 = static_cast(((LineartBoundingArea *)lip->data)->rp.first); lip2; - lip2 = next_lip) { + lip2 = next_lip) + { next_lip = lip2->next; tba = static_cast(lip2->data); if (tba == root) { @@ -3835,7 +3864,8 @@ static void lineart_bounding_areas_connect_new(LineartData *ld, LineartBoundingA } LISTBASE_FOREACH (LinkData *, lip, &root->rp) { for (lip2 = static_cast(((LineartBoundingArea *)lip->data)->lp.first); lip2; - lip2 = next_lip) { + lip2 = next_lip) + { next_lip = lip2->next; tba = static_cast(lip2->data); if (tba == root) { @@ -3851,7 +3881,8 @@ static void lineart_bounding_areas_connect_new(LineartData *ld, LineartBoundingA } LISTBASE_FOREACH (LinkData *, lip, &root->up) { for (lip2 = static_cast(((LineartBoundingArea *)lip->data)->bp.first); lip2; - lip2 = next_lip) { + lip2 = next_lip) + { next_lip = lip2->next; tba = static_cast(lip2->data); if (tba == root) { @@ -3867,7 +3898,8 @@ static void lineart_bounding_areas_connect_new(LineartData *ld, LineartBoundingA } LISTBASE_FOREACH (LinkData *, lip, &root->bp) { for (lip2 = static_cast(((LineartBoundingArea *)lip->data)->up.first); lip2; - lip2 = next_lip) { + lip2 = next_lip) + { next_lip = lip2->next; tba = static_cast(lip2->data); if (tba == root) { @@ -4024,7 +4056,8 @@ static bool lineart_bounding_area_edge_intersect(LineartData * /*fb*/, double c1, c; if (((converted[0] = ba->l) > MAX2(l[0], r[0])) || ((converted[1] = ba->r) < MIN2(l[0], r[0])) || - ((converted[2] = ba->b) > MAX2(l[1], r[1])) || ((converted[3] = ba->u) < MIN2(l[1], r[1]))) { + ((converted[2] = ba->b) > MAX2(l[1], r[1])) || ((converted[3] = ba->u) < MIN2(l[1], r[1]))) + { return false; } @@ -4070,7 +4103,8 @@ static bool lineart_bounding_area_triangle_intersect(LineartData *fb, if ((FBC1[0] >= p1[0] && FBC1[0] <= p2[0] && FBC1[1] >= p1[1] && FBC1[1] <= p3[1]) || (FBC2[0] >= p1[0] && FBC2[0] <= p2[0] && FBC2[1] >= p1[1] && FBC2[1] <= p3[1]) || - (FBC3[0] >= p1[0] && FBC3[0] <= p2[0] && FBC3[1] >= p1[1] && FBC3[1] <= p3[1])) { + (FBC3[0] >= p1[0] && FBC3[0] <= p2[0] && FBC3[1] >= p1[1] && FBC3[1] <= p3[1])) + { *r_triangle_vert_inside = true; return true; } @@ -4080,13 +4114,15 @@ static bool lineart_bounding_area_triangle_intersect(LineartData *fb, if (lineart_point_inside_triangle(p1, FBC1, FBC2, FBC3) || lineart_point_inside_triangle(p2, FBC1, FBC2, FBC3) || lineart_point_inside_triangle(p3, FBC1, FBC2, FBC3) || - lineart_point_inside_triangle(p4, FBC1, FBC2, FBC3)) { + lineart_point_inside_triangle(p4, FBC1, FBC2, FBC3)) + { return true; } if (lineart_bounding_area_edge_intersect(fb, FBC1, FBC2, ba) || lineart_bounding_area_edge_intersect(fb, FBC2, FBC3, ba) || - lineart_bounding_area_edge_intersect(fb, FBC3, FBC1, ba)) { + lineart_bounding_area_edge_intersect(fb, FBC3, FBC1, ba)) + { return true; } @@ -4171,7 +4207,8 @@ static void lineart_bounding_area_link_triangle(LineartData *ld, else { /* We need to wait for either splitting or array extension to be done. */ if (recursive_level < ld->qtree.recursive_level && - old_ba->insider_triangle_count >= LRT_TILE_SPLITTING_TRIANGLE_LIMIT) { + old_ba->insider_triangle_count >= LRT_TILE_SPLITTING_TRIANGLE_LIMIT) + { if (!old_ba->child) { /* old_ba->child==nullptr, means we are the thread that's doing the splitting. */ lineart_bounding_area_split(ld, old_ba, recursive_level); @@ -4954,8 +4991,8 @@ bool MOD_lineart_compute_feature_lines(Depsgraph *depsgraph, if (lmd->calculation_flags & LRT_USE_CUSTOM_CAMERA) { if (!lmd->source_camera || - (use_camera = DEG_get_evaluated_object(depsgraph, lmd->source_camera))->type != - OB_CAMERA) { + (use_camera = DEG_get_evaluated_object(depsgraph, lmd->source_camera))->type != OB_CAMERA) + { return false; } } @@ -5228,17 +5265,20 @@ static void lineart_gpencil_generate(LineartCache *cache, if (ec->shadow_mask_bits != LRT_SHADOW_MASK_UNDEFINED) { /* TODO(@Yiming): Give a behavior option for how to display undefined shadow info. */ if (shaodow_selection == LRT_SHADOW_FILTER_ILLUMINATED && - !(ec->shadow_mask_bits & LRT_SHADOW_MASK_ILLUMINATED)) { + !(ec->shadow_mask_bits & LRT_SHADOW_MASK_ILLUMINATED)) + { continue; } if (shaodow_selection == LRT_SHADOW_FILTER_SHADED && - !(ec->shadow_mask_bits & LRT_SHADOW_MASK_SHADED)) { + !(ec->shadow_mask_bits & LRT_SHADOW_MASK_SHADED)) + { continue; } if (shaodow_selection == LRT_SHADOW_FILTER_ILLUMINATED_ENCLOSED_SHAPES) { uint32_t test_bits = ec->shadow_mask_bits & LRT_SHADOW_TEST_SHAPE_BITS; if ((test_bits != LRT_SHADOW_MASK_ILLUMINATED) && - (test_bits != (LRT_SHADOW_MASK_SHADED | LRT_SHADOW_MASK_ILLUMINATED_SHAPE))) { + (test_bits != (LRT_SHADOW_MASK_SHADED | LRT_SHADOW_MASK_ILLUMINATED_SHAPE))) + { continue; } } @@ -5250,8 +5290,8 @@ static void lineart_gpencil_generate(LineartCache *cache, if (!ec->silhouette_backdrop) { is_silhouette = true; } - else if (!BKE_collection_has_object_recursive_instanced(orig_col, - ec->silhouette_backdrop)) { + else if (!BKE_collection_has_object_recursive_instanced(orig_col, ec->silhouette_backdrop)) + { is_silhouette = true; } } @@ -5262,7 +5302,8 @@ static void lineart_gpencil_generate(LineartCache *cache, } if ((silhouette_mode == LRT_SILHOUETTE_FILTER_INDIVIDUAL || orig_ob) && - ec->silhouette_backdrop != ec->object_ref) { + ec->silhouette_backdrop != ec->object_ref) + { is_silhouette = true; } diff --git a/source/blender/gpencil_modifiers_legacy/intern/lineart/lineart_shadow.c b/source/blender/gpencil_modifiers_legacy/intern/lineart/lineart_shadow.c index 54e5658f637..8e369f60d2b 100644 --- a/source/blender/gpencil_modifiers_legacy/intern/lineart/lineart_shadow.c +++ b/source/blender/gpencil_modifiers_legacy/intern/lineart/lineart_shadow.c @@ -90,7 +90,8 @@ static bool lineart_contour_viewed_from_dark_side(LineartData *ld, LineartEdge * side_1_facing_camera = (dot_view_1 > 0); if ((side_1_facing_camera && (!side_1_facing_light) && side_2_facing_light) || - ((!side_1_facing_camera) && side_1_facing_light && (!side_2_facing_light))) { + ((!side_1_facing_camera) && side_1_facing_light && (!side_2_facing_light))) + { return true; } return false; @@ -109,8 +110,8 @@ void lineart_register_shadow_cuts(LineartData *ld, LineartEdge *e, LineartEdge * uchar shadow_bits = (es->occlusion != 0) ? LRT_SHADOW_MASK_SHADED : LRT_SHADOW_MASK_ILLUMINATED; - if (lineart_contour_viewed_from_dark_side(ld, e) && - shadow_bits == LRT_SHADOW_MASK_ILLUMINATED) { + if (lineart_contour_viewed_from_dark_side(ld, e) && shadow_bits == LRT_SHADOW_MASK_ILLUMINATED) + { shadow_bits = LRT_SHADOW_MASK_SHADED; } @@ -297,8 +298,8 @@ static void lineart_shadow_create_shadow_edge_array(LineartData *ld, /* If the segment is short enough, we ignore them because it's not prominently visible anyway. */ #define DISCARD_NONSENSE_SEGMENTS \ if (es->occlusion != 0 || \ - (es->next && \ - LRT_DOUBLE_CLOSE_ENOUGH(es->ratio, ((LineartEdgeSegment *)es->next)->ratio))) { \ + (es->next && LRT_DOUBLE_CLOSE_ENOUGH(es->ratio, ((LineartEdgeSegment *)es->next)->ratio))) \ + { \ LRT_ITER_ALL_LINES_NEXT; \ continue; \ } @@ -674,7 +675,8 @@ static void lineart_shadow_edge_cut(LineartData *ld, r_new_in_the_middle_global, &r_new_at, &is_side_2r, - &use_new_ref))) { + &use_new_ref))) + { LineartShadowSegment *ss_middle = lineart_give_shadow_segment(ld); ss_middle->ratio = interpf(seg_2->ratio, seg_1->ratio, r_new_at); ss_middle->flag = LRT_SHADOW_CASTED | @@ -729,7 +731,8 @@ static bool lineart_shadow_cast_onto_triangle(LineartData *ld, if ((MAX3(FBC0[0], FBC1[0], FBC2[0]) < MIN2(LFBC[0], RFBC[0])) || (MIN3(FBC0[0], FBC1[0], FBC2[0]) > MAX2(LFBC[0], RFBC[0])) || (MAX3(FBC0[1], FBC1[1], FBC2[1]) < MIN2(LFBC[1], RFBC[1])) || - (MIN3(FBC0[1], FBC1[1], FBC2[1]) > MAX2(LFBC[1], RFBC[1]))) { + (MIN3(FBC0[1], FBC1[1], FBC2[1]) > MAX2(LFBC[1], RFBC[1]))) + { return false; } @@ -760,7 +763,8 @@ static bool lineart_shadow_cast_onto_triangle(LineartData *ld, if ((trie[0] == 0 && LRT_DOUBLE_CLOSE_ENOUGH(ratio[0], 0.0f) && LRT_DOUBLE_CLOSE_ENOUGH(ratio[1], 1.0f)) || (trie[0] == 1 && LRT_DOUBLE_CLOSE_ENOUGH(ratio[0], 1.0f) && - LRT_DOUBLE_CLOSE_ENOUGH(ratio[1], 0.0f))) { + LRT_DOUBLE_CLOSE_ENOUGH(ratio[1], 0.0f))) + { return false; } trie[pi] = 2; @@ -895,7 +899,8 @@ static void lineart_shadow_cast(LineartData *ld, bool transform_edge_cuts, bool tri = (LineartTriangleThread *)nba->linked_triangles[i]; if (tri->testing_e[0] == (LineartEdge *)sedge || tri->base.mat_occlusion == 0 || lineart_edge_from_triangle( - (LineartTriangle *)tri, sedge->e_ref, ld->conf.allow_overlapping_edges)) { + (LineartTriangle *)tri, sedge->e_ref, ld->conf.allow_overlapping_edges)) + { continue; } tri->testing_e[0] = (LineartEdge *)sedge; @@ -909,7 +914,8 @@ static void lineart_shadow_cast(LineartData *ld, bool transform_edge_cuts, bool fb_co_2, global_1, global_2, - &facing_light)) { + &facing_light)) + { lineart_shadow_edge_cut(ld, sedge, at_1, @@ -1130,7 +1136,8 @@ bool lineart_main_try_generate_shadow(Depsgraph *depsgraph, { if ((!original_ld->conf.use_shadow && !original_ld->conf.use_light_contour && !original_ld->conf.shadow_selection) || - (!lmd->light_contour_object)) { + (!lmd->light_contour_object)) + { return false; } diff --git a/source/blender/gpu/intern/gpu_codegen.cc b/source/blender/gpu/intern/gpu_codegen.cc index 21c97405c66..77d06bb69d7 100644 --- a/source/blender/gpu/intern/gpu_codegen.cc +++ b/source/blender/gpu/intern/gpu_codegen.cc @@ -157,7 +157,8 @@ static GPUPass *gpu_pass_cache_resolve_collision(GPUPass *pass, BLI_spin_lock(&pass_cache_spin); for (; pass && (pass->hash == hash); pass = pass->next) { if (*reinterpret_cast(info) == - *reinterpret_cast(pass->create_info)) { + *reinterpret_cast(pass->create_info)) + { BLI_spin_unlock(&pass_cache_spin); return pass; } @@ -842,7 +843,8 @@ static bool gpu_pass_shader_validate(GPUPass *pass, GPUShader *shader) /* Validate against opengl limit. */ if ((active_samplers_len > GPU_max_textures_frag()) || - (active_samplers_len > GPU_max_textures_vert())) { + (active_samplers_len > GPU_max_textures_vert())) + { return false; } diff --git a/source/blender/gpu/intern/gpu_framebuffer.cc b/source/blender/gpu/intern/gpu_framebuffer.cc index d7d0d84c5d1..ff2c2cbf5a1 100644 --- a/source/blender/gpu/intern/gpu_framebuffer.cc +++ b/source/blender/gpu/intern/gpu_framebuffer.cc @@ -97,7 +97,8 @@ void FrameBuffer::attachment_set(GPUAttachmentType type, const GPUAttachment &ne GPUAttachment &attachment = attachments_[type]; if (attachment.tex == new_attachment.tex && attachment.layer == new_attachment.layer && - attachment.mip == new_attachment.mip) { + attachment.mip == new_attachment.mip) + { return; /* Exact same texture already bound here. */ } /* Unbind previous and bind new. */ diff --git a/source/blender/gpu/intern/gpu_immediate.cc b/source/blender/gpu/intern/gpu_immediate.cc index 9698a676c36..141d602d8d4 100644 --- a/source/blender/gpu/intern/gpu_immediate.cc +++ b/source/blender/gpu/intern/gpu_immediate.cc @@ -169,7 +169,8 @@ static void wide_line_workaround_start(GPUPrimType prim_type) if (ELEM(polyline_sh, GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR, - GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR)) { + GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR)) + { immUniformColor4fv(imm->uniform_color); } } diff --git a/source/blender/gpu/intern/gpu_node_graph.cc b/source/blender/gpu/intern/gpu_node_graph.cc index ffa9a006925..09acd03fd9a 100644 --- a/source/blender/gpu/intern/gpu_node_graph.cc +++ b/source/blender/gpu/intern/gpu_node_graph.cc @@ -231,7 +231,8 @@ static void gpu_node_input_socket( gpu_node_input_link(node, sock->link, sock->type); } else if ((material != nullptr) && - (gpu_uniformbuffer_link(material, bnode, sock, index, SOCK_IN) != nullptr)) { + (gpu_uniformbuffer_link(material, bnode, sock, index, SOCK_IN) != nullptr)) + { gpu_node_input_link(node, sock->link, sock->type); } else { @@ -484,7 +485,8 @@ static GPUMaterialTexture *gpu_node_graph_add_texture(GPUNodeGraph *graph, GPUMaterialTexture *tex = static_cast(graph->textures.first); for (; tex; tex = tex->next) { if (tex->ima == ima && tex->colorband == colorband && tex->sky == sky && - tex->sampler_state == sampler_state) { + tex->sampler_state == sampler_state) + { break; } num_textures++; @@ -936,7 +938,8 @@ void gpu_node_graph_prune_unused(GPUNodeGraph *graph) } for (GPUNode *node = static_cast(graph->nodes.first), *next = nullptr; node; - node = next) { + node = next) + { next = node->next; if (node->tag == GPU_NODE_TAG_NONE) { @@ -948,7 +951,8 @@ void gpu_node_graph_prune_unused(GPUNodeGraph *graph) for (GPUMaterialAttribute *attr = static_cast(graph->attributes.first), *next = nullptr; attr; - attr = next) { + attr = next) + { next = attr->next; if (attr->users == 0) { BLI_freelinkN(&graph->attributes, attr); @@ -958,7 +962,8 @@ void gpu_node_graph_prune_unused(GPUNodeGraph *graph) for (GPUMaterialTexture *tex = static_cast(graph->textures.first), *next = nullptr; tex; - tex = next) { + tex = next) + { next = tex->next; if (tex->users == 0) { BLI_freelinkN(&graph->textures, tex); diff --git a/source/blender/gpu/intern/gpu_select_pick.c b/source/blender/gpu/intern/gpu_select_pick.c index 7e29eef8fa6..a22a735491b 100644 --- a/source/blender/gpu/intern/gpu_select_pick.c +++ b/source/blender/gpu/intern/gpu_select_pick.c @@ -745,8 +745,8 @@ void gpu_select_pick_cache_load_id(void) } } else { - if (depth_buf_subrect_depth_any_filled( - rect_depth, rect_depth->next, &ps->cache.sub_rect)) { + if (depth_buf_subrect_depth_any_filled(rect_depth, rect_depth->next, &ps->cache.sub_rect)) + { gpu_select_load_id_pass_nearest(rect_depth, rect_depth->next); } } diff --git a/source/blender/gpu/intern/gpu_shader_builtin.cc b/source/blender/gpu/intern/gpu_shader_builtin.cc index 91163a20f40..0ba5a3b8b80 100644 --- a/source/blender/gpu/intern/gpu_shader_builtin.cc +++ b/source/blender/gpu/intern/gpu_shader_builtin.cc @@ -128,7 +128,8 @@ GPUShader *GPU_shader_get_builtin_shader_with_config(eGPUBuiltinShader shader, GPU_SHADER_3D_POLYLINE_CLIPPED_UNIFORM_COLOR, GPU_SHADER_3D_POLYLINE_UNIFORM_COLOR, GPU_SHADER_3D_POLYLINE_FLAT_COLOR, - GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR)) { + GPU_SHADER_3D_POLYLINE_SMOOTH_COLOR)) + { /* Set a default value for `lineSmooth`. * Ideally this value should be set by the caller. */ GPU_shader_bind(*sh_p); diff --git a/source/blender/gpu/intern/gpu_shader_create_info.cc b/source/blender/gpu/intern/gpu_shader_create_info.cc index a305fbe68d0..6cde2d71a40 100644 --- a/source/blender/gpu/intern/gpu_shader_create_info.cc +++ b/source/blender/gpu/intern/gpu_shader_create_info.cc @@ -310,7 +310,8 @@ void gpu_shader_create_info_init() GPU_DRIVER_ANY, GPU_BACKEND_OPENGL) || GPU_type_matches_ex(GPU_DEVICE_ANY, GPU_OS_MAC, GPU_DRIVER_ANY, GPU_BACKEND_OPENGL) || - GPU_crappy_amd_driver()) { + GPU_crappy_amd_driver()) + { draw_modelmat = draw_modelmat_legacy; } @@ -433,7 +434,8 @@ bool gpu_shader_create_info_compile_all() (GPU_compute_shader_support() == false && info->compute_source_ != nullptr) || (GPU_geometry_shader_support() == false && info->geometry_source_ != nullptr) || (GPU_shader_image_load_store_support() == false && info->has_resource_image()) || - (GPU_shader_storage_buffer_objects_support() == false && info->has_resource_storage())) { + (GPU_shader_storage_buffer_objects_support() == false && info->has_resource_storage())) + { skipped++; continue; } diff --git a/source/blender/gpu/intern/gpu_shader_dependency.cc b/source/blender/gpu/intern/gpu_shader_dependency.cc index 0faa556bf1b..4e663fc81d1 100644 --- a/source/blender/gpu/intern/gpu_shader_dependency.cc +++ b/source/blender/gpu/intern/gpu_shader_dependency.cc @@ -112,7 +112,8 @@ struct GPUSource { } if ((source.find("drw_debug_") != StringRef::not_found) && /* Avoid these two files where it makes no sense to add the dependency. */ - !ELEM(filename, "common_debug_draw_lib.glsl", "draw_debug_draw_display_vert.glsl")) { + !ELEM(filename, "common_debug_draw_lib.glsl", "draw_debug_draw_display_vert.glsl")) + { builtins |= shader::BuiltinBits::USE_DEBUG_DRAW; } check_no_quotes(); diff --git a/source/blender/gpu/intern/gpu_shader_log.cc b/source/blender/gpu/intern/gpu_shader_log.cc index 28db1166c95..b2b4f582a17 100644 --- a/source/blender/gpu/intern/gpu_shader_log.cc +++ b/source/blender/gpu/intern/gpu_shader_log.cc @@ -95,7 +95,8 @@ void Shader::print_log(Span sources, /* Silence not useful lines. */ StringRef logref = StringRefNull(log_line).substr(0, size_t(line_end) - size_t(log_line)); if (logref.endswith(" shader failed to compile with the following errors:") || - logref.endswith(" No code generated")) { + logref.endswith(" No code generated")) + { log_line += size_t(line_end) - size_t(log_line); continue; } @@ -123,7 +124,8 @@ void Shader::print_log(Span sources, /* Separate from previous block. */ if (previous_location.source != log_item.cursor.source || - previous_location.row != log_item.cursor.row) { + previous_location.row != log_item.cursor.row) + { BLI_dynstr_appendf(dynstr, "%s%s%s\n", info_col, line_prefix, reset_col); } else if (log_item.cursor.column != previous_location.column) { @@ -131,7 +133,8 @@ void Shader::print_log(Span sources, } /* Print line from the source file that is producing the error. */ if ((log_item.cursor.row != -1) && (log_item.cursor.row != previous_location.row || - log_item.cursor.column != previous_location.column)) { + log_item.cursor.column != previous_location.column)) + { const char *src_line_end; found_line_id = false; /* error_line is 1 based in this case. */ diff --git a/source/blender/gpu/intern/gpu_texture_private.hh b/source/blender/gpu/intern/gpu_texture_private.hh index 48b3be95450..1ea1d600e62 100644 --- a/source/blender/gpu/intern/gpu_texture_private.hh +++ b/source/blender/gpu/intern/gpu_texture_private.hh @@ -751,7 +751,8 @@ inline size_t to_bytesize(eGPUTextureFormat tex_format, eGPUDataFormat data_form * Standard component len calculation does not apply, as the texture formats contain multiple * channels, but associated data format contains several compacted components. */ if ((tex_format == GPU_R11F_G11F_B10F && data_format == GPU_DATA_10_11_11_REV) || - (tex_format == GPU_RGB10_A2 && data_format == GPU_DATA_2_10_10_10_REV)) { + (tex_format == GPU_RGB10_A2 && data_format == GPU_DATA_2_10_10_10_REV)) + { return 4; } diff --git a/source/blender/gpu/intern/gpu_uniform_buffer.cc b/source/blender/gpu/intern/gpu_uniform_buffer.cc index 3d147bf9f18..b79abea3001 100644 --- a/source/blender/gpu/intern/gpu_uniform_buffer.cc +++ b/source/blender/gpu/intern/gpu_uniform_buffer.cc @@ -63,7 +63,8 @@ static eGPUType get_padded_gpu_type(LinkData *link) } /* Unless the vec3 is followed by a float we need to treat it as a vec4. */ if (gputype == GPU_VEC3 && (link->next != nullptr) && - (((GPUInput *)link->next->data)->type != GPU_FLOAT)) { + (((GPUInput *)link->next->data)->type != GPU_FLOAT)) + { gputype = GPU_VEC4; } return gputype; diff --git a/source/blender/gpu/intern/gpu_viewport.c b/source/blender/gpu/intern/gpu_viewport.c index c1e6bc29e3c..25c678a0b29 100644 --- a/source/blender/gpu/intern/gpu_viewport.c +++ b/source/blender/gpu/intern/gpu_viewport.c @@ -244,7 +244,8 @@ void GPU_viewport_colorspace_set(GPUViewport *viewport, if (view_settings->curve_mapping) { if (viewport->view_settings.curve_mapping) { if (view_settings->curve_mapping->changed_timestamp != - viewport->view_settings.curve_mapping->changed_timestamp) { + viewport->view_settings.curve_mapping->changed_timestamp) + { BKE_color_managed_view_settings_free(&viewport->view_settings); } } diff --git a/source/blender/gpu/metal/mtl_batch.mm b/source/blender/gpu/metal/mtl_batch.mm index 21e6e39e2a3..d93ced7b650 100644 --- a/source/blender/gpu/metal/mtl_batch.mm +++ b/source/blender/gpu/metal/mtl_batch.mm @@ -923,7 +923,8 @@ id MTLBatch::get_emulated_toplogy_buffer(GPUPrimType &in_out_prim_typ /* Check if topology buffer exists and is valid. */ if (this->emulated_topology_buffer_ != nullptr && - (emulated_topology_type_ != input_prim_type || topology_buffer_input_v_count_ != v_count)) { + (emulated_topology_type_ != input_prim_type || topology_buffer_input_v_count_ != v_count)) + { /* Release existing topology buffer. */ emulated_topology_buffer_->free(); diff --git a/source/blender/gpu/metal/mtl_command_buffer.mm b/source/blender/gpu/metal/mtl_command_buffer.mm index a10e46cdf77..794885f1bf7 100644 --- a/source/blender/gpu/metal/mtl_command_buffer.mm +++ b/source/blender/gpu/metal/mtl_command_buffer.mm @@ -153,7 +153,8 @@ bool MTLCommandBufferManager::submit(bool wait) /* If we have too many active command buffers in flight, wait until completed to avoid running * out. We can increase */ if (MTLCommandBufferManager::num_active_cmd_bufs >= - (GHOST_ContextCGL::max_command_buffer_count - 1)) { + (GHOST_ContextCGL::max_command_buffer_count - 1)) + { wait = true; MTL_LOG_WARNING( "Maximum number of command buffers in flight. Host will wait until GPU work has " @@ -325,7 +326,8 @@ id MTLCommandBufferManager::ensure_begin_render_command /* Begin new command encoder if the currently active one is * incompatible or requires updating. */ if (active_command_encoder_type_ != MTL_RENDER_COMMAND_ENCODER || - active_frame_buffer_ != ctx_framebuffer || force_begin) { + active_frame_buffer_ != ctx_framebuffer || force_begin) + { this->end_active_command_encoder(); /* Determine if this is a re-bind of the same frame-buffer. */ @@ -465,7 +467,8 @@ bool MTLCommandBufferManager::do_break_submission() /* Use optimized heuristic to split heavy command buffer submissions to better saturate the * hardware and also reduce stalling from individual large submissions. */ if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_ANY, GPU_DRIVER_ANY) || - GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_ANY)) { + GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_ANY)) + { return ((current_draw_call_count_ > 30000) || (vertex_submitted_count_ > 100000000) || (encoder_count_ > 25)); } @@ -511,21 +514,23 @@ bool MTLCommandBufferManager::insert_memory_barrier(eGPUBarrier barrier_bits, * NOTE(Metal): MTLFence/MTLEvent may be required to synchronize work if * untracked resources are ever used. */ if ([context_.device hasUnifiedMemory] && - (active_command_encoder_type_ != MTL_COMPUTE_COMMAND_ENCODER)) { + (active_command_encoder_type_ != MTL_COMPUTE_COMMAND_ENCODER)) + { return false; } /* Resolve scope. */ MTLBarrierScope scope = 0; - if (barrier_bits & GPU_BARRIER_SHADER_IMAGE_ACCESS || - barrier_bits & GPU_BARRIER_TEXTURE_FETCH) { + if (barrier_bits & GPU_BARRIER_SHADER_IMAGE_ACCESS || barrier_bits & GPU_BARRIER_TEXTURE_FETCH) + { bool is_compute = (active_command_encoder_type_ != MTL_RENDER_COMMAND_ENCODER); scope |= (is_compute ? 0 : MTLBarrierScopeRenderTargets) | MTLBarrierScopeTextures; } if (barrier_bits & GPU_BARRIER_SHADER_STORAGE || barrier_bits & GPU_BARRIER_VERTEX_ATTRIB_ARRAY || barrier_bits & GPU_BARRIER_ELEMENT_ARRAY || barrier_bits & GPU_BARRIER_UNIFORM || - barrier_bits & GPU_BARRIER_BUFFER_UPDATE) { + barrier_bits & GPU_BARRIER_BUFFER_UPDATE) + { scope = scope | MTLBarrierScopeBuffers; } @@ -715,7 +720,8 @@ void MTLRenderPassState::bind_vertex_sampler(MTLSamplerBinding &sampler_binding, /* If sampler state has not changed for the given slot, we do not need to fetch. */ if (this->cached_vertex_sampler_state_bindings[slot].sampler_state == nil || !(this->cached_vertex_sampler_state_bindings[slot].binding_state == sampler_binding.state) || - use_argument_buffer_for_samplers) { + use_argument_buffer_for_samplers) + { id sampler_state = (sampler_binding.state == DEFAULT_SAMPLER_STATE) ? ctx.get_default_sampler_state() : @@ -755,7 +761,8 @@ void MTLRenderPassState::bind_fragment_sampler(MTLSamplerBinding &sampler_bindin if (this->cached_fragment_sampler_state_bindings[slot].sampler_state == nil || !(this->cached_fragment_sampler_state_bindings[slot].binding_state == sampler_binding.state) || - use_argument_buffer_for_samplers) { + use_argument_buffer_for_samplers) + { id sampler_state = (sampler_binding.state == DEFAULT_SAMPLER_STATE) ? ctx.get_default_sampler_state() : @@ -795,7 +802,8 @@ void MTLComputeState::bind_compute_sampler(MTLSamplerBinding &sampler_binding, if (this->cached_compute_sampler_state_bindings[slot].sampler_state == nil || !(this->cached_compute_sampler_state_bindings[slot].binding_state == sampler_binding.state) || - use_argument_buffer_for_samplers) { + use_argument_buffer_for_samplers) + { id sampler_state = (sampler_binding.state == DEFAULT_SAMPLER_STATE) ? ctx.get_default_sampler_state() : @@ -828,7 +836,8 @@ void MTLRenderPassState::bind_vertex_buffer(id buffer, uint buffer_of BufferBindingCached ¤t_vert_ubo_binding = this->cached_vertex_buffer_bindings[index]; if (current_vert_ubo_binding.offset != buffer_offset || - current_vert_ubo_binding.metal_buffer != buffer || current_vert_ubo_binding.is_bytes) { + current_vert_ubo_binding.metal_buffer != buffer || current_vert_ubo_binding.is_bytes) + { id rec = this->cmd.get_active_render_command_encoder(); BLI_assert(rec != nil); @@ -857,7 +866,8 @@ void MTLRenderPassState::bind_fragment_buffer(id buffer, uint buffer_ BufferBindingCached ¤t_frag_ubo_binding = this->cached_fragment_buffer_bindings[index]; if (current_frag_ubo_binding.offset != buffer_offset || - current_frag_ubo_binding.metal_buffer != buffer || current_frag_ubo_binding.is_bytes) { + current_frag_ubo_binding.metal_buffer != buffer || current_frag_ubo_binding.is_bytes) + { id rec = this->cmd.get_active_render_command_encoder(); BLI_assert(rec != nil); @@ -889,7 +899,8 @@ void MTLComputeState::bind_compute_buffer(id buffer, BufferBindingCached ¤t_comp_ubo_binding = this->cached_compute_buffer_bindings[index]; if (current_comp_ubo_binding.offset != buffer_offset || - current_comp_ubo_binding.metal_buffer != buffer || current_comp_ubo_binding.is_bytes) { + current_comp_ubo_binding.metal_buffer != buffer || current_comp_ubo_binding.is_bytes) + { id rec = this->cmd.get_active_compute_command_encoder(); BLI_assert(rec != nil); diff --git a/source/blender/gpu/metal/mtl_context.mm b/source/blender/gpu/metal/mtl_context.mm index 26e8aaff900..37e948766db 100644 --- a/source/blender/gpu/metal/mtl_context.mm +++ b/source/blender/gpu/metal/mtl_context.mm @@ -271,7 +271,8 @@ MTLContext::~MTLContext() /* Unbind UBOs */ for (int i = 0; i < MTL_MAX_UNIFORM_BUFFER_BINDINGS; i++) { if (this->pipeline_state.ubo_bindings[i].bound && - this->pipeline_state.ubo_bindings[i].ubo != nullptr) { + this->pipeline_state.ubo_bindings[i].ubo != nullptr) + { GPUUniformBuf *ubo = wrap( static_cast(this->pipeline_state.ubo_bindings[i].ubo)); GPU_uniformbuf_unbind(ubo); @@ -372,7 +373,8 @@ void MTLContext::activate() /* Reset UBO bind state. */ for (int i = 0; i < MTL_MAX_UNIFORM_BUFFER_BINDINGS; i++) { if (this->pipeline_state.ubo_bindings[i].bound && - this->pipeline_state.ubo_bindings[i].ubo != nullptr) { + this->pipeline_state.ubo_bindings[i].ubo != nullptr) + { this->pipeline_state.ubo_bindings[i].bound = false; this->pipeline_state.ubo_bindings[i].ubo = nullptr; } @@ -440,7 +442,8 @@ id MTLContext::ensure_begin_render_pass() /* Ensure command buffer workload submissions are optimal -- * Though do not split a batch mid-IMM recording. */ if (this->main_command_buffer.do_break_submission() && - !((MTLImmediate *)(this->imm))->imm_is_recording()) { + !((MTLImmediate *)(this->imm))->imm_is_recording()) + { this->flush(); } @@ -449,7 +452,8 @@ id MTLContext::ensure_begin_render_pass() if (!this->main_command_buffer.is_inside_render_pass() || this->active_fb != this->main_command_buffer.get_active_framebuffer() || this->main_command_buffer.get_active_framebuffer()->get_dirty() || - this->is_visibility_dirty()) { + this->is_visibility_dirty()) + { /* Validate bound framebuffer before beginning render pass. */ if (!static_cast(this->active_fb)->validate_render_pass()) { @@ -1062,7 +1066,8 @@ bool MTLContext::ensure_uniform_buffer_bindings( * the current RenderCommandEncoder. */ if (this->pipeline_state.active_shader->get_push_constant_is_dirty() || active_shader_changed || !rps.cached_vertex_buffer_bindings[buffer_index].is_bytes || - !rps.cached_fragment_buffer_bindings[buffer_index].is_bytes || true) { + !rps.cached_fragment_buffer_bindings[buffer_index].is_bytes || true) + { /* Bind push constant data. */ BLI_assert(this->pipeline_state.active_shader->get_push_constant_data() != nullptr); @@ -1981,7 +1986,8 @@ void MTLContext::texture_bind(gpu::MTLTexture *mtl_texture, uint texture_unit) BLI_assert(mtl_texture); if (texture_unit < 0 || texture_unit >= GPU_max_textures() || - texture_unit >= MTL_MAX_TEXTURE_SLOTS) { + texture_unit >= MTL_MAX_TEXTURE_SLOTS) + { MTL_LOG_WARNING("Attempting to bind texture '%s' to invalid texture unit %d\n", mtl_texture->get_name(), texture_unit); @@ -1999,7 +2005,8 @@ void MTLContext::sampler_bind(MTLSamplerState sampler_state, uint sampler_unit) { BLI_assert(this); if (sampler_unit < 0 || sampler_unit >= GPU_max_textures() || - sampler_unit >= MTL_MAX_SAMPLER_SLOTS) { + sampler_unit >= MTL_MAX_SAMPLER_SLOTS) + { MTL_LOG_WARNING("Attempting to bind sampler to invalid sampler unit %d\n", sampler_unit); BLI_assert(false); return; @@ -2030,7 +2037,8 @@ void MTLContext::texture_unbind_all() /* Iterate through context's bound textures. */ for (int t = 0; t < min_uu(GPU_max_textures(), MTL_MAX_TEXTURE_SLOTS); t++) { if (this->pipeline_state.texture_bindings[t].used && - this->pipeline_state.texture_bindings[t].texture_resource) { + this->pipeline_state.texture_bindings[t].texture_resource) + { this->pipeline_state.texture_bindings[t].used = false; this->pipeline_state.texture_bindings[t].texture_resource = nullptr; diff --git a/source/blender/gpu/metal/mtl_framebuffer.mm b/source/blender/gpu/metal/mtl_framebuffer.mm index 2b70285d32a..bed1854c291 100644 --- a/source/blender/gpu/metal/mtl_framebuffer.mm +++ b/source/blender/gpu/metal/mtl_framebuffer.mm @@ -266,8 +266,8 @@ bool MTLFrameBuffer::check(char err_out[256]) } } else { - if (dim_x != stencil_att.texture->width_get() || - dim_y != stencil_att.texture->height_get()) { + if (dim_x != stencil_att.texture->width_get() || dim_y != stencil_att.texture->height_get()) + { const char *format = "Framebuffer %s: Stencil attachment dimensions do not match that of previous " "attachment"; @@ -1235,7 +1235,8 @@ void MTLFrameBuffer::ensure_render_target_size() { /* If we have no attachments, reset width and height to zero. */ if (colour_attachment_count_ == 0 && !this->has_depth_attachment() && - !this->has_stencil_attachment()) { + !this->has_stencil_attachment()) + { /* Reset default size for empty framebuffer. */ this->default_size_set(0, 0); @@ -1291,7 +1292,8 @@ bool MTLFrameBuffer::set_depth_attachment_clear_value(float depth_clear) BLI_assert(this); if (mtl_depth_attachment_.clear_value.depth != depth_clear || - mtl_depth_attachment_.load_action != GPU_LOADACTION_CLEAR) { + mtl_depth_attachment_.load_action != GPU_LOADACTION_CLEAR) + { mtl_depth_attachment_.clear_value.depth = depth_clear; mtl_depth_attachment_.load_action = GPU_LOADACTION_CLEAR; this->mark_loadstore_dirty(); @@ -1304,7 +1306,8 @@ bool MTLFrameBuffer::set_stencil_attachment_clear_value(uint stencil_clear) BLI_assert(this); if (mtl_stencil_attachment_.clear_value.stencil != stencil_clear || - mtl_stencil_attachment_.load_action != GPU_LOADACTION_CLEAR) { + mtl_stencil_attachment_.load_action != GPU_LOADACTION_CLEAR) + { mtl_stencil_attachment_.clear_value.stencil = stencil_clear; mtl_stencil_attachment_.load_action = GPU_LOADACTION_CLEAR; this->mark_loadstore_dirty(); @@ -1397,7 +1400,8 @@ bool MTLFrameBuffer::has_color_attachment_with_texture(gpu::MTLTexture *texture) for (int attachment = 0; attachment < this->get_attachment_limit(); attachment++) { if (mtl_color_attachments_[attachment].used && - mtl_color_attachments_[attachment].texture == texture) { + mtl_color_attachments_[attachment].texture == texture) + { return true; } } @@ -1423,7 +1427,8 @@ int MTLFrameBuffer::get_color_attachment_slot_from_texture(gpu::MTLTexture *text for (int attachment = 0; attachment < this->get_attachment_limit(); attachment++) { if (mtl_color_attachments_[attachment].used && - (mtl_color_attachments_[attachment].texture == texture)) { + (mtl_color_attachments_[attachment].texture == texture)) + { return attachment; } } @@ -1564,8 +1569,8 @@ MTLRenderPassDescriptor *MTLFrameBuffer::bake_render_pass_descriptor(bool load_c int len = 0; bool valid = true; - for (int attachment_ind = 0; attachment_ind < GPU_FB_MAX_COLOR_ATTACHMENT; - attachment_ind++) { + for (int attachment_ind = 0; attachment_ind < GPU_FB_MAX_COLOR_ATTACHMENT; attachment_ind++) + { if (mtl_color_attachments_[attachment_ind].used) { if (len == 0) { len = mtl_color_attachments_[attachment_ind].render_target_array_length; @@ -1624,7 +1629,8 @@ MTLRenderPassDescriptor *MTLFrameBuffer::bake_render_pass_descriptor(bool load_c id source_color_texture = texture; if (this->get_is_srgb() && mtl_color_attachments_[attachment_ind].texture->is_format_srgb() && - !this->get_srgb_enabled()) { + !this->get_srgb_enabled()) + { source_color_texture = mtl_color_attachments_[attachment_ind].texture->get_non_srgb_handle(); BLI_assert(source_color_texture != nil); @@ -1637,8 +1643,8 @@ MTLRenderPassDescriptor *MTLFrameBuffer::bake_render_pass_descriptor(bool load_c /* MTL_FB_CONFIG_LOAD must always load. */ load_action = GPU_LOADACTION_LOAD; } - else if (descriptor_config == MTL_FB_CONFIG_CUSTOM && - load_action == GPU_LOADACTION_CLEAR) { + else if (descriptor_config == MTL_FB_CONFIG_CUSTOM && load_action == GPU_LOADACTION_CLEAR) + { /* Custom config should be LOAD or DONT_CARE only. */ load_action = GPU_LOADACTION_LOAD; } @@ -1781,7 +1787,8 @@ void MTLFrameBuffer::blit(uint read_slot, /* If the color format is not the same, we cannot use the BlitCommandEncoder, and instead use * a Graphics-based blit. */ if (do_color && (this->get_color_attachment(read_slot).texture->format_get() != - metal_fb_write->get_color_attachment(read_slot).texture->format_get())) { + metal_fb_write->get_color_attachment(read_slot).texture->format_get())) + { MTLAttachment src_attachment = this->get_color_attachment(read_slot); MTLAttachment dst_attachment = metal_fb_write->get_color_attachment(write_slot); diff --git a/source/blender/gpu/metal/mtl_immediate.mm b/source/blender/gpu/metal/mtl_immediate.mm index 2918a9c5edb..d68eab0294c 100644 --- a/source/blender/gpu/metal/mtl_immediate.mm +++ b/source/blender/gpu/metal/mtl_immediate.mm @@ -66,7 +66,8 @@ void MTLImmediate::end() /* Skip draw if Metal shader is not valid. */ if (active_mtl_shader == nullptr || !active_mtl_shader->is_valid() || - active_mtl_shader->get_interface() == nullptr) { + active_mtl_shader->get_interface() == nullptr) + { const char *ptr = (active_mtl_shader) ? active_mtl_shader->name_get() : nullptr; MTL_LOG_WARNING( diff --git a/source/blender/gpu/metal/mtl_memory.mm b/source/blender/gpu/metal/mtl_memory.mm index e51d7b8c3a0..75a863da807 100644 --- a/source/blender/gpu/metal/mtl_memory.mm +++ b/source/blender/gpu/metal/mtl_memory.mm @@ -53,7 +53,8 @@ void MTLBufferPool::free() allocations_.clear(); for (std::multiset *buffer_pool : - buffer_pools_.values()) { + buffer_pools_.values()) + { delete buffer_pool; } buffer_pools_.clear(); @@ -117,7 +118,8 @@ gpu::MTLBuffer *MTLBufferPool::allocate_aligned(uint64_t size, uint64_t found_size = found_buffer->get_size(); if (found_size >= aligned_alloc_size && - found_size <= (aligned_alloc_size * mtl_buffer_size_threshold_factor_)) { + found_size <= (aligned_alloc_size * mtl_buffer_size_threshold_factor_)) + { MTL_LOG_INFO( "[MemoryAllocator] Suitable Buffer of size %lld found, for requested size: %lld\n", found_size, @@ -231,7 +233,8 @@ void MTLBufferPool::update_memory_pools() /* Always free oldest MTLSafeFreeList first. */ for (int safe_pool_free_index = 0; safe_pool_free_index < completed_safelist_queue_.size(); - safe_pool_free_index++) { + safe_pool_free_index++) + { MTLSafeFreeList *current_pool = completed_safelist_queue_[safe_pool_free_index]; /* Iterate through all MTLSafeFreeList linked-chunks. */ diff --git a/source/blender/gpu/metal/mtl_pso_descriptor_state.hh b/source/blender/gpu/metal/mtl_pso_descriptor_state.hh index a3d2ded72a2..6f57783e7f6 100644 --- a/source/blender/gpu/metal/mtl_pso_descriptor_state.hh +++ b/source/blender/gpu/metal/mtl_pso_descriptor_state.hh @@ -125,7 +125,8 @@ struct MTLVertexDescriptor { { if ((this->max_attribute_value != other.max_attribute_value) || (this->total_attributes != other.total_attributes) || - (this->num_vert_buffers != other.num_vert_buffers)) { + (this->num_vert_buffers != other.num_vert_buffers)) + { return false; } if (this->prim_topology_class != other.prim_topology_class) { @@ -227,7 +228,8 @@ struct MTLRenderPipelineStateDescriptor { (src_alpha_blend_factor != other.src_alpha_blend_factor) || (src_rgb_blend_factor != other.src_rgb_blend_factor) || (vertex_descriptor.prim_topology_class != other.vertex_descriptor.prim_topology_class) || - (point_size != other.point_size)) { + (point_size != other.point_size)) + { return false; } diff --git a/source/blender/gpu/metal/mtl_shader.hh b/source/blender/gpu/metal/mtl_shader.hh index 941f93675c8..5903d562ac7 100644 --- a/source/blender/gpu/metal/mtl_shader.hh +++ b/source/blender/gpu/metal/mtl_shader.hh @@ -672,7 +672,8 @@ inline bool mtl_convert_vertex_format(MTLVertexFormat shader_attrib_format, if (shader_attrib_format == MTLVertexFormatChar || shader_attrib_format == MTLVertexFormatChar2 || shader_attrib_format == MTLVertexFormatChar3 || - shader_attrib_format == MTLVertexFormatChar4) { + shader_attrib_format == MTLVertexFormatChar4) + { /* No conversion Needed (as type matches) - Just a vector resize if needed. */ bool can_convert = mtl_vertex_format_resize( @@ -752,7 +753,8 @@ inline bool mtl_convert_vertex_format(MTLVertexFormat shader_attrib_format, if (shader_attrib_format == MTLVertexFormatUChar || shader_attrib_format == MTLVertexFormatUChar2 || shader_attrib_format == MTLVertexFormatUChar3 || - shader_attrib_format == MTLVertexFormatUChar4) { + shader_attrib_format == MTLVertexFormatUChar4) + { /* No conversion Needed (as type matches) - Just a vector resize if needed. */ bool can_convert = mtl_vertex_format_resize( @@ -837,7 +839,8 @@ inline bool mtl_convert_vertex_format(MTLVertexFormat shader_attrib_format, if (shader_attrib_format == MTLVertexFormatShort || shader_attrib_format == MTLVertexFormatShort2 || shader_attrib_format == MTLVertexFormatShort3 || - shader_attrib_format == MTLVertexFormatShort4) { + shader_attrib_format == MTLVertexFormatShort4) + { /* No conversion Needed (as type matches) - Just a vector resize if needed. */ bool can_convert = mtl_vertex_format_resize( shader_attrib_format, component_length, &out_vert_format); @@ -892,7 +895,8 @@ inline bool mtl_convert_vertex_format(MTLVertexFormat shader_attrib_format, if (shader_attrib_format == MTLVertexFormatUShort || shader_attrib_format == MTLVertexFormatUShort2 || shader_attrib_format == MTLVertexFormatUShort3 || - shader_attrib_format == MTLVertexFormatUShort4) { + shader_attrib_format == MTLVertexFormatUShort4) + { /* No conversion Needed (as type matches) - Just a vector resize if needed. */ bool can_convert = mtl_vertex_format_resize( shader_attrib_format, component_length, &out_vert_format); @@ -947,7 +951,8 @@ inline bool mtl_convert_vertex_format(MTLVertexFormat shader_attrib_format, if (shader_attrib_format == MTLVertexFormatInt || shader_attrib_format == MTLVertexFormatInt2 || shader_attrib_format == MTLVertexFormatInt3 || - shader_attrib_format == MTLVertexFormatInt4) { + shader_attrib_format == MTLVertexFormatInt4) + { /* No conversion Needed (as type matches) - Just a vector resize if needed. */ bool can_convert = mtl_vertex_format_resize( shader_attrib_format, component_length, &out_vert_format); @@ -978,7 +983,8 @@ inline bool mtl_convert_vertex_format(MTLVertexFormat shader_attrib_format, if (shader_attrib_format == MTLVertexFormatUInt || shader_attrib_format == MTLVertexFormatUInt2 || shader_attrib_format == MTLVertexFormatUInt3 || - shader_attrib_format == MTLVertexFormatUInt4) { + shader_attrib_format == MTLVertexFormatUInt4) + { /* No conversion Needed (as type matches) - Just a vector resize if needed. */ bool can_convert = mtl_vertex_format_resize( shader_attrib_format, component_length, &out_vert_format); @@ -1014,7 +1020,8 @@ inline bool mtl_convert_vertex_format(MTLVertexFormat shader_attrib_format, if (shader_attrib_format == MTLVertexFormatFloat || shader_attrib_format == MTLVertexFormatFloat2 || shader_attrib_format == MTLVertexFormatFloat3 || - shader_attrib_format == MTLVertexFormatFloat4) { + shader_attrib_format == MTLVertexFormatFloat4) + { /* No conversion Needed (as type matches) - Just a vector resize, if needed. */ bool can_convert = mtl_vertex_format_resize( shader_attrib_format, component_length, &out_vert_format); diff --git a/source/blender/gpu/metal/mtl_shader.mm b/source/blender/gpu/metal/mtl_shader.mm index 283d0adedd8..5b5af064b25 100644 --- a/source/blender/gpu/metal/mtl_shader.mm +++ b/source/blender/gpu/metal/mtl_shader.mm @@ -291,8 +291,8 @@ bool MTLShader::finalize(const shader::ShaderCreateInfo *info) shd_builder_->msl_source_frag_); /* Transform feedback, skip compilation. */ - if (src_stage == ShaderStage::FRAGMENT && - (transform_feedback_type_ != GPU_SHADER_TFB_NONE)) { + if (src_stage == ShaderStage::FRAGMENT && (transform_feedback_type_ != GPU_SHADER_TFB_NONE)) + { shader_library_frag_ = nil; break; } @@ -576,7 +576,8 @@ void MTLShader::uniform_int(int location, int comp_len, int array_size, const in * Metal, as we cannot point a texture binding at a different slot. */ MTLShaderInterface *mtl_interface = this->get_interface(); if (location >= mtl_interface->get_total_uniforms() && - location < (mtl_interface->get_total_uniforms() + mtl_interface->get_total_textures())) { + location < (mtl_interface->get_total_uniforms() + mtl_interface->get_total_textures())) + { MTL_LOG_WARNING( "Texture uniform location re-mapping unsupported in Metal. (Possibly also bad uniform " "location %d)\n", @@ -893,7 +894,8 @@ MTLRenderPipelineStateInstance *MTLShader::bake_pipeline_state( type:MTLDataTypeInt withName:[NSString stringWithFormat:@"MTL_AttributeConvert%d", i]]; if (MTL_attribute_conversion_mode == GPU_FETCH_INT_TO_FLOAT_UNIT || - MTL_attribute_conversion_mode == GPU_FETCH_INT_TO_FLOAT) { + MTL_attribute_conversion_mode == GPU_FETCH_INT_TO_FLOAT) + { shader_debug_printf( "TODO(Metal): Shader %s needs to support internal format conversion\n", mtl_interface->name); @@ -926,7 +928,8 @@ MTLRenderPipelineStateInstance *MTLShader::bake_pipeline_state( /* Mark empty attribute conversion. */ for (int i = pipeline_descriptor.vertex_descriptor.max_attribute_value + 1; i < GPU_VERT_ATTR_MAX_LEN; - i++) { + i++) + { int MTL_attribute_conversion_mode = 0; [values setConstantValue:&MTL_attribute_conversion_mode type:MTLDataTypeInt diff --git a/source/blender/gpu/metal/mtl_shader_generator.hh b/source/blender/gpu/metal/mtl_shader_generator.hh index 333c70a6fcb..8b5e438bd44 100644 --- a/source/blender/gpu/metal/mtl_shader_generator.hh +++ b/source/blender/gpu/metal/mtl_shader_generator.hh @@ -787,7 +787,8 @@ inline char *next_word_in_range(char *begin, char *end) for (char *a = begin; a < end; a++) { char chr = *a; if ((chr >= 'a' && chr <= 'z') || (chr >= 'A' && chr <= 'Z') || (chr >= '0' && chr <= '9') || - (chr == '_')) { + (chr == '_')) + { return a; } } diff --git a/source/blender/gpu/metal/mtl_shader_generator.mm b/source/blender/gpu/metal/mtl_shader_generator.mm index 8a2cb59ee05..8e85d12a98e 100644 --- a/source/blender/gpu/metal/mtl_shader_generator.mm +++ b/source/blender/gpu/metal/mtl_shader_generator.mm @@ -165,7 +165,8 @@ static bool is_program_word(const char *chr, int *len) char ch = *c; /* Note: Hash (`#`) is not valid in var names, but is used by Closure macro patterns. */ if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || - (numchars > 0 && ch >= '0' && ch <= '9') || ch == '_' || ch == '#') { + (numchars > 0 && ch >= '0' && ch <= '9') || ch == '_' || ch == '#') + { numchars++; } else { @@ -185,7 +186,8 @@ static int backwards_program_word_scan(const char *array_loc, const char *min) for (start = array_loc - 1; (start >= min) && (*start != '\0'); start--) { char ch = *start; if ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || - ch == '_' || ch == '#') { + ch == '_' || ch == '#') + { numchars++; last_char = ch; } @@ -466,7 +468,8 @@ static void extract_global_scope_constants(std::string &str, std::stringstream & /* Check For global const declarations */ if (nested_bracket_depth == 0 && strncmp(c, "const ", 6) == 0 && - strncmp(c, "const constant ", 15) != 0) { + strncmp(c, "const constant ", 15) != 0) + { char *c_expr_end = strchr(c, ';'); if (c_expr_end != nullptr && balanced_braces(c, c_expr_end)) { MTL_LOG_INFO( @@ -1736,7 +1739,8 @@ void MSLGeneratorInterface::prepare_from_createinfo(const shader::ShaderCreateIn /* TextureBuffers must have read/write/read-write access pattern. */ if (res.sampler.type == ImageType::FLOAT_BUFFER || res.sampler.type == ImageType::INT_BUFFER || - res.sampler.type == ImageType::UINT_BUFFER) { + res.sampler.type == ImageType::UINT_BUFFER) + { access = MSLTextureSamplerAccess::TEXTURE_ACCESS_READ; } @@ -2757,7 +2761,8 @@ std::string MSLGeneratorInterface::generate_msl_vertex_attribute_input_populatio << this->vertex_input_attributes[attribute].name << 0; for (int elem = 1; elem < get_matrix_location_count(this->vertex_input_attributes[attribute].type); - elem++) { + elem++) + { out << ",\n" << "v_in.__internal_" << this->vertex_input_attributes[attribute].name << elem; } @@ -2963,10 +2968,11 @@ std::string MSLGeneratorInterface::generate_msl_fragment_input_population() * vertex shader, a warning will be provided. */ for (int f_input = (this->uses_gl_Position) ? 0 : 1; f_input < this->fragment_input_varyings.size(); - f_input++) { + f_input++) + { bool exists_in_vertex_output = false; - for (int v_o = 0; v_o < this->vertex_output_varyings.size() && !exists_in_vertex_output; - v_o++) { + for (int v_o = 0; v_o < this->vertex_output_varyings.size() && !exists_in_vertex_output; v_o++) + { if (this->fragment_input_varyings[f_input].name == this->vertex_output_varyings[v_o].name) { exists_in_vertex_output = true; } @@ -3215,7 +3221,8 @@ MTLShaderInterface *MSLGeneratorInterface::bake_shader_interface(const char *nam int size = mtl_get_data_type_size(mtl_type); for (int elem = 0; elem < get_matrix_location_count(this->vertex_input_attributes[attribute].type); - elem++) { + elem++) + { /* First attribute matches the core name -- subsequent attributes tagged with * `__internal_`. */ std::string _internal_name = (elem == 0) ? diff --git a/source/blender/gpu/metal/mtl_state.mm b/source/blender/gpu/metal/mtl_state.mm index 5f570625ff1..a77d7069b5a 100644 --- a/source/blender/gpu/metal/mtl_state.mm +++ b/source/blender/gpu/metal/mtl_state.mm @@ -147,7 +147,8 @@ void MTLStateManager::set_mutable_state(const GPUStateMutable &state) } if (changed.stencil_compare_mask != 0 || changed.stencil_reference != 0 || - changed.stencil_write_mask != 0) { + changed.stencil_write_mask != 0) + { set_stencil_mask((eGPUStencilTest)current_.stencil_test, state); } diff --git a/source/blender/gpu/metal/mtl_texture.mm b/source/blender/gpu/metal/mtl_texture.mm index e9180f1a316..9c67e901034 100644 --- a/source/blender/gpu/metal/mtl_texture.mm +++ b/source/blender/gpu/metal/mtl_texture.mm @@ -120,7 +120,8 @@ void gpu::MTLTexture::bake_mip_swizzle_view() * Only apply this if mipmap is the only change, and we have not previously generated * a texture view. For textures which are created as views, this should also be skipped. */ if (resource_mode_ != MTL_TEXTURE_MODE_TEXTURE_VIEW && - texture_view_dirty_flags_ == TEXTURE_VIEW_MIP_DIRTY && mip_swizzle_view_ == nil) { + texture_view_dirty_flags_ == TEXTURE_VIEW_MIP_DIRTY && mip_swizzle_view_ == nil) + { if (mip_texture_base_level_ == 0 && mip_texture_max_level_ == mtl_max_mips_) { texture_view_dirty_flags_ = TEXTURE_VIEW_NOT_DIRTY; @@ -534,7 +535,8 @@ void gpu::MTLTexture::update_sub( /* Determine whether we can do direct BLIT or not. */ bool can_use_direct_blit = true; if (expected_dst_bytes_per_pixel != input_bytes_per_pixel || - num_channels != destination_num_channels) { + num_channels != destination_num_channels) + { can_use_direct_blit = false; } @@ -628,7 +630,8 @@ void gpu::MTLTexture::update_sub( * format is unwritable, if our texture has not been initialized with * texture view support, use a staging texture. */ if ((compatible_write_format != destination_format) && - !(gpu_image_usage_flags_ & GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW)) { + !(gpu_image_usage_flags_ & GPU_TEXTURE_USAGE_MIP_SWIZZLE_VIEW)) + { use_staging_texture = true; } } @@ -1176,7 +1179,8 @@ void gpu::MTLTexture::generate_mipmap() /* Verify if we can perform mipmap generation. */ if (format_ == GPU_DEPTH_COMPONENT32F || format_ == GPU_DEPTH_COMPONENT24 || format_ == GPU_DEPTH_COMPONENT16 || format_ == GPU_DEPTH32F_STENCIL8 || - format_ == GPU_DEPTH24_STENCIL8) { + format_ == GPU_DEPTH24_STENCIL8) + { MTL_LOG_WARNING("Cannot generate mipmaps for textures using DEPTH formats\n"); return; } @@ -1330,7 +1334,8 @@ void gpu::MTLTexture::mip_range_set(int min, int max) mip_max_ = max; if ((type_ == GPU_TEXTURE_1D || type_ == GPU_TEXTURE_1D_ARRAY || type_ == GPU_TEXTURE_BUFFER) && - max > 1) { + max > 1) + { MTL_LOG_ERROR( " MTLTexture of type TEXTURE_1D_ARRAY or TEXTURE_BUFFER cannot have a mipcount " diff --git a/source/blender/gpu/opengl/gl_backend.cc b/source/blender/gpu/opengl/gl_backend.cc index 738961047c9..d336985d0a7 100644 --- a/source/blender/gpu/opengl/gl_backend.cc +++ b/source/blender/gpu/opengl/gl_backend.cc @@ -66,14 +66,16 @@ void GLBackend::platform_init() } else if (strstr(vendor, "Intel") || /* src/mesa/drivers/dri/intel/intel_context.c */ - strstr(renderer, "Mesa DRI Intel") || strstr(renderer, "Mesa DRI Mobile Intel")) { + strstr(renderer, "Mesa DRI Intel") || strstr(renderer, "Mesa DRI Mobile Intel")) + { device = GPU_DEVICE_INTEL; driver = GPU_DRIVER_OFFICIAL; if (strstr(renderer, "UHD Graphics") || /* Not UHD but affected by the same bugs. */ strstr(renderer, "HD Graphics 530") || strstr(renderer, "Kaby Lake GT2") || - strstr(renderer, "Whiskey Lake")) { + strstr(renderer, "Whiskey Lake")) + { device |= GPU_DEVICE_INTEL_UHD; } } @@ -81,7 +83,8 @@ void GLBackend::platform_init() (strstr(renderer, "Radeon") && strstr(vendor, "X.Org")) || (strstr(renderer, "AMD") && strstr(vendor, "X.Org")) || (strstr(renderer, "Gallium ") && strstr(renderer, " on ATI ")) || - (strstr(renderer, "Gallium ") && strstr(renderer, " on AMD "))) { + (strstr(renderer, "Gallium ") && strstr(renderer, " on AMD "))) + { device = GPU_DEVICE_ATI; driver = GPU_DRIVER_OPENSOURCE; } @@ -130,7 +133,8 @@ void GLBackend::platform_init() strstr(version, "Build 8.15") || strstr(version, "Build 9.17") || strstr(version, "Build 9.18") || strstr(version, "Build 10.18.10.3") || strstr(version, "Build 10.18.10.4") || strstr(version, "Build 10.18.10.5") || - strstr(version, "Build 10.18.14.4")) { + strstr(version, "Build 10.18.14.4")) + { support_level = GPU_SUPPORT_LEVEL_LIMITED; } } @@ -267,7 +271,8 @@ static void detect_workarounds() } if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_WIN, GPU_DRIVER_OFFICIAL) && (strstr(version, "4.5.13399") || strstr(version, "4.5.13417") || - strstr(version, "4.5.13422") || strstr(version, "4.5.13467"))) { + strstr(version, "4.5.13422") || strstr(version, "4.5.13467"))) + { /* The renderers include: * Radeon HD 5000; * Radeon HD 7500M; @@ -283,13 +288,15 @@ static void detect_workarounds() } /* Compute shaders have some issues with those versions (see #94936). */ if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL) && - (strstr(version, "4.5.14831") || strstr(version, "4.5.14760"))) { + (strstr(version, "4.5.14831") || strstr(version, "4.5.14760"))) + { GCaps.compute_shader_support = false; } /* We have issues with this specific renderer. (see #74024) */ if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE) && (strstr(renderer, "AMD VERDE") || strstr(renderer, "AMD KAVERI") || - strstr(renderer, "AMD TAHITI"))) { + strstr(renderer, "AMD TAHITI"))) + { GLContext::unused_fb_slot_workaround = true; GCaps.shader_image_load_store_support = false; GCaps.shader_draw_parameters_support = false; @@ -297,7 +304,8 @@ static void detect_workarounds() } /* Fix slowdown on this particular driver. (see #77641) */ if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE) && - strstr(version, "Mesa 19.3.4")) { + strstr(version, "Mesa 19.3.4")) + { GCaps.shader_image_load_store_support = false; GCaps.shader_draw_parameters_support = false; GCaps.broken_amd_driver = true; @@ -321,7 +329,8 @@ static void detect_workarounds() * still be broken. */ if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_MAC, GPU_DRIVER_OFFICIAL)) { if (strstr(renderer, "AMD Radeon Pro") || strstr(renderer, "AMD Radeon R9") || - strstr(renderer, "AMD Radeon RX")) { + strstr(renderer, "AMD Radeon RX")) + { GCaps.depth_blitting_workaround = true; } } @@ -329,19 +338,22 @@ static void detect_workarounds() * covered since they only support GL 4.4 on windows. * This fixes some issues with workbench anti-aliasing on Win + Intel GPU. (see #76273) */ if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_WIN, GPU_DRIVER_OFFICIAL) && - !(epoxy_gl_version() >= 45)) { + !(epoxy_gl_version() >= 45)) + { GLContext::copy_image_support = false; } /* Special fix for these specific GPUs. * Without this workaround, blender crashes on startup. (see #72098) */ if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_WIN, GPU_DRIVER_OFFICIAL) && - (strstr(renderer, "HD Graphics 620") || strstr(renderer, "HD Graphics 630"))) { + (strstr(renderer, "HD Graphics 620") || strstr(renderer, "HD Graphics 630"))) + { GCaps.mip_render_workaround = true; } /* Intel Ivy Bridge GPU's seems to have buggy cube-map array support. (see #75943) */ if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_WIN, GPU_DRIVER_OFFICIAL) && (strstr(renderer, "HD Graphics 4000") || strstr(renderer, "HD Graphics 4400") || - strstr(renderer, "HD Graphics 2500"))) { + strstr(renderer, "HD Graphics 2500"))) + { GLContext::texture_cube_map_array_support = false; } /* Maybe not all of these drivers have problems with `GL_ARB_base_instance`. @@ -351,20 +363,23 @@ static void detect_workarounds() if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_WIN, GPU_DRIVER_ANY) && (strstr(version, "Build 10.18.10.3") || strstr(version, "Build 10.18.10.4") || strstr(version, "Build 10.18.10.5") || strstr(version, "Build 10.18.14.4") || - strstr(version, "Build 10.18.14.5"))) { + strstr(version, "Build 10.18.14.5"))) + { GLContext::base_instance_support = false; GCaps.use_main_context_workaround = true; } /* Somehow fixes armature display issues (see #69743). */ if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_WIN, GPU_DRIVER_ANY) && - strstr(version, "Build 20.19.15.4285")) { + strstr(version, "Build 20.19.15.4285")) + { GCaps.use_main_context_workaround = true; } /* See #70187: merging vertices fail. This has been tested from `18.2.2` till `19.3.0~dev` * of the Mesa driver */ if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OPENSOURCE) && (strstr(version, "Mesa 18.") || strstr(version, "Mesa 19.0") || - strstr(version, "Mesa 19.1") || strstr(version, "Mesa 19.2"))) { + strstr(version, "Mesa 19.1") || strstr(version, "Mesa 19.2"))) + { GLContext::unused_fb_slot_workaround = true; } /* There is a bug on older Nvidia GPU where GL_ARB_texture_gather @@ -375,8 +390,8 @@ static void detect_workarounds() } /* dFdx/dFdy calculation factors, those are dependent on driver. */ - if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_ANY) && - strstr(version, "3.3.10750")) { + if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_ANY) && strstr(version, "3.3.10750")) + { GLContext::derivative_signs[0] = 1.0; GLContext::derivative_signs[1] = -1.0; } @@ -386,7 +401,8 @@ static void detect_workarounds() strstr(version, "4.0.0 - Build 9.18.10.3165") || strstr(version, "3.1.0 - Build 9.17.10.3347") || strstr(version, "3.1.0 - Build 9.17.10.4101") || - strstr(version, "3.3.0 - Build 8.15.10.2618")) { + strstr(version, "3.3.0 - Build 8.15.10.2618")) + { GLContext::derivative_signs[0] = -1.0; GLContext::derivative_signs[1] = 1.0; } @@ -415,20 +431,23 @@ static void detect_workarounds() /* Broken glGenerateMipmap on macOS 10.15.7 security update. */ if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_MAC, GPU_DRIVER_ANY) && - strstr(renderer, "HD Graphics 4000")) { + strstr(renderer, "HD Graphics 4000")) + { GLContext::generate_mipmap_workaround = true; } /* Buggy interface query functions cause crashes when handling SSBOs (#93680) */ if (GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_ANY, GPU_DRIVER_ANY) && - (strstr(renderer, "HD Graphics 4400") || strstr(renderer, "HD Graphics 4600"))) { + (strstr(renderer, "HD Graphics 4400") || strstr(renderer, "HD Graphics 4600"))) + { GCaps.shader_storage_buffer_objects_support = false; } /* Certain Intel/AMD based platforms don't clear the viewport textures. Always clearing leads to * noticeable performance regressions on other platforms as well. */ if (GPU_type_matches(GPU_DEVICE_ANY, GPU_OS_MAC, GPU_DRIVER_ANY) || - GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_ANY, GPU_DRIVER_ANY)) { + GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_ANY, GPU_DRIVER_ANY)) + { GCaps.clear_viewport_workaround = true; } diff --git a/source/blender/gpu/opengl/gl_debug.cc b/source/blender/gpu/opengl/gl_debug.cc index 799c62c30c3..d6dc32265c4 100644 --- a/source/blender/gpu/opengl/gl_debug.cc +++ b/source/blender/gpu/opengl/gl_debug.cc @@ -68,7 +68,8 @@ static void APIENTRY debug_callback(GLenum /*source*/, * In this case invoking `GPU_type_matches` would fail and * therefore the message is checked before the platform matching. */ if (TRIM_NVIDIA_BUFFER_INFO && STRPREFIX(message, "Buffer detailed info") && - GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_ANY, GPU_DRIVER_OFFICIAL)) { + GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_ANY, GPU_DRIVER_OFFICIAL)) + { /** Suppress buffer infos flooding the output. */ return; } @@ -327,7 +328,8 @@ static const char *to_str_suffix(GLenum type) void object_label(GLenum type, GLuint object, const char *name) { if ((G.debug & G_DEBUG_GPU) && - (epoxy_gl_version() >= 43 || epoxy_has_gl_extension("GL_KHR_debug"))) { + (epoxy_gl_version() >= 43 || epoxy_has_gl_extension("GL_KHR_debug"))) + { char label[64]; SNPRINTF(label, "%s%s%s", to_str_prefix(type), name, to_str_suffix(type)); /* Small convenience for caller. */ @@ -366,7 +368,8 @@ namespace blender::gpu { void GLContext::debug_group_begin(const char *name, int index) { if ((G.debug & G_DEBUG_GPU) && - (epoxy_gl_version() >= 43 || epoxy_has_gl_extension("GL_KHR_debug"))) { + (epoxy_gl_version() >= 43 || epoxy_has_gl_extension("GL_KHR_debug"))) + { /* Add 10 to avoid collision with other indices from other possible callback layers. */ index += 10; glPushDebugGroup(GL_DEBUG_SOURCE_APPLICATION, index, -1, name); @@ -376,7 +379,8 @@ void GLContext::debug_group_begin(const char *name, int index) void GLContext::debug_group_end() { if ((G.debug & G_DEBUG_GPU) && - (epoxy_gl_version() >= 43 || epoxy_has_gl_extension("GL_KHR_debug"))) { + (epoxy_gl_version() >= 43 || epoxy_has_gl_extension("GL_KHR_debug"))) + { glPopDebugGroup(); } } diff --git a/source/blender/gpu/opengl/gl_framebuffer.cc b/source/blender/gpu/opengl/gl_framebuffer.cc index cfbc5197a1b..4a1005f47fa 100644 --- a/source/blender/gpu/opengl/gl_framebuffer.cc +++ b/source/blender/gpu/opengl/gl_framebuffer.cc @@ -162,8 +162,8 @@ void GLFrameBuffer::update_attachments() continue; } GLuint gl_tex = static_cast(unwrap(attach.tex))->tex_id_; - if (attach.layer > -1 && GPU_texture_is_cube(attach.tex) && - !GPU_texture_is_array(attach.tex)) { + if (attach.layer > -1 && GPU_texture_is_cube(attach.tex) && !GPU_texture_is_array(attach.tex)) + { /* Could be avoided if ARB_direct_state_access is required. In this case * #glFramebufferTextureLayer would bind the correct face. */ GLenum gl_target = GL_TEXTURE_CUBE_MAP_POSITIVE_X + attach.layer; diff --git a/source/blender/gpu/opengl/gl_immediate.cc b/source/blender/gpu/opengl/gl_immediate.cc index b0840e0bc22..6571df6d951 100644 --- a/source/blender/gpu/opengl/gl_immediate.cc +++ b/source/blender/gpu/opengl/gl_immediate.cc @@ -79,7 +79,8 @@ uchar *GLImmediate::begin() recreate_buffer = true; } else if (bytes_needed < DEFAULT_INTERNAL_BUFFER_SIZE && - buffer_size() > DEFAULT_INTERNAL_BUFFER_SIZE) { + buffer_size() > DEFAULT_INTERNAL_BUFFER_SIZE) + { /* shrink the internal buffer */ buffer_size() = DEFAULT_INTERNAL_BUFFER_SIZE; recreate_buffer = true; diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc index 471399ec30a..51ec9667d57 100644 --- a/source/blender/gpu/opengl/gl_shader.cc +++ b/source/blender/gpu/opengl/gl_shader.cc @@ -531,14 +531,16 @@ std::string GLShader::vertex_interface_declare(const ShaderCreateInfo &info) con for (const ShaderCreateInfo::VertIn &attr : info.vertex_inputs_) { if (GLContext::explicit_location_support && /* Fix issue with AMDGPU-PRO + workbench_prepass_mesh_vert.glsl being quantized. */ - GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL) == false) { + GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_ANY, GPU_DRIVER_OFFICIAL) == false) + { ss << "layout(location = " << attr.index << ") "; } ss << "in " << to_string(attr.type) << " " << attr.name << ";\n"; } /* NOTE(D4490): Fix a bug where shader without any vertex attributes do not behave correctly. */ if (GPU_type_matches_ex(GPU_DEVICE_APPLE, GPU_OS_MAC, GPU_DRIVER_ANY, GPU_BACKEND_OPENGL) && - info.vertex_inputs_.is_empty()) { + info.vertex_inputs_.is_empty()) + { ss << "in float gpu_dummy_workaround;\n"; } ss << "\n/* Interfaces. */\n"; diff --git a/source/blender/gpu/opengl/gl_shader_log.cc b/source/blender/gpu/opengl/gl_shader_log.cc index 8c7cbbfdcd8..2588beafef4 100644 --- a/source/blender/gpu/opengl/gl_shader_log.cc +++ b/source/blender/gpu/opengl/gl_shader_log.cc @@ -40,14 +40,16 @@ char *GLLogParser::parse_line(char *log_line, GPULogItem &log_item) if ((log_item.cursor.row != -1) && (log_item.cursor.column != -1)) { if (GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_ANY, GPU_DRIVER_OFFICIAL) || GPU_type_matches(GPU_DEVICE_INTEL, GPU_OS_MAC, GPU_DRIVER_OFFICIAL) || - GPU_type_matches(GPU_DEVICE_APPLE, GPU_OS_MAC, GPU_DRIVER_OFFICIAL)) { + GPU_type_matches(GPU_DEVICE_APPLE, GPU_OS_MAC, GPU_DRIVER_OFFICIAL)) + { /* 0:line */ log_item.cursor.row = log_item.cursor.column; log_item.cursor.column = -1; } else if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OFFICIAL) && /* WORKAROUND(@fclem): Both Mesa and AMDGPU-PRO are reported as official. */ - StringRefNull(GPU_platform_version()).find(" Mesa ") == -1) { + StringRefNull(GPU_platform_version()).find(" Mesa ") == -1) + { /* source:row */ log_item.cursor.source = log_item.cursor.row; log_item.cursor.row = log_item.cursor.column; diff --git a/source/blender/gpu/opengl/gl_state.cc b/source/blender/gpu/opengl/gl_state.cc index 22431b922db..3cd77ca5f98 100644 --- a/source/blender/gpu/opengl/gl_state.cc +++ b/source/blender/gpu/opengl/gl_state.cc @@ -160,7 +160,8 @@ void GLStateManager::set_mutable_state(const GPUStateMutable &state) } if (changed.stencil_compare_mask != 0 || changed.stencil_reference != 0 || - changed.stencil_write_mask != 0) { + changed.stencil_write_mask != 0) + { set_stencil_mask((eGPUStencilTest)current_.stencil_test, state); } @@ -453,7 +454,8 @@ void GLStateManager::texture_bind(Texture *tex_, GPUSamplerState sampler_state, } /* Eliminate redundant binds. */ if ((textures_[unit] == tex->tex_id_) && - (samplers_[unit] == GLTexture::get_sampler(sampler_state))) { + (samplers_[unit] == GLTexture::get_sampler(sampler_state))) + { return; } targets_[unit] = tex->target_; diff --git a/source/blender/gpu/opengl/gl_texture.cc b/source/blender/gpu/opengl/gl_texture.cc index 224b81369a5..fd7d60d92d4 100644 --- a/source/blender/gpu/opengl/gl_texture.cc +++ b/source/blender/gpu/opengl/gl_texture.cc @@ -729,7 +729,8 @@ bool GLTexture::proxy_check(int mip) if (GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_WIN, GPU_DRIVER_ANY) || GPU_type_matches(GPU_DEVICE_NVIDIA, GPU_OS_MAC, GPU_DRIVER_OFFICIAL) || - GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OFFICIAL)) { + GPU_type_matches(GPU_DEVICE_ATI, GPU_OS_UNIX, GPU_DRIVER_OFFICIAL)) + { /* Some AMD drivers have a faulty `GL_PROXY_TEXTURE_..` check. * (see #55888, #56185, #59351). * Checking with `GL_PROXY_TEXTURE_..` doesn't prevent `Out Of Memory` issue, @@ -740,7 +741,8 @@ bool GLTexture::proxy_check(int mip) } if ((type_ == GPU_TEXTURE_CUBE_ARRAY) && - GPU_type_matches(GPU_DEVICE_ANY, GPU_OS_MAC, GPU_DRIVER_ANY)) { + GPU_type_matches(GPU_DEVICE_ANY, GPU_OS_MAC, GPU_DRIVER_ANY)) + { /* Special fix for #79703. */ return true; } diff --git a/source/blender/gpu/shaders/common/gpu_shader_smaa_lib.glsl b/source/blender/gpu/shaders/common/gpu_shader_smaa_lib.glsl index 0faade796d6..430fdf47687 100644 --- a/source/blender/gpu/shaders/common/gpu_shader_smaa_lib.glsl +++ b/source/blender/gpu/shaders/common/gpu_shader_smaa_lib.glsl @@ -1127,7 +1127,8 @@ float SMAASearchXLeft(SMAATexture2D(edgesTex), */ float2 e = float2(0.0, 1.0); while (texcoord.x > end && e.g > 0.8281 && // Is there some edge not activated? - e.r == 0.0) { // Or is there a crossing edge that breaks the line? + e.r == 0.0) + { // Or is there a crossing edge that breaks the line? e = SMAASampleLevelZero(edgesTex, texcoord).rg; texcoord = mad(-float2(2.0, 0.0), SMAA_RT_METRICS.xy, texcoord); } @@ -1157,7 +1158,8 @@ float SMAASearchXRight(SMAATexture2D(edgesTex), { float2 e = float2(0.0, 1.0); while (texcoord.x < end && e.g > 0.8281 && // Is there some edge not activated? - e.r == 0.0) { // Or is there a crossing edge that breaks the line? + e.r == 0.0) + { // Or is there a crossing edge that breaks the line? e = SMAASampleLevelZero(edgesTex, texcoord).rg; texcoord = mad(float2(2.0, 0.0), SMAA_RT_METRICS.xy, texcoord); } @@ -1170,7 +1172,8 @@ float SMAASearchYUp(SMAATexture2D(edgesTex), SMAATexture2D(searchTex), float2 te { float2 e = float2(1.0, 0.0); while (texcoord.y > end && e.r > 0.8281 && // Is there some edge not activated? - e.g == 0.0) { // Or is there a crossing edge that breaks the line? + e.g == 0.0) + { // Or is there a crossing edge that breaks the line? e = SMAASampleLevelZero(edgesTex, texcoord).rg; texcoord = mad(-float2(0.0, 2.0), SMAA_RT_METRICS.xy, texcoord); } @@ -1186,7 +1189,8 @@ float SMAASearchYDown(SMAATexture2D(edgesTex), { float2 e = float2(1.0, 0.0); while (texcoord.y < end && e.r > 0.8281 && // Is there some edge not activated? - e.g == 0.0) { // Or is there a crossing edge that breaks the line? + e.g == 0.0) + { // Or is there a crossing edge that breaks the line? e = SMAASampleLevelZero(edgesTex, texcoord).rg; texcoord = mad(float2(0.0, 2.0), SMAA_RT_METRICS.xy, texcoord); } diff --git a/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl index 75caf81f9fe..8e1c7c358dc 100644 --- a/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_2D_nodelink_vert.glsl @@ -111,7 +111,8 @@ void main(void) /* If the link is not muted or is not a reroute arrow the points are squashed to the center of * the line. Magic numbers are defined in drawnode.c */ if ((expand.x == 1.0 && !doMuted) || - (expand.y != 1.0 && (pos.x < 0.70 || pos.x > 0.71) && !doArrow)) { + (expand.y != 1.0 && (pos.x < 0.70 || pos.x > 0.71) && !doArrow)) + { gl_Position.xy *= 0.0; } } diff --git a/source/blender/gpu/shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl b/source/blender/gpu/shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl index 522f6de169d..de180d4d60e 100644 --- a/source/blender/gpu/shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl +++ b/source/blender/gpu/shaders/gpu_shader_image_overlays_stereo_merge_frag.glsl @@ -27,8 +27,8 @@ void main() { ivec2 texel = ivec2(gl_FragCoord.xy); - if (stereo_display_mode == S3D_DISPLAY_INTERLACE && - (interlace(texel) == stereo_interlace_swap)) { + if (stereo_display_mode == S3D_DISPLAY_INTERLACE && (interlace(texel) == stereo_interlace_swap)) + { discard; } diff --git a/source/blender/gpu/shaders/gpu_shader_keyframe_shape_vert.glsl b/source/blender/gpu/shaders/gpu_shader_keyframe_shape_vert.glsl index 22599ca9fe5..5de0c12b6a5 100644 --- a/source/blender/gpu/shaders/gpu_shader_keyframe_shape_vert.glsl +++ b/source/blender/gpu/shaders/gpu_shader_keyframe_shape_vert.glsl @@ -32,7 +32,8 @@ void main() finalFlags = flags; if (!test(GPU_KEYFRAME_SHAPE_DIAMOND | GPU_KEYFRAME_SHAPE_CIRCLE | - GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL | GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL)) { + GPU_KEYFRAME_SHAPE_CLIPPED_VERTICAL | GPU_KEYFRAME_SHAPE_CLIPPED_HORIZONTAL)) + { finalFlags |= GPU_KEYFRAME_SHAPE_DIAMOND; } diff --git a/source/blender/gpu/tests/index_buffer_test.cc b/source/blender/gpu/tests/index_buffer_test.cc index bf1643d84a0..7a44dd6bc8a 100644 --- a/source/blender/gpu/tests/index_buffer_test.cc +++ b/source/blender/gpu/tests/index_buffer_test.cc @@ -27,7 +27,8 @@ static void test_index_buffer_subbuilders() for (int subbuilder_index = 0; subbuilder_index < num_subbuilders; subbuilder_index++) { GPUIndexBufBuilder &subbuilder = subbuilders[subbuilder_index]; for (int subbuilder_vert_index = 0; subbuilder_vert_index < verts_per_subbuilders; - subbuilder_vert_index++) { + subbuilder_vert_index++) + { int vert_index_to_update = subbuilder_index * verts_per_subbuilders + subbuilder_vert_index; GPU_indexbuf_set_point_vert(&subbuilder, vert_index_to_update, vert_index_to_update); } diff --git a/source/blender/gpu/vulkan/vk_framebuffer.cc b/source/blender/gpu/vulkan/vk_framebuffer.cc index 5fe258b67ac..1fdb85a3a39 100644 --- a/source/blender/gpu/vulkan/vk_framebuffer.cc +++ b/source/blender/gpu/vulkan/vk_framebuffer.cc @@ -269,7 +269,8 @@ void VKFrameBuffer::render_pass_create() /* Keep the first attachment to the first color attachment, or to the depth buffer when there * is no color attachment. */ if (attachment.tex != nullptr && - (first_attachment == GPU_FB_MAX_ATTACHMENT || type >= GPU_FB_COLOR_ATTACHMENT0)) { + (first_attachment == GPU_FB_MAX_ATTACHMENT || type >= GPU_FB_COLOR_ATTACHMENT0)) + { first_attachment = static_cast(type); } diff --git a/source/blender/gpu/vulkan/vk_pipeline.cc b/source/blender/gpu/vulkan/vk_pipeline.cc index 1b17c4ed804..bc0d471f5ac 100644 --- a/source/blender/gpu/vulkan/vk_pipeline.cc +++ b/source/blender/gpu/vulkan/vk_pipeline.cc @@ -52,7 +52,8 @@ VKPipeline VKPipeline::create_compute_pipeline( VkPipeline vk_pipeline; if (vkCreateComputePipelines( vk_device, nullptr, 1, &pipeline_info, vk_allocation_callbacks, &vk_pipeline) != - VK_SUCCESS) { + VK_SUCCESS) + { return VKPipeline(); } diff --git a/source/blender/gpu/vulkan/vk_push_constants.hh b/source/blender/gpu/vulkan/vk_push_constants.hh index 843aaa4ede2..b13fce6cb1c 100644 --- a/source/blender/gpu/vulkan/vk_push_constants.hh +++ b/source/blender/gpu/vulkan/vk_push_constants.hh @@ -214,7 +214,8 @@ class VKPushConstants : VKResourceTracker { T *dst = static_cast(static_cast(&bytes[push_constant_layout->offset])); const bool is_tightly_std140_packed = (comp_len % 4) == 0; if (layout_->storage_type_get() == StorageType::PUSH_CONSTANTS || array_size == 0 || - push_constant_layout->array_size == 0 || is_tightly_std140_packed) { + push_constant_layout->array_size == 0 || is_tightly_std140_packed) + { const size_t copy_size_in_bytes = comp_len * max_ii(array_size, 1) * sizeof(T); BLI_assert_msg(push_constant_layout->offset + copy_size_in_bytes <= layout_->size_in_bytes(), "Tried to write outside the push constant allocated memory."); diff --git a/source/blender/gpu/vulkan/vk_shader.cc b/source/blender/gpu/vulkan/vk_shader.cc index 034d08b7b1f..7118a56947f 100644 --- a/source/blender/gpu/vulkan/vk_shader.cc +++ b/source/blender/gpu/vulkan/vk_shader.cc @@ -748,7 +748,8 @@ bool VKShader::finalize_pipeline_layout(VkDevice vk_device, } if (vkCreatePipelineLayout( - vk_device, &pipeline_info, vk_allocation_callbacks, &pipeline_layout_) != VK_SUCCESS) { + vk_device, &pipeline_info, vk_allocation_callbacks, &pipeline_layout_) != VK_SUCCESS) + { return false; }; @@ -942,7 +943,8 @@ bool VKShader::finalize_descriptor_set_layouts(VkDevice vk_device, VkDescriptorSetLayoutCreateInfo layout_info = create_descriptor_set_layout( shader_interface, all_resources, bindings); if (vkCreateDescriptorSetLayout(vk_device, &layout_info, vk_allocation_callbacks, &layout_) != - VK_SUCCESS) { + VK_SUCCESS) + { return false; }; diff --git a/source/blender/ikplugin/intern/itasc_plugin.cpp b/source/blender/ikplugin/intern/itasc_plugin.cpp index 2878bbb6da7..2b708d2af0b 100644 --- a/source/blender/ikplugin/intern/itasc_plugin.cpp +++ b/source/blender/ikplugin/intern/itasc_plugin.cpp @@ -260,7 +260,8 @@ static int initialize_chain(Object *ob, bPoseChannel *pchan_tip, bConstraint *co /* now that we know how many segment we have, set the flag */ for (rootbone = segcount, segcount = 0, curchan = pchan_tip; segcount < rootbone; - segcount++, curchan = curchan->parent) { + segcount++, curchan = curchan->parent) + { chanlist[segcount] = curchan; curchan->flag |= POSE_CHAIN; } @@ -949,17 +950,20 @@ static int convert_channels(struct Depsgraph *depsgraph, flag = 0; if (!(pchan->ikflag & BONE_IK_NO_XDOF) && !(pchan->ikflag & BONE_IK_NO_XDOF_TEMP) && (!(pchan->ikflag & BONE_IK_XLIMIT) || pchan->limitmin[0] < 0.0f || - pchan->limitmax[0] > 0.0f)) { + pchan->limitmax[0] > 0.0f)) + { flag |= IK_XDOF; } if (!(pchan->ikflag & BONE_IK_NO_YDOF) && !(pchan->ikflag & BONE_IK_NO_YDOF_TEMP) && (!(pchan->ikflag & BONE_IK_YLIMIT) || pchan->limitmin[1] < 0.0f || - pchan->limitmax[1] > 0.0f)) { + pchan->limitmax[1] > 0.0f)) + { flag |= IK_YDOF; } if (!(pchan->ikflag & BONE_IK_NO_ZDOF) && !(pchan->ikflag & BONE_IK_NO_ZDOF_TEMP) && (!(pchan->ikflag & BONE_IK_ZLIMIT) || pchan->limitmin[2] < 0.0f || - pchan->limitmax[2] > 0.0f)) { + pchan->limitmax[2] > 0.0f)) + { flag |= IK_ZDOF; } @@ -1069,7 +1073,8 @@ static void convert_pose(IK_Scene *ikscene) rot = ikscene->jointArray(0); for (joint = a = 0, ikchan = ikscene->channels; a < ikscene->numchan && joint < ikscene->numjoint; - a++, ikchan++) { + a++, ikchan++) + { pchan = ikchan->pchan; bone = pchan->bone; @@ -1112,7 +1117,8 @@ static void BKE_pose_rest(IK_Scene *ikscene) rot = ikscene->jointArray(0); for (joint = a = 0, ikchan = ikscene->channels; a < ikscene->numchan && joint < ikscene->numjoint; - a++, ikchan++) { + a++, ikchan++) + { pchan = ikchan->pchan; bone = pchan->bone; @@ -1389,7 +1395,8 @@ static IK_Scene *convert_tree( } } if ((ikchan->jointType & IK_SWING) && - (pchan->ikflag & (BONE_IK_XLIMIT | BONE_IK_ZLIMIT | BONE_IK_ROTCTL))) { + (pchan->ikflag & (BONE_IK_XLIMIT | BONE_IK_ZLIMIT | BONE_IK_ROTCTL))) + { joint = bone->name; joint += ":SW"; if (pchan->ikflag & BONE_IK_XLIMIT) { @@ -1426,7 +1433,8 @@ static IK_Scene *convert_tree( /* for each target, we need to add an end effector in the armature */ for (numtarget = 0, polarcon = nullptr, ret = true, target = (PoseTarget *)tree->targets.first; target; - target = (PoseTarget *)target->next) { + target = (PoseTarget *)target->next) + { condata = (bKinematicConstraint *)target->con->data; pchan = tree->pchan[target->tip]; @@ -1519,7 +1527,8 @@ static IK_Scene *convert_tree( /* add the end effector * estimate the average bone length, used to clamp feedback error */ for (bone_count = 0, bone_length = 0.0f, a = iktarget->channel; a >= 0; - a = tree->parent[a], bone_count++) { + a = tree->parent[a], bone_count++) + { bone_length += ikscene->blScale * tree->pchan[a]->bone->length; } bone_length /= bone_count; @@ -1619,7 +1628,8 @@ static IK_Scene *convert_tree( } } if (!ret || !scene->addCache(ikscene->cache) || !scene->addSolver(ikscene->solver) || - !scene->initialize()) { + !scene->initialize()) + { delete ikscene; ikscene = nullptr; } @@ -1769,7 +1779,8 @@ static void execute_scene(struct Depsgraph *depsgraph, /* how many times do we reiterate? */ for (i = 0; i < ikparam->numiter; i++) { if (ikscene->armature->getMaxJointChange() < ikparam->precision || - ikscene->armature->getMaxEndEffectorChange() < ikparam->precision) { + ikscene->armature->getMaxEndEffectorChange() < ikparam->precision) + { break; } ikscene->scene->update(timestamp, timestep, numstep, true, false, simulation); diff --git a/source/blender/imbuf/intern/anim_movie.c b/source/blender/imbuf/intern/anim_movie.c index b37191c335c..24945530972 100644 --- a/source/blender/imbuf/intern/anim_movie.c +++ b/source/blender/imbuf/intern/anim_movie.c @@ -768,7 +768,8 @@ static int startffmpeg(struct anim *anim) &dstRange, &brightness, &contrast, - &saturation)) { + &saturation)) + { srcRange = srcRange || anim->pCodecCtx->color_range == AVCOL_RANGE_JPEG; inv_table = sws_getCoefficients(anim->pCodecCtx->colorspace); @@ -779,7 +780,8 @@ static int startffmpeg(struct anim *anim) dstRange, brightness, contrast, - saturation)) { + saturation)) + { fprintf(stderr, "Warning: Could not set libswscale colorspace details.\n"); } } @@ -877,7 +879,8 @@ static void ffmpeg_postprocess(struct anim *anim, AVFrame *input) anim->pFrame, anim->pCodecCtx->pix_fmt, anim->pCodecCtx->width, - anim->pCodecCtx->height) < 0) { + anim->pCodecCtx->height) < 0) + { filter_y = true; } else { @@ -1196,8 +1199,8 @@ static int ffmpeg_generic_seek_workaround(struct anim *anim, current_pts = MAX2(current_pts, 0); /* Seek to timestamp. */ - if (av_seek_frame(anim->pFormatCtx, anim->videoStream, current_pts, AVSEEK_FLAG_BACKWARD) < - 0) { + if (av_seek_frame(anim->pFormatCtx, anim->videoStream, current_pts, AVSEEK_FLAG_BACKWARD) < 0) + { break; } diff --git a/source/blender/imbuf/intern/cineon/cineonlib.c b/source/blender/imbuf/intern/cineon/cineonlib.c index 6417d92644f..56012f50a9f 100644 --- a/source/blender/imbuf/intern/cineon/cineonlib.c +++ b/source/blender/imbuf/intern/cineon/cineonlib.c @@ -300,12 +300,14 @@ LogImageFile *cineonOpen(const uchar *byteStuff, int fromMemory, size_t bufferSi } if (cineon->element[i].refLowQuantity == CINEON_UNDEFINED_R32 || - isnan(cineon->element[i].refLowQuantity)) { + isnan(cineon->element[i].refLowQuantity)) + { cineon->element[i].refLowQuantity = 0.0f; } if (cineon->element[i].refHighQuantity == CINEON_UNDEFINED_R32 || - isnan(cineon->element[i].refHighQuantity)) { + isnan(cineon->element[i].refHighQuantity)) + { if (cineon->element[i].transfer == transfer_PrintingDensity) { cineon->element[i].refHighQuantity = 2.048f; } diff --git a/source/blender/imbuf/intern/cineon/dpxlib.c b/source/blender/imbuf/intern/cineon/dpxlib.c index be8fab26301..fade06e7635 100644 --- a/source/blender/imbuf/intern/cineon/dpxlib.c +++ b/source/blender/imbuf/intern/cineon/dpxlib.c @@ -373,7 +373,8 @@ LogImageFile *dpxOpen(const uchar *byteStuff, int fromMemory, size_t bufferSize) if (IS_DPX_UNDEFINED_R32(dpx->referenceBlack) || (dpx->referenceWhite <= dpx->referenceBlack || IS_DPX_UNDEFINED_R32(dpx->referenceWhite)) || - (dpx->gamma <= 0 || IS_DPX_UNDEFINED_R32(dpx->gamma))) { + (dpx->gamma <= 0 || IS_DPX_UNDEFINED_R32(dpx->gamma))) + { dpx->referenceBlack = 95.0f / 1023.0f * dpx->element[0].maxValue; dpx->referenceWhite = 685.0f / 1023.0f * dpx->element[0].maxValue; dpx->gamma = 1.7f; diff --git a/source/blender/imbuf/intern/cineon/logImageCore.c b/source/blender/imbuf/intern/cineon/logImageCore.c index 9ec48447884..fcc1ccf0f07 100644 --- a/source/blender/imbuf/intern/cineon/logImageCore.c +++ b/source/blender/imbuf/intern/cineon/logImageCore.c @@ -242,7 +242,8 @@ int logImageSetDataRGBA(LogImageFile *logImage, float *data, int dataIsLinearRGB } if (convertRGBAToLogElement( - data, elementData, logImage, logImage->element[0], dataIsLinearRGB) != 0) { + data, elementData, logImage, logImage->element[0], dataIsLinearRGB) != 0) + { MEM_freeN(elementData); return 1; } diff --git a/source/blender/imbuf/intern/colormanagement.c b/source/blender/imbuf/intern/colormanagement.c index 9407739e890..88e2c2cc859 100644 --- a/source/blender/imbuf/intern/colormanagement.c +++ b/source/blender/imbuf/intern/colormanagement.c @@ -376,7 +376,8 @@ static uchar *colormanage_cache_get(ImBuf *ibuf, cache_data->exposure != view_settings->exposure || cache_data->gamma != view_settings->gamma || cache_data->dither != view_settings->dither || cache_data->flag != view_settings->flag || cache_data->curve_mapping != curve_mapping || - cache_data->curve_mapping_timestamp != curve_mapping_timestamp) { + cache_data->curve_mapping_timestamp != curve_mapping_timestamp) + { *cache_handle = NULL; IMB_freeImBuf(cache_ibuf); @@ -1733,7 +1734,8 @@ static bool is_ibuf_rect_in_display_space(ImBuf *ibuf, const ColorManagedDisplaySettings *display_settings) { if ((view_settings->flag & COLORMANAGE_VIEW_USE_CURVES) == 0 && - view_settings->exposure == 0.0f && view_settings->gamma == 1.0f) { + view_settings->exposure == 0.0f && view_settings->gamma == 1.0f) + { const char *from_colorspace = ibuf->rect_colorspace->name; const char *to_colorspace = get_display_colorspace_name(view_settings, display_settings); ColorManagedLook *look_descr = colormanage_look_get_named(view_settings->look); @@ -2527,7 +2529,8 @@ ImBuf *IMB_colormanagement_imbuf_for_write(ImBuf *ibuf, /* Update byte buffer if exists but invalid. */ if (ibuf->rect_float && ibuf->rect && - (ibuf->userflags & (IB_DISPLAY_BUFFER_INVALID | IB_RECT_INVALID)) != 0) { + (ibuf->userflags & (IB_DISPLAY_BUFFER_INVALID | IB_RECT_INVALID)) != 0) + { IMB_rect_from_float(ibuf); ibuf->userflags &= ~(IB_RECT_INVALID | IB_DISPLAY_BUFFER_INVALID); } @@ -4019,7 +4022,8 @@ static OCIO_CurveMappingSettings *update_glsl_curve_mapping( OCIO_CurveMappingSettings *curve_mapping_settings = &global_gpu_state.curve_mapping_settings; if (view_settings->curve_mapping->changed_timestamp == global_gpu_state.curve_mapping_timestamp && - view_settings->curve_mapping == global_gpu_state.orig_curve_mapping) { + view_settings->curve_mapping == global_gpu_state.orig_curve_mapping) + { return curve_mapping_settings; } diff --git a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp index 7e147645c98..a97c169e4e2 100644 --- a/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp +++ b/source/blender/imbuf/intern/dds/DirectDrawSurface.cpp @@ -532,7 +532,8 @@ static uint findD3D9Format(uint bitcount, uint rmask, uint gmask, uint bmask, ui for (int i = 0; i < s_d3dFormatCount; i++) { if (s_d3dFormats[i].bitcount == bitcount && s_d3dFormats[i].rmask == rmask && s_d3dFormats[i].gmask == gmask && s_d3dFormats[i].bmask == bmask && - s_d3dFormats[i].amask == amask) { + s_d3dFormats[i].amask == amask) + { return s_d3dFormats[i].format; } } @@ -690,7 +691,8 @@ void DDSHeader::setPixelFormat(uint bitcount, uint rmask, uint gmask, uint bmask { /* Make sure the masks are correct. */ if ((rmask & gmask) || (rmask & bmask) || (rmask & amask) || (gmask & bmask) || - (gmask & amask) || (bmask & amask)) { + (gmask & amask) || (bmask & amask)) + { printf("DDS: bad RGBA masks, pixel format not set\n"); return; } @@ -912,7 +914,8 @@ bool DirectDrawSurface::isSupported() const DXGI_FORMAT_BC2_UNORM, DXGI_FORMAT_BC3_UNORM, DXGI_FORMAT_BC4_UNORM, - DXGI_FORMAT_BC5_UNORM)) { + DXGI_FORMAT_BC5_UNORM)) + { return true; } @@ -928,7 +931,8 @@ bool DirectDrawSurface::isSupported() const FOURCC_DXT5, FOURCC_RXGB, FOURCC_ATI1, - FOURCC_ATI2)) { + FOURCC_ATI2)) + { /* Unknown fourcc code. */ return false; } @@ -941,7 +945,8 @@ bool DirectDrawSurface::isSupported() const } if (isTextureCube() && - (header.caps.caps2 & DDSCAPS2_CUBEMAP_ALL_FACES) != DDSCAPS2_CUBEMAP_ALL_FACES) { + (header.caps.caps2 & DDSCAPS2_CUBEMAP_ALL_FACES) != DDSCAPS2_CUBEMAP_ALL_FACES) + { /* Cube-maps must contain all faces. */ return false; } @@ -968,7 +973,8 @@ bool DirectDrawSurface::hasAlpha() const } if (header.pf.flags & DDPF_FOURCC) { if (header.pf.fourcc == FOURCC_RXGB || header.pf.fourcc == FOURCC_ATI1 || - header.pf.fourcc == FOURCC_ATI2 || header.pf.flags & DDPF_NORMAL) { + header.pf.fourcc == FOURCC_ATI2 || header.pf.flags & DDPF_NORMAL) + { return false; } @@ -1244,7 +1250,8 @@ void DirectDrawSurface::readBlock(ColorBlock *rgba) block.decodeBlock(rgba); } else if (fourcc == FOURCC_DXT4 || header.pf.fourcc == FOURCC_DXT5 || - header.pf.fourcc == FOURCC_RXGB) { + header.pf.fourcc == FOURCC_RXGB) + { BlockDXT5 block; mem_read(stream, block); block.decodeBlock(rgba); diff --git a/source/blender/imbuf/intern/filter.c b/source/blender/imbuf/intern/filter.c index 67de467bd93..5fad6214973 100644 --- a/source/blender/imbuf/intern/filter.c +++ b/source/blender/imbuf/intern/filter.c @@ -395,7 +395,8 @@ static int check_pixel_assigned( res = mask[index] != 0 ? 1 : 0; } else if ((is_float && ((const float *)buffer)[alpha_index] != 0.0f) || - (!is_float && ((const uchar *)buffer)[alpha_index] != 0)) { + (!is_float && ((const uchar *)buffer)[alpha_index] != 0)) + { res = 1; } } @@ -464,7 +465,8 @@ void IMB_filter_extend(struct ImBuf *ibuf, char *mask, int filter) check_pixel_assigned( srcbuf, srcmask, filter_make_index(x, y - 1, width, height), depth, is_float) || check_pixel_assigned( - srcbuf, srcmask, filter_make_index(x, y + 1, width, height), depth, is_float)) { + srcbuf, srcmask, filter_make_index(x, y + 1, width, height), depth, is_float)) + { for (i = -n; i <= n; i++) { for (j = -n; j <= n; j++) { if (i != 0 || j != 0) { diff --git a/source/blender/imbuf/intern/indexer.c b/source/blender/imbuf/intern/indexer.c index 2936f9758c0..fca3972d6c1 100644 --- a/source/blender/imbuf/intern/indexer.c +++ b/source/blender/imbuf/intern/indexer.c @@ -607,7 +607,8 @@ static struct proxy_output_ctx *alloc_proxy_output_ffmpeg( rv->orig_height = st->codecpar->height; if (st->codecpar->width != width || st->codecpar->height != height || - st->codecpar->format != rv->c->pix_fmt) { + st->codecpar->format != rv->c->pix_fmt) + { rv->frame = av_frame_alloc(); av_image_fill_arrays(rv->frame->data, @@ -662,7 +663,8 @@ static void add_to_proxy_output_ffmpeg(struct proxy_output_ctx *ctx, AVFrame *fr } if (ctx->sws_ctx && frame && - (frame->data[0] || frame->data[1] || frame->data[2] || frame->data[3])) { + (frame->data[0] || frame->data[1] || frame->data[2] || frame->data[3])) + { sws_scale(ctx->sws_ctx, (const uint8_t *const *)frame->data, frame->linesize, @@ -908,7 +910,8 @@ static IndexBuildContext *index_ffmpeg_create_context(struct anim *anim, } if (context->proxy_ctx[0] == NULL && context->proxy_ctx[1] == NULL && - context->proxy_ctx[2] == NULL && context->proxy_ctx[3] == NULL) { + context->proxy_ctx[2] == NULL && context->proxy_ctx[3] == NULL) + { avformat_close_input(&context->iFormatCtx); avcodec_free_context(&context->iCodecCtx); MEM_freeN(context); diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c index e2d49cad374..4c237eec161 100644 --- a/source/blender/imbuf/intern/jpeg.c +++ b/source/blender/imbuf/intern/jpeg.c @@ -516,12 +516,14 @@ struct ImBuf *imb_thumbnail_jpeg(const char *filepath, /* If file contains an embedded thumbnail, let's return that instead. */ if ((fgetc(infile) == JPEG_MARKER_MSB) && (fgetc(infile) == JPEG_MARKER_SOI) && - (fgetc(infile) == JPEG_MARKER_MSB) && (fgetc(infile) == JPEG_MARKER_APP1)) { + (fgetc(infile) == JPEG_MARKER_MSB) && (fgetc(infile) == JPEG_MARKER_APP1)) + { /* This is a JPEG in EXIF format (SOI + APP1), not JFIF (SOI + APP0). */ uint i = JPEG_APP1_MAX; /* All EXIF data is within this 64K header segment. Skip ahead until next SOI for thumbnail. */ while (!((fgetc(infile) == JPEG_MARKER_MSB) && (fgetc(infile) == JPEG_MARKER_SOI)) && - !feof(infile) && i--) { + !feof(infile) && i--) + { } if (i > 0 && !feof(infile)) { /* We found a JPEG thumbnail inside this image. */ diff --git a/source/blender/imbuf/intern/oiio/openimageio_support.cc b/source/blender/imbuf/intern/oiio/openimageio_support.cc index c5e958bfc77..6eed397fdb3 100644 --- a/source/blender/imbuf/intern/oiio/openimageio_support.cc +++ b/source/blender/imbuf/intern/oiio/openimageio_support.cc @@ -377,7 +377,8 @@ ImageSpec imb_create_write_spec(const WriteContext &ctx, int file_channels, Type if (ctx.ibuf->metadata) { for (IDProperty *prop = static_cast(ctx.ibuf->metadata->data.group.first); prop; - prop = prop->next) { + prop = prop->next) + { if (prop->type == IDP_STRING) { /* If this property has a prefixed name (oiio:, tiff:, etc.) and it belongs to * oiio or a different format, then skip. */ @@ -385,7 +386,8 @@ ImageSpec imb_create_write_spec(const WriteContext &ctx, int file_channels, Type std::string prefix(prop->name, colon); Strutil::to_lower(prefix); if (prefix == "oiio" || - (!STREQ(prefix.c_str(), ctx.file_format) && OIIO::is_imageio_format_name(prefix))) { + (!STREQ(prefix.c_str(), ctx.file_format) && OIIO::is_imageio_format_name(prefix))) + { /* Skip this attribute. */ continue; } diff --git a/source/blender/imbuf/intern/openexr/openexr_api.cpp b/source/blender/imbuf/intern/openexr/openexr_api.cpp index 00baceff4ac..7e8eaca0e9d 100644 --- a/source/blender/imbuf/intern/openexr/openexr_api.cpp +++ b/source/blender/imbuf/intern/openexr/openexr_api.cpp @@ -1686,14 +1686,16 @@ static bool imb_exr_multilayer_parse_channels_from_file(ExrHandle *data) /* we can have RGB(A), XYZ(W), UVA */ if (ELEM(pass->totchan, 3, 4)) { if (pass->chan[0]->chan_id == 'B' || pass->chan[1]->chan_id == 'B' || - pass->chan[2]->chan_id == 'B') { + pass->chan[2]->chan_id == 'B') + { lookup[uint('R')] = 0; lookup[uint('G')] = 1; lookup[uint('B')] = 2; lookup[uint('A')] = 3; } else if (pass->chan[0]->chan_id == 'Y' || pass->chan[1]->chan_id == 'Y' || - pass->chan[2]->chan_id == 'Y') { + pass->chan[2]->chan_id == 'Y') + { lookup[uint('X')] = 0; lookup[uint('Y')] = 1; lookup[uint('Z')] = 2; diff --git a/source/blender/imbuf/intern/thumbs.c b/source/blender/imbuf/intern/thumbs.c index 061288b90a8..bf24c6c1b35 100644 --- a/source/blender/imbuf/intern/thumbs.c +++ b/source/blender/imbuf/intern/thumbs.c @@ -558,7 +558,8 @@ ImBuf *IMB_thumb_manage(const char *filepath, ThumbSize size, ThumbSource source } if (thumbpathname_from_uri( - uri, thumb_path, sizeof(thumb_path), thumb_name, sizeof(thumb_name), size)) { + uri, thumb_path, sizeof(thumb_path), thumb_name, sizeof(thumb_name), size)) + { if (BLI_path_ncmp(path, thumb_path, sizeof(thumb_path)) == 0) { img = IMB_loadiffname(path, IB_rect, NULL); } @@ -583,7 +584,8 @@ ImBuf *IMB_thumb_manage(const char *filepath, ThumbSize size, ThumbSource source if (use_hash && !regenerate) { if (IMB_metadata_get_field( - img->metadata, "X-Blender::Hash", thumb_hash_curr, sizeof(thumb_hash_curr))) { + img->metadata, "X-Blender::Hash", thumb_hash_curr, sizeof(thumb_hash_curr))) + { regenerate = !STREQ(thumb_hash, thumb_hash_curr); } else { diff --git a/source/blender/imbuf/intern/transform.cc b/source/blender/imbuf/intern/transform.cc index 312ed69db00..35fe4bc4a6e 100644 --- a/source/blender/imbuf/intern/transform.cc +++ b/source/blender/imbuf/intern/transform.cc @@ -127,7 +127,8 @@ struct TransformUserData { int2(src_crop.xmax, src_crop.ymin), int2(src_crop.xmin, src_crop.ymax), int2(src_crop.xmax, src_crop.ymax), - }) { + }) + { float3 dst_co = math::transform_point(inverse, float3(src_coords.x, src_coords.y, 0.0f)); BLI_rcti_do_minmax_v(&rect, int2(dst_co) + margin); BLI_rcti_do_minmax_v(&rect, int2(dst_co) - margin); @@ -381,17 +382,20 @@ class Sampler { void sample(const ImBuf *source, const double2 &uv, SampleType &r_sample) { if constexpr (Filter == IMB_FILTER_BILINEAR && std::is_same_v && - NumChannels == 4) { + NumChannels == 4) + { const double2 wrapped_uv = uv_wrapper.modify_uv(source, uv); bilinear_interpolation_color_fl(source, nullptr, r_sample.data(), UNPACK2(wrapped_uv)); } else if constexpr (Filter == IMB_FILTER_NEAREST && std::is_same_v && - NumChannels == 4) { + NumChannels == 4) + { const double2 wrapped_uv = uv_wrapper.modify_uv(source, uv); nearest_interpolation_color_char(source, r_sample.data(), nullptr, UNPACK2(wrapped_uv)); } else if constexpr (Filter == IMB_FILTER_BILINEAR && std::is_same_v && - NumChannels == 4) { + NumChannels == 4) + { const double2 wrapped_uv = uv_wrapper.modify_uv(source, uv); bilinear_interpolation_color_char(source, r_sample.data(), nullptr, UNPACK2(wrapped_uv)); } @@ -481,19 +485,23 @@ class ChannelConverter { copy_v4_v4_uchar(pixel_pointer.get_pointer(), sample.data()); } else if constexpr (std::is_same_v && SourceNumChannels == 4 && - DestinationNumChannels == 4) { + DestinationNumChannels == 4) + { copy_v4_v4(pixel_pointer.get_pointer(), sample.data()); } else if constexpr (std::is_same_v && SourceNumChannels == 3 && - DestinationNumChannels == 4) { + DestinationNumChannels == 4) + { copy_v4_fl4(pixel_pointer.get_pointer(), sample[0], sample[1], sample[2], 1.0f); } else if constexpr (std::is_same_v && SourceNumChannels == 2 && - DestinationNumChannels == 4) { + DestinationNumChannels == 4) + { copy_v4_fl4(pixel_pointer.get_pointer(), sample[0], sample[1], 0.0f, 1.0f); } else if constexpr (std::is_same_v && SourceNumChannels == 1 && - DestinationNumChannels == 4) { + DestinationNumChannels == 4) + { copy_v4_fl4(pixel_pointer.get_pointer(), sample[0], sample[0], sample[0], 1.0f); } else { @@ -510,7 +518,8 @@ class ChannelConverter { pixel_pointer.get_pointer(), pixel_pointer.get_pointer(), sample.data(), mix_factor); } else if constexpr (std::is_same_v && SourceNumChannels == 4 && - DestinationNumChannels == 4) { + DestinationNumChannels == 4) + { blend_color_interpolate_float( pixel_pointer.get_pointer(), pixel_pointer.get_pointer(), sample.data(), mix_factor); } diff --git a/source/blender/imbuf/intern/util.c b/source/blender/imbuf/intern/util.c index 1543ac1c7f2..5923c47ab70 100644 --- a/source/blender/imbuf/intern/util.c +++ b/source/blender/imbuf/intern/util.c @@ -249,7 +249,8 @@ static int isffmpeg(const char *filepath) ".exr", ".cin", ".wav", - NULL)) { + NULL)) + { return 0; } @@ -276,7 +277,8 @@ static int isffmpeg(const char *filepath) videoStream = -1; for (i = 0; i < pFormatCtx->nb_streams; i++) { if (pFormatCtx->streams[i] && pFormatCtx->streams[i]->codecpar && - (pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)) { + (pFormatCtx->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)) + { videoStream = i; break; } diff --git a/source/blender/imbuf/intern/util_gpu.c b/source/blender/imbuf/intern/util_gpu.c index 5128776d0d6..fc8800d3081 100644 --- a/source/blender/imbuf/intern/util_gpu.c +++ b/source/blender/imbuf/intern/util_gpu.c @@ -32,7 +32,8 @@ static bool imb_is_grayscale_texture_format_compatible(const ImBuf *ibuf) * to the scene color space can be uploaded as single channel textures. */ if (IMB_colormanagement_space_is_data(ibuf->rect_colorspace) || IMB_colormanagement_space_is_srgb(ibuf->rect_colorspace) || - IMB_colormanagement_space_is_scene_linear(ibuf->rect_colorspace)) { + IMB_colormanagement_space_is_scene_linear(ibuf->rect_colorspace)) + { return true; }; return false; @@ -56,7 +57,8 @@ static void imb_gpu_get_format(const ImBuf *ibuf, } else { if (IMB_colormanagement_space_is_data(ibuf->rect_colorspace) || - IMB_colormanagement_space_is_scene_linear(ibuf->rect_colorspace)) { + IMB_colormanagement_space_is_scene_linear(ibuf->rect_colorspace)) + { /* Non-color data or scene linear, just store buffer as is. */ *r_data_format = GPU_DATA_UBYTE; *r_texture_format = (is_grayscale) ? GPU_R8 : GPU_RGBA8; @@ -142,7 +144,8 @@ static void *imb_gpu_get_data(const ImBuf *ibuf, /* Non-color data, just store buffer as is. */ } else if (IMB_colormanagement_space_is_srgb(ibuf->rect_colorspace) || - IMB_colormanagement_space_is_scene_linear(ibuf->rect_colorspace)) { + IMB_colormanagement_space_is_scene_linear(ibuf->rect_colorspace)) + { /* sRGB or scene linear, store as byte texture that the GPU can decode directly. */ data_rect = MEM_mallocN( (is_grayscale ? sizeof(float[4]) : sizeof(uchar[4])) * ibuf->x * ibuf->y, __func__); diff --git a/source/blender/imbuf/intern/webp.c b/source/blender/imbuf/intern/webp.c index abf915b1b8e..f8be455a310 100644 --- a/source/blender/imbuf/intern/webp.c +++ b/source/blender/imbuf/intern/webp.c @@ -99,7 +99,8 @@ struct ImBuf *imb_load_filepath_thumbnail_webp(const char *filepath, WebPDecoderConfig config; if (!data || !WebPInitDecoderConfig(&config) || - WebPGetFeatures(data, data_size, &config.input) != VP8_STATUS_OK) { + WebPGetFeatures(data, data_size, &config.input) != VP8_STATUS_OK) + { fprintf(stderr, "WebP: Invalid file\n"); imb_mmap_lock(); BLI_mmap_free(mmap_file); diff --git a/source/blender/io/alembic/exporter/abc_writer_mesh.cc b/source/blender/io/alembic/exporter/abc_writer_mesh.cc index 84fcffa3b96..74c606208da 100644 --- a/source/blender/io/alembic/exporter/abc_writer_mesh.cc +++ b/source/blender/io/alembic/exporter/abc_writer_mesh.cc @@ -537,7 +537,8 @@ static void get_loop_normals(struct Mesh *mesh, /* If all polygons are smooth shaded, and there are no custom normals, we don't need to export * normals at all. This is also done by other software, see #71246. */ if (!has_flat_shaded_poly && !CustomData_has_layer(&mesh->ldata, CD_CUSTOMLOOPNORMAL) && - (mesh->flag & ME_AUTOSMOOTH) == 0) { + (mesh->flag & ME_AUTOSMOOTH) == 0) + { return; } diff --git a/source/blender/io/alembic/intern/abc_reader_camera.cc b/source/blender/io/alembic/intern/abc_reader_camera.cc index e7a319730b6..6db1c9827b1 100644 --- a/source/blender/io/alembic/intern/abc_reader_camera.cc +++ b/source/blender/io/alembic/intern/abc_reader_camera.cc @@ -69,7 +69,8 @@ void AbcCameraReader::readObjectData(Main *bmain, const ISampleSelector &sample_ ICompoundProperty customDataContainer = m_schema.getUserProperties(); if (customDataContainer.valid() && customDataContainer.getPropertyHeader("stereoDistance") && - customDataContainer.getPropertyHeader("eyeSeparation")) { + customDataContainer.getPropertyHeader("eyeSeparation")) + { IFloatProperty convergence_plane(customDataContainer, "stereoDistance"); IFloatProperty eye_separation(customDataContainer, "eyeSeparation"); diff --git a/source/blender/io/alembic/intern/abc_reader_mesh.cc b/source/blender/io/alembic/intern/abc_reader_mesh.cc index 4c673260802..6f9ee4c88c5 100644 --- a/source/blender/io/alembic/intern/abc_reader_mesh.cc +++ b/source/blender/io/alembic/intern/abc_reader_mesh.cc @@ -143,8 +143,8 @@ static void read_mverts(CDStreamConfig &config, const AbcMeshData &mesh_data) const P3fArraySamplePtr &positions = mesh_data.positions; if (config.use_vertex_interpolation && config.weight != 0.0f && - mesh_data.ceil_positions != nullptr && - mesh_data.ceil_positions->size() == positions->size()) { + mesh_data.ceil_positions != nullptr && mesh_data.ceil_positions->size() == positions->size()) + { read_mverts_interp(vert_positions, positions, mesh_data.ceil_positions, config.weight); BKE_mesh_tag_positions_changed(config.mesh); return; @@ -732,7 +732,8 @@ Mesh *AbcMeshReader::read_mesh(Mesh *existing_mesh, * This prevents crash from #49813. * TODO(kevin): perhaps find a better way to do this? */ if (face_counts->size() != existing_mesh->totpoly || - face_indices->size() != existing_mesh->totloop) { + face_indices->size() != existing_mesh->totloop) + { settings.read_flag = MOD_MESHSEQ_READ_VERT; if (err_str) { @@ -882,8 +883,8 @@ static void read_vertex_creases(Mesh *mesh, const Int32ArraySamplePtr &indices, const FloatArraySamplePtr &sharpnesses) { - if (!(indices && sharpnesses && indices->size() == sharpnesses->size() && - indices->size() != 0)) { + if (!(indices && sharpnesses && indices->size() == sharpnesses->size() && indices->size() != 0)) + { return; } @@ -1065,7 +1066,8 @@ Mesh *AbcSubDReader::read_mesh(Mesh *existing_mesh, * This prevents crash from #49813. * TODO(kevin): perhaps find a better way to do this? */ if (face_counts->size() != existing_mesh->totpoly || - face_indices->size() != existing_mesh->totloop) { + face_indices->size() != existing_mesh->totloop) + { settings.read_flag = MOD_MESHSEQ_READ_VERT; if (err_str) { diff --git a/source/blender/io/avi/intern/avi.c b/source/blender/io/avi/intern/avi.c index 3da93f51cfc..4c3daf02046 100644 --- a/source/blender/io/avi/intern/avi.c +++ b/source/blender/io/avi/intern/avi.c @@ -211,7 +211,8 @@ bool AVI_is_avi(const char *name) if (GET_FCC(movie.fp) != FCC("AVI ") || GET_FCC(movie.fp) != FCC("LIST") || !GET_FCC(movie.fp) || GET_FCC(movie.fp) != FCC("hdrl") || (movie.header->fcc = GET_FCC(movie.fp)) != FCC("avih") || - !(movie.header->size = GET_FCC(movie.fp))) { + !(movie.header->size = GET_FCC(movie.fp))) + { DEBUG_PRINT("bad initial header info\n"); fclose(movie.fp); return 0; @@ -250,7 +251,8 @@ bool AVI_is_avi(const char *name) if (GET_FCC(movie.fp) != FCC("LIST") || !GET_FCC(movie.fp) || GET_FCC(movie.fp) != FCC("strl") || (movie.streams[temp].sh.fcc = GET_FCC(movie.fp)) != FCC("strh") || - !(movie.streams[temp].sh.size = GET_FCC(movie.fp))) { + !(movie.streams[temp].sh.size = GET_FCC(movie.fp))) + { DEBUG_PRINT("bad stream header information\n"); MEM_freeN(movie.streams); @@ -265,7 +267,8 @@ bool AVI_is_avi(const char *name) if (movie.streams[temp].sh.Type == FCC("vids")) { if (fcca == FCC("DIB ") || fcca == FCC("RGB ") || fcca == FCC("rgb ") || - fcca == FCC("RAW ") || fcca == 0) { + fcca == FCC("RAW ") || fcca == 0) + { movie.streams[temp].format = AVI_FORMAT_AVI_RGB; } else if (fcca == FCC("mjpg") || fcca == FCC("MJPG")) { @@ -331,7 +334,8 @@ bool AVI_is_avi(const char *name) if (movie.streams[temp].format == AVI_FORMAT_AVI_RGB) { if (fcca == FCC("DIB ") || fcca == FCC("RGB ") || fcca == FCC("rgb ") || - fcca == FCC("RAW ") || fcca == 0) { + fcca == FCC("RAW ") || fcca == 0) + { /* pass */ } else if (fcca == FCC("mjpg") || fcca == FCC("MJPG")) { @@ -400,7 +404,8 @@ AviError AVI_open_movie(const char *name, AviMovie *movie) if (GET_FCC(movie->fp) != FCC("AVI ") || GET_FCC(movie->fp) != FCC("LIST") || !GET_FCC(movie->fp) || GET_FCC(movie->fp) != FCC("hdrl") || (movie->header->fcc = GET_FCC(movie->fp)) != FCC("avih") || - !(movie->header->size = GET_FCC(movie->fp))) { + !(movie->header->size = GET_FCC(movie->fp))) + { DEBUG_PRINT("bad initial header info\n"); return AVI_ERROR_FORMAT; } @@ -437,7 +442,8 @@ AviError AVI_open_movie(const char *name, AviMovie *movie) if (GET_FCC(movie->fp) != FCC("LIST") || !GET_FCC(movie->fp) || GET_FCC(movie->fp) != FCC("strl") || (movie->streams[temp].sh.fcc = GET_FCC(movie->fp)) != FCC("strh") || - !(movie->streams[temp].sh.size = GET_FCC(movie->fp))) { + !(movie->streams[temp].sh.size = GET_FCC(movie->fp))) + { DEBUG_PRINT("bad stream header information\n"); return AVI_ERROR_FORMAT; } @@ -449,7 +455,8 @@ AviError AVI_open_movie(const char *name, AviMovie *movie) if (movie->streams[temp].sh.Type == FCC("vids")) { if (fcca == FCC("DIB ") || fcca == FCC("RGB ") || fcca == FCC("rgb ") || - fcca == FCC("RAW ") || fcca == 0) { + fcca == FCC("RAW ") || fcca == 0) + { movie->streams[temp].format = AVI_FORMAT_AVI_RGB; } else if (fcca == FCC("mjpg") || fcca == FCC("MJPG")) { @@ -511,7 +518,8 @@ AviError AVI_open_movie(const char *name, AviMovie *movie) if (movie->streams[temp].format == AVI_FORMAT_AVI_RGB) { if (fcca == FCC("DIB ") || fcca == FCC("RGB ") || fcca == FCC("rgb ") || - fcca == FCC("RAW ") || fcca == 0) { + fcca == FCC("RAW ") || fcca == 0) + { /* pass */ } else if (fcca == FCC("mjpg") || fcca == FCC("MJPG")) { diff --git a/source/blender/io/collada/AnimationClipExporter.cpp b/source/blender/io/collada/AnimationClipExporter.cpp index a59418c6b18..39542282ebc 100644 --- a/source/blender/io/collada/AnimationClipExporter.cpp +++ b/source/blender/io/collada/AnimationClipExporter.cpp @@ -10,8 +10,8 @@ void AnimationClipExporter::exportAnimationClips(Scene *sce) std::map clips; std::vector>::iterator anim_meta_entry; - for (anim_meta_entry = anim_meta.begin(); anim_meta_entry != anim_meta.end(); - ++anim_meta_entry) { + for (anim_meta_entry = anim_meta.begin(); anim_meta_entry != anim_meta.end(); ++anim_meta_entry) + { std::vector entry = *anim_meta_entry; std::string action_id = entry[0]; std::string action_name = entry[1]; diff --git a/source/blender/io/collada/AnimationImporter.cpp b/source/blender/io/collada/AnimationImporter.cpp index d1568be3b24..6c116a4ab17 100644 --- a/source/blender/io/collada/AnimationImporter.cpp +++ b/source/blender/io/collada/AnimationImporter.cpp @@ -101,7 +101,8 @@ void AnimationImporter::animation_to_fcurves(COLLADAFW::AnimationCurve *curve) bez.h1 = bez.h2 = HD_AUTO; if (curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_BEZIER || - curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_STEP) { + curve->getInterpolationType() == COLLADAFW::AnimationCurve::INTERPOLATION_STEP) + { COLLADAFW::FloatOrDoubleArray &intan = curve->getInTangentValues(); COLLADAFW::FloatOrDoubleArray &outtan = curve->getOutTangentValues(); @@ -715,7 +716,8 @@ void AnimationImporter::Assign_float_animations(const COLLADAFW::UniqueId &listi * Reason: old blender versions stored spot_size in radians (was a bug) */ if (this->import_from_version.empty() || - BLI_strcasecmp_natural(this->import_from_version.c_str(), "2.69.10") != -1) { + BLI_strcasecmp_natural(this->import_from_version.c_str(), "2.69.10") != -1) + { fcurve_deg_to_rad(fcu); } } @@ -1888,7 +1890,8 @@ bool AnimationImporter::evaluate_animation(COLLADAFW::Transformation *tm, COLLADAFW::Transformation::ROTATE, COLLADAFW::Transformation::SCALE, COLLADAFW::Transformation::TRANSLATE, - COLLADAFW::Transformation::MATRIX)) { + COLLADAFW::Transformation::MATRIX)) + { fprintf(stderr, "animation of transformation %d is not supported yet\n", type); return false; } diff --git a/source/blender/io/collada/ArmatureImporter.cpp b/source/blender/io/collada/ArmatureImporter.cpp index 7de08f89b7d..5402d08d075 100644 --- a/source/blender/io/collada/ArmatureImporter.cpp +++ b/source/blender/io/collada/ArmatureImporter.cpp @@ -624,7 +624,8 @@ Object *ArmatureImporter::create_armature_bones(Main *bmain, SkinInfo &skin) COLLADAFW::Node *node = *ri; /* for shared armature check if bone tree is already created */ if (shared && std::find(skin_root_joints.begin(), skin_root_joints.end(), node) != - skin_root_joints.end()) { + skin_root_joints.end()) + { continue; } diff --git a/source/blender/io/collada/DocumentExporter.cpp b/source/blender/io/collada/DocumentExporter.cpp index 98e4febe814..7339dbfe273 100644 --- a/source/blender/io/collada/DocumentExporter.cpp +++ b/source/blender/io/collada/DocumentExporter.cpp @@ -275,8 +275,8 @@ int DocumentExporter::exportCurrentScene() /* */ ArmatureExporter arm_exporter(blender_context, writer, this->export_settings); ControllerExporter controller_exporter(blender_context, writer, this->export_settings); - if (bc_has_object_type(export_set, OB_ARMATURE) || - this->export_settings.get_include_shapekeys()) { + if (bc_has_object_type(export_set, OB_ARMATURE) || this->export_settings.get_include_shapekeys()) + { controller_exporter.export_controllers(); } diff --git a/source/blender/io/collada/DocumentImporter.cpp b/source/blender/io/collada/DocumentImporter.cpp index fc6316e97a8..f80fd7f7c38 100644 --- a/source/blender/io/collada/DocumentImporter.cpp +++ b/source/blender/io/collada/DocumentImporter.cpp @@ -599,7 +599,8 @@ std::vector *DocumentImporter::write_node(COLLADAFW::Node *node, pair_iter = object_map.equal_range(node_id); for (std::multimap::iterator it2 = pair_iter.first; it2 != pair_iter.second; - it2++) { + it2++) + { Object *source_ob = (Object *)it2->second; COLLADAFW::Node *source_node = node_map[node_id]; ob = create_instance_node(source_ob, source_node, node, sce, is_library_node); diff --git a/source/blender/io/collada/ErrorHandler.cpp b/source/blender/io/collada/ErrorHandler.cpp index f60c027a1e2..18a7fe4d7d6 100644 --- a/source/blender/io/collada/ErrorHandler.cpp +++ b/source/blender/io/collada/ErrorHandler.cpp @@ -37,7 +37,8 @@ bool ErrorHandler::handleError(const COLLADASaxFWL::IError *error) error_message = parserError.getErrorMessage(); if (parserError.getErrorType() == - GeneratedSaxParser::ParserError::ERROR_VALIDATION_MIN_OCCURS_UNMATCHED) { + GeneratedSaxParser::ParserError::ERROR_VALIDATION_MIN_OCCURS_UNMATCHED) + { if (STREQ(parserError.getElement(), "effect")) { isError = false; } @@ -45,9 +46,11 @@ bool ErrorHandler::handleError(const COLLADASaxFWL::IError *error) else if (parserError.getErrorType() == GeneratedSaxParser::ParserError:: - ERROR_VALIDATION_SEQUENCE_PREVIOUS_SIBLING_NOT_PRESENT) { + ERROR_VALIDATION_SEQUENCE_PREVIOUS_SIBLING_NOT_PRESENT) + { if (!(STREQ(parserError.getElement(), "extra") && - STREQ(parserError.getAdditionalText().c_str(), "sibling: fx_profile_abstract"))) { + STREQ(parserError.getAdditionalText().c_str(), "sibling: fx_profile_abstract"))) + { isError = false; } } @@ -59,7 +62,8 @@ bool ErrorHandler::handleError(const COLLADASaxFWL::IError *error) } else if (parserError.getErrorType() == - GeneratedSaxParser::ParserError::ERROR_REQUIRED_ATTRIBUTE_MISSING) { + GeneratedSaxParser::ParserError::ERROR_REQUIRED_ATTRIBUTE_MISSING) + { isError = true; } diff --git a/source/blender/io/collada/MeshImporter.cpp b/source/blender/io/collada/MeshImporter.cpp index 6071e429b0a..22cc7d9066b 100644 --- a/source/blender/io/collada/MeshImporter.cpp +++ b/source/blender/io/collada/MeshImporter.cpp @@ -682,7 +682,8 @@ void MeshImporter::read_polys(COLLADAFW::Mesh *collada_mesh, if (ELEM(collada_meshtype, COLLADAFW::MeshPrimitive::POLYLIST, COLLADAFW::MeshPrimitive::POLYGONS, - COLLADAFW::MeshPrimitive::TRIANGLES)) { + COLLADAFW::MeshPrimitive::TRIANGLES)) + { COLLADAFW::Polygons *mpvc = (COLLADAFW::Polygons *)mp; uint start_index = 0; diff --git a/source/blender/io/collada/collada_utils.cpp b/source/blender/io/collada/collada_utils.cpp index 579bba3839a..6a65b27a93d 100644 --- a/source/blender/io/collada/collada_utils.cpp +++ b/source/blender/io/collada/collada_utils.cpp @@ -865,7 +865,8 @@ bool bc_has_animations(Object *ob) /* Check for object, light and camera transform animations */ if ((bc_getSceneObjectAction(ob) && bc_getSceneObjectAction(ob)->curves.first) || (bc_getSceneLightAction(ob) && bc_getSceneLightAction(ob)->curves.first) || - (bc_getSceneCameraAction(ob) && bc_getSceneCameraAction(ob)->curves.first)) { + (bc_getSceneCameraAction(ob) && bc_getSceneCameraAction(ob)->curves.first)) + { return true; } @@ -964,7 +965,8 @@ void bc_create_restpose_mat(BCExportSettings &export_settings, if (!has_custom_props(bone, export_settings.get_keep_bind_info(), "restpose_loc") && !has_custom_props(bone, export_settings.get_keep_bind_info(), "restpose_rot") && - !has_custom_props(bone, export_settings.get_keep_bind_info(), "restpose_scale")) { + !has_custom_props(bone, export_settings.get_keep_bind_info(), "restpose_scale")) + { /* No need */ copy_m4_m4(to_mat, from_mat); return; diff --git a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc index e9378e6c225..583f6f4ce84 100644 --- a/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc +++ b/source/blender/io/gpencil/intern/gpencil_io_export_pdf.cc @@ -156,7 +156,8 @@ void GpencilExporterPDF::export_gpencil_layers() const float stroke_opacity = stroke_color_[3] * stroke_average_opacity_get() * gpl->opacity; if ((fill_opacity < GPENCIL_ALPHA_OPACITY_THRESH) && - (stroke_opacity < GPENCIL_ALPHA_OPACITY_THRESH)) { + (stroke_opacity < GPENCIL_ALPHA_OPACITY_THRESH)) + { continue; } diff --git a/source/blender/io/usd/intern/usd_reader_material.cc b/source/blender/io/usd/intern/usd_reader_material.cc index 5de28d0f197..d26c183acd0 100644 --- a/source/blender/io/usd/intern/usd_reader_material.cc +++ b/source/blender/io/usd/intern/usd_reader_material.cc @@ -125,7 +125,8 @@ static pxr::SdfLayerHandle get_layer_handle(const pxr::UsdAttribute &attribute) { for (auto PropertySpec : attribute.GetPropertyStack(pxr::UsdTimeCode::EarliestTime())) { if (PropertySpec->HasDefaultValue() || - PropertySpec->GetLayer()->GetNumTimeSamplesForPath(PropertySpec->GetPath()) > 0) { + PropertySpec->GetLayer()->GetNumTimeSamplesForPath(PropertySpec->GetPath()) > 0) + { return PropertySpec->GetLayer(); } } @@ -212,7 +213,8 @@ static float get_opacity_threshold(const pxr::UsdShadeShader &usd_shader, pxr::VtValue val; if (opacity_threshold_input.GetAttr().HasAuthoredValue() && - opacity_threshold_input.GetAttr().Get(&val)) { + opacity_threshold_input.GetAttr().Get(&val)) + { return val.Get(); } @@ -272,7 +274,8 @@ static void set_viewport_material_props(Material *mtl, const pxr::UsdShadeShader if (pxr::UsdShadeInput diffuse_color_input = usd_preview.GetInput(usdtokens::diffuseColor)) { pxr::VtValue val; if (diffuse_color_input.GetAttr().HasAuthoredValue() && - diffuse_color_input.GetAttr().Get(&val) && val.IsHolding()) { + diffuse_color_input.GetAttr().Get(&val) && val.IsHolding()) + { pxr::GfVec3f color = val.UncheckedGet(); mtl->r = color[0]; mtl->g = color[1]; @@ -283,7 +286,8 @@ static void set_viewport_material_props(Material *mtl, const pxr::UsdShadeShader if (pxr::UsdShadeInput metallic_input = usd_preview.GetInput(usdtokens::metallic)) { pxr::VtValue val; if (metallic_input.GetAttr().HasAuthoredValue() && metallic_input.GetAttr().Get(&val) && - val.IsHolding()) { + val.IsHolding()) + { mtl->metallic = val.Get(); } } @@ -291,7 +295,8 @@ static void set_viewport_material_props(Material *mtl, const pxr::UsdShadeShader if (pxr::UsdShadeInput roughness_input = usd_preview.GetInput(usdtokens::roughness)) { pxr::VtValue val; if (roughness_input.GetAttr().HasAuthoredValue() && roughness_input.GetAttr().Get(&val) && - val.IsHolding()) { + val.IsHolding()) + { mtl->roughness = val.Get(); } } @@ -456,7 +461,8 @@ void USDMaterialReader::set_principled_node_inputs(bNode *principled, } if (pxr::UsdShadeInput clearcoat_roughness_input = usd_shader.GetInput( - usdtokens::clearcoatRoughness)) { + usdtokens::clearcoatRoughness)) + { set_node_input( clearcoat_roughness_input, principled, "Clearcoat Roughness", ntree, column, &context); } @@ -750,7 +756,8 @@ void USDMaterialReader::load_tex_image(const pxr::UsdShadeShader &usd_shader, } if (import_textures && params_.import_textures_mode == USD_TEX_IMPORT_PACK && - !BKE_image_has_packedfile(image)) { + !BKE_image_has_packedfile(image)) + { BKE_image_packfiles(nullptr, image, ID_BLEND_PATH(bmain_, &image->id)); if (BLI_is_dir(temp_textures_dir())) { BLI_delete(temp_textures_dir(), true, true); diff --git a/source/blender/io/usd/intern/usd_reader_mesh.cc b/source/blender/io/usd/intern/usd_reader_mesh.cc index 79c382581e1..96b14a48f90 100644 --- a/source/blender/io/usd/intern/usd_reader_mesh.cc +++ b/source/blender/io/usd/intern/usd_reader_mesh.cc @@ -93,7 +93,8 @@ static void assign_materials(Main *bmain, for (std::map::const_iterator it = mat_index_map.begin(); it != mat_index_map.end(); - ++it) { + ++it) + { Material *assigned_mat = blender::io::usd::find_existing_material( it->first, params, mat_name_to_mat, usd_path_to_mat_name); @@ -336,7 +337,8 @@ void USDMeshReader::read_uvs(Mesh *mesh, const double motionSampleTime, const bo } /* Early out if not first load and UVs aren't animated. */ if (!load_uvs && primvar_varying_map_.find(uv_token) != primvar_varying_map_.end() && - !primvar_varying_map_.at(uv_token)) { + !primvar_varying_map_.at(uv_token)) + { continue; } @@ -378,9 +380,9 @@ void USDMeshReader::read_uvs(Mesh *mesh, const double motionSampleTime, const bo const UVSample &sample = uv_primvars[layer_idx]; - if (!ELEM(sample.interpolation, - pxr::UsdGeomTokens->faceVarying, - pxr::UsdGeomTokens->vertex)) { + if (!ELEM( + sample.interpolation, pxr::UsdGeomTokens->faceVarying, pxr::UsdGeomTokens->vertex)) + { std::cerr << "WARNING: unexpected interpolation type " << sample.interpolation << " for uv " << layer->name << std::endl; continue; @@ -433,7 +435,8 @@ void USDMeshReader::read_color_data_all_primvars(Mesh *mesh, const double motion if (!ELEM(type, pxr::SdfValueTypeNames->Color3hArray, pxr::SdfValueTypeNames->Color3fArray, - pxr::SdfValueTypeNames->Color3dArray)) { + pxr::SdfValueTypeNames->Color3dArray)) + { continue; } @@ -494,7 +497,8 @@ void USDMeshReader::read_color_data_primvar(Mesh *mesh, (interp == pxr::UsdGeomTokens->varying && usd_colors.size() != mesh->totloop) || (interp == pxr::UsdGeomTokens->vertex && usd_colors.size() != mesh->totvert) || (interp == pxr::UsdGeomTokens->constant && usd_colors.size() != 1) || - (interp == pxr::UsdGeomTokens->uniform && usd_colors.size() != mesh->totpoly)) { + (interp == pxr::UsdGeomTokens->uniform && usd_colors.size() != mesh->totpoly)) + { WM_reportf(RPT_WARNING, "USD Import: color attribute value '%s' count inconsistent with interpolation type", color_primvar.GetName().GetText()); @@ -509,7 +513,8 @@ void USDMeshReader::read_color_data_primvar(Mesh *mesh, if (ELEM(interp, pxr::UsdGeomTokens->varying, pxr::UsdGeomTokens->faceVarying, - pxr::UsdGeomTokens->uniform)) { + pxr::UsdGeomTokens->uniform)) + { color_domain = ATTR_DOMAIN_CORNER; } @@ -531,7 +536,8 @@ void USDMeshReader::read_color_data_primvar(Mesh *mesh, else { /* Check for situations that allow for a straight-forward copy by index. */ if ((ELEM(interp, pxr::UsdGeomTokens->vertex)) || - (color_domain == ATTR_DOMAIN_CORNER && !is_left_handed_)) { + (color_domain == ATTR_DOMAIN_CORNER && !is_left_handed_)) + { for (int i = 0; i < usd_colors.size(); i++) { ColorGeometry4f color = ColorGeometry4f( usd_colors[i][0], usd_colors[i][1], usd_colors[i][2], 1.0f); @@ -756,7 +762,8 @@ void USDMeshReader::read_mesh_sample(ImportSettings *settings, /* Process point normals after reading polys. */ if ((settings->read_flag & MOD_MESHSEQ_READ_VERT) != 0 && - normal_interpolation_ == pxr::UsdGeomTokens->vertex) { + normal_interpolation_ == pxr::UsdGeomTokens->vertex) + { process_normals_vertex_varying(mesh); } @@ -899,7 +906,8 @@ Mesh *USDMeshReader::read_mesh(Mesh *existing_mesh, if (ELEM(type, pxr::SdfValueTypeNames->TexCoord2hArray, pxr::SdfValueTypeNames->TexCoord2fArray, - pxr::SdfValueTypeNames->TexCoord2dArray)) { + pxr::SdfValueTypeNames->TexCoord2dArray)) + { is_uv = true; } /* In some cases, the st primvar is stored as float2 values. */ diff --git a/source/blender/io/usd/intern/usd_reader_stage.cc b/source/blender/io/usd/intern/usd_reader_stage.cc index 6dfd75064be..b2d763f6b48 100644 --- a/source/blender/io/usd/intern/usd_reader_stage.cc +++ b/source/blender/io/usd/intern/usd_reader_stage.cc @@ -88,8 +88,9 @@ USDPrimReader *USDStageReader::create_reader_if_allowed(const pxr::UsdPrim &prim return new USDMeshReader(prim, params_, settings_); } #if PXR_VERSION >= 2111 - if (params_.import_lights && (prim.IsA() || - prim.IsA())) { + if (params_.import_lights && + (prim.IsA() || prim.IsA())) + { #else if (params_.import_lights && prim.IsA()) { #endif @@ -336,7 +337,8 @@ void USDStageReader::import_all_materials(Main *bmain) } if (blender::io::usd::find_existing_material( - prim.GetPath(), params_, settings_.mat_name_to_mat, settings_.usd_path_to_mat_name)) { + prim.GetPath(), params_, settings_.mat_name_to_mat, settings_.usd_path_to_mat_name)) + { /* The material already exists. */ continue; } @@ -362,7 +364,8 @@ void USDStageReader::fake_users_for_unused_materials() /* Iterate over the imported materials and set a fake user for any unused * materials. */ for (const std::pair &path_mat_pair : - settings_.usd_path_to_mat_name) { + settings_.usd_path_to_mat_name) + { std::map::iterator mat_it = settings_.mat_name_to_mat.find( path_mat_pair.second); diff --git a/source/blender/io/usd/intern/usd_writer_mesh.cc b/source/blender/io/usd/intern/usd_writer_mesh.cc index e4c5332c6ee..5b4c5bec528 100644 --- a/source/blender/io/usd/intern/usd_writer_mesh.cc +++ b/source/blender/io/usd/intern/usd_writer_mesh.cc @@ -82,7 +82,8 @@ void USDGenericMeshWriter::write_custom_data(const Mesh *mesh, pxr::UsdGeomMesh [&](const bke::AttributeIDRef &attribute_id, const bke::AttributeMetaData &meta_data) { /* Color data. */ if (ELEM(meta_data.domain, ATTR_DOMAIN_CORNER, ATTR_DOMAIN_POINT) && - ELEM(meta_data.data_type, CD_PROP_BYTE_COLOR, CD_PROP_COLOR)) { + ELEM(meta_data.data_type, CD_PROP_BYTE_COLOR, CD_PROP_COLOR)) + { write_color_data(mesh, usd_mesh, attribute_id, meta_data); } @@ -281,7 +282,8 @@ void USDGenericMeshWriter::write_mesh(HierarchyContext &context, Mesh *mesh) } if (!usd_mesh_data.corner_indices.empty() && - usd_mesh_data.corner_indices.size() == usd_mesh_data.corner_sharpnesses.size()) { + usd_mesh_data.corner_indices.size() == usd_mesh_data.corner_sharpnesses.size()) + { pxr::UsdAttribute attr_corner_indices = usd_mesh.CreateCornerIndicesAttr(pxr::VtValue(), true); pxr::UsdAttribute attr_corner_sharpnesses = usd_mesh.CreateCornerSharpnessesAttr( pxr::VtValue(), true); diff --git a/source/blender/io/usd/intern/usd_writer_volume.cc b/source/blender/io/usd/intern/usd_writer_volume.cc index c985f1d061f..982a1ba8789 100644 --- a/source/blender/io/usd/intern/usd_writer_volume.cc +++ b/source/blender/io/usd/intern/usd_writer_volume.cc @@ -99,7 +99,8 @@ std::optional USDVolumeWriter::resolve_vdb_file(const Volume *volum vdb_file_path = construct_vdb_file_path(volume); if (!BKE_volume_save( - volume, usd_export_context_.bmain, nullptr, vdb_file_path.value_or("").c_str())) { + volume, usd_export_context_.bmain, nullptr, vdb_file_path.value_or("").c_str())) + { return std::nullopt; } } diff --git a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc index 575977559d9..de9900c313a 100644 --- a/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc +++ b/source/blender/io/wavefront_obj/exporter/obj_export_file_writer.cc @@ -610,8 +610,8 @@ void MTLWriter::write_bsdf_properties(const MTLMaterial &mtl, bool write_pbr) if (mtl.aniso_rot >= 0.0f) { fmt_handler_.write_mtl_float("anisor", mtl.aniso_rot); } - if (mtl.transmit_color.x > 0.0f || mtl.transmit_color.y > 0.0f || - mtl.transmit_color.z > 0.0f) { + if (mtl.transmit_color.x > 0.0f || mtl.transmit_color.y > 0.0f || mtl.transmit_color.z > 0.0f) + { fmt_handler_.write_mtl_float3( "Tf", mtl.transmit_color.x, mtl.transmit_color.y, mtl.transmit_color.z); } diff --git a/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc b/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc index 0e02fd9336e..a852a4d9319 100644 --- a/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc +++ b/source/blender/io/wavefront_obj/importer/obj_import_file_reader.cc @@ -83,7 +83,8 @@ static void geom_add_vertex(const char *p, const char *end, GlobalVertices &r_gl /* If we don't have vertex colors yet, or the previous vertex * was without color, we need to start a new vertex colors block. */ if (blocks.is_empty() || (blocks.last().start_vertex_index + blocks.last().colors.size() != - r_global_vertices.vertices.size() - 1)) { + r_global_vertices.vertices.size() - 1)) + { GlobalVertices::VertexColorsBlock block; block.start_vertex_index = r_global_vertices.vertices.size() - 1; blocks.append(block); @@ -118,7 +119,8 @@ static void geom_add_mrgb_colors(const char *p, const char *end, GlobalVertices /* If we don't have vertex colors yet, or the previous vertex * was without color, we need to start a new vertex colors block. */ if (blocks.is_empty() || (blocks.last().start_vertex_index + blocks.last().colors.size() != - r_global_vertices.vertices.size())) { + r_global_vertices.vertices.size())) + { GlobalVertices::VertexColorsBlock block; block.start_vertex_index = r_global_vertices.vertices.size(); blocks.append(block); @@ -287,7 +289,8 @@ static void geom_add_polygon(Geometry *geom, global_vertices.vert_normals.size() : -1; if (corner.vertex_normal_index < 0 || - corner.vertex_normal_index >= global_vertices.vert_normals.size()) { + corner.vertex_normal_index >= global_vertices.vert_normals.size()) + { fprintf(stderr, "Invalid normal index %i (valid range [0, %zu)), ignoring face\n", corner.vertex_normal_index, @@ -386,7 +389,8 @@ static void geom_add_curve_parameters(Geometry *geom, const char *p, const char static void geom_update_group(const StringRef rest_line, std::string &r_group_name) { if (rest_line.find("off") != string::npos || rest_line.find("null") != string::npos || - rest_line.find("default") != string::npos) { + rest_line.find("default") != string::npos) + { /* Set group for future elements like faces or curves to empty. */ r_group_name = ""; return; @@ -470,10 +474,10 @@ static void use_all_vertices_if_no_faces(Geometry *geom, const GlobalVertices &global_vertices) { if (!global_vertices.vertices.is_empty() && geom && geom->geom_type_ == GEOM_MESH) { - if (std::all_of( - all_geometries.begin(), all_geometries.end(), [](const std::unique_ptr &g) { - return g->get_vertex_count() == 0; - })) { + if (std::all_of(all_geometries.begin(), + all_geometries.end(), + [](const std::unique_ptr &g) { return g->get_vertex_count() == 0; })) + { geom->track_all_vertices(global_vertices.vertices.size()); } } @@ -578,7 +582,8 @@ void OBJParser::parse(Vector> &r_all_geometries, /* If we don't have a material index assigned yet, get one. * It means "usemtl" state came from the previous object. */ if (state_material_index == -1 && !state_material_name.empty() && - curr_geom->material_indices_.is_empty()) { + curr_geom->material_indices_.is_empty()) + { curr_geom->material_indices_.add_new(state_material_name, 0); curr_geom->material_order_.append(state_material_name); state_material_index = 0; @@ -705,7 +710,8 @@ static MTLTexMapType mtl_line_start_to_texture_type(const char *&p, const char * return MTLTexMapType::Emission; } if (parse_keyword(p, end, "bump") || parse_keyword(p, end, "map_Bump") || - parse_keyword(p, end, "map_bump")) { + parse_keyword(p, end, "map_bump")) + { return MTLTexMapType::Normal; } if (parse_keyword(p, end, "map_Pr")) { diff --git a/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc b/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc index 358f1e8fc24..f700a2d7124 100644 --- a/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc +++ b/source/blender/io/wavefront_obj/importer/obj_import_mesh.cc @@ -283,7 +283,8 @@ void MeshFromGeometry::create_uv_verts(Mesh *mesh) for (int idx = 0; idx < curr_face.corner_count_; ++idx) { const PolyCorner &curr_corner = mesh_geometry_.face_corners_[curr_face.start_index_ + idx]; if (curr_corner.uv_vert_index >= 0 && - curr_corner.uv_vert_index < global_vertices_.uv_vertices.size()) { + curr_corner.uv_vert_index < global_vertices_.uv_vertices.size()) + { uv_map.span[tot_loop_idx] = global_vertices_.uv_vertices[curr_corner.uv_vert_index]; added_uv = true; } @@ -396,7 +397,8 @@ void MeshFromGeometry::create_colors(Mesh *mesh) /* Find which vertex color block is for this mesh (if any). */ for (const auto &block : global_vertices_.vertex_colors) { if (mesh_geometry_.vertex_index_min_ >= block.start_vertex_index && - mesh_geometry_.vertex_index_max_ < block.start_vertex_index + block.colors.size()) { + mesh_geometry_.vertex_index_max_ < block.start_vertex_index + block.colors.size()) + { /* This block is suitable, use colors from it. */ CustomDataLayer *color_layer = BKE_id_attribute_new( &mesh->id, "Color", CD_PROP_COLOR, ATTR_DOMAIN_POINT, nullptr); diff --git a/source/blender/makesdna/intern/dna_genfile.c b/source/blender/makesdna/intern/dna_genfile.c index b75bf5383de..b914f40ca65 100644 --- a/source/blender/makesdna/intern/dna_genfile.c +++ b/source/blender/makesdna/intern/dna_genfile.c @@ -1485,7 +1485,8 @@ static int compress_reconstruct_steps(ReconstructStep *steps, const int old_step if (prev_step->data.memcpy.old_offset + prev_step->data.memcpy.size == step->data.memcpy.old_offset && prev_step->data.memcpy.new_offset + prev_step->data.memcpy.size == - step->data.memcpy.new_offset) { + step->data.memcpy.new_offset) + { prev_step->data.memcpy.size += step->data.memcpy.size; break; } diff --git a/source/blender/makesdna/intern/makesdna.c b/source/blender/makesdna/intern/makesdna.c index 0728f69b449..15eae50be51 100644 --- a/source/blender/makesdna/intern/makesdna.c +++ b/source/blender/makesdna/intern/makesdna.c @@ -776,7 +776,8 @@ static int convert_include(const char *filepath) const char *md1_prev = md1; while (match_identifier_and_advance(&md1, "struct") || match_identifier_and_advance(&md1, "unsigned") || - match_identifier_and_advance(&md1, "const")) { + match_identifier_and_advance(&md1, "const")) + { if (UNLIKELY(!ELEM(*md1, '\0', ' '))) { /* This will happen with: `unsigned(*value)[3]` which isn't supported. */ fprintf(stderr, diff --git a/source/blender/makesrna/RNA_access.h b/source/blender/makesrna/RNA_access.h index 2864720a7be..df72ae7b48e 100644 --- a/source/blender/makesrna/RNA_access.h +++ b/source/blender/makesrna/RNA_access.h @@ -550,7 +550,8 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name); { \ CollectionPropertyIterator rna_macro_iter; \ for (RNA_collection_begin(sptr, propname, &rna_macro_iter); rna_macro_iter.valid; \ - RNA_property_collection_next(&rna_macro_iter)) { \ + RNA_property_collection_next(&rna_macro_iter)) \ + { \ PointerRNA itemptr = rna_macro_iter.ptr; #define RNA_END \ @@ -563,7 +564,8 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name); { \ CollectionPropertyIterator rna_macro_iter; \ for (RNA_property_collection_begin(sptr, prop, &rna_macro_iter); rna_macro_iter.valid; \ - RNA_property_collection_next(&rna_macro_iter)) { \ + RNA_property_collection_next(&rna_macro_iter)) \ + { \ PointerRNA itemptr = rna_macro_iter.ptr; #define RNA_PROP_END \ @@ -578,7 +580,8 @@ void RNA_collection_clear(PointerRNA *ptr, const char *name); for (RNA_property_collection_begin( \ sptr, RNA_struct_iterator_property((sptr)->type), &rna_macro_iter); \ rna_macro_iter.valid; \ - RNA_property_collection_next(&rna_macro_iter)) { \ + RNA_property_collection_next(&rna_macro_iter)) \ + { \ PropertyRNA *prop = (PropertyRNA *)rna_macro_iter.ptr.data; #define RNA_STRUCT_BEGIN_SKIP_RNA_TYPE(sptr, prop) \ diff --git a/source/blender/makesrna/intern/makesrna.c b/source/blender/makesrna/intern/makesrna.c index 3cf32a878dc..a53e06aedd7 100644 --- a/source/blender/makesrna/intern/makesrna.c +++ b/source/blender/makesrna/intern/makesrna.c @@ -711,8 +711,8 @@ static char *rna_def_property_get_func( if (prop->type == PROP_INT) { IntPropertyRNA *iprop = (IntPropertyRNA *)prop; /* Only UI_BTYPE_NUM_SLIDER is implemented and that one can't have a softmin of zero. */ - if ((iprop->ui_scale_type == PROP_SCALE_LOG) && - (iprop->hardmin <= 0 || iprop->softmin <= 0)) { + if ((iprop->ui_scale_type == PROP_SCALE_LOG) && (iprop->hardmin <= 0 || iprop->softmin <= 0)) + { CLOG_ERROR( &LOG, "\"%s.%s\", range for log scale <= 0.", srna->identifier, prop->identifier); DefRNA.error = true; @@ -807,7 +807,8 @@ static char *rna_def_property_get_func( if (STR_ELEM(manualfunc, "rna_iterator_listbase_get", "rna_iterator_array_get", - "rna_iterator_array_dereference_get")) { + "rna_iterator_array_dereference_get")) + { fprintf(f, " return rna_pointer_inherit_refine(&iter->parent, &RNA_%s, %s(iter));\n", (cprop->item_type) ? (const char *)cprop->item_type : "UnknownType", @@ -2048,7 +2049,8 @@ static void rna_def_property_funcs(FILE *f, StructRNA *srna, PropertyDefRNA *dp) * array get/next function, we can be sure it is an actual array */ if (cprop->next && cprop->get) { if (STREQ((const char *)cprop->next, "rna_iterator_array_next") && - STREQ((const char *)cprop->get, "rna_iterator_array_get")) { + STREQ((const char *)cprop->get, "rna_iterator_array_get")) + { prop->flag_internal |= PROP_INTERN_RAW_ARRAY; } } @@ -2389,7 +2391,8 @@ static void rna_def_property_funcs_header_cpp(FILE *f, StructRNA *srna, Property const char *collection_funcs = "DefaultCollectionFunctions"; if (!(dp->prop->flag & PROP_IDPROPERTY || dp->prop->flag_internal & PROP_INTERN_BUILTIN) && - cprop->property.srna) { + cprop->property.srna) + { collection_funcs = (char *)cprop->property.srna; } @@ -2987,8 +2990,8 @@ static void rna_def_function_funcs(FILE *f, StructDefRNA *dsrna, FunctionDefRNA else if (type == PROP_POINTER || dparm->prop->arraydimension) { ptrstr = "*"; } - else if ((type == PROP_POINTER) && (flag_parameter & PARM_RNAPTR) && - !(flag & PROP_THICK_WRAP)) { + else if ((type == PROP_POINTER) && (flag_parameter & PARM_RNAPTR) && !(flag & PROP_THICK_WRAP)) + { ptrstr = "*"; /* PROP_THICK_WRAP strings are pre-allocated on the ParameterList stack, * but type name for string props is already (char *), so leave empty */ diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index 2c7ccd09a89..ae4618256bb 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -579,7 +579,8 @@ int rna_ID_is_runtime_editable(PointerRNA *ptr, const char **r_info) ID *id = (ID *)ptr->data; /* TODO: This should be abstracted in a BKE function or define, somewhat related to #88555. */ if (id->tag & (LIB_TAG_NO_MAIN | LIB_TAG_TEMP_MAIN | LIB_TAG_LOCALIZED | - LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT | LIB_TAG_COPIED_ON_WRITE)) { + LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT | LIB_TAG_COPIED_ON_WRITE)) + { *r_info = "Cannot edit 'runtime' status of non-blendfile data-blocks, as they are by definition " "always runtime"; @@ -594,7 +595,8 @@ bool rna_ID_is_runtime_get(PointerRNA *ptr) ID *id = (ID *)ptr->data; /* TODO: This should be abstracted in a BKE function or define, somewhat related to #88555. */ if (id->tag & (LIB_TAG_NO_MAIN | LIB_TAG_TEMP_MAIN | LIB_TAG_LOCALIZED | - LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT | LIB_TAG_COPIED_ON_WRITE)) { + LIB_TAG_COPIED_ON_WRITE_EVAL_RESULT | LIB_TAG_COPIED_ON_WRITE)) + { return true; } @@ -1141,7 +1143,8 @@ static void rna_ImagePreview_is_custom_set(PointerRNA *ptr, int value, enum eIco } if ((value && (prv_img->flag[size] & PRV_USER_EDITED)) || - (!value && !(prv_img->flag[size] & PRV_USER_EDITED))) { + (!value && !(prv_img->flag[size] & PRV_USER_EDITED))) + { return; } @@ -1407,7 +1410,8 @@ static void rna_ImagePreview_icon_reload(PreviewImage *prv) { /* will lazy load on next use, but only in case icon is not user-modified! */ if (!(prv->flag[ICON_SIZE_ICON] & PRV_USER_EDITED) && - !(prv->flag[ICON_SIZE_PREVIEW] & PRV_USER_EDITED)) { + !(prv->flag[ICON_SIZE_PREVIEW] & PRV_USER_EDITED)) + { BKE_previewimg_clear(prv); } } diff --git a/source/blender/makesrna/intern/rna_access.cc b/source/blender/makesrna/intern/rna_access.cc index c9c57eee4cd..150b2e7cabb 100644 --- a/source/blender/makesrna/intern/rna_access.cc +++ b/source/blender/makesrna/intern/rna_access.cc @@ -71,12 +71,13 @@ void RNA_init(void) BLENDER_RNA.structs_len = 0; for (srna = static_cast(BLENDER_RNA.structs.first); srna; - srna = static_cast(srna->cont.next)) { + srna = static_cast(srna->cont.next)) + { if (!srna->cont.prophash) { srna->cont.prophash = BLI_ghash_str_new("RNA_init gh"); - for (prop = static_cast(srna->cont.properties.first); prop; - prop = prop->next) { + for (prop = static_cast(srna->cont.properties.first); prop; prop = prop->next) + { if (!(prop->flag_internal & PROP_INTERN_BUILTIN)) { BLI_ghash_insert(srna->cont.prophash, (void *)prop->identifier, prop); } @@ -93,7 +94,8 @@ void RNA_exit(void) StructRNA *srna; for (srna = static_cast(BLENDER_RNA.structs.first); srna; - srna = static_cast(srna->cont.next)) { + srna = static_cast(srna->cont.next)) + { if (srna->cont.prophash) { BLI_ghash_free(srna->cont.prophash, nullptr, nullptr); srna->cont.prophash = nullptr; @@ -735,7 +737,8 @@ PropertyRNA *RNA_struct_find_property(PointerRNA *ptr, const char *identifier) PropertyRNA *r_prop = nullptr; PointerRNA r_ptr; /* only support single level props */ if (RNA_path_resolve_property(ptr, identifier, &r_ptr, &r_prop) && (r_ptr.type == ptr->type) && - (r_ptr.data == ptr->data)) { + (r_ptr.data == ptr->data)) + { return r_prop; } } @@ -989,7 +992,8 @@ bool RNA_struct_bl_idname_ok_or_report(ReportList *reports, last = end - 1; for (c = start; c != end; c++) { if (((*c >= 'A' && *c <= 'Z') || ((c != start) && (*c >= '0' && *c <= '9')) || - ((c != start) && (c != last) && (*c == '_'))) == 0) { + ((c != start) && (c != last) && (*c == '_'))) == 0) + { BKE_reportf(reports, eReportType(report_level), "'%s' doesn't have upper case alpha-numeric prefix", @@ -1003,7 +1007,8 @@ bool RNA_struct_bl_idname_ok_or_report(ReportList *reports, last = end - 1; for (c = start; c != end; c++) { if (((*c >= 'A' && *c <= 'Z') || (*c >= 'a' && *c <= 'z') || (*c >= '0' && *c <= '9') || - ((c != start) && (c != last) && (*c == '_'))) == 0) { + ((c != start) && (c != last) && (*c == '_'))) == 0) + { BKE_reportf(reports, eReportType(report_level), "'%s' doesn't have an alpha-numeric suffix", @@ -1142,7 +1147,8 @@ char RNA_property_array_item_char(PropertyRNA *prop, int index) PROP_EULER, PROP_VELOCITY, PROP_ACCELERATION, - PROP_COORDS)) { + PROP_COORDS)) + { return vectoritem[index]; } if ((index < 4) && ELEM(subtype, PROP_COLOR, PROP_COLOR_GAMMA)) { @@ -1178,7 +1184,8 @@ int RNA_property_array_item_index(PropertyRNA *prop, char name) PROP_XYZ_LENGTH, PROP_EULER, PROP_VELOCITY, - PROP_ACCELERATION)) { + PROP_ACCELERATION)) + { switch (name) { case 'x': return 0; @@ -2155,7 +2162,8 @@ static void rna_property_update( * is updated with custom nodes. */ if ((prop->flag & PROP_IDPROPERTY) != 0 && (ptr->owner_id != nullptr) && - (GS(ptr->owner_id->name) == ID_NT)) { + (GS(ptr->owner_id->name) == ID_NT)) + { WM_main_add_notifier(NC_MATERIAL | ND_SHADING, nullptr); } } @@ -3730,7 +3738,8 @@ void RNA_property_pointer_set(PointerRNA *ptr, /* RNA property. */ else if (pprop->set) { if (!((prop->flag & PROP_NEVER_NULL) && ptr_value.data == nullptr) && - !((prop->flag & PROP_ID_SELF_CHECK) && ptr->owner_id == ptr_value.owner_id)) { + !((prop->flag & PROP_ID_SELF_CHECK) && ptr->owner_id == ptr_value.owner_id)) + { pprop->set(ptr, ptr_value, reports); } } @@ -4383,7 +4392,8 @@ int RNA_property_collection_raw_array(PointerRNA *ptr, BLI_assert(RNA_property_type(prop) == PROP_COLLECTION); if (!(prop->flag_internal & PROP_INTERN_RAW_ARRAY) || - !(itemprop->flag_internal & PROP_INTERN_RAW_ACCESS)) { + !(itemprop->flag_internal & PROP_INTERN_RAW_ACCESS)) + { return 0; } @@ -4600,7 +4610,8 @@ static int rna_raw_access(ReportList *reports, if (((itemtype == PROP_INT) && (in.type == PROP_RAW_INT)) || ((itemtype == PROP_BOOLEAN) && (in.type == PROP_RAW_BOOLEAN)) || - ((itemtype == PROP_FLOAT) && (in.type == PROP_RAW_FLOAT))) { + ((itemtype == PROP_FLOAT) && (in.type == PROP_RAW_FLOAT))) + { /* avoid creating temporary buffer if the data type match */ needconv = 0; } @@ -5872,7 +5883,8 @@ char *RNA_property_as_string( for (RNA_property_collection_begin(ptr, prop, &collect_iter); (i < max_prop_length) && collect_iter.valid; - RNA_property_collection_next(&collect_iter), i++) { + RNA_property_collection_next(&collect_iter), i++) + { PointerRNA itemptr = collect_iter.ptr; if (i != 0) { diff --git a/source/blender/makesrna/intern/rna_access_compare_override.c b/source/blender/makesrna/intern/rna_access_compare_override.c index af13171f202..383cbc16473 100644 --- a/source/blender/makesrna/intern/rna_access_compare_override.c +++ b/source/blender/makesrna/intern/rna_access_compare_override.c @@ -336,7 +336,8 @@ static int rna_property_override_diff(Main *bmain, BLI_assert(!ELEM(NULL, prop_a, prop_b)); if (prop_a->rnaprop->flag_override & PROPOVERRIDE_NO_COMPARISON || - prop_b->rnaprop->flag_override & PROPOVERRIDE_NO_COMPARISON) { + prop_b->rnaprop->flag_override & PROPOVERRIDE_NO_COMPARISON) + { return 0; } @@ -416,7 +417,8 @@ static int rna_property_override_diff(Main *bmain, eRNAOverrideMatch diff_flags = flags; if (!RNA_property_overridable_get(&prop_a->ptr, prop_a->rawprop) || (!ELEM(RNA_property_type(prop_a->rawprop), PROP_POINTER, PROP_COLLECTION) && - !RNA_property_editable_flag(&prop_a->ptr, prop_a->rawprop))) { + !RNA_property_editable_flag(&prop_a->ptr, prop_a->rawprop))) + { diff_flags &= ~RNA_OVERRIDE_COMPARE_CREATE; } const int diff = override_diff( @@ -479,7 +481,8 @@ static bool rna_property_override_operation_store(Main *bmain, } if (ptr_storage != NULL && prop_storage->magic == RNA_MAGIC && - !ELEM(prop_storage->override_store, NULL, override_store)) { + !ELEM(prop_storage->override_store, NULL, override_store)) + { override_store = NULL; } @@ -498,7 +501,8 @@ static bool rna_property_override_operation_store(Main *bmain, if (!ELEM(opop->operation, IDOVERRIDE_LIBRARY_OP_ADD, IDOVERRIDE_LIBRARY_OP_SUBTRACT, - IDOVERRIDE_LIBRARY_OP_MULTIPLY)) { + IDOVERRIDE_LIBRARY_OP_MULTIPLY)) + { continue; } @@ -512,7 +516,8 @@ static bool rna_property_override_operation_store(Main *bmain, len_local, len_reference, len_storage, - opop)) { + opop)) + { changed = true; } } @@ -537,7 +542,8 @@ static bool rna_property_override_operation_apply(Main *bmain, const short override_op = opop->operation; if (!BKE_lib_override_library_property_operation_operands_validate( - opop, ptr_dst, ptr_src, ptr_storage, prop_dst, prop_src, prop_storage)) { + opop, ptr_dst, ptr_src, ptr_storage, prop_dst, prop_src, prop_storage)) + { return false; } @@ -567,7 +573,8 @@ static bool rna_property_override_operation_apply(Main *bmain, } if (ptr_storage && prop_storage->magic == RNA_MAGIC && - !ELEM(prop_storage->override_apply, NULL, override_apply)) { + !ELEM(prop_storage->override_apply, NULL, override_apply)) + { override_apply = NULL; } @@ -676,7 +683,8 @@ bool RNA_struct_override_matches(Main *bmain, iterprop = RNA_struct_iterator_property(ptr_local->type); for (RNA_property_collection_begin(ptr_local, iterprop, &iter); iter.valid; - RNA_property_collection_next(&iter)) { + RNA_property_collection_next(&iter)) + { PropertyRNA *rawprop = iter.ptr.data; PropertyRNAOrID prop_local; @@ -690,7 +698,8 @@ bool RNA_struct_override_matches(Main *bmain, BLI_assert(prop_local.is_idprop == prop_reference.is_idprop); if ((prop_local.is_idprop && prop_local.idprop == NULL) || - (prop_reference.is_idprop && prop_reference.idprop == NULL)) { + (prop_reference.is_idprop && prop_reference.idprop == NULL)) + { continue; } @@ -939,7 +948,8 @@ bool RNA_struct_override_store(Main *bmain, PropertyRNA *prop_reference, *prop_local; if (RNA_path_resolve_property(ptr_local, op->rna_path, &data_local, &prop_local) && - RNA_path_resolve_property(ptr_reference, op->rna_path, &data_reference, &prop_reference)) { + RNA_path_resolve_property(ptr_reference, op->rna_path, &data_reference, &prop_reference)) + { PointerRNA data_storage; PropertyRNA *prop_storage = NULL; @@ -956,7 +966,8 @@ bool RNA_struct_override_store(Main *bmain, prop_reference, prop_local, prop_storage, - op)) { + op)) + { changed = true; } } @@ -988,7 +999,8 @@ static void rna_porperty_override_collection_subitem_lookup( RNA_property_type(prop_src) != PROP_COLLECTION || (prop_storage != NULL && RNA_property_type(prop_storage) != PROP_COLLECTION)) || (opop->subitem_local_name == NULL && opop->subitem_reference_name == NULL && - opop->subitem_local_index == -1 && opop->subitem_reference_index == -1)) { + opop->subitem_local_index == -1 && opop->subitem_reference_index == -1)) + { return; } @@ -1002,7 +1014,8 @@ static void rna_porperty_override_collection_subitem_lookup( ptr_src, prop_src, opop->subitem_local_name, private_ptr_item_src); if (opop->subitem_reference_name != NULL && RNA_property_collection_lookup_string( - ptr_dst, prop_dst, opop->subitem_reference_name, private_ptr_item_dst)) { + ptr_dst, prop_dst, opop->subitem_reference_name, private_ptr_item_dst)) + { /* This is rather fragile, but the fact that local override IDs may have a different name * than their linked reference makes it necessary. * Basically, here we are considering that if we cannot find the original linked ID in @@ -1071,7 +1084,8 @@ static void rna_porperty_override_collection_subitem_lookup( * modifier...) in a collection that supports it. */ if ((*r_ptr_item_dst)->type == NULL && ((opop->subitem_reference_name != NULL && opop->subitem_reference_name[0] != '\0') || - opop->subitem_reference_index != -1)) { + opop->subitem_reference_index != -1)) + { CLOG_INFO(&LOG, 2, "Failed to find destination sub-item '%s' (%d) of '%s' in new override data '%s'", @@ -1082,7 +1096,8 @@ static void rna_porperty_override_collection_subitem_lookup( } if ((*r_ptr_item_src)->type == NULL && ((opop->subitem_local_name != NULL && opop->subitem_local_name[0] != '\0') || - opop->subitem_local_index != -1)) { + opop->subitem_local_index != -1)) + { CLOG_INFO(&LOG, 2, "Failed to find source sub-item '%s' (%d) of '%s' in old override data '%s'", @@ -1132,7 +1147,8 @@ static void rna_property_override_check_resync(Main *bmain, * NOTE: Here we are testing if `id_owner` is referencing itself, in that case the new * override copy generated by `BKE_lib_override_library_update` will already have its * self-references updated to itself, instead of still pointing to its linked source. */ - (id_dst->lib == id_src->lib && id_dst != id_owner_dst))) { + (id_dst->lib == id_src->lib && id_dst != id_owner_dst))) + { id_owner_dst->tag |= LIB_TAG_LIB_OVERRIDE_NEED_RESYNC; if (ID_IS_LINKED(id_owner_src)) { id_owner_src->lib->tag |= LIBRARY_TAG_RESYNC_REQUIRED; @@ -1161,7 +1177,8 @@ static void rna_property_override_apply_ex(Main *bmain, if (!do_insert != !ELEM(opop->operation, IDOVERRIDE_LIBRARY_OP_INSERT_AFTER, - IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE)) { + IDOVERRIDE_LIBRARY_OP_INSERT_BEFORE)) + { if (!do_insert) { CLOG_INFO(&LOG, 5, "Skipping insert override operations in first pass (%s)", op->rna_path); } @@ -1198,7 +1215,8 @@ static void rna_property_override_apply_ex(Main *bmain, ptr_item_dst, ptr_item_src, ptr_item_storage, - opop)) { + opop)) + { CLOG_INFO(&LOG, 4, "Failed to apply '%s' override operation on %s\n", @@ -1241,7 +1259,8 @@ void RNA_struct_override_apply(Main *bmain, if (!(RNA_path_resolve_property_and_item_pointer( ptr_dst, op->rna_path, &data_dst, &prop_dst, &data_item_dst) && RNA_path_resolve_property_and_item_pointer( - ptr_src, op->rna_path, &data_src, &prop_src, &data_item_src))) { + ptr_src, op->rna_path, &data_src, &prop_src, &data_item_src))) + { CLOG_INFO(&LOG, 4, "Failed to apply library override operation to '%s.%s' " @@ -1265,10 +1284,12 @@ void RNA_struct_override_apply(Main *bmain, /* Check if an overridden ID pointer supposed to be in sync with linked data gets out of * sync. */ if ((flag & RNA_OVERRIDE_APPLY_FLAG_SKIP_RESYNC_CHECK) == 0 && - (ptr_dst->owner_id->tag & LIB_TAG_LIB_OVERRIDE_NEED_RESYNC) == 0) { + (ptr_dst->owner_id->tag & LIB_TAG_LIB_OVERRIDE_NEED_RESYNC) == 0) + { if (op->rna_prop_type == PROP_POINTER && (((IDOverrideLibraryPropertyOperation *)op->operations.first)->flag & - IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE) != 0) { + IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE) != 0) + { BLI_assert(RNA_struct_is_ID(RNA_property_pointer_type(&data_src, prop_src))); BLI_assert(ptr_src->owner_id == rna_property_override_property_real_id_owner(bmain, &data_src, NULL, NULL)); @@ -1322,7 +1343,8 @@ void RNA_struct_override_apply(Main *bmain, if ((flag & RNA_OVERRIDE_APPLY_FLAG_IGNORE_ID_POINTERS) != 0 && op->rna_prop_type == PROP_POINTER && (((IDOverrideLibraryPropertyOperation *)op->operations.first)->flag & - IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE) == 0) { + IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE) == 0) + { BLI_assert(ptr_src->owner_id == rna_property_override_property_real_id_owner(bmain, &data_src, NULL, NULL)); BLI_assert(ptr_dst->owner_id == diff --git a/source/blender/makesrna/intern/rna_brush.c b/source/blender/makesrna/intern/rna_brush.c index 9505031bb76..f5b156962b8 100644 --- a/source/blender/makesrna/intern/rna_brush.c +++ b/source/blender/makesrna/intern/rna_brush.c @@ -1041,7 +1041,8 @@ static void rna_BrushGpencilSettings_default_eraser_update(Main *bmain, /* disable default eraser in all brushes */ for (Brush *brush = bmain->brushes.first; brush; brush = brush->id.next) { if ((brush != brush_cur) && (brush->ob_mode == OB_MODE_PAINT_GPENCIL) && - (brush->gpencil_tool == GPAINT_TOOL_ERASE)) { + (brush->gpencil_tool == GPAINT_TOOL_ERASE)) + { brush->gpencil_settings->flag &= ~GP_BRUSH_DEFAULT_ERASER; } } diff --git a/source/blender/makesrna/intern/rna_color.c b/source/blender/makesrna/intern/rna_color.c index 2c0e854480b..3c1df5ed112 100644 --- a/source/blender/makesrna/intern/rna_color.c +++ b/source/blender/makesrna/intern/rna_color.c @@ -705,7 +705,8 @@ static float rna_CurveMapping_evaluateF(struct CurveMapping *cumap, float value) { if (&cumap->cm[0] != cuma && &cumap->cm[1] != cuma && &cumap->cm[2] != cuma && - &cumap->cm[3] != cuma) { + &cumap->cm[3] != cuma) + { BKE_report(reports, RPT_ERROR, "CurveMapping does not own CurveMap"); return 0.0f; } diff --git a/source/blender/makesrna/intern/rna_define.c b/source/blender/makesrna/intern/rna_define.c index 58acc49aefe..3c02d480f78 100644 --- a/source/blender/makesrna/intern/rna_define.c +++ b/source/blender/makesrna/intern/rna_define.c @@ -2814,7 +2814,8 @@ void RNA_def_property_collection_sdna(PropertyRNA *prop, int dnaoffset = 0; if (lengthpropname[0] == 0 || - rna_find_sdna_member(DefRNA.sdna, structname, lengthpropname, &smember, &dnaoffset)) { + rna_find_sdna_member(DefRNA.sdna, structname, lengthpropname, &smember, &dnaoffset)) + { if (lengthpropname[0] == 0) { dp->dnalengthfixed = prop->totarraylength; prop->arraydimension = 0; diff --git a/source/blender/makesrna/intern/rna_fluid.c b/source/blender/makesrna/intern/rna_fluid.c index 545d4268edd..4b9849d4177 100644 --- a/source/blender/makesrna/intern/rna_fluid.c +++ b/source/blender/makesrna/intern/rna_fluid.c @@ -614,7 +614,8 @@ static const EnumPropertyItem *rna_Fluid_cachetype_volume_itemf(bContext *UNUSED /* Support for deprecated .raw format. */ FluidDomainSettings *fds = (FluidDomainSettings *)ptr->data; if (fds->cache_data_format == FLUID_DOMAIN_FILE_RAW || - fds->cache_noise_format == FLUID_DOMAIN_FILE_RAW) { + fds->cache_noise_format == FLUID_DOMAIN_FILE_RAW) + { tmp.value = FLUID_DOMAIN_FILE_RAW; tmp.identifier = "RAW"; tmp.name = N_("Raw Cache"); diff --git a/source/blender/makesrna/intern/rna_gpencil_legacy_modifier.c b/source/blender/makesrna/intern/rna_gpencil_legacy_modifier.c index b7cefe257c6..f4154f149ab 100644 --- a/source/blender/makesrna/intern/rna_gpencil_legacy_modifier.c +++ b/source/blender/makesrna/intern/rna_gpencil_legacy_modifier.c @@ -958,7 +958,8 @@ const EnumPropertyItem *gpencil_build_time_mode_filter(bContext *UNUSED(C), int totitem = 0; for (const EnumPropertyItem *item = gpencil_build_time_mode_items; item->identifier != NULL; - item++) { + item++) + { if (is_concurrent && (item->value == GP_BUILD_TIMEMODE_DRAWSPEED)) { continue; } diff --git a/source/blender/makesrna/intern/rna_image_api.c b/source/blender/makesrna/intern/rna_image_api.c index 3afa5383aaa..ebf5cd849e2 100644 --- a/source/blender/makesrna/intern/rna_image_api.c +++ b/source/blender/makesrna/intern/rna_image_api.c @@ -43,7 +43,8 @@ static void rna_ImagePackedFile_save(ImagePackedFile *imapf, Main *bmain, Report { if (BKE_packedfile_write_to_file( reports, BKE_main_blendfile_path(bmain), imapf->filepath, imapf->packedfile, 0) != - RET_OK) { + RET_OK) + { BKE_reportf(reports, RPT_ERROR, "Could not save packed file to disk as '%s'", imapf->filepath); } } diff --git a/source/blender/makesrna/intern/rna_modifier.c b/source/blender/makesrna/intern/rna_modifier.c index dae7d8f3b06..39ec1d55ca9 100644 --- a/source/blender/makesrna/intern/rna_modifier.c +++ b/source/blender/makesrna/intern/rna_modifier.c @@ -1370,7 +1370,8 @@ static const EnumPropertyItem *rna_DataTransferModifier_layers_select_src_itemf( } } else if (STREQ(RNA_property_identifier(prop), "layers_vcol_vert_select_src") || - STREQ(RNA_property_identifier(prop), "layers_vcol_loop_select_src")) { + STREQ(RNA_property_identifier(prop), "layers_vcol_loop_select_src")) + { Object *ob_src = dtmd->ob_source; if (ob_src) { @@ -1487,7 +1488,8 @@ static const EnumPropertyItem *rna_DataTransferModifier_layers_select_dst_itemf( } } else if (STREQ(RNA_property_identifier(prop), "layers_vcol_vert_select_dst") || - STREQ(RNA_property_identifier(prop), "layers_vcol_loop_select_dst")) { + STREQ(RNA_property_identifier(prop), "layers_vcol_loop_select_dst")) + { int multilayer_index = STREQ(RNA_property_identifier(prop), "layers_vcol_vert_select_dst") ? DT_MULTILAYER_INDEX_VCOL_VERT : DT_MULTILAYER_INDEX_VCOL_LOOP; diff --git a/source/blender/makesrna/intern/rna_nodetree.c b/source/blender/makesrna/intern/rna_nodetree.c index abf3d02f398..70cf9bffd5d 100644 --- a/source/blender/makesrna/intern/rna_nodetree.c +++ b/source/blender/makesrna/intern/rna_nodetree.c @@ -2190,15 +2190,18 @@ static void rna_GeometryNodeCompare_data_type_update(Main *bmain, Scene *scene, NODE_COMPARE_EQUAL, NODE_COMPARE_NOT_EQUAL, NODE_COMPARE_COLOR_BRIGHTER, - NODE_COMPARE_COLOR_DARKER)) { + NODE_COMPARE_COLOR_DARKER)) + { node_storage->operation = NODE_COMPARE_EQUAL; } else if (node_storage->data_type == SOCK_STRING && - !ELEM(node_storage->operation, NODE_COMPARE_EQUAL, NODE_COMPARE_NOT_EQUAL)) { + !ELEM(node_storage->operation, NODE_COMPARE_EQUAL, NODE_COMPARE_NOT_EQUAL)) + { node_storage->operation = NODE_COMPARE_EQUAL; } else if (node_storage->data_type != SOCK_RGBA && - ELEM(node_storage->operation, NODE_COMPARE_COLOR_BRIGHTER, NODE_COMPARE_COLOR_DARKER)) { + ELEM(node_storage->operation, NODE_COMPARE_COLOR_BRIGHTER, NODE_COMPARE_COLOR_DARKER)) + { node_storage->operation = NODE_COMPARE_EQUAL; } diff --git a/source/blender/makesrna/intern/rna_object.c b/source/blender/makesrna/intern/rna_object.c index f7a83915ed2..35733fe3778 100644 --- a/source/blender/makesrna/intern/rna_object.c +++ b/source/blender/makesrna/intern/rna_object.c @@ -1738,8 +1738,8 @@ static void rna_Object_modifier_remove(Object *object, PointerRNA *md_ptr) { ModifierData *md = md_ptr->data; - if (ED_object_modifier_remove(reports, CTX_data_main(C), CTX_data_scene(C), object, md) == - false) { + if (ED_object_modifier_remove(reports, CTX_data_main(C), CTX_data_scene(C), object, md) == false) + { /* error is already set */ return; } diff --git a/source/blender/makesrna/intern/rna_object_api.c b/source/blender/makesrna/intern/rna_object_api.c index 386b7d60aa9..ec86553ea7c 100644 --- a/source/blender/makesrna/intern/rna_object_api.c +++ b/source/blender/makesrna/intern/rna_object_api.c @@ -606,7 +606,8 @@ static void rna_Object_ray_cast(Object *ob, if (!bb || (isect_ray_aabb_v3_simple(origin, direction, bb->vec[0], bb->vec[6], &distmin, NULL) && - distmin <= distance)) { + distmin <= distance)) + { BVHTreeFromMesh treeData = {NULL}; /* No need to managing allocation or freeing of the BVH data. @@ -627,7 +628,8 @@ static void rna_Object_ray_cast(Object *ob, 0.0f, &hit, treeData.raycast_callback, - &treeData) != -1) { + &treeData) != -1) + { if (hit.dist <= distance) { *r_success = success = true; @@ -685,7 +687,8 @@ static void rna_Object_closest_point_on_mesh(Object *ob, nearest.dist_sq = distance * distance; if (BLI_bvhtree_find_nearest( - treeData.tree, origin, &nearest, treeData.nearest_callback, &treeData) != -1) { + treeData.tree, origin, &nearest, treeData.nearest_callback, &treeData) != -1) + { *r_success = true; copy_v3_v3(r_location, nearest.co); diff --git a/source/blender/makesrna/intern/rna_object_force.c b/source/blender/makesrna/intern/rna_object_force.c index 8c5f96c1bdb..803b6ed61d8 100644 --- a/source/blender/makesrna/intern/rna_object_force.c +++ b/source/blender/makesrna/intern/rna_object_force.c @@ -667,7 +667,8 @@ static void rna_FieldSettings_update(Main *UNUSED(bmain), Scene *UNUSED(scene), /* In the case of specific force-fields that are using the #EffectorData's normal, we need to * rebuild mesh and BVH-tree for #SurfaceModifier to work correctly. */ if (ELEM(ob->pd->shape, PFIELD_SHAPE_SURFACE, PFIELD_SHAPE_POINTS) || - ob->pd->forcefield == PFIELD_GUIDE) { + ob->pd->forcefield == PFIELD_GUIDE) + { DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); } @@ -841,8 +842,8 @@ static char *rna_EffectorWeight_path(const PointerRNA *ptr) md = (ModifierData *)BKE_modifiers_findby_type(ob, eModifierType_Fluid); if (md) { FluidModifierData *fmd = (FluidModifierData *)md; - if (fmd->type == MOD_FLUID_TYPE_DOMAIN && fmd->domain && - fmd->domain->effector_weights == ew) { + if (fmd->type == MOD_FLUID_TYPE_DOMAIN && fmd->domain && fmd->domain->effector_weights == ew) + { char name_esc[sizeof(md->name) * 2]; BLI_str_escape(name_esc, md->name, sizeof(name_esc)); return BLI_sprintfN("modifiers[\"%s\"].domain_settings.effector_weights", name_esc); diff --git a/source/blender/makesrna/intern/rna_particle.c b/source/blender/makesrna/intern/rna_particle.c index aa186aa4750..2dbca3d6acb 100644 --- a/source/blender/makesrna/intern/rna_particle.c +++ b/source/blender/makesrna/intern/rna_particle.c @@ -396,7 +396,8 @@ static void rna_Particle_uv_on_emitter(ParticleData *particle, /* get uvco */ if (r_uv && ELEM(from, PART_FROM_FACE, PART_FROM_VOLUME) && - !ELEM(num, DMCACHE_NOTFOUND, DMCACHE_ISCHILD)) { + !ELEM(num, DMCACHE_NOTFOUND, DMCACHE_ISCHILD)) + { const MFace *mface = CustomData_get_layer(&modifier->mesh_final->fdata, CD_MFACE); const MTFace *mtface = CustomData_get_layer(&modifier->mesh_final->fdata, CD_MTFACE); diff --git a/source/blender/makesrna/intern/rna_path.cc b/source/blender/makesrna/intern/rna_path.cc index a878acd5b77..8539f8d628b 100644 --- a/source/blender/makesrna/intern/rna_path.cc +++ b/source/blender/makesrna/intern/rna_path.cc @@ -489,8 +489,9 @@ static bool rna_path_parse(const PointerRNA *ptr, *r_item_ptr = nextptr; } - if (prop_elem && (prop_elem->ptr.data != curptr.data || prop_elem->prop != prop || - prop_elem->index != index)) { + if (prop_elem && + (prop_elem->ptr.data != curptr.data || prop_elem->prop != prop || prop_elem->index != index)) + { prop_elem = MEM_cnew(__func__); prop_elem->ptr = curptr; prop_elem->prop = prop; @@ -811,7 +812,8 @@ static char *rna_idp_path(PointerRNA *ptr, link.index = -1; for (i = 0, iter = static_cast(haystack->data.group.first); iter; - iter = iter->next, i++) { + iter = iter->next, i++) + { if (needle == iter) { /* found! */ link.name = iter->name; link.index = -1; diff --git a/source/blender/makesrna/intern/rna_rna.c b/source/blender/makesrna/intern/rna_rna.c index cc59603bc53..44469f545a3 100644 --- a/source/blender/makesrna/intern/rna_rna.c +++ b/source/blender/makesrna/intern/rna_rna.c @@ -756,7 +756,8 @@ static const EnumPropertyItem *rna_Property_tags_itemf(bContext *UNUSED(C), for (const EnumPropertyItem *struct_tags = RNA_struct_property_tag_defines(srna); struct_tags != NULL && struct_tags->identifier != NULL; - struct_tags++) { + struct_tags++) + { memcpy(&tmp, struct_tags, sizeof(tmp)); RNA_enum_item_add(&prop_tags, &totitem, &tmp); } @@ -989,7 +990,8 @@ static const EnumPropertyItem *rna_EnumProperty_default_itemf(bContext *C, } if ((eprop->item_fn == NULL) || (eprop->item_fn == rna_EnumProperty_default_itemf) || - (ptr->type == &RNA_EnumProperty) || (C == NULL)) { + (ptr->type == &RNA_EnumProperty) || (C == NULL)) + { if (eprop->item) { return eprop->item; } @@ -1322,7 +1324,8 @@ static bool rna_property_override_diff_propptr_validate_diffing(PointerRNA *prop } if (propname_a != NULL && propname_b != NULL) { if (propname_a_len != propname_b_len || propname_a[0] != propname_b[0] || - !STREQ(propname_a, propname_b)) { + !STREQ(propname_a, propname_b)) + { is_valid_for_diffing = false; // printf("%s: different names\n", rna_path ? rna_path : ""); } @@ -1418,7 +1421,8 @@ static int rna_property_override_diff_propptr(Main *bmain, IDOverrideLibraryPropertyOperation *opop = NULL; if (created || rna_itemname_a != NULL || rna_itemname_b != NULL || - rna_itemindex_a != -1 || rna_itemindex_b != -1) { + rna_itemindex_a != -1 || rna_itemindex_b != -1) + { opop = BKE_lib_override_library_property_operation_get(op, IDOVERRIDE_LIBRARY_OP_REPLACE, rna_itemname_b, @@ -1462,7 +1466,8 @@ static int rna_property_override_diff_propptr(Main *bmain, opop->flag &= ~IDOVERRIDE_LIBRARY_FLAG_IDPOINTER_MATCH_REFERENCE; } else if ((owner_id_a->tag & LIB_TAG_LIB_OVERRIDE_NEED_RESYNC) != 0 || - (owner_id_b->tag & LIB_TAG_LIB_OVERRIDE_NEED_RESYNC) != 0) { + (owner_id_b->tag & LIB_TAG_LIB_OVERRIDE_NEED_RESYNC) != 0) + { /* In case one of the owner of the checked property is tagged as needing resync, do * not change the 'match reference' status of its ID pointer properties overrides, * since many non-matching ones are likely due to missing resync. */ @@ -1501,7 +1506,8 @@ static int rna_property_override_diff_propptr(Main *bmain, * Note that we do not need the RNA path for insertion operations. */ if (rna_path) { if ((rna_itemname_a != NULL && rna_itemname_a[0] != '\0') && - (rna_itemname_b != NULL && rna_itemname_b[0] != '\0')) { + (rna_itemname_b != NULL && rna_itemname_b[0] != '\0')) + { BLI_assert(STREQ(rna_itemname_a, rna_itemname_b)); char esc_item_name[RNA_PATH_BUFFSIZE]; @@ -1534,7 +1540,8 @@ static int rna_property_override_diff_propptr(Main *bmain, uint index; for (index = rna_itemindex_a; index > 0 && item_index_buff_len < sizeof(item_index_buff); - index /= 10) { + index /= 10) + { item_index_buff[item_index_buff_len++] = '0' + (char)(index % 10); } BLI_assert(index == 0); @@ -2085,7 +2092,8 @@ int rna_property_override_diff_default(Main *bmain, prev_propname_a[0] = '\0'; if (propname_a != NULL && BLI_strncpy_rlen(prev_propname_a, propname_a, sizeof(buff_prev_a)) >= - sizeof(buff_prev_a) - 1) { + sizeof(buff_prev_a) - 1) + { prev_propname_a = BLI_strdup(propname_a); } if (propname_a != buff_a) { @@ -2170,7 +2178,8 @@ bool rna_property_override_store_default(Main *UNUSED(bmain), if (!ELEM(opop->operation, IDOVERRIDE_LIBRARY_OP_ADD, IDOVERRIDE_LIBRARY_OP_SUBTRACT, - IDOVERRIDE_LIBRARY_OP_MULTIPLY)) { + IDOVERRIDE_LIBRARY_OP_MULTIPLY)) + { return changed; } @@ -2724,7 +2733,8 @@ bool rna_property_override_apply_default(Main *bmain, prop_dst, opop->subitem_reference_name, &item_ptr_ref, - &item_index_ref)) { + &item_index_ref)) + { is_valid = true; item_index_dst = item_index_ref + 1; } @@ -2734,7 +2744,8 @@ bool rna_property_override_apply_default(Main *bmain, if (RNA_property_collection_lookup_int( ptr_src, prop_src, opop->subitem_local_index, &item_ptr_src) && RNA_property_collection_lookup_int( - ptr_dst, prop_dst, opop->subitem_reference_index, &item_ptr_ref)) { + ptr_dst, prop_dst, opop->subitem_reference_index, &item_ptr_ref)) + { item_index_dst = opop->subitem_reference_index + 1; is_valid = true; } diff --git a/source/blender/makesrna/intern/rna_scene.c b/source/blender/makesrna/intern/rna_scene.c index 7ad1adb66b4..dc98be848c4 100644 --- a/source/blender/makesrna/intern/rna_scene.c +++ b/source/blender/makesrna/intern/rna_scene.c @@ -1939,10 +1939,9 @@ static void object_simplify_update(Object *ob) ob->id.tag &= ~LIB_TAG_DOIT; for (md = ob->modifiers.first; md; md = md->next) { - if (ELEM(md->type, - eModifierType_Subsurf, - eModifierType_Multires, - eModifierType_ParticleSystem)) { + if (ELEM( + md->type, eModifierType_Subsurf, eModifierType_Multires, eModifierType_ParticleSystem)) + { DEG_id_tag_update(&ob->id, ID_RECALC_GEOMETRY); } } @@ -2768,7 +2767,8 @@ static void rna_FFmpegSettings_codec_update(Main *UNUSED(bmain), AV_CODEC_ID_H264, AV_CODEC_ID_MPEG4, AV_CODEC_ID_VP9, - AV_CODEC_ID_DNXHD)) { + AV_CODEC_ID_DNXHD)) + { /* Constant Rate Factor (CRF) setting is only available for H264, * MPEG4 and WEBM/VP9 codecs. So changing encoder quality mode to * CBR as CRF is not supported. diff --git a/source/blender/makesrna/intern/rna_scene_api.c b/source/blender/makesrna/intern/rna_scene_api.c index e98e8dbea74..e4105831cfb 100644 --- a/source/blender/makesrna/intern/rna_scene_api.c +++ b/source/blender/makesrna/intern/rna_scene_api.c @@ -55,7 +55,8 @@ static void rna_Scene_frame_set(Scene *scene, Main *bmain, int frame, float subf # endif for (ViewLayer *view_layer = scene->view_layers.first; view_layer != NULL; - view_layer = view_layer->next) { + view_layer = view_layer->next) + { Depsgraph *depsgraph = BKE_scene_ensure_depsgraph(bmain, scene, view_layer); BKE_scene_graph_update_for_newframe(depsgraph); } diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index a475ccf55ba..b8cf054aeb4 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -1167,7 +1167,8 @@ static void rna_3DViewShading_type_update(Main *bmain, Scene *scene, PointerRNA View3DShading *shading = ptr->data; if (shading->type == OB_MATERIAL || - (shading->type == OB_RENDER && !BKE_scene_uses_blender_workbench(scene))) { + (shading->type == OB_RENDER && !BKE_scene_uses_blender_workbench(scene))) + { /* When switching from workbench to render or material mode the geometry of any * active sculpt session needs to be recalculated. */ for (Object *ob = bmain->objects.first; ob; ob = ob->id.next) { @@ -1476,11 +1477,13 @@ static const EnumPropertyItem *rna_3DViewShading_render_pass_itemf(bContext *C, EEVEE_RENDER_PASS_CRYPTOMATTE_OBJECT, EEVEE_RENDER_PASS_CRYPTOMATTE_ASSET, EEVEE_RENDER_PASS_CRYPTOMATTE_MATERIAL) && - !eevee_next_active) { + !eevee_next_active) + { } else if (!((!bloom_enabled && (item->value == EEVEE_RENDER_PASS_BLOOM || STREQ(item->name, "Effects"))) || - (!aov_available && STREQ(item->name, "Shader AOV")))) { + (!aov_available && STREQ(item->name, "Shader AOV")))) + { RNA_enum_item_add(&result, &totitem, item); } } @@ -3234,7 +3237,8 @@ static void rna_SpaceSpreadsheet_geometry_component_type_update(Main *UNUSED(bma ATTR_DOMAIN_POINT, ATTR_DOMAIN_EDGE, ATTR_DOMAIN_FACE, - ATTR_DOMAIN_CORNER)) { + ATTR_DOMAIN_CORNER)) + { sspreadsheet->attribute_domain = ATTR_DOMAIN_POINT; } break; @@ -3287,7 +3291,8 @@ const EnumPropertyItem *rna_SpaceSpreadsheet_attribute_domain_itemf(bContext *UN EnumPropertyItem *item_array = NULL; int items_len = 0; for (const EnumPropertyItem *item = rna_enum_attribute_domain_items; item->identifier != NULL; - item++) { + item++) + { if (component_type == GEO_COMPONENT_TYPE_MESH) { if (!ELEM(item->value, ATTR_DOMAIN_CORNER, diff --git a/source/blender/makesrna/intern/rna_tracking.c b/source/blender/makesrna/intern/rna_tracking.c index a4c3dab4b5d..b0c5dd9c1f5 100644 --- a/source/blender/makesrna/intern/rna_tracking.c +++ b/source/blender/makesrna/intern/rna_tracking.c @@ -310,7 +310,8 @@ static void rna_trackingPlaneMarker_frame_set(PointerRNA *ptr, int value) LISTBASE_FOREACH (MovieTrackingObject *, tracking_object, &tracking->objects) { LISTBASE_FOREACH (MovieTrackingPlaneTrack *, plane_track, &tracking_object->plane_tracks) { if (plane_marker >= plane_track->markers && - plane_marker < plane_track->markers + plane_track->markersnr) { + plane_marker < plane_track->markers + plane_track->markersnr) + { plane_track_of_marker = plane_track; break; } diff --git a/source/blender/makesrna/intern/rna_ui_api.c b/source/blender/makesrna/intern/rna_ui_api.c index 18c43a4496c..50bd2c1ec81 100644 --- a/source/blender/makesrna/intern/rna_ui_api.c +++ b/source/blender/makesrna/intern/rna_ui_api.c @@ -139,7 +139,8 @@ static void rna_uiItemR_with_popover(uiLayout *layout, return; } if ((RNA_property_type(prop) != PROP_ENUM) && - !ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA)) { + !ELEM(RNA_property_subtype(prop), PROP_COLOR, PROP_COLOR_GAMMA)) + { RNA_warning( "property is not an enum or color: %s.%s", RNA_struct_identifier(ptr->type), propname); return; diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c index 2373e11d76c..7f8af23e745 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -655,7 +655,8 @@ static void rna_UserDef_viewport_lights_update(Main *bmain, Scene *scene, Pointe /* If all lights are off gpu_draw resets them all, see: #27627, * so disallow them all to be disabled. */ if (U.light_param[0].flag == 0 && U.light_param[1].flag == 0 && U.light_param[2].flag == 0 && - U.light_param[3].flag == 0) { + U.light_param[3].flag == 0) + { SolidLight *light = ptr->data; light->flag |= 1; } diff --git a/source/blender/modifiers/intern/MOD_armature.c b/source/blender/modifiers/intern/MOD_armature.c index bfc30737d6c..c1feae20ffe 100644 --- a/source/blender/modifiers/intern/MOD_armature.c +++ b/source/blender/modifiers/intern/MOD_armature.c @@ -99,7 +99,8 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte /* If not using envelopes, * create relations to individual bones for more rigging flexibility. */ if ((amd->deformflag & ARM_DEF_ENVELOPE) == 0 && (amd->object->pose != NULL) && - ELEM(ctx->object->type, OB_MESH, OB_LATTICE, OB_GPENCIL_LEGACY)) { + ELEM(ctx->object->type, OB_MESH, OB_LATTICE, OB_GPENCIL_LEGACY)) + { /* If neither vertex groups nor envelopes are used, the modifier has no bone dependencies. */ if ((amd->deformflag & ARM_DEF_VGROUP) != 0) { /* Enumerate groups that match existing bones. */ diff --git a/source/blender/modifiers/intern/MOD_array.cc b/source/blender/modifiers/intern/MOD_array.cc index 44b78ef370a..bac187b4f79 100644 --- a/source/blender/modifiers/intern/MOD_array.cc +++ b/source/blender/modifiers/intern/MOD_array.cc @@ -189,7 +189,8 @@ static void dm_mvert_map_doubles(int *doubles_map, /* Scan source vertices, in #SortVertsElem sorted array, * all the while maintaining the lower bound of possible doubles in target vertices. */ for (i_source = 0, sve_source = sorted_verts_source; i_source < source_verts_num; - i_source++, sve_source++) { + i_source++, sve_source++) + { int best_target_vertex = -1; float best_dist_sq = dist * dist; float sve_source_sumco; @@ -210,7 +211,8 @@ static void dm_mvert_map_doubles(int *doubles_map, /* Skip all target vertices that are more than dist3 lower in terms of sumco */ /* and advance the overall lower bound, applicable to all remaining vertices as well. */ while ((i_target_low_bound < target_verts_num) && - (sve_target_low_bound->sum_co < sve_source_sumco - dist3)) { + (sve_target_low_bound->sum_co < sve_source_sumco - dist3)) + { i_target_low_bound++; sve_target_low_bound++; } @@ -246,7 +248,8 @@ static void dm_mvert_map_doubles(int *doubles_map, !ELEM(doubles_map[best_target_vertex], -1, best_target_vertex)) { if (compare_len_v3v3(vert_positions[sve_source->vertex_num], vert_positions[doubles_map[best_target_vertex]], - dist)) { + dist)) + { best_target_vertex = doubles_map[best_target_vertex]; } else { @@ -334,7 +337,8 @@ static void mesh_merge_transform(Mesh *result, const bke::AttributeAccessor cap_attributes = cap_mesh->attributes(); if (const VArray cap_material_indices = *cap_attributes.lookup("material_index", - ATTR_DOMAIN_FACE)) { + ATTR_DOMAIN_FACE)) + { bke::MutableAttributeAccessor result_attributes = result->attributes_for_write(); bke::SpanAttributeWriter result_material_indices = result_attributes.lookup_or_add_for_write_span("material_index", ATTR_DOMAIN_FACE); @@ -509,7 +513,8 @@ static Mesh *arrayModifier_doArray(ArrayModifierData *amd, * vertices. */ if ((size_t(count) * size_t(chunk_nverts) + size_t(start_cap_nverts) + - size_t(end_cap_nverts)) > max_verts_num) { + size_t(end_cap_nverts)) > max_verts_num) + { count = 1; offset_is_too_small = true; } @@ -531,7 +536,8 @@ static Mesh *arrayModifier_doArray(ArrayModifierData *amd, * vertices. */ else if ((size_t(count) * size_t(chunk_nverts) + size_t(start_cap_nverts) + - size_t(end_cap_nverts)) > max_verts_num) { + size_t(end_cap_nverts)) > max_verts_num) + { count = 1; BKE_modifier_set_error(ctx->object, &amd->modifier, @@ -644,7 +650,8 @@ static Mesh *arrayModifier_doArray(ArrayModifierData *amd, * close enough from current vert (otherwise no mapping at all). */ if (compare_len_v3v3(result_positions[this_chunk_index], result_positions[full_doubles_map[target]], - amd->merge_dist)) { + amd->merge_dist)) + { target = full_doubles_map[target]; } else { diff --git a/source/blender/modifiers/intern/MOD_build.cc b/source/blender/modifiers/intern/MOD_build.cc index 63cb59f09c0..613fa786119 100644 --- a/source/blender/modifiers/intern/MOD_build.cc +++ b/source/blender/modifiers/intern/MOD_build.cc @@ -128,7 +128,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * const blender::int2 &edge = edges_src[i]; if (BLI_ghash_haskey(vertHash, POINTER_FROM_INT(edge[0])) && - BLI_ghash_haskey(vertHash, POINTER_FROM_INT(edge[1]))) { + BLI_ghash_haskey(vertHash, POINTER_FROM_INT(edge[1]))) + { BLI_ghash_insert(edgeHash, (void *)hash_num, (void *)hash_num_alt); BLI_ghash_insert(edgeHash2, (void *)hash_num_alt, (void *)hash_num); hash_num++; diff --git a/source/blender/modifiers/intern/MOD_cast.c b/source/blender/modifiers/intern/MOD_cast.c index ee53ca9753c..600f64556ae 100644 --- a/source/blender/modifiers/intern/MOD_cast.c +++ b/source/blender/modifiers/intern/MOD_cast.c @@ -363,7 +363,8 @@ static void cuboid_do(CastModifierData *cmd, if (has_radius) { if (fabsf(tmp_co[0]) > cmd->radius || fabsf(tmp_co[1]) > cmd->radius || - fabsf(tmp_co[2]) > cmd->radius) { + fabsf(tmp_co[2]) > cmd->radius) + { continue; } } diff --git a/source/blender/modifiers/intern/MOD_cloth.c b/source/blender/modifiers/intern/MOD_cloth.c index aae200b3e20..7fbe7b78141 100644 --- a/source/blender/modifiers/intern/MOD_cloth.c +++ b/source/blender/modifiers/intern/MOD_cloth.c @@ -114,7 +114,8 @@ static void deformVerts(ModifierData *md, if (kb && kb->data != NULL) { float(*layerorco)[3]; if (!(layerorco = CustomData_get_layer_for_write( - &mesh_src->vdata, CD_CLOTH_ORCO, mesh_src->totvert))) { + &mesh_src->vdata, CD_CLOTH_ORCO, mesh_src->totvert))) + { layerorco = CustomData_add_layer( &mesh_src->vdata, CD_CLOTH_ORCO, CD_SET_DEFAULT, mesh_src->totvert); } diff --git a/source/blender/modifiers/intern/MOD_correctivesmooth.cc b/source/blender/modifiers/intern/MOD_correctivesmooth.cc index 04a64f525ee..24aa50ee5c9 100644 --- a/source/blender/modifiers/intern/MOD_correctivesmooth.cc +++ b/source/blender/modifiers/intern/MOD_correctivesmooth.cc @@ -455,7 +455,8 @@ static void calc_tangent_spaces(const Mesh *mesh, normalize_v3(v_dir_prev); for (; next_corner != term_corner; - prev_corner = curr_corner, curr_corner = next_corner, next_corner++) { + prev_corner = curr_corner, curr_corner = next_corner, next_corner++) + { float(*ts)[3] = r_tangent_spaces[curr_corner]; /* re-use the previous value */ @@ -582,7 +583,8 @@ static void correctivesmooth_modifier_do(ModifierData *md, /* if rest bind_coords not are defined, set them (only run during bind) */ if ((csmd->rest_source == MOD_CORRECTIVESMOOTH_RESTSOURCE_BIND) && /* signal to recalculate, whoever sets MUST also free bind coords */ - (csmd->bind_coords_num == uint(-1))) { + (csmd->bind_coords_num == uint(-1))) + { if (DEG_is_active(depsgraph)) { BLI_assert(csmd->bind_coords == nullptr); csmd->bind_coords = static_cast(MEM_dupallocN(vertexCos)); @@ -637,7 +639,8 @@ static void correctivesmooth_modifier_do(ModifierData *md, /* check to see if our deltas are still valid */ if (!csmd->delta_cache.deltas || (csmd->delta_cache.deltas_num != corner_verts.size()) || - force_delta_cache_update) { + force_delta_cache_update) + { const float(*rest_coords)[3]; bool is_rest_coords_alloc = false; diff --git a/source/blender/modifiers/intern/MOD_datatransfer.cc b/source/blender/modifiers/intern/MOD_datatransfer.cc index 7a1262c3098..96b79b56d18 100644 --- a/source/blender/modifiers/intern/MOD_datatransfer.cc +++ b/source/blender/modifiers/intern/MOD_datatransfer.cc @@ -182,7 +182,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * if (((result == me) || (me_positions == result_positions) || (me_edges.data() == result_edges.data())) && - (dtmd->data_types & DT_TYPES_AFFECT_MESH)) { + (dtmd->data_types & DT_TYPES_AFFECT_MESH)) + { /* We need to duplicate data here, otherwise setting custom normals, edges' sharpness, etc., * could modify org mesh, see #43671. */ result = (Mesh *)BKE_id_copy_ex(nullptr, &me_mod->id, nullptr, LIB_ID_COPY_LOCALIZE); @@ -213,7 +214,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * dtmd->mix_factor, dtmd->defgrp_name, invert_vgroup, - &reports)) { + &reports)) + { result->runtime->is_original_bmesh = false; } diff --git a/source/blender/modifiers/intern/MOD_displace.cc b/source/blender/modifiers/intern/MOD_displace.cc index d95024d7b9f..32608098885 100644 --- a/source/blender/modifiers/intern/MOD_displace.cc +++ b/source/blender/modifiers/intern/MOD_displace.cc @@ -120,7 +120,8 @@ static void updateDepsgraph(ModifierData *md, const ModifierUpdateDepsgraphConte bool need_transform_relation = false; if (dmd->space == MOD_DISP_SPACE_GLOBAL && - ELEM(dmd->direction, MOD_DISP_DIR_X, MOD_DISP_DIR_Y, MOD_DISP_DIR_Z, MOD_DISP_DIR_RGB_XYZ)) { + ELEM(dmd->direction, MOD_DISP_DIR_X, MOD_DISP_DIR_Y, MOD_DISP_DIR_Z, MOD_DISP_DIR_RGB_XYZ)) + { need_transform_relation = true; } @@ -322,7 +323,8 @@ static void displaceModifier_do(DisplaceModifierData *dmd, } } else if (ELEM(direction, MOD_DISP_DIR_X, MOD_DISP_DIR_Y, MOD_DISP_DIR_Z, MOD_DISP_DIR_RGB_XYZ) && - use_global_direction) { + use_global_direction) + { copy_m4_m4(local_mat, ob->object_to_world); } @@ -426,7 +428,8 @@ static void panel_draw(const bContext *C, Panel *panel) uiItemR(col, ptr, "texture_coords_object", 0, IFACE_("Object"), ICON_NONE); PointerRNA texture_coords_obj_ptr = RNA_pointer_get(ptr, "texture_coords_object"); if (!RNA_pointer_is_null(&texture_coords_obj_ptr) && - (RNA_enum_get(&texture_coords_obj_ptr, "type") == OB_ARMATURE)) { + (RNA_enum_get(&texture_coords_obj_ptr, "type") == OB_ARMATURE)) + { PointerRNA texture_coords_obj_data_ptr = RNA_pointer_get(&texture_coords_obj_ptr, "data"); uiItemPointerR(col, ptr, @@ -449,7 +452,8 @@ static void panel_draw(const bContext *C, Panel *panel) MOD_DISP_DIR_X, MOD_DISP_DIR_Y, MOD_DISP_DIR_Z, - MOD_DISP_DIR_RGB_XYZ)) { + MOD_DISP_DIR_RGB_XYZ)) + { uiItemR(col, ptr, "space", 0, nullptr, ICON_NONE); } diff --git a/source/blender/modifiers/intern/MOD_dynamicpaint.c b/source/blender/modifiers/intern/MOD_dynamicpaint.c index fd407883323..0bbb08fdba9 100644 --- a/source/blender/modifiers/intern/MOD_dynamicpaint.c +++ b/source/blender/modifiers/intern/MOD_dynamicpaint.c @@ -83,12 +83,14 @@ static void requiredDataMask(ModifierData *md, CustomData_MeshMasks *r_cddata_ma for (; surface; surface = surface->next) { /* UVs: #CD_PROP_FLOAT2. */ if (surface->format == MOD_DPAINT_SURFACE_F_IMAGESEQ || - surface->init_color_type == MOD_DPAINT_INITIAL_TEXTURE) { + surface->init_color_type == MOD_DPAINT_INITIAL_TEXTURE) + { r_cddata_masks->lmask |= CD_MASK_PROP_FLOAT2; } /* Vertex Colors: #CD_PROP_BYTE_COLOR. */ if (surface->type == MOD_DPAINT_SURFACE_T_PAINT || - surface->init_color_type == MOD_DPAINT_INITIAL_VERTEXCOLOR) { + surface->init_color_type == MOD_DPAINT_INITIAL_VERTEXCOLOR) + { r_cddata_masks->lmask |= CD_MASK_PROP_BYTE_COLOR; } /* Vertex Weights: #CD_MDEFORMVERT. */ diff --git a/source/blender/modifiers/intern/MOD_edgesplit.c b/source/blender/modifiers/intern/MOD_edgesplit.c index 13d322822b5..45f7e568e13 100644 --- a/source/blender/modifiers/intern/MOD_edgesplit.c +++ b/source/blender/modifiers/intern/MOD_edgesplit.c @@ -76,7 +76,8 @@ Mesh *doEdgeSplit(const Mesh *mesh, EdgeSplitModifierData *emd) /* O° angle setting, we want to split on all edges. */ do_split_all || /* 2 face edge - check angle. */ - (dot_v3v3(l1->f->no, l2->f->no) < threshold)) { + (dot_v3v3(l1->f->no, l2->f->no) < threshold)) + { BM_elem_flag_enable(e, BM_ELEM_TAG); } } diff --git a/source/blender/modifiers/intern/MOD_explode.cc b/source/blender/modifiers/intern/MOD_explode.cc index f9d5f8bc037..cd6ea92bc39 100644 --- a/source/blender/modifiers/intern/MOD_explode.cc +++ b/source/blender/modifiers/intern/MOD_explode.cc @@ -950,7 +950,8 @@ static Mesh *explodeMesh(ExplodeModifierData *emd, if ((pa->alive == PARS_UNBORN && (emd->flag & eExplodeFlag_Unborn) == 0) || (pa->alive == PARS_ALIVE && (emd->flag & eExplodeFlag_Alive) == 0) || - (pa->alive == PARS_DEAD && (emd->flag & eExplodeFlag_Dead) == 0)) { + (pa->alive == PARS_DEAD && (emd->flag & eExplodeFlag_Dead) == 0)) + { delface++; continue; } @@ -1161,7 +1162,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * /* 1. find faces to be exploded if needed */ if (emd->facepa == nullptr || psmd->flag & eParticleSystemFlag_Pars || emd->flag & eExplodeFlag_CalcFaces || - MEM_allocN_len(emd->facepa) / sizeof(int) != mesh->totface) { + MEM_allocN_len(emd->facepa) / sizeof(int) != mesh->totface) + { if (psmd->flag & eParticleSystemFlag_Pars) { psmd->flag &= ~eParticleSystemFlag_Pars; } diff --git a/source/blender/modifiers/intern/MOD_hook.c b/source/blender/modifiers/intern/MOD_hook.c index 144c1c44077..723be5a6165 100644 --- a/source/blender/modifiers/intern/MOD_hook.c +++ b/source/blender/modifiers/intern/MOD_hook.c @@ -464,7 +464,8 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel) col = uiLayoutColumn(layout, false); uiItemR(col, ptr, "object", 0, NULL, ICON_NONE); if (!RNA_pointer_is_null(&hook_object_ptr) && - RNA_enum_get(&hook_object_ptr, "type") == OB_ARMATURE) { + RNA_enum_get(&hook_object_ptr, "type") == OB_ARMATURE) + { PointerRNA hook_object_data_ptr = RNA_pointer_get(&hook_object_ptr, "data"); uiItemPointerR( col, ptr, "subtarget", &hook_object_data_ptr, "bones", IFACE_("Bone"), ICON_NONE); diff --git a/source/blender/modifiers/intern/MOD_laplaciansmooth.cc b/source/blender/modifiers/intern/MOD_laplaciansmooth.cc index 74e02a6c9ca..7a2ba55acf5 100644 --- a/source/blender/modifiers/intern/MOD_laplaciansmooth.cc +++ b/source/blender/modifiers/intern/MOD_laplaciansmooth.cc @@ -198,7 +198,8 @@ static void init_laplacian_matrix(LaplacianSystem *sys) int corner_curr = corner_term - 1; for (; corner_next != corner_term; - corner_prev = corner_curr, corner_curr = corner_next, corner_next++) { + corner_prev = corner_curr, corner_curr = corner_next, corner_next++) + { const float *v_prev = sys->vertexCos[corner_verts[corner_prev]]; const float *v_curr = sys->vertexCos[corner_verts[corner_curr]]; const float *v_next = sys->vertexCos[corner_verts[corner_next]]; @@ -255,11 +256,13 @@ static void fill_laplacian_matrix(LaplacianSystem *sys) int corner_curr = corner_term - 1; for (; corner_next != corner_term; - corner_prev = corner_curr, corner_curr = corner_next, corner_next++) { + corner_prev = corner_curr, corner_curr = corner_next, corner_next++) + { /* Is ring if number of faces == number of edges around vertex. */ if (sys->ne_ed_num[corner_verts[corner_curr]] == sys->ne_fa_num[corner_verts[corner_curr]] && - sys->zerola[corner_verts[corner_curr]] == false) { + sys->zerola[corner_verts[corner_curr]] == false) + { EIG_linear_solver_matrix_add(sys->context, corner_verts[corner_curr], corner_verts[corner_next], @@ -272,7 +275,8 @@ static void fill_laplacian_matrix(LaplacianSystem *sys) sys->vweights[corner_verts[corner_curr]]); } if (sys->ne_ed_num[corner_verts[corner_next]] == sys->ne_fa_num[corner_verts[corner_next]] && - sys->zerola[corner_verts[corner_next]] == false) { + sys->zerola[corner_verts[corner_next]] == false) + { EIG_linear_solver_matrix_add(sys->context, corner_verts[corner_next], corner_verts[corner_curr], @@ -285,7 +289,8 @@ static void fill_laplacian_matrix(LaplacianSystem *sys) sys->vweights[corner_verts[corner_next]]); } if (sys->ne_ed_num[corner_verts[corner_prev]] == sys->ne_fa_num[corner_verts[corner_prev]] && - sys->zerola[corner_verts[corner_prev]] == false) { + sys->zerola[corner_verts[corner_prev]] == false) + { EIG_linear_solver_matrix_add(sys->context, corner_verts[corner_prev], corner_verts[corner_curr], @@ -306,7 +311,8 @@ static void fill_laplacian_matrix(LaplacianSystem *sys) /* Is boundary */ if (sys->ne_ed_num[idv1] != sys->ne_fa_num[idv1] && sys->ne_ed_num[idv2] != sys->ne_fa_num[idv2] && sys->zerola[idv1] == false && - sys->zerola[idv2] == false) { + sys->zerola[idv2] == false) + { EIG_linear_solver_matrix_add( sys->context, idv1, idv2, sys->eweights[i] * sys->vlengths[idv1]); EIG_linear_solver_matrix_add( diff --git a/source/blender/modifiers/intern/MOD_mask.cc b/source/blender/modifiers/intern/MOD_mask.cc index 25bccff6670..b0553b51d15 100644 --- a/source/blender/modifiers/intern/MOD_mask.cc +++ b/source/blender/modifiers/intern/MOD_mask.cc @@ -621,7 +621,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext * /*ctx*/, M /* Quick test to see if we can return early. */ if (!ELEM(mmd->mode, MOD_MASK_MODE_ARM, MOD_MASK_MODE_VGROUP) || (mesh->totvert == 0) || - BLI_listbase_is_empty(&mesh->vertex_group_names)) { + BLI_listbase_is_empty(&mesh->vertex_group_names)) + { return mesh; } diff --git a/source/blender/modifiers/intern/MOD_meshcache_mdd.c b/source/blender/modifiers/intern/MOD_meshcache_mdd.c index 0a812c42fe5..305bba63998 100644 --- a/source/blender/modifiers/intern/MOD_meshcache_mdd.c +++ b/source/blender/modifiers/intern/MOD_meshcache_mdd.c @@ -227,14 +227,16 @@ bool MOD_meshcache_read_mdd_frame(FILE *fp, interp, index_range, &factor, /* read into these values */ - err_str) == false) { + err_str) == false) + { return false; } if (index_range[0] == index_range[1]) { /* read single */ if ((BLI_fseek(fp, 0, SEEK_SET) == 0) && - MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str)) { + MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str)) + { return true; } @@ -245,7 +247,8 @@ bool MOD_meshcache_read_mdd_frame(FILE *fp, if ((BLI_fseek(fp, 0, SEEK_SET) == 0) && MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str) && (BLI_fseek(fp, 0, SEEK_SET) == 0) && - MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[1], factor, err_str)) { + MOD_meshcache_read_mdd_index(fp, vertexCos, verts_tot, index_range[1], factor, err_str)) + { return true; } diff --git a/source/blender/modifiers/intern/MOD_meshcache_pc2.c b/source/blender/modifiers/intern/MOD_meshcache_pc2.c index 27fea20bb13..8eb17475a50 100644 --- a/source/blender/modifiers/intern/MOD_meshcache_pc2.c +++ b/source/blender/modifiers/intern/MOD_meshcache_pc2.c @@ -196,14 +196,16 @@ bool MOD_meshcache_read_pc2_frame(FILE *fp, interp, index_range, &factor, /* read into these values */ - err_str) == false) { + err_str) == false) + { return false; } if (index_range[0] == index_range[1]) { /* read single */ if ((BLI_fseek(fp, 0, SEEK_SET) == 0) && - MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str)) { + MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str)) + { return true; } @@ -214,7 +216,8 @@ bool MOD_meshcache_read_pc2_frame(FILE *fp, if ((BLI_fseek(fp, 0, SEEK_SET) == 0) && MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[0], 1.0f, err_str) && (BLI_fseek(fp, 0, SEEK_SET) == 0) && - MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[1], factor, err_str)) { + MOD_meshcache_read_pc2_index(fp, vertexCos, verts_tot, index_range[1], factor, err_str)) + { return true; } diff --git a/source/blender/modifiers/intern/MOD_meshsequencecache.cc b/source/blender/modifiers/intern/MOD_meshsequencecache.cc index 5230facc51e..adf33bd0071 100644 --- a/source/blender/modifiers/intern/MOD_meshsequencecache.cc +++ b/source/blender/modifiers/intern/MOD_meshsequencecache.cc @@ -216,7 +216,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * * flags) and duplicate those too. * XXX(Hans): This probably isn't true anymore with various CoW improvements, etc. */ if ((me_positions.data() == mesh_positions.data()) || (me_edges.data() == mesh_edges.data()) || - (me_polys.data() == mesh_polys.data())) { + (me_polys.data() == mesh_polys.data())) + { /* We need to duplicate data here, otherwise we'll modify org mesh, see #51701. */ mesh = reinterpret_cast( BKE_id_copy_ex(nullptr, diff --git a/source/blender/modifiers/intern/MOD_nodes.cc b/source/blender/modifiers/intern/MOD_nodes.cc index 655e1d826ba..80b04ef0564 100644 --- a/source/blender/modifiers/intern/MOD_nodes.cc +++ b/source/blender/modifiers/intern/MOD_nodes.cc @@ -118,8 +118,8 @@ static void add_used_ids_from_sockets(const ListBase &sockets, Set &ids) break; } case SOCK_COLLECTION: { - if (Collection *collection = - ((bNodeSocketValueCollection *)socket->default_value)->value) { + if (Collection *collection = ((bNodeSocketValueCollection *)socket->default_value)->value) + { ids.add(&collection->id); } break; @@ -824,7 +824,8 @@ static void initialize_group_input(const bNodeTree &tree, static const lf::FunctionNode *find_viewer_lf_node(const bNode &viewer_bnode) { if (const nodes::GeometryNodesLazyFunctionGraphInfo *lf_graph_info = - nodes::ensure_geometry_nodes_lazy_function_graph(viewer_bnode.owner_tree())) { + nodes::ensure_geometry_nodes_lazy_function_graph(viewer_bnode.owner_tree())) + { return lf_graph_info->mapping.viewer_node_map.lookup_default(&viewer_bnode, nullptr); } return nullptr; @@ -832,7 +833,8 @@ static const lf::FunctionNode *find_viewer_lf_node(const bNode &viewer_bnode) static const lf::FunctionNode *find_group_lf_node(const bNode &group_bnode) { if (const nodes::GeometryNodesLazyFunctionGraphInfo *lf_graph_info = - nodes::ensure_geometry_nodes_lazy_function_graph(group_bnode.owner_tree())) { + nodes::ensure_geometry_nodes_lazy_function_graph(group_bnode.owner_tree())) + { return lf_graph_info->mapping.group_node_map.lookup_default(&group_bnode, nullptr); } return nullptr; @@ -947,7 +949,8 @@ static void find_socket_log_contexts(const NodesModifierData &nmd, const SpaceNode &snode = *reinterpret_cast(sl); if (const std::optional hash = geo_log::GeoModifierLog::get_compute_context_hash_for_node_editor( - snode, nmd.modifier.name)) { + snode, nmd.modifier.name)) + { r_socket_log_contexts.add(*hash); } } @@ -1032,7 +1035,8 @@ static Vector compute_attributes_to_store( for (const GeometryComponentType component_type : {GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE, - GEO_COMPONENT_TYPE_INSTANCES}) { + GEO_COMPONENT_TYPE_INSTANCES}) + { if (!geometry.has(component_type)) { continue; } @@ -1080,14 +1084,16 @@ static void store_computed_output_attributes( /* Attempt to remove the attribute if it already exists but the domain and type don't match. * Removing the attribute won't succeed if it is built in and non-removable. */ if (meta_data.has_value() && - (meta_data->domain != store.domain || meta_data->data_type != data_type)) { + (meta_data->domain != store.domain || meta_data->data_type != data_type)) + { attributes.remove(store.name); } /* Try to create the attribute reusing the stored buffer. This will only succeed if the * attribute didn't exist before, or if it existed but was removed above. */ if (attributes.add( - store.name, store.domain, data_type, bke::AttributeInitMoveArray(store.data.data()))) { + store.name, store.domain, data_type, bke::AttributeInitMoveArray(store.data.data()))) + { continue; } diff --git a/source/blender/modifiers/intern/MOD_normal_edit.cc b/source/blender/modifiers/intern/MOD_normal_edit.cc index 04c77f76ff0..0ce2be95850 100644 --- a/source/blender/modifiers/intern/MOD_normal_edit.cc +++ b/source/blender/modifiers/intern/MOD_normal_edit.cc @@ -147,7 +147,8 @@ static void mix_normals(const float mix_factor, } for (i = corner_verts.size(), no_new = nos_new, no_old = nos_old, wfac = facs; i--; - no_new++, no_old++, wfac++) { + no_new++, no_old++, wfac++) + { const float fac = facs ? *wfac * mix_factor : mix_factor; switch (mix_mode) { @@ -325,7 +326,8 @@ static void normalEditModifier_do_radial(NormalEditModifierData *enmd, if (do_polynors_fix && polygons_check_flip( - corner_verts, corner_edges, nos.data(), &mesh->ldata, polys, mesh->poly_normals())) { + corner_verts, corner_edges, nos.data(), &mesh->ldata, polys, mesh->poly_normals())) + { BKE_mesh_tag_face_winding_changed(mesh); } const bool *sharp_faces = static_cast( @@ -432,7 +434,8 @@ static void normalEditModifier_do_directional(NormalEditModifierData *enmd, if (do_polynors_fix && polygons_check_flip( - corner_verts, corner_edges, nos.data(), &mesh->ldata, polys, mesh->poly_normals())) { + corner_verts, corner_edges, nos.data(), &mesh->ldata, polys, mesh->poly_normals())) + { BKE_mesh_tag_face_winding_changed(mesh); } const bool *sharp_faces = static_cast( diff --git a/source/blender/modifiers/intern/MOD_particleinstance.cc b/source/blender/modifiers/intern/MOD_particleinstance.cc index 9948f300730..4d5006542d7 100644 --- a/source/blender/modifiers/intern/MOD_particleinstance.cc +++ b/source/blender/modifiers/intern/MOD_particleinstance.cc @@ -84,8 +84,8 @@ static bool isDisabled(const Scene *scene, ModifierData *md, bool useRenderParam /* If the psys modifier is disabled we cannot use its data. * First look up the psys modifier from the object, then check if it is enabled. */ - for (ob_md = static_cast(pimd->ob->modifiers.first); ob_md; - ob_md = ob_md->next) { + for (ob_md = static_cast(pimd->ob->modifiers.first); ob_md; ob_md = ob_md->next) + { if (ob_md->type == eModifierType_ParticleSystem) { ParticleSystemModifierData *psmd = (ParticleSystemModifierData *)ob_md; if (psmd->psys == psys) { @@ -368,7 +368,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * /* get particle state */ if ((psys->flag & (PSYS_HAIR_DONE | PSYS_KEYED) || psys->pointcache->flag & PTCACHE_BAKED) && - (pimd->flag & eParticleInstanceFlag_Path)) { + (pimd->flag & eParticleInstanceFlag_Path)) + { float ran = 0.0f; if (pimd->random_position != 0.0f) { ran = pimd->random_position * BLI_hash_frand(psys->seed + p); diff --git a/source/blender/modifiers/intern/MOD_particlesystem.cc b/source/blender/modifiers/intern/MOD_particlesystem.cc index 433e398a9f2..b042a1af8e9 100644 --- a/source/blender/modifiers/intern/MOD_particlesystem.cc +++ b/source/blender/modifiers/intern/MOD_particlesystem.cc @@ -201,7 +201,8 @@ static void deformVerts(ModifierData *md, * instance. */ if (had_mesh_final && (psmd->mesh_final->totvert != psmd->totdmvert || psmd->mesh_final->totedge != psmd->totdmedge || - psmd->mesh_final->totface != psmd->totdmface)) { + psmd->mesh_final->totface != psmd->totdmface)) + { psys->recalc |= ID_RECALC_PSYS_RESET; } psmd->totdmvert = psmd->mesh_final->totvert; diff --git a/source/blender/modifiers/intern/MOD_screw.cc b/source/blender/modifiers/intern/MOD_screw.cc index 17f21b6674e..dd4f6ce3971 100644 --- a/source/blender/modifiers/intern/MOD_screw.cc +++ b/source/blender/modifiers/intern/MOD_screw.cc @@ -359,7 +359,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * * NOTE: smaller than `FLT_EPSILON * 100` * gives problems with float precision so its never closed. */ if (fabsf(screw_ofs) <= (FLT_EPSILON * 100.0f) && - fabsf(fabsf(angle) - (float(M_PI) * 2.0f)) <= (FLT_EPSILON * 100.0f) && step_tot > 3) { + fabsf(fabsf(angle) - (float(M_PI) * 2.0f)) <= (FLT_EPSILON * 100.0f) && step_tot > 3) + { close = true; step_tot--; diff --git a/source/blender/modifiers/intern/MOD_shrinkwrap.c b/source/blender/modifiers/intern/MOD_shrinkwrap.c index 5d37fd81b0e..1341214be53 100644 --- a/source/blender/modifiers/intern/MOD_shrinkwrap.c +++ b/source/blender/modifiers/intern/MOD_shrinkwrap.c @@ -96,8 +96,8 @@ static void deformVerts(ModifierData *md, struct Scene *scene = DEG_get_evaluated_scene(ctx->depsgraph); Mesh *mesh_src = NULL; - if (ELEM(ctx->object->type, OB_MESH, OB_LATTICE) || - (swmd->shrinkType == MOD_SHRINKWRAP_PROJECT)) { + if (ELEM(ctx->object->type, OB_MESH, OB_LATTICE) || (swmd->shrinkType == MOD_SHRINKWRAP_PROJECT)) + { /* mesh_src is needed for vgroups, but also used as ShrinkwrapCalcData.vert when projecting. * Avoid time-consuming mesh conversion for curves when not projecting. */ mesh_src = MOD_deform_mesh_eval_get(ctx->object, NULL, mesh, NULL, verts_num, false); @@ -208,7 +208,8 @@ static void panel_draw(const bContext *UNUSED(C), Panel *panel) if (ELEM(wrap_method, MOD_SHRINKWRAP_PROJECT, MOD_SHRINKWRAP_NEAREST_SURFACE, - MOD_SHRINKWRAP_TARGET_PROJECT)) { + MOD_SHRINKWRAP_TARGET_PROJECT)) + { uiItemR(layout, ptr, "wrap_mode", 0, NULL, ICON_NONE); } diff --git a/source/blender/modifiers/intern/MOD_simpledeform.c b/source/blender/modifiers/intern/MOD_simpledeform.c index f0e2c87f53a..d6fd2389da8 100644 --- a/source/blender/modifiers/intern/MOD_simpledeform.c +++ b/source/blender/modifiers/intern/MOD_simpledeform.c @@ -532,7 +532,8 @@ static void restrictions_panel_draw(const bContext *UNUSED(C), Panel *panel) if (ELEM(deform_method, MOD_SIMPLEDEFORM_MODE_TAPER, MOD_SIMPLEDEFORM_MODE_STRETCH, - MOD_SIMPLEDEFORM_MODE_TWIST)) { + MOD_SIMPLEDEFORM_MODE_TWIST)) + { int deform_axis = RNA_enum_get(ptr, "deform_axis"); row = uiLayoutRowWithHeading(layout, true, IFACE_("Lock")); diff --git a/source/blender/modifiers/intern/MOD_skin.cc b/source/blender/modifiers/intern/MOD_skin.cc index b3bcfbb08fc..5223acd2e39 100644 --- a/source/blender/modifiers/intern/MOD_skin.cc +++ b/source/blender/modifiers/intern/MOD_skin.cc @@ -326,7 +326,8 @@ static bool build_hull(SkinOutput *so, Frame **frames, int totframe) if (!frame->detached && (!BM_edge_exists(frame->verts[0], frame->verts[1]) || !BM_edge_exists(frame->verts[1], frame->verts[2]) || !BM_edge_exists(frame->verts[2], frame->verts[3]) || - !BM_edge_exists(frame->verts[3], frame->verts[0]))) { + !BM_edge_exists(frame->verts[3], frame->verts[0]))) + { frame->detached = true; } } @@ -852,7 +853,8 @@ static int calc_edge_subdivisions(const float (*vert_positions)[3], /* If either end is a branch node marked 'loose', don't subdivide * the edge (or subdivide just twice if both are branches) */ if ((v1_branch && (evs[0]->flag & MVERT_SKIN_LOOSE)) || - (v2_branch && (evs[1]->flag & MVERT_SKIN_LOOSE))) { + (v2_branch && (evs[1]->flag & MVERT_SKIN_LOOSE))) + { if (v1_branch && v2_branch) { return 2; } @@ -1469,7 +1471,8 @@ static void quad_from_tris(BMEdge *e, BMFace *adj[2], BMVert *ndx[4]) /* When the triangle edge cuts across our quad-to-be, * throw in the second triangle's vertex */ if (ELEM(tri[0][i], e->v1, e->v2) && - (tri[0][(i + 1) % 3] == e->v1 || tri[0][(i + 1) % 3] == e->v2)) { + (tri[0][(i + 1) % 3] == e->v1 || tri[0][(i + 1) % 3] == e->v2)) + { j++; ndx[j] = opp; } @@ -1548,7 +1551,8 @@ static void hull_merge_triangles(SkinOutput *so, const SkinModifierData *smd) /* If both triangles still free, and if they don't already * share a border with another face, output as a quad */ if (!BM_elem_flag_test(adj[0], BM_ELEM_TAG) && !BM_elem_flag_test(adj[1], BM_ELEM_TAG) && - !BM_face_share_face_check(adj[0], adj[1])) { + !BM_face_share_face_check(adj[0], adj[1])) + { add_quad_from_tris(so, e, adj); BM_elem_flag_enable(adj[0], BM_ELEM_TAG); BM_elem_flag_enable(adj[1], BM_ELEM_TAG); diff --git a/source/blender/modifiers/intern/MOD_solidify.cc b/source/blender/modifiers/intern/MOD_solidify.cc index a18650e6c4b..f216bf9683e 100644 --- a/source/blender/modifiers/intern/MOD_solidify.cc +++ b/source/blender/modifiers/intern/MOD_solidify.cc @@ -59,7 +59,8 @@ static void requiredDataMask(ModifierData *md, CustomData_MeshMasks *r_cddata_ma /* ask for vertexgroups if we need them */ if (smd->defgrp_name[0] != '\0' || smd->shell_defgrp_name[0] != '\0' || - smd->rim_defgrp_name[0] != '\0') { + smd->rim_defgrp_name[0] != '\0') + { r_cddata_masks->vmask |= CD_MASK_MDEFORMVERT; } } diff --git a/source/blender/modifiers/intern/MOD_solidify_extrude.cc b/source/blender/modifiers/intern/MOD_solidify_extrude.cc index 394fb1ffead..ef4d87492fe 100644 --- a/source/blender/modifiers/intern/MOD_solidify_extrude.cc +++ b/source/blender/modifiers/intern/MOD_solidify_extrude.cc @@ -93,7 +93,8 @@ static void mesh_calc_hq_normal(Mesh *mesh, int i; const blender::int2 *edge; for (i = 0, edge = edges.data(), edge_ref = edge_ref_array; i < edges.size(); - i++, edge++, edge_ref++) { + i++, edge++, edge_ref++) + { /* Get the edge vert indices, and edge value (the face indices that use it) */ if (edgeref_is_init(edge_ref) && (edge_ref->p1 != -1)) { @@ -534,7 +535,8 @@ Mesh *MOD_solidify_extrude_modifyMesh(ModifierData *md, const ModifierEvalContex for (uint i = 0; i < edges_num; i++) { const blender::int2 &edge = orig_edges[i]; if (!ELEM(edge_user_pairs[i][0], INVALID_UNUSED, INVALID_PAIR) && - !ELEM(edge_user_pairs[i][1], INVALID_UNUSED, INVALID_PAIR)) { + !ELEM(edge_user_pairs[i][1], INVALID_UNUSED, INVALID_PAIR)) + { const float *n0 = poly_normals[edge_user_pairs[i][0]]; const float *n1 = poly_normals[edge_user_pairs[i][1]]; sub_v3_v3v3(e, orig_vert_positions[edge[0]], orig_vert_positions[edge[1]]); @@ -744,7 +746,8 @@ Mesh *MOD_solidify_extrude_modifyMesh(ModifierData *md, const ModifierEvalContex /* skip 3+ face user edges */ if ((check_non_manifold == false) || LIKELY(!BLI_BITMAP_TEST(edge_tmp_tag, poly_edges[i_curr]) && - !BLI_BITMAP_TEST(edge_tmp_tag, poly_edges[i_next]))) { + !BLI_BITMAP_TEST(edge_tmp_tag, poly_edges[i_next]))) + { vert_angles[vidx] += shell_v3v3_normalized_to_dist(vert_nors[vidx], poly_normals[i]) * angle; } @@ -838,7 +841,8 @@ Mesh *MOD_solidify_extrude_modifyMesh(ModifierData *md, const ModifierEvalContex for (i = 0; i < edges_num; i++) { const blender::int2 &edge = orig_edges[i]; if (!ELEM(edge_user_pairs[i][0], INVALID_UNUSED, INVALID_PAIR) && - !ELEM(edge_user_pairs[i][1], INVALID_UNUSED, INVALID_PAIR)) { + !ELEM(edge_user_pairs[i][1], INVALID_UNUSED, INVALID_PAIR)) + { const float *n0 = poly_normals[edge_user_pairs[i][0]]; const float *n1 = poly_normals[edge_user_pairs[i][1]]; if (do_angle_clamp) { diff --git a/source/blender/modifiers/intern/MOD_solidify_nonmanifold.cc b/source/blender/modifiers/intern/MOD_solidify_nonmanifold.cc index 415334056e1..18dff6a4565 100644 --- a/source/blender/modifiers/intern/MOD_solidify_nonmanifold.cc +++ b/source/blender/modifiers/intern/MOD_solidify_nonmanifold.cc @@ -388,7 +388,8 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, bool can_merge = true; for (uint k = 0; k < edges_num && can_merge; k++) { if (k != i && edge_adj_faces_len[k] > 0 && - (ELEM(vm[orig_edges[k][0]], v1, v2) != ELEM(vm[orig_edges[k][1]], v1, v2))) { + (ELEM(vm[orig_edges[k][0]], v1, v2) != ELEM(vm[orig_edges[k][1]], v1, v2))) + { for (uint j = 0; j < edge_adj_faces[k]->faces_len && can_merge; j++) { const blender::IndexRange poly = orig_polys[edge_adj_faces[k]->faces[j]]; uint changes = 0; @@ -550,7 +551,8 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, for (uint k = 0; k < i_adj_faces->faces_len; k++) { for (uint l = 0; l < invalid_adj_faces->faces_len; l++) { if (i_adj_faces->faces[k] == invalid_adj_faces->faces[l] && - i_adj_faces->faces[k] != MOD_SOLIDIFY_EMPTY_TAG) { + i_adj_faces->faces[k] != MOD_SOLIDIFY_EMPTY_TAG) + { i_adj_faces->faces[k] = MOD_SOLIDIFY_EMPTY_TAG; invalid_adj_faces->faces[l] = MOD_SOLIDIFY_EMPTY_TAG; j++; @@ -974,7 +976,8 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, while (!edge && j < unassigned_edges_len) { edge = unassigned_edges[j++]; if (edge && last_open_edge_track && - (edge->faces[0] != last_open_edge_track || edge->faces[1] != nullptr)) { + (edge->faces[0] != last_open_edge_track || edge->faces[1] != nullptr)) + { edge = nullptr; } } @@ -1160,7 +1163,8 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, (g.is_orig_closed && (real_k <= (first_unique_end == -1 ? 0 : first_unique_end) + int(edges_len) || - first_split != last_split))) { + first_split != last_split))) + { const uint k = real_k % edges_len; if (!doubles[k]) { if (first_unique_end != -1 && unique_start == -1) { @@ -1457,7 +1461,8 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, for (uint l = 0; l < 2; l++) { NewFaceRef *face = edge->faces[l]; if (face && (first_edge == nullptr || - (first_edge->faces[0] != face && first_edge->faces[1] != face))) { + (first_edge->faces[0] != face && first_edge->faces[1] != face))) + { float ofs = face->reversed ? ofs_back_clamped : ofs_front_clamped; /* Use face_weight here to make faces thinner. */ if (do_flat_faces) { @@ -1669,7 +1674,8 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, for (uint l = 0; l < 2; l++) { NewFaceRef *face = edge->faces[l]; if (face && (first_edge == nullptr || - (first_edge->faces[0] != face && first_edge->faces[1] != face))) { + (first_edge->faces[0] != face && first_edge->faces[1] != face))) + { float angle = 1.0f; float ofs = face->reversed ? -ofs_back_clamped : ofs_front_clamped; /* Use face_weight here to make faces thinner. */ @@ -2050,7 +2056,8 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, const uint v2 = (*l)->link_edge_groups[1]->new_vert; uint insert = edge_index; if (has_singularities && ((*l)->link_edge_groups[0]->is_singularity && - (*l)->link_edge_groups[1]->is_singularity)) { + (*l)->link_edge_groups[1]->is_singularity)) + { uint j = 0; for (uint(*p)[2] = singularity_edges; j < totsingularity; p++, j++) { if (((*p)[0] == v1 && (*p)[1] == v2) || ((*p)[0] == v2 && (*p)[1] == v1)) { @@ -2525,7 +2532,8 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md, uint valid_edges = 0; uint k = 0; while (totloop > 0 && (!fr->link_edges[totloop - 1] || - fr->link_edges[totloop - 1]->new_edge == MOD_SOLIDIFY_EMPTY_TAG)) { + fr->link_edges[totloop - 1]->new_edge == MOD_SOLIDIFY_EMPTY_TAG)) + { totloop--; } if (totloop > 0) { diff --git a/source/blender/modifiers/intern/MOD_surface.c b/source/blender/modifiers/intern/MOD_surface.c index be8b671a211..c38ec66d28f 100644 --- a/source/blender/modifiers/intern/MOD_surface.c +++ b/source/blender/modifiers/intern/MOD_surface.c @@ -130,7 +130,8 @@ static void deformVerts(ModifierData *md, if ((mesh_verts_num != surmd->runtime.verts_num) || (surmd->runtime.vert_positions_prev == NULL) || (surmd->runtime.vert_velocities == NULL) || - (cfra != surmd->runtime.cfra_prev + 1)) { + (cfra != surmd->runtime.cfra_prev + 1)) + { MEM_SAFE_FREE(surmd->runtime.vert_positions_prev); MEM_SAFE_FREE(surmd->runtime.vert_velocities); diff --git a/source/blender/modifiers/intern/MOD_surfacedeform.cc b/source/blender/modifiers/intern/MOD_surfacedeform.cc index 775e4f17485..728cbeeb02b 100644 --- a/source/blender/modifiers/intern/MOD_surfacedeform.cc +++ b/source/blender/modifiers/intern/MOD_surfacedeform.cc @@ -406,7 +406,8 @@ BLI_INLINE uint nearestVert(SDefBindCalcData *const data, const float point_co[3 const blender::int2 &edge = data->edges[index]; if (len_squared_v3v3(point_co, data->targetCos[edge[0]]) < - len_squared_v3v3(point_co, data->targetCos[edge[1]])) { + len_squared_v3v3(point_co, data->targetCos[edge[1]])) + { return edge[0]; } @@ -652,7 +653,8 @@ BLI_INLINE SDefBindWeightData *computeBindWeights(SDefBindCalcData *const data, * degenerate despite having passed isPolyValid). */ if (bpoly->scales[0] < FLT_EPSILON || bpoly->scales[1] < FLT_EPSILON || bpoly->edgemid_angle < FLT_EPSILON || bpoly->corner_edgemid_angles[0] < FLT_EPSILON || - bpoly->corner_edgemid_angles[1] < FLT_EPSILON) { + bpoly->corner_edgemid_angles[1] < FLT_EPSILON) + { freeBindData(bwdata); data->success = MOD_SDEF_BIND_RESULT_GENERIC_ERR; return nullptr; @@ -710,7 +712,8 @@ BLI_INLINE SDefBindWeightData *computeBindWeights(SDefBindCalcData *const data, /* Verify that the additional computed values are valid. */ if (bpoly->scale_mid < FLT_EPSILON || - bpoly->point_edgemid_angles[0] + bpoly->point_edgemid_angles[1] < FLT_EPSILON) { + bpoly->point_edgemid_angles[0] + bpoly->point_edgemid_angles[1] < FLT_EPSILON) + { freeBindData(bwdata); data->success = MOD_SDEF_BIND_RESULT_GENERIC_ERR; return nullptr; @@ -912,7 +915,8 @@ BLI_INLINE SDefBindWeightData *computeBindWeights(SDefBindCalcData *const data, } else { if (bpoly->dominant_angle_weight < FLT_EPSILON || - 1.0f - bpoly->dominant_angle_weight < FLT_EPSILON) { + 1.0f - bpoly->dominant_angle_weight < FLT_EPSILON) + { bwdata->binds_num += 1; } else { @@ -1476,7 +1480,8 @@ static void surfacedeformModifier_do(ModifierData *md, target_polys_num, target_verts_num, target, - mesh)) { + mesh)) + { smd->flags &= ~MOD_SDEF_BIND; } /* Early abort, this is binding 'call', no need to perform whole evaluation. */ diff --git a/source/blender/modifiers/intern/MOD_triangulate.cc b/source/blender/modifiers/intern/MOD_triangulate.cc index 04726f47a5a..182132abffe 100644 --- a/source/blender/modifiers/intern/MOD_triangulate.cc +++ b/source/blender/modifiers/intern/MOD_triangulate.cc @@ -103,7 +103,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext * /*ctx*/, M TriangulateModifierData *tmd = (TriangulateModifierData *)md; Mesh *result; if (!(result = triangulate_mesh( - mesh, tmd->quad_method, tmd->ngon_method, tmd->min_vertices, tmd->flag))) { + mesh, tmd->quad_method, tmd->ngon_method, tmd->min_vertices, tmd->flag))) + { return mesh; } diff --git a/source/blender/modifiers/intern/MOD_ui_common.c b/source/blender/modifiers/intern/MOD_ui_common.c index 17eabfbbd7a..c12e3d88782 100644 --- a/source/blender/modifiers/intern/MOD_ui_common.c +++ b/source/blender/modifiers/intern/MOD_ui_common.c @@ -155,7 +155,8 @@ static int modifier_is_simulation(const ModifierData *md) eModifierType_Fluid, eModifierType_Softbody, eModifierType_Surface, - eModifierType_DynamicPaint)) { + eModifierType_DynamicPaint)) + { return 1; } /* Particle Tab */ @@ -181,7 +182,8 @@ static bool modifier_can_delete(ModifierData *md) PART_FLUID_SPRAYFOAM, PART_FLUID_SPRAYBUBBLE, PART_FLUID_FOAMBUBBLE, - PART_FLUID_SPRAYFOAMBUBBLE)) { + PART_FLUID_SPRAYFOAMBUBBLE)) + { return false; } } @@ -231,7 +233,8 @@ static void modifier_ops_extra_draw(bContext *C, uiLayout *layout, void *md_v) eModifierType_Softbody, eModifierType_ParticleSystem, eModifierType_Cloth, - eModifierType_Fluid)) { + eModifierType_Fluid)) + { uiItemO(layout, CTX_IFACE_(BLT_I18NCONTEXT_OPERATOR_DEFAULT, "Duplicate"), ICON_DUPLICATE, @@ -363,8 +366,8 @@ static void modifier_panel_header(const bContext *C, Panel *panel) buttons_number++; } /* Some modifiers can work with pre-tessellated curves only. */ - else if (ELEM( - md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) { + else if (ELEM(md->type, eModifierType_Hook, eModifierType_Softbody, eModifierType_MeshDeform)) + { /* Add button (appearing to be ON) and add tip why this can't be changed. */ sub = uiLayoutRow(row, true); uiBlock *block = uiLayoutGetBlock(sub); diff --git a/source/blender/modifiers/intern/MOD_volume_to_mesh.cc b/source/blender/modifiers/intern/MOD_volume_to_mesh.cc index abc6b5a5a88..9a0e8eabe0b 100644 --- a/source/blender/modifiers/intern/MOD_volume_to_mesh.cc +++ b/source/blender/modifiers/intern/MOD_volume_to_mesh.cc @@ -140,7 +140,8 @@ static Mesh *modifyMesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh * return create_empty_mesh(input_mesh); } if (vmmd->resolution_mode == VOLUME_TO_MESH_RESOLUTION_MODE_VOXEL_AMOUNT && - vmmd->voxel_amount == 0) { + vmmd->voxel_amount == 0) + { return create_empty_mesh(input_mesh); } diff --git a/source/blender/modifiers/intern/MOD_warp.c b/source/blender/modifiers/intern/MOD_warp.c index b5fbac84257..5d10f58c464 100644 --- a/source/blender/modifiers/intern/MOD_warp.c +++ b/source/blender/modifiers/intern/MOD_warp.c @@ -252,7 +252,8 @@ static void warpModifier_do(WarpModifierData *wmd, if (wmd->falloff_type == eWarp_Falloff_None || ((fac = len_squared_v3v3(co, mat_from[3])) < falloff_radius_sq && - (fac = (wmd->falloff_radius - sqrtf(fac)) / wmd->falloff_radius))) { + (fac = (wmd->falloff_radius - sqrtf(fac)) / wmd->falloff_radius))) + { /* skip if no vert group found */ if (defgrp_index != -1) { dv = &dvert[i]; @@ -460,7 +461,8 @@ static void texture_panel_draw(const bContext *C, Panel *panel) uiItemR(col, ptr, "texture_coords_object", 0, IFACE_("Object"), ICON_NONE); PointerRNA texture_coords_obj_ptr = RNA_pointer_get(ptr, "texture_coords_object"); if (!RNA_pointer_is_null(&texture_coords_obj_ptr) && - (RNA_enum_get(&texture_coords_obj_ptr, "type") == OB_ARMATURE)) { + (RNA_enum_get(&texture_coords_obj_ptr, "type") == OB_ARMATURE)) + { PointerRNA texture_coords_obj_data_ptr = RNA_pointer_get(&texture_coords_obj_ptr, "data"); uiItemPointerR(col, ptr, diff --git a/source/blender/modifiers/intern/MOD_wave.cc b/source/blender/modifiers/intern/MOD_wave.cc index 6ab3c1ab19b..d66d4beb452 100644 --- a/source/blender/modifiers/intern/MOD_wave.cc +++ b/source/blender/modifiers/intern/MOD_wave.cc @@ -436,7 +436,8 @@ static void texture_panel_draw(const bContext *C, Panel *panel) uiItemR(col, ptr, "texture_coords_object", 0, IFACE_("Object"), ICON_NONE); PointerRNA texture_coords_obj_ptr = RNA_pointer_get(ptr, "texture_coords_object"); if (!RNA_pointer_is_null(&texture_coords_obj_ptr) && - (RNA_enum_get(&texture_coords_obj_ptr, "type") == OB_ARMATURE)) { + (RNA_enum_get(&texture_coords_obj_ptr, "type") == OB_ARMATURE)) + { PointerRNA texture_coords_obj_data_ptr = RNA_pointer_get(&texture_coords_obj_ptr, "data"); uiItemPointerR(col, ptr, diff --git a/source/blender/modifiers/intern/MOD_weighted_normal.cc b/source/blender/modifiers/intern/MOD_weighted_normal.cc index 102e4a6a30b..9b21b61193b 100644 --- a/source/blender/modifiers/intern/MOD_weighted_normal.cc +++ b/source/blender/modifiers/intern/MOD_weighted_normal.cc @@ -169,7 +169,8 @@ static void aggregate_item_normal(WeightedNormalModifierData *wnmd, * (since a few values will be used by most cases, we cache those). */ const int loops_num = item_data->loops_num; if (loops_num < NUM_CACHED_INVERSE_POWERS_OF_WEIGHT && - cached_inverse_powers_of_weight[loops_num] == 0.0f) { + cached_inverse_powers_of_weight[loops_num] == 0.0f) + { cached_inverse_powers_of_weight[loops_num] = 1.0f / powf(weight, loops_num); } const float inverted_n_weight = loops_num < NUM_CACHED_INVERSE_POWERS_OF_WEIGHT ? @@ -464,7 +465,8 @@ static void wn_corner_angle(WeightedNormalModifierData *wnmd, WeightedNormalData ModePair *c_angl = &corner_angle[poly.start()]; float *angl = index_angle; for (int ml_index = poly.start(); ml_index < poly.start() + poly.size(); - ml_index++, c_angl++, angl++) { + ml_index++, c_angl++, angl++) + { c_angl->val = float(M_PI) - *angl; c_angl->index = ml_index; } @@ -497,7 +499,8 @@ static void wn_face_with_angle(WeightedNormalModifierData *wnmd, WeightedNormalD ModePair *cmbnd = &combined[poly.start()]; float *angl = index_angle; for (int ml_index = poly.start(); ml_index < poly.start() + poly.size(); - ml_index++, cmbnd++, angl++) { + ml_index++, cmbnd++, angl++) + { /* In this case val is product of corner angle and face area. */ cmbnd->val = (float(M_PI) - *angl) * face_area; cmbnd->index = ml_index; diff --git a/source/blender/modifiers/intern/MOD_weightvg_util.c b/source/blender/modifiers/intern/MOD_weightvg_util.c index b15b9cf75f1..e5527b0457d 100644 --- a/source/blender/modifiers/intern/MOD_weightvg_util.c +++ b/source/blender/modifiers/intern/MOD_weightvg_util.c @@ -48,15 +48,16 @@ void weightvg_do_map( /* Return immediately, if we have nothing to do! */ /* Also security checks... */ - if (!do_invert && (((falloff_type == MOD_WVG_MAPPING_CURVE) && (cmap == NULL)) || - !ELEM(falloff_type, - MOD_WVG_MAPPING_CURVE, - MOD_WVG_MAPPING_SHARP, - MOD_WVG_MAPPING_SMOOTH, - MOD_WVG_MAPPING_ROOT, - MOD_WVG_MAPPING_SPHERE, - MOD_WVG_MAPPING_RANDOM, - MOD_WVG_MAPPING_STEP))) { + if (!do_invert && + (((falloff_type == MOD_WVG_MAPPING_CURVE) && (cmap == NULL)) || !ELEM(falloff_type, + MOD_WVG_MAPPING_CURVE, + MOD_WVG_MAPPING_SHARP, + MOD_WVG_MAPPING_SMOOTH, + MOD_WVG_MAPPING_ROOT, + MOD_WVG_MAPPING_SPHERE, + MOD_WVG_MAPPING_RANDOM, + MOD_WVG_MAPPING_STEP))) + { return; } diff --git a/source/blender/nodes/composite/node_composite_tree.cc b/source/blender/nodes/composite/node_composite_tree.cc index e025bcefc50..46134eebd03 100644 --- a/source/blender/nodes/composite/node_composite_tree.cc +++ b/source/blender/nodes/composite/node_composite_tree.cc @@ -211,7 +211,8 @@ void ntreeCompositTagRender(Scene *scene) * ideally render struct would store own main AND original G_MAIN. */ for (Scene *sce_iter = (Scene *)G_MAIN->scenes.first; sce_iter; - sce_iter = (Scene *)sce_iter->id.next) { + sce_iter = (Scene *)sce_iter->id.next) + { if (sce_iter->nodetree) { for (bNode *node : sce_iter->nodetree->all_nodes()) { if (node->id == (ID *)scene || node->type == CMP_NODE_COMPOSITE) { diff --git a/source/blender/nodes/composite/nodes/node_composite_cryptomatte.cc b/source/blender/nodes/composite/nodes/node_composite_cryptomatte.cc index c162a5e473a..fcd21f40a21 100644 --- a/source/blender/nodes/composite/nodes/node_composite_cryptomatte.cc +++ b/source/blender/nodes/composite/nodes/node_composite_cryptomatte.cc @@ -180,7 +180,8 @@ void ntreeCompositCryptomatteUpdateLayerNames(const Scene *scene, bNode *node) if (session) { for (blender::StringRef layer_name : - blender::bke::cryptomatte::BKE_cryptomatte_layer_names_get(*session)) { + blender::bke::cryptomatte::BKE_cryptomatte_layer_names_get(*session)) + { CryptomatteLayer *layer = MEM_cnew(__func__); layer_name.copy(layer->name); BLI_addtail(&n->runtime.layers, layer); @@ -201,7 +202,8 @@ void ntreeCompositCryptomatteLayerPrefix(const Scene *scene, if (session) { for (blender::StringRef layer_name : - blender::bke::cryptomatte::BKE_cryptomatte_layer_names_get(*session)) { + blender::bke::cryptomatte::BKE_cryptomatte_layer_names_get(*session)) + { if (first_layer_name.empty()) { first_layer_name = layer_name; } @@ -286,7 +288,8 @@ static bool node_poll_cryptomatte(const bNodeType * /*ntype*/, /* See node_composit_poll_rlayers. */ for (scene = static_cast(G.main->scenes.first); scene; - scene = static_cast(scene->id.next)) { + scene = static_cast(scene->id.next)) + { if (scene->nodetree == ntree) { break; } diff --git a/source/blender/nodes/composite/nodes/node_composite_curves.cc b/source/blender/nodes/composite/nodes/node_composite_curves.cc index 106f89867d3..a5f52bbfe28 100644 --- a/source/blender/nodes/composite/nodes/node_composite_curves.cc +++ b/source/blender/nodes/composite/nodes/node_composite_curves.cc @@ -282,7 +282,8 @@ class RGBCurvesShaderNode : public ShaderNode { /* If the RGB curves do nothing, use a function that skips RGB computations. */ if (BKE_curvemapping_is_map_identity(curve_mapping, 0) && BKE_curvemapping_is_map_identity(curve_mapping, 1) && - BKE_curvemapping_is_map_identity(curve_mapping, 2)) { + BKE_curvemapping_is_map_identity(curve_mapping, 2)) + { GPU_stack_link(material, &bnode(), "curves_combined_only", diff --git a/source/blender/nodes/composite/nodes/node_composite_displace.cc b/source/blender/nodes/composite/nodes/node_composite_displace.cc index 4b439213297..b38560268b0 100644 --- a/source/blender/nodes/composite/nodes/node_composite_displace.cc +++ b/source/blender/nodes/composite/nodes/node_composite_displace.cc @@ -105,7 +105,8 @@ class DisplaceOperation : public NodeOperation { const Result &input_x_scale = get_input("X Scale"); const Result &input_y_scale = get_input("Y Scale"); if (input_x_scale.is_single_value() && input_x_scale.get_float_value() == 0.0f && - input_y_scale.is_single_value() && input_y_scale.get_float_value() == 0.0f) { + input_y_scale.is_single_value() && input_y_scale.get_float_value() == 0.0f) + { return true; } diff --git a/source/blender/nodes/composite/nodes/node_composite_image.cc b/source/blender/nodes/composite/nodes/node_composite_image.cc index fe08fb51d98..76ba859621c 100644 --- a/source/blender/nodes/composite/nodes/node_composite_image.cc +++ b/source/blender/nodes/composite/nodes/node_composite_image.cc @@ -310,7 +310,8 @@ static void cmp_node_rlayer_create_outputs(bNodeTree *ntree, RE_engine_free(engine); if ((scene->r.mode & R_EDGE_FRS) && - (view_layer->freestyle_config.flags & FREESTYLE_AS_RENDER_PASS)) { + (view_layer->freestyle_config.flags & FREESTYLE_AS_RENDER_PASS)) + { node_cmp_rlayers_register_pass( ntree, node, scene, view_layer, RE_PASSNAME_FREESTYLE, SOCK_RGBA); } diff --git a/source/blender/nodes/composite/nodes/node_composite_output_file.cc b/source/blender/nodes/composite/nodes/node_composite_output_file.cc index 530956f1f4f..ddd2453b278 100644 --- a/source/blender/nodes/composite/nodes/node_composite_output_file.cc +++ b/source/blender/nodes/composite/nodes/node_composite_output_file.cc @@ -246,7 +246,8 @@ static void copy_output_file(bNodeTree * /*dst_ntree*/, bNode *dest_node, const for (src_sock = (bNodeSocket *)src_node->inputs.first, dest_sock = (bNodeSocket *)dest_node->inputs.first; src_sock && dest_sock; - src_sock = src_sock->next, dest_sock = (bNodeSocket *)dest_sock->next) { + src_sock = src_sock->next, dest_sock = (bNodeSocket *)dest_sock->next) + { dest_sock->storage = MEM_dupallocN(src_sock->storage); NodeImageMultiFileSocket *dest_sockdata = (NodeImageMultiFileSocket *)dest_sock->storage; NodeImageMultiFileSocket *src_sockdata = (NodeImageMultiFileSocket *)src_sock->storage; diff --git a/source/blender/nodes/composite/nodes/node_composite_trackpos.cc b/source/blender/nodes/composite/nodes/node_composite_trackpos.cc index 5863d12856a..66468a654e3 100644 --- a/source/blender/nodes/composite/nodes/node_composite_trackpos.cc +++ b/source/blender/nodes/composite/nodes/node_composite_trackpos.cc @@ -106,7 +106,8 @@ static void node_composit_buts_trackpos(uiLayout *layout, bContext *C, PointerRN if (ELEM(node->custom1, CMP_NODE_TRACK_POSITION_RELATIVE_FRAME, - CMP_NODE_TRACK_POSITION_ABSOLUTE_FRAME)) { + CMP_NODE_TRACK_POSITION_ABSOLUTE_FRAME)) + { uiItemR(layout, ptr, "frame_relative", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); } } diff --git a/source/blender/nodes/function/nodes/node_fn_boolean_math.cc b/source/blender/nodes/function/nodes/node_fn_boolean_math.cc index 188a6d916bf..5e99d3e1cdb 100644 --- a/source/blender/nodes/function/nodes/node_fn_boolean_math.cc +++ b/source/blender/nodes/function/nodes/node_fn_boolean_math.cc @@ -47,13 +47,15 @@ static void node_label(const bNodeTree * /*tree*/, const bNode *node, char *labe static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) { if (!params.node_tree().typeinfo->validate_link( - static_cast(params.other_socket().type), SOCK_BOOLEAN)) { + static_cast(params.other_socket().type), SOCK_BOOLEAN)) + { return; } for (const EnumPropertyItem *item = rna_enum_node_boolean_math_items; item->identifier != nullptr; - item++) { + item++) + { if (item->name != nullptr && item->identifier[0] != '\0') { NodeBooleanMathOperation operation = static_cast(item->value); params.add_item(IFACE_(item->name), [operation](LinkSearchOpParams ¶ms) { diff --git a/source/blender/nodes/function/nodes/node_fn_compare.cc b/source/blender/nodes/function/nodes/node_fn_compare.cc index 67b2c15d08e..fe18e39941c 100644 --- a/source/blender/nodes/function/nodes/node_fn_compare.cc +++ b/source/blender/nodes/function/nodes/node_fn_compare.cc @@ -128,7 +128,8 @@ static std::optional get_compare_type_for_operation( NODE_COMPARE_COLOR_BRIGHTER, NODE_COMPARE_COLOR_DARKER, NODE_COMPARE_EQUAL, - NODE_COMPARE_NOT_EQUAL)) { + NODE_COMPARE_NOT_EQUAL)) + { return SOCK_VECTOR; } return type; @@ -152,11 +153,13 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) const StringRef socket_name = params.in_out() == SOCK_IN ? "A" : "Result"; for (const EnumPropertyItem *item = rna_enum_node_compare_operation_items; item->identifier != nullptr; - item++) { + item++) + { if (item->name != nullptr && item->identifier[0] != '\0') { const NodeCompareOperation operation = NodeCompareOperation(item->value); if (const std::optional fixed_type = get_compare_type_for_operation( - type, operation)) { + type, operation)) + { params.add_item(IFACE_(item->name), SocketSearchOp{socket_name, *fixed_type, operation}); } } diff --git a/source/blender/nodes/geometry/node_geometry_tree.cc b/source/blender/nodes/geometry/node_geometry_tree.cc index dbdbf1e616d..c4bec7ede28 100644 --- a/source/blender/nodes/geometry/node_geometry_tree.cc +++ b/source/blender/nodes/geometry/node_geometry_tree.cc @@ -81,7 +81,8 @@ static bool geometry_node_tree_validate_link(eNodeSocketDatatype type_a, /* Geometry, string, object, material, texture and collection sockets can only be connected to * themselves. The other types can be converted between each other. */ if (ELEM(type_a, SOCK_FLOAT, SOCK_VECTOR, SOCK_RGBA, SOCK_BOOLEAN, SOCK_INT) && - ELEM(type_b, SOCK_FLOAT, SOCK_VECTOR, SOCK_RGBA, SOCK_BOOLEAN, SOCK_INT)) { + ELEM(type_b, SOCK_FLOAT, SOCK_VECTOR, SOCK_RGBA, SOCK_BOOLEAN, SOCK_INT)) + { return true; } return type_a == type_b; diff --git a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc index f7f3e1bf076..d424b783b21 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_accumulate_field.cc @@ -278,7 +278,8 @@ template class AccumulateFieldInput final : public bke::GeometryFiel bool is_equal_to(const fn::FieldNode &other) const override { if (const AccumulateFieldInput *other_accumulate = dynamic_cast( - &other)) { + &other)) + { return input_ == other_accumulate->input_ && group_index_ == other_accumulate->group_index_ && source_domain_ == other_accumulate->source_domain_ && @@ -392,8 +393,8 @@ static void node_geo_exec(GeoNodeExecParams params) Field group_index_field = params.extract_input>("Group Index"); attribute_math::convert_to_static_type(data_type, [&](auto dummy) { using T = decltype(dummy); - if constexpr (std::is_same_v || std::is_same_v || - std::is_same_v) { + if constexpr (std::is_same_v || std::is_same_v || std::is_same_v) + { const std::string suffix = " " + identifier_suffix(); Field input_field = params.extract_input>("Value" + suffix); if (params.output_is_required("Leading" + suffix)) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc index d7b4275040b..2960240bfdf 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_domain_size.cc @@ -85,8 +85,8 @@ static void node_geo_exec(GeoNodeExecParams params) break; } case GEO_COMPONENT_TYPE_CURVE: { - if (const CurveComponent *component = - geometry_set.get_component_for_read()) { + if (const CurveComponent *component = geometry_set.get_component_for_read()) + { const AttributeAccessor attributes = *component->attributes(); params.set_output("Point Count", attributes.domain_size(ATTR_DOMAIN_POINT)); params.set_output("Spline Count", attributes.domain_size(ATTR_DOMAIN_CURVE)); @@ -98,7 +98,8 @@ static void node_geo_exec(GeoNodeExecParams params) } case GEO_COMPONENT_TYPE_POINT_CLOUD: { if (const PointCloudComponent *component = - geometry_set.get_component_for_read()) { + geometry_set.get_component_for_read()) + { const AttributeAccessor attributes = *component->attributes(); params.set_output("Point Count", attributes.domain_size(ATTR_DOMAIN_POINT)); } @@ -109,7 +110,8 @@ static void node_geo_exec(GeoNodeExecParams params) } case GEO_COMPONENT_TYPE_INSTANCES: { if (const InstancesComponent *component = - geometry_set.get_component_for_read()) { + geometry_set.get_component_for_read()) + { const AttributeAccessor attributes = *component->attributes(); params.set_output("Instance Count", attributes.domain_size(ATTR_DOMAIN_INSTANCE)); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc index 494ce178ef3..5994a75185d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_attribute_statistic.cc @@ -135,7 +135,8 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) } else { for (const StringRefNull name : - {"Mean", "Median", "Sum", "Min", "Max", "Range", "Standard Deviation", "Variance"}) { + {"Mean", "Median", "Sum", "Min", "Max", "Range", "Standard Deviation", "Variance"}) + { params.add_item(IFACE_(name.c_str()), [node_type, name, type](LinkSearchOpParams ¶ms) { bNode &node = params.add_node(node_type); node.custom1 = *type; diff --git a/source/blender/nodes/geometry/nodes/node_geo_blur_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_blur_attribute.cc index 156534374f9..58997b0afd3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_blur_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_blur_attribute.cc @@ -456,7 +456,8 @@ class BlurAttributeFieldInput final : public bke::GeometryFieldInput { bool is_equal_to(const fn::FieldNode &other) const override { if (const BlurAttributeFieldInput *other_blur = dynamic_cast( - &other)) { + &other)) + { return weight_field_ == other_blur->weight_field_ && value_field_ == other_blur->value_field_ && iterations_ == other_blur->iterations_; } diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_handle_type_selection.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_handle_type_selection.cc index 60d8539c8cb..e3758766afb 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_handle_type_selection.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_handle_type_selection.cc @@ -104,7 +104,8 @@ class HandleTypeFieldInput final : public bke::CurvesFieldInput { bool is_equal_to(const fn::FieldNode &other) const override { if (const HandleTypeFieldInput *other_handle_selection = - dynamic_cast(&other)) { + dynamic_cast(&other)) + { return mode_ == other_handle_selection->mode_ && type_ == other_handle_selection->type_; } return false; diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc index 559054ac2c0..3942b42b333 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_quadrilateral.cc @@ -139,7 +139,8 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) search_link_ops_for_declarations(params, declaration.outputs); } else if (params.node_tree().typeinfo->validate_link( - eNodeSocketDatatype(params.other_socket().type), SOCK_FLOAT)) { + eNodeSocketDatatype(params.other_socket().type), SOCK_FLOAT)) + { params.add_item(IFACE_("Width"), SocketSearchOp{"Width", GEO_NODE_CURVE_PRIMITIVE_QUAD_MODE_RECTANGLE}); params.add_item(IFACE_("Height"), diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_star.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_star.cc index 402e396083c..d7224b8394d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_star.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_primitive_star.cc @@ -79,7 +79,8 @@ static void node_geo_exec(GeoNodeExecParams params) GeometrySet output = GeometrySet::create_with_curves(curves); if (AnonymousAttributeIDPtr outer_points_id = params.get_output_anonymous_attribute_id_if_needed( - "Outer Points")) { + "Outer Points")) + { create_selection_output(output.get_component_for_write(), outer_points_id); } params.set_output("Curve", std::move(output)); diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc index 4b7a451cf14..f2ae85df8dd 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_spline_type.cc @@ -63,7 +63,8 @@ static void node_geo_exec(GeoNodeExecParams params) if (geometry::try_curves_conversion_in_place( selection, dst_type, [&]() -> bke::CurvesGeometry & { return geometry_set.get_curves_for_write()->geometry.wrap(); - })) { + })) + { return; } diff --git a/source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc b/source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc index 385bf373755..25e33ff8ea4 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_curve_trim.cc @@ -97,7 +97,8 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) if (params.in_out() == SOCK_IN) { if (params.node_tree().typeinfo->validate_link(eNodeSocketDatatype(params.other_socket().type), - SOCK_FLOAT)) { + SOCK_FLOAT)) + { params.add_item(IFACE_("Start (Factor)"), SocketSearchOp{"Start", GEO_NODE_CURVE_SAMPLE_FACTOR}); params.add_item(IFACE_("End (Factor)"), SocketSearchOp{"End", GEO_NODE_CURVE_SAMPLE_FACTOR}); diff --git a/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc index 9eb00fd9d46..24f703e5ab3 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_dual_mesh.cc @@ -355,7 +355,8 @@ static bool sort_vertex_polys(const Span edges, const int corner_1 = poly_vertex_corners[i].first; const int corner_2 = poly_vertex_corners[i].second; if (edge_types[corner_edges[corner_1]] == EdgeType::Boundary && - corner_verts[corner_1] == vertex_index) { + corner_verts[corner_1] == vertex_index) + { shared_edge_i = corner_edges[corner_2]; r_sorted_corners[0] = poly_vertex_corners[i].first; std::swap(connected_polys[i], connected_polys[0]); @@ -363,7 +364,8 @@ static bool sort_vertex_polys(const Span edges, break; } if (edge_types[corner_edges[corner_2]] == EdgeType::Boundary && - corner_verts[corner_2] == vertex_index) { + corner_verts[corner_2] == vertex_index) + { shared_edge_i = corner_edges[corner_1]; r_sorted_corners[0] = poly_vertex_corners[i].second; std::swap(connected_polys[i], connected_polys[0]); @@ -564,13 +566,15 @@ static void dissolve_redundant_verts(const Span edges, const int2 &edge = edges[edge_i]; bool mark_edge = false; if (vertex_needs_dissolving( - edge[0], first_poly_index, second_poly_index, vertex_types, vert_to_poly_map)) { + edge[0], first_poly_index, second_poly_index, vertex_types, vert_to_poly_map)) + { /* This vertex is now 'removed' and should be ignored elsewhere. */ vertex_types[edge[0]] = VertexType::Loose; mark_edge = true; } if (vertex_needs_dissolving( - edge[1], first_poly_index, second_poly_index, vertex_types, vert_to_poly_map)) { + edge[1], first_poly_index, second_poly_index, vertex_types, vert_to_poly_map)) + { /* This vertex is now 'removed' and should be ignored elsewhere. */ vertex_types[edge[1]] = VertexType::Loose; mark_edge = true; @@ -625,7 +629,8 @@ static Mesh *calc_dual_mesh(const Mesh &src_mesh, threading::parallel_for(vert_to_poly_map.index_range(), 512, [&](IndexRange range) { for (const int i : range) { if (vertex_types[i] == VertexType::Loose || vertex_types[i] >= VertexType::NonManifold || - (!keep_boundaries && vertex_types[i] == VertexType::Boundary)) { + (!keep_boundaries && vertex_types[i] == VertexType::Boundary)) + { /* Bad vertex that we can't work with. */ continue; } @@ -721,7 +726,8 @@ static Mesh *calc_dual_mesh(const Mesh &src_mesh, for (const int i : IndexRange(src_mesh.totvert)) { if (vertex_types[i] == VertexType::Loose || vertex_types[i] >= VertexType::NonManifold || - (!keep_boundaries && vertex_types[i] == VertexType::Boundary)) { + (!keep_boundaries && vertex_types[i] == VertexType::Boundary)) + { /* Bad vertex that we can't work with. */ continue; } diff --git a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc index d33d4c11c91..02f4881772d 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_duplicate_elements.cc @@ -178,11 +178,9 @@ static void copy_attributes_without_id(const OffsetIndices offsets, const bke::AttributeAccessor src_attributes, bke::MutableAttributeAccessor dst_attributes) { - for (auto &attribute : bke::retrieve_attributes_for_transfer(src_attributes, - dst_attributes, - ATTR_DOMAIN_AS_MASK(domain), - propagation_info, - {"id"})) { + for (auto &attribute : bke::retrieve_attributes_for_transfer( + src_attributes, dst_attributes, ATTR_DOMAIN_AS_MASK(domain), propagation_info, {"id"})) + { attribute_math::convert_to_static_type(attribute.src.type(), [&](auto dummy) { using T = decltype(dummy); const Span src = attribute.src.typed(); @@ -217,7 +215,8 @@ static void copy_curve_attributes_without_id( dst_curves.attributes_for_write(), ATTR_DOMAIN_MASK_ALL, propagation_info, - {"id"})) { + {"id"})) + { attribute_math::convert_to_static_type(attribute.src.type(), [&](auto dummy) { using T = decltype(dummy); const Span src = attribute.src.typed(); @@ -394,7 +393,8 @@ static void copy_face_attributes_without_id( dst_attributes, ATTR_DOMAIN_MASK_ALL, propagation_info, - {"id", ".corner_vert", ".corner_edge", ".edge_verts"})) { + {"id", ".corner_vert", ".corner_edge", ".edge_verts"})) + { attribute_math::convert_to_static_type(attribute.src.type(), [&](auto dummy) { using T = decltype(dummy); const Span src = attribute.src.typed(); @@ -604,7 +604,8 @@ static void copy_edge_attributes_without_id( dst_attributes, ATTR_DOMAIN_MASK_POINT | ATTR_DOMAIN_MASK_EDGE, propagation_info, - {"id", ".edge_verts"})) { + {"id", ".edge_verts"})) + { attribute_math::convert_to_static_type(attribute.src.type(), [&](auto dummy) { using T = decltype(dummy); const Span src = attribute.src.typed(); @@ -792,7 +793,8 @@ static void duplicate_points_curve(GeometrySet &geometry_set, new_curves.attributes_for_write(), ATTR_DOMAIN_MASK_ALL, propagation_info, - {"id"})) { + {"id"})) + { attribute_math::convert_to_static_type(attribute.src.type(), [&](auto dummy) { using T = decltype(dummy); const Span src = attribute.src.typed(); diff --git a/source/blender/nodes/geometry/nodes/node_geo_edge_paths_to_selection.cc b/source/blender/nodes/geometry/nodes/node_geo_edge_paths_to_selection.cc index 8b5a7652eae..394ca2e1ce0 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_edge_paths_to_selection.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_edge_paths_to_selection.cc @@ -47,7 +47,8 @@ static void edge_paths_to_selection(const Mesh &src_mesh, for (const int i : edges.index_range()) { const int2 &edge = edges[i]; if ((selection[edge[0]] && selection[edge[1]]) && - (edge[0] == next_indices[edge[1]] || edge[1] == next_indices[edge[0]])) { + (edge[0] == next_indices[edge[1]] || edge[1] == next_indices[edge[0]])) + { r_selection[i] = true; } } @@ -106,7 +107,8 @@ class PathToEdgeSelectionFieldInput final : public bke::MeshFieldInput { bool is_equal_to(const fn::FieldNode &other) const override { if (const PathToEdgeSelectionFieldInput *other_field = - dynamic_cast(&other)) { + dynamic_cast(&other)) + { return other_field->start_vertices_ == start_vertices_ && other_field->next_vertex_ == next_vertex_; } diff --git a/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc index 033ab8916dc..e287bb76a7e 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_extrude_mesh.cc @@ -190,7 +190,8 @@ static MutableSpan get_orig_index_layer(Mesh &mesh, const eAttrDomain domai const bke::AttributeAccessor attributes = mesh.attributes(); CustomData &custom_data = mesh_custom_data_for_domain(mesh, domain); if (int *orig_indices = static_cast(CustomData_get_layer_for_write( - &custom_data, CD_ORIGINDEX, attributes.domain_size(domain)))) { + &custom_data, CD_ORIGINDEX, attributes.domain_size(domain)))) + { return {orig_indices, attributes.domain_size(domain)}; } return {}; diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc b/source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc index 585c95019cd..c830aa9f429 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_curve_handles.cc @@ -82,7 +82,8 @@ class HandlePositionFieldInput final : public bke::CurvesFieldInput { bool is_equal_to(const fn::FieldNode &other) const override { if (const HandlePositionFieldInput *other_handle = - dynamic_cast(&other)) { + dynamic_cast(&other)) + { return relative_ == other_handle->relative_ && left_ == other_handle->left_; } return false; diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc index d9fa912c94d..ff0b63f3825 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_mesh_edge_vertices.cc @@ -125,7 +125,8 @@ class EdgePositionFieldInput final : public bke::MeshFieldInput { bool is_equal_to(const fn::FieldNode &other) const override { if (const EdgePositionFieldInput *other_field = dynamic_cast( - &other)) { + &other)) + { return vertex_ == other_field->vertex_; } return false; diff --git a/source/blender/nodes/geometry/nodes/node_geo_input_shortest_edge_paths.cc b/source/blender/nodes/geometry/nodes/node_geo_input_shortest_edge_paths.cc index c93f41da71d..c801f3e8a89 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_input_shortest_edge_paths.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_input_shortest_edge_paths.cc @@ -144,7 +144,8 @@ class ShortestEdgePathsNextVertFieldInput final : public bke::MeshFieldInput { bool is_equal_to(const fn::FieldNode &other) const override { if (const ShortestEdgePathsNextVertFieldInput *other_field = - dynamic_cast(&other)) { + dynamic_cast(&other)) + { return other_field->end_selection_ == end_selection_ && other_field->cost_ == cost_; } return false; @@ -212,7 +213,8 @@ class ShortestEdgePathsCostFieldInput final : public bke::MeshFieldInput { bool is_equal_to(const fn::FieldNode &other) const override { if (const ShortestEdgePathsCostFieldInput *other_field = - dynamic_cast(&other)) { + dynamic_cast(&other)) + { return other_field->end_selection_ == end_selection_ && other_field->cost_ == cost_; } return false; diff --git a/source/blender/nodes/geometry/nodes/node_geo_instance_on_points.cc b/source/blender/nodes/geometry/nodes/node_geo_instance_on_points.cc index 2efde147733..59a61b6cce6 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_instance_on_points.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_instance_on_points.cc @@ -95,7 +95,8 @@ static void add_instances_from_component( Array handle_mapping; /* Only fill #handle_mapping when it may be used below. */ if (src_instances != nullptr && - (!pick_instance.is_single() || pick_instance.get_internal_single())) { + (!pick_instance.is_single() || pick_instance.get_internal_single())) + { Span src_references = src_instances->references(); handle_mapping.reinitialize(src_references.size()); for (const int src_instance_handle : src_references.index_range()) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_instances_to_points.cc b/source/blender/nodes/geometry/nodes/node_geo_instances_to_points.cc index f0145741e32..193fc02924e 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_instances_to_points.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_instances_to_points.cc @@ -72,8 +72,8 @@ static void convert_instances_to_points(GeometrySet &geometry_set, const eCustomDataType type = item.value.data_type; const GAttributeReader src = src_attributes.lookup(id); - if (selection.size() == instances.instances_num() && src.sharing_info && - src.varray.is_span()) { + if (selection.size() == instances.instances_num() && src.sharing_info && src.varray.is_span()) + { const bke::AttributeInitShared init(src.varray.get_internal_span().data(), *src.sharing_info); dst_attributes.add(id, ATTR_DOMAIN_POINT, type, init); diff --git a/source/blender/nodes/geometry/nodes/node_geo_interpolate_curves.cc b/source/blender/nodes/geometry/nodes/node_geo_interpolate_curves.cc index da53297fd62..2c149565e73 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_interpolate_curves.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_interpolate_curves.cc @@ -450,8 +450,8 @@ static void interpolate_curve_attributes(bke::CurvesGeometry &child_curves, if (type == CD_PROP_STRING) { return true; } - if (guide_curve_attributes.is_builtin(id) && - !ELEM(id.name(), "radius", "tilt", "resolution")) { + if (guide_curve_attributes.is_builtin(id) && !ELEM(id.name(), "radius", "tilt", "resolution")) + { return true; } @@ -831,7 +831,8 @@ static void node_geo_exec(GeoNodeExecParams params) GeometryComponentEditData::remember_deformed_curve_positions_if_necessary(guide_curves_geometry); if (const auto *curve_edit_data = - guide_curves_geometry.get_component_for_read()) { + guide_curves_geometry.get_component_for_read()) + { new_curves.add(*curve_edit_data); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_material_selection.cc b/source/blender/nodes/geometry/nodes/node_geo_material_selection.cc index ae85c1fbd92..db852a3d18f 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_material_selection.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_material_selection.cc @@ -93,7 +93,8 @@ class MaterialSelectionFieldInput final : public bke::GeometryFieldInput { bool is_equal_to(const fn::FieldNode &other) const override { if (const MaterialSelectionFieldInput *other_material_selection = - dynamic_cast(&other)) { + dynamic_cast(&other)) + { return material_ == other_material_selection->material_; } return false; diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc index 42f2da09701..9bf744d4895 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_primitive_line.cc @@ -98,7 +98,8 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) return; } else if (params.node_tree().typeinfo->validate_link( - eNodeSocketDatatype(params.other_socket().type), SOCK_FLOAT)) { + eNodeSocketDatatype(params.other_socket().type), SOCK_FLOAT)) + { params.add_item(IFACE_("Count"), [](LinkSearchOpParams ¶ms) { bNode &node = params.add_node("GeometryNodeMeshLine"); node_storage(node).mode = GEO_NODE_MESH_LINE_MODE_OFFSET; diff --git a/source/blender/nodes/geometry/nodes/node_geo_mesh_topology_offset_corner_in_face.cc b/source/blender/nodes/geometry/nodes/node_geo_mesh_topology_offset_corner_in_face.cc index a497c612677..f35ce663a43 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_mesh_topology_offset_corner_in_face.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_mesh_topology_offset_corner_in_face.cc @@ -86,7 +86,8 @@ class OffsetCornerInFaceFieldInput final : public bke::MeshFieldInput { bool is_equal_to(const fn::FieldNode &other) const final { if (const OffsetCornerInFaceFieldInput *other_field = - dynamic_cast(&other)) { + dynamic_cast(&other)) + { return other_field->corner_index_ == corner_index_ && other_field->offset_ == offset_; } return false; diff --git a/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc b/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc index 26f11db005a..af2aa10178c 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_points_to_volume.cc @@ -86,7 +86,8 @@ void initialize_volume_component_from_points(GeoNodeExecParams ¶ms, Field radius_field = params.get_input>("Radius"); for (const GeometryComponentType type : - {GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE}) { + {GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE}) + { if (r_geometry_set.has(type)) { gather_point_data_from_component( radius_field, *r_geometry_set.get_component_for_read(type), positions, radii); diff --git a/source/blender/nodes/geometry/nodes/node_geo_raycast.cc b/source/blender/nodes/geometry/nodes/node_geo_raycast.cc index 287b18fb28f..642c71c4316 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_raycast.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_raycast.cc @@ -163,7 +163,8 @@ static void raycast_to_mesh(IndexMask mask, 0.0f, &hit, tree_data.raycast_callback, - &tree_data) != -1) { + &tree_data) != -1) + { hit_count++; if (!r_hit.is_empty()) { r_hit[i] = hit.index >= 0; diff --git a/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc index b08ce192a81..f20f8dacc28 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_remove_attribute.cc @@ -34,7 +34,8 @@ static void node_geo_exec(GeoNodeExecParams params) for (const GeometryComponentType type : {GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE, - GEO_COMPONENT_TYPE_INSTANCES}) { + GEO_COMPONENT_TYPE_INSTANCES}) + { if (geometry_set.has(type)) { /* First check if the attribute exists before getting write access, * to avoid potentially expensive unnecessary copies. */ diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_id.cc b/source/blender/nodes/geometry/nodes/node_geo_set_id.cc index fe35f99c40e..ea3c7876825 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_set_id.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_set_id.cc @@ -59,7 +59,8 @@ static void node_geo_exec(GeoNodeExecParams params) for (const GeometryComponentType type : {GEO_COMPONENT_TYPE_INSTANCES, GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, - GEO_COMPONENT_TYPE_CURVE}) { + GEO_COMPONENT_TYPE_CURVE}) + { if (geometry_set.has(type)) { set_id_in_component(geometry_set.get_component_for_write(type), selection_field, id_field); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_set_position.cc b/source/blender/nodes/geometry/nodes/node_geo_set_position.cc index 428bf42ae40..595f87cfa0b 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_set_position.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_set_position.cc @@ -159,7 +159,8 @@ static void node_geo_exec(GeoNodeExecParams params) for (const GeometryComponentType type : {GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE, - GEO_COMPONENT_TYPE_INSTANCES}) { + GEO_COMPONENT_TYPE_INSTANCES}) + { if (geometry.has(type)) { set_position_in_component(geometry, type, selection_field, position_field, offset_field); } diff --git a/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc b/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc index 462b332568f..9e10aa7b7f2 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_store_named_attribute.cc @@ -160,7 +160,8 @@ static void node_geo_exec(GeoNodeExecParams params) else { geometry_set.modify_geometry_sets([&](GeometrySet &geometry_set) { for (const GeometryComponentType type : - {GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE}) { + {GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE}) + { if (geometry_set.has(type)) { GeometryComponent &component = geometry_set.get_component_for_write(type); if (!bke::try_capture_field_on_geometry(component, name, domain, selection, field)) { diff --git a/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc b/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc index f23bc101a14..027a94c544e 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_string_to_curves.cc @@ -333,8 +333,8 @@ static void create_attributes(GeoNodeExecParams ¶ms, { MutableAttributeAccessor attributes = instances.attributes_for_write(); - if (AnonymousAttributeIDPtr line_id = params.get_output_anonymous_attribute_id_if_needed( - "Line")) { + if (AnonymousAttributeIDPtr line_id = params.get_output_anonymous_attribute_id_if_needed("Line")) + { SpanAttributeWriter line_attribute = attributes.lookup_or_add_for_write_only_span( *line_id, ATTR_DOMAIN_INSTANCE); line_attribute.span.copy_from(layout.line_numbers); @@ -342,7 +342,8 @@ static void create_attributes(GeoNodeExecParams ¶ms, } if (AnonymousAttributeIDPtr pivot_id = params.get_output_anonymous_attribute_id_if_needed( - "Pivot Point")) { + "Pivot Point")) + { SpanAttributeWriter pivot_attribute = attributes.lookup_or_add_for_write_only_span(*pivot_id, ATTR_DOMAIN_INSTANCE); diff --git a/source/blender/nodes/geometry/nodes/node_geo_transform_geometry.cc b/source/blender/nodes/geometry/nodes/node_geo_transform_geometry.cc index 4438e4450d3..b4816379ebb 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_transform_geometry.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_transform_geometry.cc @@ -30,7 +30,8 @@ static bool use_translate(const float3 rotation, const float3 scale) return false; } if (compare_ff(scale.x, 1.0f, 1e-9f) != 1 || compare_ff(scale.y, 1.0f, 1e-9f) != 1 || - compare_ff(scale.z, 1.0f, 1e-9f) != 1) { + compare_ff(scale.z, 1.0f, 1e-9f) != 1) + { return false; } return true; diff --git a/source/blender/nodes/geometry/nodes/node_geo_volume_cube.cc b/source/blender/nodes/geometry/nodes/node_geo_volume_cube.cc index 38817f3fefb..820f9759a17 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_volume_cube.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_volume_cube.cc @@ -129,8 +129,8 @@ static void node_geo_exec(GeoNodeExecParams params) return; } - if (bounds_min.x == bounds_max.x || bounds_min.y == bounds_max.y || - bounds_min.z == bounds_max.z) { + if (bounds_min.x == bounds_max.x || bounds_min.y == bounds_max.y || bounds_min.z == bounds_max.z) + { params.error_message_add(NodeWarningType::Error, TIP_("Bounding box volume must be greater than 0")); params.set_default_remaining_outputs(); diff --git a/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc b/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc index 5ba2ebcc9d1..02084cf0389 100644 --- a/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc +++ b/source/blender/nodes/geometry/nodes/node_geo_volume_to_mesh.cc @@ -158,11 +158,13 @@ static Mesh *create_mesh_from_volume(GeometrySet &geometry_set, GeoNodeExecParam const bke::VolumeToMeshResolution resolution = get_resolution_param(params); if (resolution.mode == VOLUME_TO_MESH_RESOLUTION_MODE_VOXEL_SIZE && - resolution.settings.voxel_size <= 0.0f) { + resolution.settings.voxel_size <= 0.0f) + { return nullptr; } if (resolution.mode == VOLUME_TO_MESH_RESOLUTION_MODE_VOXEL_AMOUNT && - resolution.settings.voxel_amount <= 0) { + resolution.settings.voxel_amount <= 0) + { return nullptr; } diff --git a/source/blender/nodes/intern/geometry_nodes_lazy_function.cc b/source/blender/nodes/intern/geometry_nodes_lazy_function.cc index 1761dbda733..682e254af48 100644 --- a/source/blender/nodes/intern/geometry_nodes_lazy_function.cc +++ b/source/blender/nodes/intern/geometry_nodes_lazy_function.cc @@ -380,7 +380,8 @@ class LazyFunctionForMultiInput : public LazyFunction { const bNodeTree &btree = socket.owner_tree(); for (const bNodeLink *link : socket.directly_linked_links()) { if (link->is_muted() || !link->fromsock->is_available() || - nodeIsDanglingReroute(&btree, link->fromnode)) { + nodeIsDanglingReroute(&btree, link->fromnode)) + { continue; } inputs_.append({"Input", *base_type_}); @@ -746,8 +747,8 @@ class LazyFunctionForViewerNode : public LazyFunction { continue; } const Span links = bsocket->directly_linked_links(); - if (links.is_empty() || - nodeIsDanglingReroute(&bnode.owner_tree(), links.first()->fromnode)) { + if (links.is_empty() || nodeIsDanglingReroute(&bnode.owner_tree(), links.first()->fromnode)) + { use_field_input_ = false; inputs_.pop_last(); r_lf_index_by_bsocket[bsocket->index_in_tree()] = -1; @@ -786,15 +787,16 @@ class LazyFunctionForViewerNode : public LazyFunction { } else { geometry.modify_geometry_sets([&](GeometrySet &geometry) { - for (const GeometryComponentType type : {GEO_COMPONENT_TYPE_MESH, - GEO_COMPONENT_TYPE_POINT_CLOUD, - GEO_COMPONENT_TYPE_CURVE}) { + for (const GeometryComponentType type : + {GEO_COMPONENT_TYPE_MESH, GEO_COMPONENT_TYPE_POINT_CLOUD, GEO_COMPONENT_TYPE_CURVE}) + { if (geometry.has(type)) { GeometryComponent &component = geometry.get_component_for_write(type); eAttrDomain used_domain = domain; if (used_domain == ATTR_DOMAIN_AUTO) { if (const std::optional detected_domain = - bke::try_detect_field_domain(component, field)) { + bke::try_detect_field_domain(component, field)) + { used_domain = *detected_domain; } else { @@ -902,7 +904,8 @@ class LazyFunctionForGroupNode : public LazyFunction { /* Add an attribute set input for every output geometry socket that can propagate attributes * from inputs. */ for (auto [output_index, lf_socket] : - group_lf_graph_info.mapping.attribute_set_by_geometry_output.items()) { + group_lf_graph_info.mapping.attribute_set_by_geometry_output.items()) + { const int lf_index = inputs_.append_and_get_index_as( "Attribute Set", CPPType::get(), lf::ValueUsage::Maybe); graph_inputs.append(lf_socket); @@ -1019,8 +1022,8 @@ class LazyFunctionForGroupNode : public LazyFunction { if (i < group_node_.output_sockets().size()) { return group_node_.output_socket(i).name; } - for (const auto [bsocket_index, lf_socket_index] : - lf_output_for_input_bsocket_usage_.items()) { + for (const auto [bsocket_index, lf_socket_index] : lf_output_for_input_bsocket_usage_.items()) + { if (i == lf_socket_index) { std::stringstream ss; ss << "'" << group_node_.input_socket(bsocket_index).name << "' input is used"; @@ -1163,7 +1166,8 @@ class LazyFunctionForAnonymousAttributeSetExtract : public lf::LazyFunction { const GField &field = *type_.get_field_ptr(value_or_field); field.node().for_each_field_input_recursive([&](const FieldInput &field_input) { if (const auto *attr_field_input = dynamic_cast( - &field_input)) { + &field_input)) + { if (!attributes.names) { attributes.names = std::make_shared>(); } @@ -1202,7 +1206,8 @@ class LazyFunctionForAnonymousAttributeSetJoin : public lf::LazyFunction { if (params.get_input(this->get_use_input(i))) { if (bke::AnonymousAttributeSet *set = params.try_get_input_data_ptr_or_request( - this->get_attribute_set_input(i))) { + this->get_attribute_set_input(i))) + { sets.append(set); } else { @@ -1895,7 +1900,8 @@ struct GeometryNodesLazyFunctionGraphBuilder { break; } if (multi_input_link->is_muted() || !multi_input_link->fromsock->is_available() || - nodeIsDanglingReroute(&btree_, multi_input_link->fromnode)) { + nodeIsDanglingReroute(&btree_, multi_input_link->fromnode)) + { continue; } link_index++; @@ -2189,8 +2195,8 @@ struct GeometryNodesLazyFunctionGraphBuilder { continue; } const bNodeSocket &target_socket = *link->tosock; - if (lf::OutputSocket *is_used_socket = - socket_is_used_map_[target_socket.index_in_tree()]) { + if (lf::OutputSocket *is_used_socket = socket_is_used_map_[target_socket.index_in_tree()]) + { target_usages.append_non_duplicates(is_used_socket); } } @@ -2389,7 +2395,8 @@ struct GeometryNodesLazyFunctionGraphBuilder { Vector target_usages; for (const bNode *group_input_node : group_input_nodes) { if (lf::OutputSocket *lf_socket = - socket_is_used_map_[group_input_node->output_socket(i).index_in_tree()]) { + socket_is_used_map_[group_input_node->output_socket(i).index_in_tree()]) + { target_usages.append_non_duplicates(lf_socket); } } @@ -2679,8 +2686,8 @@ struct GeometryNodesLazyFunctionGraphBuilder { required_by_geometry_socket[bsocket->index_in_tree()] |= required_attributes; bits::foreach_1_index(required_attributes, [&](const int key_index) { const AttributeReferenceKey &key = attribute_reference_keys[key_index]; - if (key.type != AttributeReferenceKeyType::Socket || - &key.bsocket->owner_node() != bnode) { + if (key.type != AttributeReferenceKeyType::Socket || &key.bsocket->owner_node() != bnode) + { r_required_propagated_to_geometry_socket[bsocket->index_in_tree()][key_index].set(); } }); @@ -2723,7 +2730,8 @@ struct GeometryNodesLazyFunctionGraphBuilder { JoinAttibuteSetsCache join_attribute_sets_cache; for (const auto [geometry_output_bsocket, lf_attribute_set_input] : - attribute_set_propagation_map_.items()) { + attribute_set_propagation_map_.items()) + { const BoundedBitSpan required = required_propagated_to_geometry_socket[geometry_output_bsocket->index_in_tree()]; @@ -2757,7 +2765,8 @@ struct GeometryNodesLazyFunctionGraphBuilder { } }); if (lf::OutputSocket *joined_attribute_set = this->join_attribute_sets( - attribute_set_sockets, used_sockets, join_attribute_sets_cache)) { + attribute_set_sockets, used_sockets, join_attribute_sets_cache)) + { lf_graph_->add_link(*joined_attribute_set, *lf_attribute_set_input); } else { @@ -2971,7 +2980,8 @@ class UsedSocketVisualizeOptions : public lf::Graph::ToDotOptions { } } else if (lf::OutputSocket *lf_socket = builder_.output_socket_map_.lookup_default(bsocket, - nullptr)) { + nullptr)) + { socket_font_colors_.add(lf_socket, color_str); socket_name_suffixes_.add(lf_socket, suffix); } diff --git a/source/blender/nodes/intern/geometry_nodes_log.cc b/source/blender/nodes/intern/geometry_nodes_log.cc index c1d8a8f81b3..ca8f1ddd060 100644 --- a/source/blender/nodes/intern/geometry_nodes_log.cc +++ b/source/blender/nodes/intern/geometry_nodes_log.cc @@ -108,8 +108,8 @@ GeometryInfoLog::GeometryInfoLog(const GeometrySet &geometry_set) case GEO_COMPONENT_TYPE_EDIT: { const GeometryComponentEditData &edit_component = *( const GeometryComponentEditData *)component; - if (const bke::CurvesEditHints *curve_edit_hints = - edit_component.curves_edit_hints_.get()) { + if (const bke::CurvesEditHints *curve_edit_hints = edit_component.curves_edit_hints_.get()) + { EditDataInfo &info = this->edit_data_info.emplace(); info.has_deform_matrices = curve_edit_hints->deform_mats.has_value(); info.has_deformed_positions = curve_edit_hints->positions.has_value(); @@ -446,7 +446,8 @@ GeoTreeLogger &GeoModifierLog::get_local_tree_logger(const ComputeContext &compu parent_logger.children_hashes.append(compute_context.hash()); } if (const bke::NodeGroupComputeContext *node_group_compute_context = - dynamic_cast(&compute_context)) { + dynamic_cast(&compute_context)) + { tree_logger.group_node_id.emplace(node_group_compute_context->node_id()); } return tree_logger; @@ -549,7 +550,8 @@ GeoTreeLog *GeoModifierLog::get_tree_log_for_node_editor(const SpaceNode &snode) } if (const std::optional hash = GeoModifierLog::get_compute_context_hash_for_node_editor( - snode, object_and_modifier->nmd->modifier.name)) { + snode, object_and_modifier->nmd->modifier.name)) + { return &modifier_log->get_tree_log(*hash); } return nullptr; diff --git a/source/blender/nodes/intern/node_common.cc b/source/blender/nodes/intern/node_common.cc index b66f16f4d25..8f57851568b 100644 --- a/source/blender/nodes/intern/node_common.cc +++ b/source/blender/nodes/intern/node_common.cc @@ -115,7 +115,8 @@ bool nodeGroupPoll(const bNodeTree *nodetree, for (const bNode *node : grouptree->all_nodes()) { if (node->typeinfo->poll_instance && - !node->typeinfo->poll_instance(node, nodetree, r_disabled_hint)) { + !node->typeinfo->poll_instance(node, nodetree, r_disabled_hint)) + { return false; } } diff --git a/source/blender/nodes/intern/node_exec.cc b/source/blender/nodes/intern/node_exec.cc index 471e1575cc2..74dc73c84e2 100644 --- a/source/blender/nodes/intern/node_exec.cc +++ b/source/blender/nodes/intern/node_exec.cc @@ -56,7 +56,8 @@ static void node_init_input_index(bNodeSocket *sock, int *index) { /* Only consider existing link if from socket is valid! */ if (sock->link && !(sock->link->flag & NODE_LINK_MUTED) && sock->link->fromsock && - sock->link->fromsock->stack_index >= 0) { + sock->link->fromsock->stack_index >= 0) + { sock->stack_index = sock->link->fromsock->stack_index; } else { diff --git a/source/blender/nodes/intern/node_geometry_exec.cc b/source/blender/nodes/intern/node_geometry_exec.cc index a7caed7042b..f80dd433869 100644 --- a/source/blender/nodes/intern/node_geometry_exec.cc +++ b/source/blender/nodes/intern/node_geometry_exec.cc @@ -103,8 +103,8 @@ void GeoNodeExecParams::check_output_geometry_set(const GeometrySet &geometry_se { UNUSED_VARS_NDEBUG(geometry_set); #ifdef DEBUG - if (const bke::CurvesEditHints *curve_edit_hints = - geometry_set.get_curve_edit_hints_for_read()) { + if (const bke::CurvesEditHints *curve_edit_hints = geometry_set.get_curve_edit_hints_for_read()) + { /* If this is not valid, it's likely that the number of stored deformed points does not match * the number of points in the original data. */ BLI_assert(curve_edit_hints->is_valid()); diff --git a/source/blender/nodes/shader/node_shader_tree.cc b/source/blender/nodes/shader/node_shader_tree.cc index e88ff7255b6..c7f2266c7e6 100644 --- a/source/blender/nodes/shader/node_shader_tree.cc +++ b/source/blender/nodes/shader/node_shader_tree.cc @@ -473,7 +473,8 @@ static void flatten_group_do(bNodeTree *ntree, bNode *gnode) /* find external links to this input */ for (bNodeLink *tlink = static_cast(ntree->links.first); tlink != glinks_first->next; - tlink = tlink->next) { + tlink = tlink->next) + { if (tlink->tonode == gnode && STREQ(tlink->tosock->identifier, identifier)) { nodeAddLink(ntree, tlink->fromnode, tlink->fromsock, link->tonode, link->tosock); } @@ -485,7 +486,8 @@ static void flatten_group_do(bNodeTree *ntree, bNode *gnode) /* output links */ for (bNodeLink *tlink = static_cast(ntree->links.first); tlink != glinks_first->next; - tlink = tlink->next) { + tlink = tlink->next) + { if (tlink->fromnode == gnode) { const char *identifier = tlink->fromsock->identifier; /* find internal links to this output */ @@ -515,7 +517,8 @@ static void ntree_shader_groups_flatten(bNodeTree *localtree) /* This is effectively recursive as the flattened groups will add * nodes at the end of the list, which will also get evaluated. */ for (bNode *node = static_cast(localtree->nodes.first), *node_next; node; - node = node_next) { + node = node_next) + { if (ELEM(node->type, NODE_GROUP, NODE_CUSTOM_GROUP) && node->id != nullptr) { flatten_group_do(localtree, node); /* Continue even on new flattened nodes. */ @@ -544,7 +547,8 @@ static bool ntree_branch_count_and_tag_nodes(bNode *fromnode, bNode *tonode, voi { branchIterData *iter = (branchIterData *)userdata; if (fromnode->runtime->tmp_flag == -1 && - (iter->node_filter == nullptr || iter->node_filter(fromnode))) { + (iter->node_filter == nullptr || iter->node_filter(fromnode))) + { fromnode->runtime->tmp_flag = iter->node_count; iter->node_count++; } @@ -684,7 +688,8 @@ static bool ntree_weight_tree_tag_nodes(bNode *fromnode, bNode *tonode, void *us *node_count += (tonode->type == SH_NODE_MIX_SHADER) ? 4 : 1; } if (fromnode->runtime->tmp_flag == -1 && - ELEM(fromnode->type, SH_NODE_ADD_SHADER, SH_NODE_MIX_SHADER)) { + ELEM(fromnode->type, SH_NODE_ADD_SHADER, SH_NODE_MIX_SHADER)) + { fromnode->runtime->tmp_flag = *node_count; *node_count += (fromnode->type == SH_NODE_MIX_SHADER) ? 4 : 1; } diff --git a/source/blender/nodes/shader/nodes/node_shader_curves.cc b/source/blender/nodes/shader/nodes/node_shader_curves.cc index 4c81fac23e5..9933e367f90 100644 --- a/source/blender/nodes/shader/nodes/node_shader_curves.cc +++ b/source/blender/nodes/shader/nodes/node_shader_curves.cc @@ -175,7 +175,8 @@ static int gpu_shader_curve_rgb(GPUMaterial *mat, /* If the RGB curves do nothing, use a function that skips RGB computations. */ if (BKE_curvemapping_is_map_identity(curve_mapping, 0) && BKE_curvemapping_is_map_identity(curve_mapping, 1) && - BKE_curvemapping_is_map_identity(curve_mapping, 2)) { + BKE_curvemapping_is_map_identity(curve_mapping, 2)) + { return GPU_stack_link(mat, node, "curves_combined_only", diff --git a/source/blender/nodes/shader/nodes/node_shader_map_range.cc b/source/blender/nodes/shader/nodes/node_shader_map_range.cc index 1e114ccee0e..80c4331a492 100644 --- a/source/blender/nodes/shader/nodes/node_shader_map_range.cc +++ b/source/blender/nodes/shader/nodes/node_shader_map_range.cc @@ -45,7 +45,8 @@ static void node_shader_buts_map_range(uiLayout *layout, bContext * /*C*/, Point uiItemR(layout, ptr, "interpolation_type", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE); if (!ELEM(RNA_enum_get(ptr, "interpolation_type"), NODE_MAP_RANGE_SMOOTHSTEP, - NODE_MAP_RANGE_SMOOTHERSTEP)) { + NODE_MAP_RANGE_SMOOTHERSTEP)) + { uiItemR(layout, ptr, "clamp", UI_ITEM_R_SPLIT_EMPTY_NAME, nullptr, ICON_NONE); } } @@ -213,7 +214,8 @@ static int gpu_shader_map_range(GPUMaterial *mat, ret = GPU_stack_link(mat, node, "map_range_linear", in, out, GPU_constant(&clamp)); } if (ret && storage.clamp && !use_vector && - !ELEM(storage.interpolation_type, NODE_MAP_RANGE_SMOOTHSTEP, NODE_MAP_RANGE_SMOOTHERSTEP)) { + !ELEM(storage.interpolation_type, NODE_MAP_RANGE_SMOOTHSTEP, NODE_MAP_RANGE_SMOOTHERSTEP)) + { GPU_link(mat, "clamp_range", out[0].link, in[3].link, in[4].link, &out[0].link); } return ret; diff --git a/source/blender/nodes/shader/nodes/node_shader_math.cc b/source/blender/nodes/shader/nodes/node_shader_math.cc index 03bd924b79a..71b43dd82de 100644 --- a/source/blender/nodes/shader/nodes/node_shader_math.cc +++ b/source/blender/nodes/shader/nodes/node_shader_math.cc @@ -46,7 +46,8 @@ class SocketSearchOp { static void sh_node_math_gather_link_searches(GatherLinkSearchOpParams ¶ms) { if (!params.node_tree().typeinfo->validate_link( - static_cast(params.other_socket().type), SOCK_FLOAT)) { + static_cast(params.other_socket().type), SOCK_FLOAT)) + { return; } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_environment.cc b/source/blender/nodes/shader/nodes/node_shader_tex_environment.cc index 2887b89b832..ce98ffb0616 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_environment.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_environment.cc @@ -102,7 +102,8 @@ static int node_shader_gpu_tex_environment(GPUMaterial *mat, if (out[0].hasoutput && ima) { if (ELEM(ima->alpha_mode, IMA_ALPHA_IGNORE, IMA_ALPHA_CHANNEL_PACKED) || - IMB_colormanagement_space_name_is_data(ima->colorspace_settings.name)) { + IMB_colormanagement_space_name_is_data(ima->colorspace_settings.name)) + { /* Don't let alpha affect color output in these cases. */ GPU_link(mat, "color_alpha_clear", out[0].link, &out[0].link); } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_image.cc b/source/blender/nodes/shader/nodes/node_shader_tex_image.cc index ff66b021ac2..78b3233b879 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_image.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_image.cc @@ -134,7 +134,8 @@ static int node_shader_gpu_tex_image(GPUMaterial *mat, if (out[0].hasoutput) { if (ELEM(ima->alpha_mode, IMA_ALPHA_IGNORE, IMA_ALPHA_CHANNEL_PACKED) || - IMB_colormanagement_space_name_is_data(ima->colorspace_settings.name)) { + IMB_colormanagement_space_name_is_data(ima->colorspace_settings.name)) + { /* Don't let alpha affect color output in these cases. */ GPU_link(mat, "color_alpha_clear", out[0].link, &out[0].link); } diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc index fb18a59fef1..589dbbd46d2 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_musgrave.cc @@ -183,7 +183,8 @@ class MusgraveFunction : public mf::MultiFunction { if (ELEM(musgrave_type, SHD_MUSGRAVE_RIDGED_MULTIFRACTAL, SHD_MUSGRAVE_HYBRID_MULTIFRACTAL, - SHD_MUSGRAVE_HETERO_TERRAIN)) { + SHD_MUSGRAVE_HETERO_TERRAIN)) + { builder.single_input("Offset"); } if (ELEM(musgrave_type, SHD_MUSGRAVE_RIDGED_MULTIFRACTAL, SHD_MUSGRAVE_HYBRID_MULTIFRACTAL)) { diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc b/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc index 0475b3e88bf..55f5fda3317 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_sky.cc @@ -286,7 +286,8 @@ static void node_gather_link_searches(GatherLinkSearchOpParams ¶ms) return; } if (params.node_tree().typeinfo->validate_link( - static_cast(params.other_socket().type), SOCK_FLOAT)) { + static_cast(params.other_socket().type), SOCK_FLOAT)) + { params.add_item(IFACE_("Vector"), [](LinkSearchOpParams ¶ms) { bNode &node = params.add_node("ShaderNodeTexSky"); NodeTexSky *tex = (NodeTexSky *)node.storage; diff --git a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc index 585d1071cca..42932c11241 100644 --- a/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc +++ b/source/blender/nodes/shader/nodes/node_shader_tex_voronoi.cc @@ -57,7 +57,8 @@ static void node_shader_buts_tex_voronoi(uiLayout *layout, bContext * /*C*/, Poi uiItemR(layout, ptr, "feature", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE); int feature = RNA_enum_get(ptr, "feature"); if (!ELEM(feature, SHD_VORONOI_DISTANCE_TO_EDGE, SHD_VORONOI_N_SPHERE_RADIUS) && - RNA_enum_get(ptr, "voronoi_dimensions") != 1) { + RNA_enum_get(ptr, "voronoi_dimensions") != 1) + { uiItemR(layout, ptr, "distance", UI_ITEM_R_SPLIT_EMPTY_NAME, "", ICON_NONE); } } diff --git a/source/blender/nodes/shader/nodes/node_shader_vector_math.cc b/source/blender/nodes/shader/nodes/node_shader_vector_math.cc index e303b0766d2..665395de156 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vector_math.cc +++ b/source/blender/nodes/shader/nodes/node_shader_vector_math.cc @@ -48,19 +48,22 @@ class SocketSearchOp { static void sh_node_vector_math_gather_link_searches(GatherLinkSearchOpParams ¶ms) { if (!params.node_tree().typeinfo->validate_link( - static_cast(params.other_socket().type), SOCK_VECTOR)) { + static_cast(params.other_socket().type), SOCK_VECTOR)) + { return; } const int weight = ELEM(params.other_socket().type, SOCK_VECTOR, SOCK_RGBA) ? 0 : -1; for (const EnumPropertyItem *item = rna_enum_node_vec_math_items; item->identifier != nullptr; - item++) { + item++) + { if (item->name != nullptr && item->identifier[0] != '\0') { if ((params.in_out() == SOCK_OUT) && ELEM(item->value, NODE_VECTOR_MATH_LENGTH, NODE_VECTOR_MATH_DISTANCE, - NODE_VECTOR_MATH_DOT_PRODUCT)) { + NODE_VECTOR_MATH_DOT_PRODUCT)) + { params.add_item(IFACE_(item->name), SocketSearchOp{"Value", (NodeVectorMathOperation)item->value}, weight); diff --git a/source/blender/nodes/shader/nodes/node_shader_vector_transform.cc b/source/blender/nodes/shader/nodes/node_shader_vector_transform.cc index f72c1b4428a..9013f197a21 100644 --- a/source/blender/nodes/shader/nodes/node_shader_vector_transform.cc +++ b/source/blender/nodes/shader/nodes/node_shader_vector_transform.cc @@ -111,14 +111,16 @@ static int gpu_shader_vect_transform(GPUMaterial *mat, /* For cycles we have inverted Z */ /* TODO: pass here the correct matrices */ if (nodeprop->convert_from == SHD_VECT_TRANSFORM_SPACE_CAMERA && - nodeprop->convert_to != SHD_VECT_TRANSFORM_SPACE_CAMERA) { + nodeprop->convert_to != SHD_VECT_TRANSFORM_SPACE_CAMERA) + { GPU_link(mat, "invert_z", inputlink, &inputlink); } GPU_link(mat, func_name, inputlink, &out[0].link); if (nodeprop->convert_to == SHD_VECT_TRANSFORM_SPACE_CAMERA && - nodeprop->convert_from != SHD_VECT_TRANSFORM_SPACE_CAMERA) { + nodeprop->convert_from != SHD_VECT_TRANSFORM_SPACE_CAMERA) + { GPU_link(mat, "invert_z", out[0].link, &out[0].link); } } diff --git a/source/blender/nodes/texture/node_texture_tree.cc b/source/blender/nodes/texture/node_texture_tree.cc index 684e1d1ae21..3f84895b5d4 100644 --- a/source/blender/nodes/texture/node_texture_tree.cc +++ b/source/blender/nodes/texture/node_texture_tree.cc @@ -261,8 +261,8 @@ static void tex_free_delegates(bNodeTreeExec *exec) int th, a; for (th = 0; th < BLENDER_MAX_THREADS; th++) { - for (nts = static_cast(exec->threadstack[th].first); nts; - nts = nts->next) { + for (nts = static_cast(exec->threadstack[th].first); nts; nts = nts->next) + { for (ns = nts->stack, a = 0; a < exec->stacksize; a++, ns++) { if (ns->data && !ns->is_copy) { MEM_freeN(ns->data); @@ -281,8 +281,8 @@ void ntreeTexEndExecTree_internal(bNodeTreeExec *exec) tex_free_delegates(exec); for (a = 0; a < BLENDER_MAX_THREADS; a++) { - for (nts = static_cast(exec->threadstack[a].first); nts; - nts = nts->next) { + for (nts = static_cast(exec->threadstack[a].first); nts; nts = nts->next) + { if (nts->stack) { MEM_freeN(nts->stack); } diff --git a/source/blender/nodes/texture/nodes/node_texture_bricks.cc b/source/blender/nodes/texture/nodes/node_texture_bricks.cc index c215ab68c95..f0cee1d995d 100644 --- a/source/blender/nodes/texture/nodes/node_texture_bricks.cc +++ b/source/blender/nodes/texture/nodes/node_texture_bricks.cc @@ -80,7 +80,8 @@ static void colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in, shor CLAMP(tint, 0.0f, 1.0f); if (ins_x < mortar_thickness || ins_y < mortar_thickness || - ins_x > (brick_width - mortar_thickness) || ins_y > (row_height - mortar_thickness)) { + ins_x > (brick_width - mortar_thickness) || ins_y > (row_height - mortar_thickness)) + { copy_v4_v4(out, mortar); } else { diff --git a/source/blender/python/bmesh/bmesh_py_api.c b/source/blender/python/bmesh/bmesh_py_api.c index 53b65a14538..448eeb4eca9 100644 --- a/source/blender/python/bmesh/bmesh_py_api.c +++ b/source/blender/python/bmesh/bmesh_py_api.c @@ -47,7 +47,8 @@ static PyObject *bpy_bm_new(PyObject *UNUSED(self), PyObject *args, PyObject *kw bool use_operators = true; if (!PyArg_ParseTupleAndKeywords( - args, kw, "|$O&:new", (char **)kwlist, PyC_ParseBool, &use_operators)) { + args, kw, "|$O&:new", (char **)kwlist, PyC_ParseBool, &use_operators)) + { return NULL; } @@ -115,7 +116,8 @@ static PyObject *bpy_bm_update_edit_mesh(PyObject *UNUSED(self), PyObject *args, PyC_ParseBool, &do_loop_triangles, PyC_ParseBool, - &is_destructive)) { + &is_destructive)) + { return NULL; } diff --git a/source/blender/python/bmesh/bmesh_py_ops_call.c b/source/blender/python/bmesh/bmesh_py_ops_call.c index 5c8687fbf21..7d9ee2539c9 100644 --- a/source/blender/python/bmesh/bmesh_py_ops_call.c +++ b/source/blender/python/bmesh/bmesh_py_ops_call.c @@ -259,7 +259,8 @@ static int bpy_slot_from_py(BMesh *bm, (slot->slot_subtype.elem & BM_ALL_NOLOOP), opname, slot_name, - "single element") == -1) { + "single element") == -1) + { return -1; /* error is set in bpy_slot_from_py_elem_check() */ } @@ -283,7 +284,8 @@ static int bpy_slot_from_py(BMesh *bm, (slot->slot_subtype.elem & BM_ALL_NOLOOP), opname, slot_name, - "element buffer") == -1) { + "element buffer") == -1) + { return -1; /* error is set in bpy_slot_from_py_elem_check() */ } @@ -296,7 +298,8 @@ static int bpy_slot_from_py(BMesh *bm, (slot->slot_subtype.elem & BM_ALL_NOLOOP), opname, slot_name, - "element buffer") == -1) { + "element buffer") == -1) + { return -1; /* error is set in bpy_slot_from_py_elem_check() */ } @@ -309,7 +312,8 @@ static int bpy_slot_from_py(BMesh *bm, (slot->slot_subtype.elem & BM_ALL_NOLOOP), opname, slot_name, - "element buffer") == -1) { + "element buffer") == -1) + { return -1; /* error is set in bpy_slot_from_py_elem_check() */ } BMO_slot_buffer_from_all(bm, bmop, bmop->slots_in, slot_name, BM_FACE); @@ -328,7 +332,8 @@ static int bpy_slot_from_py(BMesh *bm, (slot->slot_subtype.elem & BM_ALL_NOLOOP), opname, slot_name, - "element buffer") == -1) { + "element buffer") == -1) + { return -1; /* error is set in bpy_slot_from_py_elem_check() */ } @@ -417,7 +422,8 @@ static int bpy_slot_from_py(BMesh *bm, BM_ALL_NOLOOP, opname, slot_name, - "invalid key in dict") == -1) { + "invalid key in dict") == -1) + { return -1; /* error is set in bpy_slot_from_py_elem_check() */ } @@ -426,7 +432,8 @@ static int bpy_slot_from_py(BMesh *bm, BM_ALL_NOLOOP, opname, slot_name, - "invalid value in dict") == -1) { + "invalid value in dict") == -1) + { return -1; /* error is set in bpy_slot_from_py_elem_check() */ } @@ -448,7 +455,8 @@ static int bpy_slot_from_py(BMesh *bm, BM_ALL_NOLOOP, opname, slot_name, - "invalid key in dict") == -1) { + "invalid key in dict") == -1) + { return -1; /* error is set in bpy_slot_from_py_elem_check() */ } @@ -481,7 +489,8 @@ static int bpy_slot_from_py(BMesh *bm, BM_ALL_NOLOOP, opname, slot_name, - "invalid key in dict") == -1) { + "invalid key in dict") == -1) + { return -1; /* error is set in bpy_slot_from_py_elem_check() */ } @@ -514,7 +523,8 @@ static int bpy_slot_from_py(BMesh *bm, BM_ALL_NOLOOP, opname, slot_name, - "invalid key in dict") == -1) { + "invalid key in dict") == -1) + { return -1; /* error is set in bpy_slot_from_py_elem_check() */ } @@ -547,7 +557,8 @@ static int bpy_slot_from_py(BMesh *bm, BM_ALL_NOLOOP, opname, slot_name, - "invalid key in set") == -1) { + "invalid key in set") == -1) + { return -1; /* error is set in bpy_slot_from_py_elem_check() */ } @@ -738,7 +749,8 @@ PyObject *BPy_BMO_call(BPy_BMeshOpFunc *self, PyObject *args, PyObject *kw) BMOperator bmop; if ((PyTuple_GET_SIZE(args) == 1) && (py_bm = (BPy_BMesh *)PyTuple_GET_ITEM(args, 0)) && - BPy_BMesh_Check(py_bm)) { + BPy_BMesh_Check(py_bm)) + { BPY_BM_CHECK_OBJ(py_bm); bm = py_bm->bm; diff --git a/source/blender/python/bmesh/bmesh_py_types.c b/source/blender/python/bmesh/bmesh_py_types.c index 42428282dbc..ea723bd592a 100644 --- a/source/blender/python/bmesh/bmesh_py_types.c +++ b/source/blender/python/bmesh/bmesh_py_types.c @@ -274,7 +274,8 @@ static int bpy_bmesh_select_mode_set(BPy_BMesh *self, PyObject *value) BPY_BM_CHECK_INT(self); if (PyC_FlagSet_ToBitfield(bpy_bm_scene_vert_edge_face_flags, value, &flag, "bm.select_mode") == - -1) { + -1) + { return -1; } if (flag == 0) { @@ -1018,8 +1019,8 @@ static PyObject *bpy_bmesh_to_mesh(BPy_BMesh *self, PyObject *args) BPY_BM_CHECK_OBJ(self); - if (!PyArg_ParseTuple(args, "O:to_mesh", &py_mesh) || - !(me = PyC_RNA_AsPointer(py_mesh, "Mesh"))) { + if (!PyArg_ParseTuple(args, "O:to_mesh", &py_mesh) || !(me = PyC_RNA_AsPointer(py_mesh, "Mesh"))) + { return NULL; } @@ -1100,7 +1101,8 @@ static PyObject *bpy_bmesh_from_object(BPy_BMesh *self, PyObject *args, PyObject PyC_ParseBool, &use_vert_normal) || !(ob = PyC_RNA_AsPointer(py_object, "Object")) || - !(depsgraph = PyC_RNA_AsPointer(py_depsgraph, "Depsgraph"))) { + !(depsgraph = PyC_RNA_AsPointer(py_depsgraph, "Depsgraph"))) + { return NULL; } @@ -1206,7 +1208,8 @@ static PyObject *bpy_bmesh_from_mesh(BPy_BMesh *self, PyObject *args, PyObject * PyC_ParseBool, &use_shape_key, &shape_key_index) || - !(me = PyC_RNA_AsPointer(py_mesh, "Mesh"))) { + !(me = PyC_RNA_AsPointer(py_mesh, "Mesh"))) + { return NULL; } @@ -1303,14 +1306,9 @@ static PyObject *bpy_bmesh_transform(BPy_BMElem *self, PyObject *args, PyObject BPY_BM_CHECK_OBJ(self); - if (!PyArg_ParseTupleAndKeywords(args, - kw, - "O!|$O!:transform", - (char **)kwlist, - &matrix_Type, - &mat, - &PySet_Type, - &filter)) { + if (!PyArg_ParseTupleAndKeywords( + args, kw, "O!|$O!:transform", (char **)kwlist, &matrix_Type, &mat, &PySet_Type, &filter)) + { return NULL; } @@ -1326,8 +1324,9 @@ static PyObject *bpy_bmesh_transform(BPy_BMElem *self, PyObject *args, PyObject return NULL; } - if (filter != NULL && PyC_FlagSet_ToBitfield( - bpy_bm_hflag_all_flags, filter, &filter_flags, "bm.transform") == -1) { + if (filter != NULL && + PyC_FlagSet_ToBitfield(bpy_bm_hflag_all_flags, filter, &filter_flags, "bm.transform") == -1) + { return NULL; } @@ -1367,7 +1366,8 @@ static PyObject *bpy_bmesh_calc_volume(BPy_BMElem *self, PyObject *args, PyObjec BPY_BM_CHECK_OBJ(self); if (!PyArg_ParseTupleAndKeywords( - args, kw, "|$O!:calc_volume", (char **)kwlist, &PyBool_Type, &is_signed)) { + args, kw, "|$O!:calc_volume", (char **)kwlist, &PyBool_Type, &is_signed)) + { return NULL; } @@ -1832,7 +1832,8 @@ static PyObject *bpy_bmface_copy_from_face_interp(BPy_BMFace *self, PyObject *ar &BPy_BMFace_Type, &py_face, PyC_ParseBool, - &do_vertex)) { + &do_vertex)) + { return NULL; } @@ -1874,7 +1875,8 @@ static PyObject *bpy_bmface_copy(BPy_BMFace *self, PyObject *args, PyObject *kw) PyC_ParseBool, &do_verts, PyC_ParseBool, - &do_edges)) { + &do_edges)) + { return NULL; } @@ -2087,7 +2089,8 @@ static PyObject *bpy_bmloop_copy_from_face_interp(BPy_BMLoop *self, PyObject *ar PyC_ParseBool, &do_vertex, PyC_ParseBool, - &do_multires)) { + &do_multires)) + { return NULL; } @@ -2670,7 +2673,8 @@ static PyObject *bpy_bmelemseq_sort(BPy_BMElemSeq *self, PyObject *args, PyObjec (char **)kwlist, &keyfunc, PyC_ParseBool, - &do_reverse)) { + &do_reverse)) + { return NULL; } } diff --git a/source/blender/python/bmesh/bmesh_py_types.h b/source/blender/python/bmesh/bmesh_py_types.h index 2e77e2677b8..8ebe89e1a6b 100644 --- a/source/blender/python/bmesh/bmesh_py_types.h +++ b/source/blender/python/bmesh/bmesh_py_types.h @@ -203,8 +203,8 @@ int bpy_bm_generic_valid_check_source(BMesh *bm_source, #define BPY_BM_CHECK_SOURCE_OBJ(bm, errmsg, ...) \ { \ void *_args[] = {__VA_ARGS__}; \ - if (UNLIKELY(bpy_bm_generic_valid_check_source(bm, errmsg, _args, ARRAY_SIZE(_args)) == \ - -1)) { \ + if (UNLIKELY(bpy_bm_generic_valid_check_source(bm, errmsg, _args, ARRAY_SIZE(_args)) == -1)) \ + { \ return NULL; \ } \ } \ @@ -212,8 +212,8 @@ int bpy_bm_generic_valid_check_source(BMesh *bm_source, #define BPY_BM_CHECK_SOURCE_INT(bm, errmsg, ...) \ { \ void *_args[] = {__VA_ARGS__}; \ - if (UNLIKELY(bpy_bm_generic_valid_check_source(bm, errmsg, _args, ARRAY_SIZE(_args)) == \ - -1)) { \ + if (UNLIKELY(bpy_bm_generic_valid_check_source(bm, errmsg, _args, ARRAY_SIZE(_args)) == -1)) \ + { \ return -1; \ } \ } \ diff --git a/source/blender/python/bmesh/bmesh_py_types_customdata.c b/source/blender/python/bmesh/bmesh_py_types_customdata.c index 050557e4120..667251f166c 100644 --- a/source/blender/python/bmesh/bmesh_py_types_customdata.c +++ b/source/blender/python/bmesh/bmesh_py_types_customdata.c @@ -1266,8 +1266,8 @@ int BPy_BMLayerItem_SetItem(BPy_BMElem *py_ele, BPy_BMLayerItem *py_layer, PyObj } case CD_SHAPEKEY: { float tmp_val[3]; - if (UNLIKELY(mathutils_array_parse(tmp_val, 3, 3, py_value, "BMVert[shape] = value") == - -1)) { + if (UNLIKELY(mathutils_array_parse(tmp_val, 3, 3, py_value, "BMVert[shape] = value") == -1)) + { ret = -1; } else { diff --git a/source/blender/python/bmesh/bmesh_py_utils.c b/source/blender/python/bmesh/bmesh_py_utils.c index f8ef9d1012d..cd89f37e268 100644 --- a/source/blender/python/bmesh/bmesh_py_utils.c +++ b/source/blender/python/bmesh/bmesh_py_utils.c @@ -43,12 +43,9 @@ static PyObject *bpy_bm_utils_vert_collapse_edge(PyObject *UNUSED(self), PyObjec BMesh *bm; BMEdge *e_new = NULL; - if (!PyArg_ParseTuple(args, - "O!O!:vert_collapse_edge", - &BPy_BMVert_Type, - &py_vert, - &BPy_BMEdge_Type, - &py_edge)) { + if (!PyArg_ParseTuple( + args, "O!O!:vert_collapse_edge", &BPy_BMVert_Type, &py_vert, &BPy_BMEdge_Type, &py_edge)) + { return NULL; } @@ -116,7 +113,8 @@ static PyObject *bpy_bm_utils_vert_collapse_faces(PyObject *UNUSED(self), PyObje &BPy_BMEdge_Type, &py_edge, &fac, - &do_join_faces)) { + &do_join_faces)) + { return NULL; } @@ -196,12 +194,9 @@ static PyObject *bpy_bm_utils_vert_splice(PyObject *UNUSED(self), PyObject *args bool ok; - if (!PyArg_ParseTuple(args, - "O!O!:vert_splice", - &BPy_BMVert_Type, - &py_vert, - &BPy_BMVert_Type, - &py_vert_target)) { + if (!PyArg_ParseTuple( + args, "O!O!:vert_splice", &BPy_BMVert_Type, &py_vert, &BPy_BMVert_Type, &py_vert_target)) + { return NULL; } @@ -315,13 +310,9 @@ static PyObject *bpy_bm_utils_edge_split(PyObject *UNUSED(self), PyObject *args) BMVert *v_new = NULL; BMEdge *e_new = NULL; - if (!PyArg_ParseTuple(args, - "O!O!f:edge_split", - &BPy_BMEdge_Type, - &py_edge, - &BPy_BMVert_Type, - &py_vert, - &fac)) { + if (!PyArg_ParseTuple( + args, "O!O!f:edge_split", &BPy_BMEdge_Type, &py_edge, &BPy_BMVert_Type, &py_vert, &fac)) + { return NULL; } @@ -372,7 +363,8 @@ static PyObject *bpy_bm_utils_edge_rotate(PyObject *UNUSED(self), PyObject *args BMEdge *e_new = NULL; if (!PyArg_ParseTuple( - args, "O!|O&:edge_rotate", &BPy_BMEdge_Type, &py_edge, PyC_ParseBool, &do_ccw)) { + args, "O!|O&:edge_rotate", &BPy_BMEdge_Type, &py_edge, PyC_ParseBool, &do_ccw)) + { return NULL; } @@ -446,7 +438,8 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args, PyC_ParseBool, &edge_exists, &BPy_BMEdge_Type, - &py_edge_example)) { + &py_edge_example)) + { return NULL; } @@ -460,7 +453,8 @@ static PyObject *bpy_bm_utils_face_split(PyObject *UNUSED(self), PyObject *args, /* this doubles for checking that the verts are in the same mesh */ if ((l_a = BM_face_vert_share_loop(py_face->f, py_vert_a->v)) && - (l_b = BM_face_vert_share_loop(py_face->f, py_vert_b->v))) { + (l_b = BM_face_vert_share_loop(py_face->f, py_vert_b->v))) + { /* pass */ } else { @@ -564,7 +558,8 @@ static PyObject *bpy_bm_utils_face_split_edgenet(PyObject *UNUSED(self), (char **)kwlist, &BPy_BMFace_Type, &py_face, - &edge_seq)) { + &edge_seq)) + { return NULL; } @@ -674,12 +669,9 @@ static PyObject *bpy_bm_utils_face_vert_separate(PyObject *UNUSED(self), PyObjec BMLoop *l; BMVert *v_old, *v_new; - if (!PyArg_ParseTuple(args, - "O!O!:face_vert_separate", - &BPy_BMFace_Type, - &py_face, - &BPy_BMVert_Type, - &py_vert)) { + if (!PyArg_ParseTuple( + args, "O!O!:face_vert_separate", &BPy_BMFace_Type, &py_face, &BPy_BMVert_Type, &py_vert)) + { return NULL; } diff --git a/source/blender/python/generic/bgl.c b/source/blender/python/generic/bgl.c index eee6790f6a2..439b0c48705 100644 --- a/source/blender/python/generic/bgl.c +++ b/source/blender/python/generic/bgl.c @@ -825,7 +825,8 @@ static PyObject *Buffer_new(PyTypeObject *UNUSED(type), PyObject *args, PyObject pybuffer.format); } else if (ndimensions != pybuffer.ndim || - !compare_dimensions(ndimensions, dimensions, pybuffer.shape)) { + !compare_dimensions(ndimensions, dimensions, pybuffer.shape)) + { PyErr_Format(PyExc_TypeError, "array size does not match"); } else { diff --git a/source/blender/python/generic/blf_py_api.c b/source/blender/python/generic/blf_py_api.c index 2b7c5ed7e55..bd86dea082b 100644 --- a/source/blender/python/generic/blf_py_api.c +++ b/source/blender/python/generic/blf_py_api.c @@ -123,8 +123,8 @@ static PyObject *py_blf_color(PyObject *UNUSED(self), PyObject *args) int fontid; float rgba[4]; - if (!PyArg_ParseTuple( - args, "iffff:blf.color", &fontid, &rgba[0], &rgba[1], &rgba[2], &rgba[3])) { + if (!PyArg_ParseTuple(args, "iffff:blf.color", &fontid, &rgba[0], &rgba[1], &rgba[2], &rgba[3])) + { return NULL; } @@ -361,7 +361,8 @@ static PyObject *py_blf_shadow(PyObject *UNUSED(self), PyObject *args) float rgba[4]; if (!PyArg_ParseTuple( - args, "iiffff:blf.shadow", &fontid, &level, &rgba[0], &rgba[1], &rgba[2], &rgba[3])) { + args, "iiffff:blf.shadow", &fontid, &level, &rgba[0], &rgba[1], &rgba[2], &rgba[3])) + { return NULL; } diff --git a/source/blender/python/generic/idprop_py_api.c b/source/blender/python/generic/idprop_py_api.c index af6aad796dd..f2fe31d973e 100644 --- a/source/blender/python/generic/idprop_py_api.c +++ b/source/blender/python/generic/idprop_py_api.c @@ -608,7 +608,8 @@ static IDProperty *idp_from_PySequence(const char *name, PyObject *ob) else { const char format = PyC_StructFmt_type_from_str(buffer.format); if (PyC_StructFmt_type_is_float_any(format) || - (PyC_StructFmt_type_is_int_any(format) && buffer.itemsize == 4)) { + (PyC_StructFmt_type_is_int_any(format) && buffer.itemsize == 4)) + { use_buffer = true; } else { @@ -737,7 +738,8 @@ bool BPy_IDProperty_Map_ValidateAndCreate(PyObject *name_obj, IDProperty *group, * obviously this isn't a complete solution, but helps for common cases. */ prop_exist = IDP_GetPropertyFromGroup(group, prop->name); if ((prop_exist != NULL) && (prop_exist->type == prop->type) && - (prop_exist->subtype == prop->subtype)) { + (prop_exist->subtype == prop->subtype)) + { /* Preserve prev/next links!!! See #42593. */ prop->prev = prop_exist->prev; prop->next = prop_exist->next; diff --git a/source/blender/python/generic/idprop_py_ui_api.c b/source/blender/python/generic/idprop_py_ui_api.c index ad26fe273ed..b87d40db2ef 100644 --- a/source/blender/python/generic/idprop_py_ui_api.c +++ b/source/blender/python/generic/idprop_py_ui_api.c @@ -58,7 +58,8 @@ static bool idprop_ui_data_update_base(IDPropertyUIData *ui_data, if (pyrna_enum_value_from_id(rna_enum_property_subtype_items, rna_subtype, &ui_data->rna_subtype, - "IDPropertyUIManager.update") == -1) { + "IDPropertyUIManager.update") == -1) + { return false; } } @@ -88,7 +89,8 @@ static bool idprop_ui_data_update_int_default(IDProperty *idprop, int *new_default_array = (int *)MEM_malloc_arrayN(len, sizeof(int), __func__); if (PyC_AsArray( new_default_array, sizeof(int), default_value, len, &PyLong_Type, "ui_data_update") == - -1) { + -1) + { MEM_freeN(new_default_array); return false; } @@ -130,7 +132,8 @@ static bool idprop_ui_data_update_int(IDProperty *idprop, PyObject *args, PyObje &step, &default_value, &rna_subtype, - &description)) { + &description)) + { return false; } @@ -202,7 +205,8 @@ static bool idprop_ui_data_update_bool_default(IDProperty *idprop, default_value, len, &PyBool_Type, - "ui_data_update") == -1) { + "ui_data_update") == -1) + { MEM_freeN(new_default_array); return false; } @@ -237,7 +241,8 @@ static bool idprop_ui_data_update_bool(IDProperty *idprop, PyObject *args, PyObj (char **)kwlist, &default_value, &rna_subtype, - &description)) { + &description)) + { return false; } @@ -285,7 +290,8 @@ static bool idprop_ui_data_update_float_default(IDProperty *idprop, default_value, len, &PyFloat_Type, - "ui_data_update") == -1) { + "ui_data_update") == -1) + { MEM_freeN(new_default_array); return false; } @@ -337,7 +343,8 @@ static bool idprop_ui_data_update_float(IDProperty *idprop, PyObject *args, PyOb &precision, &default_value, &rna_subtype, - &description)) { + &description)) + { return false; } @@ -406,7 +413,8 @@ static bool idprop_ui_data_update_string(IDProperty *idprop, PyObject *args, PyO (char **)kwlist, &default_value, &rna_subtype, - &description)) { + &description)) + { return false; } @@ -438,7 +446,8 @@ static bool idprop_ui_data_update_id(IDProperty *idprop, PyObject *args, PyObjec const char *description = NULL; const char *kwlist[] = {"subtype", "description", NULL}; if (!PyArg_ParseTupleAndKeywords( - args, kwargs, "|$zz:update", (char **)kwlist, &rna_subtype, &description)) { + args, kwargs, "|$zz:update", (char **)kwlist, &rna_subtype, &description)) + { return false; } diff --git a/source/blender/python/generic/imbuf_py_api.c b/source/blender/python/generic/imbuf_py_api.c index 925e47afaf5..0f7de169352 100644 --- a/source/blender/python/generic/imbuf_py_api.c +++ b/source/blender/python/generic/imbuf_py_api.c @@ -101,7 +101,8 @@ static PyObject *py_imbuf_resize(Py_ImBuf *self, PyObject *args, PyObject *kw) 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kw, &_parser, &size[0], &size[1], PyC_ParseStringEnum, &method)) { + args, kw, &_parser, &size[0], &size[1], PyC_ParseStringEnum, &method)) + { return NULL; } if (size[0] <= 0 || size[1] <= 0) { @@ -145,7 +146,8 @@ static PyObject *py_imbuf_crop(Py_ImBuf *self, PyObject *args, PyObject *kw) 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kw, &_parser, &crop.xmin, &crop.ymin, &crop.xmax, &crop.ymax)) { + args, kw, &_parser, &crop.xmin, &crop.ymin, &crop.xmax, &crop.ymax)) + { return NULL; } @@ -156,7 +158,8 @@ static PyObject *py_imbuf_crop(Py_ImBuf *self, PyObject *args, PyObject *kw) /* X order. */ !(crop.xmin <= crop.xmax) || /* Y order. */ - !(crop.ymin <= crop.ymax)) { + !(crop.ymin <= crop.ymax)) + { PyErr_SetString(PyExc_ValueError, "ImBuf crop min/max not in range"); return NULL; } diff --git a/source/blender/python/generic/py_capi_rna.c b/source/blender/python/generic/py_capi_rna.c index 8bb91d311cd..86a00133be8 100644 --- a/source/blender/python/generic/py_capi_rna.c +++ b/source/blender/python/generic/py_capi_rna.c @@ -200,7 +200,8 @@ int pyrna_enum_value_parse_string(PyObject *o, void *p) } struct BPy_EnumProperty_Parse *parse_data = p; if (pyrna_enum_value_from_id( - parse_data->items, identifier, &parse_data->value, "enum identifier") == -1) { + parse_data->items, identifier, &parse_data->value, "enum identifier") == -1) + { return 0; } @@ -218,7 +219,8 @@ int pyrna_enum_bitfield_parse_set(PyObject *o, void *p) struct BPy_EnumProperty_Parse *parse_data = p; if (pyrna_enum_bitfield_from_set( - parse_data->items, o, &parse_data->value, "enum identifier set") == -1) { + parse_data->items, o, &parse_data->value, "enum identifier set") == -1) + { return 0; } parse_data->value_orig = o; diff --git a/source/blender/python/generic/py_capi_utils.c b/source/blender/python/generic/py_capi_utils.c index b7b18aa79a1..f4bb31c7522 100644 --- a/source/blender/python/generic/py_capi_utils.c +++ b/source/blender/python/generic/py_capi_utils.c @@ -214,8 +214,8 @@ static int PyC_AsArray_Multi_FAST_impl(void **array_p, const int length = dims[0]; if (dims_len == 1) { - if (PyC_AsArray_FAST(*array_p, array_item_size, value_fast, length, type, error_prefix) == - -1) { + if (PyC_AsArray_FAST(*array_p, array_item_size, value_fast, length, type, error_prefix) == -1) + { return -1; } *array_p = POINTER_OFFSET(*array_p, array_item_size * length); @@ -241,7 +241,8 @@ static int PyC_AsArray_Multi_FAST_impl(void **array_p, dims_next, dims_next_len, type, - error_prefix) == -1) { + error_prefix) == -1) + { return -1; } } @@ -1309,7 +1310,8 @@ void *PyC_RNA_AsPointer(PyObject *value, const char *type_name) if (STREQ(Py_TYPE(value)->tp_name, type_name) && (as_pointer = PyObject_GetAttrString(value, "as_pointer")) != NULL && - PyCallable_Check(as_pointer)) { + PyCallable_Check(as_pointer)) + { void *result = NULL; /* must be a 'type_name' object */ diff --git a/source/blender/python/gpu/gpu_py_batch.c b/source/blender/python/gpu/gpu_py_batch.c index 9df37a41892..9c3d4ad6bab 100644 --- a/source/blender/python/gpu/gpu_py_batch.c +++ b/source/blender/python/gpu/gpu_py_batch.c @@ -71,7 +71,8 @@ static PyObject *pygpu_batch__tp_new(PyTypeObject *UNUSED(type), PyObject *args, &BPyGPUVertBuf_Type, &py_vertbuf, &BPyGPUIndexBuf_Type, - &py_indexbuf)) { + &py_indexbuf)) + { return NULL; } @@ -136,8 +137,8 @@ static PyObject *pygpu_batch_vertbuf_add(BPyGPUBatch *self, BPyGPUVertBuf *py_bu return NULL; } - if (GPU_vertbuf_get_vertex_len(self->batch->verts[0]) != - GPU_vertbuf_get_vertex_len(py_buf->buf)) { + if (GPU_vertbuf_get_vertex_len(self->batch->verts[0]) != GPU_vertbuf_get_vertex_len(py_buf->buf)) + { PyErr_Format(PyExc_TypeError, "Expected %d length, got %d", GPU_vertbuf_get_vertex_len(self->batch->verts[0]), @@ -264,7 +265,8 @@ static PyObject *pygpu_batch_draw_instanced(BPyGPUBatch *self, PyObject *args, P 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kw, &_parser, &BPyGPUShader_Type, &py_program, &instance_start, &instance_count)) { + args, kw, &_parser, &BPyGPUShader_Type, &py_program, &instance_start, &instance_count)) + { return NULL; } @@ -305,7 +307,8 @@ static PyObject *pygpu_batch_draw_range(BPyGPUBatch *self, PyObject *args, PyObj 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kw, &_parser, &BPyGPUShader_Type, &py_program, &elem_start, &elem_count)) { + args, kw, &_parser, &BPyGPUShader_Type, &py_program, &elem_start, &elem_count)) + { return NULL; } diff --git a/source/blender/python/gpu/gpu_py_buffer.c b/source/blender/python/gpu/gpu_py_buffer.c index 0d64498dbbf..b20052b347b 100644 --- a/source/blender/python/gpu/gpu_py_buffer.c +++ b/source/blender/python/gpu/gpu_py_buffer.c @@ -46,7 +46,8 @@ static bool pygpu_buffer_dimensions_tot_len_compare(const Py_ssize_t *shape_a, const Py_ssize_t shape_b_len) { if (pygpu_buffer_dimensions_tot_elem(shape_a, shape_a_len) != - pygpu_buffer_dimensions_tot_elem(shape_b, shape_b_len)) { + pygpu_buffer_dimensions_tot_elem(shape_b, shape_b_len)) + { PyErr_Format(PyExc_BufferError, "array size does not match"); return false; } @@ -382,7 +383,8 @@ static PyObject *pygpu_buffer__tp_new(PyTypeObject *UNUSED(type), PyObject *args const struct PyC_StringEnum pygpu_dataformat = {bpygpu_dataformat_items, GPU_DATA_FLOAT}; if (!PyArg_ParseTuple( - args, "O&O|O: Buffer", PyC_ParseStringEnum, &pygpu_dataformat, &length_ob, &init)) { + args, "O&O|O: Buffer", PyC_ParseStringEnum, &pygpu_dataformat, &length_ob, &init)) + { return NULL; } diff --git a/source/blender/python/gpu/gpu_py_element.c b/source/blender/python/gpu/gpu_py_element.c index d150a51ba04..e559e6c70e5 100644 --- a/source/blender/python/gpu/gpu_py_element.c +++ b/source/blender/python/gpu/gpu_py_element.c @@ -72,7 +72,8 @@ static PyObject *pygpu_IndexBuf__tp_new(PyTypeObject *UNUSED(type), PyObject *ar } if (pybuffer.itemsize != 4 || - PyC_StructFmt_type_is_float_any(PyC_StructFmt_type_from_str(pybuffer.format))) { + PyC_StructFmt_type_is_float_any(PyC_StructFmt_type_from_str(pybuffer.format))) + { PyErr_Format(PyExc_ValueError, "Each index must be an 4-bytes integer value"); PyBuffer_Release(&pybuffer); return NULL; diff --git a/source/blender/python/gpu/gpu_py_framebuffer.c b/source/blender/python/gpu/gpu_py_framebuffer.c index a451019a06b..b89ca246467 100644 --- a/source/blender/python/gpu/gpu_py_framebuffer.c +++ b/source/blender/python/gpu/gpu_py_framebuffer.c @@ -284,7 +284,8 @@ static PyObject *pygpu_framebuffer__tp_new(PyTypeObject *UNUSED(self), 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kwds, &_parser, &depth_attachment, &color_attachements)) { + args, kwds, &_parser, &depth_attachment, &color_attachements)) + { return NULL; } @@ -514,7 +515,8 @@ static PyObject *pygpu_framebuffer_read_color(BPyGPUFrameBuffer *self, PyC_ParseStringEnum, &pygpu_dataformat, &BPyGPU_BufferType, - &py_buffer)) { + &py_buffer)) + { return NULL; } @@ -598,7 +600,8 @@ static PyObject *pygpu_framebuffer_read_depth(BPyGPUFrameBuffer *self, 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kwds, &_parser, &x, &y, &w, &h, &BPyGPU_BufferType, &py_buffer)) { + args, kwds, &_parser, &x, &y, &w, &h, &BPyGPU_BufferType, &py_buffer)) + { return NULL; } diff --git a/source/blender/python/gpu/gpu_py_matrix.c b/source/blender/python/gpu/gpu_py_matrix.c index 414c7751926..4c9ff0bdf0f 100644 --- a/source/blender/python/gpu/gpu_py_matrix.c +++ b/source/blender/python/gpu/gpu_py_matrix.c @@ -291,7 +291,8 @@ static PyObject *pygpu_matrix_scale(PyObject *UNUSED(self), PyObject *value) float scale[3]; int len; if ((len = mathutils_array_parse( - scale, 2, 3, value, "gpu.matrix.scale(): invalid vector arg")) == -1) { + scale, 2, 3, value, "gpu.matrix.scale(): invalid vector arg")) == -1) + { return NULL; } if (len == 2) { @@ -331,7 +332,8 @@ static PyObject *pygpu_matrix_translate(PyObject *UNUSED(self), PyObject *value) float offset[3]; int len; if ((len = mathutils_array_parse( - offset, 2, 3, value, "gpu.matrix.translate(): invalid vector arg")) == -1) { + offset, 2, 3, value, "gpu.matrix.translate(): invalid vector arg")) == -1) + { return NULL; } if (len == 2) { diff --git a/source/blender/python/gpu/gpu_py_offscreen.c b/source/blender/python/gpu/gpu_py_offscreen.c index 1a425024315..dfbdd3f4cd1 100644 --- a/source/blender/python/gpu/gpu_py_offscreen.c +++ b/source/blender/python/gpu/gpu_py_offscreen.c @@ -227,7 +227,8 @@ static PyObject *pygpu_offscreen__tp_new(PyTypeObject *UNUSED(self), 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kwds, &_parser, &width, &height, PyC_ParseStringEnum, &pygpu_textureformat)) { + args, kwds, &_parser, &width, &height, PyC_ParseStringEnum, &pygpu_textureformat)) + { return NULL; } @@ -369,7 +370,8 @@ static PyObject *pygpu_offscreen_draw_view3d(BPyGPUOffScreen *self, PyObject *ar (!(scene = PyC_RNA_AsPointer(py_scene, "Scene")) || !(view_layer = PyC_RNA_AsPointer(py_view_layer, "ViewLayer")) || !(v3d = PyC_RNA_AsPointer(py_view3d, "SpaceView3D")) || - !(region = PyC_RNA_AsPointer(py_region, "Region")))) { + !(region = PyC_RNA_AsPointer(py_region, "Region")))) + { return NULL; } diff --git a/source/blender/python/gpu/gpu_py_shader.c b/source/blender/python/gpu/gpu_py_shader.c index 80c22bd7a97..1b737faaee5 100644 --- a/source/blender/python/gpu/gpu_py_shader.c +++ b/source/blender/python/gpu/gpu_py_shader.c @@ -126,7 +126,8 @@ static PyObject *pygpu_shader__tp_new(PyTypeObject *UNUSED(type), PyObject *args ¶ms.geocode, ¶ms.libcode, ¶ms.defines, - ¶ms.name)) { + ¶ms.name)) + { return NULL; } @@ -219,7 +220,8 @@ static bool pygpu_shader_uniform_vector_impl(PyObject *args, *r_count = 1; if (!PyArg_ParseTuple( - args, "iOi|i:GPUShader.uniform_vector_*", r_location, &buffer, r_length, r_count)) { + args, "iOi|i:GPUShader.uniform_vector_*", r_location, &buffer, r_length, r_count)) + { return false; } @@ -286,8 +288,8 @@ static PyObject *pygpu_shader_uniform_vector_int(BPyGPUShader *self, PyObject *a Py_buffer pybuffer; - if (!pygpu_shader_uniform_vector_impl( - args, sizeof(int), &location, &length, &count, &pybuffer)) { + if (!pygpu_shader_uniform_vector_impl(args, sizeof(int), &location, &length, &count, &pybuffer)) + { return NULL; } @@ -528,7 +530,8 @@ static PyObject *pygpu_shader_uniform_sampler(BPyGPUShader *self, PyObject *args const char *name; BPyGPUTexture *py_texture; if (!PyArg_ParseTuple( - args, "sO!:GPUShader.uniform_sampler", &name, &BPyGPUTexture_Type, &py_texture)) { + args, "sO!:GPUShader.uniform_sampler", &name, &BPyGPUTexture_Type, &py_texture)) + { return NULL; } @@ -851,7 +854,8 @@ static PyObject *pygpu_shader_from_builtin(PyObject *UNUSED(self), PyObject *arg pyc_parse_buitinshader_w_backward_compatibility, &pygpu_bultinshader, PyC_ParseStringEnum, - &pygpu_config)) { + &pygpu_config)) + { return NULL; } diff --git a/source/blender/python/gpu/gpu_py_shader_create_info.cc b/source/blender/python/gpu/gpu_py_shader_create_info.cc index deb8653eb18..b60cbbf918a 100644 --- a/source/blender/python/gpu/gpu_py_shader_create_info.cc +++ b/source/blender/python/gpu/gpu_py_shader_create_info.cc @@ -499,7 +499,8 @@ static PyObject *pygpu_shader_info_fragment_out(BPyGPUShaderCreateInfo *self, &pygpu_type, &name, PyC_ParseStringEnum, - &blend_type)) { + &blend_type)) + { return nullptr; } @@ -604,13 +605,15 @@ static PyObject *pygpu_shader_info_image(BPyGPUShaderCreateInfo *self, PyC_ParseStringEnum, &pygpu_imagetype, &name, - &py_qualifiers)) { + &py_qualifiers)) + { return nullptr; } if (py_qualifiers && PyC_FlagSet_ToBitfield( - pygpu_qualifiers, py_qualifiers, (int *)&qualifier, "shader_info.image") == -1) { + pygpu_qualifiers, py_qualifiers, (int *)&qualifier, "shader_info.image") == -1) + { return nullptr; } @@ -775,7 +778,8 @@ static PyObject *pygpu_shader_info_push_constant(BPyGPUShaderCreateInfo *self, nullptr, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kwds, &_parser, PyC_ParseStringEnum, &pygpu_type, &name, &array_size)) { + args, kwds, &_parser, PyC_ParseStringEnum, &pygpu_type, &name, &array_size)) + { return nullptr; } diff --git a/source/blender/python/gpu/gpu_py_texture.c b/source/blender/python/gpu/gpu_py_texture.c index a49866a6560..be2e19f4ff9 100644 --- a/source/blender/python/gpu/gpu_py_texture.c +++ b/source/blender/python/gpu/gpu_py_texture.c @@ -140,7 +140,8 @@ static PyObject *pygpu_texture__tp_new(PyTypeObject *UNUSED(self), PyObject *arg PyC_ParseStringEnum, &pygpu_textureformat, &BPyGPU_BufferType, - &pybuffer_obj)) { + &pybuffer_obj)) + { return NULL; } @@ -301,7 +302,8 @@ static PyObject *pygpu_texture_clear(BPyGPUTexture *self, PyObject *args, PyObje 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kwds, &_parser, PyC_ParseStringEnum, &pygpu_dataformat, &py_values)) { + args, kwds, &_parser, PyC_ParseStringEnum, &pygpu_dataformat, &py_values)) + { return NULL; } @@ -315,8 +317,8 @@ static PyObject *pygpu_texture_clear(BPyGPUTexture *self, PyObject *args, PyObje return NULL; } - if (shape != 1 && - ELEM(pygpu_dataformat.value_found, GPU_DATA_UINT_24_8, GPU_DATA_10_11_11_REV)) { + if (shape != 1 && ELEM(pygpu_dataformat.value_found, GPU_DATA_UINT_24_8, GPU_DATA_10_11_11_REV)) + { PyErr_SetString(PyExc_AttributeError, "`UINT_24_8` and `10_11_11_REV` only support single values"); return NULL; @@ -329,7 +331,8 @@ static PyObject *pygpu_texture_clear(BPyGPUTexture *self, PyObject *args, PyObje py_values, shape, (pygpu_dataformat.value_found == GPU_DATA_FLOAT) ? &PyFloat_Type : &PyLong_Type, - "clear") == -1) { + "clear") == -1) + { return NULL; } diff --git a/source/blender/python/gpu/gpu_py_vertex_buffer.c b/source/blender/python/gpu/gpu_py_vertex_buffer.c index fd36c0a2d71..827feb7dda0 100644 --- a/source/blender/python/gpu/gpu_py_vertex_buffer.c +++ b/source/blender/python/gpu/gpu_py_vertex_buffer.c @@ -244,7 +244,8 @@ static PyObject *pygpu_vertbuf__tp_new(PyTypeObject *UNUSED(type), PyObject *arg 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kwds, &_parser, &BPyGPUVertFormat_Type, ¶ms.py_fmt, ¶ms.len)) { + args, kwds, &_parser, &BPyGPUVertFormat_Type, ¶ms.py_fmt, ¶ms.len)) + { return NULL; } diff --git a/source/blender/python/gpu/gpu_py_vertex_format.c b/source/blender/python/gpu/gpu_py_vertex_format.c index ac0ec6bdc01..128ef08f0a7 100644 --- a/source/blender/python/gpu/gpu_py_vertex_format.c +++ b/source/blender/python/gpu/gpu_py_vertex_format.c @@ -108,7 +108,8 @@ static PyObject *pygpu_vertformat_attr_add(BPyGPUVertFormat *self, PyObject *arg &comp_type, &len, PyC_ParseStringEnum, - &fetch_mode)) { + &fetch_mode)) + { return NULL; } diff --git a/source/blender/python/intern/bpy.c b/source/blender/python/intern/bpy.c index 78729ff54d3..2e7653fec92 100644 --- a/source/blender/python/intern/bpy.c +++ b/source/blender/python/intern/bpy.c @@ -134,7 +134,8 @@ static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObjec PyC_ParseBool, &packed, PyC_ParseBool, - &local)) { + &local)) + { return NULL; } @@ -188,7 +189,8 @@ static PyObject *bpy_flip_name(PyObject *UNUSED(self), PyObject *args, PyObject 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kw, &_parser, &name_src, &name_src_len, PyC_ParseBool, &strip_digits)) { + args, kw, &_parser, &name_src, &name_src_len, PyC_ParseBool, &strip_digits)) + { return NULL; } @@ -320,7 +322,8 @@ static PyObject *bpy_resource_path(PyObject *UNUSED(self), PyObject *args, PyObj 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kw, &_parser, PyC_ParseStringEnum, &type, &major, &minor)) { + args, kw, &_parser, PyC_ParseStringEnum, &type, &major, &minor)) + { return NULL; } @@ -366,7 +369,8 @@ static PyObject *bpy_driver_secure_code_test(PyObject *UNUSED(self), PyObject *a &PyDict_Type, &py_namespace, PyC_ParseBool, - &verbose)) { + &verbose)) + { return NULL; } return PyBool_FromLong(BPY_driver_secure_bytecode_test(py_code, py_namespace, verbose)); diff --git a/source/blender/python/intern/bpy_app.c b/source/blender/python/intern/bpy_app.c index 434151e4bf2..e93d975b780 100644 --- a/source/blender/python/intern/bpy_app.c +++ b/source/blender/python/intern/bpy_app.c @@ -508,7 +508,8 @@ static PyObject *bpy_app_is_job_running(PyObject *UNUSED(self), PyObject *args, 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kwds, &_parser, pyrna_enum_value_parse_string, &job_type_enum)) { + args, kwds, &_parser, pyrna_enum_value_parse_string, &job_type_enum)) + { return NULL; } wmWindowManager *wm = G_MAIN->wm.first; diff --git a/source/blender/python/intern/bpy_app_handlers.c b/source/blender/python/intern/bpy_app_handlers.c index 387f1c73b83..17ee3a762e5 100644 --- a/source/blender/python/intern/bpy_app_handlers.c +++ b/source/blender/python/intern/bpy_app_handlers.c @@ -310,7 +310,8 @@ void BPY_app_handlers_reset(const bool do_all) PyObject **dict_ptr; if (PyFunction_Check(item) && (dict_ptr = _PyObject_GetDictPtr(item)) && (*dict_ptr) && - (PyDict_GetItem(*dict_ptr, perm_id_str) != NULL)) { + (PyDict_GetItem(*dict_ptr, perm_id_str) != NULL)) + { /* keep */ } else { diff --git a/source/blender/python/intern/bpy_app_icons.c b/source/blender/python/intern/bpy_app_icons.c index 65edbb597ca..fc34b181ab8 100644 --- a/source/blender/python/intern/bpy_app_icons.c +++ b/source/blender/python/intern/bpy_app_icons.c @@ -49,7 +49,8 @@ static PyObject *bpy_app_icons_new_triangles(PyObject *UNUSED(self), PyObject *a 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kw, &_parser, &coords_range[0], &coords_range[1], &py_coords, &py_colors)) { + args, kw, &_parser, &coords_range[0], &coords_range[1], &py_coords, &py_colors)) + { return NULL; } diff --git a/source/blender/python/intern/bpy_app_translations.c b/source/blender/python/intern/bpy_app_translations.c index b9b1b629eca..99beeb5ac63 100644 --- a/source/blender/python/intern/bpy_app_translations.c +++ b/source/blender/python/intern/bpy_app_translations.c @@ -320,7 +320,8 @@ static PyObject *app_translations_py_messages_register(BlenderAppTranslations *s &PyUnicode_Type, &module_name, &PyDict_Type, - &uuid_dict)) { + &uuid_dict)) + { return NULL; } @@ -371,7 +372,8 @@ static PyObject *app_translations_py_messages_unregister(BlenderAppTranslations "O!:bpy.app.translations.unregister", (char **)kwlist, &PyUnicode_Type, - &module_name)) { + &module_name)) + { return NULL; } @@ -534,7 +536,8 @@ static PyObject *_py_pgettext(PyObject *args, char *msgid, *msgctxt = NULL; if (!PyArg_ParseTupleAndKeywords( - args, kw, "s|z:bpy.app.translations.pgettext", (char **)kwlist, &msgid, &msgctxt)) { + args, kw, "s|z:bpy.app.translations.pgettext", (char **)kwlist, &msgid, &msgctxt)) + { return NULL; } @@ -544,7 +547,8 @@ static PyObject *_py_pgettext(PyObject *args, (void)_pgettext; if (!PyArg_ParseTupleAndKeywords( - args, kw, "O|O:bpy.app.translations.pgettext", (char **)kwlist, &msgid, &msgctxt)) { + args, kw, "O|O:bpy.app.translations.pgettext", (char **)kwlist, &msgid, &msgctxt)) + { return NULL; } @@ -678,7 +682,8 @@ static PyObject *app_translations_locale_explode(BlenderAppTranslations *UNUSED( char *language, *country, *variant, *language_country, *language_variant; if (!PyArg_ParseTupleAndKeywords( - args, kw, "s:bpy.app.translations.locale_explode", (char **)kwlist, &locale)) { + args, kw, "s:bpy.app.translations.locale_explode", (char **)kwlist, &locale)) + { return NULL; } diff --git a/source/blender/python/intern/bpy_driver.c b/source/blender/python/intern/bpy_driver.c index 7f8376798fe..402bc6408f8 100644 --- a/source/blender/python/intern/bpy_driver.c +++ b/source/blender/python/intern/bpy_driver.c @@ -184,7 +184,8 @@ static void bpy_pydriver_namespace_update_frame(const float evaltime) static void bpy_pydriver_namespace_update_self(struct PathResolvedRNA *anim_rna) { if ((g_pydriver_state_prev.self == NULL) || - (pyrna_driver_is_equal_anim_rna(anim_rna, g_pydriver_state_prev.self) == false)) { + (pyrna_driver_is_equal_anim_rna(anim_rna, g_pydriver_state_prev.self) == false)) + { PyObject *item = pyrna_driver_self_from_anim_rna(anim_rna); PyDict_SetItem(bpy_pydriver_Dict, bpy_intern_str_self, item); Py_DECREF(item); @@ -225,7 +226,8 @@ static void bpy_pydriver_namespace_update_depsgraph(struct Depsgraph *depsgraph) } if ((g_pydriver_state_prev.depsgraph == NULL) || - (depsgraph != g_pydriver_state_prev.depsgraph->ptr.data)) { + (depsgraph != g_pydriver_state_prev.depsgraph->ptr.data)) + { PyObject *item = bpy_pydriver_depsgraph_as_pyobject(depsgraph); PyDict_SetItem(bpy_pydriver_Dict, bpy_intern_str_depsgraph, item); Py_DECREF(item); @@ -753,7 +755,8 @@ float BPY_driver_exec(struct PathResolvedRNA *anim_rna, }, /* Always be verbose since this can give hints to why evaluation fails. */ true, - __func__)) { + __func__)) + { if (!(G.f & G_FLAG_SCRIPT_AUTOEXEC_FAIL_QUIET)) { G.f |= G_FLAG_SCRIPT_AUTOEXEC_FAIL; BLI_snprintf(G.autoexec_fail, sizeof(G.autoexec_fail), "Driver '%s'", expr); diff --git a/source/blender/python/intern/bpy_gizmo_wrap.c b/source/blender/python/intern/bpy_gizmo_wrap.c index 99720e7a1ba..84f90d2f3df 100644 --- a/source/blender/python/intern/bpy_gizmo_wrap.c +++ b/source/blender/python/intern/bpy_gizmo_wrap.c @@ -66,7 +66,8 @@ static bool bpy_gizmotype_target_property_def(wmGizmoType *gzt, PyObject *item) ¶ms.id, pyrna_enum_value_parse_string, ¶ms.type_enum, - ¶ms.array_length)) { + ¶ms.array_length)) + { goto fail; } @@ -117,7 +118,8 @@ static void gizmo_properties_init(wmGizmoType *gzt) if (bl_target_properties != NULL) { PyObject *bl_target_properties_fast; if (!(bl_target_properties_fast = PySequence_Fast(bl_target_properties, - "bl_target_properties sequence"))) { + "bl_target_properties sequence"))) + { /* PySequence_Fast sets the error */ PyErr_Print(); PyErr_Clear(); diff --git a/source/blender/python/intern/bpy_interface.c b/source/blender/python/intern/bpy_interface.c index 4fe39e1c5b0..8ec4a91b822 100644 --- a/source/blender/python/intern/bpy_interface.c +++ b/source/blender/python/intern/bpy_interface.c @@ -401,7 +401,8 @@ void BPY_python_start(bContext *C, int argc, const char **argv) { char program_path[FILE_MAX]; if (BKE_appdir_program_python_search( - program_path, sizeof(program_path), PY_MAJOR_VERSION, PY_MINOR_VERSION)) { + program_path, sizeof(program_path), PY_MAJOR_VERSION, PY_MINOR_VERSION)) + { status = PyConfig_SetBytesString(&config, &config.executable, program_path); pystatus_exit_on_error(status); has_python_executable = true; @@ -848,7 +849,8 @@ static bool bpy_module_ensure_compatible_version(void) uint version_runtime_major = version_runtime >> 24; uint version_runtime_minor = ((version_runtime & 0x00ff0000) >> 16); if ((version_compile_major != version_runtime_major) || - (version_compile_minor != version_runtime_minor)) { + (version_compile_minor != version_runtime_minor)) + { PyErr_Format(PyExc_ImportError, "The version of \"bpy\" was compiled with: " "(%u.%u) is incompatible with: (%u.%u) used by the interpreter!", diff --git a/source/blender/python/intern/bpy_library_load.c b/source/blender/python/intern/bpy_library_load.c index 7675aab2945..0f554fc1536 100644 --- a/source/blender/python/intern/bpy_library_load.c +++ b/source/blender/python/intern/bpy_library_load.c @@ -219,7 +219,8 @@ static PyObject *bpy_lib_load(BPy_PropertyRNA *self, PyObject *args, PyObject *k PyC_ParseBool, &reuse_liboverrides, PyC_ParseBool, - &create_liboverrides_runtime)) { + &create_liboverrides_runtime)) + { return NULL; } @@ -353,7 +354,8 @@ static void bpy_lib_exit_warn_idname(BPy_Library *self, "load: '%s' does not contain %s[\"%s\"]", self->abspath, name_plural, - idname)) { + idname)) + { /* Spurious errors can appear at shutdown */ if (PyErr_ExceptionMatches(PyExc_Warning)) { PyErr_WriteUnraisable((PyObject *)self); @@ -370,7 +372,8 @@ static void bpy_lib_exit_warn_type(BPy_Library *self, PyObject *item) 1, "load: '%s' expected a string type, not a %.200s", self->abspath, - Py_TYPE(item)->tp_name)) { + Py_TYPE(item)->tp_name)) + { /* Spurious errors can appear at shutdown */ if (PyErr_ExceptionMatches(PyExc_Warning)) { PyErr_WriteUnraisable((PyObject *)self); diff --git a/source/blender/python/intern/bpy_library_write.c b/source/blender/python/intern/bpy_library_write.c index 79a3680b78d..6b5cae45222 100644 --- a/source/blender/python/intern/bpy_library_write.c +++ b/source/blender/python/intern/bpy_library_write.c @@ -105,7 +105,8 @@ static PyObject *bpy_lib_write(BPy_PropertyRNA *self, PyObject *args, PyObject * PyC_ParseBool, &use_fake_user, PyC_ParseBool, - &use_compress)) { + &use_compress)) + { return NULL; } diff --git a/source/blender/python/intern/bpy_msgbus.c b/source/blender/python/intern/bpy_msgbus.c index 835ef8f7f1f..2d7a293ea9a 100644 --- a/source/blender/python/intern/bpy_msgbus.c +++ b/source/blender/python/intern/bpy_msgbus.c @@ -260,12 +260,14 @@ static PyObject *bpy_msgbus_subscribe_rna(PyObject *UNUSED(self), PyObject *args &callback_args, &callback_notify, &PySet_Type, - &py_options)) { + &py_options)) + { return NULL; } if (py_options && - (pyrna_enum_bitfield_from_set(py_options_enum, py_options, &options, error_prefix) == -1)) { + (pyrna_enum_bitfield_from_set(py_options_enum, py_options, &options, error_prefix) == -1)) + { return NULL; } diff --git a/source/blender/python/intern/bpy_operator.c b/source/blender/python/intern/bpy_operator.c index f97e7a3f38d..585e8902a67 100644 --- a/source/blender/python/intern/bpy_operator.c +++ b/source/blender/python/intern/bpy_operator.c @@ -70,7 +70,8 @@ static void op_context_override_deprecated_warning(const char *action, const cha "Passing in context overrides is deprecated in favor of " "Context.temp_override(..), %s \"%s\"", action, - opname) < 0) { + opname) < 0) + { /* The function has no return value, the exception cannot * be reported to the caller, so just log it. */ PyErr_WriteUnraisable(NULL); @@ -196,7 +197,8 @@ static PyObject *pyop_call(PyObject *UNUSED(self), PyObject *args) &PyDict_Type, &kw, &context_str, - &is_undo)) { + &is_undo)) + { return NULL; } @@ -397,7 +399,8 @@ static PyObject *pyop_as_string(PyObject *UNUSED(self), PyObject *args) PyC_ParseBool, &all_args, PyC_ParseBool, - ¯o_args)) { + ¯o_args)) + { return NULL; } diff --git a/source/blender/python/intern/bpy_props.c b/source/blender/python/intern/bpy_props.c index 8777a0393da..49b896ec905 100644 --- a/source/blender/python/intern/bpy_props.c +++ b/source/blender/python/intern/bpy_props.c @@ -743,7 +743,8 @@ static void bpy_prop_boolean_array_get_fn(struct PointerRNA *ptr, ret, &array_len_info, &PyBool_Type, - "BoolVectorProperty get callback") == -1) { + "BoolVectorProperty get callback") == -1) + { PyC_Err_PrintWithFunc(py_func); } else { @@ -1004,7 +1005,8 @@ static void bpy_prop_int_array_get_fn(struct PointerRNA *ptr, ret, &array_len_info, &PyLong_Type, - "IntVectorProperty get callback") == -1) { + "IntVectorProperty get callback") == -1) + { PyC_Err_PrintWithFunc(py_func); } else { @@ -1266,7 +1268,8 @@ static void bpy_prop_float_array_get_fn(struct PointerRNA *ptr, ret, &array_len_info, &PyFloat_Type, - "FloatVectorProperty get callback") == -1) { + "FloatVectorProperty get callback") == -1) + { PyC_Err_PrintWithFunc(py_func); } else { @@ -2009,7 +2012,8 @@ static const EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, (item_size != 4 || py_long_as_int(PyTuple_GET_ITEM(item, 3), &tmp.value)) && (item_size != 5 || ((py_long_as_int(PyTuple_GET_ITEM(item, 3), &tmp.icon) || (tmp_icon = PyUnicode_AsUTF8(PyTuple_GET_ITEM(item, 3)))) && - py_long_as_int(PyTuple_GET_ITEM(item, 4), &tmp.value)))) { + py_long_as_int(PyTuple_GET_ITEM(item, 4), &tmp.value)))) + { if (is_enum_flag) { if (item_size < 4) { tmp.value = 1 << i; @@ -2027,7 +2031,8 @@ static const EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, if (default_py && default_used == 0) { if ((default_str_cmp != NULL && STREQ(default_str_cmp, tmp.identifier)) || - (default_str_cmp == NULL && default_int_cmp == tmp.value)) { + (default_str_cmp == NULL && default_int_cmp == tmp.value)) + { *r_default_value = tmp.value; default_used++; /* only ever 1 */ } @@ -2161,7 +2166,8 @@ static const EnumPropertyItem *bpy_prop_enum_itemf_fn(struct bContext *C, if (!(items_fast = PySequence_Fast(items, "EnumProperty(...): " - "return value from the callback was not a sequence"))) { + "return value from the callback was not a sequence"))) + { err = -1; } else { @@ -2571,7 +2577,8 @@ static int bpy_prop_arg_parse_id(PyObject *o, void *p) parse_data->prop_free_handle = NULL; if (UNLIKELY(RNA_def_property_free_identifier_deferred_prepare( - srna, id, &parse_data->prop_free_handle) == -1)) { + srna, id, &parse_data->prop_free_handle) == -1)) + { PyErr_Format(PyExc_TypeError, "'%s' is defined as a non-dynamic type for '%s'", id, @@ -2840,7 +2847,8 @@ static PyObject *BPy_BoolProperty(PyObject *self, PyObject *args, PyObject *kw) &subtype_enum, &update_fn, &get_fn, - &set_fn)) { + &set_fn)) + { return NULL; } @@ -2990,7 +2998,8 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject &array_len_info, &update_fn, &get_fn, - &set_fn)) { + &set_fn)) + { return NULL; } @@ -3000,7 +3009,8 @@ static PyObject *BPy_BoolVectorProperty(PyObject *self, PyObject *args, PyObject default_py, &array_len_info, &PyBool_Type, - "BoolVectorProperty(default=sequence)") == -1) { + "BoolVectorProperty(default=sequence)") == -1) + { return NULL; } } @@ -3177,7 +3187,8 @@ static PyObject *BPy_IntProperty(PyObject *self, PyObject *args, PyObject *kw) &subtype_enum, &update_fn, &get_fn, - &set_fn)) { + &set_fn)) + { return NULL; } @@ -3354,7 +3365,8 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject &array_len_info, &update_fn, &get_fn, - &set_fn)) { + &set_fn)) + { return NULL; } @@ -3364,7 +3376,8 @@ static PyObject *BPy_IntVectorProperty(PyObject *self, PyObject *args, PyObject default_py, &array_len_info, &PyLong_Type, - "IntVectorProperty(default=sequence)") == -1) { + "IntVectorProperty(default=sequence)") == -1) + { return NULL; } } @@ -3543,7 +3556,8 @@ static PyObject *BPy_FloatProperty(PyObject *self, PyObject *args, PyObject *kw) &unit_enum, &update_fn, &get_fn, - &set_fn)) { + &set_fn)) + { return NULL; } @@ -3719,7 +3733,8 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec &array_len_info, &update_fn, &get_fn, - &set_fn)) { + &set_fn)) + { return NULL; } @@ -3729,7 +3744,8 @@ static PyObject *BPy_FloatVectorProperty(PyObject *self, PyObject *args, PyObjec default_py, &array_len_info, &PyFloat_Type, - "FloatVectorProperty(default=sequence)") == -1) { + "FloatVectorProperty(default=sequence)") == -1) + { return NULL; } if (bpy_prop_array_is_matrix_compatible_ex(subtype_enum.value, &array_len_info)) { @@ -3909,7 +3925,8 @@ static PyObject *BPy_StringProperty(PyObject *self, PyObject *args, PyObject *kw &set_fn, &search_fn, pyrna_enum_bitfield_parse_set, - &search_options_enum)) { + &search_options_enum)) + { return NULL; } @@ -4096,7 +4113,8 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) &tags_enum, &update_fn, &get_fn, - &set_fn)) { + &set_fn)) + { return NULL; } @@ -4117,8 +4135,8 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) } /* items can be a list or a callable */ - if (PyFunction_Check( - items)) { /* don't use PyCallable_Check because we need the function code for errors */ + if (PyFunction_Check(items)) + { /* don't use PyCallable_Check because we need the function code for errors */ PyCodeObject *f_code = (PyCodeObject *)PyFunction_GET_CODE(items); if (f_code->co_argcount != 2) { PyErr_Format(PyExc_ValueError, @@ -4145,7 +4163,8 @@ static PyObject *BPy_EnumProperty(PyObject *self, PyObject *args, PyObject *kw) if (!(items_fast = PySequence_Fast( items, "EnumProperty(...): " - "expected a sequence of tuples for the enum items or a function"))) { + "expected a sequence of tuples for the enum items or a function"))) + { return NULL; } @@ -4310,7 +4329,8 @@ PyObject *BPy_PointerProperty(PyObject *self, PyObject *args, PyObject *kw) bpy_prop_arg_parse_tag_defines, &tags_enum, &poll_fn, - &update_fn)) { + &update_fn)) + { return NULL; } @@ -4440,7 +4460,8 @@ PyObject *BPy_CollectionProperty(PyObject *self, PyObject *args, PyObject *kw) pyrna_enum_bitfield_parse_set, &override_enum, bpy_prop_arg_parse_tag_defines, - &tags_enum)) { + &tags_enum)) + { return NULL; } diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 26d3b13d68d..8b251973d14 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -147,7 +147,8 @@ static void id_release_gc(struct ID *id) while ((g = g->gc.gc_next) != gen) { PyObject *ob = FROM_GC(g); if (PyType_IsSubtype(Py_TYPE(ob), &pyrna_struct_Type) || - PyType_IsSubtype(Py_TYPE(ob), &pyrna_prop_Type)) { + PyType_IsSubtype(Py_TYPE(ob), &pyrna_prop_Type)) + { BPy_DummyPointerRNA *ob_ptr = (BPy_DummyPointerRNA *)ob; if (ob_ptr->ptr.owner_id == id) { pyrna_invalidate(ob_ptr); @@ -2051,7 +2052,8 @@ static int pyrna_py_to_prop( } if (pyrna_pydict_to_props( - &itemptr, item, true, "Converting a Python list to an RNA collection") == -1) { + &itemptr, item, true, "Converting a Python list to an RNA collection") == -1) + { PyObject *msg = PyC_ExceptionBuffer(); const char *msg_char = PyUnicode_AsUTF8(msg); PyErr_Clear(); @@ -2108,7 +2110,8 @@ static int pyrna_py_to_prop_array_index(BPy_PropertyArrayRNA *self, int index, P if (totdim > 1) { // char error_str[512]; if (pyrna_py_to_array_index( - &self->ptr, self->prop, self->arraydim, self->arrayoffset, index, value, "") == -1) { + &self->ptr, self->prop, self->arraydim, self->arrayoffset, index, value, "") == -1) + { /* Error is set. */ ret = -1; } @@ -2943,7 +2946,8 @@ static PyObject *prop_subscript_ass_array_slice__as_seq_fast(PyObject *value, in PyObject *value_fast; if (!(value_fast = PySequence_Fast(value, "bpy_prop_array[slice] = value: " - "element in assignment is not a sequence type"))) { + "element in assignment is not a sequence type"))) + { return NULL; } if (PySequence_Fast_GET_SIZE(value_fast) != length) { @@ -3077,7 +3081,8 @@ static int prop_subscript_ass_array_slice(PointerRNA *ptr, } if (!(value = PySequence_Fast( - value_orig, "bpy_prop_array[slice] = value: assignment is not a sequence type"))) { + value_orig, "bpy_prop_array[slice] = value: assignment is not a sequence type"))) + { return -1; } @@ -3371,7 +3376,8 @@ static int pyrna_prop_collection_contains(BPy_PropertyRNA *self, PyObject *key) return 1; } if (pyrna_prop_collection_string_subscript_supported_or_error( - self, "bpy_prop_collection.__contains__") == -1) { + self, "bpy_prop_collection.__contains__") == -1) + { return -1; } @@ -3503,7 +3509,8 @@ static int pyrna_struct_ass_subscript(BPy_StructRNA *self, PyObject *key, PyObje BPy_StructRNA *val = (BPy_StructRNA *)value; if (val && self->ptr.type && val->ptr.type) { if (!RNA_struct_idprops_datablock_allowed(self->ptr.type) && - RNA_struct_idprops_contains_datablock(val->ptr.type)) { + RNA_struct_idprops_contains_datablock(val->ptr.type)) + { PyErr_SetString( PyExc_TypeError, "bpy_struct[key] = val: datablock id properties not supported for this type"); @@ -4338,10 +4345,11 @@ static PyObject *pyrna_struct_getattro(BPy_StructRNA *self, PyObject *pyname) } else if ( /* RNA can't start with a "_", so for __dict__ and similar we can skip using RNA lookups. */ - name[0] == '_') { + name[0] == '_') + { /* Annoying exception, maybe we need to have different types for this... */ - if (STR_ELEM(name, "__getitem__", "__setitem__") && - !RNA_struct_idprops_check(self->ptr.type)) { + if (STR_ELEM(name, "__getitem__", "__setitem__") && !RNA_struct_idprops_check(self->ptr.type)) + { PyErr_SetString(PyExc_AttributeError, "bpy_struct: no __getitem__ support for this type"); ret = NULL; } @@ -4498,7 +4506,8 @@ static int pyrna_struct_meta_idprop_setattro(PyObject *cls, PyObject *attr, PyOb const char *attr_str = PyUnicode_AsUTF8(attr); if (srna && !pyrna_write_check() && - (is_deferred_prop || RNA_struct_type_find_property_no_base(srna, attr_str))) { + (is_deferred_prop || RNA_struct_type_find_property_no_base(srna, attr_str))) + { PyErr_Format(PyExc_AttributeError, "pyrna_struct_meta_idprop_setattro() " "can't set in readonly state '%.200s.%S'", @@ -5134,8 +5143,9 @@ static PyObject *pyrna_prop_collection_get(BPy_PropertyRNA *self, PyObject *args if (RNA_property_collection_lookup_string(&self->ptr, self->prop, key, &newptr)) { return pyrna_struct_CreatePyObject(&newptr); } - if (pyrna_prop_collection_string_subscript_supported_or_error( - self, "bpy_prop_collection.get") == -1) { + if (pyrna_prop_collection_string_subscript_supported_or_error(self, + "bpy_prop_collection.get") == -1) + { return NULL; } } @@ -5368,7 +5378,8 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set) RawPropertyType raw_type; if (foreach_parse_args( - self, args, &attr, &seq, &tot, &size, &raw_type, &attr_tot, &attr_signed) == -1) { + self, args, &attr, &seq, &tot, &size, &raw_type, &attr_tot, &attr_signed) == -1) + { return NULL; } @@ -5654,7 +5665,8 @@ static PyObject *pyprop_array_foreach_getset(BPy_PropertyArrayRNA *self, else { const char f = buf.format ? buf.format[0] : 0; if ((prop_type == PROP_INT && (buf.itemsize != sizeof(int) || !ELEM(f, 'l', 'i'))) || - (prop_type == PROP_FLOAT && (buf.itemsize != sizeof(float) || f != 'f'))) { + (prop_type == PROP_FLOAT && (buf.itemsize != sizeof(float) || f != 'f'))) + { PyBuffer_Release(&buf); PyErr_Format(PyExc_TypeError, "incorrect sequence item type: %s", buf.format); return NULL; @@ -7279,7 +7291,8 @@ static PyObject *pyrna_srna_Subtype(StructRNA *srna) #endif if (RNA_struct_idprops_check(srna) && - !PyObject_IsSubclass(py_base, (PyObject *)&pyrna_struct_meta_idprop_Type)) { + !PyObject_IsSubclass(py_base, (PyObject *)&pyrna_struct_meta_idprop_Type)) + { metaclass = (PyObject *)&pyrna_struct_meta_idprop_Type; } else { @@ -7958,7 +7971,8 @@ static int deferred_register_prop(StructRNA *srna, PyObject *key, PyObject *item if (!RNA_struct_idprops_datablock_allowed(srna) && (*(PyCFunctionWithKeywords)PyCFunction_GET_FUNCTION(py_func) == BPy_PointerProperty || *(PyCFunctionWithKeywords)PyCFunction_GET_FUNCTION(py_func) == BPy_CollectionProperty) && - RNA_struct_idprops_contains_datablock(type_srna)) { + RNA_struct_idprops_contains_datablock(type_srna)) + { PyErr_Format(PyExc_ValueError, "bpy_struct \"%.200s\" registration error: " "'%.200s' %.200s could not register because " @@ -8064,7 +8078,8 @@ static int pyrna_deferred_register_props(StructRNA *srna, PyObject *class_dict) /* in both cases PyDict_CheckExact(class_dict) will be true even * though Operators have a metaclass dict namespace */ if ((annotations_dict = PyDict_GetItem(class_dict, bpy_intern_str___annotations__)) && - PyDict_CheckExact(annotations_dict)) { + PyDict_CheckExact(annotations_dict)) + { while (PyDict_Next(annotations_dict, &pos, &key, &item)) { ret = deferred_register_prop(srna, key, item); @@ -8096,7 +8111,8 @@ static int pyrna_deferred_register_class_recursive(StructRNA *srna, PyTypeObject * This best fits having 'mix-in' classes for operators and render engines. */ if (py_superclass != &PyBaseObject_Type && - !PyObject_IsSubclass((PyObject *)py_superclass, (PyObject *)&pyrna_struct_Type)) { + !PyObject_IsSubclass((PyObject *)py_superclass, (PyObject *)&pyrna_struct_Type)) + { ret = pyrna_deferred_register_class_recursive(srna, py_superclass); if (ret != 0) { @@ -8321,8 +8337,7 @@ static int bpy_class_validate_recursive(PointerRNA *dummy_ptr, /* Sneaky workaround to use the class name as the bl_idname. */ #define BPY_REPLACEMENT_STRING(rna_attr, py_attr) \ - else if (STREQ(identifier, rna_attr)) \ - { \ + else if (STREQ(identifier, rna_attr)) { \ if ((item = PyObject_GetAttr(py_class, py_attr))) { \ if (item != Py_None) { \ if (pyrna_py_to_prop(dummy_ptr, prop, NULL, item, "validating class:") != 0) { \ @@ -8678,8 +8693,8 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param ReportList *reports; /* Alert the user, else they won't know unless they see the console. */ if ((!is_staticmethod) && (!is_classmethod) && (ptr->data) && - RNA_struct_is_a(ptr->type, &RNA_Operator) && - (is_valid_wm == (CTX_wm_manager(C) != NULL))) { + RNA_struct_is_a(ptr->type, &RNA_Operator) && (is_valid_wm == (CTX_wm_manager(C) != NULL))) + { wmOperator *op = ptr->data; reports = op->reports; } diff --git a/source/blender/python/intern/bpy_rna_anim.c b/source/blender/python/intern/bpy_rna_anim.c index d4a164d9482..99a96133bac 100644 --- a/source/blender/python/intern/bpy_rna_anim.c +++ b/source/blender/python/intern/bpy_rna_anim.c @@ -199,7 +199,8 @@ static int pyrna_struct_anim_args_parse_no_resolve_fallback(PointerRNA *ptr, { bool path_unresolved = false; if (pyrna_struct_anim_args_parse_ex( - ptr, error_prefix, path, r_path_full, r_index, &path_unresolved) == -1) { + ptr, error_prefix, path, r_path_full, r_index, &path_unresolved) == -1) + { if (path_unresolved == true) { if (pyrna_struct_anim_args_parse_no_resolve(ptr, error_prefix, path, r_path_full) == -1) { return -1; @@ -239,7 +240,8 @@ static int pyrna_struct_keyframe_parse(PointerRNA *ptr, r_cfra, r_group_name, &PySet_Type, - &pyoptions)) { + &pyoptions)) + { return -1; } @@ -255,7 +257,8 @@ static int pyrna_struct_keyframe_parse(PointerRNA *ptr, if (r_options) { if (pyoptions && (pyrna_enum_bitfield_from_set( - rna_enum_keying_flag_items_api, pyoptions, r_options, error_prefix) == -1)) { + rna_enum_keying_flag_items_api, pyoptions, r_options, error_prefix) == -1)) + { return -1; } @@ -319,7 +322,8 @@ PyObject *pyrna_struct_keyframe_insert(BPy_StructRNA *self, PyObject *args, PyOb &index, &cfra, &group_name, - &options) == -1) { + &options) == -1) + { return NULL; } @@ -434,7 +438,8 @@ PyObject *pyrna_struct_keyframe_delete(BPy_StructRNA *self, PyObject *args, PyOb &index, &cfra, &group_name, - NULL) == -1) { + NULL) == -1) + { return NULL; } @@ -536,7 +541,8 @@ PyObject *pyrna_struct_driver_add(BPy_StructRNA *self, PyObject *args) } if (pyrna_struct_anim_args_parse( - &self->ptr, "bpy_struct.driver_add():", path, &path_full, &index) == -1) { + &self->ptr, "bpy_struct.driver_add():", path, &path_full, &index) == -1) + { return NULL; } @@ -618,7 +624,8 @@ PyObject *pyrna_struct_driver_remove(BPy_StructRNA *self, PyObject *args) } if (pyrna_struct_anim_args_parse_no_resolve_fallback( - &self->ptr, "bpy_struct.driver_remove():", path, &path_full, &index) == -1) { + &self->ptr, "bpy_struct.driver_remove():", path, &path_full, &index) == -1) + { return NULL; } diff --git a/source/blender/python/intern/bpy_rna_array.c b/source/blender/python/intern/bpy_rna_array.c index d1a351e8509..fbc981689d5 100644 --- a/source/blender/python/intern/bpy_rna_array.c +++ b/source/blender/python/intern/bpy_rna_array.c @@ -144,7 +144,8 @@ static int validate_array_type(PyObject *seq, is_dynamic, check_item_type, item_type_str, - error_prefix) == -1) { + error_prefix) == -1) + { ok = 0; } @@ -402,7 +403,8 @@ static int validate_array(PyObject *rvalue, (prop_flag & PROP_DYNAMIC) != 0, check_item_type, item_type_str, - error_prefix) == -1) { + error_prefix) == -1) + { return -1; } @@ -537,7 +539,8 @@ static int py_to_array(PyObject *seq, check_item_type, item_type_str, &totitem, - error_prefix) == -1) { + error_prefix) == -1) + { return -1; } @@ -643,7 +646,8 @@ static int py_to_array_index(PyObject *py, check_item_type, item_type_str, &totitem, - error_prefix) == -1) { + error_prefix) == -1) + { return -1; } diff --git a/source/blender/python/intern/bpy_rna_callback.c b/source/blender/python/intern/bpy_rna_callback.c index 4409e3ae828..39ebf8a70b4 100644 --- a/source/blender/python/intern/bpy_rna_callback.c +++ b/source/blender/python/intern/bpy_rna_callback.c @@ -296,7 +296,8 @@ PyObject *pyrna_callback_classmethod_add(PyObject *UNUSED(self), PyObject *args) pyrna_enum_value_parse_string, ¶ms.space_type_enum, pyrna_enum_value_parse_string, - ¶ms.region_type_enum)) { + ¶ms.region_type_enum)) + { return NULL; } @@ -324,7 +325,8 @@ PyObject *pyrna_callback_classmethod_add(PyObject *UNUSED(self), PyObject *args) pyrna_enum_value_parse_string, ¶ms.region_type_enum, pyrna_enum_value_parse_string, - ¶ms.event_enum)) { + ¶ms.event_enum)) + { return NULL; } @@ -391,7 +393,8 @@ PyObject *pyrna_callback_classmethod_remove(PyObject *UNUSED(self), PyObject *ar if (srna == &RNA_WindowManager) { if (!PyArg_ParseTuple( - args, "OO!:WindowManager.draw_cursor_remove", &cls, &PyCapsule_Type, &py_handle)) { + args, "OO!:WindowManager.draw_cursor_remove", &cls, &PyCapsule_Type, &py_handle)) + { return NULL; } handle_removed = WM_paint_cursor_end(handle); @@ -411,7 +414,8 @@ PyObject *pyrna_callback_classmethod_remove(PyObject *UNUSED(self), PyObject *ar &PyCapsule_Type, &py_handle, /* already assigned, no matter */ pyrna_enum_value_parse_string, - ¶ms.region_type_enum)) { + ¶ms.region_type_enum)) + { return NULL; } diff --git a/source/blender/python/intern/bpy_rna_context.c b/source/blender/python/intern/bpy_rna_context.c index df0a10050a1..b3a60e13e23 100644 --- a/source/blender/python/intern/bpy_rna_context.c +++ b/source/blender/python/intern/bpy_rna_context.c @@ -85,7 +85,8 @@ static PyObject *bpy_rna_context_temp_override_enter(BPyContextTempOverride *sel return NULL; } if ((screen && BLI_findindex(&screen->regionbase, region) == -1) && - (BLI_findindex(&area->regionbase, region) == -1)) { + (BLI_findindex(&area->regionbase, region) == -1)) + { PyErr_SetString(PyExc_TypeError, "Region not found in area"); return NULL; } diff --git a/source/blender/python/intern/bpy_rna_driver.c b/source/blender/python/intern/bpy_rna_driver.c index f15daba3890..01ef3aed3fa 100644 --- a/source/blender/python/intern/bpy_rna_driver.c +++ b/source/blender/python/intern/bpy_rna_driver.c @@ -78,7 +78,8 @@ bool pyrna_driver_is_equal_anim_rna(const PathResolvedRNA *anim_rna, const PyObj const PointerRNA *ptr_b = &(((const BPy_StructRNA *)py_anim_rna)->ptr); if ((ptr_a->owner_id == ptr_b->owner_id) && (ptr_a->type == ptr_b->type) && - (ptr_a->data == ptr_b->data)) { + (ptr_a->data == ptr_b->data)) + { return true; } } diff --git a/source/blender/python/intern/bpy_rna_gizmo.c b/source/blender/python/intern/bpy_rna_gizmo.c index 32ef7865e84..8ba8b4d66f6 100644 --- a/source/blender/python/intern/bpy_rna_gizmo.c +++ b/source/blender/python/intern/bpy_rna_gizmo.c @@ -169,7 +169,8 @@ static void py_rna_gizmo_handler_get_cb(const wmGizmo *UNUSED(gz), ret, gz_prop->type->array_length, &PyFloat_Type, - "Gizmo get callback: ") == -1) { + "Gizmo get callback: ") == -1) + { goto fail; } } @@ -361,7 +362,8 @@ static PyObject *bpy_gizmo_target_set_handler(PyObject *UNUSED(self), PyObject * /* `get/set/range` */ ¶ms.py_fn_slots[BPY_GIZMO_FN_SLOT_GET], ¶ms.py_fn_slots[BPY_GIZMO_FN_SLOT_SET], - ¶ms.py_fn_slots[BPY_GIZMO_FN_SLOT_RANGE_GET])) { + ¶ms.py_fn_slots[BPY_GIZMO_FN_SLOT_RANGE_GET])) + { goto fail; } @@ -450,7 +452,8 @@ static PyObject *bpy_gizmo_target_get_value(PyObject *UNUSED(self), PyObject *ar ¶ms.gz_with_target.gz, /* `target` */ py_rna_gizmo_target_id_parse_and_ensure_is_valid, - ¶ms.gz_with_target)) { + ¶ms.gz_with_target)) + { goto fail; } @@ -517,7 +520,8 @@ static PyObject *bpy_gizmo_target_set_value(PyObject *UNUSED(self), PyObject *ar py_rna_gizmo_target_id_parse_and_ensure_is_valid, ¶ms.gz_with_target, /* `value` */ - ¶ms.value)) { + ¶ms.value)) + { goto fail; } @@ -534,7 +538,8 @@ static PyObject *bpy_gizmo_target_set_value(PyObject *UNUSED(self), PyObject *ar params.value, gz_prop->type->array_length, &PyFloat_Type, - "Gizmo target property array: ") == -1) { + "Gizmo target property array: ") == -1) + { goto fail; } WM_gizmo_target_property_float_set_array(BPY_context_get(), gz, gz_prop, value); @@ -590,7 +595,8 @@ static PyObject *bpy_gizmo_target_get_range(PyObject *UNUSED(self), PyObject *ar ¶ms.gz_with_target.gz, /* `target` */ py_rna_gizmo_target_id_parse_and_ensure_is_valid, - ¶ms.gz_with_target)) { + ¶ms.gz_with_target)) + { goto fail; } diff --git a/source/blender/python/intern/bpy_rna_id_collection.c b/source/blender/python/intern/bpy_rna_id_collection.c index df3c687307b..1b18877dbe9 100644 --- a/source/blender/python/intern/bpy_rna_id_collection.c +++ b/source/blender/python/intern/bpy_rna_id_collection.c @@ -168,7 +168,8 @@ static PyObject *bpy_user_map(PyObject *UNUSED(self), PyObject *args, PyObject * 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kwds, &_parser, &subset, &PySet_Type, &key_types, &PySet_Type, &val_types)) { + args, kwds, &_parser, &subset, &PySet_Type, &key_types, &PySet_Type, &val_types)) + { return NULL; } @@ -226,7 +227,8 @@ static PyObject *bpy_user_map(PyObject *UNUSED(self), PyObject *args, PyObject * (key_types_bitmap == NULL || id_check_type(id, key_types_bitmap)) && /* We do not want to pre-add keys when we have filter on value types, * but not on key types. */ - (val_types_bitmap == NULL || key_types_bitmap != NULL)) { + (val_types_bitmap == NULL || key_types_bitmap != NULL)) + { PyObject *key = pyrna_id_CreatePyObject(id); PyObject *set; @@ -394,7 +396,8 @@ static PyObject *bpy_orphans_purge(PyObject *UNUSED(self), PyObject *args, PyObj PyC_ParseBool, &do_linked_ids, PyC_ParseBool, - &do_recursive_cleanup)) { + &do_recursive_cleanup)) + { return NULL; } diff --git a/source/blender/python/intern/bpy_rna_text.c b/source/blender/python/intern/bpy_rna_text.c index 9653ecbe1e3..8f1049614c7 100644 --- a/source/blender/python/intern/bpy_rna_text.c +++ b/source/blender/python/intern/bpy_rna_text.c @@ -71,7 +71,8 @@ static PyObject *bpy_rna_region_as_string(PyObject *self, PyObject *args, PyObje 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kwds, &_parser, ®ion.curl, ®ion.curc, ®ion.sell, ®ion.selc)) { + args, kwds, &_parser, ®ion.curl, ®ion.curc, ®ion.sell, ®ion.selc)) + { return NULL; } @@ -136,7 +137,8 @@ static PyObject *bpy_rna_region_from_string(PyObject *self, PyObject *args, PyOb ®ion.curl, ®ion.curc, ®ion.sell, - ®ion.selc)) { + ®ion.selc)) + { return NULL; } diff --git a/source/blender/python/intern/bpy_traceback.c b/source/blender/python/intern/bpy_traceback.c index 63da19b8c9e..1466d674384 100644 --- a/source/blender/python/intern/bpy_traceback.c +++ b/source/blender/python/intern/bpy_traceback.c @@ -201,11 +201,13 @@ bool python_script_error_jump( r_offset, r_lineno_end, r_offset_end, - &text_py)) { + &text_py)) + { const char *filepath_exc = PyUnicode_AsUTF8(filepath_exc_py); /* python adds a '/', prefix, so check for both */ if ((BLI_path_cmp(filepath_exc, filepath) == 0) || - (ELEM(filepath_exc[0], '\\', '/') && BLI_path_cmp(filepath_exc + 1, filepath) == 0)) { + (ELEM(filepath_exc[0], '\\', '/') && BLI_path_cmp(filepath_exc + 1, filepath) == 0)) + { success = true; } } @@ -216,7 +218,8 @@ bool python_script_error_jump( for (tb = (PyTracebackObject *)PySys_GetObject("last_traceback"); tb && (PyObject *)tb != Py_None; - tb = tb->tb_next) { + tb = tb->tb_next) + { PyObject *coerce; const char *tb_filepath = traceback_filepath(tb, &coerce); const int match = ((BLI_path_cmp(tb_filepath, filepath) == 0) || diff --git a/source/blender/python/intern/bpy_utils_units.c b/source/blender/python/intern/bpy_utils_units.c index 95d7f4f2eb7..49ed09a1806 100644 --- a/source/blender/python/intern/bpy_utils_units.c +++ b/source/blender/python/intern/bpy_utils_units.c @@ -186,7 +186,8 @@ static PyObject *bpyunits_to_value(PyObject *UNUSED(self), PyObject *args, PyObj 0, }; if (!_PyArg_ParseTupleAndKeywordsFast( - args, kw, &_parser, &usys_str, &ucat_str, &inpt, &str_len, &uref)) { + args, kw, &_parser, &usys_str, &ucat_str, &inpt, &str_len, &uref)) + { return NULL; } @@ -283,7 +284,8 @@ static PyObject *bpyunits_to_string(PyObject *UNUSED(self), PyObject *args, PyOb PyC_ParseBool, &split_unit, PyC_ParseBool, - &compatible_unit)) { + &compatible_unit)) + { return NULL; } diff --git a/source/blender/python/mathutils/mathutils.c b/source/blender/python/mathutils/mathutils.c index fe9c05b4e4f..4af6357ad73 100644 --- a/source/blender/python/mathutils/mathutils.c +++ b/source/blender/python/mathutils/mathutils.c @@ -102,7 +102,8 @@ int mathutils_array_parse( if ((num = VectorObject_Check(value) ? ((VectorObject *)value)->vec_num : 0) || (num = EulerObject_Check(value) ? 3 : 0) || (num = QuaternionObject_Check(value) ? 4 : 0) || - (num = ColorObject_Check(value) ? 3 : 0)) { + (num = ColorObject_Check(value) ? 3 : 0)) + { if (BaseMath_ReadCallback((BaseMathObject *)value) == -1) { return -1; } @@ -196,7 +197,8 @@ int mathutils_array_parse_alloc(float **array, if ((num = VectorObject_Check(value) ? ((VectorObject *)value)->vec_num : 0) || (num = EulerObject_Check(value) ? 3 : 0) || (num = QuaternionObject_Check(value) ? 4 : 0) || - (num = ColorObject_Check(value) ? 3 : 0)) { + (num = ColorObject_Check(value) ? 3 : 0)) + { if (BaseMath_ReadCallback((BaseMathObject *)value) == -1) { return -1; } diff --git a/source/blender/python/mathutils/mathutils_Color.c b/source/blender/python/mathutils/mathutils_Color.c index 017e733de8e..65edb95d18d 100644 --- a/source/blender/python/mathutils/mathutils_Color.c +++ b/source/blender/python/mathutils/mathutils_Color.c @@ -74,7 +74,8 @@ static PyObject *Color_new(PyTypeObject *type, PyObject *args, PyObject *kwds) break; case 1: if (mathutils_array_parse( - col, COLOR_SIZE, COLOR_SIZE, PyTuple_GET_ITEM(args, 0), "mathutils.Color()") == -1) { + col, COLOR_SIZE, COLOR_SIZE, PyTuple_GET_ITEM(args, 0), "mathutils.Color()") == -1) + { return NULL; } break; @@ -457,7 +458,8 @@ static int Color_ass_slice(ColorObject *self, int begin, int end, PyObject *seq) begin = MIN2(begin, end); if ((size = mathutils_array_parse(col, 0, COLOR_SIZE, seq, "mathutils.Color[begin:end] = []")) == - -1) { + -1) + { return -1; } diff --git a/source/blender/python/mathutils/mathutils_Euler.c b/source/blender/python/mathutils/mathutils_Euler.c index c34f97f201d..74e836f2820 100644 --- a/source/blender/python/mathutils/mathutils_Euler.c +++ b/source/blender/python/mathutils/mathutils_Euler.c @@ -280,7 +280,8 @@ static PyObject *Euler_make_compatible(EulerObject *self, PyObject *value) EULER_SIZE, EULER_SIZE, value, - "euler.make_compatible(other), invalid 'other' arg") == -1) { + "euler.make_compatible(other), invalid 'other' arg") == -1) + { return NULL; } @@ -540,7 +541,8 @@ static int Euler_ass_slice(EulerObject *self, int begin, int end, PyObject *seq) begin = MIN2(begin, end); if ((size = mathutils_array_parse(eul, 0, EULER_SIZE, seq, "mathutils.Euler[begin:end] = []")) == - -1) { + -1) + { return -1; } @@ -698,7 +700,8 @@ static int Euler_order_set(EulerObject *self, PyObject *value, void *UNUSED(clos } if (((order_str = PyUnicode_AsUTF8(value)) == NULL) || - ((order = euler_order_from_string(order_str, "euler.order")) == -1)) { + ((order = euler_order_from_string(order_str, "euler.order")) == -1)) + { return -1; } diff --git a/source/blender/python/mathutils/mathutils_Matrix.c b/source/blender/python/mathutils/mathutils_Matrix.c index 1c02ecb0bd3..84ee3a9db57 100644 --- a/source/blender/python/mathutils/mathutils_Matrix.c +++ b/source/blender/python/mathutils/mathutils_Matrix.c @@ -737,7 +737,8 @@ static PyObject *C_Matrix_Rotation(PyObject *cls, PyObject *args) float tvec[3]; if (mathutils_array_parse( - tvec, 3, 3, vec, "Matrix.Rotation(angle, size, axis), invalid 'axis' arg") == -1) { + tvec, 3, 3, vec, "Matrix.Rotation(angle, size, axis), invalid 'axis' arg") == -1) + { return NULL; } @@ -775,7 +776,8 @@ static PyObject *C_Matrix_Translation(PyObject *cls, PyObject *value) unit_m4(mat); if (mathutils_array_parse( - mat[3], 3, 4, value, "mathutils.Matrix.Translation(vector), invalid vector arg") == -1) { + mat[3], 3, 4, value, "mathutils.Matrix.Translation(vector), invalid vector arg") == -1) + { return NULL; } @@ -847,7 +849,8 @@ static PyObject *C_Matrix_Scale(PyObject *cls, PyObject *args) vec_num = (matSize == 2 ? 2 : 3); if (mathutils_array_parse( tvec, vec_num, vec_num, vec, "Matrix.Scale(factor, size, axis), invalid 'axis' arg") == - -1) { + -1) + { return NULL; } } @@ -980,7 +983,8 @@ static PyObject *C_Matrix_OrthoProjection(PyObject *cls, PyObject *args) vec_num, vec_num, axis, - "Matrix.OrthoProjection(axis, size), invalid 'axis' arg") == -1) { + "Matrix.OrthoProjection(axis, size), invalid 'axis' arg") == -1) + { return NULL; } @@ -1148,7 +1152,8 @@ static PyObject *C_Matrix_LocRotScale(PyObject *cls, PyObject *args) zero_v3(loc); } else if (mathutils_array_parse( - loc, 3, 3, loc_obj, "Matrix.LocRotScale(), invalid location argument") == -1) { + loc, 3, 3, loc_obj, "Matrix.LocRotScale(), invalid location argument") == -1) + { return NULL; } @@ -1203,7 +1208,8 @@ static PyObject *C_Matrix_LocRotScale(PyObject *cls, PyObject *args) float scale[3]; if (mathutils_array_parse( - scale, 3, 3, scale_obj, "Matrix.LocRotScale(), invalid scale argument") == -1) { + scale, 3, 3, scale_obj, "Matrix.LocRotScale(), invalid scale argument") == -1) + { return NULL; } @@ -2438,7 +2444,8 @@ static int Matrix_ass_item_row(MatrixObject *self, int row, PyObject *value) } if (mathutils_array_parse( - vec, self->col_num, self->col_num, value, "matrix[i] = value assignment") == -1) { + vec, self->col_num, self->col_num, value, "matrix[i] = value assignment") == -1) + { return -1; } @@ -2466,7 +2473,8 @@ static int Matrix_ass_item_col(MatrixObject *self, int col, PyObject *value) } if (mathutils_array_parse( - vec, self->row_num, self->row_num, value, "matrix[i] = value assignment") == -1) { + vec, self->row_num, self->row_num, value, "matrix[i] = value assignment") == -1) + { return -1; } @@ -2546,8 +2554,8 @@ static int Matrix_ass_slice(MatrixObject *self, int begin, int end, PyObject *va PyObject *item = value_fast_items[row - begin]; if (mathutils_array_parse( - vec, self->col_num, self->col_num, item, "matrix[begin:end] = value assignment") == - -1) { + vec, self->col_num, self->col_num, item, "matrix[begin:end] = value assignment") == -1) + { Py_DECREF(value_fast); return -1; } @@ -3692,8 +3700,8 @@ static PyObject *MatrixAccess_subscript(MatrixAccessObject *self, PyObject *item if (PySlice_Check(item)) { Py_ssize_t start, stop, step, slicelength; - if (PySlice_GetIndicesEx(item, MatrixAccess_len(self), &start, &stop, &step, &slicelength) < - 0) { + if (PySlice_GetIndicesEx(item, MatrixAccess_len(self), &start, &stop, &step, &slicelength) < 0) + { return NULL; } diff --git a/source/blender/python/mathutils/mathutils_Quaternion.c b/source/blender/python/mathutils/mathutils_Quaternion.c index b56a1b78f0a..91a994749d2 100644 --- a/source/blender/python/mathutils/mathutils_Quaternion.c +++ b/source/blender/python/mathutils/mathutils_Quaternion.c @@ -54,7 +54,8 @@ static void quat__axis_angle_sanitize(float axis[3], float *angle) axis[2] = 0.0f; } else if (EXPP_FloatsAreEqual(axis[0], 0.0f, 10) && EXPP_FloatsAreEqual(axis[1], 0.0f, 10) && - EXPP_FloatsAreEqual(axis[2], 0.0f, 10)) { + EXPP_FloatsAreEqual(axis[2], 0.0f, 10)) + { axis[0] = 1.0f; } } @@ -120,8 +121,8 @@ static PyObject *Quaternion_new(PyTypeObject *type, PyObject *args, PyObject *kw case 1: { int size; - if ((size = mathutils_array_parse(quat, 3, QUAT_SIZE, seq, "mathutils.Quaternion()")) == - -1) { + if ((size = mathutils_array_parse(quat, 3, QUAT_SIZE, seq, "mathutils.Quaternion()")) == -1) + { return NULL; } @@ -387,7 +388,8 @@ static PyObject *Quaternion_cross(QuaternionObject *self, PyObject *value) if (mathutils_array_parse( tquat, QUAT_SIZE, QUAT_SIZE, value, "Quaternion.cross(other), invalid 'other' arg") == - -1) { + -1) + { return NULL; } @@ -419,8 +421,8 @@ static PyObject *Quaternion_dot(QuaternionObject *self, PyObject *value) } if (mathutils_array_parse( - tquat, QUAT_SIZE, QUAT_SIZE, value, "Quaternion.dot(other), invalid 'other' arg") == - -1) { + tquat, QUAT_SIZE, QUAT_SIZE, value, "Quaternion.dot(other), invalid 'other' arg") == -1) + { return NULL; } @@ -454,7 +456,8 @@ static PyObject *Quaternion_rotation_difference(QuaternionObject *self, PyObject QUAT_SIZE, QUAT_SIZE, value, - "Quaternion.rotation_difference(other), invalid 'other' arg") == -1) { + "Quaternion.rotation_difference(other), invalid 'other' arg") == -1) + { return NULL; } @@ -498,7 +501,8 @@ static PyObject *Quaternion_slerp(QuaternionObject *self, PyObject *args) if (mathutils_array_parse( tquat, QUAT_SIZE, QUAT_SIZE, value, "Quaternion.slerp(other), invalid 'other' arg") == - -1) { + -1) + { return NULL; } @@ -568,7 +572,8 @@ static PyObject *Quaternion_make_compatible(QuaternionObject *self, PyObject *va QUAT_SIZE, QUAT_SIZE, value, - "Quaternion.make_compatible(other), invalid 'other' arg") == -1) { + "Quaternion.make_compatible(other), invalid 'other' arg") == -1) + { return NULL; } @@ -987,7 +992,8 @@ static int Quaternion_ass_slice(QuaternionObject *self, int begin, int end, PyOb begin = MIN2(begin, end); if ((size = mathutils_array_parse( - quat, 0, QUAT_SIZE, seq, "mathutils.Quaternion[begin:end] = []")) == -1) { + quat, 0, QUAT_SIZE, seq, "mathutils.Quaternion[begin:end] = []")) == -1) + { return -1; } diff --git a/source/blender/python/mathutils/mathutils_Vector.c b/source/blender/python/mathutils/mathutils_Vector.c index 72084a624d3..b10dcdc9e98 100644 --- a/source/blender/python/mathutils/mathutils_Vector.c +++ b/source/blender/python/mathutils/mathutils_Vector.c @@ -158,7 +158,8 @@ static PyObject *Vector_new(PyTypeObject *type, PyObject *args, PyObject *kwds) break; case 1: if ((vec_num = mathutils_array_parse_alloc( - &vec, 2, PyTuple_GET_ITEM(args, 0), "mathutils.Vector()")) == -1) { + &vec, 2, PyTuple_GET_ITEM(args, 0), "mathutils.Vector()")) == -1) + { return NULL; } break; @@ -360,7 +361,8 @@ static PyObject *C_Vector_Repeat(PyObject *cls, PyObject *args) } if ((value_num = mathutils_array_parse_alloc( - &iter_vec, 2, value, "Vector.Repeat(vector, vec_num), invalid 'vector' arg")) == -1) { + &iter_vec, 2, value, "Vector.Repeat(vector, vec_num), invalid 'vector' arg")) == -1) + { return NULL; } @@ -947,7 +949,8 @@ static PyObject *Vector_reflect(VectorObject *self, PyObject *value) } if ((value_num = mathutils_array_parse( - tvec, 2, 4, value, "Vector.reflect(other), invalid 'other' arg")) == -1) { + tvec, 2, 4, value, "Vector.reflect(other), invalid 'other' arg")) == -1) + { return NULL; } @@ -1003,7 +1006,8 @@ static PyObject *Vector_cross(VectorObject *self, PyObject *value) if (mathutils_array_parse( tvec, self->vec_num, self->vec_num, value, "Vector.cross(other), invalid 'other' arg") == - -1) { + -1) + { return NULL; } @@ -1043,7 +1047,8 @@ static PyObject *Vector_dot(VectorObject *self, PyObject *value) } if (mathutils_array_parse_alloc( - &tvec, self->vec_num, value, "Vector.dot(other), invalid 'other' arg") == -1) { + &tvec, self->vec_num, value, "Vector.dot(other), invalid 'other' arg") == -1) + { return NULL; } @@ -1092,7 +1097,8 @@ static PyObject *Vector_angle(VectorObject *self, PyObject *args) * even though n this case 'w' is ignored */ if (mathutils_array_parse( tvec, self->vec_num, self->vec_num, value, "Vector.angle(other), invalid 'other' arg") == - -1) { + -1) + { return NULL; } @@ -1158,7 +1164,8 @@ static PyObject *Vector_angle_signed(VectorObject *self, PyObject *args) } if (mathutils_array_parse( - tvec, 2, 2, value, "Vector.angle_signed(other), invalid 'other' arg") == -1) { + tvec, 2, 2, value, "Vector.angle_signed(other), invalid 'other' arg") == -1) + { return NULL; } @@ -1217,8 +1224,8 @@ static PyObject *Vector_rotation_difference(VectorObject *self, PyObject *value) } if (mathutils_array_parse( - vec_b, 3, MAX_DIMENSIONS, value, "Vector.difference(other), invalid 'other' arg") == - -1) { + vec_b, 3, MAX_DIMENSIONS, value, "Vector.difference(other), invalid 'other' arg") == -1) + { return NULL; } @@ -1257,7 +1264,8 @@ static PyObject *Vector_project(VectorObject *self, PyObject *value) } if (mathutils_array_parse_alloc( - &tvec, vec_num, value, "Vector.project(other), invalid 'other' arg") == -1) { + &tvec, vec_num, value, "Vector.project(other), invalid 'other' arg") == -1) + { return NULL; } @@ -1307,7 +1315,8 @@ static PyObject *Vector_lerp(VectorObject *self, PyObject *args) } if (mathutils_array_parse_alloc( - &tvec, vec_num, value, "Vector.lerp(other), invalid 'other' arg") == -1) { + &tvec, vec_num, value, "Vector.lerp(other), invalid 'other' arg") == -1) + { return NULL; } @@ -1361,7 +1370,8 @@ static PyObject *Vector_slerp(VectorObject *self, PyObject *args) } if (mathutils_array_parse( - other_vec, vec_num, vec_num, value, "Vector.slerp(other), invalid 'other' arg") == -1) { + other_vec, vec_num, vec_num, value, "Vector.slerp(other), invalid 'other' arg") == -1) + { return NULL; } @@ -2193,8 +2203,8 @@ static PyObject *Vector_imul(PyObject *v1, PyObject *v2) /* Element-wise product in-place. */ mul_vn_vn(vec1->vec, vec2->vec, vec1->vec_num); } - else if (vec1 && (((scalar = PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) == - 0)) { /* VEC *= FLOAT */ + else if (vec1 && (((scalar = PyFloat_AsDouble(v2)) == -1.0f && PyErr_Occurred()) == 0)) + { /* VEC *= FLOAT */ mul_vn_fl(vec1->vec, vec1->vec_num, scalar); } else { @@ -2682,7 +2692,8 @@ static int Vector_swizzle_set(VectorObject *self, PyObject *value, void *closure } else if ((void)PyErr_Clear(), /* run but ignore the result */ (size_from = (size_t)mathutils_array_parse( - vec_assign, 2, 4, value, "Vector.**** = swizzle assignment")) == (size_t)-1) { + vec_assign, 2, 4, value, "Vector.**** = swizzle assignment")) == (size_t)-1) + { return -1; } diff --git a/source/blender/python/mathutils/mathutils_bvhtree.cc b/source/blender/python/mathutils/mathutils_bvhtree.cc index 52b4bb72983..ee8cda2c931 100644 --- a/source/blender/python/mathutils/mathutils_bvhtree.cc +++ b/source/blender/python/mathutils/mathutils_bvhtree.cc @@ -341,8 +341,8 @@ static PyObject *py_bvhtree_ray_cast(PyBVHTree *self, PyObject *args) } if ((mathutils_array_parse(co, 2, 3 | MU_ARRAY_ZERO, py_co, error_prefix) == -1) || - (mathutils_array_parse(direction, 2, 3 | MU_ARRAY_ZERO, py_direction, error_prefix) == - -1)) { + (mathutils_array_parse(direction, 2, 3 | MU_ARRAY_ZERO, py_direction, error_prefix) == -1)) + { return nullptr; } @@ -668,12 +668,14 @@ static PyObject *C_BVHTree_FromPolygons(PyObject * /*cls*/, PyObject *args, PyOb &py_tris, PyC_ParseBool, &all_triangles, - &epsilon)) { + &epsilon)) + { return nullptr; } if (!(py_coords_fast = PySequence_Fast(py_coords, error_prefix)) || - !(py_tris_fast = PySequence_Fast(py_tris, error_prefix))) { + !(py_tris_fast = PySequence_Fast(py_tris, error_prefix))) + { Py_XDECREF(py_coords_fast); return nullptr; } @@ -940,7 +942,8 @@ static PyObject *C_BVHTree_FromBMesh(PyObject * /*cls*/, PyObject *args, PyObjec (char **)keywords, &BPy_BMesh_Type, &py_bm, - &epsilon)) { + &epsilon)) + { return nullptr; } @@ -1125,7 +1128,8 @@ static PyObject *C_BVHTree_FromObject(PyObject * /*cls*/, PyObject *args, PyObje &epsilon) || ((ob = static_cast(PyC_RNA_AsPointer(py_ob, "Object"))) == nullptr) || ((depsgraph = static_cast(PyC_RNA_AsPointer(py_depsgraph, "Depsgraph"))) == - nullptr)) { + nullptr)) + { return nullptr; } diff --git a/source/blender/python/mathutils/mathutils_geometry.c b/source/blender/python/mathutils/mathutils_geometry.c index 751883e6f1f..2c136e63b7c 100644 --- a/source/blender/python/mathutils/mathutils_geometry.c +++ b/source/blender/python/mathutils/mathutils_geometry.c @@ -67,20 +67,23 @@ static PyObject *M_Geometry_intersect_ray_tri(PyObject *UNUSED(self), PyObject * &py_ray, &py_ray_off, PyC_ParseBool, - &clip)) { + &clip)) + { return NULL; } if (((mathutils_array_parse(dir, 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_ray, error_prefix) != -1) && (mathutils_array_parse( - orig, 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_ray_off, error_prefix) != -1)) == 0) { + orig, 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_ray_off, error_prefix) != -1)) == 0) + { return NULL; } for (i = 0; i < ARRAY_SIZE(tri); i++) { if (mathutils_array_parse( - tri[i], 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_tri[i], error_prefix) == -1) { + tri[i], 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_tri[i], error_prefix) == -1) + { return NULL; } } @@ -181,7 +184,8 @@ static PyObject *M_Geometry_intersect_line_line(PyObject *UNUSED(self), PyObject ix_vec_num, ix_vec_num | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_lines[3], - error_prefix) != -1)) == 0) { + error_prefix) != -1)) == 0) + { return NULL; } @@ -238,13 +242,14 @@ static PyObject *M_Geometry_intersect_sphere_sphere_2d(PyObject *UNUSED(self), P float v_ab[2]; float dist; - if (!PyArg_ParseTuple( - args, "OfOf:intersect_sphere_sphere_2d", &py_v_a, &rad_a, &py_v_b, &rad_b)) { + if (!PyArg_ParseTuple(args, "OfOf:intersect_sphere_sphere_2d", &py_v_a, &rad_a, &py_v_b, &rad_b)) + { return NULL; } if (((mathutils_array_parse(v_a, 2, 2, py_v_a, error_prefix) != -1) && - (mathutils_array_parse(v_b, 2, 2, py_v_b, error_prefix) != -1)) == 0) { + (mathutils_array_parse(v_b, 2, 2, py_v_b, error_prefix) != -1)) == 0) + { return NULL; } @@ -258,7 +263,8 @@ static PyObject *M_Geometry_intersect_sphere_sphere_2d(PyObject *UNUSED(self), P /* fully-contained in the other */ (dist < fabsf(rad_a - rad_b)) || /* co-incident */ - (dist < FLT_EPSILON)) { + (dist < FLT_EPSILON)) + { /* out of range */ PyTuple_SET_ITEMS(ret, Py_INCREF_RET(Py_None), Py_INCREF_RET(Py_None)); } @@ -302,14 +308,16 @@ static PyObject *M_Geometry_intersect_tri_tri_2d(PyObject *UNUSED(self), PyObjec &tri_pair_py[0][2], &tri_pair_py[1][0], &tri_pair_py[1][1], - &tri_pair_py[1][2])) { + &tri_pair_py[1][2])) + { return NULL; } for (int i = 0; i < 2; i++) { for (int j = 0; j < 3; j++) { if (mathutils_array_parse( - tri_pair[i][j], 2, 2 | MU_ARRAY_SPILL, tri_pair_py[i][j], error_prefix) == -1) { + tri_pair[i][j], 2, 2 | MU_ARRAY_SPILL, tri_pair_py[i][j], error_prefix) == -1) + { return NULL; } } @@ -340,7 +348,8 @@ static PyObject *M_Geometry_normal(PyObject *UNUSED(self), PyObject *args) } if ((coords_len = mathutils_array_parse_alloc_v( - (float **)&coords, 3 | MU_ARRAY_SPILL, args, "normal")) == -1) { + (float **)&coords, 3 | MU_ARRAY_SPILL, args, "normal")) == -1) + { return NULL; } @@ -384,7 +393,8 @@ static PyObject *M_Geometry_area_tri(PyObject *UNUSED(self), PyObject *args) if ((((len = mathutils_array_parse(tri[0], 2, 3, py_tri[0], error_prefix)) != -1) && (mathutils_array_parse(tri[1], len, len, py_tri[1], error_prefix) != -1) && - (mathutils_array_parse(tri[2], len, len, py_tri[2], error_prefix) != -1)) == 0) { + (mathutils_array_parse(tri[2], len, len, py_tri[2], error_prefix) != -1)) == 0) + { return NULL; } @@ -501,7 +511,8 @@ static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObjec &py_plane_co, &py_plane_no, PyC_ParseBool, - &no_flip)) { + &no_flip)) + { return NULL; } @@ -509,7 +520,8 @@ static PyObject *M_Geometry_intersect_line_plane(PyObject *UNUSED(self), PyObjec (mathutils_array_parse(line_b, 3, 3 | MU_ARRAY_SPILL, py_line_b, error_prefix) != -1) && (mathutils_array_parse(plane_co, 3, 3 | MU_ARRAY_SPILL, py_plane_co, error_prefix) != -1) && (mathutils_array_parse(plane_no, 3, 3 | MU_ARRAY_SPILL, py_plane_no, error_prefix) != - -1)) == 0) { + -1)) == 0) + { return NULL; } @@ -554,7 +566,8 @@ static PyObject *M_Geometry_intersect_plane_plane(PyObject *UNUSED(self), PyObje &py_plane_a_co, &py_plane_a_no, &py_plane_b_co, - &py_plane_b_no)) { + &py_plane_b_no)) + { return NULL; } @@ -565,7 +578,8 @@ static PyObject *M_Geometry_intersect_plane_plane(PyObject *UNUSED(self), PyObje (mathutils_array_parse(plane_b_co, 3, 3 | MU_ARRAY_SPILL, py_plane_b_co, error_prefix) != -1) && (mathutils_array_parse(plane_b_no, 3, 3 | MU_ARRAY_SPILL, py_plane_b_no, error_prefix) != - -1)) == 0) { + -1)) == 0) + { return NULL; } @@ -624,14 +638,16 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje &py_sphere_co, &sphere_radius, PyC_ParseBool, - &clip)) { + &clip)) + { return NULL; } if (((mathutils_array_parse(line_a, 3, 3 | MU_ARRAY_SPILL, py_line_a, error_prefix) != -1) && (mathutils_array_parse(line_b, 3, 3 | MU_ARRAY_SPILL, py_line_b, error_prefix) != -1) && (mathutils_array_parse(sphere_co, 3, 3 | MU_ARRAY_SPILL, py_sphere_co, error_prefix) != - -1)) == 0) { + -1)) == 0) + { return NULL; } @@ -644,18 +660,21 @@ static PyObject *M_Geometry_intersect_line_sphere(PyObject *UNUSED(self), PyObje switch (isect_line_sphere_v3(line_a, line_b, sphere_co, sphere_radius, isect_a, isect_b)) { case 1: if (!(!clip || (((lambda = line_point_factor_v3(isect_a, line_a, line_b)) >= 0.0f) && - (lambda <= 1.0f)))) { + (lambda <= 1.0f)))) + { use_a = false; } use_b = false; break; case 2: if (!(!clip || (((lambda = line_point_factor_v3(isect_a, line_a, line_b)) >= 0.0f) && - (lambda <= 1.0f)))) { + (lambda <= 1.0f)))) + { use_a = false; } if (!(!clip || (((lambda = line_point_factor_v3(isect_b, line_a, line_b)) >= 0.0f) && - (lambda <= 1.0f)))) { + (lambda <= 1.0f)))) + { use_b = false; } break; @@ -709,14 +728,16 @@ static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject *UNUSED(self), PyO &py_sphere_co, &sphere_radius, PyC_ParseBool, - &clip)) { + &clip)) + { return NULL; } if (((mathutils_array_parse(line_a, 2, 2 | MU_ARRAY_SPILL, py_line_a, error_prefix) != -1) && (mathutils_array_parse(line_b, 2, 2 | MU_ARRAY_SPILL, py_line_b, error_prefix) != -1) && (mathutils_array_parse(sphere_co, 2, 2 | MU_ARRAY_SPILL, py_sphere_co, error_prefix) != - -1)) == 0) { + -1)) == 0) + { return NULL; } @@ -729,18 +750,21 @@ static PyObject *M_Geometry_intersect_line_sphere_2d(PyObject *UNUSED(self), PyO switch (isect_line_sphere_v2(line_a, line_b, sphere_co, sphere_radius, isect_a, isect_b)) { case 1: if (!(!clip || (((lambda = line_point_factor_v2(isect_a, line_a, line_b)) >= 0.0f) && - (lambda <= 1.0f)))) { + (lambda <= 1.0f)))) + { use_a = false; } use_b = false; break; case 2: if (!(!clip || (((lambda = line_point_factor_v2(isect_a, line_a, line_b)) >= 0.0f) && - (lambda <= 1.0f)))) { + (lambda <= 1.0f)))) + { use_a = false; } if (!(!clip || (((lambda = line_point_factor_v2(isect_b, line_a, line_b)) >= 0.0f) && - (lambda <= 1.0f)))) { + (lambda <= 1.0f)))) + { use_b = false; } break; @@ -790,7 +814,8 @@ static PyObject *M_Geometry_intersect_point_line(PyObject *UNUSED(self), PyObjec (mathutils_array_parse( line_a, 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_line_a, error_prefix) != -1) && (mathutils_array_parse( - line_b, 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_line_b, error_prefix) != -1)) == 0) { + line_b, 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_line_b, error_prefix) != -1)) == 0) + { return NULL; } @@ -830,13 +855,14 @@ static PyObject *M_Geometry_intersect_point_tri(PyObject *UNUSED(self), PyObject return NULL; } - if (mathutils_array_parse(pt, 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_pt, error_prefix) == - -1) { + if (mathutils_array_parse(pt, 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_pt, error_prefix) == -1) + { return NULL; } for (i = 0; i < ARRAY_SIZE(tri); i++) { if (mathutils_array_parse( - tri[i], 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_tri[i], error_prefix) == -1) { + tri[i], 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_tri[i], error_prefix) == -1) + { return NULL; } } @@ -875,13 +901,14 @@ static PyObject *M_Geometry_closest_point_on_tri(PyObject *UNUSED(self), PyObjec return NULL; } - if (mathutils_array_parse(pt, 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_pt, error_prefix) == - -1) { + if (mathutils_array_parse(pt, 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_pt, error_prefix) == -1) + { return NULL; } for (i = 0; i < ARRAY_SIZE(tri); i++) { if (mathutils_array_parse( - tri[i], 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_tri[i], error_prefix) == -1) { + tri[i], 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_tri[i], error_prefix) == -1) + { return NULL; } } @@ -1000,7 +1027,8 @@ static PyObject *M_Geometry_distance_point_to_plane(PyObject *UNUSED(self), PyOb if (((mathutils_array_parse(pt, 3, 3 | MU_ARRAY_SPILL, py_pt, error_prefix) != -1) && (mathutils_array_parse(plane_co, 3, 3 | MU_ARRAY_SPILL, py_plane_co, error_prefix) != -1) && (mathutils_array_parse(plane_no, 3, 3 | MU_ARRAY_SPILL, py_plane_no, error_prefix) != - -1)) == 0) { + -1)) == 0) + { return NULL; } @@ -1041,7 +1069,8 @@ static PyObject *M_Geometry_barycentric_transform(PyObject *UNUSED(self), PyObje "OOOOOOO:barycentric_transform", &py_pt_src, UNPACK3_EX(&, py_tri_src, ), - UNPACK3_EX(&, py_tri_dst, ))) { + UNPACK3_EX(&, py_tri_dst, ))) + { return NULL; } @@ -1052,7 +1081,8 @@ static PyObject *M_Geometry_barycentric_transform(PyObject *UNUSED(self), PyObje if (((mathutils_array_parse(tri_src[i], 3, 3 | MU_ARRAY_SPILL, py_tri_src[i], error_prefix) != -1) && (mathutils_array_parse(tri_dst[i], 3, 3 | MU_ARRAY_SPILL, py_tri_dst[i], error_prefix) != - -1)) == 0) { + -1)) == 0) + { return NULL; } } @@ -1098,7 +1128,8 @@ static PyObject *M_Geometry_points_in_planes(PyObject *UNUSED(self), PyObject *a } if ((planes_len = mathutils_array_parse_alloc_v( - (float **)&planes, 4, py_planes, "points_in_planes")) == -1) { + (float **)&planes, 4, py_planes, "points_in_planes")) == -1) + { return NULL; } @@ -1175,7 +1206,8 @@ static PyObject *M_Geometry_interpolate_bezier(PyObject *UNUSED(self), PyObject for (i = 0; i < 4; i++) { int dims_tmp; if ((dims_tmp = mathutils_array_parse( - data[i], 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_data[i], error_prefix)) == -1) { + data[i], 2, 3 | MU_ARRAY_SPILL | MU_ARRAY_ZERO, py_data[i], error_prefix)) == -1) + { return NULL; } dims = max_ii(dims, dims_tmp); @@ -1597,7 +1629,8 @@ static PyObject *M_Geometry_delaunay_2d_cdt(PyObject *UNUSED(self), PyObject *ar &faces, &output_type, &epsilon, - &need_ids)) { + &need_ids)) + { return NULL; } diff --git a/source/blender/python/mathutils/mathutils_interpolate.c b/source/blender/python/mathutils/mathutils_interpolate.c index 4b90a8233a4..62ba1214a78 100644 --- a/source/blender/python/mathutils/mathutils_interpolate.c +++ b/source/blender/python/mathutils/mathutils_interpolate.c @@ -45,7 +45,8 @@ static PyObject *M_Interpolate_poly_3d_calc(PyObject *UNUSED(self), PyObject *ar } if (mathutils_array_parse( - fp, 2, 3 | MU_ARRAY_ZERO, point, "pt must be a 2-3 dimensional vector") == -1) { + fp, 2, 3 | MU_ARRAY_ZERO, point, "pt must be a 2-3 dimensional vector") == -1) + { return NULL; } diff --git a/source/blender/python/mathutils/mathutils_kdtree.c b/source/blender/python/mathutils/mathutils_kdtree.c index 190a3768286..fc7edcf5f71 100644 --- a/source/blender/python/mathutils/mathutils_kdtree.c +++ b/source/blender/python/mathutils/mathutils_kdtree.c @@ -320,7 +320,8 @@ static PyObject *py_kdtree_find_range(PyKDTree *self, PyObject *args, PyObject * const char *keywords[] = {"co", "radius", NULL}; if (!PyArg_ParseTupleAndKeywords( - args, kwargs, "Of:find_range", (char **)keywords, &py_co, &radius)) { + args, kwargs, "Of:find_range", (char **)keywords, &py_co, &radius)) + { return NULL; } diff --git a/source/blender/python/mathutils/mathutils_noise.c b/source/blender/python/mathutils/mathutils_noise.c index 79bb0a58df4..004d7255582 100644 --- a/source/blender/python/mathutils/mathutils_noise.c +++ b/source/blender/python/mathutils/mathutils_noise.c @@ -307,8 +307,8 @@ static PyObject *M_Noise_random_unit_vector(PyObject *UNUSED(self), PyObject *ar float norm = 2.0f; int vec_num = 3; - if (!PyArg_ParseTupleAndKeywords( - args, kw, "|$i:random_unit_vector", (char **)kwlist, &vec_num)) { + if (!PyArg_ParseTupleAndKeywords(args, kw, "|$i:random_unit_vector", (char **)kwlist, &vec_num)) + { return NULL; } @@ -392,7 +392,8 @@ static PyObject *M_Noise_noise(PyObject *UNUSED(self), PyObject *args, PyObject int noise_basis_enum = DEFAULT_NOISE_TYPE; if (!PyArg_ParseTupleAndKeywords( - args, kw, "O|$s:noise", (char **)kwlist, &value, &noise_basis_str)) { + args, kw, "O|$s:noise", (char **)kwlist, &value, &noise_basis_str)) + { return NULL; } @@ -400,7 +401,8 @@ static PyObject *M_Noise_noise(PyObject *UNUSED(self), PyObject *args, PyObject /* pass through */ } else if (PyC_FlagSet_ValueFromID(bpy_noise_types, noise_basis_str, &noise_basis_enum, "noise") == - -1) { + -1) + { return NULL; } @@ -431,7 +433,8 @@ static PyObject *M_Noise_noise_vector(PyObject *UNUSED(self), PyObject *args, Py int noise_basis_enum = DEFAULT_NOISE_TYPE; if (!PyArg_ParseTupleAndKeywords( - args, kw, "O|$s:noise_vector", (char **)kwlist, &value, &noise_basis_str)) { + args, kw, "O|$s:noise_vector", (char **)kwlist, &value, &noise_basis_str)) + { return NULL; } @@ -439,7 +442,8 @@ static PyObject *M_Noise_noise_vector(PyObject *UNUSED(self), PyObject *args, Py /* pass through */ } else if (PyC_FlagSet_ValueFromID( - bpy_noise_types, noise_basis_str, &noise_basis_enum, "noise_vector") == -1) { + bpy_noise_types, noise_basis_str, &noise_basis_enum, "noise_vector") == -1) + { return NULL; } @@ -490,7 +494,8 @@ static PyObject *M_Noise_turbulence(PyObject *UNUSED(self), PyObject *args, PyOb &hd, &noise_basis_str, &as, - &fs)) { + &fs)) + { return NULL; } @@ -498,7 +503,8 @@ static PyObject *M_Noise_turbulence(PyObject *UNUSED(self), PyObject *args, PyOb /* pass through */ } else if (PyC_FlagSet_ValueFromID( - bpy_noise_types, noise_basis_str, &noise_basis_enum, "turbulence") == -1) { + bpy_noise_types, noise_basis_str, &noise_basis_enum, "turbulence") == -1) + { return NULL; } @@ -547,7 +553,8 @@ static PyObject *M_Noise_turbulence_vector(PyObject *UNUSED(self), PyObject *arg &hd, &noise_basis_str, &as, - &fs)) { + &fs)) + { return NULL; } @@ -555,7 +562,8 @@ static PyObject *M_Noise_turbulence_vector(PyObject *UNUSED(self), PyObject *arg /* pass through */ } else if (PyC_FlagSet_ValueFromID( - bpy_noise_types, noise_basis_str, &noise_basis_enum, "turbulence_vector") == -1) { + bpy_noise_types, noise_basis_str, &noise_basis_enum, "turbulence_vector") == -1) + { return NULL; } @@ -595,15 +603,9 @@ static PyObject *M_Noise_fractal(PyObject *UNUSED(self), PyObject *args, PyObjec float H, lac, oct; int noise_basis_enum = DEFAULT_NOISE_TYPE; - if (!PyArg_ParseTupleAndKeywords(args, - kw, - "Offf|$s:fractal", - (char **)kwlist, - &value, - &H, - &lac, - &oct, - &noise_basis_str)) { + if (!PyArg_ParseTupleAndKeywords( + args, kw, "Offf|$s:fractal", (char **)kwlist, &value, &H, &lac, &oct, &noise_basis_str)) + { return NULL; } @@ -611,7 +613,8 @@ static PyObject *M_Noise_fractal(PyObject *UNUSED(self), PyObject *args, PyObjec /* pass through */ } else if (PyC_FlagSet_ValueFromID( - bpy_noise_types, noise_basis_str, &noise_basis_enum, "fractal") == -1) { + bpy_noise_types, noise_basis_str, &noise_basis_enum, "fractal") == -1) + { return NULL; } @@ -657,7 +660,8 @@ static PyObject *M_Noise_multi_fractal(PyObject *UNUSED(self), PyObject *args, P &H, &lac, &oct, - &noise_basis_str)) { + &noise_basis_str)) + { return NULL; } @@ -665,7 +669,8 @@ static PyObject *M_Noise_multi_fractal(PyObject *UNUSED(self), PyObject *args, P /* pass through */ } else if (PyC_FlagSet_ValueFromID( - bpy_noise_types, noise_basis_str, &noise_basis_enum, "multi_fractal") == -1) { + bpy_noise_types, noise_basis_str, &noise_basis_enum, "multi_fractal") == -1) + { return NULL; } @@ -716,7 +721,8 @@ static PyObject *M_Noise_variable_lacunarity(PyObject *UNUSED(self), PyObject *a &value, &d, &noise_type1_str, - &noise_type2_str)) { + &noise_type2_str)) + { return NULL; } @@ -724,7 +730,8 @@ static PyObject *M_Noise_variable_lacunarity(PyObject *UNUSED(self), PyObject *a /* pass through */ } else if (PyC_FlagSet_ValueFromID( - bpy_noise_types, noise_type1_str, &noise_type1_enum, "variable_lacunarity") == -1) { + bpy_noise_types, noise_type1_str, &noise_type1_enum, "variable_lacunarity") == -1) + { return NULL; } @@ -732,12 +739,13 @@ static PyObject *M_Noise_variable_lacunarity(PyObject *UNUSED(self), PyObject *a /* pass through */ } else if (PyC_FlagSet_ValueFromID( - bpy_noise_types, noise_type2_str, &noise_type2_enum, "variable_lacunarity") == -1) { + bpy_noise_types, noise_type2_str, &noise_type2_enum, "variable_lacunarity") == -1) + { return NULL; } - if (mathutils_array_parse(vec, 3, 3, value, "variable_lacunarity: invalid 'position' arg") == - -1) { + if (mathutils_array_parse(vec, 3, 3, value, "variable_lacunarity: invalid 'position' arg") == -1) + { return NULL; } @@ -782,7 +790,8 @@ static PyObject *M_Noise_hetero_terrain(PyObject *UNUSED(self), PyObject *args, &lac, &oct, &ofs, - &noise_basis_str)) { + &noise_basis_str)) + { return NULL; } @@ -790,7 +799,8 @@ static PyObject *M_Noise_hetero_terrain(PyObject *UNUSED(self), PyObject *args, /* pass through */ } else if (PyC_FlagSet_ValueFromID( - bpy_noise_types, noise_basis_str, &noise_basis_enum, "hetero_terrain") == -1) { + bpy_noise_types, noise_basis_str, &noise_basis_enum, "hetero_terrain") == -1) + { return NULL; } @@ -842,7 +852,8 @@ static PyObject *M_Noise_hybrid_multi_fractal(PyObject *UNUSED(self), PyObject * &oct, &ofs, &gn, - &noise_basis_str)) { + &noise_basis_str)) + { return NULL; } @@ -850,8 +861,8 @@ static PyObject *M_Noise_hybrid_multi_fractal(PyObject *UNUSED(self), PyObject * /* pass through */ } else if (PyC_FlagSet_ValueFromID( - bpy_noise_types, noise_basis_str, &noise_basis_enum, "hybrid_multi_fractal") == - -1) { + bpy_noise_types, noise_basis_str, &noise_basis_enum, "hybrid_multi_fractal") == -1) + { return NULL; } @@ -904,7 +915,8 @@ static PyObject *M_Noise_ridged_multi_fractal(PyObject *UNUSED(self), PyObject * &oct, &ofs, &gn, - &noise_basis_str)) { + &noise_basis_str)) + { return NULL; } @@ -912,8 +924,8 @@ static PyObject *M_Noise_ridged_multi_fractal(PyObject *UNUSED(self), PyObject * /* pass through */ } else if (PyC_FlagSet_ValueFromID( - bpy_noise_types, noise_basis_str, &noise_basis_enum, "ridged_multi_fractal") == - -1) { + bpy_noise_types, noise_basis_str, &noise_basis_enum, "ridged_multi_fractal") == -1) + { return NULL; } @@ -952,7 +964,8 @@ static PyObject *M_Noise_voronoi(PyObject *UNUSED(self), PyObject *args, PyObjec int i; if (!PyArg_ParseTupleAndKeywords( - args, kw, "O|$sf:voronoi", (char **)kwlist, &value, &metric_str, &me)) { + args, kw, "O|$sf:voronoi", (char **)kwlist, &value, &metric_str, &me)) + { return NULL; } diff --git a/source/blender/render/intern/bake.cc b/source/blender/render/intern/bake.cc index 3cffb99078b..8022d875e65 100644 --- a/source/blender/render/intern/bake.cc +++ b/source/blender/render/intern/bake.cc @@ -654,7 +654,8 @@ bool RE_bake_pixels_populate_from_objects(Mesh *me_low, dir, i, tot_highpoly, - max_ray_distance)) { + max_ray_distance)) + { /* if it fails mask out the original pixel array */ pixel_array_from[i].primitive_id = -1; } diff --git a/source/blender/render/intern/pipeline.cc b/source/blender/render/intern/pipeline.cc index c74b7df6a65..131db2cb099 100644 --- a/source/blender/render/intern/pipeline.cc +++ b/source/blender/render/intern/pipeline.cc @@ -732,12 +732,14 @@ void RE_InitState(Render *re, /* disable border if it's a full render anyway */ if (re->r.border.xmin == 0.0f && re->r.border.xmax == 1.0f && re->r.border.ymin == 0.0f && - re->r.border.ymax == 1.0f) { + re->r.border.ymax == 1.0f) + { re->r.mode &= ~R_BORDER; } if (re->rectx < 1 || re->recty < 1 || - (BKE_imtype_is_movie(rd->im_format.imtype) && (re->rectx < 16 || re->recty < 16))) { + (BKE_imtype_is_movie(rd->im_format.imtype) && (re->rectx < 16 || re->recty < 16))) + { BKE_report(re->reports, RPT_ERROR, "Image too small"); re->ok = false; return; @@ -1473,11 +1475,12 @@ static int check_valid_camera(Scene *scene, Object *camera_override, ReportList if (scene->ed) { LISTBASE_FOREACH (Sequence *, seq, &scene->ed->seqbase) { if ((seq->type == SEQ_TYPE_SCENE) && ((seq->flag & SEQ_SCENE_STRIPS) == 0) && - (seq->scene != nullptr)) { + (seq->scene != nullptr)) + { if (!seq->scene_camera) { if (!seq->scene->camera && - !BKE_view_layer_camera_find(seq->scene, - BKE_view_layer_default_render(seq->scene))) { + !BKE_view_layer_camera_find(seq->scene, BKE_view_layer_default_render(seq->scene))) + { /* camera could be unneeded due to composite nodes */ Object *override = (seq->scene == scene) ? camera_override : nullptr; @@ -1758,7 +1761,8 @@ void RE_RenderFrame(Render *re, scene->r.subframe = subframe; if (render_init_from_main( - re, &scene->r, bmain, scene, single_layer, camera_override, false, false)) { + re, &scene->r, bmain, scene, single_layer, camera_override, false, false)) + { RenderData rd; memcpy(&rd, &scene->r, sizeof(rd)); MEM_reset_peak_memory(); @@ -1918,7 +1922,8 @@ bool RE_WriteRenderViewsMovie(ReportList *reports, ibuf->x, ibuf->y, suffix, - reports)) { + reports)) + { ok = false; } @@ -1951,7 +1956,8 @@ bool RE_WriteRenderViewsMovie(ReportList *reports, ibuf_arr[2]->x, ibuf_arr[2]->y, "", - reports)) { + reports)) + { ok = false; } @@ -2138,7 +2144,8 @@ void RE_RenderAnim(Render *re, height, re->reports, false, - suffix)) { + suffix)) + { is_error = true; break; } diff --git a/source/blender/render/intern/render_result.cc b/source/blender/render/intern/render_result.cc index 4383f30c5aa..9d07c4ce1ae 100644 --- a/source/blender/render/intern/render_result.cc +++ b/source/blender/render/intern/render_result.cc @@ -715,7 +715,8 @@ void render_result_merge(RenderResult *rr, RenderResult *rrpart) for (RenderPass *rpass = static_cast(rl->passes.first), *rpassp = static_cast(rlp->passes.first); rpass && rpassp; - rpass = rpass->next) { + rpass = rpass->next) + { /* For save buffers, skip any passes that are only saved to disk. */ if (rpass->rect == nullptr || rpassp->rect == nullptr) { continue; @@ -758,8 +759,8 @@ void render_result_single_layer_end(Render *re) return; } - if (re->pushedresult->rectx == re->result->rectx && - re->pushedresult->recty == re->result->recty) { + if (re->pushedresult->rectx == re->result->rectx && re->pushedresult->recty == re->result->recty) + { /* find which layer in re->pushedresult should be replaced */ RenderLayer *rl = static_cast(re->result->layers.first); @@ -947,7 +948,8 @@ ImBuf *RE_render_result_rect_to_ibuf(RenderResult *rr, */ if (ibuf->rect) { if (BKE_imtype_valid_depths(imf->imtype) & - (R_IMF_CHAN_DEPTH_12 | R_IMF_CHAN_DEPTH_16 | R_IMF_CHAN_DEPTH_24 | R_IMF_CHAN_DEPTH_32)) { + (R_IMF_CHAN_DEPTH_12 | R_IMF_CHAN_DEPTH_16 | R_IMF_CHAN_DEPTH_24 | R_IMF_CHAN_DEPTH_32)) + { if (imf->depth == R_IMF_CHAN_DEPTH_8) { /* Higher depth bits are supported but not needed for current file output. */ ibuf->rect_float = nullptr; diff --git a/source/blender/render/intern/render_result.h b/source/blender/render/intern/render_result.h index 2f98f13f9c4..fa8e28e3b9f 100644 --- a/source/blender/render/intern/render_result.h +++ b/source/blender/render/intern/render_result.h @@ -136,7 +136,8 @@ void render_result_views_shallowdelete(struct RenderResult *rr); ViewLayer *iter_; \ for (nr_ = 0, iter_ = static_cast((re_)->scene->view_layers.first); \ iter_ != NULL; \ - iter_ = iter_->next, nr_++) { \ + iter_ = iter_->next, nr_++) \ + { \ if (!G.background && (re_)->r.scemode & R_SINGLE_LAYER) { \ if (!STREQ(iter_->name, re->single_view_layer)) { \ continue; \ diff --git a/source/blender/render/intern/texture_image.c b/source/blender/render/intern/texture_image.c index 8c7d842ee47..ec79b8e5193 100644 --- a/source/blender/render/intern/texture_image.c +++ b/source/blender/render/intern/texture_image.c @@ -1137,7 +1137,8 @@ static int imagewraposa_aniso(Tex *tex, if (tex->extend == TEX_CLIPCUBE) { if ((fx + minx) < 0.0f || (fy + miny) < 0.0f || (fx - minx) > 1.0f || (fy - miny) > 1.0f || - texvec[2] < -1.0f || texvec[2] > 1.0f) { + texvec[2] < -1.0f || texvec[2] > 1.0f) + { if (ima) { BKE_image_pool_release_ibuf(ima, ibuf, pool); } @@ -1565,7 +1566,8 @@ int imagewraposa(Tex *tex, if (tex->extend == TEX_CLIPCUBE) { if (fx + minx < 0.0f || fy + miny < 0.0f || fx - minx > 1.0f || fy - miny > 1.0f || - texvec[2] < -1.0f || texvec[2] > 1.0f) { + texvec[2] < -1.0f || texvec[2] > 1.0f) + { if (ima) { BKE_image_pool_release_ibuf(ima, ibuf, pool); } diff --git a/source/blender/render/intern/texture_pointdensity.c b/source/blender/render/intern/texture_pointdensity.c index 816bfbdf09e..dabf9c2f401 100644 --- a/source/blender/render/intern/texture_pointdensity.c +++ b/source/blender/render/intern/texture_pointdensity.c @@ -52,12 +52,13 @@ static int point_data_used(PointDensity *pd) if (pd->source == TEX_PD_PSYS) { if ((pd->falloff_type == TEX_PD_FALLOFF_PARTICLE_VEL) || - (pd->color_source == TEX_PD_COLOR_PARTVEL) || - (pd->color_source == TEX_PD_COLOR_PARTSPEED)) { + (pd->color_source == TEX_PD_COLOR_PARTVEL) || (pd->color_source == TEX_PD_COLOR_PARTSPEED)) + { pd_bitflag |= POINT_DATA_VEL; } if ((pd->color_source == TEX_PD_COLOR_PARTAGE) || - (pd->falloff_type == TEX_PD_FALLOFF_PARTICLE_AGE)) { + (pd->falloff_type == TEX_PD_FALLOFF_PARTICLE_AGE)) + { pd_bitflag |= POINT_DATA_LIFE; } } diff --git a/source/blender/sequencer/intern/effects.c b/source/blender/sequencer/intern/effects.c index 607bde4b61b..624eb3a27e4 100644 --- a/source/blender/sequencer/intern/effects.c +++ b/source/blender/sequencer/intern/effects.c @@ -143,7 +143,8 @@ static ImBuf *prepare_effect_imbufs(const SeqRenderData *context, out = IMB_allocImBuf(x, y, 32, IB_rect); } else if ((ibuf1 && ibuf1->rect_float) || (ibuf2 && ibuf2->rect_float) || - (ibuf3 && ibuf3->rect_float)) { + (ibuf3 && ibuf3->rect_float)) + { /* if any inputs are rectfloat, output is float too */ out = IMB_allocImBuf(x, y, 32, IB_rectfloat); @@ -3283,7 +3284,8 @@ static int early_out_text(Sequence *seq, float UNUSED(fac)) TextVars *data = seq->effectdata; if (data->text[0] == 0 || data->text_size < 1.0f || ((data->color[3] == 0.0f) && - (data->shadow_color[3] == 0.0f || (data->flag & SEQ_TEXT_SHADOW) == 0))) { + (data->shadow_color[3] == 0.0f || (data->flag & SEQ_TEXT_SHADOW) == 0))) + { return EARLY_USE_INPUT_1; } return EARLY_NO_INPUT; diff --git a/source/blender/sequencer/intern/image_cache.c b/source/blender/sequencer/intern/image_cache.c index f8c43a7d293..a5bfca6a85c 100644 --- a/source/blender/sequencer/intern/image_cache.c +++ b/source/blender/sequencer/intern/image_cache.c @@ -566,7 +566,8 @@ void seq_cache_free_temp_cache(Scene *scene, short id, int timeline_frame) scene, key->seq, timeline_frame, key->type); if (frame_index != key->frame_index || timeline_frame > SEQ_time_right_handle_frame_get(scene, key->seq) || - timeline_frame < SEQ_time_left_handle_frame_get(scene, key->seq)) { + timeline_frame < SEQ_time_left_handle_frame_get(scene, key->seq)) + { BLI_ghash_remove(cache->hash, key, seq_cache_keyfree, seq_cache_valfree); } } @@ -661,7 +662,8 @@ void seq_cache_cleanup_sequence(Scene *scene, /* Clean all final and composite in intersection of seq and seq_changed. */ if (key->type & invalidate_composite && key->timeline_frame >= range_start && - key->timeline_frame <= range_end) { + key->timeline_frame <= range_end) + { if (key->link_next || key->link_prev) { seq_cache_relink_keys(key->link_next, key->link_prev); } @@ -671,7 +673,8 @@ void seq_cache_cleanup_sequence(Scene *scene, if (key->type & invalidate_source && key->seq == seq && key->timeline_frame >= SEQ_time_left_handle_frame_get(scene, seq_changed) && - key->timeline_frame <= SEQ_time_right_handle_frame_get(scene, seq_changed)) { + key->timeline_frame <= SEQ_time_right_handle_frame_get(scene, seq_changed)) + { if (key->link_next || key->link_prev) { seq_cache_relink_keys(key->link_next, key->link_prev); } @@ -715,7 +718,8 @@ void seq_cache_thumbnail_cleanup(Scene *scene, rctf *view_area_safe) if ((key->type & SEQ_CACHE_STORE_THUMBNAIL) && (key->timeline_frame > view_area_safe->xmax || key->timeline_frame < view_area_safe->xmin || key->seq->machine > view_area_safe->ymax || - key->seq->machine < view_area_safe->ymin)) { + key->seq->machine < view_area_safe->ymin)) + { BLI_ghash_remove(cache->hash, key, seq_cache_keyfree, seq_cache_valfree); cache->thumbnail_count--; } diff --git a/source/blender/sequencer/intern/iterator.c b/source/blender/sequencer/intern/iterator.c index acf6776c4ed..b303c035574 100644 --- a/source/blender/sequencer/intern/iterator.c +++ b/source/blender/sequencer/intern/iterator.c @@ -261,8 +261,8 @@ static bool must_render_strip(const Sequence *seq, SeqCollection *strips_at_time return false; } - if ((seq_iter->type & SEQ_TYPE_EFFECT) != 0 && - SEQ_relation_is_effect_of_strip(seq_iter, seq)) { + if ((seq_iter->type & SEQ_TYPE_EFFECT) != 0 && SEQ_relation_is_effect_of_strip(seq_iter, seq)) + { /* Strips in same channel or higher than its effect are rendered. */ if (seq->machine >= seq_iter->machine) { return true; @@ -357,7 +357,8 @@ void SEQ_query_strip_effect_chain(const Scene *scene, /* Find all strips connected to seq_reference. */ LISTBASE_FOREACH (Sequence *, seq_test, seqbase) { if (seq_test->seq1 == seq_reference || seq_test->seq2 == seq_reference || - seq_test->seq3 == seq_reference) { + seq_test->seq3 == seq_reference) + { SEQ_query_strip_effect_chain(scene, seq_test, seqbase, collection); } } diff --git a/source/blender/sequencer/intern/prefetch.c b/source/blender/sequencer/intern/prefetch.c index 2a9f7f52779..4b749d233ad 100644 --- a/source/blender/sequencer/intern/prefetch.c +++ b/source/blender/sequencer/intern/prefetch.c @@ -401,13 +401,15 @@ static bool seq_prefetch_scene_strip_is_rendered(PrefetchJob *pfjob, for (int i = 0; i < count; i++) { Sequence *seq = seq_arr[i]; if (seq->type == SEQ_TYPE_META && - seq_prefetch_scene_strip_is_rendered(pfjob, channels, &seq->seqbase, scene_strips, true)) { + seq_prefetch_scene_strip_is_rendered(pfjob, channels, &seq->seqbase, scene_strips, true)) + { return true; } /* Disable prefetching 3D scene strips, but check for disk cache. */ if (seq->type == SEQ_TYPE_SCENE && (seq->flag & SEQ_SCENE_STRIPS) == 0 && - !seq_prefetch_seq_has_disk_cache(pfjob, seq, !is_recursive_check)) { + !seq_prefetch_seq_has_disk_cache(pfjob, seq, !is_recursive_check)) + { return true; } @@ -456,7 +458,8 @@ static void seq_prefetch_do_suspend(PrefetchJob *pfjob) { BLI_mutex_lock(&pfjob->prefetch_suspend_mutex); while (seq_prefetch_need_suspend(pfjob) && - (pfjob->scene->ed->cache_flag & SEQ_CACHE_PREFETCH_ENABLE) && !pfjob->stop) { + (pfjob->scene->ed->cache_flag & SEQ_CACHE_PREFETCH_ENABLE) && !pfjob->stop) + { pfjob->waiting = true; BLI_condition_wait(&pfjob->prefetch_suspend_cond, &pfjob->prefetch_suspend_mutex); seq_prefetch_update_area(pfjob); @@ -501,8 +504,8 @@ static void *seq_prefetch_frames(void *job) seq_prefetch_do_suspend(pfjob); /* Avoid "collision" with main thread, but make sure to fetch at least few frames */ - if (pfjob->num_frames_prefetched > 5 && - (seq_prefetch_cfra(pfjob) - pfjob->scene->r.cfra) < 2) { + if (pfjob->num_frames_prefetched > 5 && (seq_prefetch_cfra(pfjob) - pfjob->scene->r.cfra) < 2) + { break; } @@ -575,7 +578,8 @@ void seq_prefetch_start(const SeqRenderData *context, float timeline_frame) * important, see D7820. */ if ((ed->cache_flag & SEQ_CACHE_PREFETCH_ENABLE) && !running && !scrubbing && !playing && - ed->cache_flag & SEQ_CACHE_ALL_TYPES && has_strips && !G.is_rendering && !G.moving) { + ed->cache_flag & SEQ_CACHE_ALL_TYPES && has_strips && !G.is_rendering && !G.moving) + { seq_prefetch_start_ex(context, timeline_frame); } diff --git a/source/blender/sequencer/intern/proxy.c b/source/blender/sequencer/intern/proxy.c index cff8c5ad082..d5076e28a38 100644 --- a/source/blender/sequencer/intern/proxy.c +++ b/source/blender/sequencer/intern/proxy.c @@ -146,7 +146,8 @@ static bool seq_proxy_get_fname(Scene *scene, /* Per strip with Custom file situation is handled separately. */ if (proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_FILE && - ed->proxy_storage != SEQ_EDIT_PROXY_DIR_STORAGE) { + ed->proxy_storage != SEQ_EDIT_PROXY_DIR_STORAGE) + { if (seq_proxy_get_custom_file_fname(seq, name, view_id)) { return true; } @@ -232,8 +233,8 @@ ImBuf *seq_proxy_fetch(const SeqRenderData *context, Sequence *seq, int timeline return IMB_anim_absolute(proxy->anim, frameno, IMB_TC_NONE, IMB_PROXY_NONE); } - if (seq_proxy_get_fname(context->scene, seq, timeline_frame, psize, name, context->view_id) == - 0) { + if (seq_proxy_get_fname(context->scene, seq, timeline_frame, psize, name, context->view_id) == 0) + { return NULL; } @@ -263,8 +264,8 @@ static void seq_proxy_build_frame(const SeqRenderData *context, ImBuf *ibuf_tmp, *ibuf; Scene *scene = context->scene; - if (!seq_proxy_get_fname( - scene, seq, timeline_frame, proxy_render_size, name, context->view_id)) { + if (!seq_proxy_get_fname(scene, seq, timeline_frame, proxy_render_size, name, context->view_id)) + { return; } @@ -521,7 +522,8 @@ void SEQ_proxy_rebuild(SeqIndexBuildContext *context, bool *stop, bool *do_updat for (timeline_frame = SEQ_time_left_handle_frame_get(scene, seq); timeline_frame < SEQ_time_right_handle_frame_get(scene, seq); - timeline_frame++) { + timeline_frame++) + { if (context->size_flags & IMB_PROXY_25) { seq_proxy_build_frame(&render_context, &state, seq, timeline_frame, 25, overwrite); } diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c index fe40c3b3d09..63791a1077b 100644 --- a/source/blender/sequencer/intern/render.c +++ b/source/blender/sequencer/intern/render.c @@ -313,7 +313,8 @@ static bool sequencer_use_transform(const Sequence *seq) const StripTransform *transform = seq->strip->transform; if (transform->xofs != 0 || transform->yofs != 0 || transform->scale_x != 1 || - transform->scale_y != 1 || transform->rotation != 0) { + transform->scale_y != 1 || transform->rotation != 0) + { return true; } @@ -341,7 +342,8 @@ static bool seq_input_have_to_preprocess(const SeqRenderData *context, } if ((seq->flag & (SEQ_FILTERY | SEQ_FLIPX | SEQ_FLIPY | SEQ_MAKE_FLOAT)) || - sequencer_use_crop(seq) || sequencer_use_transform(seq)) { + sequencer_use_crop(seq) || sequencer_use_transform(seq)) + { return true; } @@ -379,7 +381,8 @@ static bool seq_need_scale_to_render_size(const Sequence *seq, bool is_proxy_ima } if ((seq->type & SEQ_TYPE_EFFECT) != 0 || seq->type == SEQ_TYPE_MASK || seq->type == SEQ_TYPE_META || - (seq->type == SEQ_TYPE_SCENE && ((seq->flag & SEQ_SCENE_STRIPS) != 0))) { + (seq->type == SEQ_TYPE_SCENE && ((seq->flag & SEQ_SCENE_STRIPS) != 0))) + { return true; } return false; @@ -607,7 +610,8 @@ static ImBuf *input_preprocess(const SeqRenderData *context, } if (sequencer_use_crop(seq) || sequencer_use_transform(seq) || context->rectx != ibuf->x || - context->recty != ibuf->y) { + context->recty != ibuf->y) + { const int x = context->rectx; const int y = context->recty; preprocessed_ibuf = IMB_allocImBuf(x, y, 32, ibuf->rect_float ? IB_rectfloat : IB_rect); @@ -1073,7 +1077,8 @@ static ImBuf *seq_render_movie_strip_view(const SeqRenderData *context, /* Try to get a proxy image. * Movie proxies are handled by ImBuf module with exception of `custom file` setting. */ if (context->scene->ed->proxy_storage != SEQ_EDIT_PROXY_DIR_STORAGE && - seq->strip->proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_FILE) { + seq->strip->proxy->storage & SEQ_STORAGE_PROXY_CUSTOM_FILE) + { ibuf = seq_render_movie_strip_custom_file_proxy(context, seq, timeline_frame); } else { @@ -1761,8 +1766,8 @@ ImBuf *seq_render_strip(const SeqRenderData *context, } /* Proxies are not stored in cache. */ - if (!SEQ_can_use_proxy( - context, seq, SEQ_rendersize_to_proxysize(context->preview_render_size))) { + if (!SEQ_can_use_proxy(context, seq, SEQ_rendersize_to_proxysize(context->preview_render_size))) + { ibuf = seq_cache_get(context, seq, timeline_frame, SEQ_CACHE_STORE_RAW); } diff --git a/source/blender/sequencer/intern/sequencer.c b/source/blender/sequencer/intern/sequencer.c index a47aa2c9f15..82032fbb372 100644 --- a/source/blender/sequencer/intern/sequencer.c +++ b/source/blender/sequencer/intern/sequencer.c @@ -979,7 +979,8 @@ static bool seq_update_seq_cb(Sequence *seq, void *user_data) if (seq->type == SEQ_TYPE_SCENE && seq->scene != NULL) { BKE_sound_set_scene_volume(seq->scene, seq->scene->audio.volume); if ((seq->flag & SEQ_SCENE_STRIPS) == 0 && seq->scene->sound_scene != NULL && - seq->scene->ed != NULL) { + seq->scene->ed != NULL) + { SEQ_for_each_callback(&seq->scene->ed->seqbase, seq_disable_sound_strips_cb, seq->scene); } } diff --git a/source/blender/sequencer/intern/strip_add.c b/source/blender/sequencer/intern/strip_add.c index 621d342810b..168f3bbf6ae 100644 --- a/source/blender/sequencer/intern/strip_add.c +++ b/source/blender/sequencer/intern/strip_add.c @@ -524,7 +524,8 @@ void SEQ_add_reload_new_file(Main *bmain, Scene *scene, Sequence *seq, const boo SEQ_TYPE_SCENE, SEQ_TYPE_META, SEQ_TYPE_MOVIECLIP, - SEQ_TYPE_MASK) == 0) { + SEQ_TYPE_MASK) == 0) + { return; } diff --git a/source/blender/sequencer/intern/strip_relations.c b/source/blender/sequencer/intern/strip_relations.c index f89974b8fef..7f88fb178a2 100644 --- a/source/blender/sequencer/intern/strip_relations.c +++ b/source/blender/sequencer/intern/strip_relations.c @@ -49,7 +49,8 @@ static bool seq_relations_check_depend(const Scene *scene, Sequence *seq, Sequen /* sequences are not intersecting in time, assume no dependency exists between them */ if (SEQ_time_right_handle_frame_get(scene, cur) < SEQ_time_left_handle_frame_get(scene, seq) || - SEQ_time_left_handle_frame_get(scene, cur) > SEQ_time_right_handle_frame_get(scene, seq)) { + SEQ_time_left_handle_frame_get(scene, cur) > SEQ_time_right_handle_frame_get(scene, seq)) + { return false; } @@ -63,7 +64,8 @@ static bool seq_relations_check_depend(const Scene *scene, Sequence *seq, Sequen */ if ((cur->type & SEQ_TYPE_EFFECT) == 0 && ((cur->blend_mode == SEQ_BLEND_REPLACE) || - (cur->blend_mode == SEQ_TYPE_CROSS && cur->blend_opacity == 100.0f))) { + (cur->blend_mode == SEQ_TYPE_CROSS && cur->blend_opacity == 100.0f))) + { return false; } @@ -280,7 +282,8 @@ static void sequencer_all_free_anim_ibufs(const Scene *scene, Editing *ed = SEQ_editing_get(scene); for (Sequence *seq = seqbase->first; seq != NULL; seq = seq->next) { if (!SEQ_time_strip_intersects_frame(scene, seq, timeline_frame) || - !((frame_range[0] <= timeline_frame) && (frame_range[1] > timeline_frame))) { + !((frame_range[0] <= timeline_frame) && (frame_range[1] > timeline_frame))) + { SEQ_relations_sequence_free_anim(seq); } if (seq->type == SEQ_TYPE_META) { @@ -375,7 +378,8 @@ bool SEQ_relations_render_loop_check(Sequence *seq_main, Sequence *seq) if ((seq_main->seq1 && SEQ_relations_render_loop_check(seq_main->seq1, seq)) || (seq_main->seq2 && SEQ_relations_render_loop_check(seq_main->seq2, seq)) || - (seq_main->seq3 && SEQ_relations_render_loop_check(seq_main->seq3, seq))) { + (seq_main->seq3 && SEQ_relations_render_loop_check(seq_main->seq3, seq))) + { return true; } @@ -451,8 +455,8 @@ struct Sequence *SEQ_find_metastrip_by_sequence(ListBase *seqbase, Sequence *met if (seq == iseq) { return meta; } - if (iseq->seqbase.first && - (rval = SEQ_find_metastrip_by_sequence(&iseq->seqbase, iseq, seq))) { + if (iseq->seqbase.first && (rval = SEQ_find_metastrip_by_sequence(&iseq->seqbase, iseq, seq))) + { return rval; } } diff --git a/source/blender/sequencer/intern/strip_transform.c b/source/blender/sequencer/intern/strip_transform.c index c8ee4e58b4a..09c0736612c 100644 --- a/source/blender/sequencer/intern/strip_transform.c +++ b/source/blender/sequencer/intern/strip_transform.c @@ -65,13 +65,15 @@ bool SEQ_transform_seqbase_isolated_sel_check(ListBase *seqbase) if (seq->flag & SELECT) { if ((seq->seq1 && (seq->seq1->flag & SELECT) == 0) || (seq->seq2 && (seq->seq2->flag & SELECT) == 0) || - (seq->seq3 && (seq->seq3->flag & SELECT) == 0)) { + (seq->seq3 && (seq->seq3->flag & SELECT) == 0)) + { return false; } } else { if ((seq->seq1 && (seq->seq1->flag & SELECT)) || (seq->seq2 && (seq->seq2->flag & SELECT)) || - (seq->seq3 && (seq->seq3->flag & SELECT))) { + (seq->seq3 && (seq->seq3->flag & SELECT))) + { return false; } } @@ -405,25 +407,29 @@ static eOvelapDescrition overlap_description_get(const Scene *scene, if (SEQ_time_left_handle_frame_get(scene, transformed) <= SEQ_time_left_handle_frame_get(scene, target) && SEQ_time_right_handle_frame_get(scene, transformed) >= - SEQ_time_right_handle_frame_get(scene, target)) { + SEQ_time_right_handle_frame_get(scene, target)) + { return STRIP_OVERLAP_IS_FULL; } if (SEQ_time_left_handle_frame_get(scene, transformed) > SEQ_time_left_handle_frame_get(scene, target) && SEQ_time_right_handle_frame_get(scene, transformed) < - SEQ_time_right_handle_frame_get(scene, target)) { + SEQ_time_right_handle_frame_get(scene, target)) + { return STRIP_OVERLAP_IS_INSIDE; } if (SEQ_time_left_handle_frame_get(scene, transformed) <= SEQ_time_left_handle_frame_get(scene, target) && SEQ_time_left_handle_frame_get(scene, target) <= - SEQ_time_right_handle_frame_get(scene, transformed)) { + SEQ_time_right_handle_frame_get(scene, transformed)) + { return STRIP_OVERLAP_LEFT_SIDE; } if (SEQ_time_left_handle_frame_get(scene, transformed) <= SEQ_time_right_handle_frame_get(scene, target) && SEQ_time_right_handle_frame_get(scene, target) <= - SEQ_time_right_handle_frame_get(scene, transformed)) { + SEQ_time_right_handle_frame_get(scene, transformed)) + { return STRIP_OVERLAP_RIGHT_SIDE; } return STRIP_OVERLAP_NONE; diff --git a/source/blender/sequencer/intern/utils.c b/source/blender/sequencer/intern/utils.c index 5b70bc33e88..21faa34c41a 100644 --- a/source/blender/sequencer/intern/utils.c +++ b/source/blender/sequencer/intern/utils.c @@ -348,8 +348,8 @@ const Sequence *SEQ_get_topmost_sequence(const Scene *scene, int frame) int best_machine = -1; for (seq = ed->seqbasep->first; seq; seq = seq->next) { - if (SEQ_render_is_muted(channels, seq) || - !SEQ_time_strip_intersects_frame(scene, seq, frame)) { + if (SEQ_render_is_muted(channels, seq) || !SEQ_time_strip_intersects_frame(scene, seq, frame)) + { continue; } /* Only use strips that generate an image, not ones that combine @@ -360,7 +360,8 @@ const Sequence *SEQ_get_topmost_sequence(const Scene *scene, int frame) SEQ_TYPE_SCENE, SEQ_TYPE_MOVIE, SEQ_TYPE_COLOR, - SEQ_TYPE_TEXT)) { + SEQ_TYPE_TEXT)) + { if (seq->machine > best_machine) { best_seq = seq; best_machine = seq->machine; @@ -407,7 +408,8 @@ Sequence *SEQ_sequence_from_strip_elem(ListBase *seqbase, StripElem *se) for (iseq = seqbase->first; iseq; iseq = iseq->next) { Sequence *seq_found; if ((iseq->strip && iseq->strip->stripdata) && - ARRAY_HAS_ITEM(se, iseq->strip->stripdata, iseq->len)) { + ARRAY_HAS_ITEM(se, iseq->strip->stripdata, iseq->len)) + { break; } if ((seq_found = SEQ_sequence_from_strip_elem(&iseq->seqbase, se))) { @@ -429,7 +431,8 @@ Sequence *SEQ_get_sequence_by_name(ListBase *seqbase, const char *name, bool rec return iseq; } if (recursive && (iseq->seqbase.first) && - (rseq = SEQ_get_sequence_by_name(&iseq->seqbase, name, 1))) { + (rseq = SEQ_get_sequence_by_name(&iseq->seqbase, name, 1))) + { return rseq; } } diff --git a/source/blender/simulation/intern/SIM_mass_spring.cpp b/source/blender/simulation/intern/SIM_mass_spring.cpp index f703c9a3f78..888172b5374 100644 --- a/source/blender/simulation/intern/SIM_mass_spring.cpp +++ b/source/blender/simulation/intern/SIM_mass_spring.cpp @@ -381,7 +381,8 @@ BLI_INLINE void cloth_calc_spring_force(ClothModifierData *clmd, ClothSpring *s) /* Calculate force of structural + shear springs. */ if (s->type & - (CLOTH_SPRING_TYPE_STRUCTURAL | CLOTH_SPRING_TYPE_SEWING | CLOTH_SPRING_TYPE_INTERNAL)) { + (CLOTH_SPRING_TYPE_STRUCTURAL | CLOTH_SPRING_TYPE_SEWING | CLOTH_SPRING_TYPE_INTERNAL)) + { #ifdef CLOTH_FORCE_SPRING_STRUCTURAL float k_tension, scaling_tension; @@ -1193,11 +1194,9 @@ static void cloth_solve_collisions( zero_v3(verts[i].dcvel); } - if (cloth_bvh_collision(depsgraph, - ob, - clmd, - step / clmd->sim_parms->timescale, - dt / clmd->sim_parms->timescale)) { + if (cloth_bvh_collision( + depsgraph, ob, clmd, step / clmd->sim_parms->timescale, dt / clmd->sim_parms->timescale)) + { for (i = 0; i < mvert_num; i++) { if ((clmd->sim_parms->vgroup_mass > 0) && (verts[i].flags & CLOTH_VERT_FLAG_PINNED)) { continue; diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo.c index aa9518186c8..6da422e4014 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo.c @@ -505,7 +505,8 @@ int wm_gizmo_is_visible(wmGizmo *gz) return 0; } if ((gz->state & WM_GIZMO_STATE_MODAL) && - !(gz->flag & (WM_GIZMO_DRAW_MODAL | WM_GIZMO_DRAW_VALUE))) { + !(gz->flag & (WM_GIZMO_DRAW_MODAL | WM_GIZMO_DRAW_VALUE))) + { /* don't draw while modal (dragging) */ return 0; } diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c index ca02e3c17c0..5d8e6cdb211 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_group.c @@ -73,8 +73,8 @@ void wm_gizmogroup_free(bContext *C, wmGizmoGroup *gzgroup) /* Similar to WM_gizmo_unlink, but only to keep gzmap state correct, * we don't want to run callbacks. */ - if (gzmap->gzmap_context.highlight && - gzmap->gzmap_context.highlight->parent_gzgroup == gzgroup) { + if (gzmap->gzmap_context.highlight && gzmap->gzmap_context.highlight->parent_gzgroup == gzgroup) + { wm_gizmomap_highlight_set(gzmap, C, NULL, 0); } if (gzmap->gzmap_context.modal && gzmap->gzmap_context.modal->parent_gzgroup == gzgroup) { @@ -199,7 +199,8 @@ wmGizmo *wm_gizmogroup_find_intersected_gizmo(wmWindowManager *wm, if (gz->type->test_select && (gz->flag & (WM_GIZMO_HIDDEN | WM_GIZMO_HIDDEN_SELECT)) == 0) { if (!wm_gizmo_keymap_uses_event_modifier( - wm, gzgroup, gz, event_modifier, &gzgroup_keymap_uses_modifier)) { + wm, gzgroup, gz, event_modifier, &gzgroup_keymap_uses_modifier)) + { continue; } @@ -222,10 +223,12 @@ void wm_gizmogroup_intersectable_gizmos_to_list(wmWindowManager *wm, if ((gz->flag & (WM_GIZMO_HIDDEN | WM_GIZMO_HIDDEN_SELECT)) == 0) { if (((gzgroup->type->flag & WM_GIZMOGROUPTYPE_3D) && (gz->type->draw_select || gz->type->test_select)) || - ((gzgroup->type->flag & WM_GIZMOGROUPTYPE_3D) == 0 && gz->type->test_select)) { + ((gzgroup->type->flag & WM_GIZMOGROUPTYPE_3D) == 0 && gz->type->test_select)) + { if (!wm_gizmo_keymap_uses_event_modifier( - wm, gzgroup, gz, event_modifier, &gzgroup_keymap_uses_modifier)) { + wm, gzgroup, gz, event_modifier, &gzgroup_keymap_uses_modifier)) + { continue; } @@ -458,7 +461,8 @@ static void gizmo_tweak_finish(bContext *C, wmOperator *op, const bool cancel, b if (clear_modal) { /* The gizmo may have been removed. */ if ((BLI_findindex(&mtweak->gzmap->groups, mtweak->gzgroup) != -1) && - (BLI_findindex(&mtweak->gzgroup->gizmos, mtweak->gz_modal) != -1)) { + (BLI_findindex(&mtweak->gzgroup->gizmos, mtweak->gz_modal) != -1)) + { wm_gizmomap_modal_set(mtweak->gzmap, C, mtweak->gz_modal, NULL, false); } } @@ -1244,7 +1248,8 @@ void WM_gizmo_group_refresh(const bContext *C, wmGizmoGroup *gzgroup) BLI_assert(region->gizmo_map == gzmap); /* Check if the tweak event originated from this region. */ if ((win->eventstate != NULL) && (win->event_queue_check_drag) && - BLI_rcti_isect_pt_v(®ion->winrct, win->eventstate->prev_press_xy)) { + BLI_rcti_isect_pt_v(®ion->winrct, win->eventstate->prev_press_xy)) + { /* We need to run refresh again. */ gzgroup->init_flag &= ~WM_GIZMOGROUP_INIT_REFRESH; WM_gizmomap_tag_refresh_drawstep(gzmap, WM_gizmomap_drawstep_from_gizmo_group(gzgroup)); diff --git a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c index 0dde58ebfcd..079b9f3431d 100644 --- a/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c +++ b/source/blender/windowmanager/gizmo/intern/wm_gizmo_map.c @@ -176,8 +176,8 @@ static void wm_gizmomap_free_data(wmGizmoMap *gzmap) /* Clear first so further calls don't waste time trying to maintain correct array state. */ wm_gizmomap_select_array_clear(gzmap); - for (wmGizmoGroup *gzgroup = gzmap->groups.first, *gzgroup_next; gzgroup; - gzgroup = gzgroup_next) { + for (wmGizmoGroup *gzgroup = gzmap->groups.first, *gzgroup_next; gzgroup; gzgroup = gzgroup_next) + { gzgroup_next = gzgroup->next; BLI_assert(gzgroup->parent_gzmap == gzmap); wm_gizmogroup_free(NULL, gzgroup); @@ -274,8 +274,8 @@ static GHash *WM_gizmomap_gizmo_hash_new(const bContext *C, LISTBASE_FOREACH (wmGizmoGroup *, gzgroup, &gzmap->groups) { if (WM_gizmo_group_type_poll(C, gzgroup->type)) { LISTBASE_FOREACH (wmGizmo *, gz, &gzgroup->gizmos) { - if (((flag_exclude == 0) || ((gz->flag & flag_exclude) == 0)) && - (!poll || poll(gz, data))) { + if (((flag_exclude == 0) || ((gz->flag & flag_exclude) == 0)) && (!poll || poll(gz, data))) + { BLI_ghash_insert(hash, gz, gz); } } @@ -1135,7 +1135,8 @@ void wm_gizmomap_modal_set( } LISTBASE_FOREACH (wmGizmoGroup *, gzgroup, &gzmap->groups) { if (((gzgroup->type->flag & WM_GIZMOGROUPTYPE_DRAW_MODAL_ALL) == 0) && - wm_gizmogroup_is_visible_in_drawstep(gzgroup, step_iter)) { + wm_gizmogroup_is_visible_in_drawstep(gzgroup, step_iter)) + { gzmap->update_flag[i] |= update_flag; break; } @@ -1167,7 +1168,8 @@ void WM_gizmomap_message_subscribe(const bContext *C, { LISTBASE_FOREACH (wmGizmoGroup *, gzgroup, &gzmap->groups) { if ((gzgroup->hide.any != 0) || (gzgroup->init_flag & WM_GIZMOGROUP_INIT_SETUP) == 0 || - !WM_gizmo_group_type_poll(C, gzgroup->type)) { + !WM_gizmo_group_type_poll(C, gzgroup->type)) + { continue; } LISTBASE_FOREACH (wmGizmo *, gz, &gzgroup->gizmos) { @@ -1247,10 +1249,12 @@ wmGizmoMapType *WM_gizmomaptype_ensure(const struct wmGizmoMapType_Params *gzmap void wm_gizmomaptypes_free(void) { for (wmGizmoMapType *gzmap_type = gizmomaptypes.first, *gzmap_type_next; gzmap_type; - gzmap_type = gzmap_type_next) { + gzmap_type = gzmap_type_next) + { gzmap_type_next = gzmap_type->next; for (wmGizmoGroupTypeRef *gzgt_ref = gzmap_type->grouptype_refs.first, *gzgt_next; gzgt_ref; - gzgt_ref = gzgt_next) { + gzgt_ref = gzgt_next) + { gzgt_next = gzgt_ref->next; WM_gizmomaptype_group_free(gzgt_ref); } @@ -1317,7 +1321,8 @@ void WM_gizmoconfig_update(struct Main *bmain) gzmap_type->type_update_flag &= ~WM_GIZMOMAPTYPE_UPDATE_REMOVE; for (wmGizmoGroupTypeRef *gzgt_ref = gzmap_type->grouptype_refs.first, *gzgt_ref_next; gzgt_ref; - gzgt_ref = gzgt_ref_next) { + gzgt_ref = gzgt_ref_next) + { gzgt_ref_next = gzgt_ref->next; if (gzgt_ref->type->type_update_flag & WM_GIZMOMAPTYPE_UPDATE_REMOVE) { gzgt_ref->type->type_update_flag &= ~WM_GIZMOMAPTYPE_UPDATE_REMOVE; diff --git a/source/blender/windowmanager/intern/wm_cursors.c b/source/blender/windowmanager/intern/wm_cursors.c index 75b4073660c..ca1a88c650e 100644 --- a/source/blender/windowmanager/intern/wm_cursors.c +++ b/source/blender/windowmanager/intern/wm_cursors.c @@ -154,7 +154,8 @@ void WM_cursor_set(wmWindow *win, int curs) GHOST_TStandardCursor ghost_cursor = convert_to_ghost_standard_cursor(curs); if (ghost_cursor != GHOST_kStandardCursorCustom && - GHOST_HasCursorShape(win->ghostwin, ghost_cursor)) { + GHOST_HasCursorShape(win->ghostwin, ghost_cursor)) + { /* Use native GHOST cursor when available. */ GHOST_SetCursorShape(win->ghostwin, ghost_cursor); } diff --git a/source/blender/windowmanager/intern/wm_dragdrop.cc b/source/blender/windowmanager/intern/wm_dragdrop.cc index 5b74ee2984f..c0f03791a90 100644 --- a/source/blender/windowmanager/intern/wm_dragdrop.cc +++ b/source/blender/windowmanager/intern/wm_dragdrop.cc @@ -431,8 +431,8 @@ static void wm_drop_update_active(bContext *C, wmDrag *drag, const wmEvent *even const int winsize_y = WM_window_pixels_y(win); /* for multiwin drags, we only do this if mouse inside */ - if (event->xy[0] < 0 || event->xy[1] < 0 || event->xy[0] > winsize_x || - event->xy[1] > winsize_y) { + if (event->xy[0] < 0 || event->xy[1] < 0 || event->xy[0] > winsize_x || event->xy[1] > winsize_y) + { return; } diff --git a/source/blender/windowmanager/intern/wm_draw.c b/source/blender/windowmanager/intern/wm_draw.c index 6936f741f05..ce20e8b6d8a 100644 --- a/source/blender/windowmanager/intern/wm_draw.c +++ b/source/blender/windowmanager/intern/wm_draw.c @@ -666,7 +666,8 @@ static void wm_draw_region_buffer_create(ARegion *region, bool stereo, bool use_ /* Free offscreen buffer on size changes. Viewport auto resizes. */ GPUOffScreen *offscreen = region->draw_buffer->offscreen; if (offscreen && (GPU_offscreen_width(offscreen) != region->winx || - GPU_offscreen_height(offscreen) != region->winy)) { + GPU_offscreen_height(offscreen) != region->winy)) + { wm_draw_region_buffer_free(region); } } @@ -906,7 +907,8 @@ static void wm_draw_window_offscreen(bContext *C, wmWindow *win, bool stereo) !(region->flag & RGN_FLAG_HIDDEN); if ((region->visible || ignore_visibility) && region->do_draw && region->type && - region->type->layout) { + region->type->layout) + { CTX_wm_region_set(C, region); ED_region_do_layout(C, region); CTX_wm_region_set(C, NULL); diff --git a/source/blender/windowmanager/intern/wm_event_query.c b/source/blender/windowmanager/intern/wm_event_query.c index 3e33f88126e..1ae7e157c1a 100644 --- a/source/blender/windowmanager/intern/wm_event_query.c +++ b/source/blender/windowmanager/intern/wm_event_query.c @@ -353,7 +353,8 @@ bool WM_event_consecutive_gesture_test_break(const wmWindow *win, const wmEvent /* Mouse motion is checked because the user may navigate to a new area * and perform the same gesture - logically it's best to view this as two separate gestures. */ if (len_manhattan_v2v2_int(event->xy, win->event_queue_consecutive_gesture_xy) > - WM_EVENT_CURSOR_MOTION_THRESHOLD) { + WM_EVENT_CURSOR_MOTION_THRESHOLD) + { return true; } } diff --git a/source/blender/windowmanager/intern/wm_event_system.cc b/source/blender/windowmanager/intern/wm_event_system.cc index 53f3541c611..6bf4e127fee 100644 --- a/source/blender/windowmanager/intern/wm_event_system.cc +++ b/source/blender/windowmanager/intern/wm_event_system.cc @@ -642,7 +642,8 @@ void wm_event_do_notifiers(bContext *C) /* Filter out notifiers. */ if (note->category == NC_SCREEN && note->reference && note->reference != screen && - note->reference != workspace && note->reference != WM_window_get_active_layout(win)) { + note->reference != workspace && note->reference != WM_window_get_active_layout(win)) + { /* Pass. */ } else if (note->category == NC_SCENE && note->reference && note->reference != scene) { @@ -779,7 +780,8 @@ static eHandlerActionFlag wm_handler_ui_call(bContext *C, /* UI code doesn't handle return values - it just always returns break. * to make the #DBL_CLICK conversion work, we just don't send this to UI, except mouse clicks. */ if (((handler->head.flag & WM_HANDLER_ACCEPT_DBL_CLICK) == 0) && !ISMOUSE_BUTTON(event->type) && - (event->val == KM_DBL_CLICK)) { + (event->val == KM_DBL_CLICK)) + { return WM_HANDLER_CONTINUE; } @@ -1577,8 +1579,8 @@ static int wm_operator_invoke(bContext *C, if (event && (U.uiflag & USER_CONTINUOUS_MOUSE)) { const wmOperator *op_test = op->opm ? op->opm : op; const wmOperatorType *ot_test = op_test->type; - if ((ot_test->flag & OPTYPE_GRAB_CURSOR_XY) || - (op_test->flag & OP_IS_MODAL_GRAB_CURSOR)) { + if ((ot_test->flag & OPTYPE_GRAB_CURSOR_XY) || (op_test->flag & OP_IS_MODAL_GRAB_CURSOR)) + { wrap = WM_CURSOR_WRAP_XY; } else if (ot_test->flag & OPTYPE_GRAB_CURSOR_X) { @@ -1599,7 +1601,8 @@ static int wm_operator_invoke(bContext *C, } if (region && region->regiontype == RGN_TYPE_WINDOW && - BLI_rcti_isect_pt_v(®ion->winrct, event->xy)) { + BLI_rcti_isect_pt_v(®ion->winrct, event->xy)) + { wrap_region = ®ion->winrct; } else if (area && BLI_rcti_isect_pt_v(&area->totrct, event->xy)) { @@ -2264,8 +2267,8 @@ static bool wm_eventmatch(const wmEvent *winevent, const wmKeyMapItem *kmi) /* Account for rare case of when these keys are used as the 'type' not as modifiers. */ if (kmi->shift != KM_ANY) { const bool shift = (winevent->modifier & KM_SHIFT) != 0; - if ((shift != bool(kmi->shift)) && - !ELEM(winevent->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY)) { + if ((shift != bool(kmi->shift)) && !ELEM(winevent->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY)) + { return false; } } @@ -2429,7 +2432,8 @@ static eHandlerActionFlag wm_handler_operator_call(bContext *C, /* Derived, modal or blocking operator. */ if ((handler_base->type == WM_HANDLER_TYPE_OP) && - (((wmEventHandler_Op *)handler_base)->op != nullptr)) { + (((wmEventHandler_Op *)handler_base)->op != nullptr)) + { wmEventHandler_Op *handler = (wmEventHandler_Op *)handler_base; wmOperator *op = handler->op; wmOperatorType *ot = op->type; @@ -2650,7 +2654,8 @@ static eHandlerActionFlag wm_handler_fileselect_do(bContext *C, U.file_space_data.temp_win_sizey * UI_SCALE_FAC, SPACE_FILE, U.filebrowser_display_type, - true))) { + true))) + { ARegion *region_header = BKE_area_find_region_type(area, RGN_TYPE_HEADER); BLI_assert(area->spacetype == SPACE_FILE); @@ -3103,7 +3108,8 @@ static eHandlerActionFlag wm_handlers_do_gizmo_handler(bContext *C, /* Handle gizmo highlighting. */ if ((prev.gz_modal == nullptr) && - ((event->type == MOUSEMOVE) || is_event_modifier || is_event_drag)) { + ((event->type == MOUSEMOVE) || is_event_modifier || is_event_drag)) + { handle_highlight = true; if (is_event_modifier || is_event_drag) { handle_keymap = true; @@ -3257,7 +3263,8 @@ static eHandlerActionFlag wm_handlers_do_intern(bContext *C, for (wmEventHandler *handler_base = static_cast(handlers->first), *handler_base_next; handler_base && handlers->first; - handler_base = handler_base_next) { + handler_base = handler_base_next) + { handler_base_next = handler_base->next; /* During this loop, UI handlers for nested menus can tag multiple handlers free. */ @@ -3438,7 +3445,8 @@ static eHandlerActionFlag wm_handlers_do(bContext *C, wmEvent *event, ListBase * if ((action & WM_HANDLER_BREAK) == 0 || wm_action_not_handled(action)) { if (win->event_queue_check_drag) { if ((event->flag & WM_EVENT_FORCE_DRAG_THRESHOLD) || - WM_event_drag_test(event, event->prev_press_xy)) { + WM_event_drag_test(event, event->prev_press_xy)) + { win->event_queue_check_drag_handled = true; const int direction = WM_event_drag_direction(event); @@ -3502,7 +3510,8 @@ static eHandlerActionFlag wm_handlers_do(bContext *C, wmEvent *event, ListBase * else if (event->val == KM_RELEASE) { if (win->event_queue_check_drag) { if ((event->prev_press_type != event->type) && - (ISKEYMODIFIER(event->type) || (event->type == event->prev_press_keymodifier))) { + (ISKEYMODIFIER(event->type) || (event->type == event->prev_press_keymodifier))) + { /* Support releasing modifier keys without canceling the drag event, see #89989. */ } else { @@ -3920,7 +3929,8 @@ void wm_event_do_handlers(bContext *C) is_playing_screen = (ED_screen_animation_playing(wm) != nullptr); if (((is_playing_sound == 1) && (is_playing_screen == 0)) || - ((is_playing_sound == 0) && (is_playing_screen == 1))) { + ((is_playing_sound == 0) && (is_playing_screen == 1))) + { wmWindow *win_ctx = CTX_wm_window(C); bScreen *screen_stx = CTX_wm_screen(C); Scene *scene_ctx = CTX_data_scene(C); @@ -3962,7 +3972,8 @@ void wm_event_do_handlers(bContext *C) * Otherwise pressing two keys on the keyboard will interpret this as a drag action. */ if (win->event_queue_check_drag) { if ((event->val == KM_PRESS) && ((event->flag & WM_EVENT_IS_REPEAT) == 0) && - ISKEYBOARD_OR_BUTTON(event->type) && ISMOUSE_BUTTON(event->prev_press_type)) { + ISKEYBOARD_OR_BUTTON(event->type) && ISMOUSE_BUTTON(event->prev_press_type)) + { event = wm_event_add_mousemove_to_head(win); event->flag |= WM_EVENT_FORCE_DRAG_THRESHOLD; } @@ -4024,7 +4035,8 @@ void wm_event_do_handlers(bContext *C) if (screen->tool_tip && screen->tool_tip->exit_on_event) { if (ISMOUSE_MOTION(event->type)) { if (len_manhattan_v2v2_int(screen->tool_tip->event_xy, event->xy) > - WM_EVENT_CURSOR_MOTION_THRESHOLD) { + WM_EVENT_CURSOR_MOTION_THRESHOLD) + { WM_tooltip_clear(C, win); } } @@ -4138,8 +4150,8 @@ void wm_event_do_handlers(bContext *C) /* If press was handled, we don't want to do click. This way * press in tool key-map can override click in editor key-map. */ - if (ISMOUSE_BUTTON(event->type) && event->val == KM_PRESS && - !wm_action_not_handled(action)) { + if (ISMOUSE_BUTTON(event->type) && event->val == KM_PRESS && !wm_action_not_handled(action)) + { win->event_queue_check_click = false; } @@ -4230,7 +4242,8 @@ static wmWindow *wm_event_find_fileselect_root_window_from_context(const bContex wmWindow *ctx_win = CTX_wm_window(C); for (wmWindow *ctx_win_or_parent = ctx_win; ctx_win_or_parent; - ctx_win_or_parent = ctx_win_or_parent->parent) { + ctx_win_or_parent = ctx_win_or_parent->parent) + { ScrArea *file_area = ED_fileselect_handler_area_find_any_with_op(ctx_win_or_parent); if (!file_area) { @@ -4525,7 +4538,8 @@ static void wm_event_get_keymap_from_toolsystem_ex(wmWindowManager *wm, bool is_gizmo_highlight = false; if ((tref_rt && tref_rt->keymap_fallback[0]) && - (scene && (scene->toolsettings->workspace_tool_type == SCE_WORKSPACE_TOOL_FALLBACK))) { + (scene && (scene->toolsettings->workspace_tool_type == SCE_WORKSPACE_TOOL_FALLBACK))) + { bool add_keymap = false; /* Support for the gizmo owning the tool key-map. */ @@ -4746,7 +4760,8 @@ void WM_event_remove_ui_handler(ListBase *handlers, if (handler_base->type == WM_HANDLER_TYPE_UI) { wmEventHandler_UI *handler = (wmEventHandler_UI *)handler_base; if ((handler->handle_fn == handle_fn) && (handler->remove_fn == remove_fn) && - (handler->user_data == user_data)) { + (handler->user_data == user_data)) + { /* Handlers will be freed in #wm_handlers_do(). */ if (postpone) { handler->head.flag |= WM_HANDLER_DO_FREE; @@ -5181,7 +5196,8 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi /* Check if outside, include top window bar. */ int event_xy[2] = {UNPACK2(event->xy)}; if (event_xy[0] < 0 || event_xy[1] < 0 || event_xy[0] > WM_window_pixels_x(win) || - event_xy[1] > WM_window_pixels_y(win) + 30) { + event_xy[1] > WM_window_pixels_y(win) + 30) + { /* Let's skip windows having modal handlers now. */ /* Potential XXX ugly... I wouldn't have added a `modalhandlers` list * (introduced in rev 23331, ton). */ @@ -5203,7 +5219,8 @@ static wmWindow *wm_event_cursor_other_windows(wmWindowManager *wm, wmWindow *wi static bool wm_event_is_double_click(const wmEvent *event) { if ((event->type == event->prev_type) && (event->prev_val == KM_RELEASE) && - (event->val == KM_PRESS)) { + (event->val == KM_PRESS)) + { if (ISMOUSE_BUTTON(event->type) && WM_event_drag_test(event, event->prev_press_xy)) { /* Pass. */ } @@ -5457,13 +5474,15 @@ void wm_event_add_ghostevent(wmWindowManager *wm, wmWindow *win, const int type, * while not common, avoid a false alarm. */ #ifndef NDEBUG if ((event_state->type || event_state->val) && /* Ignore cleared event state. */ - !(ISKEYBOARD_OR_BUTTON(event_state->type) || (event_state->type == EVENT_NONE))) { + !(ISKEYBOARD_OR_BUTTON(event_state->type) || (event_state->type == EVENT_NONE))) + { CLOG_WARN(WM_LOG_HANDLERS, "Non-keyboard/mouse button found in 'win->eventstate->type = %d'", event_state->type); } if ((event_state->prev_type || event_state->prev_val) && /* Ignore cleared event state. */ - !(ISKEYBOARD_OR_BUTTON(event_state->prev_type) || (event_state->type == EVENT_NONE))) { + !(ISKEYBOARD_OR_BUTTON(event_state->prev_type) || (event_state->type == EVENT_NONE))) + { CLOG_WARN(WM_LOG_HANDLERS, "Non-keyboard/mouse button found in 'win->eventstate->prev_type = %d'", event_state->prev_type); @@ -6121,7 +6140,8 @@ void WM_window_cursor_keymap_status_refresh(bContext *C, wmWindow *win) RGN_TYPE_TOOL_HEADER, RGN_TYPE_FOOTER, RGN_TYPE_TEMPORARY, - RGN_TYPE_HUD)) { + RGN_TYPE_HUD)) + { return; } /* Fallback to window. */ diff --git a/source/blender/windowmanager/intern/wm_files.cc b/source/blender/windowmanager/intern/wm_files.cc index 0ca6d2372a9..ee3b22e77fb 100644 --- a/source/blender/windowmanager/intern/wm_files.cc +++ b/source/blender/windowmanager/intern/wm_files.cc @@ -602,8 +602,8 @@ void wm_file_read_report(bContext *C, Main *bmain) ReportList *reports = nullptr; LISTBASE_FOREACH (Scene *, scene, &bmain->scenes) { if (scene->r.engine[0] && - BLI_findstring(&R_engines, scene->r.engine, offsetof(RenderEngineType, idname)) == - nullptr) { + BLI_findstring(&R_engines, scene->r.engine, offsetof(RenderEngineType, idname)) == nullptr) + { if (reports == nullptr) { reports = CTX_wm_reports(C); } @@ -874,7 +874,8 @@ static void file_read_reports_finalize(BlendFileReadReport *bf_reports) if (bf_reports->resynced_lib_overrides_libraries_count != 0) { for (LinkNode *node_lib = bf_reports->resynced_lib_overrides_libraries; node_lib != nullptr; - node_lib = node_lib->next) { + node_lib = node_lib->next) + { Library *library = static_cast(node_lib->link); BKE_reportf(bf_reports->reports, RPT_INFO, @@ -914,7 +915,8 @@ static void file_read_reports_finalize(BlendFileReadReport *bf_reports) } if (bf_reports->count.proxies_to_lib_overrides_success != 0 || - bf_reports->count.proxies_to_lib_overrides_failures != 0) { + bf_reports->count.proxies_to_lib_overrides_failures != 0) + { BKE_reportf(bf_reports->reports, RPT_WARNING, "Proxies have been removed from Blender (%d proxies were automatically converted " @@ -1250,7 +1252,8 @@ void wm_homefile_read_ex(bContext *C, if ((app_template != nullptr) && (app_template[0] != '\0')) { if (!BKE_appdir_app_template_id_search( - app_template, app_template_system, sizeof(app_template_system))) { + app_template, app_template_system, sizeof(app_template_system))) + { /* Can safely continue with code below, just warn it's not found. */ BKE_reportf(reports, RPT_WARNING, "Application Template \"%s\" not found", app_template); } @@ -1569,7 +1572,8 @@ static void wm_history_file_update(void) RecentFile *recent_next; for (recent = static_cast(BLI_findlink(&G.recent_files, U.recent_files - 1)); recent; - recent = recent_next) { + recent = recent_next) + { recent_next = recent->next; wm_history_file_free(recent); } @@ -3683,7 +3687,8 @@ static void wm_block_file_close_save(bContext *C, void *arg_block, void *arg_dat if (file_has_been_saved_before) { if (WM_operator_name_call(C, "WM_OT_save_mainfile", WM_OP_EXEC_DEFAULT, nullptr, nullptr) & - OPERATOR_CANCELLED) { + OPERATOR_CANCELLED) + { execute_callback = false; } } @@ -3926,7 +3931,8 @@ bool wm_operator_close_file_dialog_if_needed(bContext *C, wmGenericCallbackFn post_action_fn) { if (U.uiflag & USER_SAVE_PROMPT && - wm_file_or_session_data_has_unsaved_changes(CTX_data_main(C), CTX_wm_manager(C))) { + wm_file_or_session_data_has_unsaved_changes(CTX_data_main(C), CTX_wm_manager(C))) + { wmGenericCallback *callback = MEM_cnew(__func__); callback->exec = post_action_fn; callback->user_data = IDP_CopyProperty(op->properties); diff --git a/source/blender/windowmanager/intern/wm_files_link.c b/source/blender/windowmanager/intern/wm_files_link.c index 8b1885c8ad0..1473d4ae7e5 100644 --- a/source/blender/windowmanager/intern/wm_files_link.c +++ b/source/blender/windowmanager/intern/wm_files_link.c @@ -126,7 +126,8 @@ static int wm_link_append_flag(wmOperator *op) flag |= FILE_ACTIVE_COLLECTION; } if ((prop = RNA_struct_find_property(op->ptr, "relative_path")) && - RNA_property_boolean_get(op->ptr, prop)) { + RNA_property_boolean_get(op->ptr, prop)) + { flag |= FILE_RELPATH; } if (RNA_boolean_get(op->ptr, "link")) { @@ -177,7 +178,8 @@ static bool wm_link_append_item_poll(ReportList *reports, idcode = BKE_idtype_idcode_from_name(group); if (!BKE_idtype_idcode_is_linkable(idcode) || - (!do_append && BKE_idtype_idcode_is_only_appendable(idcode))) { + (!do_append && BKE_idtype_idcode_is_only_appendable(idcode))) + { if (reports) { if (do_append) { BKE_reportf(reports, diff --git a/source/blender/windowmanager/intern/wm_init_exit.cc b/source/blender/windowmanager/intern/wm_init_exit.cc index 764177fcc18..4cf6e5939c0 100644 --- a/source/blender/windowmanager/intern/wm_init_exit.cc +++ b/source/blender/windowmanager/intern/wm_init_exit.cc @@ -498,7 +498,8 @@ void WM_exit_ex(bContext *C, const bool do_python) BlendFileWriteParams blend_file_write_params{}; if ((has_edited && BLO_write_file(bmain, filepath, fileflags, &blend_file_write_params, nullptr)) || - BLO_memfile_write_file(undo_memfile, filepath)) { + BLO_memfile_write_file(undo_memfile, filepath)) + { printf("Saved session recovery to \"%s\"\n", filepath); } } diff --git a/source/blender/windowmanager/intern/wm_keymap.c b/source/blender/windowmanager/intern/wm_keymap.c index 16a93dd4ead..936eab3b21b 100644 --- a/source/blender/windowmanager/intern/wm_keymap.c +++ b/source/blender/windowmanager/intern/wm_keymap.c @@ -450,7 +450,8 @@ bool WM_keymap_poll(bContext *C, wmKeyMap *keymap) !BLI_str_endswith(keymap->idname, " (fallback)") && /* This is an exception which may be empty. * Longer term we might want a flag to indicate an empty key-map is intended. */ - !STREQ(keymap->idname, "Node Tool: Tweak")) { + !STREQ(keymap->idname, "Node Tool: Tweak")) + { CLOG_WARN(WM_LOG_KEYMAPS, "empty keymap '%s'", keymap->idname); } } @@ -1252,7 +1253,8 @@ int WM_modalkeymap_items_to_string(const wmKeyMap *km, totlen += WM_keymap_item_to_string(kmi, compact, &result[totlen], result_len - totlen); if ((kmi = wm_modalkeymap_find_propvalue_iter(km, kmi, propvalue)) == NULL || - totlen >= (result_len - 2)) { + totlen >= (result_len - 2)) + { break; } diff --git a/source/blender/windowmanager/intern/wm_keymap_utils.c b/source/blender/windowmanager/intern/wm_keymap_utils.c index 10ef02f3829..5e4ebeedd62 100644 --- a/source/blender/windowmanager/intern/wm_keymap_utils.c +++ b/source/blender/windowmanager/intern/wm_keymap_utils.c @@ -202,7 +202,8 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) } /* Screen & Render */ else if (STRPREFIX(opname, "SCREEN_OT") || STRPREFIX(opname, "RENDER_OT") || - STRPREFIX(opname, "SOUND_OT") || STRPREFIX(opname, "SCENE_OT")) { + STRPREFIX(opname, "SOUND_OT") || STRPREFIX(opname, "SCENE_OT")) + { km = WM_keymap_find_all(wm, "Screen", 0, 0); } /* Grease Pencil */ @@ -233,7 +234,8 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) } /* Object mode related */ else if (STRPREFIX(opname, "GROUP_OT") || STRPREFIX(opname, "MATERIAL_OT") || - STRPREFIX(opname, "PTCACHE_OT") || STRPREFIX(opname, "RIGIDBODY_OT")) { + STRPREFIX(opname, "PTCACHE_OT") || STRPREFIX(opname, "RIGIDBODY_OT")) + { km = WM_keymap_find_all(wm, "Object Mode", 0, 0); } diff --git a/source/blender/windowmanager/intern/wm_operator_type.c b/source/blender/windowmanager/intern/wm_operator_type.c index 304880a75d0..d71f60c8a4b 100644 --- a/source/blender/windowmanager/intern/wm_operator_type.c +++ b/source/blender/windowmanager/intern/wm_operator_type.c @@ -235,8 +235,8 @@ void WM_operatortype_last_properties_clear_all(void) { GHashIterator iter; - for (WM_operatortype_iter(&iter); !BLI_ghashIterator_done(&iter); - BLI_ghashIterator_step(&iter)) { + for (WM_operatortype_iter(&iter); !BLI_ghashIterator_done(&iter); BLI_ghashIterator_step(&iter)) + { wmOperatorType *ot = BLI_ghashIterator_getValue(&iter); if (ot->last_properties) { diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 548ee1440c9..7689364d4af 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -446,7 +446,8 @@ static const char *wm_context_member_from_ptr(const bContext *C, { \ const char *ctx_member = member; \ if (RNA_struct_is_a((rna_ptr)->type, &(rna_type)) && \ - (rna_ptr)->data == (CTX_data_pointer_get_type(C, ctx_member, &(rna_type)).data)) { \ + (rna_ptr)->data == (CTX_data_pointer_get_type(C, ctx_member, &(rna_type)).data)) \ + { \ member_id = ctx_member; \ break; \ } \ @@ -2304,7 +2305,8 @@ static void radial_control_set_tex(RadialControl *rc) if ((ibuf = BKE_brush_gen_radial_control_imbuf( rc->image_id_ptr.data, rc->use_secondary_tex, - !ELEM(rc->subtype, PROP_NONE, PROP_PIXEL, PROP_DISTANCE)))) { + !ELEM(rc->subtype, PROP_NONE, PROP_PIXEL, PROP_DISTANCE)))) + { rc->texture = GPU_texture_create_2d("radial_control", ibuf->x, @@ -2336,8 +2338,9 @@ static void radial_control_paint_tex(RadialControl *rc, float radius, float alph PointerRNA *fill_ptr; PropertyRNA *fill_prop; - if (rc->fill_col_override_prop && RNA_property_boolean_get(&rc->fill_col_override_test_ptr, - rc->fill_col_override_test_prop)) { + if (rc->fill_col_override_prop && + RNA_property_boolean_get(&rc->fill_col_override_test_ptr, rc->fill_col_override_test_prop)) + { fill_ptr = &rc->fill_col_override_ptr; fill_prop = rc->fill_col_override_prop; } @@ -2631,7 +2634,8 @@ static int radial_control_get_path(PointerRNA *ctx_ptr, PropertyType prop_type = RNA_property_type(*r_prop); if (((flags & RC_PROP_REQUIRE_BOOL) && (prop_type != PROP_BOOLEAN)) || - ((flags & RC_PROP_REQUIRE_FLOAT) && (prop_type != PROP_FLOAT))) { + ((flags & RC_PROP_REQUIRE_FLOAT) && (prop_type != PROP_FLOAT))) + { MEM_freeN(str); BKE_reportf(op->reports, RPT_ERROR, "Property from path '%s' is not a float", name); return 0; @@ -2673,7 +2677,8 @@ static int radial_control_get_properties(bContext *C, wmOperator *op) &use_secondary_ptr, &use_secondary_prop, 0, - (RC_PROP_ALLOW_MISSING | RC_PROP_REQUIRE_BOOL))) { + (RC_PROP_ALLOW_MISSING | RC_PROP_REQUIRE_BOOL))) + { return 0; } @@ -2695,12 +2700,14 @@ static int radial_control_get_properties(bContext *C, wmOperator *op) } if (!radial_control_get_path( - &ctx_ptr, op, "rotation_path", &rc->rot_ptr, &rc->rot_prop, 0, RC_PROP_REQUIRE_FLOAT)) { + &ctx_ptr, op, "rotation_path", &rc->rot_ptr, &rc->rot_prop, 0, RC_PROP_REQUIRE_FLOAT)) + { return 0; } if (!radial_control_get_path( - &ctx_ptr, op, "color_path", &rc->col_ptr, &rc->col_prop, 4, RC_PROP_REQUIRE_FLOAT)) { + &ctx_ptr, op, "color_path", &rc->col_ptr, &rc->col_prop, 4, RC_PROP_REQUIRE_FLOAT)) + { return 0; } @@ -2710,7 +2717,8 @@ static int radial_control_get_properties(bContext *C, wmOperator *op) &rc->fill_col_ptr, &rc->fill_col_prop, 3, - RC_PROP_REQUIRE_FLOAT)) { + RC_PROP_REQUIRE_FLOAT)) + { return 0; } @@ -2720,7 +2728,8 @@ static int radial_control_get_properties(bContext *C, wmOperator *op) &rc->fill_col_override_ptr, &rc->fill_col_override_prop, 3, - RC_PROP_REQUIRE_FLOAT)) { + RC_PROP_REQUIRE_FLOAT)) + { return 0; } if (!radial_control_get_path(&ctx_ptr, @@ -2729,7 +2738,8 @@ static int radial_control_get_properties(bContext *C, wmOperator *op) &rc->fill_col_override_test_ptr, &rc->fill_col_override_test_prop, 0, - RC_PROP_REQUIRE_BOOL)) { + RC_PROP_REQUIRE_BOOL)) + { return 0; } @@ -2742,7 +2752,8 @@ static int radial_control_get_properties(bContext *C, wmOperator *op) &rc->zoom_ptr, &rc->zoom_prop, 2, - RC_PROP_REQUIRE_FLOAT | RC_PROP_ALLOW_MISSING)) { + RC_PROP_REQUIRE_FLOAT | RC_PROP_ALLOW_MISSING)) + { return 0; } @@ -2821,7 +2832,8 @@ static int radial_control_invoke(bContext *C, wmOperator *op, const wmEvent *eve PROP_FACTOR, PROP_PERCENTAGE, PROP_ANGLE, - PROP_PIXEL)) { + PROP_PIXEL)) + { BKE_report(op->reports, RPT_ERROR, "Property must be a none, distance, factor, percentage, angle, or pixel"); @@ -3085,7 +3097,8 @@ static int radial_control_modal(bContext *C, wmOperator *op, const wmEvent *even } if (!handled && (event->val == KM_RELEASE) && (rc->init_event == event->type) && - RNA_boolean_get(op->ptr, "release_confirm")) { + RNA_boolean_get(op->ptr, "release_confirm")) + { ret = OPERATOR_FINISHED; } diff --git a/source/blender/windowmanager/intern/wm_platform_support.c b/source/blender/windowmanager/intern/wm_platform_support.c index 60037f3ceb5..1d19c952f2e 100644 --- a/source/blender/windowmanager/intern/wm_platform_support.c +++ b/source/blender/windowmanager/intern/wm_platform_support.c @@ -109,7 +109,8 @@ bool WM_platform_support_perform_checks(void) /* Check if previous check matches the current check. Don't update the approval when running in * `background`. this could have been triggered by installing add-ons via installers. */ if (support_level != GPU_SUPPORT_LEVEL_UNSUPPORTED && !G.factory_startup && - wm_platform_support_check_approval(platform_key, !G.background)) { + wm_platform_support_check_approval(platform_key, !G.background)) + { /* If it matches the user has confirmed and wishes to use it. */ return result; } diff --git a/source/blender/windowmanager/intern/wm_splash_screen.c b/source/blender/windowmanager/intern/wm_splash_screen.c index f1fe742fde2..42164bf0029 100644 --- a/source/blender/windowmanager/intern/wm_splash_screen.c +++ b/source/blender/windowmanager/intern/wm_splash_screen.c @@ -139,7 +139,8 @@ static ImBuf *wm_block_splash_image(int width, int *r_height) char splash_filepath[FILE_MAX]; char template_directory[FILE_MAX]; if (BKE_appdir_app_template_id_search( - U.app_template, template_directory, sizeof(template_directory))) { + U.app_template, template_directory, sizeof(template_directory))) + { BLI_path_join(splash_filepath, sizeof(splash_filepath), template_directory, "splash.png"); ibuf = IMB_loadiffname(splash_filepath, IB_rect, NULL); } diff --git a/source/blender/windowmanager/intern/wm_stereo.c b/source/blender/windowmanager/intern/wm_stereo.c index c46160197d1..f249cac104c 100644 --- a/source/blender/windowmanager/intern/wm_stereo.c +++ b/source/blender/windowmanager/intern/wm_stereo.c @@ -275,7 +275,8 @@ int wm_stereo3d_set_exec(bContext *C, wmOperator *op) *win_src->stereo3d_format = s3dd->stereo3d_format; if (prev_display_mode == S3D_DISPLAY_PAGEFLIP && - prev_display_mode != win_src->stereo3d_format->display_mode) { + prev_display_mode != win_src->stereo3d_format->display_mode) + { /* in case the hardware supports pageflip but not the display */ if ((win_dst = wm_window_copy_test(C, win_src, false, false))) { /* pass */ diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index b742569738f..bab9fe40d84 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -523,7 +523,8 @@ void WM_toolsystem_refresh_active(bContext *C) /* Don't change the space type of the active tool, only update its mode. */ const int space_type_mask = (1 << area->spacetype); if ((space_type_mask & WM_TOOLSYSTEM_SPACE_MASK) && - ((space_type_mask_handled & space_type_mask) == 0)) { + ((space_type_mask_handled & space_type_mask) == 0)) + { space_type_mask_handled |= space_type_mask; const bToolKey tkey = { .space_type = area->spacetype, diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c index ae0411e38c7..017b1d86bba 100644 --- a/source/blender/windowmanager/intern/wm_window.c +++ b/source/blender/windowmanager/intern/wm_window.c @@ -388,7 +388,8 @@ void wm_quit_with_optional_confirmation_prompt(bContext *C, wmWindow *win) if (U.uiflag & USER_SAVE_PROMPT) { if (wm_file_or_session_data_has_unsaved_changes(CTX_data_main(C), CTX_wm_manager(C)) && - !G.background) { + !G.background) + { wm_window_raise(win); wm_confirm_quit(C); } diff --git a/source/blender/windowmanager/message_bus/intern/wm_message_bus.c b/source/blender/windowmanager/message_bus/intern/wm_message_bus.c index bf2107c3db3..a170469908a 100644 --- a/source/blender/windowmanager/message_bus/intern/wm_message_bus.c +++ b/source/blender/windowmanager/message_bus/intern/wm_message_bus.c @@ -68,8 +68,8 @@ void WM_msgbus_clear_by_owner(struct wmMsgBus *mbus, void *owner) msg_key_next = msg_key->next; wmMsgSubscribeValueLink *msg_lnk_next; - for (wmMsgSubscribeValueLink *msg_lnk = msg_key->values.first; msg_lnk; - msg_lnk = msg_lnk_next) { + for (wmMsgSubscribeValueLink *msg_lnk = msg_key->values.first; msg_lnk; msg_lnk = msg_lnk_next) + { msg_lnk_next = msg_lnk->next; if (msg_lnk->params.owner == owner) { if (msg_lnk->params.tag) { @@ -154,7 +154,8 @@ wmMsgSubscribeKey *WM_msg_subscribe_with_key(struct wmMsgBus *mbus, LISTBASE_FOREACH (wmMsgSubscribeValueLink *, msg_lnk, &key->values) { if ((msg_lnk->params.notify == msg_val_params->notify) && (msg_lnk->params.owner == msg_val_params->owner) && - (msg_lnk->params.user_data == msg_val_params->user_data)) { + (msg_lnk->params.user_data == msg_val_params->user_data)) + { return key; } } diff --git a/source/blender/windowmanager/message_bus/intern/wm_message_bus_rna.c b/source/blender/windowmanager/message_bus/intern/wm_message_bus_rna.c index e903ac11fba..661ef748a55 100644 --- a/source/blender/windowmanager/message_bus/intern/wm_message_bus_rna.c +++ b/source/blender/windowmanager/message_bus/intern/wm_message_bus_rna.c @@ -55,8 +55,8 @@ static void wm_msg_rna_gset_key_free(void *key_p) { wmMsgSubscribeKey_RNA *key = key_p; wmMsgSubscribeValueLink *msg_lnk_next; - for (wmMsgSubscribeValueLink *msg_lnk = key->head.values.first; msg_lnk; - msg_lnk = msg_lnk_next) { + for (wmMsgSubscribeValueLink *msg_lnk = key->head.values.first; msg_lnk; msg_lnk = msg_lnk_next) + { msg_lnk_next = msg_lnk->next; wm_msg_subscribe_value_free(&key->head, msg_lnk); } @@ -97,7 +97,8 @@ static void wm_msg_rna_update_by_id(struct wmMsgBus *mbus, ID *id_src, ID *id_ds /* Remove any non-persistent values, so a single persistent * value doesn't modify behavior for the rest. */ for (wmMsgSubscribeValueLink *msg_lnk = key->head.values.first, *msg_lnk_next; msg_lnk; - msg_lnk = msg_lnk_next) { + msg_lnk = msg_lnk_next) + { msg_lnk_next = msg_lnk->next; if (msg_lnk->params.is_persistent == false) { if (msg_lnk->params.tag) { @@ -125,7 +126,8 @@ static void wm_msg_rna_update_by_id(struct wmMsgBus *mbus, ID *id_src, ID *id_ds PointerRNA ptr; PropertyRNA *prop = NULL; if (RNA_path_resolve(&idptr, key->msg.params.data_path, &ptr, &prop) && - (prop == NULL) == (key->msg.params.prop == NULL)) { + (prop == NULL) == (key->msg.params.prop == NULL)) + { key->msg.params.ptr = ptr; key->msg.params.prop = prop; remove = false; @@ -134,7 +136,8 @@ static void wm_msg_rna_update_by_id(struct wmMsgBus *mbus, ID *id_src, ID *id_ds if (remove) { for (wmMsgSubscribeValueLink *msg_lnk = key->head.values.first, *msg_lnk_next; msg_lnk; - msg_lnk = msg_lnk_next) { + msg_lnk = msg_lnk_next) + { msg_lnk_next = msg_lnk->next; if (msg_lnk->params.is_persistent == false) { if (msg_lnk->params.tag) { @@ -169,7 +172,8 @@ static void wm_msg_rna_remove_by_id(struct wmMsgBus *mbus, const ID *id) if (key->msg.params.ptr.owner_id == id) { /* Clear here so we can decrement 'messages_tag_count'. */ for (wmMsgSubscribeValueLink *msg_lnk = key->head.values.first, *msg_lnk_next; msg_lnk; - msg_lnk = msg_lnk_next) { + msg_lnk = msg_lnk_next) + { msg_lnk_next = msg_lnk->next; if (msg_lnk->params.tag) { mbus->messages_tag_count -= 1; diff --git a/source/blender/windowmanager/xr/intern/wm_xr_action.c b/source/blender/windowmanager/xr/intern/wm_xr_action.c index 68f6bfc1aff..ee2dbc9ee3b 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_action.c +++ b/source/blender/windowmanager/xr/intern/wm_xr_action.c @@ -302,7 +302,8 @@ void WM_xr_action_destroy(wmXrData *xr, const char *action_set_name, const char if ((action_set->controller_grip_action && STREQ(action_set->controller_grip_action->name, action_name)) || (action_set->controller_aim_action && - STREQ(action_set->controller_aim_action->name, action_name))) { + STREQ(action_set->controller_aim_action->name, action_name))) + { if (action_set == xr->runtime->session_state.active_action_set) { wm_xr_session_controller_data_clear(&xr->runtime->session_state); } diff --git a/source/blender/windowmanager/xr/intern/wm_xr_draw.c b/source/blender/windowmanager/xr/intern/wm_xr_draw.c index 6cc9c8962dc..77f68144caf 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_draw.c +++ b/source/blender/windowmanager/xr/intern/wm_xr_draw.c @@ -196,7 +196,8 @@ static GPUBatch *wm_xr_controller_model_batch_create(GHOST_XrContextHandle xr_co GHOST_XrControllerModelData model_data; if (!GHOST_XrGetControllerModelData(xr_context, subaction_path, &model_data) || - model_data.count_vertices < 1) { + model_data.count_vertices < 1) + { return NULL; } @@ -259,7 +260,8 @@ static void wm_xr_controller_model_draw(const XrSessionSettings *settings, if (model && GHOST_XrGetControllerModelData(xr_context, controller->subaction_path, &model_data) && - model_data.count_components > 0) { + model_data.count_components > 0) + { GPU_batch_program_set_builtin(model, GPU_SHADER_3D_UNIFORM_COLOR); GPU_batch_uniform_4fv(model, "color", color); diff --git a/source/blender/windowmanager/xr/intern/wm_xr_operators.c b/source/blender/windowmanager/xr/intern/wm_xr_operators.c index 543e5782a5a..f17f6847ae4 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_operators.c +++ b/source/blender/windowmanager/xr/intern/wm_xr_operators.c @@ -474,8 +474,8 @@ static void wm_xr_navigation_grab_apply(wmXrData *xr, /* Limit scale to reasonable values. */ nav_scale = len_v3(out[0]); - if (!(nav_scale < xr->session_settings.clip_start || - nav_scale > xr->session_settings.clip_end)) { + if (!(nav_scale < xr->session_settings.clip_start || nav_scale > xr->session_settings.clip_end)) + { WM_xr_session_state_nav_location_set(xr, out[3]); if (!data->rot_lock) { mat4_to_quat(nav_pose.orientation_quat, out); diff --git a/source/blender/windowmanager/xr/intern/wm_xr_session.c b/source/blender/windowmanager/xr/intern/wm_xr_session.c index 64d687b956a..76a23fe0606 100644 --- a/source/blender/windowmanager/xr/intern/wm_xr_session.c +++ b/source/blender/windowmanager/xr/intern/wm_xr_session.c @@ -215,7 +215,8 @@ wmWindow *wm_xr_session_root_window_or_fallback_get(const wmWindowManager *wm, const wmXrRuntimeData *runtime_data) { if (runtime_data->session_root_win && - BLI_findindex(&wm->windows, runtime_data->session_root_win) != -1) { + BLI_findindex(&wm->windows, runtime_data->session_root_win) != -1) + { /* Root window is still valid, use it. */ return runtime_data->session_root_win; } @@ -436,7 +437,8 @@ bool WM_xr_session_state_controller_grip_location_get(const wmXrData *xr, float r_location[3]) { if (!WM_xr_session_is_ready(xr) || !xr->runtime->session_state.is_view_data_set || - (subaction_idx >= BLI_listbase_count(&xr->runtime->session_state.controllers))) { + (subaction_idx >= BLI_listbase_count(&xr->runtime->session_state.controllers))) + { zero_v3(r_location); return false; } @@ -453,7 +455,8 @@ bool WM_xr_session_state_controller_grip_rotation_get(const wmXrData *xr, float r_rotation[4]) { if (!WM_xr_session_is_ready(xr) || !xr->runtime->session_state.is_view_data_set || - (subaction_idx >= BLI_listbase_count(&xr->runtime->session_state.controllers))) { + (subaction_idx >= BLI_listbase_count(&xr->runtime->session_state.controllers))) + { unit_qt(r_rotation); return false; } @@ -470,7 +473,8 @@ bool WM_xr_session_state_controller_aim_location_get(const wmXrData *xr, float r_location[3]) { if (!WM_xr_session_is_ready(xr) || !xr->runtime->session_state.is_view_data_set || - (subaction_idx >= BLI_listbase_count(&xr->runtime->session_state.controllers))) { + (subaction_idx >= BLI_listbase_count(&xr->runtime->session_state.controllers))) + { zero_v3(r_location); return false; } @@ -487,7 +491,8 @@ bool WM_xr_session_state_controller_aim_rotation_get(const wmXrData *xr, float r_rotation[4]) { if (!WM_xr_session_is_ready(xr) || !xr->runtime->session_state.is_view_data_set || - (subaction_idx >= BLI_listbase_count(&xr->runtime->session_state.controllers))) { + (subaction_idx >= BLI_listbase_count(&xr->runtime->session_state.controllers))) + { unit_qt(r_rotation); return false; } @@ -729,7 +734,8 @@ static bool wm_xr_session_modal_action_test(const ListBase *active_modal_actions return true; } if (action->ot == active_modal_action->ot && - IDP_EqualsProperties(action->op_properties, active_modal_action->op_properties)) { + IDP_EqualsProperties(action->op_properties, active_modal_action->op_properties)) + { /* Don't allow duplicate modal operators since this can lead to unwanted modal handler * behavior. */ return false; @@ -847,12 +853,14 @@ static void wm_xr_session_action_states_interpret(wmXrData *xr, const float *state = &((float *)action->states)[subaction_idx]; float *state_prev = &((float *)action->states_prev)[subaction_idx]; if (test_float_state( - state, action->float_thresholds[subaction_idx], action->axis_flags[subaction_idx])) { + state, action->float_thresholds[subaction_idx], action->axis_flags[subaction_idx])) + { curr = true; } if (test_float_state(state_prev, action->float_thresholds[subaction_idx], - action->axis_flags[subaction_idx])) { + action->axis_flags[subaction_idx])) + { prev = true; } *state_prev = *state; @@ -861,14 +869,15 @@ static void wm_xr_session_action_states_interpret(wmXrData *xr, case XR_VECTOR2F_INPUT: { const float(*state)[2] = &((float(*)[2])action->states)[subaction_idx]; float(*state_prev)[2] = &((float(*)[2])action->states_prev)[subaction_idx]; - if (test_vec2f_state(*state, - action->float_thresholds[subaction_idx], - action->axis_flags[subaction_idx])) { + if (test_vec2f_state( + *state, action->float_thresholds[subaction_idx], action->axis_flags[subaction_idx])) + { curr = true; } if (test_vec2f_state(*state_prev, action->float_thresholds[subaction_idx], - action->axis_flags[subaction_idx])) { + action->axis_flags[subaction_idx])) + { prev = true; } copy_v2_v2(*state_prev, *state); @@ -893,7 +902,8 @@ static void wm_xr_session_action_states_interpret(wmXrData *xr, haptic_subaction_path, &action->haptic_duration, &action->haptic_frequency, - &action->haptic_amplitude)) { + &action->haptic_amplitude)) + { wm_xr_session_haptic_action_add( active_haptic_actions, action, haptic_subaction_path, time_now); } @@ -909,8 +919,8 @@ static void wm_xr_session_action_states_interpret(wmXrData *xr, wm_xr_session_modal_action_test_add(active_modal_actions, action); } if (haptic && ((action->haptic_flag & XR_HAPTIC_REPEAT) != 0)) { - if (!wm_xr_session_haptic_action_find( - active_haptic_actions, action, haptic_subaction_path)) { + if (!wm_xr_session_haptic_action_find(active_haptic_actions, action, haptic_subaction_path)) + { /* Apply haptics. */ if (WM_xr_haptic_action_apply(xr, action_set_name, @@ -918,7 +928,8 @@ static void wm_xr_session_action_states_interpret(wmXrData *xr, haptic_subaction_path, &action->haptic_duration, &action->haptic_frequency, - &action->haptic_amplitude)) { + &action->haptic_amplitude)) + { wm_xr_session_haptic_action_add( active_haptic_actions, action, haptic_subaction_path, time_now); } @@ -944,7 +955,8 @@ static void wm_xr_session_action_states_interpret(wmXrData *xr, haptic_subaction_path, &action->haptic_duration, &action->haptic_frequency, - &action->haptic_amplitude)) { + &action->haptic_amplitude)) + { wm_xr_session_haptic_action_add( active_haptic_actions, action, haptic_subaction_path, time_now); } @@ -986,7 +998,8 @@ static bool wm_xr_session_action_test_bimanual(const wmXrSessionState *session_s const float *state = &((float *)action->states)[*r_subaction_idx_other]; if (test_float_state(state, action->float_thresholds[*r_subaction_idx_other], - action->axis_flags[*r_subaction_idx_other])) { + action->axis_flags[*r_subaction_idx_other])) + { bimanual = true; } break; @@ -995,7 +1008,8 @@ static bool wm_xr_session_action_test_bimanual(const wmXrSessionState *session_s const float(*state)[2] = &((float(*)[2])action->states)[*r_subaction_idx_other]; if (test_vec2f_state(*state, action->float_thresholds[*r_subaction_idx_other], - action->axis_flags[*r_subaction_idx_other])) { + action->axis_flags[*r_subaction_idx_other])) + { bimanual = true; } break; @@ -1116,8 +1130,8 @@ static void wm_xr_session_events_dispatch(wmXrData *xr, const bool haptic = (GHOST_XrGetActionCustomdata( xr_context, action_set_name, action->haptic_name) != NULL); - for (uint subaction_idx = 0; subaction_idx < action->count_subaction_paths; - ++subaction_idx) { + for (uint subaction_idx = 0; subaction_idx < action->count_subaction_paths; ++subaction_idx) + { short val = KM_NOTHING; /* Interpret action states (update modal/haptic action lists, apply haptics, etc). */ diff --git a/source/creator/blender_launcher_win32.c b/source/creator/blender_launcher_win32.c index 49acc591487..4fb314596a5 100644 --- a/source/creator/blender_launcher_win32.c +++ b/source/creator/blender_launcher_win32.c @@ -110,7 +110,8 @@ int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PWSTR pCmdLine STRSAFE_NULL_ON_FAILURE, L"\"%s\" %s", path, - pCmdLine) != S_OK) { + pCmdLine) != S_OK) + { free(buffer); return -1; } diff --git a/source/creator/creator_args.c b/source/creator/creator_args.c index 0b34d8bb8ba..e30dd772675 100644 --- a/source/creator/creator_args.c +++ b/source/creator/creator_args.c @@ -149,8 +149,8 @@ static bool parse_int_range_relative(const char *str, const char **r_err_msg) { if (parse_int_relative(str, str_end_range, pos, neg, &r_value_range[0], r_err_msg) && - parse_int_relative( - str_end_range + 2, str_end_test, pos, neg, &r_value_range[1], r_err_msg)) { + parse_int_relative(str_end_range + 2, str_end_test, pos, neg, &r_value_range[1], r_err_msg)) + { return true; } return false; @@ -329,7 +329,8 @@ static int (*parse_int_range_relative_clamp_n(const char *str, parse_int_range_relative_clamp( str, str_end_range, str_end, pos, neg, min, max, values[i], r_err_msg) : parse_int_relative_clamp( - str, str_end, pos, neg, min, max, &values[i][0], r_err_msg)) { + str, str_end, pos, neg, min, max, &values[i][0], r_err_msg)) + { if (str_end_range == NULL) { values[i][1] = values[i][0]; } @@ -395,7 +396,8 @@ static void arg_py_context_restore(bContext *C, struct BlendePyContextStore *c_p /* script may load a file, check old data is valid before using */ if (c_py->has_win) { if ((c_py->win == NULL) || ((BLI_findindex(&G_MAIN->wm, c_py->wm) != -1) && - (BLI_findindex(&c_py->wm->windows, c_py->win) != -1))) { + (BLI_findindex(&c_py->wm->windows, c_py->win) != -1))) + { CTX_wm_window_set(C, c_py->win); } } @@ -1675,7 +1677,8 @@ static int arg_handle_render_frame(int argc, const char **argv, void *data) MINAFRAME, MAXFRAME, &frames_range_len, - &err_msg)) == NULL) { + &err_msg)) == NULL) + { fprintf(stderr, "\nError: %s '%s %s'.\n", err_msg, arg_id, argv[1]); return 1; } @@ -1774,7 +1777,8 @@ static int arg_handle_frame_start_set(int argc, const char **argv, void *data) MINAFRAME, MAXFRAME, &scene->r.sfra, - &err_msg)) { + &err_msg)) + { fprintf(stderr, "\nError: %s '%s %s'.\n", err_msg, arg_id, argv[1]); } else { @@ -1807,7 +1811,8 @@ static int arg_handle_frame_end_set(int argc, const char **argv, void *data) MINAFRAME, MAXFRAME, &scene->r.efra, - &err_msg)) { + &err_msg)) + { fprintf(stderr, "\nError: %s '%s %s'.\n", err_msg, arg_id, argv[1]); } else {