Cleanup: Various clang tidy changes
This commit is contained in:
parent
7ca4dcac5a
commit
21407901f8
|
@ -65,7 +65,7 @@ static FTC_CMapCache ftc_charmap_cache = nullptr;
|
|||
static ThreadMutex ft_lib_mutex;
|
||||
|
||||
/* May be set to #UI_widgetbase_draw_cache_flush. */
|
||||
static void (*blf_draw_cache_flush)(void) = nullptr;
|
||||
static void (*blf_draw_cache_flush)() = nullptr;
|
||||
|
||||
static ft_pix blf_font_height_max_ft_pix(FontBLF *font);
|
||||
static ft_pix blf_font_width_max_ft_pix(FontBLF *font);
|
||||
|
@ -1334,7 +1334,7 @@ void blf_font_exit()
|
|||
blf_batch_draw_exit();
|
||||
}
|
||||
|
||||
void BLF_cache_flush_set_fn(void (*cache_flush_fn)(void))
|
||||
void BLF_cache_flush_set_fn(void (*cache_flush_fn)())
|
||||
{
|
||||
blf_draw_cache_flush = cache_flush_fn;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ void BKE_cachefile_eval(struct Main *bmain,
|
|||
struct CacheFile *cache_file);
|
||||
|
||||
bool BKE_cachefile_filepath_get(const struct Main *bmain,
|
||||
const struct Depsgraph *depsgrah,
|
||||
const struct Depsgraph *depsgraph,
|
||||
const struct CacheFile *cache_file,
|
||||
char r_filepath[1024]);
|
||||
|
||||
|
|
|
@ -395,7 +395,7 @@ BMCustomDataCopyMap CustomData_bmesh_copy_map_calc(const CustomData &src,
|
|||
void CustomData_bmesh_copy_block(CustomData &dst_data,
|
||||
const BMCustomDataCopyMap &map,
|
||||
const void *src_block,
|
||||
void **dest_block);
|
||||
void **dst_block);
|
||||
|
||||
/**
|
||||
* Copies data of a single layer of a given type.
|
||||
|
|
|
@ -155,7 +155,7 @@ bool BKE_object_data_transfer_mesh(struct Depsgraph *depsgraph,
|
|||
int map_vert_mode,
|
||||
int map_edge_mode,
|
||||
int map_loop_mode,
|
||||
int map_poly_mode,
|
||||
int map_face_mode,
|
||||
struct SpaceTransform *space_transform,
|
||||
bool auto_transform,
|
||||
float max_distance,
|
||||
|
@ -177,7 +177,7 @@ bool BKE_object_data_transfer_ex(struct Depsgraph *depsgraph,
|
|||
int map_vert_mode,
|
||||
int map_edge_mode,
|
||||
int map_loop_mode,
|
||||
int map_poly_mode,
|
||||
int map_face_mode,
|
||||
struct SpaceTransform *space_transform,
|
||||
bool auto_transform,
|
||||
float max_distance,
|
||||
|
|
|
@ -485,7 +485,7 @@ bool BKE_mesh_validate_arrays(struct Mesh *mesh,
|
|||
int *corner_verts,
|
||||
int *corner_edges,
|
||||
unsigned int corners_num,
|
||||
int *face_offsets,
|
||||
const int *face_offsets,
|
||||
unsigned int faces_num,
|
||||
struct MDeformVert *dverts, /* assume totvert length */
|
||||
bool do_verbose,
|
||||
|
@ -498,7 +498,7 @@ bool BKE_mesh_validate_arrays(struct Mesh *mesh,
|
|||
* \returns is_valid.
|
||||
*/
|
||||
bool BKE_mesh_validate_all_customdata(struct CustomData *vert_data,
|
||||
uint totvert,
|
||||
uint verts_num,
|
||||
struct CustomData *edge_data,
|
||||
uint edges_num,
|
||||
struct CustomData *corner_data,
|
||||
|
|
|
@ -119,7 +119,7 @@ void BKE_mesh_vert_corner_tri_map_create(MeshElemMap **r_map,
|
|||
int **r_mem,
|
||||
int totvert,
|
||||
const blender::int3 *corner_tris,
|
||||
int tottris,
|
||||
int tris_num,
|
||||
const int *corner_verts,
|
||||
int corners_num);
|
||||
/**
|
||||
|
|
|
@ -21,8 +21,6 @@
|
|||
|
||||
#include "FN_field.hh"
|
||||
|
||||
#include "BLT_translation.h"
|
||||
|
||||
#include "CLG_log.h"
|
||||
|
||||
#include "attribute_access_intern.hh"
|
||||
|
|
|
@ -334,10 +334,10 @@ static std::shared_ptr<DictionaryValue> write_blob_shared_simple_gspan(
|
|||
const int size,
|
||||
const ImplicitSharingInfo **r_sharing_info)
|
||||
{
|
||||
const char *func = __func__;
|
||||
const std::optional<ImplicitSharingInfoAndData> sharing_info_and_data = blob_sharing.read_shared(
|
||||
io_data, [&]() -> std::optional<ImplicitSharingInfoAndData> {
|
||||
void *data_mem = MEM_mallocN_aligned(
|
||||
size * cpp_type.size(), cpp_type.alignment(), __func__);
|
||||
void *data_mem = MEM_mallocN_aligned(size * cpp_type.size(), cpp_type.alignment(), func);
|
||||
if (!read_blob_simple_gspan(blob_reader, io_data, {cpp_type, data_mem, size})) {
|
||||
MEM_freeN(data_mem);
|
||||
return std::nullopt;
|
||||
|
@ -378,7 +378,7 @@ template<typename T>
|
|||
const std::optional<StringRefNull> name = io_attribute->lookup_str("name");
|
||||
const std::optional<StringRefNull> domain_str = io_attribute->lookup_str("domain");
|
||||
const std::optional<StringRefNull> type_str = io_attribute->lookup_str("type");
|
||||
auto io_data = io_attribute->lookup_dict("data");
|
||||
const auto *io_data = io_attribute->lookup_dict("data");
|
||||
if (!name || !domain_str || !type_str || !io_data) {
|
||||
return false;
|
||||
}
|
||||
|
@ -479,7 +479,7 @@ static Curves *try_load_curves(const DictionaryValue &io_geometry,
|
|||
};
|
||||
|
||||
if (curves.curves_num() > 0) {
|
||||
const auto io_curve_offsets = io_curves->lookup_dict("curve_offsets");
|
||||
const auto *io_curve_offsets = io_curves->lookup_dict("curve_offsets");
|
||||
if (!io_curve_offsets) {
|
||||
return cancel();
|
||||
}
|
||||
|
@ -534,7 +534,7 @@ static Mesh *try_load_mesh(const DictionaryValue &io_geometry,
|
|||
};
|
||||
|
||||
if (mesh->faces_num > 0) {
|
||||
const auto io_poly_offsets = io_mesh->lookup_dict("poly_offsets");
|
||||
const auto *io_poly_offsets = io_mesh->lookup_dict("poly_offsets");
|
||||
if (!io_poly_offsets) {
|
||||
return cancel();
|
||||
}
|
||||
|
@ -594,7 +594,7 @@ static std::unique_ptr<Instances> try_load_instances(const DictionaryValue &io_g
|
|||
instances->add_reference(std::move(reference_geometry));
|
||||
}
|
||||
|
||||
const auto io_transforms = io_instances->lookup_dict("transforms");
|
||||
const auto *io_transforms = io_instances->lookup_dict("transforms");
|
||||
if (!io_transforms) {
|
||||
return {};
|
||||
}
|
||||
|
@ -602,7 +602,7 @@ static std::unique_ptr<Instances> try_load_instances(const DictionaryValue &io_g
|
|||
return {};
|
||||
}
|
||||
|
||||
const auto io_handles = io_instances->lookup_dict("handles");
|
||||
const auto *io_handles = io_instances->lookup_dict("handles");
|
||||
if (!io_handles) {
|
||||
return {};
|
||||
}
|
||||
|
@ -1031,9 +1031,7 @@ static std::unique_ptr<BakeItem> deserialize_bake_item(const DictionaryValue &io
|
|||
const io::serialize::StringValue &io_string = *io_data->get()->as_string_value();
|
||||
return std::make_unique<StringBakeItem>(io_string.value());
|
||||
}
|
||||
else if (const io::serialize::DictionaryValue *io_string =
|
||||
io_data->get()->as_dictionary_value())
|
||||
{
|
||||
if (const io::serialize::DictionaryValue *io_string = io_data->get()->as_dictionary_value()) {
|
||||
const std::optional<int64_t> size = io_string->lookup_int("size");
|
||||
if (!size) {
|
||||
return {};
|
||||
|
|
|
@ -269,11 +269,11 @@ static void data_transfer_mesh_attributes_transfer_active_color_string(
|
|||
{
|
||||
return;
|
||||
}
|
||||
else if ((data_type == CD_PROP_BYTE_COLOR) &&
|
||||
!BKE_id_attribute_search(&const_cast<ID &>(mesh_src->id),
|
||||
active_color_src,
|
||||
CD_MASK_PROP_BYTE_COLOR,
|
||||
ATTR_DOMAIN_MASK_COLOR))
|
||||
if ((data_type == CD_PROP_BYTE_COLOR) &&
|
||||
!BKE_id_attribute_search(&const_cast<ID &>(mesh_src->id),
|
||||
active_color_src,
|
||||
CD_MASK_PROP_BYTE_COLOR,
|
||||
ATTR_DOMAIN_MASK_COLOR))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
@ -320,11 +320,11 @@ static void data_transfer_mesh_attributes_transfer_default_color_string(
|
|||
{
|
||||
return;
|
||||
}
|
||||
else if ((data_type == CD_PROP_BYTE_COLOR) &&
|
||||
!BKE_id_attribute_search(&const_cast<ID &>(mesh_src->id),
|
||||
default_color_src,
|
||||
CD_MASK_PROP_BYTE_COLOR,
|
||||
ATTR_DOMAIN_MASK_COLOR))
|
||||
if ((data_type == CD_PROP_BYTE_COLOR) &&
|
||||
!BKE_id_attribute_search(&const_cast<ID &>(mesh_src->id),
|
||||
default_color_src,
|
||||
CD_MASK_PROP_BYTE_COLOR,
|
||||
ATTR_DOMAIN_MASK_COLOR))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -157,7 +157,7 @@ void BKE_editmesh_loop_tangent_calc(BMEditMesh *em,
|
|||
const char (*tangent_names)[MAX_CUSTOMDATA_LAYER_NAME],
|
||||
int tangent_names_len,
|
||||
const float (*face_normals)[3],
|
||||
const float (*loop_normals)[3],
|
||||
const float (*corner_normals)[3],
|
||||
const float (*vert_orco)[3],
|
||||
/* result */
|
||||
CustomData *loopdata_out,
|
||||
|
@ -257,7 +257,7 @@ void BKE_editmesh_loop_tangent_calc(BMEditMesh *em,
|
|||
mesh2tangent->precomputedFaceNormals = face_normals;
|
||||
/* NOTE: we assume we do have tessellated loop normals at this point
|
||||
* (in case it is object-enabled), have to check this is valid. */
|
||||
mesh2tangent->precomputedLoopNormals = loop_normals;
|
||||
mesh2tangent->precomputedLoopNormals = corner_normals;
|
||||
mesh2tangent->cd_loop_uv_offset = CustomData_get_n_offset(&bm->ldata, CD_PROP_FLOAT2, n);
|
||||
|
||||
/* needed for indexing loop-tangents */
|
||||
|
|
|
@ -174,9 +174,8 @@ std::optional<AttributeAccessor> GeometryFieldContext::attributes() const
|
|||
if (domain_ == AttrDomain::Layer) {
|
||||
return grease_pencil->attributes();
|
||||
}
|
||||
else if (const greasepencil::Drawing *drawing =
|
||||
greasepencil::get_eval_grease_pencil_layer_drawing(*grease_pencil,
|
||||
grease_pencil_layer_index_))
|
||||
if (const greasepencil::Drawing *drawing = greasepencil::get_eval_grease_pencil_layer_drawing(
|
||||
*grease_pencil, grease_pencil_layer_index_))
|
||||
{
|
||||
return drawing->strokes().attributes();
|
||||
}
|
||||
|
@ -380,7 +379,7 @@ GVArray AttributeFieldInput::get_varray_for_context(const GeometryFieldContext &
|
|||
if (domain == AttrDomain::Layer) {
|
||||
return *layer_attributes.lookup(name_, data_type);
|
||||
}
|
||||
else if (ELEM(domain, AttrDomain::Point, AttrDomain::Curve)) {
|
||||
if (ELEM(domain, AttrDomain::Point, AttrDomain::Curve)) {
|
||||
const int layer_index = context.grease_pencil_layer_index();
|
||||
const AttributeAccessor curves_attributes = *context.attributes();
|
||||
if (const GAttributeReader reader = curves_attributes.lookup(name_, domain, data_type)) {
|
||||
|
|
|
@ -305,8 +305,9 @@ Drawing::~Drawing()
|
|||
|
||||
Span<uint3> Drawing::triangles() const
|
||||
{
|
||||
const char *func = __func__;
|
||||
this->runtime->triangles_cache.ensure([&](Vector<uint3> &r_data) {
|
||||
MemArena *pf_arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, __func__);
|
||||
MemArena *pf_arena = BLI_memarena_new(BLI_MEMARENA_STD_BUFSIZE, func);
|
||||
|
||||
const CurvesGeometry &curves = this->strokes();
|
||||
const Span<float3> positions = curves.positions();
|
||||
|
@ -479,7 +480,7 @@ DrawingReference::DrawingReference(const DrawingReference &other)
|
|||
this->id_reference = other.id_reference;
|
||||
}
|
||||
|
||||
DrawingReference::~DrawingReference() {}
|
||||
DrawingReference::~DrawingReference() = default;
|
||||
|
||||
const Drawing *get_eval_grease_pencil_layer_drawing(const GreasePencil &grease_pencil,
|
||||
const int layer_index)
|
||||
|
@ -709,23 +710,24 @@ Layer::SortedKeysIterator Layer::remove_leading_null_frames_in_range(
|
|||
return next_it;
|
||||
}
|
||||
|
||||
GreasePencilFrame *Layer::add_frame_internal(const FramesMapKey key, const int drawing_index)
|
||||
GreasePencilFrame *Layer::add_frame_internal(const FramesMapKey frame_number,
|
||||
const int drawing_index)
|
||||
{
|
||||
BLI_assert(drawing_index != -1);
|
||||
if (!this->frames().contains(key)) {
|
||||
if (!this->frames().contains(frame_number)) {
|
||||
GreasePencilFrame frame{};
|
||||
frame.drawing_index = drawing_index;
|
||||
this->frames_for_write().add_new(key, frame);
|
||||
this->frames_for_write().add_new(frame_number, frame);
|
||||
this->tag_frames_map_keys_changed();
|
||||
return this->frames_for_write().lookup_ptr(key);
|
||||
return this->frames_for_write().lookup_ptr(frame_number);
|
||||
}
|
||||
/* Overwrite null-frames. */
|
||||
if (this->frames().lookup(key).is_null()) {
|
||||
if (this->frames().lookup(frame_number).is_null()) {
|
||||
GreasePencilFrame frame{};
|
||||
frame.drawing_index = drawing_index;
|
||||
this->frames_for_write().add_overwrite(key, frame);
|
||||
this->frames_for_write().add_overwrite(frame_number, frame);
|
||||
this->tag_frames_map_changed();
|
||||
return this->frames_for_write().lookup_ptr(key);
|
||||
return this->frames_for_write().lookup_ptr(frame_number);
|
||||
}
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -2232,9 +2234,9 @@ blender::IndexMask GreasePencil::layer_selection_by_name(const blender::StringRe
|
|||
|
||||
if (node->is_layer()) {
|
||||
const int index = *this->get_layer_index(node->as_layer());
|
||||
return blender::IndexMask::from_indices(Span{index}, memory);
|
||||
return blender::IndexMask::from_indices(blender::Span<int>{index}, memory);
|
||||
}
|
||||
else if (node->is_group()) {
|
||||
if (node->is_group()) {
|
||||
blender::Vector<int64_t> layer_indices;
|
||||
for (const int64_t layer_index : this->layers().index_range()) {
|
||||
const Layer &layer = *this->layers()[layer_index];
|
||||
|
@ -2344,7 +2346,7 @@ static void read_drawing_array(GreasePencil &grease_pencil, BlendDataReader *rea
|
|||
for (int i = 0; i < grease_pencil.drawing_array_num; i++) {
|
||||
BLO_read_data_address(reader, &grease_pencil.drawing_array[i]);
|
||||
GreasePencilDrawingBase *drawing_base = grease_pencil.drawing_array[i];
|
||||
switch (drawing_base->type) {
|
||||
switch (GreasePencilDrawingType(drawing_base->type)) {
|
||||
case GP_DRAWING: {
|
||||
GreasePencilDrawing *drawing = reinterpret_cast<GreasePencilDrawing *>(drawing_base);
|
||||
drawing->wrap().strokes_for_write().blend_read(*reader);
|
||||
|
@ -2368,7 +2370,7 @@ static void write_drawing_array(GreasePencil &grease_pencil, BlendWriter *writer
|
|||
BLO_write_pointer_array(writer, grease_pencil.drawing_array_num, grease_pencil.drawing_array);
|
||||
for (int i = 0; i < grease_pencil.drawing_array_num; i++) {
|
||||
GreasePencilDrawingBase *drawing_base = grease_pencil.drawing_array[i];
|
||||
switch (drawing_base->type) {
|
||||
switch (GreasePencilDrawingType(drawing_base->type)) {
|
||||
case GP_DRAWING: {
|
||||
GreasePencilDrawing *drawing = reinterpret_cast<GreasePencilDrawing *>(drawing_base);
|
||||
bke::CurvesGeometry::BlendWriteData write_data =
|
||||
|
@ -2394,7 +2396,7 @@ static void free_drawing_array(GreasePencil &grease_pencil)
|
|||
}
|
||||
for (int i = 0; i < grease_pencil.drawing_array_num; i++) {
|
||||
GreasePencilDrawingBase *drawing_base = grease_pencil.drawing_array[i];
|
||||
switch (drawing_base->type) {
|
||||
switch (GreasePencilDrawingType(drawing_base->type)) {
|
||||
case GP_DRAWING: {
|
||||
GreasePencilDrawing *drawing = reinterpret_cast<GreasePencilDrawing *>(drawing_base);
|
||||
MEM_delete(&drawing->wrap());
|
||||
|
|
|
@ -2752,7 +2752,7 @@ static void lib_override_resync_tagging_finalize_recurse(Main *bmain,
|
|||
BLI_assert(is_in_partial_resync_hierarchy);
|
||||
return;
|
||||
}
|
||||
else if (!is_in_partial_resync_hierarchy) {
|
||||
if (!is_in_partial_resync_hierarchy) {
|
||||
/* This ID is not tagged for resync, and is part of a loop where none of the other IDs are
|
||||
* tagged for resync, nothing else to do. */
|
||||
return;
|
||||
|
@ -2795,7 +2795,7 @@ static void lib_override_resync_tagging_finalize_recurse(Main *bmain,
|
|||
}
|
||||
/* Else, if it is not being processed as part of a resync hierarchy, nothing more to do either,
|
||||
* its current status and the one of its whole dependency tree is also assumed valid. */
|
||||
else if (!is_in_partial_resync_hierarchy) {
|
||||
if (!is_in_partial_resync_hierarchy) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -3619,13 +3619,11 @@ void BKE_lib_override_library_main_resync(Main *bmain,
|
|||
level_reprocess_count);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
CLOG_INFO(&LOG_RESYNC,
|
||||
4,
|
||||
"Applying reprocess %d for resyncing at library level %d",
|
||||
level_reprocess_count,
|
||||
library_indirect_level);
|
||||
}
|
||||
CLOG_INFO(&LOG_RESYNC,
|
||||
4,
|
||||
"Applying reprocess %d for resyncing at library level %d",
|
||||
level_reprocess_count,
|
||||
library_indirect_level);
|
||||
}
|
||||
library_indirect_level--;
|
||||
}
|
||||
|
|
|
@ -710,7 +710,7 @@ static bool lib_query_unused_ids_tag_recurse(Main *bmain,
|
|||
if ((id_relations->tags & MAINIDRELATIONS_ENTRY_TAGS_PROCESSED) != 0) {
|
||||
return false;
|
||||
}
|
||||
else if ((id_relations->tags & MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS) != 0) {
|
||||
if ((id_relations->tags & MAINIDRELATIONS_ENTRY_TAGS_INPROGRESS) != 0) {
|
||||
/* This ID has not yet been fully processed. If this condition is reached, it means this is a
|
||||
* dependency loop case. */
|
||||
return true;
|
||||
|
|
|
@ -756,7 +756,7 @@ Mesh *BKE_mesh_new_nomain_from_template_ex(const Mesh *me_src,
|
|||
const int edges_num,
|
||||
const int tessface_num,
|
||||
const int faces_num,
|
||||
const int loops_num,
|
||||
const int corners_num,
|
||||
const CustomData_MeshMasks mask)
|
||||
{
|
||||
/* Only do tessface if we are creating tessfaces or copying from mesh with only tessfaces. */
|
||||
|
@ -770,7 +770,7 @@ Mesh *BKE_mesh_new_nomain_from_template_ex(const Mesh *me_src,
|
|||
me_dst->verts_num = verts_num;
|
||||
me_dst->edges_num = edges_num;
|
||||
me_dst->faces_num = faces_num;
|
||||
me_dst->corners_num = loops_num;
|
||||
me_dst->corners_num = corners_num;
|
||||
me_dst->totface_legacy = tessface_num;
|
||||
|
||||
BKE_mesh_copy_parameters_for_eval(me_dst, me_src);
|
||||
|
@ -782,7 +782,7 @@ Mesh *BKE_mesh_new_nomain_from_template_ex(const Mesh *me_src,
|
|||
CustomData_copy_layout(
|
||||
&me_src->face_data, &me_dst->face_data, mask.pmask, CD_SET_DEFAULT, faces_num);
|
||||
CustomData_copy_layout(
|
||||
&me_src->corner_data, &me_dst->corner_data, mask.lmask, CD_SET_DEFAULT, loops_num);
|
||||
&me_src->corner_data, &me_dst->corner_data, mask.lmask, CD_SET_DEFAULT, corners_num);
|
||||
if (do_tessface) {
|
||||
CustomData_copy_layout(
|
||||
&me_src->fdata_legacy, &me_dst->fdata_legacy, mask.fmask, CD_SET_DEFAULT, tessface_num);
|
||||
|
@ -806,10 +806,10 @@ Mesh *BKE_mesh_new_nomain_from_template(const Mesh *me_src,
|
|||
const int verts_num,
|
||||
const int edges_num,
|
||||
const int faces_num,
|
||||
const int loops_num)
|
||||
const int corners_num)
|
||||
{
|
||||
return BKE_mesh_new_nomain_from_template_ex(
|
||||
me_src, verts_num, edges_num, 0, faces_num, loops_num, CD_MASK_EVERYTHING);
|
||||
me_src, verts_num, edges_num, 0, faces_num, corners_num, CD_MASK_EVERYTHING);
|
||||
}
|
||||
|
||||
void BKE_mesh_eval_delete(Mesh *mesh_eval)
|
||||
|
|
|
@ -192,7 +192,7 @@ void BKE_mesh_vert_corner_tri_map_create(MeshElemMap **r_map,
|
|||
const blender::int3 *corner_tris,
|
||||
const int tris_num,
|
||||
const int *corner_verts,
|
||||
const int /*totloop*/)
|
||||
const int /*corners_num*/)
|
||||
{
|
||||
MeshElemMap *map = MEM_cnew_array<MeshElemMap>(size_t(totvert), __func__);
|
||||
int *indices = static_cast<int *>(MEM_mallocN(sizeof(int) * size_t(tris_num) * 3, __func__));
|
||||
|
@ -407,9 +407,9 @@ GroupedSpan<int> build_vert_to_edge_map(const Span<int2> edges,
|
|||
void build_vert_to_face_indices(const OffsetIndices<int> faces,
|
||||
const Span<int> corner_verts,
|
||||
const OffsetIndices<int> offsets,
|
||||
MutableSpan<int> r_indices)
|
||||
MutableSpan<int> face_indices)
|
||||
{
|
||||
reverse_group_indices_in_groups(faces, corner_verts, offsets, r_indices);
|
||||
reverse_group_indices_in_groups(faces, corner_verts, offsets, face_indices);
|
||||
}
|
||||
|
||||
GroupedSpan<int> build_vert_to_face_map(const OffsetIndices<int> faces,
|
||||
|
@ -822,7 +822,7 @@ static bool mesh_calc_islands_loop_face_uv(const int totedge,
|
|||
const blender::OffsetIndices<int> faces,
|
||||
const int *corner_verts,
|
||||
const int *corner_edges,
|
||||
const int totloop,
|
||||
const int corners_num,
|
||||
const float (*luvs)[2],
|
||||
MeshIslandStore *r_island_store)
|
||||
{
|
||||
|
@ -847,19 +847,19 @@ static bool mesh_calc_islands_loop_face_uv(const int totedge,
|
|||
|
||||
BKE_mesh_loop_islands_clear(r_island_store);
|
||||
BKE_mesh_loop_islands_init(
|
||||
r_island_store, MISLAND_TYPE_LOOP, totloop, MISLAND_TYPE_POLY, MISLAND_TYPE_EDGE);
|
||||
r_island_store, MISLAND_TYPE_LOOP, corners_num, MISLAND_TYPE_POLY, MISLAND_TYPE_EDGE);
|
||||
|
||||
Array<int> edge_to_face_offsets;
|
||||
Array<int> edge_to_face_indices;
|
||||
const GroupedSpan<int> edge_to_face_map = bke::mesh::build_edge_to_face_map(
|
||||
faces, {corner_edges, totloop}, totedge, edge_to_face_offsets, edge_to_face_indices);
|
||||
faces, {corner_edges, corners_num}, totedge, edge_to_face_offsets, edge_to_face_indices);
|
||||
|
||||
Array<int> edge_to_loop_offsets;
|
||||
Array<int> edge_to_loop_indices;
|
||||
GroupedSpan<int> edge_to_loop_map;
|
||||
if (luvs) {
|
||||
edge_to_loop_map = bke::mesh::build_edge_to_corner_map(
|
||||
{corner_edges, totloop}, totedge, edge_to_loop_offsets, edge_to_loop_indices);
|
||||
{corner_edges, corners_num}, totedge, edge_to_loop_offsets, edge_to_loop_indices);
|
||||
}
|
||||
|
||||
/* TODO: I'm not sure edge seam flag is enough to define UV islands?
|
||||
|
@ -909,7 +909,7 @@ static bool mesh_calc_islands_loop_face_uv(const int totedge,
|
|||
|
||||
face_edge_loop_islands_calc(totedge,
|
||||
faces,
|
||||
{corner_edges, totloop},
|
||||
{corner_edges, corners_num},
|
||||
edge_to_face_map,
|
||||
false,
|
||||
mesh_check_island_boundary_uv,
|
||||
|
@ -935,7 +935,7 @@ static bool mesh_calc_islands_loop_face_uv(const int totedge,
|
|||
face_indices = static_cast<int *>(
|
||||
MEM_mallocN(sizeof(*face_indices) * size_t(faces.size()), __func__));
|
||||
loop_indices = static_cast<int *>(
|
||||
MEM_mallocN(sizeof(*loop_indices) * size_t(totloop), __func__));
|
||||
MEM_mallocN(sizeof(*loop_indices) * size_t(corners_num), __func__));
|
||||
|
||||
/* NOTE: here we ignore '0' invalid group - this should *never* happen in this case anyway? */
|
||||
for (grp_idx = 1; grp_idx <= num_face_groups; grp_idx++) {
|
||||
|
@ -996,12 +996,12 @@ bool BKE_mesh_calc_islands_loop_face_edgeseam(const float (*vert_positions)[3],
|
|||
const blender::OffsetIndices<int> faces,
|
||||
const int *corner_verts,
|
||||
const int *corner_edges,
|
||||
const int totloop,
|
||||
const int corners_num,
|
||||
MeshIslandStore *r_island_store)
|
||||
{
|
||||
UNUSED_VARS(vert_positions, totvert, edges);
|
||||
return mesh_calc_islands_loop_face_uv(
|
||||
totedge, uv_seams, faces, corner_verts, corner_edges, totloop, nullptr, r_island_store);
|
||||
totedge, uv_seams, faces, corner_verts, corner_edges, corners_num, nullptr, r_island_store);
|
||||
}
|
||||
|
||||
bool BKE_mesh_calc_islands_loop_face_uvmap(float (*vert_positions)[3],
|
||||
|
@ -1012,14 +1012,14 @@ bool BKE_mesh_calc_islands_loop_face_uvmap(float (*vert_positions)[3],
|
|||
const blender::OffsetIndices<int> faces,
|
||||
const int *corner_verts,
|
||||
const int *corner_edges,
|
||||
const int totloop,
|
||||
const int corners_num,
|
||||
const float (*luvs)[2],
|
||||
MeshIslandStore *r_island_store)
|
||||
{
|
||||
UNUSED_VARS(vert_positions, totvert, edges);
|
||||
BLI_assert(luvs != nullptr);
|
||||
return mesh_calc_islands_loop_face_uv(
|
||||
totedge, uv_seams, faces, corner_verts, corner_edges, totloop, luvs, r_island_store);
|
||||
totedge, uv_seams, faces, corner_verts, corner_edges, corners_num, luvs, r_island_store);
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
|
@ -62,7 +62,7 @@ static void free_batch_cache(MeshRuntime &mesh_runtime)
|
|||
}
|
||||
}
|
||||
|
||||
MeshRuntime::MeshRuntime() {}
|
||||
MeshRuntime::MeshRuntime() = default;
|
||||
|
||||
MeshRuntime::~MeshRuntime()
|
||||
{
|
||||
|
|
|
@ -200,7 +200,7 @@ static void sample_nearest_weights(const Span<float3> vert_positions,
|
|||
|
||||
int sample_surface_points_spherical(RandomNumberGenerator &rng,
|
||||
const Mesh &mesh,
|
||||
const Span<int> tri_indices_to_sample,
|
||||
const Span<int> tris_to_sample,
|
||||
const float3 &sample_pos,
|
||||
const float sample_radius,
|
||||
const float approximate_density,
|
||||
|
@ -219,7 +219,7 @@ int sample_surface_points_spherical(RandomNumberGenerator &rng,
|
|||
|
||||
const int old_num = r_bary_coords.size();
|
||||
|
||||
for (const int tri_index : tri_indices_to_sample) {
|
||||
for (const int tri_index : tris_to_sample) {
|
||||
const int3 &tri = corner_tris[tri_index];
|
||||
|
||||
const float3 &v0 = positions[corner_verts[tri[0]]];
|
||||
|
|
|
@ -221,7 +221,7 @@ bool BKE_mesh_validate_arrays(Mesh *mesh,
|
|||
int *corner_verts,
|
||||
int *corner_edges,
|
||||
uint corners_num,
|
||||
int *face_offsets,
|
||||
const int *face_offsets,
|
||||
uint faces_num,
|
||||
MDeformVert *dverts, /* assume verts_num length */
|
||||
const bool do_verbose,
|
||||
|
|
|
@ -166,7 +166,7 @@ class bNodeTreeToDotOptionsForAnonymousAttributeInferencing : public bNodeTreeTo
|
|||
{
|
||||
}
|
||||
|
||||
std::string socket_name(const bNodeSocket &socket) const
|
||||
std::string socket_name(const bNodeSocket &socket) const override
|
||||
{
|
||||
if (socket.type == SOCK_GEOMETRY) {
|
||||
std::stringstream ss;
|
||||
|
@ -180,7 +180,7 @@ class bNodeTreeToDotOptionsForAnonymousAttributeInferencing : public bNodeTreeTo
|
|||
ss << "]";
|
||||
return ss.str();
|
||||
}
|
||||
else if (nodes::socket_type_supports_fields(eNodeSocketDatatype(socket.type))) {
|
||||
if (nodes::socket_type_supports_fields(eNodeSocketDatatype(socket.type))) {
|
||||
std::stringstream ss;
|
||||
ss << socket.identifier << " [";
|
||||
bits::foreach_1_index(result_.propagated_fields_by_socket[socket.index_in_tree()],
|
||||
|
@ -699,7 +699,7 @@ bool update_anonymous_attribute_relations(bNodeTree &tree)
|
|||
tree.ensure_topology_cache();
|
||||
|
||||
if (tree.has_available_link_cycle()) {
|
||||
const bool changed = tree.runtime->anonymous_attribute_inferencing.get() != nullptr;
|
||||
const bool changed = bool(tree.runtime->anonymous_attribute_inferencing);
|
||||
tree.runtime->anonymous_attribute_inferencing.reset();
|
||||
return changed;
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ typedef struct BoxPack {
|
|||
* \param r_tot_x, r_tot_y: set so you can normalize the data.
|
||||
*/
|
||||
void BLI_box_pack_2d(
|
||||
BoxPack *box_array, unsigned int len, bool sort_boxes, float *r_tot_x, float *r_tot_y);
|
||||
BoxPack *boxarray, unsigned int len, bool sort_boxes, float *r_tot_x, float *r_tot_y);
|
||||
|
||||
typedef struct FixedSizeBoxPack {
|
||||
struct FixedSizeBoxPack *next, *prev;
|
||||
|
|
|
@ -128,7 +128,10 @@ float volume_tri_tetrahedron_signed_v3(const float v1[3], const float v2[3], con
|
|||
* (depends on face winding)
|
||||
* Copied from BM_edge_is_convex().
|
||||
*/
|
||||
bool is_edge_convex_v3(const float v1[3], const float v2[3], const float v3[3], const float v4[3]);
|
||||
bool is_edge_convex_v3(const float v1[3],
|
||||
const float v2[3],
|
||||
const float f1_no[3],
|
||||
const float f2_no[3]);
|
||||
/**
|
||||
* Evaluate if entire quad is a proper convex quad
|
||||
*/
|
||||
|
@ -759,7 +762,7 @@ bool isect_ray_tri_watertight_v3(const float ray_origin[3],
|
|||
const float v0[3],
|
||||
const float v1[3],
|
||||
const float v2[3],
|
||||
float *r_dist,
|
||||
float *r_lambda,
|
||||
float r_uv[2]);
|
||||
/**
|
||||
* Slower version which calculates #IsectRayPrecalc each time.
|
||||
|
|
|
@ -39,9 +39,9 @@ void BLI_mempool_free(BLI_mempool *pool, void *addr) ATTR_NONNULL(1, 2);
|
|||
* Empty the pool, as if it were just created.
|
||||
*
|
||||
* \param pool: The pool to clear.
|
||||
* \param totelem_reserve: Optionally reserve how many items should be kept from clearing.
|
||||
* \param elem_num_reserve: Optionally reserve how many items should be kept from clearing.
|
||||
*/
|
||||
void BLI_mempool_clear_ex(BLI_mempool *pool, int totelem_reserve) ATTR_NONNULL(1);
|
||||
void BLI_mempool_clear_ex(BLI_mempool *pool, int elem_num_reserve) ATTR_NONNULL(1);
|
||||
/**
|
||||
* Wrap #BLI_mempool_clear_ex with no reserve set.
|
||||
*/
|
||||
|
|
|
@ -177,7 +177,7 @@ void build_reverse_map(OffsetIndices<int> offsets, MutableSpan<int> r_map);
|
|||
/**
|
||||
* Build offsets to group the elements of \a indices pointing to the same index.
|
||||
*/
|
||||
void build_reverse_offsets(Span<int> indices, MutableSpan<int> r_map);
|
||||
void build_reverse_offsets(Span<int> indices, MutableSpan<int> offsets);
|
||||
|
||||
} // namespace blender::offset_indices
|
||||
|
||||
|
|
|
@ -807,10 +807,8 @@ void *mempool_iter_threadsafe_step(BLI_mempool_threadsafe_iter *ts_iter)
|
|||
mempool_asan_unlock(iter->pool);
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
mempool_asan_unlock(iter->pool);
|
||||
return ret;
|
||||
}
|
||||
mempool_asan_unlock(iter->pool);
|
||||
return ret;
|
||||
}
|
||||
/* End `threadsafe` exception. */
|
||||
|
||||
|
@ -824,10 +822,8 @@ void *mempool_iter_threadsafe_step(BLI_mempool_threadsafe_iter *ts_iter)
|
|||
mempool_asan_unlock(iter->pool);
|
||||
return NULL;
|
||||
}
|
||||
else {
|
||||
mempool_asan_unlock(iter->pool);
|
||||
return ret;
|
||||
}
|
||||
mempool_asan_unlock(iter->pool);
|
||||
return ret;
|
||||
}
|
||||
|
||||
curnode = CHUNK_DATA(iter->curchunk);
|
||||
|
|
|
@ -102,6 +102,8 @@
|
|||
/* Only for #BLI_array_store_is_valid. */
|
||||
#include "BLI_ghash.h"
|
||||
|
||||
struct BChunkList;
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name Defines
|
||||
*
|
||||
|
@ -236,9 +238,9 @@
|
|||
/** \name Internal Structs
|
||||
* \{ */
|
||||
|
||||
typedef uint32_t hash_key;
|
||||
using hash_key = uint32_t;
|
||||
|
||||
typedef struct BArrayInfo {
|
||||
struct BArrayInfo {
|
||||
size_t chunk_stride;
|
||||
// uint chunk_count; /* UNUSED (other values are derived from this) */
|
||||
|
||||
|
@ -256,13 +258,13 @@ typedef struct BArrayInfo {
|
|||
size_t accum_steps;
|
||||
size_t accum_read_ahead_len;
|
||||
#endif
|
||||
} BArrayInfo;
|
||||
};
|
||||
|
||||
typedef struct BArrayMemory {
|
||||
struct BArrayMemory {
|
||||
BLI_mempool *chunk_list; /* #BChunkList. */
|
||||
BLI_mempool *chunk_ref; /* #BChunkRef. */
|
||||
BLI_mempool *chunk; /* #BChunk. */
|
||||
} BArrayMemory;
|
||||
};
|
||||
|
||||
/**
|
||||
* Main storage for all states.
|
||||
|
@ -294,10 +296,10 @@ struct BArrayState {
|
|||
/** linked list in #BArrayStore.states. */
|
||||
BArrayState *next, *prev;
|
||||
/** Shared chunk list, this reference must hold a #BChunkList::users. */
|
||||
struct BChunkList *chunk_list;
|
||||
BChunkList *chunk_list;
|
||||
};
|
||||
|
||||
typedef struct BChunkList {
|
||||
struct BChunkList {
|
||||
/** List of #BChunkRef's. */
|
||||
ListBase chunk_refs;
|
||||
/** Result of `BLI_listbase_count(chunks)`, store for reuse. */
|
||||
|
@ -307,10 +309,10 @@ typedef struct BChunkList {
|
|||
|
||||
/** Number of #BArrayState using this. */
|
||||
int users;
|
||||
} BChunkList;
|
||||
};
|
||||
|
||||
/** A chunk of memory in an array (unit of de-duplication). */
|
||||
typedef struct BChunk {
|
||||
struct BChunk {
|
||||
const uchar *data;
|
||||
size_t data_len;
|
||||
/** number of #BChunkList using this. */
|
||||
|
@ -319,15 +321,15 @@ typedef struct BChunk {
|
|||
#ifdef USE_HASH_TABLE_KEY_CACHE
|
||||
hash_key key;
|
||||
#endif
|
||||
} BChunk;
|
||||
};
|
||||
|
||||
/**
|
||||
* Links to store #BChunk data in #BChunkList.chunk_refs.
|
||||
*/
|
||||
typedef struct BChunkRef {
|
||||
struct BChunkRef {
|
||||
BChunkRef *next, *prev;
|
||||
BChunk *link;
|
||||
} BChunkRef;
|
||||
};
|
||||
|
||||
/**
|
||||
* Single linked list used when putting chunks into a temporary table,
|
||||
|
@ -337,10 +339,10 @@ typedef struct BChunkRef {
|
|||
* to allow talking down the chunks in-order until a mismatch is found,
|
||||
* this avoids having to do so many table lookups.
|
||||
*/
|
||||
typedef struct BTableRef {
|
||||
struct BTableRef {
|
||||
BTableRef *next;
|
||||
const BChunkRef *cref;
|
||||
} BTableRef;
|
||||
};
|
||||
|
||||
/** \} */
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* \ingroup bli
|
||||
*/
|
||||
|
||||
#include <math.h>
|
||||
#include <string.h>
|
||||
#include <cmath>
|
||||
#include <cstring>
|
||||
|
||||
#include "BLI_math_base.h"
|
||||
#include "BLI_math_interp.hh"
|
||||
|
|
|
@ -556,9 +556,7 @@ float perlin_fbm(
|
|||
return normalize ? mix(0.5f * sum / maxamp + 0.5f, 0.5f * sum2 / (maxamp + amp) + 0.5f, rmd) :
|
||||
mix(sum, sum2, rmd);
|
||||
}
|
||||
else {
|
||||
return normalize ? 0.5f * sum / maxamp + 0.5f : sum;
|
||||
}
|
||||
return normalize ? 0.5f * sum / maxamp + 0.5f : sum;
|
||||
}
|
||||
|
||||
/* Explicit instantiation for Wave Texture. */
|
||||
|
@ -1909,7 +1907,7 @@ VoronoiOutput fractal_voronoi_x_fx(const VoronoiParams ¶ms,
|
|||
output = octave;
|
||||
break;
|
||||
}
|
||||
else if (i <= params.detail) {
|
||||
if (i <= params.detail) {
|
||||
max_amplitude += amplitude;
|
||||
output.distance += octave.distance * amplitude;
|
||||
output.color += octave.color * amplitude;
|
||||
|
@ -1960,7 +1958,7 @@ float fractal_voronoi_distance_to_edge(const VoronoiParams ¶ms, const T coor
|
|||
distance = octave_distance;
|
||||
break;
|
||||
}
|
||||
else if (i <= params.detail) {
|
||||
if (i <= params.detail) {
|
||||
max_amplitude = mix(max_amplitude, params.max_distance / scale, amplitude);
|
||||
distance = mix(distance, math::min(distance, octave_distance / scale), amplitude);
|
||||
scale *= params.lacunarity;
|
||||
|
|
|
@ -882,15 +882,15 @@ bool BLI_path_parent_dir(char *path)
|
|||
return true;
|
||||
}
|
||||
|
||||
bool BLI_path_parent_dir_until_exists(char *dir)
|
||||
bool BLI_path_parent_dir_until_exists(char *path)
|
||||
{
|
||||
bool valid_path = true;
|
||||
|
||||
/* Loop as long as cur path is not a dir, and we can get a parent path. */
|
||||
while ((BLI_access(dir, R_OK) != 0) && (valid_path = BLI_path_parent_dir(dir))) {
|
||||
while ((BLI_access(path, R_OK) != 0) && (valid_path = BLI_path_parent_dir(path))) {
|
||||
/* Pass. */
|
||||
}
|
||||
return (valid_path && dir[0]);
|
||||
return (valid_path && path[0]);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -430,9 +430,9 @@ int BLI_stat(const char *path, struct stat *buffer)
|
|||
}
|
||||
#endif
|
||||
|
||||
bool BLI_is_dir(const char *file)
|
||||
bool BLI_is_dir(const char *path)
|
||||
{
|
||||
return S_ISDIR(BLI_exists(file));
|
||||
return S_ISDIR(BLI_exists(path));
|
||||
}
|
||||
|
||||
bool BLI_is_file(const char *path)
|
||||
|
|
|
@ -96,15 +96,15 @@ void BLI_string_replace_char(char *str, char src, char dst)
|
|||
}
|
||||
|
||||
bool BLI_string_replace_table_exact(char *string,
|
||||
const size_t string_maxncpy,
|
||||
const size_t string_len,
|
||||
const char *replace_table[][2],
|
||||
int replace_table_len)
|
||||
{
|
||||
BLI_string_debug_size_after_nil(string, string_maxncpy);
|
||||
BLI_string_debug_size_after_nil(string, string_len);
|
||||
|
||||
for (int i = 0; i < replace_table_len; i++) {
|
||||
if (STREQ(string, replace_table[i][0])) {
|
||||
BLI_strncpy(string, replace_table[i][1], string_maxncpy);
|
||||
BLI_strncpy(string, replace_table[i][1], string_len);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -731,17 +731,17 @@ static uiBlock *wm_block_insert_unicode_create(bContext *C, ARegion *region, voi
|
|||
|
||||
if (windows_layout) {
|
||||
confirm = uiDefIconTextBut(
|
||||
block, UI_BTYPE_BUT, 0, 0, "Insert", 0, 0, 0, UI_UNIT_Y, 0, 0, 0, 0, 0, nullptr);
|
||||
block, UI_BTYPE_BUT, 0, 0, "Insert", 0, 0, 0, UI_UNIT_Y, nullptr, 0, 0, 0, 0, nullptr);
|
||||
uiLayoutColumn(split, false);
|
||||
}
|
||||
|
||||
cancel = uiDefIconTextBut(
|
||||
block, UI_BTYPE_BUT, 0, 0, "Cancel", 0, 0, 0, UI_UNIT_Y, 0, 0, 0, 0, 0, nullptr);
|
||||
block, UI_BTYPE_BUT, 0, 0, "Cancel", 0, 0, 0, UI_UNIT_Y, nullptr, 0, 0, 0, 0, nullptr);
|
||||
|
||||
if (!windows_layout) {
|
||||
uiLayoutColumn(split, false);
|
||||
confirm = uiDefIconTextBut(
|
||||
block, UI_BTYPE_BUT, 0, 0, "Insert", 0, 0, 0, UI_UNIT_Y, 0, 0, 0, 0, 0, nullptr);
|
||||
block, UI_BTYPE_BUT, 0, 0, "Insert", 0, 0, 0, UI_UNIT_Y, nullptr, 0, 0, 0, 0, nullptr);
|
||||
}
|
||||
|
||||
UI_block_func_set(block, nullptr, nullptr, nullptr);
|
||||
|
|
|
@ -532,12 +532,12 @@ void ED_mesh_faces_remove(Mesh *mesh, ReportList *reports, int count);
|
|||
|
||||
void ED_mesh_geometry_clear(Mesh *mesh);
|
||||
|
||||
bool *ED_mesh_uv_map_vert_select_layer_ensure(Mesh *mesh, int uv_map_index);
|
||||
bool *ED_mesh_uv_map_edge_select_layer_ensure(Mesh *mesh, int uv_map_index);
|
||||
bool *ED_mesh_uv_map_pin_layer_ensure(Mesh *mesh, int uv_map_index);
|
||||
const bool *ED_mesh_uv_map_vert_select_layer_get(const Mesh *mesh, int uv_map_index);
|
||||
const bool *ED_mesh_uv_map_edge_select_layer_get(const Mesh *mesh, int uv_map_index);
|
||||
const bool *ED_mesh_uv_map_pin_layer_get(const Mesh *mesh, int uv_map_index);
|
||||
bool *ED_mesh_uv_map_vert_select_layer_ensure(Mesh *mesh, int uv_index);
|
||||
bool *ED_mesh_uv_map_edge_select_layer_ensure(Mesh *mesh, int uv_index);
|
||||
bool *ED_mesh_uv_map_pin_layer_ensure(Mesh *mesh, int uv_index);
|
||||
const bool *ED_mesh_uv_map_vert_select_layer_get(const Mesh *mesh, int uv_index);
|
||||
const bool *ED_mesh_uv_map_edge_select_layer_get(const Mesh *mesh, int uv_index);
|
||||
const bool *ED_mesh_uv_map_pin_layer_get(const Mesh *mesh, int uv_index);
|
||||
|
||||
void ED_mesh_uv_ensure(Mesh *mesh, const char *name);
|
||||
int ED_mesh_uv_add(
|
||||
|
|
|
@ -90,8 +90,8 @@ bool ED_transform_snap_object_project_ray(SnapObjectContext *sctx,
|
|||
Depsgraph *depsgraph,
|
||||
const View3D *v3d,
|
||||
const SnapObjectParams *params,
|
||||
const float ray_origin[3],
|
||||
const float ray_direction[3],
|
||||
const float ray_start[3],
|
||||
const float ray_normal[3],
|
||||
float *ray_depth,
|
||||
float r_co[3],
|
||||
float r_no[3]);
|
||||
|
|
|
@ -96,7 +96,7 @@ void ED_slider_factor_bounds_set(tSlider *slider, float lower_bound, float upper
|
|||
bool ED_slider_allow_increments_get(tSlider *slider);
|
||||
void ED_slider_allow_increments_set(tSlider *slider, bool value);
|
||||
|
||||
void ED_slider_mode_set(tSlider *slider, SliderMode unit);
|
||||
void ED_slider_mode_set(tSlider *slider, SliderMode mode);
|
||||
SliderMode ED_slider_mode_get(tSlider *slider);
|
||||
void ED_slider_unit_set(tSlider *slider, const char *unit);
|
||||
|
||||
|
|
|
@ -7238,7 +7238,7 @@ static void uiTemplateRecentFiles_tooltip_func(bContext * /*C*/, uiTooltipData *
|
|||
if (BLI_stat(path, &status) != -1) {
|
||||
char date_st[FILELIST_DIRENTRY_DATE_LEN], time_st[FILELIST_DIRENTRY_TIME_LEN];
|
||||
bool is_today, is_yesterday;
|
||||
std::string day_string = ("");
|
||||
std::string day_string;
|
||||
BLI_filelist_entry_datetime_to_string(
|
||||
nullptr, int64_t(status.st_mtime), false, time_st, date_st, &is_today, &is_yesterday);
|
||||
if (is_today || is_yesterday) {
|
||||
|
|
|
@ -14,7 +14,6 @@
|
|||
#include "DNA_windowmanager_types.h"
|
||||
|
||||
#ifdef WITH_FREESTYLE
|
||||
# include "BKE_customdata.hh"
|
||||
# include "DNA_meshdata_types.h"
|
||||
#endif
|
||||
|
||||
|
|
|
@ -3050,9 +3050,9 @@ static std::string vertex_group_lock_description(bContext * /*C*/,
|
|||
}
|
||||
break;
|
||||
default:
|
||||
return nullptr;
|
||||
return {};
|
||||
}
|
||||
return nullptr;
|
||||
return {};
|
||||
}
|
||||
|
||||
void OBJECT_OT_vertex_group_lock(wmOperatorType *ot)
|
||||
|
|
|
@ -1317,14 +1317,14 @@ bool ED_region_is_overlap(int spacetype, int regiontype)
|
|||
bTheme *theme = UI_GetTheme();
|
||||
return theme->space_view3d.header[3] != 255;
|
||||
}
|
||||
else if (ELEM(regiontype,
|
||||
RGN_TYPE_TOOLS,
|
||||
RGN_TYPE_UI,
|
||||
RGN_TYPE_TOOL_PROPS,
|
||||
RGN_TYPE_FOOTER,
|
||||
RGN_TYPE_TOOL_HEADER,
|
||||
RGN_TYPE_ASSET_SHELF,
|
||||
RGN_TYPE_ASSET_SHELF_HEADER))
|
||||
if (ELEM(regiontype,
|
||||
RGN_TYPE_TOOLS,
|
||||
RGN_TYPE_UI,
|
||||
RGN_TYPE_TOOL_PROPS,
|
||||
RGN_TYPE_FOOTER,
|
||||
RGN_TYPE_TOOL_HEADER,
|
||||
RGN_TYPE_ASSET_SHELF,
|
||||
RGN_TYPE_ASSET_SHELF_HEADER))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -4226,16 +4226,14 @@ static bool project_paint_check_face_paintable(const ProjPaintState *ps,
|
|||
}
|
||||
return ps->select_poly_eval && ps->select_poly_eval[face_i];
|
||||
}
|
||||
else {
|
||||
int orig_index;
|
||||
const int face_i = ps->corner_tri_faces_eval[tri_i];
|
||||
if ((face_lookup->index_mp_to_orig != nullptr) &&
|
||||
((orig_index = (face_lookup->index_mp_to_orig[face_i])) != ORIGINDEX_NONE))
|
||||
{
|
||||
return !(face_lookup->hide_poly_orig && face_lookup->hide_poly_orig[orig_index]);
|
||||
}
|
||||
return !(ps->hide_poly_eval && ps->hide_poly_eval[face_i]);
|
||||
int orig_index;
|
||||
const int face_i = ps->corner_tri_faces_eval[tri_i];
|
||||
if ((face_lookup->index_mp_to_orig != nullptr) &&
|
||||
((orig_index = (face_lookup->index_mp_to_orig[face_i])) != ORIGINDEX_NONE))
|
||||
{
|
||||
return !(face_lookup->hide_poly_orig && face_lookup->hide_poly_orig[orig_index]);
|
||||
}
|
||||
return !(ps->hide_poly_eval && ps->hide_poly_eval[face_i]);
|
||||
}
|
||||
|
||||
struct ProjPaintFaceCoSS {
|
||||
|
|
|
@ -135,7 +135,7 @@ void neighbor_coords_average(SculptSession *ss, float result[3], PBVHVertRef ver
|
|||
}
|
||||
|
||||
float neighbor_mask_average(SculptSession *ss,
|
||||
const SculptMaskWriteInfo mask_write,
|
||||
const SculptMaskWriteInfo write_info,
|
||||
PBVHVertRef vertex)
|
||||
{
|
||||
float avg = 0.0f;
|
||||
|
@ -144,7 +144,7 @@ float neighbor_mask_average(SculptSession *ss,
|
|||
switch (BKE_pbvh_type(ss->pbvh)) {
|
||||
case PBVH_FACES:
|
||||
SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, vertex, ni) {
|
||||
avg += mask_write.layer[ni.vertex.i];
|
||||
avg += write_info.layer[ni.vertex.i];
|
||||
total++;
|
||||
}
|
||||
SCULPT_VERTEX_NEIGHBORS_ITER_END(ni);
|
||||
|
@ -160,7 +160,7 @@ float neighbor_mask_average(SculptSession *ss,
|
|||
case PBVH_BMESH:
|
||||
SCULPT_VERTEX_NEIGHBORS_ITER_BEGIN (ss, vertex, ni) {
|
||||
BMVert *vert = reinterpret_cast<BMVert *>(vertex.i);
|
||||
avg += BM_ELEM_CD_GET_FLOAT(vert, mask_write.bm_offset);
|
||||
avg += BM_ELEM_CD_GET_FLOAT(vert, write_info.bm_offset);
|
||||
total++;
|
||||
}
|
||||
SCULPT_VERTEX_NEIGHBORS_ITER_END(ni);
|
||||
|
|
|
@ -1340,8 +1340,9 @@ static void store_hidden(Object *ob, Node *unode)
|
|||
|
||||
PBVHNode *node = static_cast<PBVHNode *>(unode->node);
|
||||
const Span<int> verts = BKE_pbvh_node_get_vert_indices(node);
|
||||
for (const int i : verts.index_range())
|
||||
for (const int i : verts.index_range()) {
|
||||
unode->vert_hidden[i].set(hide_vert[verts[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
static void store_face_hidden(Object &object, Node &unode)
|
||||
|
@ -1354,8 +1355,9 @@ static void store_face_hidden(Object &object, Node &unode)
|
|||
return;
|
||||
}
|
||||
const Span<int> faces = unode.face_indices;
|
||||
for (const int i : faces.index_range())
|
||||
for (const int i : faces.index_range()) {
|
||||
unode.face_hidden[i].set(hide_poly[faces[i]]);
|
||||
}
|
||||
}
|
||||
|
||||
static void store_mask(Object *ob, Node *unode)
|
||||
|
|
|
@ -1047,12 +1047,10 @@ static uchar mute_overlap_alpha_factor_get(const ListBase *channels, const Seque
|
|||
return MUTE_ALPHA;
|
||||
}
|
||||
/* Draw background semi-transparent when overlapping strips. */
|
||||
else if (seq->flag & SEQ_OVERLAP) {
|
||||
if (seq->flag & SEQ_OVERLAP) {
|
||||
return OVERLAP_ALPHA;
|
||||
}
|
||||
else {
|
||||
return 255;
|
||||
}
|
||||
return 255;
|
||||
}
|
||||
|
||||
static void draw_strip_color_band(TimelineDrawContext *timeline_ctx,
|
||||
|
@ -1115,10 +1113,10 @@ static void draw_strip_background(TimelineDrawContext *timeline_ctx,
|
|||
}
|
||||
}
|
||||
|
||||
typedef enum {
|
||||
enum TransitionType {
|
||||
STRIP_TRANSITION_IN,
|
||||
STRIP_TRANSITION_OUT,
|
||||
} TransitionType;
|
||||
};
|
||||
|
||||
static void draw_seq_transition_strip_half(TimelineDrawContext *timeline_ctx,
|
||||
const StripDrawContext *strip_ctx,
|
||||
|
|
|
@ -1141,7 +1141,7 @@ bool ED_view3d_navigation_do(bContext *C,
|
|||
|
||||
return true;
|
||||
}
|
||||
else if (vod->rv3d->rflag & RV3D_NAVIGATING) {
|
||||
if (vod->rv3d->rflag & RV3D_NAVIGATING) {
|
||||
/* Add a fake confirmation. */
|
||||
vod->rv3d->rflag &= ~RV3D_NAVIGATING;
|
||||
return true;
|
||||
|
|
|
@ -1044,7 +1044,7 @@ bool ED_view3d_minmax_verts(Object *obedit, float r_min[3], float r_max[3])
|
|||
}
|
||||
return changed;
|
||||
}
|
||||
else if (obedit->type == OB_CURVES) {
|
||||
if (obedit->type == OB_CURVES) {
|
||||
const Object &ob_orig = *DEG_get_original_object(obedit);
|
||||
const Curves &curves_id = *static_cast<const Curves *>(ob_orig.data);
|
||||
const bke::CurvesGeometry &curves = curves_id.geometry.wrap();
|
||||
|
|
|
@ -558,11 +558,8 @@ static bool transform_modal_item_poll(const wmOperator *op, int value)
|
|||
if (value == TFM_MODAL_EDIT_SNAP_SOURCE_OFF) {
|
||||
return true;
|
||||
}
|
||||
else if (!ELEM(value,
|
||||
TFM_MODAL_CANCEL,
|
||||
TFM_MODAL_CONFIRM,
|
||||
TFM_MODAL_ADD_SNAP,
|
||||
TFM_MODAL_REMOVE_SNAP))
|
||||
if (!ELEM(
|
||||
value, TFM_MODAL_CANCEL, TFM_MODAL_CONFIRM, TFM_MODAL_ADD_SNAP, TFM_MODAL_REMOVE_SNAP))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -653,10 +653,8 @@ short ED_transform_calc_orientation_from_type_ex(const Scene *scene,
|
|||
handle_armature_parent_orientation(ob, r_mat);
|
||||
break;
|
||||
}
|
||||
else {
|
||||
handle_object_parent_orientation(ob, r_mat);
|
||||
break;
|
||||
}
|
||||
handle_object_parent_orientation(ob, r_mat);
|
||||
break;
|
||||
}
|
||||
/* No break; we define 'parent' as 'normal' otherwise. */
|
||||
ATTR_FALLTHROUGH;
|
||||
|
|
|
@ -848,10 +848,8 @@ static eSnapMode snap_polygon(SnapObjectContext *sctx, eSnapMode snap_to_flag)
|
|||
return snap_polygon_mesh(
|
||||
sctx, sctx->ret.ob, sctx->ret.data, sctx->ret.obmat, snap_to_flag, sctx->ret.index);
|
||||
}
|
||||
else {
|
||||
return snap_polygon_editmesh(
|
||||
sctx, sctx->ret.ob, sctx->ret.data, sctx->ret.obmat, snap_to_flag, sctx->ret.index);
|
||||
}
|
||||
return snap_polygon_editmesh(
|
||||
sctx, sctx->ret.ob, sctx->ret.data, sctx->ret.obmat, snap_to_flag, sctx->ret.index);
|
||||
}
|
||||
|
||||
static eSnapMode snap_edge_points(SnapObjectContext *sctx, const float dist_px_sq_orig)
|
||||
|
@ -870,10 +868,8 @@ static eSnapMode snap_edge_points(SnapObjectContext *sctx, const float dist_px_s
|
|||
return snap_edge_points_mesh(
|
||||
sctx, sctx->ret.ob, sctx->ret.data, sctx->ret.obmat, dist_px_sq_orig, sctx->ret.index);
|
||||
}
|
||||
else {
|
||||
return snap_edge_points_editmesh(
|
||||
sctx, sctx->ret.ob, sctx->ret.data, sctx->ret.obmat, dist_px_sq_orig, sctx->ret.index);
|
||||
}
|
||||
return snap_edge_points_editmesh(
|
||||
sctx, sctx->ret.ob, sctx->ret.data, sctx->ret.obmat, dist_px_sq_orig, sctx->ret.index);
|
||||
}
|
||||
|
||||
/* May extend later (for now just snaps to empty or camera center). */
|
||||
|
|
|
@ -215,7 +215,7 @@ eSnapMode snap_polygon_editmesh(SnapObjectContext *sctx,
|
|||
const ID *id,
|
||||
const blender::float4x4 &obmat,
|
||||
eSnapMode snap_to_flag,
|
||||
int polygon);
|
||||
int face);
|
||||
|
||||
eSnapMode snap_edge_points_editmesh(SnapObjectContext *sctx,
|
||||
Object *ob_eval,
|
||||
|
@ -238,7 +238,7 @@ eSnapMode snap_polygon_mesh(SnapObjectContext *sctx,
|
|||
const ID *id,
|
||||
const blender::float4x4 &obmat,
|
||||
eSnapMode snap_to_flag,
|
||||
int polygon);
|
||||
int face);
|
||||
|
||||
eSnapMode snap_edge_points_mesh(SnapObjectContext *sctx,
|
||||
Object *ob_eval,
|
||||
|
|
|
@ -52,7 +52,7 @@ struct SnapCache_EditMesh : public SnapObjectContext::SnapCache {
|
|||
}
|
||||
}
|
||||
|
||||
~SnapCache_EditMesh()
|
||||
~SnapCache_EditMesh() override
|
||||
{
|
||||
this->clear();
|
||||
}
|
||||
|
@ -430,20 +430,20 @@ class SnapData_EditMesh : public SnapData {
|
|||
SnapData_EditMesh(SnapObjectContext *sctx, BMesh *bm, const float4x4 &obmat)
|
||||
: SnapData(sctx, obmat), bm(bm){};
|
||||
|
||||
void get_vert_co(const int index, const float **r_co)
|
||||
void get_vert_co(const int index, const float **r_co) override
|
||||
{
|
||||
BMVert *eve = BM_vert_at_index(this->bm, index);
|
||||
*r_co = eve->co;
|
||||
}
|
||||
|
||||
void get_edge_verts_index(const int index, int r_v_index[2])
|
||||
void get_edge_verts_index(const int index, int r_v_index[2]) override
|
||||
{
|
||||
BMEdge *eed = BM_edge_at_index(this->bm, index);
|
||||
r_v_index[0] = BM_elem_index_get(eed->v1);
|
||||
r_v_index[1] = BM_elem_index_get(eed->v2);
|
||||
}
|
||||
|
||||
void copy_vert_no(const int index, float r_no[3])
|
||||
void copy_vert_no(const int index, float r_no[3]) override
|
||||
{
|
||||
BMVert *eve = BM_vert_at_index(this->bm, index);
|
||||
copy_v3_v3(r_no, eve->no);
|
||||
|
|
|
@ -241,19 +241,19 @@ class SnapData_Mesh : public SnapData {
|
|||
this->corner_tris = mesh_eval->corner_tris().data();
|
||||
};
|
||||
|
||||
void get_vert_co(const int index, const float **r_co)
|
||||
void get_vert_co(const int index, const float **r_co) override
|
||||
{
|
||||
*r_co = this->vert_positions[index];
|
||||
}
|
||||
|
||||
void get_edge_verts_index(const int index, int r_v_index[2])
|
||||
void get_edge_verts_index(const int index, int r_v_index[2]) override
|
||||
{
|
||||
const blender::int2 &edge = this->edges[index];
|
||||
r_v_index[0] = edge[0];
|
||||
r_v_index[1] = edge[1];
|
||||
}
|
||||
|
||||
void copy_vert_no(const int index, float r_no[3])
|
||||
void copy_vert_no(const int index, float r_no[3]) override
|
||||
{
|
||||
copy_v3_v3(r_no, this->vert_normals[index]);
|
||||
}
|
||||
|
|
|
@ -144,7 +144,7 @@ static const char *to_string(const Type &type)
|
|||
return "unknown";
|
||||
}
|
||||
|
||||
static const int to_component_count(const Type &type)
|
||||
static int to_component_count(const Type &type)
|
||||
{
|
||||
switch (type) {
|
||||
case Type::FLOAT:
|
||||
|
@ -200,7 +200,7 @@ static const int to_component_count(const Type &type)
|
|||
return -1;
|
||||
}
|
||||
|
||||
static const Type to_component_type(const Type &type)
|
||||
static Type to_component_type(const Type &type)
|
||||
{
|
||||
switch (type) {
|
||||
case Type::FLOAT:
|
||||
|
|
|
@ -171,7 +171,7 @@ static void dna_write(FILE *file, const void *pntr, const int size);
|
|||
/**
|
||||
* Report all structures found so far, and print their lengths.
|
||||
*/
|
||||
void print_struct_sizes(void);
|
||||
void print_struct_sizes();
|
||||
|
||||
/** \} */
|
||||
|
||||
|
|
|
@ -877,9 +877,9 @@ const char *WM_drag_get_single_path(const wmDrag *drag, int file_type)
|
|||
return nullptr;
|
||||
}
|
||||
const wmDragPath *path_data = static_cast<const wmDragPath *>(drag->poin);
|
||||
auto const file_types = path_data->file_types;
|
||||
const blender::Span<int> file_types = path_data->file_types;
|
||||
|
||||
auto itr = std::find_if(
|
||||
const auto *itr = std::find_if(
|
||||
file_types.begin(), file_types.end(), [file_type](const int file_fype_test) {
|
||||
return file_fype_test & file_type;
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue