Cleanup: Various clang-tidy warnings in modifiers
Pull Request: https://projects.blender.org/blender/blender/pulls/133734
This commit is contained in:
@@ -8,6 +8,8 @@
|
||||
* Array modifier: duplicates the object multiple times along an axis.
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
@@ -230,8 +232,8 @@ static void dm_mvert_map_doubles(int *doubles_map,
|
||||
while ((i_target < target_verts_num) && (sve_target->sum_co <= sve_source_sumco + dist3)) {
|
||||
/* Testing distance for candidate double in target */
|
||||
/* v_target is within dist3 of v_source in terms of sumco; check real distance */
|
||||
float dist_sq;
|
||||
if ((dist_sq = len_squared_v3v3(sve_source->co, sve_target->co)) <= best_dist_sq) {
|
||||
const float dist_sq = len_squared_v3v3(sve_source->co, sve_target->co);
|
||||
if (dist_sq <= best_dist_sq) {
|
||||
/* Potential double found */
|
||||
best_dist_sq = dist_sq;
|
||||
best_target_vertex = sve_target->vertex_num;
|
||||
@@ -546,9 +548,7 @@ static Mesh *arrayModifier_doArray(ArrayModifierData *amd,
|
||||
"geometry it would require");
|
||||
}
|
||||
|
||||
if (count < 1) {
|
||||
count = 1;
|
||||
}
|
||||
count = std::max(count, 1);
|
||||
|
||||
/* The number of verts, edges, loops, faces, before eventually merging doubles */
|
||||
result_nverts = chunk_nverts * count + start_cap_nverts + end_cap_nverts;
|
||||
|
||||
@@ -8,10 +8,7 @@
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_math_vector.h"
|
||||
#include "BLI_string.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLT_translation.hh"
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLI_array.hh"
|
||||
@@ -671,7 +669,7 @@ ModifierTypeInfo modifierType_Boolean = {
|
||||
/*srna*/ &RNA_BooleanModifier,
|
||||
/*type*/ ModifierTypeType::Nonconstructive,
|
||||
/*flags*/
|
||||
(ModifierTypeFlag)(eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsEditmode),
|
||||
(eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsEditmode),
|
||||
/*icon*/ ICON_MOD_BOOLEAN,
|
||||
|
||||
/*copy_data*/ BKE_modifier_copydata_generic,
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
|
||||
#include "DNA_defaults.h"
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_screen_types.h"
|
||||
|
||||
#include "DEG_depsgraph_query.hh"
|
||||
|
||||
@@ -97,10 +97,9 @@ static void deform_verts(ModifierData *md,
|
||||
KeyBlock *kb = BKE_keyblock_find_by_index(BKE_key_from_object(ctx->object),
|
||||
clmd->sim_parms->shapekey_rest);
|
||||
if (kb && kb->data != nullptr) {
|
||||
float(*layerorco)[3];
|
||||
if (!(layerorco = static_cast<float(*)[3]>(
|
||||
CustomData_get_layer_for_write(&mesh->vert_data, CD_CLOTH_ORCO, mesh->verts_num))))
|
||||
{
|
||||
float(*layerorco)[3] = static_cast<float(*)[3]>(
|
||||
CustomData_get_layer_for_write(&mesh->vert_data, CD_CLOTH_ORCO, mesh->verts_num));
|
||||
if (!layerorco) {
|
||||
layerorco = static_cast<float(*)[3]>(CustomData_add_layer(
|
||||
&mesh->vert_data, CD_CLOTH_ORCO, CD_SET_DEFAULT, mesh->verts_num));
|
||||
}
|
||||
|
||||
@@ -42,12 +42,12 @@
|
||||
|
||||
// #define DEBUG_TIME
|
||||
|
||||
#include "BLI_time.h"
|
||||
#ifdef DEBUG_TIME
|
||||
# include "BLI_time.h"
|
||||
# include "BLI_time_utildefines.h"
|
||||
#endif
|
||||
|
||||
#include "BLI_strict_flags.h" /* Keep last. */
|
||||
#include "BLI_strict_flags.h" /* IWYU pragma: keep. Keep last. */
|
||||
|
||||
static void init_data(ModifierData *md)
|
||||
{
|
||||
|
||||
@@ -21,7 +21,6 @@
|
||||
#include "DNA_screen_types.h"
|
||||
|
||||
#include "BKE_attribute.hh"
|
||||
#include "BKE_customdata.hh"
|
||||
#include "BKE_deform.hh"
|
||||
#include "BKE_image.hh"
|
||||
#include "BKE_lib_query.hh"
|
||||
|
||||
@@ -67,8 +67,9 @@ Mesh *doEdgeSplit(const Mesh *mesh, EdgeSplitModifierData *emd)
|
||||
if (do_split_angle) {
|
||||
BM_ITER_MESH (e, &iter, bm, BM_EDGES_OF_MESH) {
|
||||
/* check for 1 edge having 2 face users */
|
||||
BMLoop *l1, *l2;
|
||||
if ((l1 = e->l) && (l2 = e->l->radial_next) != l1) {
|
||||
BMLoop *l1 = e->l;
|
||||
BMLoop *l2 = (e->l) ? e->l->radial_next : nullptr;
|
||||
if (l1 && l2 != l1) {
|
||||
if (/* 3+ faces on this edge, always split */
|
||||
UNLIKELY(l1 != l2->radial_next) ||
|
||||
/* O degree angle setting, we want to split on all edges. */
|
||||
|
||||
@@ -8,10 +8,7 @@
|
||||
|
||||
#include <cstddef>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_task.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLT_translation.hh"
|
||||
|
||||
|
||||
@@ -6,19 +6,12 @@
|
||||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_array_utils.hh"
|
||||
#include "BLI_math_matrix.hh"
|
||||
|
||||
#include "DNA_defaults.h"
|
||||
#include "DNA_material_types.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
#include "DNA_modifier_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
#include "BKE_armature.hh"
|
||||
#include "BKE_colorband.hh"
|
||||
#include "BKE_curves.hh"
|
||||
#include "BKE_geometry_set.hh"
|
||||
#include "BKE_grease_pencil.hh"
|
||||
|
||||
@@ -7,17 +7,13 @@
|
||||
*/
|
||||
|
||||
#include "BLI_array.hh"
|
||||
#include "BLI_hash.h"
|
||||
#include "BLI_rand.h"
|
||||
#include "BLI_sort.hh"
|
||||
#include "BLI_task.h"
|
||||
|
||||
#include "BLT_translation.hh"
|
||||
|
||||
#include "BLO_read_write.hh"
|
||||
|
||||
#include "DNA_defaults.h"
|
||||
#include "DNA_gpencil_modifier_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
|
||||
@@ -6,14 +6,9 @@
|
||||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_math_color.hh"
|
||||
|
||||
#include "DNA_defaults.h"
|
||||
#include "DNA_material_types.h"
|
||||
#include "DNA_modifier_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
#include "BKE_colortools.hh"
|
||||
#include "BKE_curves.hh"
|
||||
|
||||
@@ -16,15 +16,12 @@
|
||||
#include "BKE_geometry_set.hh"
|
||||
#include "BKE_grease_pencil.hh"
|
||||
#include "BKE_instances.hh"
|
||||
#include "BKE_lib_query.hh"
|
||||
#include "BKE_material.hh"
|
||||
#include "BKE_modifier.hh"
|
||||
#include "BKE_screen.hh"
|
||||
|
||||
#include "BLO_read_write.hh"
|
||||
|
||||
#include "GEO_realize_instances.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
*/
|
||||
|
||||
#include "BLI_index_mask.hh"
|
||||
#include "BLI_math_rotation.hh"
|
||||
#include "BLI_string.h" /* For #STRNCPY. */
|
||||
|
||||
#include "BLT_translation.hh"
|
||||
|
||||
@@ -123,7 +121,7 @@ static float hook_falloff(const float falloff,
|
||||
if (falloff_type == MOD_GREASE_PENCIL_HOOK_Falloff_Const) {
|
||||
return fac_orig;
|
||||
}
|
||||
else if (falloff_type == MOD_GREASE_PENCIL_HOOK_Falloff_InvSquare) {
|
||||
if (falloff_type == MOD_GREASE_PENCIL_HOOK_Falloff_InvSquare) {
|
||||
/* Avoid sqrt below. */
|
||||
return (1.0f - (len_sq / falloff_sq)) * fac_orig;
|
||||
}
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include "BLI_hash.h"
|
||||
#include "BLI_rand.h"
|
||||
#include "BLI_task.h"
|
||||
|
||||
#include "BLT_translation.hh"
|
||||
|
||||
@@ -22,7 +21,6 @@
|
||||
#include "BKE_curves.hh"
|
||||
#include "BKE_geometry_set.hh"
|
||||
#include "BKE_grease_pencil.hh"
|
||||
#include "BKE_lib_query.hh"
|
||||
#include "BKE_modifier.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
|
||||
@@ -6,12 +6,9 @@
|
||||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_math_matrix.hh"
|
||||
|
||||
#include "DNA_defaults.h"
|
||||
#include "DNA_material_types.h"
|
||||
#include "DNA_modifier_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
|
||||
@@ -20,8 +17,6 @@
|
||||
#include "BKE_geometry_set.hh"
|
||||
#include "BKE_grease_pencil.hh"
|
||||
#include "BKE_instances.hh"
|
||||
#include "BKE_lib_query.hh"
|
||||
#include "BKE_material.hh"
|
||||
#include "BKE_modifier.hh"
|
||||
#include "BKE_screen.hh"
|
||||
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#include "BKE_attribute.hh"
|
||||
#include "BKE_material.hh"
|
||||
#include "BLI_array_utils.hh"
|
||||
#include "BLI_enumerable_thread_specific.hh"
|
||||
#include "BLI_index_range.hh"
|
||||
#include "BLI_math_matrix.hh"
|
||||
#include "BLI_math_vector.hh"
|
||||
|
||||
@@ -89,7 +89,7 @@ static void deform_drawing(const ModifierData &md,
|
||||
const Object &ob,
|
||||
bke::greasepencil::Drawing &drawing)
|
||||
{
|
||||
auto &mmd = reinterpret_cast<const GreasePencilSmoothModifierData &>(md);
|
||||
const auto &mmd = reinterpret_cast<const GreasePencilSmoothModifierData &>(md);
|
||||
|
||||
const int iterations = mmd.step;
|
||||
const float influence = mmd.factor;
|
||||
|
||||
@@ -11,7 +11,6 @@
|
||||
#include "BLI_span.hh"
|
||||
#include "BLI_string.h"
|
||||
#include "BLI_string_utf8.h"
|
||||
#include "BLI_vector_set.hh"
|
||||
|
||||
#include "DNA_defaults.h"
|
||||
#include "DNA_modifier_types.h"
|
||||
@@ -42,8 +41,6 @@
|
||||
#include "MOD_grease_pencil_util.hh"
|
||||
#include "MOD_ui_common.hh"
|
||||
|
||||
#include <iostream>
|
||||
|
||||
namespace blender {
|
||||
|
||||
static void init_data(ModifierData *md)
|
||||
@@ -134,7 +131,7 @@ struct FrameRange {
|
||||
* and after the interval. The extra keys are needed when frames are held at the beginning or when
|
||||
* reversing the direction.
|
||||
*/
|
||||
static const IndexRange find_key_range(const Span<int> sorted_keys, const FrameRange &frame_range)
|
||||
static IndexRange find_key_range(const Span<int> sorted_keys, const FrameRange &frame_range)
|
||||
{
|
||||
IndexRange result = sorted_keys.index_range();
|
||||
for (const int i : result.index_range()) {
|
||||
|
||||
@@ -275,7 +275,7 @@ static void modify_fill_color(Object &ob,
|
||||
if (points.is_empty() || (stroke_weight <= 0.0f)) {
|
||||
return 0.0f;
|
||||
}
|
||||
else if (use_weight_as_factor) {
|
||||
if (use_weight_as_factor) {
|
||||
return stroke_weight;
|
||||
}
|
||||
return tmd.factor * stroke_weight;
|
||||
|
||||
@@ -191,9 +191,9 @@ static Vector<int> get_grease_pencil_material_passes(const Object *ob)
|
||||
{
|
||||
short *totcol = BKE_object_material_len_p(const_cast<Object *>(ob));
|
||||
Vector<int> result(*totcol, 0);
|
||||
Material *ma = nullptr;
|
||||
for (short i = 0; i < *totcol; i++) {
|
||||
if ((ma = BKE_object_material_get(const_cast<Object *>(ob), i + 1))) {
|
||||
const Material *ma = BKE_object_material_get(const_cast<Object *>(ob), i + 1);
|
||||
if (ma) {
|
||||
/* Pass index of the grease pencil material. */
|
||||
result[i] = ma->gp_style->index;
|
||||
}
|
||||
|
||||
@@ -7,8 +7,6 @@
|
||||
*/
|
||||
|
||||
#include "BLI_index_mask.hh"
|
||||
#include "BLI_math_rotation.hh"
|
||||
#include "BLI_string.h" /* For #STRNCPY. */
|
||||
|
||||
#include "BLT_translation.hh"
|
||||
|
||||
@@ -25,7 +23,6 @@
|
||||
#include "BKE_geometry_set.hh"
|
||||
#include "BKE_grease_pencil.hh"
|
||||
#include "BKE_grease_pencil_vertex_groups.hh"
|
||||
#include "BKE_lib_query.hh"
|
||||
#include "BKE_modifier.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
|
||||
@@ -8,7 +8,6 @@
|
||||
|
||||
#include "BLI_index_mask.hh"
|
||||
#include "BLI_math_matrix.hh"
|
||||
#include "BLI_string.h" /* For #STRNCPY. */
|
||||
|
||||
#include "BLT_translation.hh"
|
||||
|
||||
@@ -127,7 +126,7 @@ static float get_distance_factor(float3 target_pos,
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
else if (dist_max < dist_min) {
|
||||
if (dist_max < dist_min) {
|
||||
if (dist > dist_min) {
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
|
||||
#include "RNA_prototypes.hh"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "MOD_ui_common.hh"
|
||||
#include "MOD_util.hh"
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "BKE_collection.hh"
|
||||
#include "BKE_geometry_set.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_grease_pencil.hh"
|
||||
#include "BKE_lib_query.hh"
|
||||
#include "BKE_material.hh"
|
||||
@@ -855,7 +854,7 @@ static void modify_geometry_set(ModifierData *md,
|
||||
return;
|
||||
}
|
||||
GreasePencil &grease_pencil = *geometry_set->get_grease_pencil_for_write();
|
||||
auto mmd = reinterpret_cast<GreasePencilLineartModifierData *>(md);
|
||||
auto *mmd = reinterpret_cast<GreasePencilLineartModifierData *>(md);
|
||||
|
||||
GreasePencilLineartModifierData *first_lineart =
|
||||
blender::ed::greasepencil::get_first_lineart_modifier(*ctx->object);
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLI_array_utils.hh"
|
||||
@@ -801,8 +799,8 @@ ModifierTypeInfo modifierType_Mask = {
|
||||
/*srna*/ &RNA_MaskModifier,
|
||||
/*type*/ ModifierTypeType::Nonconstructive,
|
||||
/*flags*/
|
||||
(ModifierTypeFlag)(eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsMapping |
|
||||
eModifierTypeFlag_SupportsEditmode),
|
||||
(eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsMapping |
|
||||
eModifierTypeFlag_SupportsEditmode),
|
||||
/*icon*/ ICON_MOD_MASK,
|
||||
|
||||
/*copy_data*/ BKE_modifier_copydata_generic,
|
||||
|
||||
@@ -27,13 +27,9 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "MOD_ui_common.hh"
|
||||
|
||||
#include "BLI_index_range.hh"
|
||||
#include "BLI_math_matrix_types.hh"
|
||||
#include "BLI_span.hh"
|
||||
|
||||
#include "RNA_prototypes.hh"
|
||||
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLI_math_matrix.h"
|
||||
|
||||
@@ -11,8 +11,6 @@
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLI_fileops.h"
|
||||
#include "BLI_math_base.h"
|
||||
#ifdef __LITTLE_ENDIAN__
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
#include "BLI_math_base.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "DNA_modifier_types.h"
|
||||
|
||||
|
||||
@@ -379,12 +379,12 @@ static void meshdeformModifier_do(ModifierData *md,
|
||||
BKE_modifier_set_error(ob, md, "Vertices changed from %d to %d", mmd->verts_num, verts_num);
|
||||
return;
|
||||
}
|
||||
else if (mmd->cage_verts_num != cage_verts_num) {
|
||||
if (mmd->cage_verts_num != cage_verts_num) {
|
||||
BKE_modifier_set_error(
|
||||
ob, md, "Cage vertices changed from %d to %d", mmd->cage_verts_num, cage_verts_num);
|
||||
return;
|
||||
}
|
||||
else if (mmd->bindcagecos == nullptr) {
|
||||
if (mmd->bindcagecos == nullptr) {
|
||||
BKE_modifier_set_error(ob, md, "Bind data missing");
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
#include <cstring>
|
||||
#include <limits>
|
||||
|
||||
#include "BLI_math_vector.hh"
|
||||
#include "BLI_string.h"
|
||||
@@ -494,7 +493,7 @@ ModifierTypeInfo modifierType_MeshSequenceCache = {
|
||||
/*srna*/ &RNA_MeshSequenceCacheModifier,
|
||||
/*type*/ ModifierTypeType::Constructive,
|
||||
/*flags*/
|
||||
static_cast<ModifierTypeFlag>(eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_AcceptsCVs),
|
||||
(eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_AcceptsCVs),
|
||||
/*icon*/ ICON_MOD_MESHDEFORM, /* TODO: Use correct icon. */
|
||||
|
||||
/*copy_data*/ copy_data,
|
||||
|
||||
@@ -8,17 +8,13 @@
|
||||
|
||||
#include <cstring>
|
||||
#include <fmt/format.h>
|
||||
#include <iostream>
|
||||
#include <sstream>
|
||||
#include <string>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_array.hh"
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_math_vector_types.hh"
|
||||
#include "BLI_multi_value_map.hh"
|
||||
#include "BLI_path_utils.hh"
|
||||
#include "BLI_set.hh"
|
||||
#include "BLI_string.h"
|
||||
#include "BLI_utildefines.h"
|
||||
@@ -29,7 +25,6 @@
|
||||
#include "DNA_defaults.h"
|
||||
#include "DNA_material_types.h"
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
#include "DNA_modifier_types.h"
|
||||
#include "DNA_node_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
@@ -40,13 +35,10 @@
|
||||
#include "DNA_view3d_types.h"
|
||||
#include "DNA_windowmanager_types.h"
|
||||
|
||||
#include "BKE_attribute_math.hh"
|
||||
#include "BKE_bake_data_block_map.hh"
|
||||
#include "BKE_bake_geometry_nodes_modifier.hh"
|
||||
#include "BKE_compute_contexts.hh"
|
||||
#include "BKE_customdata.hh"
|
||||
#include "BKE_geometry_fields.hh"
|
||||
#include "BKE_geometry_set_instances.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_idprop.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
@@ -87,7 +79,6 @@
|
||||
|
||||
#include "ED_object.hh"
|
||||
#include "ED_screen.hh"
|
||||
#include "ED_spreadsheet.hh"
|
||||
#include "ED_undo.hh"
|
||||
#include "ED_viewer_path.hh"
|
||||
|
||||
@@ -99,11 +90,6 @@
|
||||
#include "NOD_node_declaration.hh"
|
||||
#include "NOD_socket_usage_inference.hh"
|
||||
|
||||
#include "FN_field.hh"
|
||||
#include "FN_lazy_function_execute.hh"
|
||||
#include "FN_lazy_function_graph_executor.hh"
|
||||
#include "FN_multi_function.hh"
|
||||
|
||||
namespace lf = blender::fn::lazy_function;
|
||||
namespace geo_log = blender::nodes::geo_eval_log;
|
||||
namespace bake = blender::bke::bake;
|
||||
@@ -1461,7 +1447,7 @@ class NodesModifierBakeParams : public nodes::GeoNodesBakeParams {
|
||||
bmain_ = DEG_get_bmain(depsgraph);
|
||||
}
|
||||
|
||||
nodes::BakeNodeBehavior *get(const int id) const
|
||||
nodes::BakeNodeBehavior *get(const int id) const override
|
||||
{
|
||||
if (!modifier_cache_) {
|
||||
return nullptr;
|
||||
@@ -2837,10 +2823,9 @@ ModifierTypeInfo modifierType_Nodes = {
|
||||
/*srna*/ &RNA_NodesModifier,
|
||||
/*type*/ ModifierTypeType::Constructive,
|
||||
/*flags*/
|
||||
static_cast<ModifierTypeFlag>(
|
||||
eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_AcceptsCVs |
|
||||
eModifierTypeFlag_SupportsEditmode | eModifierTypeFlag_EnableInEditmode |
|
||||
eModifierTypeFlag_SupportsMapping | eModifierTypeFlag_AcceptsGreasePencil),
|
||||
(eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_AcceptsCVs |
|
||||
eModifierTypeFlag_SupportsEditmode | eModifierTypeFlag_EnableInEditmode |
|
||||
eModifierTypeFlag_SupportsMapping | eModifierTypeFlag_AcceptsGreasePencil),
|
||||
/*icon*/ ICON_GEOMETRY_NODES,
|
||||
|
||||
/*copy_data*/ blender::copy_data,
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "MOD_modifiertypes.hh"
|
||||
|
||||
#include "UI_resources.hh"
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#include "DNA_screen_types.h"
|
||||
|
||||
#include "BKE_attribute.hh"
|
||||
#include "BKE_customdata.hh"
|
||||
#include "BKE_deform.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
#include "BKE_lib_query.hh"
|
||||
|
||||
@@ -86,9 +86,9 @@ struct DualConOutput {
|
||||
/* allocate and initialize a DualConOutput */
|
||||
static void *dualcon_alloc_output(int totvert, int totquad)
|
||||
{
|
||||
DualConOutput *output;
|
||||
DualConOutput *output = MEM_cnew<DualConOutput>(__func__);
|
||||
|
||||
if (!(output = MEM_cnew<DualConOutput>(__func__))) {
|
||||
if (!output) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
*/
|
||||
|
||||
/* Screw modifier: revolves the edges about an axis */
|
||||
#include <algorithm>
|
||||
#include <climits>
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
@@ -46,7 +47,7 @@
|
||||
|
||||
#include "GEO_mesh_merge_by_distance.hh"
|
||||
|
||||
#include "BLI_strict_flags.h" /* Keep last. */
|
||||
#include "BLI_strict_flags.h" /* IWYU pragma: keep. Keep last. */
|
||||
|
||||
using namespace blender;
|
||||
|
||||
@@ -376,9 +377,7 @@ static Mesh *modify_mesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh
|
||||
}
|
||||
else {
|
||||
close = false;
|
||||
if (step_tot < 2) {
|
||||
step_tot = 2;
|
||||
}
|
||||
step_tot = std::max<uint>(step_tot, 2);
|
||||
|
||||
maxVerts = totvert * step_tot; /* -1 because we're joining back up */
|
||||
maxEdges = (totvert * (step_tot - 1)) + /* these are the edges between new verts */
|
||||
@@ -881,7 +880,7 @@ static Mesh *modify_mesh(ModifierData *md, const ModifierEvalContext *ctx, Mesh
|
||||
/* Polygon */
|
||||
if (has_mpoly_orig) {
|
||||
CustomData_copy_data(
|
||||
&mesh->face_data, &result->face_data, int(face_index_orig), int(face_index), 1);
|
||||
&mesh->face_data, &result->face_data, int(face_index_orig), face_index, 1);
|
||||
origindex[face_index] = int(face_index_orig);
|
||||
}
|
||||
else {
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
#include "BLI_math_matrix.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLT_translation.hh"
|
||||
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "BLI_math_matrix.h"
|
||||
#include "BLI_math_vector.h"
|
||||
#include "BLI_task.h"
|
||||
@@ -76,12 +78,8 @@ BLI_INLINE void copy_v3_v3_unmap(float a[3], const float b[3], const uint map[3]
|
||||
static void axis_limit(const int axis, const float limits[2], float co[3], float dcut[3])
|
||||
{
|
||||
float val = co[axis];
|
||||
if (limits[0] > val) {
|
||||
val = limits[0];
|
||||
}
|
||||
if (limits[1] < val) {
|
||||
val = limits[1];
|
||||
}
|
||||
val = std::max(limits[0], val);
|
||||
val = std::min(limits[1], val);
|
||||
|
||||
dcut[axis] = co[axis] - val;
|
||||
co[axis] = val;
|
||||
@@ -312,12 +310,8 @@ static void SimpleDeformModifier_do(SimpleDeformModifierData *smd,
|
||||
smd->origin = nullptr; /* No self references */
|
||||
}
|
||||
|
||||
if (smd->limit[0] < 0.0f) {
|
||||
smd->limit[0] = 0.0f;
|
||||
}
|
||||
if (smd->limit[0] > 1.0f) {
|
||||
smd->limit[0] = 1.0f;
|
||||
}
|
||||
smd->limit[0] = std::max(smd->limit[0], 0.0f);
|
||||
smd->limit[0] = std::min(smd->limit[0], 1.0f);
|
||||
|
||||
smd->limit[0] = min_ff(smd->limit[0], smd->limit[1]); /* Upper limit >= than lower limit */
|
||||
|
||||
|
||||
@@ -6,10 +6,6 @@
|
||||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
#include <cstdio>
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLT_translation.hh"
|
||||
|
||||
#include "DNA_object_force_types.h"
|
||||
|
||||
@@ -14,11 +14,9 @@
|
||||
|
||||
#include "DNA_defaults.h"
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_screen_types.h"
|
||||
|
||||
#include "BKE_context.hh"
|
||||
#include "BKE_particle.h"
|
||||
#include "BKE_screen.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "BLI_math_vector.h"
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
@@ -24,7 +26,6 @@
|
||||
#include "BKE_deform.hh"
|
||||
#include "BKE_mesh.hh"
|
||||
|
||||
#include "MOD_modifiertypes.hh"
|
||||
#include "MOD_solidify_util.hh" /* own include */
|
||||
#include "MOD_util.hh"
|
||||
|
||||
@@ -748,9 +749,7 @@ Mesh *MOD_solidify_extrude_modifyMesh(ModifierData *md, const ModifierEvalContex
|
||||
angle = angle_normalized_v3v3(nor_prev, nor_next);
|
||||
|
||||
/* --- not related to angle calc --- */
|
||||
if (angle < FLT_EPSILON) {
|
||||
angle = FLT_EPSILON;
|
||||
}
|
||||
angle = std::max(angle, FLT_EPSILON);
|
||||
|
||||
vidx = face_verts[i_curr];
|
||||
vert_accum[vidx] += angle;
|
||||
|
||||
@@ -6,6 +6,8 @@
|
||||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "BLI_math_matrix.h"
|
||||
#include "BLI_math_vector.h"
|
||||
#include "BLI_utildefines.h"
|
||||
@@ -21,7 +23,6 @@
|
||||
#include "BKE_deform.hh"
|
||||
#include "BKE_mesh.hh"
|
||||
|
||||
#include "MOD_modifiertypes.hh"
|
||||
#include "MOD_solidify_util.hh" /* Own include. */
|
||||
#include "MOD_util.hh"
|
||||
|
||||
@@ -711,7 +712,7 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md,
|
||||
}
|
||||
if (do_shell) {
|
||||
new_faces_num -= 2;
|
||||
new_loops_num -= 2 * uint(del_loops);
|
||||
new_loops_num -= 2 * del_loops;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -1600,9 +1601,7 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md,
|
||||
for (uint k = 0; k < 2; k++) {
|
||||
for (uint m = 2; m < size; m++) {
|
||||
float p = dot_v3v3(planes_queue[m], planes_queue[k]);
|
||||
if (p < greatest_angle_cos) {
|
||||
greatest_angle_cos = p;
|
||||
}
|
||||
greatest_angle_cos = std::min(p, greatest_angle_cos);
|
||||
}
|
||||
}
|
||||
if (greatest_angle_cos > boundary_fix_threshold) {
|
||||
@@ -1891,9 +1890,7 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md,
|
||||
for (NewEdgeRef **p = g->edges; k < g->edges_len; k++, p++) {
|
||||
float length = orig_edge_lengths[(*p)->old_edge];
|
||||
float e_ang = (*p)->angle;
|
||||
if (e_ang > angle) {
|
||||
angle = e_ang;
|
||||
}
|
||||
angle = std::max(e_ang, angle);
|
||||
if (length < min_length || k == 0) {
|
||||
min_length = length;
|
||||
}
|
||||
@@ -2212,9 +2209,7 @@ Mesh *MOD_solidify_nonmanifold_modifyMesh(ModifierData *md,
|
||||
if (g->edges[k]->new_edge != MOD_SOLIDIFY_EMPTY_TAG) {
|
||||
if (result_edge_bweight) {
|
||||
float bweight = result_edge_bweight[g->edges[k]->new_edge];
|
||||
if (bweight > max_bweight) {
|
||||
max_bweight = bweight;
|
||||
}
|
||||
max_bweight = std::max(bweight, max_bweight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -7,7 +7,6 @@
|
||||
*/
|
||||
|
||||
#include <cstddef>
|
||||
#include <cstdio>
|
||||
#include <cstring>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
@@ -8,8 +8,6 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLT_translation.hh"
|
||||
@@ -94,14 +92,9 @@ static void init_data(ModifierData *md)
|
||||
static Mesh *modify_mesh(ModifierData *md, const ModifierEvalContext * /*ctx*/, Mesh *mesh)
|
||||
{
|
||||
TriangulateModifierData *tmd = (TriangulateModifierData *)md;
|
||||
Mesh *result;
|
||||
if (!(result = triangulate_mesh(
|
||||
mesh, tmd->quad_method, tmd->ngon_method, tmd->min_vertices, tmd->flag)))
|
||||
{
|
||||
return mesh;
|
||||
}
|
||||
|
||||
return result;
|
||||
Mesh *result = triangulate_mesh(
|
||||
mesh, tmd->quad_method, tmd->ngon_method, tmd->min_vertices, tmd->flag);
|
||||
return (result) ? result : mesh;
|
||||
}
|
||||
|
||||
static void panel_draw(const bContext * /*C*/, Panel *panel)
|
||||
|
||||
@@ -8,27 +8,23 @@
|
||||
|
||||
#include <cstring>
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLI_bitmap.h"
|
||||
#include "BLI_math_matrix.h"
|
||||
#include "BLI_math_vector.h"
|
||||
|
||||
#include "DNA_image_types.h"
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_modifier_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
|
||||
#include "BKE_action.hh" /* BKE_pose_channel_find_name */
|
||||
#include "BKE_attribute.hh"
|
||||
#include "BKE_customdata.hh"
|
||||
#include "BKE_deform.hh"
|
||||
#include "BKE_editmesh.hh"
|
||||
#include "BKE_image.hh"
|
||||
#include "BKE_lattice.hh"
|
||||
|
||||
#include "BKE_modifier.hh"
|
||||
|
||||
#include "DEG_depsgraph.hh"
|
||||
#include "DEG_depsgraph_query.hh"
|
||||
|
||||
#include "MOD_modifiertypes.hh"
|
||||
|
||||
@@ -26,8 +26,6 @@
|
||||
#include "UI_interface.hh"
|
||||
#include "UI_resources.hh"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "MOD_ui_common.hh"
|
||||
|
||||
#include "RE_texture.h"
|
||||
|
||||
@@ -6,8 +6,6 @@
|
||||
* \ingroup modifiers
|
||||
*/
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "BKE_lib_query.hh"
|
||||
#include "BKE_mesh.hh"
|
||||
#include "BKE_modifier.hh"
|
||||
|
||||
@@ -112,14 +112,13 @@ static void required_data_mask(ModifierData *md, CustomData_MeshMasks *r_cddata_
|
||||
}
|
||||
}
|
||||
|
||||
static void waveModifier_do(WaveModifierData *md,
|
||||
static void waveModifier_do(WaveModifierData *wmd,
|
||||
const ModifierEvalContext *ctx,
|
||||
Object *ob,
|
||||
Mesh *mesh,
|
||||
float (*vertexCos)[3],
|
||||
int verts_num)
|
||||
{
|
||||
WaveModifierData *wmd = (WaveModifierData *)md;
|
||||
const MDeformVert *dvert;
|
||||
int defgrp_index;
|
||||
float ctime = DEG_get_ctime(ctx->depsgraph);
|
||||
@@ -163,7 +162,7 @@ static void waveModifier_do(WaveModifierData *md,
|
||||
lifefac = 0.0;
|
||||
}
|
||||
else {
|
||||
lifefac = float(wmd->height * (1.0f - sqrtf(lifefac / wmd->damp)));
|
||||
lifefac = (wmd->height * (1.0f - sqrtf(lifefac / wmd->damp)));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -215,7 +214,7 @@ static void waveModifier_do(WaveModifierData *md,
|
||||
amplit -= (ctime - wmd->timeoffs) * wmd->speed;
|
||||
|
||||
if (wmd->flag & MOD_WAVE_CYCL) {
|
||||
amplit = float(fmodf(amplit - wmd->width, 2.0f * wmd->width)) + wmd->width;
|
||||
amplit = fmodf(amplit - wmd->width, 2.0f * wmd->width) + wmd->width;
|
||||
}
|
||||
|
||||
if (falloff != 0.0f) {
|
||||
@@ -240,7 +239,7 @@ static void waveModifier_do(WaveModifierData *md,
|
||||
/* GAUSSIAN */
|
||||
if ((falloff_fac != 0.0f) && (amplit > -wmd->width) && (amplit < wmd->width)) {
|
||||
amplit = amplit * wmd->narrow;
|
||||
amplit = float(1.0f / expf(amplit * amplit) - minfac);
|
||||
amplit = (1.0f / expf(amplit * amplit) - minfac);
|
||||
|
||||
/* Apply texture. */
|
||||
if (tex_co) {
|
||||
|
||||
@@ -9,8 +9,6 @@
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_array_utils.hh"
|
||||
#include "BLI_bitmap.h"
|
||||
#include "BLI_linklist.h"
|
||||
#include "BLI_math_vector.h"
|
||||
|
||||
#include "BLT_translation.hh"
|
||||
@@ -18,8 +16,6 @@
|
||||
#include "DNA_defaults.h"
|
||||
#include "DNA_mesh_types.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_screen_types.h"
|
||||
|
||||
#include "BKE_attribute.hh"
|
||||
@@ -27,7 +23,6 @@
|
||||
#include "BKE_deform.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
#include "BKE_mesh.hh"
|
||||
#include "BKE_mesh_mapping.hh"
|
||||
#include "BKE_screen.hh"
|
||||
|
||||
#include "UI_interface.hh"
|
||||
|
||||
@@ -26,7 +26,6 @@
|
||||
#include "BKE_customdata.hh"
|
||||
#include "BKE_deform.hh"
|
||||
#include "BKE_modifier.hh"
|
||||
#include "BKE_scene.hh"
|
||||
#include "BKE_texture.h" /* Texture masking. */
|
||||
|
||||
#include "UI_interface.hh"
|
||||
@@ -34,7 +33,6 @@
|
||||
|
||||
#include "RNA_access.hh"
|
||||
|
||||
#include "DEG_depsgraph.hh"
|
||||
#include "DEG_depsgraph_query.hh"
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
@@ -12,8 +12,6 @@
|
||||
* - Review weight and vertex color interpolation.;
|
||||
*/
|
||||
|
||||
#include "MEM_guardedalloc.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
|
||||
#include "BLI_array.hh"
|
||||
@@ -41,8 +39,6 @@
|
||||
#include "RNA_access.hh"
|
||||
#include "RNA_prototypes.hh"
|
||||
|
||||
#include "DEG_depsgraph.hh"
|
||||
|
||||
#include "MOD_modifiertypes.hh"
|
||||
#include "MOD_ui_common.hh"
|
||||
|
||||
@@ -187,9 +183,9 @@ ModifierTypeInfo modifierType_Weld = {
|
||||
/*srna*/ &RNA_WeldModifier,
|
||||
/*type*/ ModifierTypeType::Constructive,
|
||||
/*flags*/
|
||||
(ModifierTypeFlag)(eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsMapping |
|
||||
eModifierTypeFlag_SupportsEditmode | eModifierTypeFlag_EnableInEditmode |
|
||||
eModifierTypeFlag_AcceptsCVs),
|
||||
(eModifierTypeFlag_AcceptsMesh | eModifierTypeFlag_SupportsMapping |
|
||||
eModifierTypeFlag_SupportsEditmode | eModifierTypeFlag_EnableInEditmode |
|
||||
eModifierTypeFlag_AcceptsCVs),
|
||||
/*icon*/ ICON_AUTOMERGE_OFF, /* TODO: Use correct icon. */
|
||||
|
||||
/*copy_data*/ BKE_modifier_copydata_generic,
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "BLI_linklist.h"
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_math_matrix_types.hh"
|
||||
#include "BLI_math_vector.h"
|
||||
#include "BLI_set.hh"
|
||||
@@ -18,7 +17,7 @@
|
||||
#include "ED_grease_pencil.hh"
|
||||
|
||||
#include <algorithm>
|
||||
#include <math.h>
|
||||
#include <cmath>
|
||||
|
||||
struct LineartBoundingArea;
|
||||
struct LineartEdge;
|
||||
|
||||
@@ -11,14 +11,11 @@
|
||||
#include "MOD_lineart.hh"
|
||||
|
||||
#include "BLI_listbase.h"
|
||||
#include "BLI_math_base.hh"
|
||||
#include "BLI_math_geom.h"
|
||||
#include "BLI_math_matrix.h"
|
||||
#include "BLI_math_matrix.hh"
|
||||
#include "BLI_math_rotation.h"
|
||||
#include "BLI_math_vector.hh"
|
||||
#include "BLI_sort.hh"
|
||||
#include "BLI_string.h"
|
||||
#include "BLI_task.h"
|
||||
#include "BLI_time.h"
|
||||
#include "BLI_utildefines.h"
|
||||
@@ -32,10 +29,8 @@
|
||||
#include "BKE_deform.hh"
|
||||
#include "BKE_geometry_set.hh"
|
||||
#include "BKE_global.hh"
|
||||
#include "BKE_gpencil_geom_legacy.h"
|
||||
#include "BKE_gpencil_legacy.h"
|
||||
#include "BKE_grease_pencil.hh"
|
||||
#include "BKE_grease_pencil_legacy_convert.hh"
|
||||
#include "BKE_lib_id.hh"
|
||||
#include "BKE_material.hh"
|
||||
#include "BKE_mesh.hh"
|
||||
@@ -46,7 +41,6 @@
|
||||
|
||||
#include "DNA_camera_types.h"
|
||||
#include "DNA_collection_types.h"
|
||||
#include "DNA_gpencil_legacy_types.h"
|
||||
#include "DNA_light_types.h"
|
||||
#include "DNA_material_types.h"
|
||||
#include "DNA_meshdata_types.h"
|
||||
@@ -64,8 +58,6 @@
|
||||
|
||||
#include "lineart_intern.hh"
|
||||
|
||||
#include <algorithm> /* For `min/max`. */
|
||||
|
||||
using blender::float3;
|
||||
using blender::int3;
|
||||
using blender::MutableSpan;
|
||||
@@ -2540,7 +2532,7 @@ static void lineart_object_load_single_instance(LineartData *ld,
|
||||
copy_m4d_m4(obi->normal, imat);
|
||||
|
||||
obi->original_me = use_mesh;
|
||||
obi->original_ob = (ref_ob->id.orig_id ? (Object *)ref_ob->id.orig_id : (Object *)ref_ob);
|
||||
obi->original_ob = (ref_ob->id.orig_id ? (Object *)ref_ob->id.orig_id : ref_ob);
|
||||
obi->original_ob_eval = DEG_get_evaluated_object(depsgraph, obi->original_ob);
|
||||
lineart_geometry_load_assign_thread(olti, obi, thread_count, use_mesh->faces_num);
|
||||
}
|
||||
@@ -4458,12 +4450,8 @@ static bool lineart_get_triangle_bounding_areas(
|
||||
if ((*rowend) >= ld->qtree.count_y) {
|
||||
(*rowend) = ld->qtree.count_y - 1;
|
||||
}
|
||||
if ((*colbegin) < 0) {
|
||||
(*colbegin) = 0;
|
||||
}
|
||||
if ((*rowbegin) < 0) {
|
||||
(*rowbegin) = 0;
|
||||
}
|
||||
*colbegin = std::max(*colbegin, 0);
|
||||
*rowbegin = std::max(*rowbegin, 0);
|
||||
|
||||
return true;
|
||||
}
|
||||
@@ -4531,12 +4519,8 @@ LineartBoundingArea *MOD_lineart_get_parent_bounding_area(LineartData *ld, doubl
|
||||
if (row >= ld->qtree.count_y) {
|
||||
row = ld->qtree.count_y - 1;
|
||||
}
|
||||
if (col < 0) {
|
||||
col = 0;
|
||||
}
|
||||
if (row < 0) {
|
||||
row = 0;
|
||||
}
|
||||
col = std::max(col, 0);
|
||||
row = std::max(row, 0);
|
||||
|
||||
return &ld->qtree.initials[row * ld->qtree.count_x + col];
|
||||
}
|
||||
@@ -4547,12 +4531,8 @@ static LineartBoundingArea *lineart_get_bounding_area(LineartData *ld, double x,
|
||||
double sp_w = ld->qtree.tile_width, sp_h = ld->qtree.tile_height;
|
||||
int c = int((x + 1.0) / sp_w);
|
||||
int r = ld->qtree.count_y - int((y + 1.0) / sp_h) - 1;
|
||||
if (r < 0) {
|
||||
r = 0;
|
||||
}
|
||||
if (c < 0) {
|
||||
c = 0;
|
||||
}
|
||||
r = std::max(r, 0);
|
||||
c = std::max(c, 0);
|
||||
if (r >= ld->qtree.count_y) {
|
||||
r = ld->qtree.count_y - 1;
|
||||
}
|
||||
@@ -5226,10 +5206,10 @@ bool MOD_lineart_compute_feature_lines_v3(Depsgraph *depsgraph,
|
||||
return true;
|
||||
}
|
||||
|
||||
typedef struct LineartChainWriteInfo {
|
||||
struct LineartChainWriteInfo {
|
||||
LineartEdgeChain *chain;
|
||||
int point_count;
|
||||
} LineartChainWriteInfo;
|
||||
};
|
||||
|
||||
void MOD_lineart_gpencil_generate_v3(const LineartCache *cache,
|
||||
const blender::float4x4 &inverse_mat,
|
||||
@@ -5310,7 +5290,7 @@ void MOD_lineart_gpencil_generate_v3(const LineartCache *cache,
|
||||
continue;
|
||||
}
|
||||
if (orig_col && ec->object_ref) {
|
||||
if (BKE_collection_has_object_recursive_instanced(orig_col, (Object *)ec->object_ref)) {
|
||||
if (BKE_collection_has_object_recursive_instanced(orig_col, ec->object_ref)) {
|
||||
if (modifier_flags & MOD_LINEART_INVERT_COLLECTION) {
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -144,8 +144,7 @@ void lineart_register_intersection_shadow_cuts(LineartData *ld, ListBase *shadow
|
||||
* #shadow_e in different threads. */
|
||||
for (int i = 0; i < eln_isect_original->element_count; i++) {
|
||||
LineartEdge *e = &((LineartEdge *)eln_isect_original->pointer)[i];
|
||||
LineartEdge *shadow_e = lineart_find_matching_edge(eln_isect_shadow,
|
||||
uint64_t(e->edge_identifier));
|
||||
LineartEdge *shadow_e = lineart_find_matching_edge(eln_isect_shadow, e->edge_identifier);
|
||||
if (shadow_e) {
|
||||
lineart_register_shadow_cuts(ld, e, shadow_e);
|
||||
}
|
||||
@@ -163,7 +162,7 @@ static LineartShadowSegment *lineart_give_shadow_segment(LineartData *ld)
|
||||
LineartShadowSegment *es = (LineartShadowSegment *)BLI_pophead(&ld->wasted_shadow_cuts);
|
||||
BLI_spin_unlock(&ld->lock_cuts);
|
||||
memset(es, 0, sizeof(LineartShadowSegment));
|
||||
return (LineartShadowSegment *)es;
|
||||
return es;
|
||||
}
|
||||
BLI_spin_unlock(&ld->lock_cuts);
|
||||
|
||||
@@ -293,9 +292,9 @@ static bool lineart_do_closest_segment(bool is_persp,
|
||||
*r_new_at = 0;
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
*r_new_at = is_persp ? s2_fb_co_2[3] * ga / ga_div : ga;
|
||||
}
|
||||
|
||||
*r_new_at = is_persp ? s2_fb_co_2[3] * ga / ga_div : ga;
|
||||
|
||||
interp_v3_v3v3_db(r_new_in_the_middle, s2_fb_co_1, s2_fb_co_2, *r_new_at);
|
||||
r_new_in_the_middle[3] = interpd(s2_fb_co_2[3], s2_fb_co_1[3], ga);
|
||||
interp_v3_v3v3_db(r_new_in_the_middle_global, s1_gloc_1, s1_gloc_2, ga);
|
||||
@@ -388,7 +387,7 @@ static void lineart_shadow_create_shadow_edge_array(LineartData *ld,
|
||||
LISTBASE_FOREACH (LineartEdgeSegment *, es, &e->segments) {
|
||||
DISCARD_NONSENSE_SEGMENTS
|
||||
|
||||
double next_at = es->next ? ((LineartEdgeSegment *)es->next)->ratio : 1.0f;
|
||||
double next_at = es->next ? (es->next)->ratio : 1.0f;
|
||||
/* Get correct XYZ and W coordinates. */
|
||||
interp_v3_v3v3_db(sedge[i].fbc1, e->v1->fbcoord, e->v2->fbcoord, es->ratio);
|
||||
interp_v3_v3v3_db(sedge[i].fbc2, e->v1->fbcoord, e->v2->fbcoord, next_at);
|
||||
@@ -1017,7 +1016,7 @@ static bool lineart_shadow_cast_generate_edges(LineartData *ld,
|
||||
BLI_addtail(&e->segments, &es[ei]);
|
||||
LineartVert *v1 = &vlist[ei * 2], *v2 = &vlist[ei * 2 + 1];
|
||||
copy_v3_v3_db(v1->gloc, sseg->g2);
|
||||
copy_v3_v3_db(v2->gloc, ((LineartShadowSegment *)sseg->next)->g1);
|
||||
copy_v3_v3_db(v2->gloc, (sseg->next)->g1);
|
||||
e->v1 = v1;
|
||||
e->v2 = v2;
|
||||
e->t1 = (LineartTriangle *)sedge->e_ref; /* See LineartEdge::t1 for usage. */
|
||||
@@ -1103,7 +1102,7 @@ static void lineart_shadow_register_enclosed_shapes(LineartData *ld, LineartData
|
||||
if (es->occlusion > 0) {
|
||||
continue;
|
||||
}
|
||||
double next_at = es->next ? ((LineartEdgeSegment *)es->next)->ratio : 1.0f;
|
||||
double next_at = es->next ? (es->next)->ratio : 1.0f;
|
||||
LineartEdge *orig_e = (LineartEdge *)e->t2;
|
||||
|
||||
/* Shadow view space to global. */
|
||||
|
||||
Reference in New Issue
Block a user