Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans Goudey <h.goudey@me.com>2021-06-29 06:47:29 +0300
committerHans Goudey <h.goudey@me.com>2021-06-29 06:47:29 +0300
commit5be17e92c56f84acc455f4c59f70148b1f002ffd (patch)
tree598894f2f22bf9fd946749b67c70c07ab1ec9c06 /source/blender/blenkernel
parent1d5527baf3d7ec236d3be88a4bbe0eb2cc9120f2 (diff)
parent24c321cfe9b0fb1ac4fa610b9b3387916079660c (diff)
Merge branch 'master' into refactor-vertex-group-names
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_DerivedMesh.h2
-rw-r--r--source/blender/blenkernel/BKE_action.h2
-rw-r--r--source/blender/blenkernel/BKE_animsys.h2
-rw-r--r--source/blender/blenkernel/BKE_armature.h18
-rw-r--r--source/blender/blenkernel/BKE_attribute.h8
-rw-r--r--source/blender/blenkernel/BKE_attribute_math.hh2
-rw-r--r--source/blender/blenkernel/BKE_blender_version.h2
-rw-r--r--source/blender/blenkernel/BKE_cloth.h8
-rw-r--r--source/blender/blenkernel/BKE_collision.h2
-rw-r--r--source/blender/blenkernel/BKE_constraint.h2
-rw-r--r--source/blender/blenkernel/BKE_curve.h4
-rw-r--r--source/blender/blenkernel/BKE_customdata.h19
-rw-r--r--source/blender/blenkernel/BKE_displist.h10
-rw-r--r--source/blender/blenkernel/BKE_editmesh.h10
-rw-r--r--source/blender/blenkernel/BKE_effect.h2
-rw-r--r--source/blender/blenkernel/BKE_fcurve.h12
-rw-r--r--source/blender/blenkernel/BKE_geometry_set.hh2
-rw-r--r--source/blender/blenkernel/BKE_global.h2
-rw-r--r--source/blender/blenkernel/BKE_gpencil.h4
-rw-r--r--source/blender/blenkernel/BKE_idprop.h2
-rw-r--r--source/blender/blenkernel/BKE_idtype.h4
-rw-r--r--source/blender/blenkernel/BKE_lib_id.h3
-rw-r--r--source/blender/blenkernel/BKE_lib_override.h2
-rw-r--r--source/blender/blenkernel/BKE_mesh.h5
-rw-r--r--source/blender/blenkernel/BKE_mesh_remap.h2
-rw-r--r--source/blender/blenkernel/BKE_multires.h2
-rw-r--r--source/blender/blenkernel/BKE_object.h21
-rw-r--r--source/blender/blenkernel/BKE_particle.h4
-rw-r--r--source/blender/blenkernel/BKE_screen.h4
-rw-r--r--source/blender/blenkernel/BKE_spline.hh8
-rw-r--r--source/blender/blenkernel/BKE_subsurf.h2
-rw-r--r--source/blender/blenkernel/BKE_text.h2
-rw-r--r--source/blender/blenkernel/CMakeLists.txt1
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.cc2
-rw-r--r--source/blender/blenkernel/intern/action.c7
-rw-r--r--source/blender/blenkernel/intern/action_mirror.c2
-rw-r--r--source/blender/blenkernel/intern/anim_data.c4
-rw-r--r--source/blender/blenkernel/intern/anim_path.c2
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c6
-rw-r--r--source/blender/blenkernel/intern/appdir.c2
-rw-r--r--source/blender/blenkernel/intern/armature.c12
-rw-r--r--source/blender/blenkernel/intern/armature_test.cc2
-rw-r--r--source/blender/blenkernel/intern/armature_update.c2
-rw-r--r--source/blender/blenkernel/intern/attribute_access.cc2
-rw-r--r--source/blender/blenkernel/intern/blender_copybuffer.c6
-rw-r--r--source/blender/blenkernel/intern/blender_undo.c6
-rw-r--r--source/blender/blenkernel/intern/blendfile.c2
-rw-r--r--source/blender/blenkernel/intern/bvhutils.c2
-rw-r--r--source/blender/blenkernel/intern/camera.c4
-rw-r--r--source/blender/blenkernel/intern/collection.c4
-rw-r--r--source/blender/blenkernel/intern/colortools.c6
-rw-r--r--source/blender/blenkernel/intern/constraint.c34
-rw-r--r--source/blender/blenkernel/intern/context.c7
-rw-r--r--source/blender/blenkernel/intern/curve.c40
-rw-r--r--source/blender/blenkernel/intern/curve_bevel.c2
-rw-r--r--source/blender/blenkernel/intern/curve_decimate.c4
-rw-r--r--source/blender/blenkernel/intern/curve_eval.cc10
-rw-r--r--source/blender/blenkernel/intern/customdata.c24
-rw-r--r--source/blender/blenkernel/intern/data_transfer.c4
-rw-r--r--source/blender/blenkernel/intern/displist.cc215
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c4
-rw-r--r--source/blender/blenkernel/intern/editmesh.c2
-rw-r--r--source/blender/blenkernel/intern/effect.c4
-rw-r--r--source/blender/blenkernel/intern/fcurve.c4
-rw-r--r--source/blender/blenkernel/intern/fluid.c4
-rw-r--r--source/blender/blenkernel/intern/fmodifier.c2
-rw-r--r--source/blender/blenkernel/intern/font.c4
-rw-r--r--source/blender/blenkernel/intern/geometry_component_mesh.cc2
-rw-r--r--source/blender/blenkernel/intern/geometry_set.cc14
-rw-r--r--source/blender/blenkernel/intern/geometry_set_instances.cc6
-rw-r--r--source/blender/blenkernel/intern/gpencil.c79
-rw-r--r--source/blender/blenkernel/intern/gpencil_curve.c6
-rw-r--r--source/blender/blenkernel/intern/gpencil_geom.c10
-rw-r--r--source/blender/blenkernel/intern/idprop.c40
-rw-r--r--source/blender/blenkernel/intern/image.c12
-rw-r--r--source/blender/blenkernel/intern/image_save.c2
-rw-r--r--source/blender/blenkernel/intern/ipo.c20
-rw-r--r--source/blender/blenkernel/intern/keyconfig.c2
-rw-r--r--source/blender/blenkernel/intern/lattice_deform.c6
-rw-r--r--source/blender/blenkernel/intern/layer.c4
-rw-r--r--source/blender/blenkernel/intern/lib_id.c4
-rw-r--r--source/blender/blenkernel/intern/lib_id_eval.c48
-rw-r--r--source/blender/blenkernel/intern/lib_override.c31
-rw-r--r--source/blender/blenkernel/intern/lib_query.c2
-rw-r--r--source/blender/blenkernel/intern/mask.c2
-rw-r--r--source/blender/blenkernel/intern/mball.c2
-rw-r--r--source/blender/blenkernel/intern/mball_tessellate.c31
-rw-r--r--source/blender/blenkernel/intern/mesh.c25
-rw-r--r--source/blender/blenkernel/intern/mesh_boolean_convert.cc4
-rw-r--r--source/blender/blenkernel/intern/mesh_convert.c34
-rw-r--r--source/blender/blenkernel/intern/mesh_evaluate.c4
-rw-r--r--source/blender/blenkernel/intern/mesh_mapping.c2
-rw-r--r--source/blender/blenkernel/intern/mesh_merge.c16
-rw-r--r--source/blender/blenkernel/intern/mesh_mirror.c6
-rw-r--r--source/blender/blenkernel/intern/mesh_validate.c4
-rw-r--r--source/blender/blenkernel/intern/movieclip.c6
-rw-r--r--source/blender/blenkernel/intern/multires.c6
-rw-r--r--source/blender/blenkernel/intern/multires_reshape.c2
-rw-r--r--source/blender/blenkernel/intern/multires_reshape_smooth.c6
-rw-r--r--source/blender/blenkernel/intern/multires_unsubdivide.c2
-rw-r--r--source/blender/blenkernel/intern/nla.c4
-rw-r--r--source/blender/blenkernel/intern/node.cc6
-rw-r--r--source/blender/blenkernel/intern/object.c13
-rw-r--r--source/blender/blenkernel/intern/object_update.c2
-rw-r--r--source/blender/blenkernel/intern/ocean.c16
-rw-r--r--source/blender/blenkernel/intern/ocean_intern.h2
-rw-r--r--source/blender/blenkernel/intern/ocean_spectrum.c2
-rw-r--r--source/blender/blenkernel/intern/paint.c2
-rw-r--r--source/blender/blenkernel/intern/particle.c2
-rw-r--r--source/blender/blenkernel/intern/particle_child.c2
-rw-r--r--source/blender/blenkernel/intern/particle_distribute.c2
-rw-r--r--source/blender/blenkernel/intern/particle_system.c26
-rw-r--r--source/blender/blenkernel/intern/pbvh_bmesh.c4
-rw-r--r--source/blender/blenkernel/intern/pointcache.c26
-rw-r--r--source/blender/blenkernel/intern/rigidbody.c6
-rw-r--r--source/blender/blenkernel/intern/scene.c4
-rw-r--r--source/blender/blenkernel/intern/screen.c4
-rw-r--r--source/blender/blenkernel/intern/shrinkwrap.c2
-rw-r--r--source/blender/blenkernel/intern/softbody.c182
-rw-r--r--source/blender/blenkernel/intern/spline_nurbs.cc2
-rw-r--r--source/blender/blenkernel/intern/subdiv_ccg.c6
-rw-r--r--source/blender/blenkernel/intern/subdiv_eval.c2
-rw-r--r--source/blender/blenkernel/intern/subdiv_foreach.c2
-rw-r--r--source/blender/blenkernel/intern/subsurf_ccg.c32
-rw-r--r--source/blender/blenkernel/intern/tracking_stabilize.c2
-rw-r--r--source/blender/blenkernel/intern/unit.c6
-rw-r--r--source/blender/blenkernel/intern/volume.cc2
-rw-r--r--source/blender/blenkernel/intern/workspace.c4
-rw-r--r--source/blender/blenkernel/nla_private.h10
129 files changed, 775 insertions, 652 deletions
diff --git a/source/blender/blenkernel/BKE_DerivedMesh.h b/source/blender/blenkernel/BKE_DerivedMesh.h
index 7d553b68185..684296381eb 100644
--- a/source/blender/blenkernel/BKE_DerivedMesh.h
+++ b/source/blender/blenkernel/BKE_DerivedMesh.h
@@ -329,7 +329,7 @@ void DM_copy_vert_data(struct DerivedMesh *source,
int dest_index,
int count);
-/*sets up mpolys for a DM based on face iterators in source*/
+/* Sets up mpolys for a DM based on face iterators in source. */
void DM_DupPolys(DerivedMesh *source, DerivedMesh *target);
void DM_ensure_normals(DerivedMesh *dm);
diff --git a/source/blender/blenkernel/BKE_action.h b/source/blender/blenkernel/BKE_action.h
index 3d81fcba37d..9f69c5e3976 100644
--- a/source/blender/blenkernel/BKE_action.h
+++ b/source/blender/blenkernel/BKE_action.h
@@ -108,7 +108,7 @@ void action_group_colors_sync(struct bActionGroup *grp, const struct bActionGrou
/* Add a new action group with the given name to the action */
struct bActionGroup *action_groups_add_new(struct bAction *act, const char name[]);
-/* Add given channel into (active) group */
+/* Add given channel into (active) group */
void action_groups_add_channel(struct bAction *act,
struct bActionGroup *agrp,
struct FCurve *fcurve);
diff --git a/source/blender/blenkernel/BKE_animsys.h b/source/blender/blenkernel/BKE_animsys.h
index d43332ae1ac..030560015a9 100644
--- a/source/blender/blenkernel/BKE_animsys.h
+++ b/source/blender/blenkernel/BKE_animsys.h
@@ -242,7 +242,7 @@ bool BKE_animsys_rna_path_resolve(struct PointerRNA *ptr,
bool BKE_animsys_read_from_rna_path(struct PathResolvedRNA *anim_rna, float *r_value);
bool BKE_animsys_write_to_rna_path(struct PathResolvedRNA *anim_rna, const float value);
-/* Evaluation loop for evaluating animation data */
+/* Evaluation loop for evaluating animation data. */
void BKE_animsys_evaluate_animdata(struct ID *id,
struct AnimData *adt,
const struct AnimationEvalContext *anim_eval_context,
diff --git a/source/blender/blenkernel/BKE_armature.h b/source/blender/blenkernel/BKE_armature.h
index 112b8bf3ad4..07b7aa2ec50 100644
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@ -49,24 +49,30 @@ typedef struct EditBone {
struct EditBone *next, *prev;
/** User-Defined Properties on this Bone */
struct IDProperty *prop;
- /** Editbones have a one-way link (i.e. children refer
+ /**
+ * Editbones have a one-way link (i.e. children refer
* to parents. This is converted to a two-way link for
- * normal bones when leaving editmode. */
+ * normal bones when leaving editmode.
+ */
struct EditBone *parent;
/** (64 == MAXBONENAME) */
char name[64];
- /** Roll along axis. We'll ultimately use the axis/angle method
+ /**
+ * Roll along axis. We'll ultimately use the axis/angle method
* for determining the transformation matrix of the bone. The axis
* is tail-head while roll provides the angle. Refer to Graphics
- * Gems 1 p. 466 (section IX.6) if it's not already in here somewhere*/
+ * Gems 1 p. 466 (section IX.6) if it's not already in here somewhere.
+ */
float roll;
/** Orientation and length is implicit during editing */
float head[3];
float tail[3];
- /** All joints are considered to have zero rotation with respect to
+ /**
+ * All joints are considered to have zero rotation with respect to
* their parents. Therefore any rotations specified during the
- * animation are automatically relative to the bones' rest positions*/
+ * animation are automatically relative to the bones' rest positions.
+ */
int flag;
int layer;
char inherit_scale_mode;
diff --git a/source/blender/blenkernel/BKE_attribute.h b/source/blender/blenkernel/BKE_attribute.h
index 30a595dba8e..6a1f1feb14f 100644
--- a/source/blender/blenkernel/BKE_attribute.h
+++ b/source/blender/blenkernel/BKE_attribute.h
@@ -38,12 +38,16 @@ struct ID;
struct ReportList;
/* Attribute.domain */
+/**
+ * \warning: Careful when changing existing items. Arrays may be initialized from this (e.g.
+ * #DATASET_layout_hierarchy).
+ */
typedef enum AttributeDomain {
ATTR_DOMAIN_AUTO = -1, /* Use for nodes to choose automatically based on other data. */
ATTR_DOMAIN_POINT = 0, /* Mesh, Hair or PointCloud Point */
ATTR_DOMAIN_EDGE = 1, /* Mesh Edge */
- ATTR_DOMAIN_CORNER = 2, /* Mesh Corner */
- ATTR_DOMAIN_FACE = 3, /* Mesh Face */
+ ATTR_DOMAIN_FACE = 2, /* Mesh Face */
+ ATTR_DOMAIN_CORNER = 3, /* Mesh Corner */
ATTR_DOMAIN_CURVE = 4, /* Hair Curve */
ATTR_DOMAIN_NUM
diff --git a/source/blender/blenkernel/BKE_attribute_math.hh b/source/blender/blenkernel/BKE_attribute_math.hh
index ba683362e69..2ce41e95b65 100644
--- a/source/blender/blenkernel/BKE_attribute_math.hh
+++ b/source/blender/blenkernel/BKE_attribute_math.hh
@@ -306,7 +306,7 @@ template<> struct DefaultMixerStruct<float3> {
};
template<> struct DefaultMixerStruct<ColorGeometry4f> {
/* Use a special mixer for colors. ColorGeometry4f can't be added/multiplied, because this is not
- * something one should usually do with colors. */
+ * something one should usually do with colors. */
using type = ColorGeometryMixer;
};
template<> struct DefaultMixerStruct<int> {
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index bac982708bc..d5baeb08ccc 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -39,7 +39,7 @@ extern "C" {
/* Blender file format version. */
#define BLENDER_FILE_VERSION BLENDER_VERSION
-#define BLENDER_FILE_SUBVERSION 5
+#define BLENDER_FILE_SUBVERSION 7
/* Minimum Blender version that supports reading file written with the current
* version. Older Blender versions will test this and show a warning if the file
diff --git a/source/blender/blenkernel/BKE_cloth.h b/source/blender/blenkernel/BKE_cloth.h
index 04fcdd6ed6f..a0e3d5dc142 100644
--- a/source/blender/blenkernel/BKE_cloth.h
+++ b/source/blender/blenkernel/BKE_cloth.h
@@ -103,11 +103,11 @@ typedef struct Cloth {
* The definition of a cloth vertex.
*/
typedef struct ClothVertex {
- int flags; /* General flags per vertex. */
- float v[3]; /* The velocity of the point. */
+ int flags; /* General flags per vertex. */
+ float v[3]; /* The velocity of the point. */
float xconst[3]; /* constrained position */
float x[3]; /* The current position of this vertex. */
- float xold[3]; /* The previous position of this vertex.*/
+ float xold[3]; /* The previous position of this vertex. */
float tx[3]; /* temporary position */
float txold[3]; /* temporary old position */
float tv[3]; /* temporary "velocity", mostly used as tv = tx-txold */
@@ -194,7 +194,7 @@ typedef struct ClothSpring {
} \
((void)0)
-/* Spring types as defined in the paper.*/
+/* Spring types as defined in the paper. */
typedef enum {
CLOTH_SPRING_TYPE_STRUCTURAL = (1 << 1),
CLOTH_SPRING_TYPE_SHEAR = (1 << 2),
diff --git a/source/blender/blenkernel/BKE_collision.h b/source/blender/blenkernel/BKE_collision.h
index ff1bca896b1..2c21b7355d6 100644
--- a/source/blender/blenkernel/BKE_collision.h
+++ b/source/blender/blenkernel/BKE_collision.h
@@ -63,7 +63,7 @@ typedef struct CollPair {
float time; /* collision time, from 0 up to 1 */
/* mesh-mesh collision */
-#ifdef WITH_ELTOPO /*either ap* or bp* can be set, but not both*/
+#ifdef WITH_ELTOPO /* Either ap* or bp* can be set, but not both. */
float bary[3];
int ap1, ap2, ap3, collp, bp1, bp2, bp3;
int collface;
diff --git a/source/blender/blenkernel/BKE_constraint.h b/source/blender/blenkernel/BKE_constraint.h
index afad1e26159..575df93a9fc 100644
--- a/source/blender/blenkernel/BKE_constraint.h
+++ b/source/blender/blenkernel/BKE_constraint.h
@@ -59,7 +59,7 @@ typedef struct bConstraintOb {
/** space matrix for custom object space */
float space_obj_world_matrix[4][4];
- /** type of owner */
+ /** type of owner. */
short type;
/** rotation order for constraint owner (as defined in eEulerRotationOrders in BLI_math.h) */
short rotOrder;
diff --git a/source/blender/blenkernel/BKE_curve.h b/source/blender/blenkernel/BKE_curve.h
index 2687a5ea16c..c7c5f59cab2 100644
--- a/source/blender/blenkernel/BKE_curve.h
+++ b/source/blender/blenkernel/BKE_curve.h
@@ -121,6 +121,7 @@ void BKE_curve_material_remap(struct Curve *cu, const unsigned int *remap, unsig
void BKE_curve_smooth_flag_set(struct Curve *cu, const bool use_smooth);
ListBase *BKE_curve_nurbs_get(struct Curve *cu);
+const ListBase *BKE_curve_nurbs_get_for_read(const struct Curve *cu);
int BKE_curve_nurb_vert_index_get(const struct Nurb *nu, const void *vert);
void BKE_curve_nurb_active_set(struct Curve *cu, const struct Nurb *nu);
@@ -153,9 +154,10 @@ void BKE_curve_editNurb_keyIndex_delCV(struct GHash *keyindex, const void *cv);
void BKE_curve_editNurb_keyIndex_free(struct GHash **keyindex);
void BKE_curve_editNurb_free(struct Curve *cu);
struct ListBase *BKE_curve_editNurbs_get(struct Curve *cu);
+const struct ListBase *BKE_curve_editNurbs_get_for_read(const struct Curve *cu);
void BKE_curve_bevelList_free(struct ListBase *bev);
-void BKE_curve_bevelList_make(struct Object *ob, struct ListBase *nurbs, bool for_render);
+void BKE_curve_bevelList_make(struct Object *ob, const struct ListBase *nurbs, bool for_render);
ListBase BKE_curve_bevel_make(const struct Curve *curve);
void BKE_curve_forward_diff_bezier(
diff --git a/source/blender/blenkernel/BKE_customdata.h b/source/blender/blenkernel/BKE_customdata.h
index ed319948160..c4db8ee925e 100644
--- a/source/blender/blenkernel/BKE_customdata.h
+++ b/source/blender/blenkernel/BKE_customdata.h
@@ -41,7 +41,7 @@ struct CustomData_MeshMasks;
struct ID;
typedef uint64_t CustomDataMask;
-/*a data type large enough to hold 1 element from any customdata layer type*/
+/* A data type large enough to hold 1 element from any custom-data layer type. */
typedef struct {
unsigned char data[64];
} CDBlockBytes;
@@ -109,9 +109,9 @@ bool CustomData_bmesh_has_free(const struct CustomData *data);
*/
bool CustomData_has_referenced(const struct CustomData *data);
-/* copies the "value" (e.g. mloopuv uv or mloopcol colors) from one block to
+/* Copies the "value" (e.g. mloopuv uv or mloopcol colors) from one block to
* another, while not overwriting anything else (e.g. flags). probably only
- * implemented for mloopuv/mloopcol, for now.*/
+ * implemented for mloopuv/mloopcol, for now. */
void CustomData_data_copy_value(int type, const void *source, void *dest);
/* Same as above, but doing advanced mixing.
@@ -121,7 +121,7 @@ void CustomData_data_mix_value(
/* compares if data1 is equal to data2. type is a valid CustomData type
* enum (e.g. CD_MLOOPUV). the layer type's equal function is used to compare
- * the data, if it exists, otherwise memcmp is used.*/
+ * the data, if it exists, otherwise memcmp is used. */
bool CustomData_data_equals(int type, const void *data1, const void *data2);
void CustomData_data_initminmax(int type, void *min, void *max);
void CustomData_data_dominmax(int type, const void *data, void *min, void *max);
@@ -158,7 +158,7 @@ void CustomData_realloc(struct CustomData *data, int totelem);
/* bmesh version of CustomData_merge; merges the layouts of source and dest,
* then goes through the mesh and makes sure all the customdata blocks are
- * consistent with the new layout.*/
+ * consistent with the new layout. */
bool CustomData_bmesh_merge(const struct CustomData *source,
struct CustomData *dest,
CustomDataMask mask,
@@ -186,7 +186,7 @@ void CustomData_free_temporary(struct CustomData *data, int totelem);
*/
void *CustomData_add_layer(
struct CustomData *data, int type, eCDAllocType alloctype, void *layer, int totelem);
-/*same as above but accepts a name */
+/* Same as above but accepts a name. */
void *CustomData_add_layer_named(struct CustomData *data,
int type,
eCDAllocType alloctype,
@@ -233,6 +233,9 @@ void *CustomData_duplicate_referenced_layer_named(struct CustomData *data,
const int totelem);
bool CustomData_is_referenced_layer(struct CustomData *data, int type);
+/* Duplicate all the layers with flag NOFREE, and remove the flag from duplicated layers. */
+void CustomData_duplicate_referenced_layers(CustomData *data, int totelem);
+
/* set the CD_FLAG_NOCOPY flag in custom data layers where the mask is
* zero for the layer type, so only layer types specified by the mask
* will be copied
@@ -443,7 +446,7 @@ void CustomData_validate_layer_name(const struct CustomData *data,
* only after this test passes, layer->data should be assigned */
bool CustomData_verify_versions(struct CustomData *data, int index);
-/*BMesh specific customdata stuff*/
+/* BMesh specific custom-data stuff. */
void CustomData_to_bmeshpoly(struct CustomData *fdata, struct CustomData *ldata, int totloop);
void CustomData_from_bmeshpoly(struct CustomData *fdata, struct CustomData *ldata, int total);
void CustomData_bmesh_update_active_layers(struct CustomData *fdata, struct CustomData *ldata);
@@ -536,7 +539,7 @@ enum {
CDT_MIX_ADD = 17,
CDT_MIX_SUB = 18,
CDT_MIX_MUL = 19,
- /* etc. etc. */
+ /* Etc. */
};
typedef struct CustomDataTransferLayerMap {
diff --git a/source/blender/blenkernel/BKE_displist.h b/source/blender/blenkernel/BKE_displist.h
index a2d9bbcd011..0f37ba6c4ce 100644
--- a/source/blender/blenkernel/BKE_displist.h
+++ b/source/blender/blenkernel/BKE_displist.h
@@ -32,11 +32,11 @@ extern "C" {
/** #DispList.type */
enum {
- /** A closed polygon (that can be filled). */
+ /** A closed polygon (that can be filled). */
DL_POLY = 0,
- /** An open polygon. */
+ /** An open polygon. */
DL_SEGM = 1,
- /** A grid surface that respects #DL_CYCL_U & #DL_CYCL_V. */
+ /** A grid surface that respects #DL_CYCL_U & #DL_CYCL_V. */
DL_SURF = 2,
/** Triangles. */
DL_INDEX3 = 4,
@@ -87,13 +87,11 @@ bool BKE_displist_has_faces(const struct ListBase *lb);
void BKE_displist_make_curveTypes(struct Depsgraph *depsgraph,
const struct Scene *scene,
struct Object *ob,
- const bool for_render,
- const bool for_orco);
+ const bool for_render);
void BKE_displist_make_curveTypes_forRender(struct Depsgraph *depsgraph,
const struct Scene *scene,
struct Object *ob,
struct ListBase *dispbase,
- const bool for_orco,
struct Mesh **r_final);
void BKE_displist_make_mball(struct Depsgraph *depsgraph, struct Scene *scene, struct Object *ob);
void BKE_displist_make_mball_forRender(struct Depsgraph *depsgraph,
diff --git a/source/blender/blenkernel/BKE_editmesh.h b/source/blender/blenkernel/BKE_editmesh.h
index 075a9bc0eac..e31a0a16408 100644
--- a/source/blender/blenkernel/BKE_editmesh.h
+++ b/source/blender/blenkernel/BKE_editmesh.h
@@ -53,12 +53,12 @@ struct Scene;
typedef struct BMEditMesh {
struct BMesh *bm;
- /*this is for undoing failed operations*/
+ /* This is for undoing failed operations. */
struct BMEditMesh *emcopy;
int emcopyusers;
/* we store tessellations as triplets of three loops,
- * which each define a triangle.*/
+ * which each define a triangle. */
struct BMLoop *(*looptris)[3];
int tottri;
@@ -67,14 +67,14 @@ typedef struct BMEditMesh {
/** Cached cage bounding box for selection. */
struct BoundBox *bb_cage;
- /*derivedmesh stuff*/
+ /** Evaluated mesh data-mask. */
CustomData_MeshMasks lastDataMask;
- /*selection mode*/
+ /* Selection mode. */
short selectmode;
short mat_nr;
- /*temp variables for x-mirror editing*/
+ /* Temp variables for x-mirror editing. */
int mirror_cdlayer; /* -1 is invalid */
/**
diff --git a/source/blender/blenkernel/BKE_effect.h b/source/blender/blenkernel/BKE_effect.h
index 231a4563630..3a964ddb1aa 100644
--- a/source/blender/blenkernel/BKE_effect.h
+++ b/source/blender/blenkernel/BKE_effect.h
@@ -179,7 +179,7 @@ unsigned int BKE_sim_debug_data_hash(int i);
unsigned int BKE_sim_debug_data_hash_combine(unsigned int kx, unsigned int ky);
/* _VA_SIM_DEBUG_HASH#(i, ...): combined hash value of multiple integers */
-/* internal helpers*/
+/* Internal helpers. */
#define _VA_SIM_DEBUG_HASH1(a) (BKE_sim_debug_data_hash(a))
#define _VA_SIM_DEBUG_HASH2(a, b) \
(BKE_sim_debug_data_hash_combine(BKE_sim_debug_data_hash(a), _VA_SIM_DEBUG_HASH1(b)))
diff --git a/source/blender/blenkernel/BKE_fcurve.h b/source/blender/blenkernel/BKE_fcurve.h
index 589d1839dd4..ed2d9d4507f 100644
--- a/source/blender/blenkernel/BKE_fcurve.h
+++ b/source/blender/blenkernel/BKE_fcurve.h
@@ -180,7 +180,7 @@ int BKE_fcm_envelope_find_index(struct FCM_EnvelopeData *array,
* but should become userpref */
#define BEZT_BINARYSEARCH_THRESH 0.01f /* was 0.00001, but giving errors */
-/* -------- Data Management -------- */
+/* -------- Data Management -------- */
struct FCurve *BKE_fcurve_create(void);
void BKE_fcurve_free(struct FCurve *fcu);
struct FCurve *BKE_fcurve_copy(const struct FCurve *fcu);
@@ -302,7 +302,7 @@ bool BKE_fcurve_bezt_subdivide_handles(struct BezTriple *bezt,
struct BezTriple *next,
float *r_pdelta);
-/* -------- Curve Sanity -------- */
+/* -------- Curve Sanity -------- */
void calchandles_fcurve(struct FCurve *fcu);
void calchandles_fcurve_ex(struct FCurve *fcu, eBezTriple_Flag handle_sel_flag);
@@ -312,7 +312,7 @@ bool test_time_fcurve(struct FCurve *fcu);
void BKE_fcurve_correct_bezpart(const float v1[2], float v2[2], float v3[2], const float v4[2]);
-/* -------- Evaluation -------- */
+/* -------- Evaluation -------- */
/* evaluate fcurve */
float evaluate_fcurve(struct FCurve *fcu, float evaltime);
@@ -329,7 +329,7 @@ float calculate_fcurve(struct PathResolvedRNA *anim_rna,
/* ************* F-Curve Samples API ******************** */
-/* -------- Defines -------- */
+/* -------- Defines -------- */
/* Basic signature for F-Curve sample-creation function
* - fcu: the F-Curve being operated on
@@ -337,12 +337,12 @@ float calculate_fcurve(struct PathResolvedRNA *anim_rna,
*/
typedef float (*FcuSampleFunc)(struct FCurve *fcu, void *data, float evaltime);
-/* ----- Sampling Callbacks ------ */
+/* ----- Sampling Callbacks ------ */
/* Basic sampling callback which acts as a wrapper for evaluate_fcurve() */
float fcurve_samplingcb_evalcurve(struct FCurve *fcu, void *data, float evaltime);
-/* -------- Main Methods -------- */
+/* -------- Main Methods -------- */
/* Main API function for creating a set of sampled curve data, given some callback function
* used to retrieve the values to store.
diff --git a/source/blender/blenkernel/BKE_geometry_set.hh b/source/blender/blenkernel/BKE_geometry_set.hh
index f81b582d5b1..77e827bf6f2 100644
--- a/source/blender/blenkernel/BKE_geometry_set.hh
+++ b/source/blender/blenkernel/BKE_geometry_set.hh
@@ -280,8 +280,6 @@ struct GeometrySet {
void compute_boundbox_without_instances(blender::float3 *r_min, blender::float3 *r_max) const;
friend std::ostream &operator<<(std::ostream &stream, const GeometrySet &geometry_set);
- friend bool operator==(const GeometrySet &a, const GeometrySet &b);
- uint64_t hash() const;
void clear();
diff --git a/source/blender/blenkernel/BKE_global.h b/source/blender/blenkernel/BKE_global.h
index 74f2bf7c6ad..69c950a86dc 100644
--- a/source/blender/blenkernel/BKE_global.h
+++ b/source/blender/blenkernel/BKE_global.h
@@ -149,7 +149,7 @@ enum {
G_DEBUG_DEPSGRAPH_TIME | G_DEBUG_DEPSGRAPH_UUID),
G_DEBUG_SIMDATA = (1 << 15), /* sim debug data display */
G_DEBUG_GPU = (1 << 16), /* gpu debug */
- G_DEBUG_IO = (1 << 17), /* IO Debugging (for Collada, ...)*/
+ G_DEBUG_IO = (1 << 17), /* IO Debugging (for Collada, ...). */
G_DEBUG_GPU_FORCE_WORKAROUNDS = (1 << 18), /* force gpu workarounds bypassing detections. */
G_DEBUG_XR = (1 << 19), /* XR/OpenXR messages */
G_DEBUG_XR_TIME = (1 << 20), /* XR/OpenXR timing messages */
diff --git a/source/blender/blenkernel/BKE_gpencil.h b/source/blender/blenkernel/BKE_gpencil.h
index d0a1f102a43..657e66729e1 100644
--- a/source/blender/blenkernel/BKE_gpencil.h
+++ b/source/blender/blenkernel/BKE_gpencil.h
@@ -214,6 +214,10 @@ void BKE_gpencil_layer_mask_remove_ref(struct bGPdata *gpd, const char *name);
struct bGPDlayer_Mask *BKE_gpencil_layer_mask_named_get(struct bGPDlayer *gpl, const char *name);
void BKE_gpencil_layer_mask_sort(struct bGPdata *gpd, struct bGPDlayer *gpl);
void BKE_gpencil_layer_mask_sort_all(struct bGPdata *gpd);
+void BKE_gpencil_layer_mask_copy(const struct bGPDlayer *gpl_src, struct bGPDlayer *gpl_dst);
+void BKE_gpencil_layer_mask_cleanup(struct bGPdata *gpd, struct bGPDlayer *gpl);
+void BKE_gpencil_layer_mask_cleanup_all_layers(struct bGPdata *gpd);
+
void BKE_gpencil_layer_frames_sort(struct bGPDlayer *gpl, bool *r_has_duplicate_frames);
struct bGPDlayer *BKE_gpencil_layer_get_by_name(struct bGPdata *gpd,
diff --git a/source/blender/blenkernel/BKE_idprop.h b/source/blender/blenkernel/BKE_idprop.h
index bcf35bf1197..a5cb6489194 100644
--- a/source/blender/blenkernel/BKE_idprop.h
+++ b/source/blender/blenkernel/BKE_idprop.h
@@ -67,7 +67,7 @@ void IDP_AppendArray(struct IDProperty *prop, struct IDProperty *item);
void IDP_ResizeIDPArray(struct IDProperty *prop, int len);
/* ----------- Numeric Array Type ----------- */
-/*this function works for strings too!*/
+/* This function works for strings too! */
void IDP_ResizeArray(struct IDProperty *prop, int newlen);
void IDP_FreeArray(struct IDProperty *prop);
diff --git a/source/blender/blenkernel/BKE_idtype.h b/source/blender/blenkernel/BKE_idtype.h
index 4578f1c3ca5..28171b2b363 100644
--- a/source/blender/blenkernel/BKE_idtype.h
+++ b/source/blender/blenkernel/BKE_idtype.h
@@ -82,8 +82,8 @@ typedef void (*IDTypeMakeLocalFunction)(struct Main *bmain, struct ID *id, const
typedef void (*IDTypeForeachIDFunction)(struct ID *id, struct LibraryForeachIDData *data);
typedef enum eIDTypeInfoCacheCallbackFlags {
- /** Indicates to the callback that that cache may be stored in the .blend file, so its pointer
- * should not be cleared at read-time. */
+ /** Indicates to the callback that cache may be stored in the .blend file,
+ * so its pointer should not be cleared at read-time. */
IDTYPE_CACHE_CB_FLAGS_PERSISTENT = 1 << 0,
} eIDTypeInfoCacheCallbackFlags;
typedef void (*IDTypeForeachCacheFunctionCallback)(struct ID *id,
diff --git a/source/blender/blenkernel/BKE_lib_id.h b/source/blender/blenkernel/BKE_lib_id.h
index e16507bf3cc..fac5dc8c010 100644
--- a/source/blender/blenkernel/BKE_lib_id.h
+++ b/source/blender/blenkernel/BKE_lib_id.h
@@ -315,6 +315,9 @@ void BKE_id_blend_write(struct BlendWriter *writer, struct ID *id);
#define IS_TAGGED(_id) ((_id) && (((ID *)_id)->tag & LIB_TAG_DOIT))
+/* lib_id_eval.c */
+void BKE_id_eval_properties_copy(struct ID *id_cow, struct ID *id);
+
#ifdef __cplusplus
}
#endif
diff --git a/source/blender/blenkernel/BKE_lib_override.h b/source/blender/blenkernel/BKE_lib_override.h
index 3eb0ff44129..27076d908e7 100644
--- a/source/blender/blenkernel/BKE_lib_override.h
+++ b/source/blender/blenkernel/BKE_lib_override.h
@@ -99,6 +99,8 @@ void BKE_lib_override_library_main_resync(struct Main *bmain,
void BKE_lib_override_library_delete(struct Main *bmain, struct ID *id_root);
+void BKE_lib_override_library_make_local(struct ID *id);
+
struct IDOverrideLibraryProperty *BKE_lib_override_library_property_find(
struct IDOverrideLibrary *override, const char *rna_path);
struct IDOverrideLibraryProperty *BKE_lib_override_library_property_get(
diff --git a/source/blender/blenkernel/BKE_mesh.h b/source/blender/blenkernel/BKE_mesh.h
index 8ddfb0c8eb2..6d74888b810 100644
--- a/source/blender/blenkernel/BKE_mesh.h
+++ b/source/blender/blenkernel/BKE_mesh.h
@@ -128,7 +128,8 @@ struct Mesh *BKE_mesh_copy_for_eval(struct Mesh *source, bool reference);
/* These functions construct a new Mesh,
* contrary to BKE_mesh_from_nurbs which modifies ob itself. */
struct Mesh *BKE_mesh_new_nomain_from_curve(struct Object *ob);
-struct Mesh *BKE_mesh_new_nomain_from_curve_displist(struct Object *ob, struct ListBase *dispbase);
+struct Mesh *BKE_mesh_new_nomain_from_curve_displist(const struct Object *ob,
+ const struct ListBase *dispbase);
bool BKE_mesh_ensure_facemap_customdata(struct Mesh *me);
bool BKE_mesh_clear_facemap_customdata(struct Mesh *me);
@@ -151,7 +152,7 @@ int BKE_mesh_nurbs_to_mdata(struct Object *ob,
struct MPoly **r_allpoly,
int *r_totloop,
int *r_totpoly);
-int BKE_mesh_nurbs_displist_to_mdata(struct Object *ob,
+int BKE_mesh_nurbs_displist_to_mdata(const struct Object *ob,
const struct ListBase *dispbase,
struct MVert **r_allvert,
int *r_totvert,
diff --git a/source/blender/blenkernel/BKE_mesh_remap.h b/source/blender/blenkernel/BKE_mesh_remap.h
index d9b6ab3813e..02f8af6443c 100644
--- a/source/blender/blenkernel/BKE_mesh_remap.h
+++ b/source/blender/blenkernel/BKE_mesh_remap.h
@@ -36,7 +36,7 @@ typedef struct MeshPairRemapItem {
int sources_num;
int *indices_src; /* NULL if no source found. */
float *weights_src; /* NULL if no source found, else, always normalized! */
- /* UNUSED (at the moment)*/
+ /* UNUSED (at the moment). */
// float hit_dist; /* FLT_MAX if irrelevant or no source found. */
int island; /* For loops only. */
} MeshPairRemapItem;
diff --git a/source/blender/blenkernel/BKE_multires.h b/source/blender/blenkernel/BKE_multires.h
index fce25abba7f..11bfc4b2b3a 100644
--- a/source/blender/blenkernel/BKE_multires.h
+++ b/source/blender/blenkernel/BKE_multires.h
@@ -220,7 +220,7 @@ BLI_INLINE void BKE_multires_construct_tangent_matrix(float tangent_matrix[3][3]
/* Versioning. */
/* Convert displacement which is stored for simply-subdivided mesh to a Catmull-Clark
- * subdivided mesh. */
+ * subdivided mesh. */
void multires_do_versions_simple_to_catmull_clark(struct Object *object,
struct MultiresModifierData *mmd);
diff --git a/source/blender/blenkernel/BKE_object.h b/source/blender/blenkernel/BKE_object.h
index b0b1657c162..af9f5d7bf22 100644
--- a/source/blender/blenkernel/BKE_object.h
+++ b/source/blender/blenkernel/BKE_object.h
@@ -382,20 +382,19 @@ void BKE_object_data_batch_cache_dirty_tag(struct ID *object_data);
/* this function returns a superset of the scenes selection based on relationships */
typedef enum eObRelationTypes {
- OB_REL_NONE = 0, /* just the selection as is */
- OB_REL_PARENT = (1 << 0), /* immediate parent */
- OB_REL_PARENT_RECURSIVE = (1 << 1), /* parents up to root of selection tree*/
- OB_REL_CHILDREN = (1 << 2), /* immediate children */
- OB_REL_CHILDREN_RECURSIVE = (1 << 3), /* All children */
- OB_REL_MOD_ARMATURE = (1 << 4), /* Armatures related to the selected objects */
- /* OB_REL_SCENE_CAMERA = (1 << 5), */ /* you might want the scene camera too even if unselected?
- */
+ OB_REL_NONE = 0, /* Just the selection as is. */
+ OB_REL_PARENT = (1 << 0), /* Immediate parent. */
+ OB_REL_PARENT_RECURSIVE = (1 << 1), /* Parents up to root of selection tree. */
+ OB_REL_CHILDREN = (1 << 2), /* Immediate children. */
+ OB_REL_CHILDREN_RECURSIVE = (1 << 3), /* All children. */
+ OB_REL_MOD_ARMATURE = (1 << 4), /* Armatures related to the selected objects. */
+ // OB_REL_SCENE_CAMERA = (1 << 5), /* You might want the scene camera too even if unselected? */
} eObRelationTypes;
typedef enum eObjectSet {
- OB_SET_SELECTED, /* Selected Objects */
- OB_SET_VISIBLE, /* Visible Objects */
- OB_SET_ALL, /* All Objects */
+ OB_SET_SELECTED, /* Selected Objects. */
+ OB_SET_VISIBLE, /* Visible Objects. */
+ OB_SET_ALL, /* All Objects. */
} eObjectSet;
struct LinkNode *BKE_object_relational_superset(struct ViewLayer *view_layer,
diff --git a/source/blender/blenkernel/BKE_particle.h b/source/blender/blenkernel/BKE_particle.h
index 3913ede9049..e5b547d2557 100644
--- a/source/blender/blenkernel/BKE_particle.h
+++ b/source/blender/blenkernel/BKE_particle.h
@@ -78,7 +78,7 @@ struct Scene;
for (p = 0; p < psys->totpart; p++) \
if ((pa = psys->particles + p)->state.time > 0.0f)
-/* fast but sure way to get the modifier*/
+/* Fast but sure way to get the modifier. */
#define PARTICLE_PSMD \
ParticleSystemModifierData *psmd = sim->psmd ? sim->psmd : psys_get_modifier(sim->ob, sim->psys)
@@ -190,7 +190,7 @@ typedef struct ParticleCollisionElement {
/* pointers to original data */
float *x[3], *v[3];
- /* values interpolated from original data*/
+ /* Values interpolated from original data. */
float x0[3], x1[3], x2[3], p[3];
/* results for found intersection point */
diff --git a/source/blender/blenkernel/BKE_screen.h b/source/blender/blenkernel/BKE_screen.h
index 085851ba5e6..fed155626ed 100644
--- a/source/blender/blenkernel/BKE_screen.h
+++ b/source/blender/blenkernel/BKE_screen.h
@@ -62,7 +62,7 @@ struct wmWindow;
struct wmWindowManager;
/* spacetype has everything stored to get an editor working, it gets initialized via
- * ED_spacetypes_init() in editors/space_api/spacetypes.c */
+ * #ED_spacetypes_init() in `editors/space_api/spacetypes.c` */
/* an editor in Blender is a combined ScrArea + SpaceType + SpaceData */
#define BKE_ST_MAXNAME 64
@@ -206,7 +206,7 @@ typedef struct ARegionType {
* performed.
*
* This callback is not called on indirect changes of the current viewport (which could happen
- * when the `v2d->tot is changed and `cur` is adopted accordingly). */
+ * when the `v2d->tot is changed and `cur` is adopted accordingly). */
void (*on_view2d_changed)(const struct bContext *C, struct ARegion *region);
/* custom drawing callbacks */
diff --git a/source/blender/blenkernel/BKE_spline.hh b/source/blender/blenkernel/BKE_spline.hh
index 24b5a78e598..1aac2e311e3 100644
--- a/source/blender/blenkernel/BKE_spline.hh
+++ b/source/blender/blenkernel/BKE_spline.hh
@@ -32,6 +32,7 @@
#include "BKE_attribute_math.hh"
struct Curve;
+struct ListBase;
class Spline;
using SplinePtr = std::unique_ptr<Spline>;
@@ -328,7 +329,8 @@ class BezierSpline final : public Spline {
};
InterpolationData interpolation_data_from_index_factor(const float index_factor) const;
- virtual blender::fn::GVArrayPtr interpolate_to_evaluated(const blender::fn::GVArray &src) const;
+ virtual blender::fn::GVArrayPtr interpolate_to_evaluated(
+ const blender::fn::GVArray &src) const override;
void evaluate_segment(const int index,
const int next_index,
@@ -545,4 +547,6 @@ struct CurveEval {
void assert_valid_point_attributes() const;
};
-std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &curve);
+std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &curve,
+ const ListBase &nurbs_list);
+std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &dna_curve);
diff --git a/source/blender/blenkernel/BKE_subsurf.h b/source/blender/blenkernel/BKE_subsurf.h
index 07bbeafb1ae..3816a822279 100644
--- a/source/blender/blenkernel/BKE_subsurf.h
+++ b/source/blender/blenkernel/BKE_subsurf.h
@@ -25,7 +25,7 @@
/* struct DerivedMesh is used directly */
#include "BKE_DerivedMesh.h"
-/* Thread sync primitives used directly. */
+/* Thread sync primitives used directly. */
#include "BLI_threads.h"
#ifdef __cplusplus
diff --git a/source/blender/blenkernel/BKE_text.h b/source/blender/blenkernel/BKE_text.h
index c60d5c7bfec..26351ee65c2 100644
--- a/source/blender/blenkernel/BKE_text.h
+++ b/source/blender/blenkernel/BKE_text.h
@@ -91,7 +91,7 @@ bool txt_cursor_is_line_end(struct Text *text);
int txt_calc_tab_left(struct TextLine *tl, int ch);
int txt_calc_tab_right(struct TextLine *tl, int ch);
-/* utility functions, could be moved somewhere more generic but are python/text related */
+/* Utility functions, could be moved somewhere more generic but are python/text related. */
int text_check_bracket(const char ch);
bool text_check_delim(const char ch);
bool text_check_digit(const char ch);
diff --git a/source/blender/blenkernel/CMakeLists.txt b/source/blender/blenkernel/CMakeLists.txt
index 0f36887b234..20663f0a790 100644
--- a/source/blender/blenkernel/CMakeLists.txt
+++ b/source/blender/blenkernel/CMakeLists.txt
@@ -165,6 +165,7 @@ set(SRC
intern/layer_utils.c
intern/lib_id.c
intern/lib_id_delete.c
+ intern/lib_id_eval.c
intern/lib_override.c
intern/lib_query.c
intern/lib_remap.c
diff --git a/source/blender/blenkernel/intern/DerivedMesh.cc b/source/blender/blenkernel/intern/DerivedMesh.cc
index 3008585033d..d390da6c96a 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.cc
+++ b/source/blender/blenkernel/intern/DerivedMesh.cc
@@ -959,7 +959,7 @@ static Mesh *modifier_modify_mesh_and_geometry_set(ModifierData *md,
mesh_output = mesh_component.release();
}
- /* Return an empty mesh instead of null. */
+ /* Return an empty mesh instead of null. */
if (mesh_output == nullptr) {
mesh_output = BKE_mesh_new_nomain(0, 0, 0, 0, 0);
BKE_mesh_copy_parameters_for_eval(mesh_output, input_mesh);
diff --git a/source/blender/blenkernel/intern/action.c b/source/blender/blenkernel/intern/action.c
index 71d242e9c79..fdf3558abed 100644
--- a/source/blender/blenkernel/intern/action.c
+++ b/source/blender/blenkernel/intern/action.c
@@ -370,7 +370,7 @@ void set_active_action_group(bAction *act, bActionGroup *agrp, short select)
/* Sync colors used for action/bone group with theme settings */
void action_group_colors_sync(bActionGroup *grp, const bActionGroup *ref_grp)
{
- /* only do color copying if using a custom color (i.e. not default color) */
+ /* Only do color copying if using a custom color (i.e. not default color). */
if (grp->customCol) {
if (grp->customCol > 0) {
/* copy theme colors on-to group's custom color in case user tries to edit color */
@@ -486,8 +486,7 @@ void action_groups_add_channel(bAction *act, bActionGroup *agrp, FCurve *fcurve)
/* If grp is NULL, that means we fell through, and this F-Curve should be added as the new
* first since group is (effectively) the first group. Thus, the existing first F-Curve becomes
- * the second in the chain, etc. etc.
- */
+ * the second in the chain, etc. */
if (grp == NULL) {
BLI_insertlinkbefore(&act->curves, act->curves.first, fcurve);
}
@@ -1856,7 +1855,7 @@ void BKE_pose_blend_write(BlendWriter *writer, bPose *pose, bArmature *arm)
/* Write channels */
LISTBASE_FOREACH (bPoseChannel *, chan, &pose->chanbase) {
/* Write ID Properties -- and copy this comment EXACTLY for easy finding
- * of library blocks that implement this.*/
+ * of library blocks that implement this. */
if (chan->prop) {
IDP_BlendWrite(writer, chan->prop);
}
diff --git a/source/blender/blenkernel/intern/action_mirror.c b/source/blender/blenkernel/intern/action_mirror.c
index c975d2bfb9c..69e0091444b 100644
--- a/source/blender/blenkernel/intern/action_mirror.c
+++ b/source/blender/blenkernel/intern/action_mirror.c
@@ -343,7 +343,7 @@ static void action_flip_pchan(Object *ob_arm,
} \
((void)0)
- /* Write the values back the the F-curves. */
+ /* Write the values back the F-curves. */
WRITE_ARRAY_FLT(loc);
WRITE_ARRAY_FLT(eul);
WRITE_ARRAY_FLT(quat);
diff --git a/source/blender/blenkernel/intern/anim_data.c b/source/blender/blenkernel/intern/anim_data.c
index 44b760aefc8..2f71dda17f2 100644
--- a/source/blender/blenkernel/intern/anim_data.c
+++ b/source/blender/blenkernel/intern/anim_data.c
@@ -946,7 +946,7 @@ static bool nlastrips_path_rename_fix(ID *owner_id,
is_changed |= fcurves_path_rename_fix(
owner_id, prefix, oldName, newName, oldKey, newKey, &strip->act->curves, verify_paths);
}
- /* Ignore own F-Curves, since those are local. */
+ /* Ignore own F-Curves, since those are local. */
/* Check sub-strips (if meta-strips). */
is_changed |= nlastrips_path_rename_fix(
owner_id, prefix, oldName, newName, oldKey, newKey, &strip->strips, verify_paths);
@@ -1422,7 +1422,7 @@ void BKE_animdata_fix_paths_rename_all(ID *ref_id,
* NOTE: it is assumed that the structure we're replacing is <prefix><["><name><"]>
* i.e. pose.bones["Bone"]
*/
-/* TODO: use BKE_animdata_main_cb for looping over all data */
+/* TODO: use BKE_animdata_main_cb for looping over all data. */
void BKE_animdata_fix_paths_rename_all_ex(Main *bmain,
ID *ref_id,
const char *prefix,
diff --git a/source/blender/blenkernel/intern/anim_path.c b/source/blender/blenkernel/intern/anim_path.c
index af2b386a30a..e2c2708101b 100644
--- a/source/blender/blenkernel/intern/anim_path.c
+++ b/source/blender/blenkernel/intern/anim_path.c
@@ -327,7 +327,7 @@ bool BKE_where_on_path(const Object *ob,
}
const Nurb *nu = nurbs->first;
- /* make sure that first and last frame are included in the vectors here */
+ /* Make sure that first and last frame are included in the vectors here. */
if (ELEM(nu->type, CU_POLY, CU_BEZIER, CU_NURBS)) {
key_curve_position_weights(frac, w, KEY_LINEAR);
}
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index e347306e0ae..08a3f3fcf4f 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -852,7 +852,7 @@ NlaEvalStrip *nlastrips_ctime_get_strip(ListBase *list,
/* loop over strips, checking if they fall within the range */
for (strip = strips->first; strip; strip = strip->next) {
- /* check if current time occurs within this strip */
+ /* Check if current time occurs within this strip. */
if (IN_RANGE_INCL(ctime, strip->start, strip->end) ||
(strip->flag & NLASTRIP_FLAG_NO_TIME_MAP)) {
/* this strip is active, so try to use it */
@@ -1564,7 +1564,7 @@ static bool nla_blend_get_inverted_strip_value(const int blendmode,
}
}
-/** \returns true if solution exists and output is written to. */
+/** \returns true if solution exists and output is written to. */
static bool nla_combine_get_inverted_strip_value(const int mix_mode,
float base_value,
const float lower_value,
@@ -2017,7 +2017,7 @@ static void nlaeval_fmodifiers_join_stacks(ListBase *result, ListBase *list1, Li
{
FModifier *fcm1, *fcm2;
- /* if list1 is invalid... */
+ /* if list1 is invalid... */
if (ELEM(NULL, list1, list1->first)) {
if (list2 && list2->first) {
result->first = list2->first;
diff --git a/source/blender/blenkernel/intern/appdir.c b/source/blender/blenkernel/intern/appdir.c
index bcfd34ab42f..579f671e2b0 100644
--- a/source/blender/blenkernel/intern/appdir.c
+++ b/source/blender/blenkernel/intern/appdir.c
@@ -200,7 +200,7 @@ bool BKE_appdir_folder_documents(char *dir)
return true;
}
- /* Ghost couldn't give us a documents path, let's try if we can find it ourselves.*/
+ /* Ghost couldn't give us a documents path, let's try if we can find it ourselves. */
const char *home_path = BKE_appdir_folder_home();
if (!home_path || !BLI_is_dir(home_path)) {
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index a57e1d6b2dd..5799f82bf94 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -198,7 +198,7 @@ static void write_bone(BlendWriter *writer, Bone *bone)
BLO_write_struct(writer, Bone, bone);
/* Write ID Properties -- and copy this comment EXACTLY for easy finding
- * of library blocks that implement this.*/
+ * of library blocks that implement this. */
if (bone->prop) {
IDP_BlendWrite(writer, bone->prop);
}
@@ -1627,7 +1627,7 @@ void BKE_armature_mat_world_to_pose(Object *ob, const float inmat[4][4], float o
return;
}
- /* get inverse of (armature) object's matrix */
+ /* Get inverse of (armature) object's matrix. */
invert_m4_m4(obmat, ob->obmat);
/* multiply given matrix by object's-inverse to find pose-space matrix */
@@ -2063,9 +2063,11 @@ void BKE_armature_mat_pose_to_delta(float delta_mat[4][4],
* Used for Objects and Pose Channels, since both can have multiple rotation representations.
* \{ */
-/* Called from RNA when rotation mode changes
+/**
+ * Called from RNA when rotation mode changes
* - the result should be that the rotations given in the provided pointers have had conversions
- * applied (as appropriate), such that the rotation of the element hasn't 'visually' changed */
+ * applied (as appropriate), such that the rotation of the element hasn't 'visually' changed.
+ */
void BKE_rotMode_change_values(
float quat[4], float eul[3], float axis[3], float *angle, short oldMode, short newMode)
{
@@ -2333,7 +2335,7 @@ void BKE_armature_where_is_bone(Bone *bone, const Bone *bone_parent, const bool
/* yoffs(b-1) + root(b) + bonemat(b) */
BKE_bone_offset_matrix_get(bone, offs_bone);
- /* Compose the matrix for this bone */
+ /* Compose the matrix for this bone. */
mul_m4_m4m4(bone->arm_mat, bone_parent->arm_mat, offs_bone);
}
else {
diff --git a/source/blender/blenkernel/intern/armature_test.cc b/source/blender/blenkernel/intern/armature_test.cc
index 366bbe3e37c..589337d9d01 100644
--- a/source/blender/blenkernel/intern/armature_test.cc
+++ b/source/blender/blenkernel/intern/armature_test.cc
@@ -121,7 +121,7 @@ TEST(vec_roll_to_mat3_normalized, Rotationmatrix)
/* TODO: This test will pass after fixing T82455) */
/* If normalized_vector is close to -Y and
* it has X and Z values above a threshold,
- * apply the special case. */
+ * apply the special case. */
{
const float expected_roll_mat[3][3] = {{0.000000f, -9.99999975e-06f, 1.000000f},
{9.99999975e-06f, -0.999999881f, 9.99999975e-06f},
diff --git a/source/blender/blenkernel/intern/armature_update.c b/source/blender/blenkernel/intern/armature_update.c
index 4504f10967c..0f8956a1a91 100644
--- a/source/blender/blenkernel/intern/armature_update.c
+++ b/source/blender/blenkernel/intern/armature_update.c
@@ -837,7 +837,7 @@ void BKE_pose_eval_init_ik(struct Depsgraph *depsgraph, Scene *scene, Object *ob
BIK_init_tree(depsgraph, scene, object, ctime);
/* construct the Spline IK trees
* - this is not integrated as an IK plugin, since it should be able
- * to function in conjunction with standard IK. */
+ * to function in conjunction with standard IK. */
BKE_pose_splineik_init_tree(scene, object, ctime);
}
diff --git a/source/blender/blenkernel/intern/attribute_access.cc b/source/blender/blenkernel/intern/attribute_access.cc
index 8bbb3014dac..aa0af294bc3 100644
--- a/source/blender/blenkernel/intern/attribute_access.cc
+++ b/source/blender/blenkernel/intern/attribute_access.cc
@@ -1197,7 +1197,7 @@ static blender::bke::OutputAttribute create_output_attribute(
cpp_type->size() * domain_size, cpp_type->alignment(), __func__);
if (ignore_old_values) {
/* This does nothing for trivially constructible types, but is necessary for correctness. */
- cpp_type->construct_default_n(data, domain);
+ cpp_type->default_construct_n(data, domain);
}
else {
/* Fill the temporary array with values from the existing attribute. */
diff --git a/source/blender/blenkernel/intern/blender_copybuffer.c b/source/blender/blenkernel/intern/blender_copybuffer.c
index c8fedc086b8..9c9f898afef 100644
--- a/source/blender/blenkernel/intern/blender_copybuffer.c
+++ b/source/blender/blenkernel/intern/blender_copybuffer.c
@@ -87,7 +87,8 @@ bool BKE_copybuffer_read(Main *bmain_dst,
ReportList *reports,
const uint64_t id_types_mask)
{
- BlendHandle *bh = BLO_blendhandle_from_file(libname, &(BlendFileReadReport){.reports = reports});
+ BlendFileReadReport bf_reports = {.reports = reports};
+ BlendHandle *bh = BLO_blendhandle_from_file(libname, &bf_reports);
if (bh == NULL) {
/* Error reports will have been made by BLO_blendhandle_from_file(). */
return false;
@@ -133,7 +134,8 @@ int BKE_copybuffer_paste(bContext *C,
BlendHandle *bh;
const int id_tag_extra = 0;
- bh = BLO_blendhandle_from_file(libname, &(BlendFileReadReport){.reports = reports});
+ BlendFileReadReport bf_reports = {.reports = reports};
+ bh = BLO_blendhandle_from_file(libname, &bf_reports);
if (bh == NULL) {
/* error reports will have been made by BLO_blendhandle_from_file() */
diff --git a/source/blender/blenkernel/intern/blender_undo.c b/source/blender/blenkernel/intern/blender_undo.c
index 6f47cd1336e..411ece21599 100644
--- a/source/blender/blenkernel/intern/blender_undo.c
+++ b/source/blender/blenkernel/intern/blender_undo.c
@@ -78,10 +78,10 @@ bool BKE_memfile_undo_decode(MemFileUndoData *mfu,
if (UNDO_DISK) {
const struct BlendFileReadParams params = {0};
- struct BlendFileData *bfd = BKE_blendfile_read(
- mfu->filename, &params, &(BlendFileReadReport){NULL});
+ BlendFileReadReport bf_reports = {.reports = NULL};
+ struct BlendFileData *bfd = BKE_blendfile_read(mfu->filename, &params, &bf_reports);
if (bfd != NULL) {
- BKE_blendfile_read_setup(C, bfd, &params, &(BlendFileReadReport){NULL});
+ BKE_blendfile_read_setup(C, bfd, &params, &bf_reports);
success = true;
}
}
diff --git a/source/blender/blenkernel/intern/blendfile.c b/source/blender/blenkernel/intern/blendfile.c
index 9ea1c8fedda..f31d8f5ade7 100644
--- a/source/blender/blenkernel/intern/blendfile.c
+++ b/source/blender/blenkernel/intern/blendfile.c
@@ -272,7 +272,7 @@ static void setup_app_data(bContext *C,
/* We need to tag this here because events may be handled immediately after.
* only the current screen is important because we won't have to handle
- * events from multiple screens at once.*/
+ * events from multiple screens at once. */
if (curscreen) {
BKE_screen_gizmo_tag_refresh(curscreen);
}
diff --git a/source/blender/blenkernel/intern/bvhutils.c b/source/blender/blenkernel/intern/bvhutils.c
index 116e6279657..4659c464099 100644
--- a/source/blender/blenkernel/intern/bvhutils.c
+++ b/source/blender/blenkernel/intern/bvhutils.c
@@ -1143,7 +1143,7 @@ static BVHTree *bvhtree_from_editmesh_looptri_create_tree(float epsilon,
bool insert = looptri_mask ? BLI_BITMAP_TEST_BOOL(looptri_mask, i) : true;
if (insert) {
- /* No reason found to block hit-testing the triangle for snap, so insert it now.*/
+ /* No reason found to block hit-testing the triangle for snap, so insert it now. */
float co[3][3];
copy_v3_v3(co[0], ltri[0]->v->co);
copy_v3_v3(co[1], ltri[1]->v->co);
diff --git a/source/blender/blenkernel/intern/camera.c b/source/blender/blenkernel/intern/camera.c
index bab9e2a5592..5172b067eba 100644
--- a/source/blender/blenkernel/intern/camera.c
+++ b/source/blender/blenkernel/intern/camera.c
@@ -615,7 +615,7 @@ static void camera_frame_fit_data_init(const Scene *scene,
BKE_camera_params_init(params);
BKE_camera_params_from_object(params, ob);
- /* compute matrix, viewplane, .. */
+ /* Compute matrix, view-plane, etc. */
if (scene) {
BKE_camera_params_compute_viewplane(
params, scene->r.xsch, scene->r.ysch, scene->r.xasp, scene->r.yasp);
@@ -975,7 +975,7 @@ void BKE_camera_multiview_window_matrix(const RenderData *rd,
BKE_camera_params_from_object(&params, camera);
BKE_camera_multiview_params(rd, &params, camera, viewname);
- /* Compute matrix, viewplane, .. */
+ /* Compute matrix, view-plane, etc. */
BKE_camera_params_compute_viewplane(&params, rd->xsch, rd->ysch, rd->xasp, rd->yasp);
BKE_camera_params_compute_matrix(&params);
diff --git a/source/blender/blenkernel/intern/collection.c b/source/blender/blenkernel/intern/collection.c
index aa51ee0017e..fdffe7dca57 100644
--- a/source/blender/blenkernel/intern/collection.c
+++ b/source/blender/blenkernel/intern/collection.c
@@ -710,7 +710,7 @@ Collection *BKE_collection_duplicate(Main *bmain,
* unless its duplication is a sub-process of another one. */
collection_new->id.tag &= ~LIB_TAG_NEW;
- /* This code will follow into all ID links using an ID tagged with LIB_TAG_NEW.*/
+ /* This code will follow into all ID links using an ID tagged with LIB_TAG_NEW. */
BKE_libblock_relink_to_newid(&collection_new->id);
#ifndef NDEBUG
@@ -1458,7 +1458,7 @@ bool BKE_collection_cycle_find(Collection *new_ancestor, Collection *collection)
}
/* Find possible objects in collection or its children, that would instantiate the given ancestor
- * collection (that would also make a fully invalid cycle of dependencies) .*/
+ * collection (that would also make a fully invalid cycle of dependencies). */
return collection_instance_find_recursive(collection, new_ancestor);
}
diff --git a/source/blender/blenkernel/intern/colortools.c b/source/blender/blenkernel/intern/colortools.c
index f30fcc54b23..df2277387ce 100644
--- a/source/blender/blenkernel/intern/colortools.c
+++ b/source/blender/blenkernel/intern/colortools.c
@@ -1280,12 +1280,12 @@ static void save_sample_line(
{
float yuv[3];
- /* vectorscope*/
+ /* Vector-scope. */
rgb_to_yuv(rgb[0], rgb[1], rgb[2], &yuv[0], &yuv[1], &yuv[2], BLI_YUV_ITU_BT709);
scopes->vecscope[idx + 0] = yuv[1];
scopes->vecscope[idx + 1] = yuv[2];
- /* waveform */
+ /* Waveform. */
switch (scopes->wavefrm_mode) {
case SCOPES_WAVEFRM_RGB:
case SCOPES_WAVEFRM_RGB_PARADE:
@@ -1497,7 +1497,7 @@ static void scopes_update_cb(void *__restrict userdata,
mul_v3_fl(ycc, INV_255);
minmax_v3v3_v3(min, max, ycc);
}
- /* increment count for histo*/
+ /* Increment count for histo. */
bin_lum[get_bin_float(luma)]++;
bin_r[get_bin_float(rgba[0])]++;
bin_g[get_bin_float(rgba[1])]++;
diff --git a/source/blender/blenkernel/intern/constraint.c b/source/blender/blenkernel/intern/constraint.c
index 826c79c3764..1d5cfa752a4 100644
--- a/source/blender/blenkernel/intern/constraint.c
+++ b/source/blender/blenkernel/intern/constraint.c
@@ -222,7 +222,7 @@ void BKE_constraints_clear_evalob(bConstraintOb *cob)
/* XXX This would seem to be in wrong order. However, it does not work in 'right' order -
* would be nice to understand why premul is needed here instead of usual postmul?
* In any case, we **do not get a delta** here (e.g. startmat & matrix having same location,
- * still gives a 'delta' with non-null translation component :/ ).*/
+ * still gives a 'delta' with non-null translation component :/ ). */
mul_m4_m4m4(delta, cob->matrix, imat);
/* copy matrices back to source */
@@ -272,7 +272,7 @@ void BKE_constraint_mat_convertspace(Object *ob,
float diff_mat[4][4];
float imat[4][4];
- /* prevent crashes in these unlikely events */
+ /* Prevent crashes in these unlikely events. */
if (ob == NULL || mat == NULL) {
return;
}
@@ -1491,7 +1491,7 @@ static void followpath_get_tarmat(struct Depsgraph *UNUSED(depsgraph),
dir,
(data->followflag & FOLLOWPATH_FOLLOW) ? quat : NULL,
&radius,
- NULL)) { /* quat_pt is quat or NULL*/
+ NULL)) { /* quat_pt is quat or NULL. */
float totmat[4][4];
unit_m4(totmat);
@@ -2361,7 +2361,7 @@ static void pycon_new_data(void *cdata)
{
bPythonConstraint *data = (bPythonConstraint *)cdata;
- /* everything should be set correctly by calloc, except for the prop->type constant.*/
+ /* Everything should be set correctly by calloc, except for the prop->type constant. */
data->prop = MEM_callocN(sizeof(IDProperty), "PyConstraintProps");
data->prop->type = IDP_GROUP;
}
@@ -3523,7 +3523,7 @@ static void stretchto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
scale[0] = 1.0;
scale[2] = 1.0;
break;
- default: /* should not happen, but in case*/
+ default: /* Should not happen, but in case. */
return;
} /* switch (data->volmode) */
@@ -3536,34 +3536,34 @@ static void stretchto_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *t
damptrack_do_transform(cob->matrix, vec, TRACK_Y);
break;
case PLANE_X:
- /* new Y aligns object target connection*/
+ /* New Y aligns object target connection. */
copy_v3_v3(cob->matrix[1], vec);
- /* build new Z vector */
- /* othogonal to "new Y" "old X! plane */
+ /* Build new Z vector. */
+ /* Orthogonal to "new Y" "old X! plane. */
cross_v3_v3v3(orth, xx, vec);
normalize_v3(orth);
- /* new Z*/
+ /* New Z. */
copy_v3_v3(cob->matrix[2], orth);
- /* we decided to keep X plane*/
+ /* We decided to keep X plane. */
cross_v3_v3v3(xx, vec, orth);
normalize_v3_v3(cob->matrix[0], xx);
break;
case PLANE_Z:
- /* new Y aligns object target connection*/
+ /* New Y aligns object target connection. */
copy_v3_v3(cob->matrix[1], vec);
- /* build new X vector */
- /* othogonal to "new Y" "old Z! plane */
+ /* Build new X vector. */
+ /* Orthogonal to "new Y" "old Z! plane. */
cross_v3_v3v3(orth, zz, vec);
normalize_v3(orth);
- /* new X */
+ /* New X. */
negate_v3_v3(cob->matrix[0], orth);
- /* we decided to keep Z */
+ /* We decided to keep Z. */
cross_v3_v3v3(zz, vec, orth);
normalize_v3_v3(cob->matrix[2], zz);
break;
@@ -4678,7 +4678,7 @@ static void pivotcon_evaluate(bConstraint *con, bConstraintOb *cob, ListBase *ta
}
}
- /* find the pivot-point to use */
+ /* Find the pivot-point to use. */
if (VALID_CONS_TARGET(ct)) {
/* apply offset to target location */
add_v3_v3v3(pivot, ct->matrix[3], data->offset);
@@ -6297,7 +6297,7 @@ void BKE_constraint_blend_write(BlendWriter *writer, ListBase *conlist)
}
/* Write ID Properties -- and copy this comment EXACTLY for easy finding
- * of library blocks that implement this.*/
+ * of library blocks that implement this. */
IDP_BlendWrite(writer, data->prop);
break;
diff --git a/source/blender/blenkernel/intern/context.c b/source/blender/blenkernel/intern/context.c
index 81830f5bb61..1028790856c 100644
--- a/source/blender/blenkernel/intern/context.c
+++ b/source/blender/blenkernel/intern/context.c
@@ -1225,8 +1225,11 @@ enum eContextObjectMode CTX_data_mode_enum(const bContext *C)
return CTX_data_mode_enum_ex(obedit, obact, obact ? obact->mode : OB_MODE_OBJECT);
}
-/* would prefer if we can use the enum version below over this one - Campbell */
-/* must be aligned with above enum */
+/**
+ * Would prefer if we can use the enum version below over this one - Campbell.
+ *
+ * \note Must be aligned with above enum.
+ */
static const char *data_mode_strings[] = {
"mesh_edit", "curve_edit", "surface_edit", "text_edit",
"armature_edit", "mball_edit", "lattice_edit", "posemode",
diff --git a/source/blender/blenkernel/intern/curve.c b/source/blender/blenkernel/intern/curve.c
index 65cdb8503a4..a5538453248 100644
--- a/source/blender/blenkernel/intern/curve.c
+++ b/source/blender/blenkernel/intern/curve.c
@@ -442,6 +442,15 @@ ListBase *BKE_curve_editNurbs_get(Curve *cu)
return NULL;
}
+const ListBase *BKE_curve_editNurbs_get_for_read(const Curve *cu)
+{
+ if (cu->editnurb) {
+ return &cu->editnurb->nurbs;
+ }
+
+ return NULL;
+}
+
short BKE_curve_type_get(const Curve *cu)
{
int type = cu->type;
@@ -1926,7 +1935,7 @@ static int cu_isectLL(const float v1[3],
static bool bevelinside(const BevList *bl1, const BevList *bl2)
{
/* is bl2 INSIDE bl1 ? with left-right method and "lambda's" */
- /* returns '1' if correct hole */
+ /* returns '1' if correct hole. */
BevPoint *bevp, *prevbevp;
float min, max, vec[3], hvec1[3], hvec2[3], lab, mu;
int nr, links = 0, rechts = 0, mode;
@@ -1941,7 +1950,7 @@ static bool bevelinside(const BevList *bl1, const BevList *bl2)
hvec2[0] += 1000;
/* test it with all edges of potential surrounding poly */
- /* count number of transitions left-right */
+ /* count number of transitions left-right. */
bevp = bl1->bevpoints;
nr = bl1->nr;
@@ -2049,7 +2058,7 @@ static void calc_bevel_sin_cos(
static void tilt_bezpart(const BezTriple *prevbezt,
const BezTriple *bezt,
- Nurb *nu,
+ const Nurb *nu,
float *tilt_array,
float *radius_array,
float *weight_array,
@@ -2133,7 +2142,7 @@ static void tilt_bezpart(const BezTriple *prevbezt,
}
if (weight_array) {
- /* basic interpolation for now, could copy tilt interp too */
+ /* Basic interpolation for now, could copy tilt interp too. */
*weight_array = prevbezt->weight + (bezt->weight - prevbezt->weight) *
(3.0f * fac * fac - 2.0f * fac * fac * fac);
@@ -2611,7 +2620,7 @@ static void make_bevel_list_2D(BevList *bl)
}
}
-static void bevlist_firstlast_direction_calc_from_bpoint(Nurb *nu, BevList *bl)
+static void bevlist_firstlast_direction_calc_from_bpoint(const Nurb *nu, BevList *bl)
{
if (nu->pntsu > 1) {
BPoint *first_bp = nu->bp, *last_bp = nu->bp + (nu->pntsu - 1);
@@ -2646,7 +2655,7 @@ void BKE_curve_bevelList_free(ListBase *bev)
BLI_listbase_clear(bev);
}
-void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
+void BKE_curve_bevelList_make(Object *ob, const ListBase *nurbs, const bool for_render)
{
/*
* - convert all curves to polys, with indication of resol and flags for double-vertices
@@ -2684,14 +2693,14 @@ void BKE_curve_bevelList_make(Object *ob, ListBase *nurbs, bool for_render)
1;
#endif
- /* STEP 1: MAKE POLYS */
+ /* STEP 1: MAKE POLYS */
BKE_curve_bevelList_free(&ob->runtime.curve_cache->bev);
if (cu->editnurb && ob->type != OB_FONT) {
is_editmode = 1;
}
- LISTBASE_FOREACH (Nurb *, nu, nurbs) {
+ LISTBASE_FOREACH (const Nurb *, nu, nurbs) {
if (nu->hide && is_editmode) {
continue;
}
@@ -4361,7 +4370,7 @@ void BKE_nurbList_handles_set(ListBase *editnurb, const char code)
else {
char h_new = HD_FREE;
- /* there is 1 handle not FREE: FREE it all, else make ALIGNED */
+ /* There is 1 handle not FREE: FREE it all, else make ALIGNED. */
if (code == 5) {
h_new = HD_ALIGN;
}
@@ -4932,7 +4941,7 @@ bool BKE_nurb_type_convert(Nurb *nu,
int a, c, nr;
if (nu->type == CU_POLY) {
- if (type == CU_BEZIER) { /* to Bezier with vecthandles */
+ if (type == CU_BEZIER) { /* To Bezier with vecthandles. */
nr = nu->pntsu;
bezt = (BezTriple *)MEM_calloc_arrayN(nr, sizeof(BezTriple), "setsplinetype2");
nu->bezt = bezt;
@@ -5078,6 +5087,15 @@ ListBase *BKE_curve_nurbs_get(Curve *cu)
return &cu->nurb;
}
+const ListBase *BKE_curve_nurbs_get_for_read(const Curve *cu)
+{
+ if (cu->editnurb) {
+ return BKE_curve_editNurbs_get_for_read(cu);
+ }
+
+ return &cu->nurb;
+}
+
void BKE_curve_nurb_active_set(Curve *cu, const Nurb *nu)
{
if (nu == NULL) {
@@ -5135,7 +5153,7 @@ void BKE_curve_nurb_vert_active_set(Curve *cu, const Nurb *nu, const void *vert)
}
}
-/* Get points to active active nurb and active vert for curve */
+/* Get points to the active nurb and active vert for curve. */
bool BKE_curve_nurb_vert_active_get(Curve *cu, Nurb **r_nu, void **r_vert)
{
Nurb *nu = NULL;
diff --git a/source/blender/blenkernel/intern/curve_bevel.c b/source/blender/blenkernel/intern/curve_bevel.c
index 7f2cdfa59d3..d205d8cca46 100644
--- a/source/blender/blenkernel/intern/curve_bevel.c
+++ b/source/blender/blenkernel/intern/curve_bevel.c
@@ -97,7 +97,7 @@ static void curve_bevel_make_extrude_and_fill(const Curve *cu,
* in a consistent direction.
*
* These should be small enough for stack allocations because the current limit
- * for #Curve.bevresol is 32. */
+ * for #Curve.bevresol is 32. */
float *quarter_coords_x = alloca(sizeof(float) * (cu->bevresol + 1));
float *quarter_coords_y = alloca(sizeof(float) * (cu->bevresol + 1));
bevel_quarter_fill(cu, quarter_coords_x, quarter_coords_y);
diff --git a/source/blender/blenkernel/intern/curve_decimate.c b/source/blender/blenkernel/intern/curve_decimate.c
index e4647908b58..62de7c74183 100644
--- a/source/blender/blenkernel/intern/curve_decimate.c
+++ b/source/blender/blenkernel/intern/curve_decimate.c
@@ -32,8 +32,8 @@
struct Knot {
struct Knot *next, *prev;
- uint point_index; /* index in point array */
- uint knot_index; /* index in knot array*/
+ uint point_index; /* Index in point array. */
+ uint knot_index; /* Index in knot array. */
float tan[2][3];
float handles[2];
diff --git a/source/blender/blenkernel/intern/curve_eval.cc b/source/blender/blenkernel/intern/curve_eval.cc
index 0a6e4458a35..72ee2587c8a 100644
--- a/source/blender/blenkernel/intern/curve_eval.cc
+++ b/source/blender/blenkernel/intern/curve_eval.cc
@@ -257,9 +257,10 @@ static SplinePtr spline_from_dna_poly(const Nurb &nurb)
return spline;
}
-std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &dna_curve)
+std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &dna_curve,
+ const ListBase &nurbs_list)
{
- Vector<const Nurb *> nurbs(*BKE_curve_nurbs_get(&const_cast<Curve &>(dna_curve)));
+ Vector<const Nurb *> nurbs(nurbs_list);
std::unique_ptr<CurveEval> curve = std::make_unique<CurveEval>();
curve->resize(nurbs.size());
@@ -295,6 +296,11 @@ std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &dna_curve)
return curve;
}
+std::unique_ptr<CurveEval> curve_eval_from_dna_curve(const Curve &dna_curve)
+{
+ return curve_eval_from_dna_curve(dna_curve, *BKE_curve_nurbs_get_for_read(&dna_curve));
+}
+
/**
* Check the invariants that curve control point attributes should always uphold, necessary
* because attributes are stored on splines rather than in a flat array on the curve:
diff --git a/source/blender/blenkernel/intern/customdata.c b/source/blender/blenkernel/intern/customdata.c
index b1bb8b9715e..08d0af45e92 100644
--- a/source/blender/blenkernel/intern/customdata.c
+++ b/source/blender/blenkernel/intern/customdata.c
@@ -2099,7 +2099,7 @@ bool CustomData_merge(const struct CustomData *source,
eCDAllocType alloctype,
int totelem)
{
- /*const LayerTypeInfo *typeInfo;*/
+ // const LayerTypeInfo *typeInfo;
CustomDataLayer *layer, *newlayer;
int lasttype = -1, lastactive = 0, lastrender = 0, lastclone = 0, lastmask = 0;
int number = 0, maxnumber = -1;
@@ -2107,7 +2107,7 @@ bool CustomData_merge(const struct CustomData *source,
for (int i = 0; i < source->totlayer; i++) {
layer = &source->layers[i];
- /*typeInfo = layerType_getInfo(layer->type);*/ /*UNUSED*/
+ // typeInfo = layerType_getInfo(layer->type); /* UNUSED */
int type = layer->type;
int flag = layer->flag;
@@ -2631,7 +2631,7 @@ void *CustomData_add_layer(
return NULL;
}
-/*same as above but accepts a name*/
+/* Same as above but accepts a name. */
void *CustomData_add_layer_named(CustomData *data,
int type,
eCDAllocType alloctype,
@@ -2813,6 +2813,14 @@ void *CustomData_duplicate_referenced_layer_named(CustomData *data,
return customData_duplicate_referenced_layer_index(data, layer_index, totelem);
}
+void CustomData_duplicate_referenced_layers(CustomData *data, int totelem)
+{
+ for (int i = 0; i < data->totlayer; i++) {
+ CustomDataLayer *layer = &data->layers[i];
+ layer->data = customData_duplicate_referenced_layer_index(data, i, totelem);
+ }
+}
+
bool CustomData_is_referenced_layer(struct CustomData *data, int type)
{
/* get the layer index of the first layer of type */
@@ -3559,7 +3567,7 @@ bool CustomData_bmesh_merge(const CustomData *source,
if (iter_type != BM_LOOPS_OF_FACE) {
BMHeader *h;
BMIter iter;
- /*ensure all current elements follow new customdata layout*/
+ /* Ensure all current elements follow new customdata layout. */
BM_ITER_MESH (h, &iter, bm, iter_type) {
void *tmp = NULL;
CustomData_bmesh_copy_data(&destold, dest, h->data, &tmp);
@@ -3573,7 +3581,7 @@ bool CustomData_bmesh_merge(const CustomData *source,
BMIter iter;
BMIter liter;
- /*ensure all current elements follow new customdata layout*/
+ /* Ensure all current elements follow new customdata layout. */
BM_ITER_MESH (f, &iter, bm, BM_FACES_OF_MESH) {
BM_ITER_ELEM (l, &liter, f, BM_LOOPS_OF_FACE) {
void *tmp = NULL;
@@ -3797,7 +3805,7 @@ void *CustomData_bmesh_get_n(const CustomData *data, void *block, int type, int
return POINTER_OFFSET(block, data->layers[layer_index + n].offset);
}
-/*gets from the layer at physical index n, note: doesn't check type.*/
+/* Gets from the layer at physical index n, note: doesn't check type. */
void *CustomData_bmesh_get_layer_n(const CustomData *data, void *block, int n)
{
if (n < 0 || n >= data->totlayer) {
@@ -3879,7 +3887,7 @@ bool CustomData_has_referenced(const struct CustomData *data)
}
/* copies the "value" (e.g. mloopuv uv or mloopcol colors) from one block to
- * another, while not overwriting anything else (e.g. flags)*/
+ * another, while not overwriting anything else (e.g. flags). */
void CustomData_data_copy_value(int type, const void *source, void *dest)
{
const LayerTypeInfo *typeInfo = layerType_getInfo(type);
@@ -3897,7 +3905,7 @@ void CustomData_data_copy_value(int type, const void *source, void *dest)
}
/* Mixes the "value" (e.g. mloopuv uv or mloopcol colors) from one block into
- * another, while not overwriting anything else (e.g. flags)*/
+ * another, while not overwriting anything else (e.g. flags). */
void CustomData_data_mix_value(
int type, const void *source, void *dest, const int mixmode, const float mixfactor)
{
diff --git a/source/blender/blenkernel/intern/data_transfer.c b/source/blender/blenkernel/intern/data_transfer.c
index 2bf58d9e764..12269cf0d51 100644
--- a/source/blender/blenkernel/intern/data_transfer.c
+++ b/source/blender/blenkernel/intern/data_transfer.c
@@ -1260,7 +1260,7 @@ void BKE_object_data_transfer_layout(struct Depsgraph *depsgraph,
me_dst = ob_dst->data;
- /* Get source evaluated mesh.*/
+ /* Get source evaluated mesh. */
BKE_object_data_transfer_dttypes_to_cdmask(data_types, &me_src_mask);
me_src = mesh_get_eval_final(depsgraph, scene, ob_src, &me_src_mask);
if (!me_src) {
@@ -1441,7 +1441,7 @@ bool BKE_object_data_transfer_ex(struct Depsgraph *depsgraph,
}
}
- /* Get source evaluated mesh.*/
+ /* Get source evaluated mesh. */
BKE_object_data_transfer_dttypes_to_cdmask(data_types, &me_src_mask);
BKE_mesh_remap_calc_source_cddata_masks_from_map_modes(
map_vert_mode, map_edge_mode, map_loop_mode, map_poly_mode, &me_src_mask);
diff --git a/source/blender/blenkernel/intern/displist.cc b/source/blender/blenkernel/intern/displist.cc
index 70355f3883d..cfe4701fb69 100644
--- a/source/blender/blenkernel/intern/displist.cc
+++ b/source/blender/blenkernel/intern/displist.cc
@@ -135,7 +135,7 @@ void BKE_displist_normals_add(ListBase *lb)
LISTBASE_FOREACH (DispList *, dl, lb) {
if (dl->type == DL_INDEX3) {
if (dl->nors == nullptr) {
- dl->nors = (float *)MEM_callocN(sizeof(float[3]), "dlnors");
+ dl->nors = (float *)MEM_callocN(sizeof(float[3]), __func__);
if (dl->flag & DL_BACK_CURVE) {
dl->nors[2] = -1.0f;
@@ -147,7 +147,7 @@ void BKE_displist_normals_add(ListBase *lb)
}
else if (dl->type == DL_SURF) {
if (dl->nors == nullptr) {
- dl->nors = (float *)MEM_callocN(sizeof(float[3]) * dl->nr * dl->parts, "dlnors");
+ dl->nors = (float *)MEM_callocN(sizeof(float[3]) * dl->nr * dl->parts, __func__);
vdata = dl->verts;
ndata = dl->nors;
@@ -323,12 +323,12 @@ static void curve_to_displist(const Curve *cu,
/* Check that there are more than two points so the curve doesn't loop back on itself. This
* needs to be separate from `is_cyclic` because cyclic sampling can work with two points
- * and resolution > 1. */
+ * and resolution > 1. */
const bool use_cyclic_sample = is_cyclic && (samples_len != 2);
DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), __func__);
/* Add one to the length because of 'BKE_curve_forward_diff_bezier'. */
- dl->verts = (float *)MEM_mallocN(sizeof(float[3]) * (samples_len + 1), "dlverts");
+ dl->verts = (float *)MEM_mallocN(sizeof(float[3]) * (samples_len + 1), __func__);
BLI_addtail(r_dispbase, dl);
dl->parts = 1;
dl->nr = samples_len;
@@ -382,7 +382,7 @@ static void curve_to_displist(const Curve *cu,
else if (nu->type == CU_NURBS) {
const int len = (resolution * SEGMENTSU(nu));
DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), __func__);
- dl->verts = (float *)MEM_mallocN(len * sizeof(float[3]), "dlverts");
+ dl->verts = (float *)MEM_mallocN(len * sizeof(float[3]), __func__);
BLI_addtail(r_dispbase, dl);
dl->parts = 1;
dl->nr = len;
@@ -395,7 +395,7 @@ static void curve_to_displist(const Curve *cu,
else if (nu->type == CU_POLY) {
const int len = nu->pntsu;
DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), __func__);
- dl->verts = (float *)MEM_mallocN(len * sizeof(float[3]), "dlverts");
+ dl->verts = (float *)MEM_mallocN(len * sizeof(float[3]), __func__);
BLI_addtail(r_dispbase, dl);
dl->parts = 1;
dl->nr = len;
@@ -491,7 +491,7 @@ void BKE_displist_fill(const ListBase *dispbase,
const int triangles_len = BLI_scanfill_calc_ex(&sf_ctx, scanfill_flag, normal_proj);
if (totvert != 0 && triangles_len != 0) {
- DispList *dlnew = (DispList *)MEM_callocN(sizeof(DispList), "filldisplist");
+ DispList *dlnew = (DispList *)MEM_callocN(sizeof(DispList), __func__);
dlnew->type = DL_INDEX3;
dlnew->flag = (dl_flag_accum & (DL_BACK_CURVE | DL_FRONT_CURVE));
dlnew->rt = (dl_rt_accum & CU_SMOOTH);
@@ -499,8 +499,8 @@ void BKE_displist_fill(const ListBase *dispbase,
dlnew->nr = totvert;
dlnew->parts = triangles_len;
- dlnew->index = (int *)MEM_mallocN(sizeof(int[3]) * triangles_len, "dlindex");
- dlnew->verts = (float *)MEM_mallocN(sizeof(float[3]) * totvert, "dlverts");
+ dlnew->index = (int *)MEM_mallocN(sizeof(int[3]) * triangles_len, __func__);
+ dlnew->verts = (float *)MEM_mallocN(sizeof(float[3]) * totvert, __func__);
/* vert data */
int i;
@@ -630,7 +630,7 @@ static float displist_calc_taper(Depsgraph *depsgraph,
(DispList *)taperobj->runtime.curve_cache->disp.first :
nullptr;
if (dl == nullptr) {
- BKE_displist_make_curveTypes(depsgraph, scene, taperobj, false, false);
+ BKE_displist_make_curveTypes(depsgraph, scene, taperobj, false);
dl = (DispList *)taperobj->runtime.curve_cache->disp.first;
}
if (dl) {
@@ -681,8 +681,7 @@ void BKE_displist_make_mball(Depsgraph *depsgraph, Scene *scene, Object *ob)
BKE_displist_free(&(ob->runtime.curve_cache->disp));
}
else {
- ob->runtime.curve_cache = (CurveCache *)MEM_callocN(sizeof(CurveCache),
- "CurveCache for MBall");
+ ob->runtime.curve_cache = (CurveCache *)MEM_callocN(sizeof(CurveCache), __func__);
}
BKE_mball_polygonize(depsgraph, scene, ob, &ob->runtime.curve_cache->disp);
@@ -1068,7 +1067,7 @@ static void displist_surf_indices(DispList *dl)
dl->totindex = 0;
int *index = dl->index = (int *)MEM_mallocN(sizeof(int[4]) * (dl->parts + 1) * (dl->nr + 1),
- "index array nurbs");
+ __func__);
for (int a = 0; a < dl->parts; a++) {
@@ -1092,31 +1091,29 @@ static void displist_surf_indices(DispList *dl)
}
}
-static void displist_make_surf(Depsgraph *depsgraph,
- const Scene *scene,
- Object *ob,
- ListBase *dispbase,
- Mesh **r_final,
- const bool for_render,
- const bool for_orco)
+static void evaluate_surface_object(Depsgraph *depsgraph,
+ const Scene *scene,
+ Object *ob,
+ const bool for_render,
+ ListBase *r_dispbase,
+ Mesh **r_final)
{
- ListBase nubase = {nullptr, nullptr};
+ BLI_assert(ob->type == OB_SURF);
const Curve *cu = (const Curve *)ob->data;
+ ListBase *deformed_nurbs = &ob->runtime.curve_cache->deformed_nurbs;
+
if (!for_render && cu->editnurb) {
- BKE_nurbList_duplicate(&nubase, BKE_curve_editNurbs_get(const_cast<Curve *>(cu)));
+ BKE_nurbList_duplicate(deformed_nurbs, BKE_curve_editNurbs_get_for_read(cu));
}
else {
- BKE_nurbList_duplicate(&nubase, &cu->nurb);
+ BKE_nurbList_duplicate(deformed_nurbs, &cu->nurb);
}
- bool force_mesh_conversion = false;
- if (!for_orco) {
- force_mesh_conversion = BKE_curve_calc_modifiers_pre(
- depsgraph, scene, ob, &nubase, &nubase, for_render);
- }
+ bool force_mesh_conversion = BKE_curve_calc_modifiers_pre(
+ depsgraph, scene, ob, deformed_nurbs, deformed_nurbs, for_render);
- LISTBASE_FOREACH (Nurb *, nu, &nubase) {
+ LISTBASE_FOREACH (const Nurb *, nu, deformed_nurbs) {
if (!(for_render || nu->hide == 0) || !BKE_nurb_check_valid_uv(nu)) {
continue;
}
@@ -1127,10 +1124,10 @@ static void displist_make_surf(Depsgraph *depsgraph,
if (nu->pntsv == 1) {
const int len = SEGMENTSU(nu) * resolu;
- DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), "makeDispListsurf");
- dl->verts = (float *)MEM_mallocN(len * sizeof(float[3]), "dlverts");
+ DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), __func__);
+ dl->verts = (float *)MEM_mallocN(len * sizeof(float[3]), __func__);
- BLI_addtail(dispbase, dl);
+ BLI_addtail(r_dispbase, dl);
dl->parts = 1;
dl->nr = len;
dl->col = nu->mat_nr;
@@ -1150,9 +1147,9 @@ static void displist_make_surf(Depsgraph *depsgraph,
else {
const int len = (nu->pntsu * resolu) * (nu->pntsv * resolv);
- DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), "makeDispListsurf");
- dl->verts = (float *)MEM_mallocN(len * sizeof(float[3]), "dlverts");
- BLI_addtail(dispbase, dl);
+ DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), __func__);
+ dl->verts = (float *)MEM_mallocN(len * sizeof(float[3]), __func__);
+ BLI_addtail(r_dispbase, dl);
dl->col = nu->mat_nr;
dl->charidx = nu->charidx;
@@ -1177,13 +1174,8 @@ static void displist_make_surf(Depsgraph *depsgraph,
}
}
- if (!for_orco) {
- BKE_nurbList_duplicate(&ob->runtime.curve_cache->deformed_nurbs, &nubase);
- curve_calc_modifiers_post(
- depsgraph, scene, ob, dispbase, for_render, force_mesh_conversion, r_final);
- }
-
- BKE_nurbList_free(&nubase);
+ curve_calc_modifiers_post(
+ depsgraph, scene, ob, r_dispbase, for_render, force_mesh_conversion, r_final);
}
static void rotateBevelPiece(const Curve *cu,
@@ -1252,8 +1244,8 @@ static void fillBevelCap(const Nurb *nu,
const float *prev_fp,
ListBase *dispbase)
{
- DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), "makeDispListbev2");
- dl->verts = (float *)MEM_mallocN(sizeof(float[3]) * dlb->nr, "dlverts");
+ DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), __func__);
+ dl->verts = (float *)MEM_mallocN(sizeof(float[3]) * dlb->nr, __func__);
memcpy(dl->verts, prev_fp, sizeof(float[3]) * dlb->nr);
dl->type = DL_POLY;
@@ -1403,67 +1395,47 @@ static void calc_bevfac_mapping(const Curve *cu,
}
}
-static void do_makeDispListCurveTypes(Depsgraph *depsgraph,
- const Scene *scene,
- Object *ob,
- ListBase *dispbase,
- const bool for_render,
- const bool for_orco,
- Mesh **r_final)
+static void evaluate_curve_type_object(Depsgraph *depsgraph,
+ const Scene *scene,
+ Object *ob,
+ const bool for_render,
+ ListBase *r_dispbase,
+ Mesh **r_final)
{
+ BLI_assert(ELEM(ob->type, OB_CURVE, OB_FONT));
const Curve *cu = (const Curve *)ob->data;
- /* we do allow duplis... this is only displist on curve level */
- if (!ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT)) {
- return;
- }
-
- if (ob->type == OB_SURF) {
- displist_make_surf(depsgraph, scene, ob, dispbase, r_final, for_render, for_orco);
- return;
- }
-
- ListBase nubase = {nullptr, nullptr};
- bool force_mesh_conversion = false;
-
- BKE_curve_bevelList_free(&ob->runtime.curve_cache->bev);
-
- /* We only re-evaluate path if evaluation is not happening for orco.
- * If the calculation happens for orco, we should never free data which
- * was needed before and only not needed for orco calculation. */
- if (!for_orco) {
- if (ob->runtime.curve_cache->anim_path_accum_length) {
- MEM_freeN((void *)ob->runtime.curve_cache->anim_path_accum_length);
- }
- ob->runtime.curve_cache->anim_path_accum_length = nullptr;
- }
+ ListBase *deformed_nurbs = &ob->runtime.curve_cache->deformed_nurbs;
if (ob->type == OB_FONT) {
- BKE_vfont_to_curve_nubase(ob, FO_EDIT, &nubase);
+ BKE_vfont_to_curve_nubase(ob, FO_EDIT, deformed_nurbs);
}
else {
- BKE_nurbList_duplicate(&nubase, BKE_curve_nurbs_get(const_cast<Curve *>(cu)));
+ BKE_nurbList_duplicate(deformed_nurbs, BKE_curve_nurbs_get_for_read(cu));
}
- if (!for_orco) {
- force_mesh_conversion = BKE_curve_calc_modifiers_pre(
- depsgraph, scene, ob, &nubase, &nubase, for_render);
- }
+ bool force_mesh_conversion = BKE_curve_calc_modifiers_pre(
+ depsgraph, scene, ob, deformed_nurbs, deformed_nurbs, for_render);
+
+ BKE_curve_bevelList_make(ob, deformed_nurbs, for_render);
- BKE_curve_bevelList_make(ob, &nubase, for_render);
+ if ((cu->flag & CU_PATH) ||
+ DEG_get_eval_flags_for_id(depsgraph, &ob->id) & DAG_EVAL_NEED_CURVE_PATH) {
+ BKE_anim_path_calc_data(ob);
+ }
/* If curve has no bevel will return nothing */
ListBase dlbev = BKE_curve_bevel_make(cu);
/* no bevel or extrude, and no width correction? */
if (BLI_listbase_is_empty(&dlbev) && cu->width == 1.0f) {
- curve_to_displist(cu, &nubase, for_render, dispbase);
+ curve_to_displist(cu, deformed_nurbs, for_render, r_dispbase);
}
else {
const float widfac = cu->width - 1.0f;
- BevList *bl = (BevList *)ob->runtime.curve_cache->bev.first;
- Nurb *nu = (Nurb *)nubase.first;
+ const BevList *bl = (BevList *)ob->runtime.curve_cache->bev.first;
+ const Nurb *nu = (Nurb *)deformed_nurbs->first;
for (; bl && nu; bl = bl->next, nu = nu->next) {
float *data;
@@ -1475,7 +1447,7 @@ static void do_makeDispListCurveTypes(Depsgraph *depsgraph,
if (BLI_listbase_is_empty(&dlbev)) {
DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), "makeDispListbev");
dl->verts = (float *)MEM_mallocN(sizeof(float[3]) * bl->nr, "dlverts");
- BLI_addtail(dispbase, dl);
+ BLI_addtail(r_dispbase, dl);
if (bl->poly != -1) {
dl->type = DL_POLY;
@@ -1523,9 +1495,9 @@ static void do_makeDispListCurveTypes(Depsgraph *depsgraph,
LISTBASE_FOREACH (DispList *, dlb, &dlbev) {
/* for each part of the bevel use a separate displblock */
- DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), "makeDispListbev1");
- dl->verts = data = (float *)MEM_mallocN(sizeof(float[3]) * dlb->nr * steps, "dlverts");
- BLI_addtail(dispbase, dl);
+ DispList *dl = (DispList *)MEM_callocN(sizeof(DispList), __func__);
+ dl->verts = data = (float *)MEM_mallocN(sizeof(float[3]) * dlb->nr * steps, __func__);
+ BLI_addtail(r_dispbase, dl);
dl->type = DL_SURF;
@@ -1621,62 +1593,51 @@ static void do_makeDispListCurveTypes(Depsgraph *depsgraph,
}
if (bottom_capbase.first) {
- BKE_displist_fill(&bottom_capbase, dispbase, bottom_no, false);
- BKE_displist_fill(&top_capbase, dispbase, top_no, false);
+ BKE_displist_fill(&bottom_capbase, r_dispbase, bottom_no, false);
+ BKE_displist_fill(&top_capbase, r_dispbase, top_no, false);
BKE_displist_free(&bottom_capbase);
BKE_displist_free(&top_capbase);
}
}
}
- BKE_displist_free(&dlbev);
}
+ BKE_displist_free(&dlbev);
+
if (!(cu->flag & CU_DEFORM_FILL)) {
- curve_to_filledpoly(cu, dispbase);
+ curve_to_filledpoly(cu, r_dispbase);
}
- if (!for_orco) {
- if ((cu->flag & CU_PATH) ||
- DEG_get_eval_flags_for_id(depsgraph, &ob->id) & DAG_EVAL_NEED_CURVE_PATH) {
- BKE_anim_path_calc_data(ob);
- }
-
- BKE_nurbList_duplicate(&ob->runtime.curve_cache->deformed_nurbs, &nubase);
- curve_calc_modifiers_post(
- depsgraph, scene, ob, dispbase, for_render, force_mesh_conversion, r_final);
- }
+ curve_calc_modifiers_post(
+ depsgraph, scene, ob, r_dispbase, for_render, force_mesh_conversion, r_final);
if (cu->flag & CU_DEFORM_FILL && !ob->runtime.data_eval) {
- curve_to_filledpoly(cu, dispbase);
+ curve_to_filledpoly(cu, r_dispbase);
}
-
- BKE_nurbList_free(&nubase);
}
void BKE_displist_make_curveTypes(Depsgraph *depsgraph,
const Scene *scene,
Object *ob,
- const bool for_render,
- const bool for_orco)
+ const bool for_render)
{
- /* The same check for duplis as in do_makeDispListCurveTypes.
- * Happens when curve used for constraint/bevel was converted to mesh.
- * check there is still needed for render displist and orco displists. */
- if (!ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT)) {
- return;
- }
+ BLI_assert(ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT));
BKE_object_free_derived_caches(ob);
if (!ob->runtime.curve_cache) {
- ob->runtime.curve_cache = (CurveCache *)MEM_callocN(sizeof(CurveCache),
- "CurveCache for curve types");
+ ob->runtime.curve_cache = (CurveCache *)MEM_callocN(sizeof(CurveCache), __func__);
}
ListBase *dispbase = &(ob->runtime.curve_cache->disp);
Mesh *mesh_eval = nullptr;
- do_makeDispListCurveTypes(depsgraph, scene, ob, dispbase, for_render, for_orco, &mesh_eval);
+ if (ob->type == OB_SURF) {
+ evaluate_surface_object(depsgraph, scene, ob, for_render, dispbase, &mesh_eval);
+ }
+ else {
+ evaluate_curve_type_object(depsgraph, scene, ob, for_render, dispbase, &mesh_eval);
+ }
if (mesh_eval != nullptr) {
BKE_object_eval_assign_data(ob, &mesh_eval->id, true);
@@ -1685,19 +1646,19 @@ void BKE_displist_make_curveTypes(Depsgraph *depsgraph,
boundbox_displist_object(ob);
}
-void BKE_displist_make_curveTypes_forRender(Depsgraph *depsgraph,
- const Scene *scene,
- Object *ob,
- ListBase *dispbase,
- const bool for_orco,
- Mesh **r_final)
+void BKE_displist_make_curveTypes_forRender(
+ Depsgraph *depsgraph, const Scene *scene, Object *ob, ListBase *r_dispbase, Mesh **r_final)
{
if (ob->runtime.curve_cache == nullptr) {
- ob->runtime.curve_cache = (CurveCache *)MEM_callocN(sizeof(CurveCache),
- "CurveCache for Curve");
+ ob->runtime.curve_cache = (CurveCache *)MEM_callocN(sizeof(CurveCache), __func__);
}
- do_makeDispListCurveTypes(depsgraph, scene, ob, dispbase, true, for_orco, r_final);
+ if (ob->type == OB_SURF) {
+ evaluate_surface_object(depsgraph, scene, ob, true, r_dispbase, r_final);
+ }
+ else {
+ evaluate_curve_type_object(depsgraph, scene, ob, true, r_dispbase, r_final);
+ }
}
void BKE_displist_minmax(const ListBase *dispbase, float min[3], float max[3])
@@ -1730,7 +1691,7 @@ static void boundbox_displist_object(Object *ob)
/* object's BB is calculated from final displist */
if (ob->runtime.bb == nullptr) {
- ob->runtime.bb = (BoundBox *)MEM_callocN(sizeof(BoundBox), "boundbox");
+ ob->runtime.bb = (BoundBox *)MEM_callocN(sizeof(BoundBox), __func__);
}
Mesh *mesh_eval = BKE_object_get_evaluated_mesh(ob);
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index 788a51257bf..2eb18a06799 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -1757,7 +1757,7 @@ void dynamicPaint_clearSurface(const Scene *scene, DynamicPaintSurface *surface)
}
}
-/* completely (re)initializes surface (only for point cache types)*/
+/* Completely (re)initializes surface (only for point cache types). */
bool dynamicPaint_resetSurface(const Scene *scene, DynamicPaintSurface *surface)
{
int numOfPoints = dynamicPaint_surfaceNumOfPoints(surface);
@@ -4145,7 +4145,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
/* mix final sample strength depending on brush settings */
if (hit_found) {
- /* if "negate volume" enabled, negate all factors within volume*/
+ /* If "negate volume" enabled, negate all factors within volume. */
if (brush->collision == MOD_DPAINT_COL_VOLDIST && brush->flags & MOD_DPAINT_NEGATE_VOLUME) {
volume_factor = 1.0f - volume_factor;
if (inner_proximity) {
diff --git a/source/blender/blenkernel/intern/editmesh.c b/source/blender/blenkernel/intern/editmesh.c
index b512309a773..49c2a2cbd89 100644
--- a/source/blender/blenkernel/intern/editmesh.c
+++ b/source/blender/blenkernel/intern/editmesh.c
@@ -222,7 +222,7 @@ void BKE_editmesh_free_derivedmesh(BMEditMesh *em)
MEM_SAFE_FREE(em->bb_cage);
}
-/*does not free the BMEditMesh struct itself*/
+/* Does not free the #BMEditMesh struct itself. */
void BKE_editmesh_free(BMEditMesh *em)
{
BKE_editmesh_free_derivedmesh(em);
diff --git a/source/blender/blenkernel/intern/effect.c b/source/blender/blenkernel/intern/effect.c
index e39749225ea..97aba5e787d 100644
--- a/source/blender/blenkernel/intern/effect.c
+++ b/source/blender/blenkernel/intern/effect.c
@@ -163,7 +163,7 @@ static void precalculate_effector(struct Depsgraph *depsgraph, EffectorCache *ef
if (cu->flag & CU_PATH) {
if (eff->ob->runtime.curve_cache == NULL ||
eff->ob->runtime.curve_cache->anim_path_accum_length == NULL) {
- BKE_displist_make_curveTypes(depsgraph, eff->scene, eff->ob, false, false);
+ BKE_displist_make_curveTypes(depsgraph, eff->scene, eff->ob, false);
}
if (eff->ob->runtime.curve_cache->anim_path_accum_length) {
@@ -773,7 +773,7 @@ int get_effector_data(EffectorCache *eff,
/* use center of object for distance calculus */
const Object *ob = eff->ob;
- /* use z-axis as normal*/
+ /* Use z-axis as normal. */
normalize_v3_v3(efd->nor, ob->obmat[2]);
if (eff->pd && ELEM(eff->pd->shape, PFIELD_SHAPE_PLANE, PFIELD_SHAPE_LINE)) {
diff --git a/source/blender/blenkernel/intern/fcurve.c b/source/blender/blenkernel/intern/fcurve.c
index 68ed3c239ef..18dac2fb679 100644
--- a/source/blender/blenkernel/intern/fcurve.c
+++ b/source/blender/blenkernel/intern/fcurve.c
@@ -1309,7 +1309,7 @@ void calchandles_fcurve_ex(FCurve *fcu, eBezTriple_Flag handle_sel_flag)
* - Need bezier keys.
* - Only bezier-interpolation has handles (for now).
*/
- if (ELEM(NULL, fcu, fcu->bezt) || (a < 2) /*|| ELEM(fcu->ipo, BEZT_IPO_CONST, BEZT_IPO_LIN)*/) {
+ if (ELEM(NULL, fcu, fcu->bezt) || (a < 2) /*|| ELEM(fcu->ipo, BEZT_IPO_CONST, BEZT_IPO_LIN) */) {
return;
}
@@ -2322,7 +2322,7 @@ void BKE_fmodifiers_blend_write(BlendWriter *writer, ListBase *fmodifiers)
FMod_Python *data = fcm->data;
/* Write ID Properties -- and copy this comment EXACTLY for easy finding
- * of library blocks that implement this.*/
+ * of library blocks that implement this. */
IDP_BlendWrite(writer, data->prop);
break;
diff --git a/source/blender/blenkernel/intern/fluid.c b/source/blender/blenkernel/intern/fluid.c
index 553575b5c7b..947417af55d 100644
--- a/source/blender/blenkernel/intern/fluid.c
+++ b/source/blender/blenkernel/intern/fluid.c
@@ -4395,7 +4395,7 @@ static void manta_smoke_calc_transparency(FluidDomainSettings *fds, ViewLayer *v
int cell[3];
float t_ray = 1.0;
- /* Reset shadow value.*/
+ /* Reset shadow value. */
shadow[index] = -1.0f;
voxel_center[0] = (float)x;
@@ -5023,7 +5023,7 @@ void BKE_fluid_modifier_copy(const struct FluidModifierData *fmd,
/* viscosity options */
tfds->viscosity_value = fds->viscosity_value;
- /* diffusion options*/
+ /* Diffusion options. */
tfds->surface_tension = fds->surface_tension;
tfds->viscosity_base = fds->viscosity_base;
tfds->viscosity_exponent = fds->viscosity_exponent;
diff --git a/source/blender/blenkernel/intern/fmodifier.c b/source/blender/blenkernel/intern/fmodifier.c
index 8d1e6b26d4d..b9f0b97ab46 100644
--- a/source/blender/blenkernel/intern/fmodifier.c
+++ b/source/blender/blenkernel/intern/fmodifier.c
@@ -875,7 +875,7 @@ static void fcm_python_new_data(void *mdata)
{
FMod_Python *data = (FMod_Python *)mdata;
- /* everything should be set correctly by calloc, except for the prop->type constant.*/
+ /* Everything should be set correctly by calloc, except for the prop->type constant. */
data->prop = MEM_callocN(sizeof(IDProperty), "PyFModifierProps");
data->prop->type = IDP_GROUP;
}
diff --git a/source/blender/blenkernel/intern/font.c b/source/blender/blenkernel/intern/font.c
index 92cc3c763b6..95de9a9d636 100644
--- a/source/blender/blenkernel/intern/font.c
+++ b/source/blender/blenkernel/intern/font.c
@@ -1271,7 +1271,7 @@ static bool vfont_to_curve(Object *ob,
MEM_freeN(i_textbox_array);
/* TEXT ON CURVE */
- /* Note: Only OB_CURVE objects could have a path */
+ /* NOTE: Only OB_CURVE objects could have a path. */
if (cu->textoncurve && cu->textoncurve->type == OB_CURVE) {
BLI_assert(cu->textoncurve->runtime.curve_cache != NULL);
if (cu->textoncurve->runtime.curve_cache != NULL &&
@@ -1746,7 +1746,7 @@ void BKE_vfont_clipboard_set(const char32_t *text_buf, const CharInfo *info_buf,
char32_t *text;
CharInfo *info;
- /* clean previous buffers*/
+ /* Clean previous buffers. */
BKE_vfont_clipboard_free();
text = MEM_malloc_arrayN((len + 1), sizeof(*text), __func__);
diff --git a/source/blender/blenkernel/intern/geometry_component_mesh.cc b/source/blender/blenkernel/intern/geometry_component_mesh.cc
index 53e3b27ab1d..af500ab3427 100644
--- a/source/blender/blenkernel/intern/geometry_component_mesh.cc
+++ b/source/blender/blenkernel/intern/geometry_component_mesh.cc
@@ -29,7 +29,7 @@
#include "attribute_access_intern.hh"
-/* Can't include BKE_object_deform.h right now, due to an enum forward declaration. */
+/* Can't include BKE_object_deform.h right now, due to an enum forward declaration. */
extern "C" MDeformVert *BKE_object_defgroup_data_create(ID *id);
using blender::fn::GVArray;
diff --git a/source/blender/blenkernel/intern/geometry_set.cc b/source/blender/blenkernel/intern/geometry_set.cc
index 3d85118deee..07b4e715ea9 100644
--- a/source/blender/blenkernel/intern/geometry_set.cc
+++ b/source/blender/blenkernel/intern/geometry_set.cc
@@ -199,20 +199,6 @@ std::ostream &operator<<(std::ostream &stream, const GeometrySet &geometry_set)
return stream;
}
-/* This generally should not be used. It is necessary currently, so that GeometrySet can by used by
- * the CPPType system. */
-bool operator==(const GeometrySet &UNUSED(a), const GeometrySet &UNUSED(b))
-{
- return false;
-}
-
-/* This generally should not be used. It is necessary currently, so that GeometrySet can by used by
- * the CPPType system. */
-uint64_t GeometrySet::hash() const
-{
- return reinterpret_cast<uint64_t>(this);
-}
-
/* Remove all geometry components from the geometry set. */
void GeometrySet::clear()
{
diff --git a/source/blender/blenkernel/intern/geometry_set_instances.cc b/source/blender/blenkernel/intern/geometry_set_instances.cc
index 01a7c11c2d0..47c8df03375 100644
--- a/source/blender/blenkernel/intern/geometry_set_instances.cc
+++ b/source/blender/blenkernel/intern/geometry_set_instances.cc
@@ -55,7 +55,7 @@ static void add_curve_data_as_geometry_component(const Object &object, GeometryS
{
BLI_assert(object.type == OB_CURVE);
if (object.data != nullptr) {
- std::unique_ptr<CurveEval> curve = curve_eval_from_dna_curve(*(Curve *)object.data);
+ std::unique_ptr<CurveEval> curve = curve_eval_from_dna_curve(*(const Curve *)object.data);
CurveComponent &curve_component = geometry_set.get_component_for_write<CurveComponent>();
curve_component.replace(curve.release(), GeometryOwnershipType::Owned);
}
@@ -263,7 +263,7 @@ static bool instances_attribute_foreach_recursive(const GeometrySet &geometry_se
}
}
- /* Now that this this geometry set is visited, increase the count and check with the limit. */
+ /* Now that this geometry set is visited, increase the count and check with the limit. */
if (limit > 0 && count++ > limit) {
return false;
}
@@ -534,7 +534,7 @@ static void join_attributes(Span<GeometryInstanceGroup> set_groups,
const void *src_buffer = src_span.data();
for (const int UNUSED(i) : set_group.transforms.index_range()) {
void *dst_buffer = dst_span[offset];
- cpp_type->copy_to_initialized_n(src_buffer, dst_buffer, domain_size);
+ cpp_type->copy_assign_n(src_buffer, dst_buffer, domain_size);
offset += domain_size;
}
}
diff --git a/source/blender/blenkernel/intern/gpencil.c b/source/blender/blenkernel/intern/gpencil.c
index ba6592996e8..6321f6b8461 100644
--- a/source/blender/blenkernel/intern/gpencil.c
+++ b/source/blender/blenkernel/intern/gpencil.c
@@ -199,12 +199,12 @@ static void greasepencil_blend_write(BlendWriter *writer, ID *id, const void *id
void BKE_gpencil_blend_read_data(BlendDataReader *reader, bGPdata *gpd)
{
- /* we must firstly have some grease-pencil data to link! */
+ /* We must firstly have some grease-pencil data to link! */
if (gpd == NULL) {
return;
}
- /* relink animdata */
+ /* Relink anim-data. */
BLO_read_data_address(reader, &gpd->adt);
BKE_animdata_blend_read_data(reader, gpd->adt);
@@ -223,7 +223,7 @@ void BKE_gpencil_blend_read_data(BlendDataReader *reader, bGPdata *gpd)
gpd->runtime.sbuffer_size = 0;
gpd->runtime.tot_cp_points = 0;
- /* relink palettes (old palettes deprecated, only to convert old files) */
+ /* Relink palettes (old palettes deprecated, only to convert old files). */
BLO_read_list(reader, &gpd->palettes);
if (gpd->palettes.first != NULL) {
LISTBASE_FOREACH (bGPDpalette *, palette, &gpd->palettes) {
@@ -233,14 +233,14 @@ void BKE_gpencil_blend_read_data(BlendDataReader *reader, bGPdata *gpd)
BLO_read_list(reader, &gpd->vertex_group_names);
- /* materials */
+ /* Materials. */
BLO_read_pointer_array(reader, (void **)&gpd->mat);
- /* relink layers */
+ /* Relink layers. */
BLO_read_list(reader, &gpd->layers);
LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
- /* relink frames */
+ /* Relink frames. */
BLO_read_list(reader, &gpl->frames);
BLO_read_data_address(reader, &gpl->actframe);
@@ -251,23 +251,23 @@ void BKE_gpencil_blend_read_data(BlendDataReader *reader, bGPdata *gpd)
BLO_read_list(reader, &gpl->mask_layers);
LISTBASE_FOREACH (bGPDframe *, gpf, &gpl->frames) {
- /* relink strokes (and their points) */
+ /* Relink strokes (and their points). */
BLO_read_list(reader, &gpf->strokes);
LISTBASE_FOREACH (bGPDstroke *, gps, &gpf->strokes) {
- /* relink stroke points array */
+ /* Relink stroke points array. */
BLO_read_data_address(reader, &gps->points);
- /* Relink geometry*/
+ /* Relink geometry. */
BLO_read_data_address(reader, &gps->triangles);
- /* relink stroke edit curve. */
+ /* Relink stroke edit curve. */
BLO_read_data_address(reader, &gps->editcurve);
if (gps->editcurve != NULL) {
- /* relink curve point array */
+ /* Relink curve point array. */
BLO_read_data_address(reader, &gps->editcurve->curve_points);
}
- /* relink weight data */
+ /* Relink weight data. */
if (gps->dvert) {
BLO_read_data_address(reader, &gps->dvert);
BKE_defvert_blend_read(reader, gps->totpoints, gps->dvert);
@@ -464,7 +464,7 @@ void BKE_gpencil_free_frames(bGPDlayer *gpl)
void BKE_gpencil_free_layer_masks(bGPDlayer *gpl)
{
- /* Free masks.*/
+ /* Free masks. */
bGPDlayer_Mask *mask_next = NULL;
for (bGPDlayer_Mask *mask = gpl->mask_layers.first; mask; mask = mask_next) {
mask_next = mask->next;
@@ -488,7 +488,7 @@ void BKE_gpencil_free_layers(ListBase *list)
/* free layers and their data */
BKE_gpencil_free_frames(gpl);
- /* Free masks.*/
+ /* Free masks. */
BKE_gpencil_free_layer_masks(gpl);
BLI_freelinkN(list, gpl);
@@ -1084,12 +1084,7 @@ bGPDlayer *BKE_gpencil_layer_duplicate(const bGPDlayer *gpl_src,
gpl_dst->prev = gpl_dst->next = NULL;
/* Copy masks. */
- BLI_listbase_clear(&gpl_dst->mask_layers);
- LISTBASE_FOREACH (bGPDlayer_Mask *, mask_src, &gpl_src->mask_layers) {
- bGPDlayer_Mask *mask_dst = MEM_dupallocN(mask_src);
- mask_dst->prev = mask_dst->next = NULL;
- BLI_addtail(&gpl_dst->mask_layers, mask_dst);
- }
+ BKE_gpencil_layer_mask_copy(gpl_src, gpl_dst);
/* copy frames */
BLI_listbase_clear(&gpl_dst->frames);
@@ -1130,13 +1125,8 @@ void BKE_gpencil_layer_copy_settings(const bGPDlayer *gpl_src, bGPDlayer *gpl_ds
copy_v3_v3(gpl_dst->scale, gpl_src->scale);
copy_m4_m4(gpl_dst->layer_mat, gpl_src->layer_mat);
copy_m4_m4(gpl_dst->layer_invmat, gpl_src->layer_invmat);
- /* Use Lights flag. */
- if (gpl_src->flag & GP_LAYER_USE_LIGHTS) {
- gpl_dst->flag |= GP_LAYER_USE_LIGHTS;
- }
- else {
- gpl_dst->flag &= ~GP_LAYER_USE_LIGHTS;
- }
+ gpl_dst->blend_mode = gpl_src->blend_mode;
+ gpl_dst->flag = gpl_src->flag;
}
/**
@@ -1655,6 +1645,41 @@ void BKE_gpencil_layer_mask_sort_all(bGPdata *gpd)
}
}
+/**
+ * Make a copy of a given gpencil mask layers.
+ */
+void BKE_gpencil_layer_mask_copy(const bGPDlayer *gpl_src, bGPDlayer *gpl_dst)
+{
+ BLI_listbase_clear(&gpl_dst->mask_layers);
+ LISTBASE_FOREACH (bGPDlayer_Mask *, mask_src, &gpl_src->mask_layers) {
+ bGPDlayer_Mask *mask_dst = MEM_dupallocN(mask_src);
+ mask_dst->prev = mask_dst->next = NULL;
+ BLI_addtail(&gpl_dst->mask_layers, mask_dst);
+ }
+}
+
+/**
+ * Clean any invalid mask layer.
+ */
+void BKE_gpencil_layer_mask_cleanup(bGPdata *gpd, bGPDlayer *gpl)
+{
+ LISTBASE_FOREACH_MUTABLE (bGPDlayer_Mask *, mask, &gpl->mask_layers) {
+ if (BKE_gpencil_layer_named_get(gpd, mask->name) == NULL) {
+ BKE_gpencil_layer_mask_remove(gpl, mask);
+ }
+ }
+}
+
+/**
+ * Clean any invalid mask layer for all layers.
+ */
+void BKE_gpencil_layer_mask_cleanup_all_layers(bGPdata *gpd)
+{
+ LISTBASE_FOREACH (bGPDlayer *, gpl, &gpd->layers) {
+ BKE_gpencil_layer_mask_cleanup(gpd, gpl);
+ }
+}
+
static int gpencil_cb_cmp_frame(void *thunk, const void *a, const void *b)
{
const bGPDframe *frame_a = a;
diff --git a/source/blender/blenkernel/intern/gpencil_curve.c b/source/blender/blenkernel/intern/gpencil_curve.c
index 906d0fb0792..344be7bc0f5 100644
--- a/source/blender/blenkernel/intern/gpencil_curve.c
+++ b/source/blender/blenkernel/intern/gpencil_curve.c
@@ -242,8 +242,8 @@ static int gpencil_get_stroke_material_fromcurve(
float color_fill[4] = {0.0f, 0.0f, 0.0f, 0.0f};
/* If the curve has 2 materials, the first is considered as Fill and the second as Stroke.
- * If the has only one material, if the name contains _stroke, the is used
- * as stroke, else as fill.*/
+ * If the has only one material, if the name contains "_stroke",
+ * it's used as a stroke, otherwise as fill. */
if (ob_cu->totcol >= 2) {
*do_stroke = true;
*do_fill = true;
@@ -350,7 +350,7 @@ static void gpencil_convert_spline(Main *bmain,
/* Assign material index to stroke. */
gps->mat_nr = r_idx;
- /* Add stroke to frame.*/
+ /* Add stroke to frame. */
BLI_addtail(&gpf->strokes, gps);
float *coord_array = NULL;
diff --git a/source/blender/blenkernel/intern/gpencil_geom.c b/source/blender/blenkernel/intern/gpencil_geom.c
index 36b8b5e52f0..2b16bbb10b2 100644
--- a/source/blender/blenkernel/intern/gpencil_geom.c
+++ b/source/blender/blenkernel/intern/gpencil_geom.c
@@ -2050,7 +2050,7 @@ void BKE_gpencil_stroke_subdivide(bGPdata *gpd, bGPDstroke *gps, int level, int
MEM_SAFE_FREE(temp_points);
MEM_SAFE_FREE(temp_dverts);
- /* move points to smooth stroke (not simple type )*/
+ /* Move points to smooth stroke (not simple type). */
if (type != GP_SUBDIV_SIMPLE) {
/* duplicate points in a temp area with the new subdivide data */
temp_points = MEM_dupallocN(gps->points);
@@ -2133,7 +2133,7 @@ void BKE_gpencil_stroke_merge_distance(bGPdata *gpd,
else {
pt->flag |= GP_SPOINT_TAG;
}
- /* Jump to next pair of points, keeping first point segment equals.*/
+ /* Jump to next pair of points, keeping first point segment equals. */
step++;
}
else {
@@ -2868,7 +2868,7 @@ static void gpencil_stroke_join_islands(bGPdata *gpd,
MDeformVert *dvert_src = NULL;
MDeformVert *dvert_dst = NULL;
- /* Copy weights (last before)*/
+ /* Copy weights (last before). */
e1 = 0;
e2 = 0;
for (int i = 0; i < totpoints; i++) {
@@ -3808,11 +3808,11 @@ static ListBase *gpencil_stroke_perimeter_ex(const bGPdata *gpd,
last_prev_pt[0] -= 1.0f;
}
- /* generate points for start cap */
+ /* Generate points for start cap. */
num_perimeter_points += generate_perimeter_cap(
first_pt, first_next_pt, first_radius, perimeter_right_side, subdivisions, gps->caps[0]);
- /* generate perimeter points */
+ /* Generate perimeter points. */
float curr_pt[3], next_pt[3], prev_pt[3];
float vec_next[2], vec_prev[2];
float nvec_next[2], nvec_prev[2];
diff --git a/source/blender/blenkernel/intern/idprop.c b/source/blender/blenkernel/intern/idprop.c
index 58715ac2e05..a67e78ceea0 100644
--- a/source/blender/blenkernel/intern/idprop.c
+++ b/source/blender/blenkernel/intern/idprop.c
@@ -54,15 +54,15 @@
static CLG_LogRef LOG = {"bke.idprop"};
-/*local size table.*/
+/* Local size table. */
static size_t idp_size_table[] = {
1, /*strings*/
sizeof(int),
sizeof(float),
- sizeof(float[3]), /*Vector type, deprecated*/
- sizeof(float[16]), /*Matrix type, deprecated*/
- 0, /*arrays don't have a fixed size*/
- sizeof(ListBase), /*Group type*/
+ sizeof(float[3]), /* Vector type, deprecated. */
+ sizeof(float[16]), /* Matrix type, deprecated. */
+ 0, /* Arrays don't have a fixed size. */
+ sizeof(ListBase), /* Group type. */
sizeof(void *),
sizeof(double),
};
@@ -99,12 +99,12 @@ IDProperty *IDP_CopyIDPArray(const IDProperty *array, const int flag)
narray->data.pointer = MEM_dupallocN(array->data.pointer);
for (int i = 0; i < narray->len; i++) {
- /* ok, the copy functions always allocate a new structure,
+ /* OK, the copy functions always allocate a new structure,
* which doesn't work here. instead, simply copy the
* contents of the new structure into the array cell,
* then free it. this makes for more maintainable
* code than simply re-implementing the copy functions
- * in this loop.*/
+ * in this loop. */
IDProperty *tmp = IDP_CopyProperty_ex(GETPROP(narray, i), flag);
memcpy(GETPROP(narray, i), tmp, sizeof(IDProperty));
MEM_freeN(tmp);
@@ -228,7 +228,7 @@ static void idp_resize_group_array(IDProperty *prop, int newlen, void *newarr)
}
}
-/*this function works for strings too!*/
+/* This function works for strings too! */
void IDP_ResizeArray(IDProperty *prop, int newlen)
{
const bool is_grow = newlen >= prop->len;
@@ -390,8 +390,8 @@ void IDP_ConcatStringC(IDProperty *prop, const char *st)
BLI_assert(prop->type == IDP_STRING);
int newlen = prop->len + (int)strlen(st);
- /* we have to remember that prop->len includes the null byte for strings.
- * so there's no need to add +1 to the resize function.*/
+ /* We have to remember that prop->len includes the null byte for strings.
+ * so there's no need to add +1 to the resize function. */
IDP_ResizeArray(prop, newlen);
strcat(prop->data.pointer, st);
}
@@ -400,8 +400,8 @@ void IDP_ConcatString(IDProperty *str1, IDProperty *append)
{
BLI_assert(append->type == IDP_STRING);
- /* since ->len for strings includes the NULL byte, we have to subtract one or
- * we'll get an extra null byte after each concatenation operation.*/
+ /* Since ->len for strings includes the NULL byte, we have to subtract one or
+ * we'll get an extra null byte after each concatenation operation. */
int newlen = str1->len + append->len - 1;
IDP_ResizeArray(str1, newlen);
strcat(str1->data.pointer, append->data.pointer);
@@ -775,10 +775,10 @@ IDProperty *IDP_GetProperties(ID *id, const bool create_if_needed)
if (create_if_needed) {
id->properties = MEM_callocN(sizeof(IDProperty), "IDProperty");
id->properties->type = IDP_GROUP;
- /* don't overwrite the data's name and type
+ /* NOTE(campbell): Don't overwrite the data's name and type
* some functions might need this if they
- * don't have a real ID, should be named elsewhere - Campbell */
- /* strcpy(id->name, "top_level_group");*/
+ * don't have a real ID, should be named elsewhere. */
+ // strcpy(id->name, "top_level_group");
}
return id->properties;
}
@@ -1106,7 +1106,7 @@ void IDP_WriteProperty_OnlyData(const IDProperty *prop, BlendWriter *writer);
static void IDP_WriteArray(const IDProperty *prop, BlendWriter *writer)
{
- /*REMEMBER to set totalen to len in the linking code!!*/
+ /* Remember to set #IDProperty.totallen to len in the linking code! */
if (prop->data.pointer) {
BLO_write_raw(writer, MEM_allocN_len(prop->data.pointer), prop->data.pointer);
@@ -1123,7 +1123,7 @@ static void IDP_WriteArray(const IDProperty *prop, BlendWriter *writer)
static void IDP_WriteIDPArray(const IDProperty *prop, BlendWriter *writer)
{
- /*REMEMBER to set totalen to len in the linking code!!*/
+ /* Remember to set #IDProperty.totallen to len in the linking code! */
if (prop->data.pointer) {
const IDProperty *array = prop->data.pointer;
@@ -1137,7 +1137,7 @@ static void IDP_WriteIDPArray(const IDProperty *prop, BlendWriter *writer)
static void IDP_WriteString(const IDProperty *prop, BlendWriter *writer)
{
- /*REMEMBER to set totalen to len in the linking code!!*/
+ /* Remember to set #IDProperty.totallen to len in the linking code! */
BLO_write_raw(writer, (size_t)prop->len, prop->data.pointer);
}
@@ -1219,7 +1219,7 @@ static void IDP_DirectLinkArray(IDProperty *prop, BlendDataReader *reader)
static void IDP_DirectLinkString(IDProperty *prop, BlendDataReader *reader)
{
- /*since we didn't save the extra string buffer, set totallen to len.*/
+ /* Since we didn't save the extra string buffer, set totallen to len. */
prop->totallen = prop->len;
BLO_read_data_address(reader, &prop->data.pointer);
}
@@ -1230,7 +1230,7 @@ static void IDP_DirectLinkGroup(IDProperty *prop, BlendDataReader *reader)
BLO_read_list(reader, lb);
- /*Link child id properties now*/
+ /* Link child id properties now. */
LISTBASE_FOREACH (IDProperty *, loop, &prop->data.group) {
IDP_DirectLinkProperty(loop, reader);
}
diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c
index 7a3619154a6..740c9b3864c 100644
--- a/source/blender/blenkernel/intern/image.c
+++ b/source/blender/blenkernel/intern/image.c
@@ -1056,9 +1056,11 @@ Image *BKE_image_add_generated(Main *bmain,
return ima;
}
-/* Create an image image from ibuf. The refcount of ibuf is increased,
+/**
+ * Create an image from ibuf. The refcount of ibuf is increased,
* caller should take care to drop its reference by calling
- * IMB_freeImBuf if needed. */
+ * #IMB_freeImBuf if needed.
+ */
Image *BKE_image_add_from_imbuf(Main *bmain, ImBuf *ibuf, const char *name)
{
/* on save, type is changed to FILE in editsima.c */
@@ -3208,7 +3210,7 @@ Image *BKE_image_ensure_viewer(Main *bmain, int type, const char *name)
ima = image_alloc(bmain, name, IMA_SRC_VIEWER, type);
}
- /* happens on reload, imagewindow cannot be image user when hidden*/
+ /* Happens on reload, imagewindow cannot be image user when hidden. */
if (ima->id.us == 0) {
id_us_ensure_real(&ima->id);
}
@@ -4349,7 +4351,7 @@ static ImBuf *load_movie_single(Image *ima, ImageUser *iuser, int frame, const i
BKE_image_user_file_path(&iuser_t, ima, str);
- /* FIXME: make several stream accessible in image editor, too*/
+ /* FIXME: make several stream accessible in image editor, too. */
ia->anim = openanim(str, flags, 0, ima->colorspace_settings.name);
/* let's initialize this user */
@@ -5188,7 +5190,7 @@ bool BKE_image_has_ibuf(Image *ima, ImageUser *iuser)
return ibuf != NULL;
}
-/* ******** Pool for image buffers ******** */
+/* ******** Pool for image buffers ******** */
typedef struct ImagePoolItem {
struct ImagePoolItem *next, *prev;
diff --git a/source/blender/blenkernel/intern/image_save.c b/source/blender/blenkernel/intern/image_save.c
index e571499ba8e..b68cd9e4d2d 100644
--- a/source/blender/blenkernel/intern/image_save.c
+++ b/source/blender/blenkernel/intern/image_save.c
@@ -207,7 +207,7 @@ static bool image_save_single(ReportList *reports,
goto cleanup;
}
- /* it shouldn't ever happen*/
+ /* It shouldn't ever happen. */
if ((BLI_findstring(&rr->views, STEREO_LEFT_NAME, offsetof(RenderView, name)) == NULL) ||
(BLI_findstring(&rr->views, STEREO_RIGHT_NAME, offsetof(RenderView, name)) == NULL)) {
BKE_reportf(reports,
diff --git a/source/blender/blenkernel/intern/ipo.c b/source/blender/blenkernel/intern/ipo.c
index bdc763cf4ca..f365e759221 100644
--- a/source/blender/blenkernel/intern/ipo.c
+++ b/source/blender/blenkernel/intern/ipo.c
@@ -262,7 +262,7 @@ static AdrBit2Path *adrcode_bitmaps_to_paths(int blocktype, int adrcode, int *to
/* Object types */
static const char *ob_adrcodes_to_paths(int adrcode, int *array_index)
{
- /* set array index like this in-case nothing sets it correctly */
+ /* Set array index like this in-case nothing sets it correctly. */
*array_index = 0;
/* result depends on adrcode */
@@ -377,7 +377,7 @@ static const char *ob_adrcodes_to_paths(int adrcode, int *array_index)
*/
static const char *pchan_adrcodes_to_paths(int adrcode, int *array_index)
{
- /* set array index like this in-case nothing sets it correctly */
+ /* Set array index like this in-case nothing sets it correctly. */
*array_index = 0;
/* result depends on adrcode */
@@ -434,7 +434,7 @@ static const char *pchan_adrcodes_to_paths(int adrcode, int *array_index)
/* Constraint types */
static const char *constraint_adrcodes_to_paths(int adrcode, int *array_index)
{
- /* set array index like this in-case nothing sets it correctly */
+ /* Set array index like this in-case nothing sets it correctly. */
*array_index = 0;
/* result depends on adrcode */
@@ -605,7 +605,7 @@ static const char *mtex_adrcodes_to_paths(int adrcode, int *UNUSED(array_index))
/* Texture types */
static const char *texture_adrcodes_to_paths(int adrcode, int *array_index)
{
- /* set array index like this in-case nothing sets it correctly */
+ /* Set array index like this in-case nothing sets it correctly. */
*array_index = 0;
/* result depends on adrcode */
@@ -692,7 +692,7 @@ static const char *texture_adrcodes_to_paths(int adrcode, int *array_index)
/* Material Types */
static const char *material_adrcodes_to_paths(int adrcode, int *array_index)
{
- /* set array index like this in-case nothing sets it correctly */
+ /* Set array index like this in-case nothing sets it correctly. */
*array_index = 0;
/* result depends on adrcode */
@@ -785,7 +785,7 @@ static const char *material_adrcodes_to_paths(int adrcode, int *array_index)
/* Camera Types */
static const char *camera_adrcodes_to_paths(int adrcode, int *array_index)
{
- /* set array index like this in-case nothing sets it correctly */
+ /* Set array index like this in-case nothing sets it correctly. */
*array_index = 0;
/* result depends on adrcode */
@@ -830,7 +830,7 @@ static const char *camera_adrcodes_to_paths(int adrcode, int *array_index)
/* Light Types */
static const char *light_adrcodes_to_paths(int adrcode, int *array_index)
{
- /* set array index like this in-case nothing sets it correctly */
+ /* Set array index like this in-case nothing sets it correctly. */
*array_index = 0;
/* result depends on adrcode */
@@ -875,7 +875,7 @@ static const char *light_adrcodes_to_paths(int adrcode, int *array_index)
/* Sound Types */
static const char *sound_adrcodes_to_paths(int adrcode, int *array_index)
{
- /* set array index like this in-case nothing sets it correctly */
+ /* Set array index like this in-case nothing sets it correctly. */
*array_index = 0;
/* result depends on adrcode */
@@ -901,7 +901,7 @@ static const char *sound_adrcodes_to_paths(int adrcode, int *array_index)
/* World Types */
static const char *world_adrcodes_to_paths(int adrcode, int *array_index)
{
- /* set array index like this in-case nothing sets it correctly */
+ /* Set array index like this in-case nothing sets it correctly. */
*array_index = 0;
/* result depends on adrcode */
@@ -947,7 +947,7 @@ static const char *world_adrcodes_to_paths(int adrcode, int *array_index)
/* Particle Types */
static const char *particle_adrcodes_to_paths(int adrcode, int *array_index)
{
- /* set array index like this in-case nothing sets it correctly */
+ /* Set array index like this in-case nothing sets it correctly. */
*array_index = 0;
/* result depends on adrcode */
diff --git a/source/blender/blenkernel/intern/keyconfig.c b/source/blender/blenkernel/intern/keyconfig.c
index 552760c9b34..d25f475c140 100644
--- a/source/blender/blenkernel/intern/keyconfig.c
+++ b/source/blender/blenkernel/intern/keyconfig.c
@@ -55,7 +55,7 @@ wmKeyConfigPref *BKE_keyconfig_pref_ensure(UserDef *userdef, const char *kc_idna
}
if (kpt->prop == NULL) {
IDPropertyTemplate val = {0};
- kpt->prop = IDP_New(IDP_GROUP, &val, kc_idname); /* name is unimportant */
+ kpt->prop = IDP_New(IDP_GROUP, &val, kc_idname); /* name is unimportant. */
}
return kpt;
}
diff --git a/source/blender/blenkernel/intern/lattice_deform.c b/source/blender/blenkernel/intern/lattice_deform.c
index a8126cb5538..a3133b58a0a 100644
--- a/source/blender/blenkernel/intern/lattice_deform.c
+++ b/source/blender/blenkernel/intern/lattice_deform.c
@@ -93,18 +93,18 @@ LatticeDeformData *BKE_lattice_deform_data_create(const Object *oblatt, const Ob
/* for example with a particle system: (ob == NULL) */
if (ob == NULL) {
- /* in deformspace, calc matrix */
+ /* In deform-space, calc matrix. */
invert_m4_m4(latmat, oblatt->obmat);
/* back: put in deform array */
invert_m4_m4(imat, latmat);
}
else {
- /* in deformspace, calc matrix */
+ /* In deform-space, calc matrix. */
invert_m4_m4(imat, oblatt->obmat);
mul_m4_m4m4(latmat, imat, ob->obmat);
- /* back: put in deform array */
+ /* back: put in deform array. */
invert_m4_m4(imat, latmat);
}
diff --git a/source/blender/blenkernel/intern/layer.c b/source/blender/blenkernel/intern/layer.c
index fb9c38f51b7..1edf83b6685 100644
--- a/source/blender/blenkernel/intern/layer.c
+++ b/source/blender/blenkernel/intern/layer.c
@@ -819,7 +819,7 @@ static void layer_collection_sync(ViewLayer *view_layer,
}
/* We separate restrict viewport and visible view layer because a layer collection can be
- * hidden in the view layer yet (locally) visible in a viewport (if it is not restricted).*/
+ * hidden in the view layer yet (locally) visible in a viewport (if it is not restricted). */
if (child_restrict & COLLECTION_RESTRICT_VIEWPORT) {
lc->runtime_flag |= LAYER_COLLECTION_RESTRICT_VIEWPORT;
}
@@ -1827,7 +1827,7 @@ void BKE_view_layer_bases_in_mode_iterator_end(BLI_Iterator *UNUSED(iter))
/** \} */
-/* Evaluation */
+/* Evaluation. */
/* Applies object's restrict flags on top of flags coming from the collection
* and stores those in base->flag. BASE_VISIBLE_DEPSGRAPH ignores viewport flags visibility
diff --git a/source/blender/blenkernel/intern/lib_id.c b/source/blender/blenkernel/intern/lib_id.c
index b7cacba20b3..297ee565257 100644
--- a/source/blender/blenkernel/intern/lib_id.c
+++ b/source/blender/blenkernel/intern/lib_id.c
@@ -1941,13 +1941,13 @@ void BKE_library_make_local(Main *bmain,
ntree->tag &= ~LIB_TAG_DOIT;
}
- if (id->lib == NULL) {
+ if (!ID_IS_LINKED(id)) {
id->tag &= ~(LIB_TAG_EXTERN | LIB_TAG_INDIRECT | LIB_TAG_NEW);
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))) {
- BKE_lib_override_library_free(&id->override_library, true);
+ BKE_lib_override_library_make_local(id);
}
}
/* The check on the fourth line (LIB_TAG_PRE_EXISTING) is done so it's possible to tag data
diff --git a/source/blender/blenkernel/intern/lib_id_eval.c b/source/blender/blenkernel/intern/lib_id_eval.c
new file mode 100644
index 00000000000..140fe403ac3
--- /dev/null
+++ b/source/blender/blenkernel/intern/lib_id_eval.c
@@ -0,0 +1,48 @@
+/*
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ */
+
+/** \file
+ * \ingroup bke
+ *
+ * Contains management of ID's and libraries
+ * allocate and free of all library data
+ */
+
+#include "DNA_ID.h"
+#include "DNA_mesh_types.h"
+
+#include "BLI_utildefines.h"
+
+#include "BKE_lib_id.h"
+#include "BKE_mesh.h"
+
+/**
+ * Copy relatives parameters, from `id` to `id_cow`.
+ * Use handle the #ID_RECALC_PARAMETERS tag.
+ * \note Keep in sync with #ID_TYPE_SUPPORTS_PARAMS_WITHOUT_COW.
+ */
+void BKE_id_eval_properties_copy(ID *id_cow, ID *id)
+{
+ const ID_Type id_type = GS(id->name);
+ BLI_assert((id_cow->tag & LIB_TAG_COPIED_ON_WRITE) && !(id->tag & LIB_TAG_COPIED_ON_WRITE));
+ BLI_assert(ID_TYPE_SUPPORTS_PARAMS_WITHOUT_COW(id_type));
+ if (id_type == ID_ME) {
+ BKE_mesh_copy_parameters((Mesh *)id_cow, (const Mesh *)id);
+ }
+ else {
+ BLI_assert_unreachable();
+ }
+}
diff --git a/source/blender/blenkernel/intern/lib_override.c b/source/blender/blenkernel/intern/lib_override.c
index 9a45f484581..595e470876d 100644
--- a/source/blender/blenkernel/intern/lib_override.c
+++ b/source/blender/blenkernel/intern/lib_override.c
@@ -646,8 +646,8 @@ static void lib_override_linked_group_tag(LibOverrideGroupTagData *data)
instantiating_collection->id.lib->temp_index < id_root->lib->temp_index)) {
break;
}
- else if (ID_IS_LINKED(instantiating_collection) &&
- (!is_resync || instantiating_collection->id.lib == id_root->lib)) {
+ if (ID_IS_LINKED(instantiating_collection) &&
+ (!is_resync || instantiating_collection->id.lib == id_root->lib)) {
instantiating_collection_override_candidate = instantiating_collection;
}
}
@@ -1788,6 +1788,33 @@ void BKE_lib_override_library_delete(Main *bmain, ID *id_root)
BKE_main_id_tag_all(bmain, LIB_TAG_DOIT, false);
}
+/** Make given ID fully local.
+ *
+ * \note Only differs from lower-level `BKE_lib_override_library_free in infamous embedded ID
+ * cases.
+ */
+void BKE_lib_override_library_make_local(ID *id)
+{
+ BKE_lib_override_library_free(&id->override_library, true);
+
+ Key *shape_key = BKE_key_from_id(id);
+ if (shape_key != NULL) {
+ shape_key->id.flag &= ~LIB_EMBEDDED_DATA_LIB_OVERRIDE;
+ }
+
+ if (GS(id->name) == ID_SCE) {
+ Collection *master_collection = ((Scene *)id)->master_collection;
+ if (master_collection != NULL) {
+ master_collection->id.flag &= ~LIB_EMBEDDED_DATA_LIB_OVERRIDE;
+ }
+ }
+
+ bNodeTree *node_tree = ntreeFromID(id);
+ if (node_tree != NULL) {
+ node_tree->id.flag &= ~LIB_EMBEDDED_DATA_LIB_OVERRIDE;
+ }
+}
+
BLI_INLINE IDOverrideLibraryRuntime *override_library_rna_path_runtime_ensure(
IDOverrideLibrary *override)
{
diff --git a/source/blender/blenkernel/intern/lib_query.c b/source/blender/blenkernel/intern/lib_query.c
index b748061ef8a..9d2552777bf 100644
--- a/source/blender/blenkernel/intern/lib_query.c
+++ b/source/blender/blenkernel/intern/lib_query.c
@@ -83,7 +83,7 @@ bool BKE_lib_query_foreachid_process(LibraryForeachIDData *data, ID **id_pp, int
ID *old_id = *id_pp;
/* Update the callback flags with the ones defined (or forbidden) in `data` by the generic
- * caller code. */
+ * caller code. */
cb_flag = ((cb_flag | data->cb_flag) & ~data->cb_flag_clear);
/* Update the callback flags with some extra information regarding overrides: all 'loopback',
diff --git a/source/blender/blenkernel/intern/mask.c b/source/blender/blenkernel/intern/mask.c
index a3f122115d8..371af2a95ed 100644
--- a/source/blender/blenkernel/intern/mask.c
+++ b/source/blender/blenkernel/intern/mask.c
@@ -1923,7 +1923,7 @@ static void interp_weights_uv_v2_apply(const float uv[2],
r_pt[1] += dvec[0] * uv[1];
}
-/* when a new points added - resize all shapekey array */
+/* When a new points added - resize all shape-key array. */
void BKE_mask_layer_shape_changed_add(MaskLayer *masklay,
int index,
bool do_init,
diff --git a/source/blender/blenkernel/intern/mball.c b/source/blender/blenkernel/intern/mball.c
index 6bef11dea76..f5d898e801b 100644
--- a/source/blender/blenkernel/intern/mball.c
+++ b/source/blender/blenkernel/intern/mball.c
@@ -158,7 +158,7 @@ static void metaball_blend_read_data(BlendDataReader *reader, ID *id)
mb->editelems = NULL;
/* Must always be cleared (meta's don't have their own edit-data). */
mb->needs_flush_to_id = 0;
- /* mb->edit_elems.first= mb->edit_elems.last= NULL;*/
+ // mb->edit_elems.first = mb->edit_elems.last = NULL;
mb->lastelem = NULL;
mb->batch_cache = NULL;
}
diff --git a/source/blender/blenkernel/intern/mball_tessellate.c b/source/blender/blenkernel/intern/mball_tessellate.c
index bb46c7b16c0..413cefd2271 100644
--- a/source/blender/blenkernel/intern/mball_tessellate.c
+++ b/source/blender/blenkernel/intern/mball_tessellate.c
@@ -272,20 +272,20 @@ static void build_bvh_spatial(PROCESS *process,
* any and all purposes, provided that this notice appears in all copies.
*/
-#define L 0 /* left direction: -x, -i */
-#define R 1 /* right direction: +x, +i */
-#define B 2 /* bottom direction: -y, -j */
-#define T 3 /* top direction: +y, +j */
-#define N 4 /* near direction: -z, -k */
-#define F 5 /* far direction: +z, +k */
-#define LBN 0 /* left bottom near corner */
-#define LBF 1 /* left bottom far corner */
-#define LTN 2 /* left top near corner */
-#define LTF 3 /* left top far corner */
-#define RBN 4 /* right bottom near corner */
-#define RBF 5 /* right bottom far corner */
-#define RTN 6 /* right top near corner */
-#define RTF 7 /* right top far corner */
+#define L 0 /* Left direction: -x, -i. */
+#define R 1 /* Right direction: +x, +i. */
+#define B 2 /* Bottom direction: -y, -j. */
+#define T 3 /* Top direction: +y, +j. */
+#define N 4 /* Near direction: -z, -k. */
+#define F 5 /* Far direction: +z, +k. */
+#define LBN 0 /* Left bottom near corner. */
+#define LBF 1 /* Left bottom far corner. */
+#define LTN 2 /* Left top near corner. */
+#define LTF 3 /* Left top far corner. */
+#define RBN 4 /* Right bottom near corner. */
+#define RBF 5 /* Right bottom far corner. */
+#define RTN 6 /* Right top near corner. */
+#define RTF 7 /* Right top far corner. */
/**
* the LBN corner of cube (i, j, k), corresponds with location
@@ -293,7 +293,8 @@ static void build_bvh_spatial(PROCESS *process,
*/
#define HASHBIT (5)
-#define HASHSIZE (size_t)(1 << (3 * HASHBIT)) /*! < hash table size (32768) */
+/** Hash table size (32768). */
+#define HASHSIZE (size_t)(1 << (3 * HASHBIT))
#define HASH(i, j, k) ((((((i)&31) << 5) | ((j)&31)) << 5) | ((k)&31))
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index c9aab0bde5c..a2b073b36e5 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -421,8 +421,7 @@ static const char *cmpcode_to_str(int code)
}
}
-/* thresh is threshold for comparing vertices, uvs, vertex colors,
- * weights, etc.*/
+/** Thresh is threshold for comparing vertices, UV's, vertex colors, weights, etc. */
static int customdata_compare(
CustomData *c1, CustomData *c2, Mesh *m1, Mesh *m2, const float thresh)
{
@@ -487,11 +486,11 @@ static int customdata_compare(
if (len_squared_v3v3(v1->co, v2->co) > thresh_sq) {
return MESHCMP_VERTCOMISMATCH;
}
- /* I don't care about normals, let's just do coordinates */
+ /* I don't care about normals, let's just do coordinates. */
}
}
- /*we're order-agnostic for edges here*/
+ /* We're order-agnostic for edges here. */
if (l1->type == CD_MEDGE) {
MEdge *e1 = l1->data;
MEdge *e2 = l2->data;
@@ -756,12 +755,14 @@ bool BKE_mesh_clear_facemap_customdata(struct Mesh *me)
return changed;
}
-/* this ensures grouped customdata (e.g. mtexpoly and mloopuv and mtface, or
+/**
+ * This ensures grouped customdata (e.g. mtexpoly and mloopuv and mtface, or
* mloopcol and mcol) have the same relative active/render/clone/mask indices.
*
- * note that for undo mesh data we want to skip 'ensure_tess_cd' call since
+ * NOTE(campbell): that for undo mesh data we want to skip 'ensure_tess_cd' call since
* we don't want to store memory for tessface when its only used for older
- * versions of the mesh. - campbell*/
+ * Versions of the mesh.
+ */
static void mesh_update_linked_customdata(Mesh *me, const bool do_ensure_tess_cd)
{
if (do_ensure_tess_cd) {
@@ -819,7 +820,7 @@ static void mesh_clear_geometry(Mesh *mesh)
/* Note that materials and shape keys are not freed here. This is intentional, as freeing
* shape keys requires tagging the depsgraph for updated relations, which is expensive.
- * Material slots should be kept in sync with the object.*/
+ * Material slots should be kept in sync with the object. */
mesh->totvert = 0;
mesh->totedge = 0;
@@ -2095,6 +2096,14 @@ void BKE_mesh_split_faces(Mesh *mesh, bool free_loop_normals)
SplitFaceNewVert *new_verts = NULL;
SplitFaceNewEdge *new_edges = NULL;
+ /* Ensure we own the layers, we need to do this before split_faces_prepare_new_verts as it will
+ * directly assign new indices to existing edges and loops. */
+ CustomData_duplicate_referenced_layers(&mesh->vdata, mesh->totvert);
+ CustomData_duplicate_referenced_layers(&mesh->edata, mesh->totedge);
+ CustomData_duplicate_referenced_layers(&mesh->ldata, mesh->totloop);
+ /* Update pointers in case we duplicated referenced layers. */
+ BKE_mesh_update_customdata_pointers(mesh, false);
+
/* Detect loop normal spaces (a.k.a. smooth fans) that will need a new vert. */
const int num_new_verts = split_faces_prepare_new_verts(
mesh, &lnors_spacearr, &new_verts, memarena);
diff --git a/source/blender/blenkernel/intern/mesh_boolean_convert.cc b/source/blender/blenkernel/intern/mesh_boolean_convert.cc
index cfb1c192afe..c162458ffb9 100644
--- a/source/blender/blenkernel/intern/mesh_boolean_convert.cc
+++ b/source/blender/blenkernel/intern/mesh_boolean_convert.cc
@@ -304,7 +304,7 @@ static IMesh meshes_to_imesh(Span<const Mesh *> meshes,
r_info->mesh_edge_offset[mi] = e;
r_info->mesh_poly_offset[mi] = f;
/* Get matrix that transforms a coordinate in objects[mi]'s local space
- * to the target space space.*/
+ * to the target space space. */
const float4x4 objn_mat = (obmats[mi] == nullptr) ? float4x4::identity() :
clean_obmat(*obmats[mi]);
r_info->to_target_transform[mi] = inv_target_mat * objn_mat;
@@ -776,7 +776,7 @@ static Mesh *imesh_to_mesh(IMesh *im, MeshesToIMeshInfo &mim)
/**
* Do a mesh boolean operation directly on meshes (without going back and forth to BMesh).
- * \param meshes: An array of of Mesh pointers.
+ * \param meshes: An array of Mesh pointers.
* \param obmats: An array of pointers to the obmat matrices that transform local
* coordinates to global ones. It is allowed for the pointers to be null, meaning the
* transformation is the identity.
diff --git a/source/blender/blenkernel/intern/mesh_convert.c b/source/blender/blenkernel/intern/mesh_convert.c
index 934f9ce5018..cfad5e1100d 100644
--- a/source/blender/blenkernel/intern/mesh_convert.c
+++ b/source/blender/blenkernel/intern/mesh_convert.c
@@ -247,7 +247,7 @@ int BKE_mesh_nurbs_to_mdata(Object *ob,
/* Initialize mverts, medges and, faces for converting nurbs to mesh and derived mesh */
/* use specified dispbase */
-int BKE_mesh_nurbs_displist_to_mdata(Object *ob,
+int BKE_mesh_nurbs_displist_to_mdata(const Object *ob,
const ListBase *dispbase,
MVert **r_allvert,
int *r_totvert,
@@ -259,8 +259,7 @@ int BKE_mesh_nurbs_displist_to_mdata(Object *ob,
int *r_totloop,
int *r_totpoly)
{
- Curve *cu = ob->data;
- DispList *dl;
+ const Curve *cu = ob->data;
MVert *mvert;
MPoly *mpoly;
MLoop *mloop;
@@ -276,8 +275,7 @@ int BKE_mesh_nurbs_displist_to_mdata(Object *ob,
(ob->type == OB_SURF));
/* count */
- dl = dispbase->first;
- while (dl) {
+ LISTBASE_FOREACH (const DispList *, dl, dispbase) {
if (dl->type == DL_SEGM) {
totvert += dl->parts * dl->nr;
totedge += dl->parts * (dl->nr - 1);
@@ -305,7 +303,6 @@ int BKE_mesh_nurbs_displist_to_mdata(Object *ob,
totpoly += tot;
totloop += tot * 3;
}
- dl = dl->next;
}
if (totvert == 0) {
@@ -327,8 +324,7 @@ int BKE_mesh_nurbs_displist_to_mdata(Object *ob,
/* verts and faces */
vertcount = 0;
- dl = dispbase->first;
- while (dl) {
+ LISTBASE_FOREACH (const DispList *, dl, dispbase) {
const bool is_smooth = (dl->rt & CU_SMOOTH) != 0;
if (dl->type == DL_SEGM) {
@@ -507,8 +503,6 @@ int BKE_mesh_nurbs_displist_to_mdata(Object *ob,
}
}
}
-
- dl = dl->next;
}
if (totpoly) {
@@ -523,7 +517,7 @@ int BKE_mesh_nurbs_displist_to_mdata(Object *ob,
return 0;
}
-Mesh *BKE_mesh_new_nomain_from_curve_displist(Object *ob, ListBase *dispbase)
+Mesh *BKE_mesh_new_nomain_from_curve_displist(const Object *ob, const ListBase *dispbase)
{
Mesh *mesh;
MVert *allvert;
@@ -551,10 +545,18 @@ Mesh *BKE_mesh_new_nomain_from_curve_displist(Object *ob, ListBase *dispbase)
mesh = BKE_mesh_new_nomain(totvert, totedge, 0, totloop, totpoly);
mesh->runtime.cd_dirty_vert |= CD_MASK_NORMAL;
- memcpy(mesh->mvert, allvert, totvert * sizeof(MVert));
- memcpy(mesh->medge, alledge, totedge * sizeof(MEdge));
- memcpy(mesh->mloop, allloop, totloop * sizeof(MLoop));
- memcpy(mesh->mpoly, allpoly, totpoly * sizeof(MPoly));
+ if (totvert != 0) {
+ memcpy(mesh->mvert, allvert, totvert * sizeof(MVert));
+ }
+ if (totedge != 0) {
+ memcpy(mesh->medge, alledge, totedge * sizeof(MEdge));
+ }
+ if (totloop != 0) {
+ memcpy(mesh->mloop, allloop, totloop * sizeof(MLoop));
+ }
+ if (totpoly != 0) {
+ memcpy(mesh->mpoly, allpoly, totpoly * sizeof(MPoly));
+ }
if (alluv) {
const char *uvname = "UVMap";
@@ -1113,7 +1115,7 @@ static void curve_to_mesh_eval_ensure(Object *object)
* Brecht says hold off with that. */
Mesh *mesh_eval = NULL;
BKE_displist_make_curveTypes_forRender(
- NULL, NULL, &remapped_object, &remapped_object.runtime.curve_cache->disp, false, &mesh_eval);
+ NULL, NULL, &remapped_object, &remapped_object.runtime.curve_cache->disp, &mesh_eval);
/* Note: this is to be consistent with `BKE_displist_make_curveTypes()`, however that is not a
* real issue currently, code here is broken in more than one way, fix(es) will be done
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c b/source/blender/blenkernel/intern/mesh_evaluate.c
index 2260ffc668a..961c10ea5d3 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -3280,8 +3280,8 @@ void BKE_mesh_flush_select_from_polys_ex(MVert *mvert,
i = totpoly;
for (mp = mpoly; i--; mp++) {
- /* assume if its selected its not hidden and none of its verts/edges are hidden
- * (a common assumption)*/
+ /* Assume if its selected its not hidden and none of its verts/edges are hidden
+ * (a common assumption). */
if (mp->flag & ME_FACE_SEL) {
const MLoop *ml;
int j;
diff --git a/source/blender/blenkernel/intern/mesh_mapping.c b/source/blender/blenkernel/intern/mesh_mapping.c
index d4119f48193..c469a65449d 100644
--- a/source/blender/blenkernel/intern/mesh_mapping.c
+++ b/source/blender/blenkernel/intern/mesh_mapping.c
@@ -535,7 +535,7 @@ void BKE_mesh_edge_poly_map_create(MeshElemMap **r_map,
*
* This has the advantage that it can operate on any data-types.
*
- * \param totsource: The total number of elements the that \a final_origindex points to.
+ * \param totsource: The total number of elements that \a final_origindex points to.
* \param totfinal: The size of \a final_origindex
* \param final_origindex: The size of the final array.
*
diff --git a/source/blender/blenkernel/intern/mesh_merge.c b/source/blender/blenkernel/intern/mesh_merge.c
index fb73152cb8e..1e51ee73c7c 100644
--- a/source/blender/blenkernel/intern/mesh_merge.c
+++ b/source/blender/blenkernel/intern/mesh_merge.c
@@ -109,7 +109,7 @@ static int cddm_poly_compare(MLoop *mloop_array,
i_loop_source++;
if (i_loop_source == mpoly_source->totloop) {
- /* End of loops for source, must match end of loop for target. */
+ /* End of loops for source, must match end of loop for target. */
if (i_loop_target_offset == mpoly_target->totloop - 1) {
compare_completed = true;
same_loops = true;
@@ -597,7 +597,7 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh,
mp_new->loopstart = STACK_SIZE(mloop) - c;
STACK_PUSH(oldp, i);
- } /* end of the loop that tests polys */
+ } /* End of the loop that tests polys. */
if (poly_gset) {
// printf("hash quality %.6f\n", BLI_gset_calc_quality(poly_gset));
@@ -606,11 +606,11 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh,
MEM_freeN(poly_keys);
}
- /*create new cddm*/
+ /* Create new cddm. */
result = BKE_mesh_new_nomain_from_template(
mesh, STACK_SIZE(mvert), STACK_SIZE(medge), 0, STACK_SIZE(mloop), STACK_SIZE(mpoly));
- /*update edge indices and copy customdata*/
+ /* Update edge indices and copy customdata. */
med = medge;
for (i = 0; i < result->totedge; i++, med++) {
BLI_assert(newv[med->v1] != -1);
@@ -624,7 +624,7 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh,
CustomData_copy_data(&mesh->edata, &result->edata, olde[i], i, 1);
}
- /*update loop indices and copy customdata*/
+ /* Update loop indices and copy customdata. */
ml = mloop;
for (i = 0; i < result->totloop; i++, ml++) {
/* Edge remapping has already be done in main loop handling part above. */
@@ -634,19 +634,19 @@ Mesh *BKE_mesh_merge_verts(Mesh *mesh,
CustomData_copy_data(&mesh->ldata, &result->ldata, oldl[i], i, 1);
}
- /*copy vertex customdata*/
+ /* Copy vertex customdata. */
mv = mvert;
for (i = 0; i < result->totvert; i++, mv++) {
CustomData_copy_data(&mesh->vdata, &result->vdata, oldv[i], i, 1);
}
- /*copy poly customdata*/
+ /* Copy poly customdata. */
mp = mpoly;
for (i = 0; i < result->totpoly; i++, mp++) {
CustomData_copy_data(&mesh->pdata, &result->pdata, oldp[i], i, 1);
}
- /*copy over data. CustomData_add_layer can do this, need to look it up.*/
+ /* Copy over data. #CustomData_add_layer can do this, need to look it up. */
memcpy(result->mvert, mvert, sizeof(MVert) * STACK_SIZE(mvert));
memcpy(result->medge, medge, sizeof(MEdge) * STACK_SIZE(medge));
memcpy(result->mloop, mloop, sizeof(MLoop) * STACK_SIZE(mloop));
diff --git a/source/blender/blenkernel/intern/mesh_mirror.c b/source/blender/blenkernel/intern/mesh_mirror.c
index 3d30c218fba..9aeaa1ada52 100644
--- a/source/blender/blenkernel/intern/mesh_mirror.c
+++ b/source/blender/blenkernel/intern/mesh_mirror.c
@@ -70,9 +70,9 @@ Mesh *BKE_mesh_mirror_bisect_on_mirror_plane_for_modifier(MirrorModifierData *mm
/* Define bisecting plane (aka mirror plane). */
float plane[4];
if (!do_bisect_flip_axis) {
- /* That reversed condition is a tad weird, but for some reason that's how you keep
- * the part of the mesh which is on the non-mirrored side when flip option is disabled,
- * think that that is the expected behavior. */
+ /* That reversed condition is a little weird, but for some reason that's how you keep
+ * the part of the mesh which is on the non-mirrored side when flip option is disabled.
+ * I think this is the expected behavior. */
negate_v3(plane_no);
}
plane_from_point_normal_v3(plane, plane_co, plane_no);
diff --git a/source/blender/blenkernel/intern/mesh_validate.c b/source/blender/blenkernel/intern/mesh_validate.c
index df84cf6607f..bfdbf844a26 100644
--- a/source/blender/blenkernel/intern/mesh_validate.c
+++ b/source/blender/blenkernel/intern/mesh_validate.c
@@ -1105,7 +1105,7 @@ bool BKE_mesh_validate(Mesh *me, const bool do_verbose, const bool cddata_check_
&changed);
if (changed) {
- DEG_id_tag_update(&me->id, ID_RECALC_GEOMETRY);
+ DEG_id_tag_update(&me->id, ID_RECALC_GEOMETRY_ALL_MODES);
return true;
}
@@ -1183,7 +1183,7 @@ bool BKE_mesh_validate_material_indices(Mesh *me)
}
if (!is_valid) {
- DEG_id_tag_update(&me->id, ID_RECALC_GEOMETRY);
+ DEG_id_tag_update(&me->id, ID_RECALC_GEOMETRY_ALL_MODES);
return true;
}
diff --git a/source/blender/blenkernel/intern/movieclip.c b/source/blender/blenkernel/intern/movieclip.c
index 0f2f56f4f2b..3a7910d1a9f 100644
--- a/source/blender/blenkernel/intern/movieclip.c
+++ b/source/blender/blenkernel/intern/movieclip.c
@@ -1320,7 +1320,7 @@ static ImBuf *movieclip_get_postprocessed_ibuf(
clip->lastframe = framenr;
real_ibuf_size(clip, user, ibuf, &clip->lastsize[0], &clip->lastsize[1]);
- /* postprocess frame and put to cache if needed*/
+ /* Post-process frame and put to cache if needed. */
if (need_postprocess) {
ImBuf *tmpibuf = ibuf;
ibuf = postprocess_frame(clip, user, tmpibuf, flag, postprocess_flag);
@@ -2128,9 +2128,9 @@ GPUTexture *BKE_movieclip_get_gpu_texture(MovieClip *clip, MovieClipUser *cuser)
void BKE_movieclip_free_gputexture(struct MovieClip *clip)
{
- /* number of gpu textures to keep around as cache
+ /* Number of gpu textures to keep around as cache.
* We don't want to keep too many GPU textures for
- * movie clips around, as they can be large.*/
+ * movie clips around, as they can be large. */
const int MOVIECLIP_NUM_GPUTEXTURES = 1;
while (BLI_listbase_count(&clip->runtime.gputextures) > MOVIECLIP_NUM_GPUTEXTURES) {
diff --git a/source/blender/blenkernel/intern/multires.c b/source/blender/blenkernel/intern/multires.c
index 45ac20ef154..54f0da30a2b 100644
--- a/source/blender/blenkernel/intern/multires.c
+++ b/source/blender/blenkernel/intern/multires.c
@@ -994,7 +994,7 @@ static void multiresModifier_disp_run(
}
}
- /*numGrids = dm->getNumGrids(dm);*/ /*UNUSED*/
+ // numGrids = dm->getNumGrids(dm); /* UNUSED */
gridSize = dm->getGridSize(dm);
gridData = dm->getGridData(dm);
gridOffset = dm->getGridOffset(dm);
@@ -1285,7 +1285,7 @@ DerivedMesh *multires_make_derived_from_derived(
multires_set_tot_mdisps(me, mmd->totlvl);
multiresModifier_ensure_external_read(me, mmd);
- /*run displacement*/
+ /* Run displacement. */
multiresModifier_disp_run(result, ob->data, dm, APPLY_DISPLACEMENTS, subGridData, mmd->totlvl);
/* copy hidden elements for this level */
@@ -1514,7 +1514,7 @@ void multires_topology_changed(Mesh *me)
*
* Since the multires data files only contain displacement vectors without knowledge about
* subdivision level some extra work is needed. Namely make is to all displacement grids have
- * proper level and number of displacement vectors set. */
+ * proper level and number of displacement vectors set. */
void multires_ensure_external_read(struct Mesh *mesh, int top_level)
{
if (!CustomData_external_test(&mesh->ldata, CD_MDISPS)) {
diff --git a/source/blender/blenkernel/intern/multires_reshape.c b/source/blender/blenkernel/intern/multires_reshape.c
index 04ad78ec0de..bd52d70b223 100644
--- a/source/blender/blenkernel/intern/multires_reshape.c
+++ b/source/blender/blenkernel/intern/multires_reshape.c
@@ -235,7 +235,7 @@ void multiresModifier_subdivide_to_level(struct Object *object,
/* Free original grids which makes it so smoothing with details thinks all the details were
* added against base mesh's limit surface. This is similar behavior to as if we've done all
- * displacement in sculpt mode at the old top level and then propagated to the new top level.*/
+ * displacement in sculpt mode at the old top level and then propagated to the new top level. */
multires_reshape_free_original_grids(&reshape_context);
if (ELEM(mode, MULTIRES_SUBDIVIDE_LINEAR, MULTIRES_SUBDIVIDE_SIMPLE)) {
diff --git a/source/blender/blenkernel/intern/multires_reshape_smooth.c b/source/blender/blenkernel/intern/multires_reshape_smooth.c
index f10aae18142..aed8c3122a2 100644
--- a/source/blender/blenkernel/intern/multires_reshape_smooth.c
+++ b/source/blender/blenkernel/intern/multires_reshape_smooth.c
@@ -55,7 +55,7 @@
/* Surface refers to a simplified and lower-memory footprint representation of the limit surface.
*
* Used to store pre-calculated information which is expensive or impossible to evaluate when
- * traversing the final limit surface. */
+ * traversing the final limit surface. */
typedef struct SurfacePoint {
float P[3];
@@ -1027,7 +1027,7 @@ static void converter_init(const MultiresReshapeSmoothContext *reshape_smooth_co
converter->user_data = (void *)reshape_smooth_context;
}
-/* Create subdiv descriptor created for topology at a reshape level, */
+/* Create subdiv descriptor created for topology at a reshape level. */
static void reshape_subdiv_create(MultiresReshapeSmoothContext *reshape_smooth_context)
{
const MultiresReshapeContext *reshape_context = reshape_smooth_context->reshape_context;
@@ -1050,7 +1050,7 @@ typedef void(ReshapeSubdivCoarsePositionCb)(
const Vertex *vertex,
float r_P[3]);
-/* Refine subdivision surface topology at a reshape level for new coarse vertices positions. */
+/* Refine subdivision surface topology at a reshape level for new coarse vertices positions. */
static void reshape_subdiv_refine(const MultiresReshapeSmoothContext *reshape_smooth_context,
ReshapeSubdivCoarsePositionCb coarse_position_cb)
{
diff --git a/source/blender/blenkernel/intern/multires_unsubdivide.c b/source/blender/blenkernel/intern/multires_unsubdivide.c
index 02b9bb852d6..4210f26a694 100644
--- a/source/blender/blenkernel/intern/multires_unsubdivide.c
+++ b/source/blender/blenkernel/intern/multires_unsubdivide.c
@@ -312,7 +312,7 @@ static bool unsubdivide_tag_disconnected_mesh_element(BMesh *bm, int *elem_id, i
/* Also try from the different 4 vertices of a quad in the current
* disconnected element ID. If a solution exists the search should return a valid solution from
- * one of these vertices.*/
+ * one of these vertices. */
BMFace *f, *init_face = NULL;
BMVert *v;
BMIter iter_a, iter_b;
diff --git a/source/blender/blenkernel/intern/nla.c b/source/blender/blenkernel/intern/nla.c
index 92e21183acb..bf18765aa94 100644
--- a/source/blender/blenkernel/intern/nla.c
+++ b/source/blender/blenkernel/intern/nla.c
@@ -1289,7 +1289,7 @@ void BKE_nlastrip_set_active(AnimData *adt, NlaStrip *strip)
return;
}
- /* loop over tracks, deactivating*/
+ /* Loop over tracks, deactivating. */
for (nlt = adt->nla_tracks.first; nlt; nlt = nlt->next) {
for (nls = nlt->strips.first; nls; nls = nls->next) {
if (nls != strip) {
@@ -1560,7 +1560,7 @@ bool BKE_nlatracks_have_animated_strips(ListBase *tracks)
return false;
}
-/* Validate the NLA-Strips 'control' F-Curves based on the flags set*/
+/* Validate the NLA-Strips 'control' F-Curves based on the flags set. */
void BKE_nlastrip_validate_fcurves(NlaStrip *strip)
{
FCurve *fcu;
diff --git a/source/blender/blenkernel/intern/node.cc b/source/blender/blenkernel/intern/node.cc
index db18cecb5d3..cf0dd75ea9d 100644
--- a/source/blender/blenkernel/intern/node.cc
+++ b/source/blender/blenkernel/intern/node.cc
@@ -875,7 +875,7 @@ void ntreeBlendReadLib(struct BlendLibReader *reader, struct bNodeTree *ntree)
LISTBASE_FOREACH (bNode *, node, &ntree->nodes) {
/* Link ID Properties -- and copy this comment EXACTLY for easy finding
- * of library blocks that implement this.*/
+ * of library blocks that implement this. */
IDP_BlendReadLib(reader, node->prop);
BLO_read_id_address(reader, lib, &node->id);
@@ -2365,7 +2365,7 @@ static void nodeUnMuteLink(bNodeLink *link)
link->tosock->flag |= SOCK_IN_USE;
}
-/* Upstream muting. Always happens when unmuting but checks when muting. O(n^2) algorithm.*/
+/* Upstream muting. Always happens when unmuting but checks when muting. O(n^2) algorithm. */
static void nodeMuteRerouteInputLinks(bNodeTree *ntree, bNode *node, const bool mute)
{
if (node->type != NODE_REROUTE) {
@@ -2388,7 +2388,7 @@ static void nodeMuteRerouteInputLinks(bNodeTree *ntree, bNode *node, const bool
}
}
-/* Downstream muting propagates when reaching reroute nodes. O(n^2) algorithm.*/
+/* Downstream muting propagates when reaching reroute nodes. O(n^2) algorithm. */
static void nodeMuteRerouteOutputLinks(bNodeTree *ntree, bNode *node, const bool mute)
{
if (node->type != NODE_REROUTE) {
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index c2bab797003..9270a7eb56a 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -2752,7 +2752,7 @@ Object *BKE_object_duplicate(Main *bmain,
}
if (!is_subprocess) {
- /* This code will follow into all ID links using an ID tagged with LIB_TAG_NEW.*/
+ /* This code will follow into all ID links using an ID tagged with LIB_TAG_NEW. */
BKE_libblock_relink_to_newid(&obn->id);
#ifndef NDEBUG
@@ -2847,7 +2847,7 @@ void BKE_object_copy_proxy_drivers(Object *ob, Object *target)
else {
/* only on local objects because this causes indirect links
* 'a -> b -> c', blend to point directly to a.blend
- * when a.blend has a proxy that's linked into c.blend */
+ * when a.blend has a proxy that's linked into `c.blend`. */
if (!ID_IS_LINKED(ob)) {
id_lib_extern((ID *)dtar->id);
}
@@ -3206,12 +3206,11 @@ void BKE_object_to_mat3(Object *ob, float r_mat[3][3]) /* no parent */
{
float smat[3][3];
float rmat[3][3];
- /*float q1[4];*/
- /* scale */
+ /* Scale. */
BKE_object_scale_to_mat3(ob, smat);
- /* rot */
+ /* Rotation. */
BKE_object_rot_to_mat3(ob, rmat, true);
mul_m3_m3m3(r_mat, rmat, smat);
}
@@ -4470,7 +4469,7 @@ Mesh *BKE_object_get_pre_modified_mesh(const Object *object)
}
/**
- * Get a mesh which corresponds to very very original mesh from #Main.
+ * Get a mesh which corresponds to the very original mesh from #Main.
* - For original objects it will be object->data.
* - For evaluated objects it will be same mesh as corresponding original
* object uses as data.
@@ -5298,7 +5297,7 @@ KDTree_3d *BKE_object_as_kdtree(Object *ob, int *r_tot)
tot = 0;
tree = BLI_kdtree_3d_new(totvert);
- /* we don't how how many verts from the DM we can use */
+ /* We don't how many verts from the DM we can use. */
for (i = 0; i < totvert; i++) {
if (index[i] != ORIGINDEX_NONE) {
float co[3];
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c
index b1afd968bdc..ab247ef5507 100644
--- a/source/blender/blenkernel/intern/object_update.c
+++ b/source/blender/blenkernel/intern/object_update.c
@@ -224,7 +224,7 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *o
case OB_SURF:
case OB_FONT: {
bool for_render = (DEG_get_mode(depsgraph) == DAG_EVAL_RENDER);
- BKE_displist_make_curveTypes(depsgraph, scene, ob, for_render, false);
+ BKE_displist_make_curveTypes(depsgraph, scene, ob, for_render);
break;
}
diff --git a/source/blender/blenkernel/intern/ocean.c b/source/blender/blenkernel/intern/ocean.c
index 9d53dad8d03..2e7152302c7 100644
--- a/source/blender/blenkernel/intern/ocean.c
+++ b/source/blender/blenkernel/intern/ocean.c
@@ -248,7 +248,7 @@ void BKE_ocean_eval_uv(struct Ocean *oc, struct OceanResult *ocr, float u, float
if (oc->_do_normals) {
ocr->normal[0] = BILERP(oc->_N_x);
- ocr->normal[1] = oc->_N_y /*BILERP(oc->_N_y) (MEM01)*/;
+ ocr->normal[1] = oc->_N_y /* BILERP(oc->_N_y) (MEM01) */;
ocr->normal[2] = BILERP(oc->_N_z);
}
@@ -347,7 +347,7 @@ void BKE_ocean_eval_uv_catrom(struct Ocean *oc, struct OceanResult *ocr, float u
}
if (oc->_do_normals) {
ocr->normal[0] = INTERP(oc->_N_x);
- ocr->normal[1] = oc->_N_y /*INTERP(oc->_N_y) (MEM01)*/;
+ ocr->normal[1] = oc->_N_y /* INTERP(oc->_N_y) (MEM01) */;
ocr->normal[2] = INTERP(oc->_N_z);
}
if (oc->_do_chop) {
@@ -1052,7 +1052,7 @@ void BKE_ocean_free_data(struct Ocean *oc)
fftw_destroy_plan(oc->_N_x_plan);
fftw_destroy_plan(oc->_N_z_plan);
MEM_freeN(oc->_N_x);
- /*fftwf_free(oc->_N_y); (MEM01)*/
+ /* fftwf_free(oc->_N_y); (MEM01) */
MEM_freeN(oc->_N_z);
}
@@ -1437,9 +1437,9 @@ void BKE_ocean_bake(struct Ocean *o,
rgb_to_rgba_unit_alpha(&ibuf_disp->rect_float[4 * (res_x * y + x)], ocr.disp);
if (o->_do_jacobian) {
- /* TODO, cleanup unused code - campbell */
+ /* TODO: cleanup unused code - campbell */
- float /*r, */ /* UNUSED */ pr = 0.0f, foam_result;
+ float /* r, */ /* UNUSED */ pr = 0.0f, foam_result;
float neg_disp, neg_eplus;
ocr.foam = BKE_ocean_jminus_to_foam(ocr.Jminus, och->foam_coverage);
@@ -1449,9 +1449,9 @@ void BKE_ocean_bake(struct Ocean *o,
pr = prev_foam[res_x * y + x];
}
- /* r = BLI_rng_get_float(rng); */ /* UNUSED */ /* randomly reduce foam */
+ // r = BLI_rng_get_float(rng); /* UNUSED */ /* randomly reduce foam */
- /* pr = pr * och->foam_fade; */ /* overall fade */
+ // pr = pr * och->foam_fade; /* overall fade */
/* Remember ocean coord sys is Y up!
* break up the foam where height (Y) is low (wave valley),
@@ -1475,7 +1475,7 @@ void BKE_ocean_bake(struct Ocean *o,
prev_foam[res_x * y + x] = foam_result;
- /*foam_result = min_ff(foam_result, 1.0f); */
+ // foam_result = min_ff(foam_result, 1.0f);
value_to_rgba_unit_alpha(&ibuf_foam->rect_float[4 * (res_x * y + x)], foam_result);
diff --git a/source/blender/blenkernel/intern/ocean_intern.h b/source/blender/blenkernel/intern/ocean_intern.h
index b55b211fa33..4ebd03789af 100644
--- a/source/blender/blenkernel/intern/ocean_intern.h
+++ b/source/blender/blenkernel/intern/ocean_intern.h
@@ -99,7 +99,7 @@ typedef struct Ocean {
double *_N_x; /* init w sim w via plan? */
/* all member of this array has same values,
* so convert this array to a float to reduce memory usage (MEM01). */
- /*float * _N_y; */
+ // float * _N_y;
double _N_y; /* sim w ********* can be rearranged? */
double *_N_z; /* init w sim w via plan? */
double *_disp_x; /* init w sim w via plan? */
diff --git a/source/blender/blenkernel/intern/ocean_spectrum.c b/source/blender/blenkernel/intern/ocean_spectrum.c
index 1f7cc56f1a9..7ed70234baf 100644
--- a/source/blender/blenkernel/intern/ocean_spectrum.c
+++ b/source/blender/blenkernel/intern/ocean_spectrum.c
@@ -122,7 +122,7 @@ static float jonswap(const Ocean *oc, const float k2)
float val = alpha_beta_spectrum(m_alpha, beta, GRAVITY, omega, m_peakomega);
- /* Peak sharpening */
+ /* Peak sharpening. */
val *= peak_sharpen(m_omega, m_peakomega, m_gamma);
return val;
diff --git a/source/blender/blenkernel/intern/paint.c b/source/blender/blenkernel/intern/paint.c
index 3494630e1fa..a7c6dc2deb9 100644
--- a/source/blender/blenkernel/intern/paint.c
+++ b/source/blender/blenkernel/intern/paint.c
@@ -1810,7 +1810,7 @@ void BKE_sculpt_color_layer_create_if_needed(struct Object *object)
CustomData_add_layer(&orig_me->vdata, CD_PROP_COLOR, CD_DEFAULT, NULL, orig_me->totvert);
BKE_mesh_update_customdata_pointers(orig_me, true);
- DEG_id_tag_update(&orig_me->id, ID_RECALC_GEOMETRY);
+ DEG_id_tag_update(&orig_me->id, ID_RECALC_GEOMETRY_ALL_MODES);
}
/** \warning Expects a fully evaluated depsgraph. */
diff --git a/source/blender/blenkernel/intern/particle.c b/source/blender/blenkernel/intern/particle.c
index 021121034f1..d386967bf8b 100644
--- a/source/blender/blenkernel/intern/particle.c
+++ b/source/blender/blenkernel/intern/particle.c
@@ -2462,7 +2462,7 @@ int do_guides(Depsgraph *depsgraph,
(int)(data->strength * guidetime * 100.0f),
100));
}
- else { /* curve size*/
+ else { /* Curve size. */
if (cu->flag & CU_PATH_RADIUS) {
mul_v3_fl(vec_to_point, radius);
}
diff --git a/source/blender/blenkernel/intern/particle_child.c b/source/blender/blenkernel/intern/particle_child.c
index 6e0965650d3..2231731287d 100644
--- a/source/blender/blenkernel/intern/particle_child.c
+++ b/source/blender/blenkernel/intern/particle_child.c
@@ -785,7 +785,7 @@ static void do_twist(const ParticleChildModifierContext *modifier_ctx,
return;
}
if (part->twist == 0.0f) {
- /* No twist along the strand. */
+ /* No twist along the strand. */
return;
}
/* Dependent on whether it's threaded update or not, curve comes
diff --git a/source/blender/blenkernel/intern/particle_distribute.c b/source/blender/blenkernel/intern/particle_distribute.c
index 13f0cb28428..1fd99bb2cbd 100644
--- a/source/blender/blenkernel/intern/particle_distribute.c
+++ b/source/blender/blenkernel/intern/particle_distribute.c
@@ -142,7 +142,7 @@ static void distribute_grid(Mesh *mesh, ParticleSystem *psys)
size[(axis + 1) % 3] = (int)ceil(delta[(axis + 1) % 3] / d);
size[(axis + 2) % 3] = (int)ceil(delta[(axis + 2) % 3] / d);
- /* float errors grrr.. */
+ /* float errors grrr. */
size[(axis + 1) % 3] = MIN2(size[(axis + 1) % 3], res);
size[(axis + 2) % 3] = MIN2(size[(axis + 2) % 3], res);
diff --git a/source/blender/blenkernel/intern/particle_system.c b/source/blender/blenkernel/intern/particle_system.c
index d236dbbf101..c35f703b072 100644
--- a/source/blender/blenkernel/intern/particle_system.c
+++ b/source/blender/blenkernel/intern/particle_system.c
@@ -250,7 +250,7 @@ static void realloc_particles(ParticleSimulationData *sim, int new_totpart)
if (psys->particles) {
totsaved = MIN2(psys->totpart, totpart);
- /*save old pars*/
+ /* Save old pars. */
if (totsaved) {
memcpy(newpars, psys->particles, totsaved * sizeof(ParticleData));
@@ -607,8 +607,8 @@ void init_particle(ParticleSimulationData *sim, ParticleData *pa)
pa->time = part->sta + (part->end - part->sta) * birth_time;
pa->hair_index = 0;
- /* we can't reset to -1 anymore since we've figured out correct index in distribute_particles */
- /* usage other than straight after distribute has to handle this index by itself - jahka*/
+ /* We can't reset to -1 anymore since we've figured out correct index in #distribute_particles
+ * usage other than straight after distribute has to handle this index by itself - jahka. */
// pa->num_dmcache = DMCACHE_NOTFOUND; /* assume we don't have a derived mesh face */
}
@@ -840,7 +840,7 @@ void psys_get_birth_coords(
copy_v3_v3(state->co, loc);
- /* boids don't get any initial velocity */
+ /* boids don't get any initial velocity. */
zero_v3(state->vel);
/* boids store direction in ave */
@@ -1473,7 +1473,7 @@ static void integrate_particle(
force_func(forcedata, states + i, force, impulse);
- /* force to acceleration*/
+ /* Force to acceleration. */
mul_v3_v3fl(acceleration, force, 1.0f / pa_mass);
if (external_acceleration) {
@@ -1920,7 +1920,7 @@ static void sph_force_cb(void *sphdata_v, ParticleKey *state, float *force, floa
}
}
- /* Artificial buoyancy force in negative gravity direction */
+ /* Artificial buoyancy force in negative gravity direction. */
if (fluid->buoyancy > 0.0f && gravity) {
madd_v3_v3fl(force, gravity, fluid->buoyancy * (density - rest_density));
}
@@ -2095,7 +2095,7 @@ static void sphclassical_force_cb(void *sphdata_v,
}
}
- /* Artificial buoyancy force in negative gravity direction */
+ /* Artificial buoyancy force in negative gravity direction. */
if (fluid->buoyancy > 0.0f && gravity) {
madd_v3_v3fl(force, gravity, fluid->buoyancy * (pa->sphdensity - rest_density));
}
@@ -2226,7 +2226,7 @@ static void sph_integrate(ParticleSimulationData *sim,
sphdata->pass = 0;
// sphdata.element_size and sphdata.flow are set in the callback.
- /* restore previous state and treat gravity & effectors as external acceleration*/
+ /* Restore previous state and treat gravity & effectors as external acceleration. */
sub_v3_v3v3(effector_acceleration, pa->state.vel, pa->prev_state.vel);
mul_v3_fl(effector_acceleration, 1.0f / dtime);
@@ -3001,7 +3001,7 @@ static int collision_response(ParticleSimulationData *sim,
/* get back to global coordinates */
add_v3_v3(v1_tan, vc_tan);
- /* convert to angular velocity*/
+ /* Convert to angular velocity. */
cross_v3_v3v3(ave, vr_tan, pce->nor);
mul_v3_fl(ave, 1.0f / MAX2(pa->size, 0.001f));
@@ -3369,7 +3369,7 @@ static void hair_create_input_mesh(ParticleSimulationData *sim,
/* XXX placeholder for more flexible future hair settings */
hair_radius = part->size;
- /* make vgroup for pin roots etc.. */
+ /* Make vgroup for pin roots etc. */
hair_index = 1;
LOOP_PARTICLES
{
@@ -3927,7 +3927,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
pa->alive = PARS_DYING;
}
else if (birthtime <= cfra && birthtime >= psys->cfra) {
- /* particle is born some time between this and last step*/
+ /* Particle is born some time between this and last step. */
reset_particle(sim, pa, dfra * timestep, cfra);
pa->alive = PARS_ALIVE;
pa->state.time = cfra - birthtime;
@@ -3936,7 +3936,7 @@ static void dynamics_step(ParticleSimulationData *sim, float cfra)
/* nothing to be done when particle is dead */
}
- /* only reset unborn particles if they're shown or if the particle is born soon*/
+ /* 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))) {
reset_particle(sim, pa, dtime, cfra);
@@ -4104,7 +4104,7 @@ static void update_children(ParticleSimulationData *sim, const bool use_render_p
psys_free_children(sim->psys);
}
}
-/* updates cached particles' alive & other flags etc..*/
+/* Updates cached particles' alive & other flags etc. */
static void cached_step(ParticleSimulationData *sim, float cfra, const bool use_render_params)
{
ParticleSystem *psys = sim->psys;
diff --git a/source/blender/blenkernel/intern/pbvh_bmesh.c b/source/blender/blenkernel/intern/pbvh_bmesh.c
index 09e4ad93baa..c2483b265a5 100644
--- a/source/blender/blenkernel/intern/pbvh_bmesh.c
+++ b/source/blender/blenkernel/intern/pbvh_bmesh.c
@@ -180,7 +180,7 @@ static BMVert *bm_vert_hash_lookup_chain(GHash *deleted_verts, BMVert *v)
while (true) {
BMVert **v_next_p = (BMVert **)BLI_ghash_lookup_p(deleted_verts, v);
if (v_next_p == NULL) {
- /* not remapped*/
+ /* Not remapped. */
return v;
}
if (*v_next_p == NULL) {
@@ -2316,7 +2316,7 @@ static void pbvh_bmesh_verify(PBVH *pbvh)
vert_count++;
}
- /* if totvert differs from number of verts inside the hash. hash-totvert is checked above */
+ /* If totvert differs from number of verts inside the hash. hash-totvert is checked above. */
BLI_assert(vert_count == pbvh->bm->totvert);
# endif
diff --git a/source/blender/blenkernel/intern/pointcache.c b/source/blender/blenkernel/intern/pointcache.c
index be206f8a642..a05eb6962ce 100644
--- a/source/blender/blenkernel/intern/pointcache.c
+++ b/source/blender/blenkernel/intern/pointcache.c
@@ -2632,7 +2632,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
}
#endif
- /*if (!G.relbase_valid) return; */ /* save blend file before using pointcache */
+ // if (!G.relbase_valid) return; /* Save blend file before using pointcache. */
/* clear all files in the temp dir with the prefix of the ID and the ".bphys" suffix */
switch (mode) {
@@ -2659,8 +2659,8 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
ptcache_filename_ext_append(pid, ext, 0, false, 0);
while ((de = readdir(dir)) != NULL) {
- if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
- if (STREQLEN(filename, de->d_name, len)) { /* do we have the right prefix */
+ if (strstr(de->d_name, ext)) { /* Do we have the right extension? */
+ if (STREQLEN(filename, de->d_name, len)) { /* Do we have the right prefix. */
if (mode == PTCACHE_CLEAR_ALL) {
pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
@@ -2695,7 +2695,7 @@ void BKE_ptcache_id_clear(PTCacheID *pid, int mode, unsigned int cfra)
PTCacheMem *link = NULL;
if (mode == PTCACHE_CLEAR_ALL) {
- /*we want startframe if the cache starts before zero*/
+ /* We want startframe if the cache starts before zero. */
pid->cache->last_exact = MIN2(pid->cache->startframe, 0);
for (; pm; pm = pm->next) {
ptcache_mem_clear(pm);
@@ -2856,8 +2856,8 @@ void BKE_ptcache_id_time(
ptcache_filename_ext_append(pid, ext, 0, false, 0);
while ((de = readdir(dir)) != NULL) {
- if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
- if (STREQLEN(filename, de->d_name, len)) { /* do we have the right prefix */
+ if (strstr(de->d_name, ext)) { /* Do we have the right extension? */
+ if (STREQLEN(filename, de->d_name, len)) { /* Do we have the right prefix. */
/* read the number of the file */
const int frame = ptcache_frame_from_filename(de->d_name, ext);
@@ -3038,7 +3038,7 @@ void BKE_ptcache_remove(void)
if (FILENAME_IS_CURRPAR(de->d_name)) {
/* do nothing */
}
- else if (strstr(de->d_name, PTCACHE_EXT)) { /* do we have the right extension?*/
+ else if (strstr(de->d_name, PTCACHE_EXT)) { /* Do we have the right extension? */
BLI_join_dirfile(path_full, sizeof(path_full), path, de->d_name);
BLI_delete(path_full, false, false);
}
@@ -3050,7 +3050,7 @@ void BKE_ptcache_remove(void)
closedir(dir);
}
else {
- rmdir = 0; /* path doesn't exist */
+ rmdir = 0; /* Path doesn't exist. */
}
if (rmdir) {
@@ -3569,8 +3569,8 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, const char *name_src, const c
BLI_strncpy(pid->cache->name, name_dst, sizeof(pid->cache->name));
while ((de = readdir(dir)) != NULL) {
- if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
- if (STREQLEN(old_filename, de->d_name, len)) { /* do we have the right prefix */
+ if (strstr(de->d_name, ext)) { /* Do we have the right extension? */
+ if (STREQLEN(old_filename, de->d_name, len)) { /* Do we have the right prefix. */
/* read the number of the file */
const int frame = ptcache_frame_from_filename(de->d_name, ext);
@@ -3589,7 +3589,7 @@ void BKE_ptcache_disk_cache_rename(PTCacheID *pid, const char *name_src, const c
void BKE_ptcache_load_external(PTCacheID *pid)
{
- /*todo*/
+ /* TODO: */
PointCache *cache = pid->cache;
int len; /* store the length of the string */
int info = 0;
@@ -3626,8 +3626,8 @@ void BKE_ptcache_load_external(PTCacheID *pid)
}
while ((de = readdir(dir)) != NULL) {
- if (strstr(de->d_name, ext)) { /* do we have the right extension?*/
- if (STREQLEN(filename, de->d_name, len)) { /* do we have the right prefix */
+ if (strstr(de->d_name, ext)) { /* Do we have the right extension? */
+ if (STREQLEN(filename, de->d_name, len)) { /* Do we have the right prefix. */
/* read the number of the file */
const int frame = ptcache_frame_from_filename(de->d_name, ext);
diff --git a/source/blender/blenkernel/intern/rigidbody.c b/source/blender/blenkernel/intern/rigidbody.c
index 21b86aa8148..2d4cce4b953 100644
--- a/source/blender/blenkernel/intern/rigidbody.c
+++ b/source/blender/blenkernel/intern/rigidbody.c
@@ -668,7 +668,7 @@ void BKE_rigidbody_calc_volume(Object *ob, float *r_vol)
radius = max_fff(size[0], size[1], size[2]) * 0.5f;
}
- /* calculate volume as appropriate */
+ /* Calculate volume as appropriate. */
switch (rbo->shape) {
case RB_SHAPE_BOX:
volume = size[0] * size[1] * size[2];
@@ -744,10 +744,10 @@ void BKE_rigidbody_calc_center_of_mass(Object *ob, float r_center[3])
* (i.e. Object pivot is centralized in boundbox)
* - boundbox gives full width
*/
- /* XXX: all dimensions are auto-determined now... later can add stored settings for this */
+ /* XXX: all dimensions are auto-determined now... later can add stored settings for this. */
BKE_object_dimensions_get(ob, size);
- /* calculate volume as appropriate */
+ /* Calculate volume as appropriate. */
switch (rbo->shape) {
case RB_SHAPE_BOX:
case RB_SHAPE_SPHERE:
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index 41f70db3fba..791116682c8 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -2013,7 +2013,7 @@ Scene *BKE_scene_duplicate(Main *bmain, Scene *sce, eSceneCopyMethod type)
bmain, NULL, sce_copy->master_collection, duplicate_flags, LIB_ID_DUPLICATE_IS_SUBPROCESS);
if (!is_subprocess) {
- /* This code will follow into all ID links using an ID tagged with LIB_TAG_NEW.*/
+ /* This code will follow into all ID links using an ID tagged with LIB_TAG_NEW. */
BKE_libblock_relink_to_newid(&sce_copy->id);
#ifndef NDEBUG
@@ -3379,7 +3379,7 @@ static bool depsgraph_key_compare(const void *key_a_v, const void *key_b_v)
{
const DepsgraphKey *key_a = key_a_v;
const DepsgraphKey *key_b = key_b_v;
- /* TODO(sergey): Compare rest of */
+ /* TODO(sergey): Compare rest of. */
return !(key_a->view_layer == key_b->view_layer);
}
diff --git a/source/blender/blenkernel/intern/screen.c b/source/blender/blenkernel/intern/screen.c
index 7a5892baaf6..608317933f5 100644
--- a/source/blender/blenkernel/intern/screen.c
+++ b/source/blender/blenkernel/intern/screen.c
@@ -1703,9 +1703,9 @@ static void direct_link_area(BlendDataReader *reader, ScrArea *area)
BLO_read_list(reader, &sconsole->scrollback);
BLO_read_list(reader, &sconsole->history);
- /* comma expressions, (e.g. expr1, expr2, expr3) evaluate each expression,
+ /* Comma expressions, (e.g. expr1, expr2, expr3) evaluate each expression,
* from left to right. the right-most expression sets the result of the comma
- * expression as a whole*/
+ * expression as a whole. */
LISTBASE_FOREACH_MUTABLE (ConsoleLine *, cl, &sconsole->history) {
BLO_read_data_address(reader, &cl->line);
if (cl->line) {
diff --git a/source/blender/blenkernel/intern/shrinkwrap.c b/source/blender/blenkernel/intern/shrinkwrap.c
index ae39b200b56..aeb8133974e 100644
--- a/source/blender/blenkernel/intern/shrinkwrap.c
+++ b/source/blender/blenkernel/intern/shrinkwrap.c
@@ -546,7 +546,7 @@ static void shrinkwrap_calc_normal_projection_cb_ex(void *__restrict userdata,
}
if (calc->vert != NULL && calc->smd->projAxis == MOD_SHRINKWRAP_PROJECT_OVER_NORMAL) {
- /* calc->vert contains verts from evaluated mesh. */
+ /* calc->vert 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
* vertexCos should be used */
diff --git a/source/blender/blenkernel/intern/softbody.c b/source/blender/blenkernel/intern/softbody.c
index fcc1afbc59b..123843c88db 100644
--- a/source/blender/blenkernel/intern/softbody.c
+++ b/source/blender/blenkernel/intern/softbody.c
@@ -109,11 +109,11 @@ typedef struct ReferenceVert {
} ReferenceVert;
typedef struct ReferenceState {
- float com[3]; /* center of mass*/
- ReferenceVert *ivert; /* list of initial values */
+ float com[3]; /* Center of mass. */
+ ReferenceVert *ivert; /* List of initial values. */
} ReferenceState;
-/*private scratch pad for caching and other data only needed when alive*/
+/* Private scratch pad for caching and other data only needed when alive. */
typedef struct SBScratch {
GHash *colliderhash;
short needstobuildcollider;
@@ -150,11 +150,11 @@ typedef struct SB_thread_context {
#define BSF_INTERSECT 1 /* edge intersects collider face */
/* private definitions for bodypoint states */
-#define SBF_DOFUZZY 1 /* Bodypoint do fuzzy */
-#define SBF_OUTOFCOLLISION 2 /* Bodypoint does not collide */
+#define SBF_DOFUZZY 1 /* Bodypoint do fuzzy. */
+#define SBF_OUTOFCOLLISION 2 /* Bodypoint does not collide. */
-#define BFF_INTERSECT 1 /* collider edge intrudes face */
-#define BFF_CLOSEVERT 2 /* collider vertex repulses face */
+#define BFF_INTERSECT 1 /* collider edge intrudes face. */
+#define BFF_CLOSEVERT 2 /* collider vertex repulses face. */
/* humm .. this should be calculated from sb parameters and sizes. */
static float SoftHeunTol = 1.0f;
@@ -162,9 +162,9 @@ static float SoftHeunTol = 1.0f;
/* local prototypes */
static void free_softbody_intern(SoftBody *sb);
-/*+++ frame based timing +++*/
+/*+++ frame based timing +++ */
-/*physical unit of force is [kg * m / sec^2]*/
+/* Physical unit of force is `kg * m / sec^2`. */
/**
* Since unit of g is [m/sec^2] and F = mass * g we re-scale unit mass of node to 1 gram
@@ -207,7 +207,7 @@ static float sb_time_scale(Object *ob)
}
/*--- frame based timing ---*/
-/* helper functions for everything is animatable jow_go_for2_5 +++++++*/
+/* helper functions for everything is animatable jow_go_for2_5 +++++++ */
/* introducing them here, because i know: steps in properties ( at frame timing )
* will cause unwanted responses of the softbody system (which does inter frame calculations )
* so first 'cure' would be: interpolate linear in time ..
@@ -217,7 +217,7 @@ static float sb_time_scale(Object *ob)
*/
/* animate sb->maxgoal, sb->mingoal */
-static float _final_goal(Object *ob, BodyPoint *bp) /*jow_go_for2_5 */
+static float _final_goal(Object *ob, BodyPoint *bp) /* jow_go_for2_5 */
{
float f = -1999.99f;
if (ob) {
@@ -235,7 +235,7 @@ static float _final_goal(Object *ob, BodyPoint *bp) /*jow_go_for2_5 */
}
}
CLOG_ERROR(&LOG, "sb or bp == NULL");
- return f; /*using crude but spot able values some times helps debuggin */
+ return f; /* Using crude but spot able values some times helps debugging. */
}
static float _final_mass(Object *ob, BodyPoint *bp)
@@ -251,7 +251,7 @@ static float _final_mass(Object *ob, BodyPoint *bp)
}
/* helper functions for everything is animateble jow_go_for2_5 ------*/
-/*+++ collider caching and dicing +++*/
+/* +++ collider caching and dicing +++ */
/*
* for each target object/face the axis aligned bounding box (AABB) is stored
@@ -311,7 +311,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
/* blow it up with forcefield ranges */
hull = max_ff(ob->pd->pdef_sbift, ob->pd->pdef_sboft);
- /* alloc and copy verts*/
+ /* Allocate and copy verts. */
pccd_M->mvert = MEM_dupallocN(cmd->xnew);
/* note that xnew coords are already in global space, */
/* determine the ortho BB */
@@ -328,7 +328,7 @@ static ccd_Mesh *ccd_mesh_make(Object *ob)
pccd_M->bbmax[1] = max_ff(pccd_M->bbmax[1], v[1] + hull);
pccd_M->bbmax[2] = max_ff(pccd_M->bbmax[2], v[2] + hull);
}
- /* alloc and copy faces*/
+ /* Allocate and copy faces. */
pccd_M->tri = MEM_dupallocN(cmd->tri);
/* OBBs for idea1 */
@@ -401,7 +401,7 @@ static void ccd_mesh_update(Object *ob, ccd_Mesh *pccd_M)
MEM_freeN((void *)pccd_M->mprevvert);
}
pccd_M->mprevvert = pccd_M->mvert;
- /* alloc and copy verts*/
+ /* Allocate and copy verts. */
pccd_M->mvert = MEM_dupallocN(cmd->xnew);
/* note that xnew coords are already in global space, */
/* determine the ortho BB */
@@ -598,7 +598,7 @@ static int count_mesh_quads(Mesh *me)
static void add_mesh_quad_diag_springs(Object *ob)
{
Mesh *me = ob->data;
- /*BodyPoint *bp;*/ /*UNUSED*/
+ // BodyPoint *bp; /* UNUSED */
int a;
if (ob->soft) {
@@ -618,7 +618,7 @@ static void add_mesh_quad_diag_springs(Object *ob)
/* fill the tail */
a = 0;
bs = &ob->soft->bspring[ob->soft->totspring];
- /*bp= ob->soft->bpoint; */ /*UNUSED*/
+ // bp = ob->soft->bpoint; /* UNUSED */
for (a = me->totpoly; a > 0; a--, mp++) {
if (mp->totloop == 4) {
bs->v1 = mloop[mp->loopstart + 0].v;
@@ -640,7 +640,7 @@ static void add_mesh_quad_diag_springs(Object *ob)
static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *counter, int addsprings)
{
- /*assume we have a softbody*/
+ /* Assume we have a softbody. */
SoftBody *sb = ob->soft; /* is supposed to be there */
BodyPoint *bp, *bpo;
BodySpring *bs, *bs2, *bs3 = NULL;
@@ -654,7 +654,7 @@ static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *count
bs3 = ob->soft->bspring + ob->soft->totspring;
}
for (a = sb->totpoint, bp = sb->bpoint; a > 0; a--, bp++) {
- /*scan for neighborhood*/
+ /* Scan for neighborhood. */
bpo = NULL;
v0 = (sb->totpoint - a);
for (b = bp->nofsprings; b > 0; b--) {
@@ -678,7 +678,7 @@ static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *count
for (c = bpo->nofsprings; c > 0; c--) {
bs2 = sb->bspring + bpo->springs[c - 1];
if ((bs2->v1 != notthis) && (bs2->v1 > v0)) {
- (*counter)++; /*hit */
+ (*counter)++; /* hit */
if (addsprings) {
bs3->v1 = v0;
bs3->v2 = bs2->v1;
@@ -698,7 +698,7 @@ static void add_2nd_order_roller(Object *ob, float UNUSED(stiffness), int *count
}
}
}
- /*scan for neighborhood done*/
+ /* Scan for neighborhood done. */
}
}
@@ -772,8 +772,8 @@ static void build_bps_springlist(Object *ob)
if (((sb->totpoint - a) == bs->v2)) {
add_bp_springlist(bp, sb->totspring - b);
}
- } /*for springs*/
- } /*for bp*/
+ } /* For springs. */
+ } /* For bp. */
}
static void calculate_collision_balls(Object *ob)
@@ -825,7 +825,7 @@ static void calculate_collision_balls(Object *ob)
else {
bp->colball = 0;
}
- } /*for bp*/
+ } /* For bp. */
}
/* creates new softbody if didn't exist yet, makes new points and springs arrays */
@@ -905,7 +905,7 @@ static void free_scratch(SoftBody *sb)
if (sb->scratch->colliderhash) {
BLI_ghash_free(sb->scratch->colliderhash,
NULL,
- (GHashValFreeFP)ccd_mesh_free); /*this hoepfully will free all caches*/
+ (GHashValFreeFP)ccd_mesh_free); /* This hopefully will free all caches. */
sb->scratch->colliderhash = NULL;
}
if (sb->scratch->bodyface) {
@@ -976,7 +976,7 @@ static void free_softbody_intern(SoftBody *sb)
* since that would only valid for 'slow' moving collision targets and dito particles
*/
-/* +++ dependency information functions*/
+/* +++ dependency information functions. */
/**
* \note collection overrides scene when not NULL.
@@ -990,9 +990,9 @@ static int query_external_colliders(Depsgraph *depsgraph, Collection *collection
return (numobjects != 0);
}
-/* --- dependency information functions*/
+/* --- dependency information functions. */
-/* +++ the aabb "force" section*/
+/* +++ the aabb "force" section. */
static int sb_detect_aabb_collisionCached(float UNUSED(force[3]),
struct Object *vertexowner,
float UNUSED(time))
@@ -1036,7 +1036,7 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]),
deflected = 2;
}
else {
- /*aye that should be cached*/
+ /* Aye that should be cached. */
CLOG_ERROR(&LOG, "missing cache error");
BLI_ghashIterator_step(ihash);
continue;
@@ -1048,9 +1048,9 @@ static int sb_detect_aabb_collisionCached(float UNUSED(force[3]),
BLI_ghashIterator_free(ihash);
return deflected;
}
-/* --- the aabb section*/
+/* --- the aabb section. */
-/* +++ the face external section*/
+/* +++ the face external section. */
static int sb_detect_face_pointCached(const float face_v1[3],
const float face_v2[3],
const float face_v3[3],
@@ -1104,13 +1104,13 @@ static int sb_detect_face_pointCached(const float face_v1[3],
}
}
else {
- /*aye that should be cached*/
+ /* Aye that should be cached. */
CLOG_ERROR(&LOG, "missing cache error");
BLI_ghashIterator_step(ihash);
continue;
}
- /* use mesh*/
+ /* Use mesh. */
if (mvert) {
while (a) {
copy_v3_v3(nv1, mvert[a - 1].co);
@@ -1118,7 +1118,7 @@ static int sb_detect_face_pointCached(const float face_v1[3],
mul_v3_fl(nv1, time);
madd_v3_v3fl(nv1, mprevvert[a - 1].co, 1.0f - time);
}
- /* origin to face_v2*/
+ /* Origin to face_v2. */
sub_v3_v3(nv1, face_v2);
facedist = dot_v3v3(nv1, d_nvect);
if (fabsf(facedist) < outerfacethickness) {
@@ -1139,7 +1139,7 @@ static int sb_detect_face_pointCached(const float face_v1[3],
}
}
a--;
- } /* while (a)*/
+ } /* while (a) */
} /* if (mvert) */
} /* if (ob->pd && ob->pd->deflect) */
BLI_ghashIterator_step(ihash);
@@ -1201,13 +1201,13 @@ static int sb_detect_face_collisionCached(const float face_v1[3],
}
}
else {
- /*aye that should be cached*/
+ /* Aye that should be cached. */
CLOG_ERROR(&LOG, "missing cache error");
BLI_ghashIterator_step(ihash);
continue;
}
- /* use mesh*/
+ /* Use mesh. */
while (a--) {
if ((aabbmax[0] < mima->minx) || (aabbmin[0] > mima->maxx) ||
(aabbmax[1] < mima->miny) || (aabbmin[1] > mima->maxy) ||
@@ -1235,7 +1235,7 @@ static int sb_detect_face_collisionCached(const float face_v1[3],
}
}
- /* switch origin to be nv2*/
+ /* Switch origin to be nv2. */
sub_v3_v3v3(edge1, nv1, nv2);
sub_v3_v3v3(edge2, nv3, nv2);
cross_v3_v3v3(d_nvect, edge2, edge1);
@@ -1272,7 +1272,7 @@ static void scan_for_ext_face_forces(Object *ob, float timenow)
bf = sb->scratch->bodyface;
for (a = 0; a < sb->scratch->totface; a++, bf++) {
bf->ext_force[0] = bf->ext_force[1] = bf->ext_force[2] = 0.0f;
- /*+++edges intruding*/
+ /*+++edges intruding. */
bf->flag &= ~BFF_INTERSECT;
zero_v3(feedback);
if (sb_detect_face_collisionCached(sb->bpoint[bf->v1].pos,
@@ -1289,9 +1289,9 @@ static void scan_for_ext_face_forces(Object *ob, float timenow)
bf->flag |= BFF_INTERSECT;
choke = min_ff(max_ff(damp, choke), 1.0f);
}
- /*---edges intruding*/
+ /*---edges intruding. */
- /*+++ close vertices*/
+ /*+++ close vertices. */
if ((bf->flag & BFF_INTERSECT) == 0) {
bf->flag &= ~BFF_CLOSEVERT;
tune = -1.0f;
@@ -1311,7 +1311,7 @@ static void scan_for_ext_face_forces(Object *ob, float timenow)
choke = min_ff(max_ff(damp, choke), 1.0f);
}
}
- /*--- close vertices*/
+ /*--- close vertices. */
}
bf = sb->scratch->bodyface;
for (a = 0; a < sb->scratch->totface; a++, bf++) {
@@ -1324,9 +1324,9 @@ static void scan_for_ext_face_forces(Object *ob, float timenow)
}
}
-/* --- the face external section*/
+/* --- the face external section. */
-/* +++ the spring external section*/
+/* +++ the spring external section. */
static int sb_detect_edge_collisionCached(const float edge_v1[3],
const float edge_v2[3],
@@ -1377,13 +1377,13 @@ static int sb_detect_edge_collisionCached(const float edge_v1[3],
}
}
else {
- /*aye that should be cached*/
+ /* Aye that should be cached. */
CLOG_ERROR(&LOG, "missing cache error");
BLI_ghashIterator_step(ihash);
continue;
}
- /* use mesh*/
+ /* Use mesh. */
while (a--) {
if ((aabbmax[0] < mima->minx) || (aabbmin[0] > mima->maxx) ||
(aabbmax[1] < mima->miny) || (aabbmin[1] > mima->maxy) ||
@@ -1411,7 +1411,7 @@ static int sb_detect_edge_collisionCached(const float edge_v1[3],
}
}
- /* switch origin to be nv2*/
+ /* Switch origin to be nv2. */
sub_v3_v3v3(edge1, nv1, nv2);
sub_v3_v3v3(edge2, nv3, nv2);
@@ -1469,12 +1469,12 @@ static void _scan_for_ext_spring_forces(
}
/* ---- springs colliding */
- /* +++ springs seeing wind ... n stuff depending on their orientation*/
- /* note we don't use sb->mediafrict but use sb->aeroedge for magnitude of effect*/
+ /* +++ springs seeing wind ... n stuff depending on their orientation. */
+ /* NOTE: we don't use `sb->mediafrict` but use `sb->aeroedge` for magnitude of effect. */
if (sb->aeroedge) {
float vel[3], sp[3], pr[3], force[3];
float f, windfactor = 0.25f;
- /*see if we have wind*/
+ /* See if we have wind. */
if (effectors) {
EffectedPoint epoint;
float speed[3] = {0.0f, 0.0f, 0.0f};
@@ -1543,7 +1543,7 @@ static void sb_sfesf_threads_run(struct Depsgraph *depsgraph,
/* figure the number of threads while preventing pretty pointless threading overhead */
totthread = BKE_scene_num_threads(scene);
- /* what if we got zillions of CPUs running but less to spread*/
+ /* What if we got zillions of CPUs running but less to spread. */
while ((totsprings / totthread < lowsprings) && (totthread > 1)) {
totthread--;
}
@@ -1590,7 +1590,7 @@ static void sb_sfesf_threads_run(struct Depsgraph *depsgraph,
BKE_effectors_free(effectors);
}
-/* --- the spring external section*/
+/* --- the spring external section. */
static int choose_winner(
float *w, float *pos, float *a, float *b, float *c, float *ca, float *cb, float *cc)
@@ -1683,7 +1683,7 @@ static int sb_detect_vertex_collisionCached(float opco[3],
}
}
else {
- /*aye that should be cached*/
+ /* Aye that should be cached. */
CLOG_ERROR(&LOG, "missing cache error");
BLI_ghashIterator_step(ihash);
continue;
@@ -1697,7 +1697,7 @@ static int sb_detect_vertex_collisionCached(float opco[3],
fa *= fa;
fa = 1.0f / fa;
avel[0] = avel[1] = avel[2] = 0.0f;
- /* use mesh*/
+ /* 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)) {
@@ -1733,7 +1733,7 @@ static int sb_detect_vertex_collisionCached(float opco[3],
}
}
- /* switch origin to be nv2*/
+ /* Switch origin to be nv2. */
sub_v3_v3v3(edge1, nv1, nv2);
sub_v3_v3v3(edge2, nv3, nv2);
/* Abuse dv1 to have vertex in question at *origin* of triangle. */
@@ -2068,7 +2068,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene,
bp->force[1] += -ks * (auxvect[1]);
bp->force[2] += -ks * (auxvect[2]);
- /* calculate damping forces generated by goals*/
+ /* Calculate damping forces generated by goals. */
sub_v3_v3v3(velgoal, bp->origS, bp->origE);
kd = sb->goalfrict * sb_fric_force_scale(ob);
add_v3_v3v3(auxvect, velgoal, bp->vec);
@@ -2113,7 +2113,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene,
pd_point_from_soft(scene, bp->pos, bp->vec, sb->bpoint - bp, &epoint);
BKE_effectors_apply(effectors, NULL, sb->effector_weights, &epoint, force, NULL, speed);
- /* apply forcefield*/
+ /* Apply force-field. */
mul_v3_fl(force, fieldfactor * eval_sb_fric_force_scale);
add_v3_v3(bp->force, force);
@@ -2125,7 +2125,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene,
/* now we'll have nice centrifugal effect for vortex */
}
else {
- /* BP friction in media (not) moving*/
+ /* BP friction in media (not) moving. */
float kd = sb->mediafrict * sb_fric_force_scale(ob);
/* assume it to be proportional to actual velocity */
bp->force[0] -= bp->vec[0] * kd;
@@ -2160,7 +2160,7 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene,
/* +++springs */
iks = 1.0f / (1.0f - sb->inspring) - 1.0f; /* inner spring constants function */
if (ob->softflag & OB_SB_EDGES) {
- if (sb->bspring) { /* spring list exists at all ? */
+ if (sb->bspring) { /* Spring list exists at all? */
int b;
BodySpring *bs;
for (b = bp->nofsprings; b > 0; b--) {
@@ -2173,13 +2173,13 @@ static int _softbody_calc_forces_slice_in_a_thread(Scene *scene,
}
// sb_spring_force(Object *ob, int bpi, BodySpring *bs, float iks, float forcetime)
sb_spring_force(ob, ilast - bb, bs, iks, forcetime);
- } /* loop springs */
- } /* existing spring list */
- } /*any edges*/
+ } /* loop springs. */
+ } /* existing spring list. */
+ } /* Any edges. */
/* ---springs */
- } /*omit on snap */
- } /*loop all bp's*/
- return 0; /*done fine*/
+ } /* Omit on snap. */
+ } /* Loop all bp's. */
+ return 0; /* Done fine. */
}
static void *exec_softbody_calc_forces(void *data)
@@ -2220,7 +2220,7 @@ static void sb_cf_threads_run(Scene *scene,
/* figure the number of threads while preventing pretty pointless threading overhead */
totthread = BKE_scene_num_threads(scene);
- /* what if we got zillions of CPUs running but less to spread*/
+ /* What if we got zillions of CPUs running but less to spread. */
while ((totpoint / totthread < lowpoints) && (totthread > 1)) {
totthread--;
}
@@ -2275,11 +2275,11 @@ static void softbody_calc_forces(
* this will ruin adaptive stepsize AKA heun! (BM)
*/
SoftBody *sb = ob->soft; /* is supposed to be there */
- /*BodyPoint *bproot;*/ /* UNUSED */
- /* float gravity; */ /* UNUSED */
- /* float iks; */
+ // BodyPoint *bproot; /* UNUSED */
+ // float gravity; /* UNUSED */
+ // float iks;
float fieldfactor = -1.0f, windfactor = 0.25;
- int do_deflector /*, do_selfcollision*/, do_springcollision, do_aero;
+ int do_deflector /*, do_selfcollision */, do_springcollision, do_aero;
/* gravity = sb->grav * sb_grav_force_scale(ob); */ /* UNUSED */
@@ -2292,8 +2292,8 @@ static void softbody_calc_forces(
(ob->softflag & OB_SB_EDGECOLL);
do_aero = ((sb->aeroedge) && (ob->softflag & OB_SB_EDGES));
- /* iks = 1.0f/(1.0f-sb->inspring)-1.0f; */ /* inner spring constants function */ /* UNUSED */
- /* bproot= sb->bpoint; */ /* need this for proper spring addressing */ /* UNUSED */
+ // iks = 1.0f / (1.0f - sb->inspring) - 1.0f; /* Inner spring constants function. */ /* UNUSED */
+ // bproot = sb->bpoint; /* Need this for proper spring addressing. */ /* UNUSED */
if (do_springcollision || do_aero) {
sb_sfesf_threads_run(depsgraph, scene, ob, timenow, sb->totspring, NULL);
@@ -2344,7 +2344,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
aabbmin[0] = aabbmin[1] = aabbmin[2] = 1e20f;
aabbmax[0] = aabbmax[1] = aabbmax[2] = -1e20f;
- /* old one with homogeneous masses */
+ /* old one with homogeneous masses */
/* claim a minimum mass for vertex */
#if 0
if (sb->nodemass > 0.009999f) {
@@ -2489,7 +2489,7 @@ static void softbody_apply_forces(Object *ob, float forcetime, int mode, float *
/* used by heun when it overshoots */
static void softbody_restore_prev_step(Object *ob)
{
- SoftBody *sb = ob->soft; /* is supposed to be there*/
+ SoftBody *sb = ob->soft; /* is supposed to be there. */
BodyPoint *bp;
int a;
@@ -2502,7 +2502,7 @@ static void softbody_restore_prev_step(Object *ob)
#if 0
static void softbody_store_step(Object *ob)
{
- SoftBody *sb = ob->soft; /* is supposed to be there*/
+ SoftBody *sb = ob->soft; /* is supposed to be there. */
BodyPoint *bp;
int a;
@@ -2515,7 +2515,7 @@ static void softbody_store_step(Object *ob)
/* used by predictors and correctors */
static void softbody_store_state(Object *ob, float *ppos, float *pvel)
{
- SoftBody *sb = ob->soft; /* is supposed to be there*/
+ SoftBody *sb = ob->soft; /* is supposed to be there. */
BodyPoint *bp;
int a;
float *pp = ppos, *pv = pvel;
@@ -2533,7 +2533,7 @@ static void softbody_store_state(Object *ob, float *ppos, float *pvel)
/* used by predictors and correctors */
static void softbody_retrieve_state(Object *ob, float *ppos, float *pvel)
{
- SoftBody *sb = ob->soft; /* is supposed to be there*/
+ SoftBody *sb = ob->soft; /* is supposed to be there. */
BodyPoint *bp;
int a;
float *pp = ppos, *pv = pvel;
@@ -2551,7 +2551,7 @@ static void softbody_retrieve_state(Object *ob, float *ppos, float *pvel)
/* used by predictors and correctors */
static void softbody_swap_state(Object *ob, float *ppos, float *pvel)
{
- SoftBody *sb = ob->soft; /* is supposed to be there*/
+ SoftBody *sb = ob->soft; /* is supposed to be there. */
BodyPoint *bp;
int a;
float *pp = ppos, *pv = pvel;
@@ -2773,7 +2773,7 @@ static void mesh_faces_to_scratch(Object *ob)
MLoopTri *looptri, *lt;
BodyFace *bodyface;
int a;
- /* alloc and copy faces*/
+ /* Allocate and copy faces. */
sb->scratch->totface = poly_to_tri_count(me->totpoly, me->totloop);
looptri = lt = MEM_mallocN(sizeof(*looptri) * sb->scratch->totface, __func__);
@@ -3000,8 +3000,8 @@ static void curve_surf_to_softbody(Object *ob)
bp = sb->bpoint;
bs = sb->bspring;
- /* weights from bpoints, same code used as for mesh vertices */
- /* if ((ob->softflag & OB_SB_GOAL) && sb->vertgroup) 2.4x hack*/
+ /* Weights from bpoints, same code used as for mesh vertices. */
+ /* if ((ob->softflag & OB_SB_GOAL) && sb->vertgroup) 2.4x hack. */
/* new! take the weights from curve vertex anyhow */
if (ob->softflag & OB_SB_GOAL) {
setgoal = 1;
@@ -3022,10 +3022,10 @@ static void curve_surf_to_softbody(Object *ob)
if (setgoal) {
bp->goal *= bezt->weight;
- /* all three triples */
+ /* All three triples. */
(bp + 1)->goal = bp->goal;
(bp + 2)->goal = bp->goal;
- /*do not collide handles */
+ /* Do not collide handles. */
(bp + 1)->loc_flag |= SBF_OUTOFCOLLISION;
(bp + 2)->loc_flag |= SBF_OUTOFCOLLISION;
}
@@ -3137,7 +3137,7 @@ SoftBody *sbNew(void)
sb->inspring = 0.5f;
sb->infrict = 0.5f;
- /*todo backward file compat should copy inspring to inpush while reading old files*/
+ /* TODO: backward file compat should copy `inspring` to `inpush` while reading old files. */
sb->inpush = 0.5f;
sb->colball = 0.49f;
@@ -3150,7 +3150,7 @@ SoftBody *sbNew(void)
sb->choke = 3;
sb_new_scratch(sb);
- /*todo backward file compat should set sb->shearstiff = 1.0f while reading old files*/
+ /* TODO: backward file compat should set `sb->shearstiff = 1.0f` while reading old files. */
sb->shearstiff = 1.0f;
sb->solverflags |= SBSO_OLDERR;
@@ -3311,7 +3311,7 @@ static void softbody_reset(Object *ob, SoftBody *sb, float (*vertexCos)[3], int
for (a = 0, bp = sb->bpoint; a < numVerts; a++, bp++) {
copy_v3_v3(bp->pos, vertexCos[a]);
- mul_m4_v3(ob->obmat, bp->pos); /* yep, sofbody is global coords*/
+ mul_m4_v3(ob->obmat, bp->pos); /* Yep, soft-body is global coords. */
copy_v3_v3(bp->origS, bp->pos);
copy_v3_v3(bp->origE, bp->pos);
copy_v3_v3(bp->origT, bp->pos);
@@ -3493,18 +3493,18 @@ static void softbody_step(
else if (sb->solver_ID == 2) {
/* do semi "fake" implicit euler */
/* removed */
- } /*SOLVER SELECT*/
+ } /* SOLVER SELECT */
else if (sb->solver_ID == 4) {
/* do semi "fake" implicit euler */
- } /*SOLVER SELECT*/
+ } /* SOLVER SELECT */
else if (sb->solver_ID == 3) {
/* do "stupid" semi "fake" implicit euler */
/* removed */
- } /*SOLVER SELECT*/
+ } /* SOLVER SELECT */
else {
CLOG_ERROR(&LOG, "softbody no valid solver ID!");
- } /*SOLVER SELECT*/
+ } /* SOLVER SELECT */
if (sb->plastic) {
apply_spring_memory(ob);
}
diff --git a/source/blender/blenkernel/intern/spline_nurbs.cc b/source/blender/blenkernel/intern/spline_nurbs.cc
index 85fb9730e83..76d046337c0 100644
--- a/source/blender/blenkernel/intern/spline_nurbs.cc
+++ b/source/blender/blenkernel/intern/spline_nurbs.cc
@@ -45,7 +45,7 @@ void NURBSpline::copy_data(Spline &dst) const
nurbs.positions_ = positions_;
nurbs.weights_ = weights_;
nurbs.knots_ = knots_;
- nurbs.knots_dirty_ = false;
+ nurbs.knots_dirty_ = knots_dirty_;
nurbs.radii_ = radii_;
nurbs.tilts_ = tilts_;
}
diff --git a/source/blender/blenkernel/intern/subdiv_ccg.c b/source/blender/blenkernel/intern/subdiv_ccg.c
index 4ca6f93b014..8b672b2cb49 100644
--- a/source/blender/blenkernel/intern/subdiv_ccg.c
+++ b/source/blender/blenkernel/intern/subdiv_ccg.c
@@ -63,7 +63,7 @@ void subdiv_ccg_average_faces_boundaries_and_corners(SubdivCCG *subdiv_ccg,
/** \name Generally useful internal helpers
* \{ */
-/* Number of floats in per-vertex elements. */
+/* Number of floats in per-vertex elements. */
static int num_element_float_get(const SubdivCCG *subdiv_ccg)
{
/* We always have 3 floats for coordinate. */
@@ -1116,7 +1116,7 @@ typedef struct AverageGridsCornerData {
SubdivCCG *subdiv_ccg;
CCGKey *key;
- /* Optional lookup table. Maps task range index to index in subdiv_ccg->adjacent_vertices*/
+ /* Optional lookup table. Maps task range index to index in `subdiv_ccg->adjacent_vertices`. */
const int *adjacent_vert_index_map;
} AverageGridsCornerData;
@@ -1489,7 +1489,7 @@ BLI_INLINE SubdivCCGCoord coord_at_next_col(const SubdivCCG *subdiv_ccg,
return result;
}
-/* For the input coordinate which is at the boundary of the grid do one step inside. */
+/* For the input coordinate which is at the boundary of the grid do one step inside. */
static SubdivCCGCoord coord_step_inside_from_boundary(const SubdivCCG *subdiv_ccg,
const SubdivCCGCoord *coord)
diff --git a/source/blender/blenkernel/intern/subdiv_eval.c b/source/blender/blenkernel/intern/subdiv_eval.c
index 201d308e096..693827f99ac 100644
--- a/source/blender/blenkernel/intern/subdiv_eval.c
+++ b/source/blender/blenkernel/intern/subdiv_eval.c
@@ -282,7 +282,7 @@ static void buffer_apply_offset(void **buffer, const int offset)
*buffer = ((unsigned char *)*buffer) + offset;
}
-/* Write given number of floats to the beginning of given buffer. */
+/* Write given number of floats to the beginning of given buffer. */
static void buffer_write_float_value(void **buffer, const float *values_buffer, int num_values)
{
memcpy(*buffer, values_buffer, sizeof(float) * num_values);
diff --git a/source/blender/blenkernel/intern/subdiv_foreach.c b/source/blender/blenkernel/intern/subdiv_foreach.c
index 4400e9c976f..061c196df2a 100644
--- a/source/blender/blenkernel/intern/subdiv_foreach.c
+++ b/source/blender/blenkernel/intern/subdiv_foreach.c
@@ -1749,7 +1749,7 @@ static void subdiv_foreach_vertices_of_loose_edges_task(void *__restrict userdat
/* Subdivision vertices which corresponds to edge's v1 and v2. */
const int subdiv_v1_index = ctx->vertices_corner_offset + coarse_edge->v1;
const int subdiv_v2_index = ctx->vertices_corner_offset + coarse_edge->v2;
- /* First subdivided inner vertex of the edge. */
+ /* First subdivided inner vertex of the edge. */
const int subdiv_start_vertex = ctx->vertices_edge_offset +
coarse_edge_index * num_subdiv_vertices_per_coarse_edge;
/* Perform interpolation. */
diff --git a/source/blender/blenkernel/intern/subsurf_ccg.c b/source/blender/blenkernel/intern/subsurf_ccg.c
index 23eccbfba9b..0dbfeaaaadb 100644
--- a/source/blender/blenkernel/intern/subsurf_ccg.c
+++ b/source/blender/blenkernel/intern/subsurf_ccg.c
@@ -580,16 +580,16 @@ static void ss_sync_ccg_from_derivedmesh(CCGSubSurf *ss,
#endif
MVert *mvert = dm->getVertArray(dm);
MEdge *medge = dm->getEdgeArray(dm);
- /* MFace *mface = dm->getTessFaceArray(dm); */ /* UNUSED */
+ // MFace *mface = dm->getTessFaceArray(dm); /* UNUSED */
MVert *mv;
MEdge *me;
MLoop *mloop = dm->getLoopArray(dm), *ml;
MPoly *mpoly = dm->getPolyArray(dm), *mp;
- /*MFace *mf;*/ /*UNUSED*/
+ // MFace *mf; /* UNUSED */
int totvert = dm->getNumVerts(dm);
int totedge = dm->getNumEdges(dm);
- /*int totface = dm->getNumTessFaces(dm);*/ /*UNUSED*/
- /*int totpoly = dm->getNumFaces(dm);*/ /*UNUSED*/
+ // int totface = dm->getNumTessFaces(dm); /* UNUSED */
+ // int totpoly = dm->getNumFaces(dm); /* UNUSED */
int i, j;
int *index;
@@ -641,10 +641,10 @@ static void ss_sync_ccg_from_derivedmesh(CCGSubSurf *ss,
fVerts[j] = POINTER_FROM_UINT(ml->v);
}
- /* this is very bad, means mesh is internally inconsistent.
+ /* This is very bad, means mesh is internally inconsistent.
* it is not really possible to continue without modifying
* other parts of code significantly to handle missing faces.
- * since this really shouldn't even be possible we just bail.*/
+ * since this really shouldn't even be possible we just bail. */
if (ccgSubSurf_syncFace(ss, POINTER_FROM_INT(i), mp->totloop, fVerts, &f) ==
eCCGError_InvalidValue) {
static int hasGivenError = 0;
@@ -1008,11 +1008,11 @@ static void ccgDM_getFinalFace(DerivedMesh *dm, int faceNum, MFace *mf)
int gridFaces = gridSideEdges * gridSideEdges;
int i;
CCGFace *f;
- /*int numVerts;*/
+ // int numVerts;
int offset;
int grid;
int x, y;
- /*int lastface = ccgSubSurf_getNumFaces(ss) - 1;*/ /*UNUSED*/
+ // int lastface = ccgSubSurf_getNumFaces(ss) - 1; /* UNUSED */
DMFlagMat *faceFlags = ccgdm->faceFlags;
memset(mf, 0, sizeof(*mf));
@@ -1023,7 +1023,7 @@ static void ccgDM_getFinalFace(DerivedMesh *dm, int faceNum, MFace *mf)
i = ccgdm->reverseFaceMap[faceNum];
f = ccgdm->faceMap[i].face;
- /*numVerts = ccgSubSurf_getFaceNumVerts(f);*/ /*UNUSED*/
+ // numVerts = ccgSubSurf_getFaceNumVerts(f); /* UNUSED */
offset = faceNum - ccgdm->faceMap[i].startFace;
grid = offset / gridFaces;
@@ -1781,7 +1781,7 @@ static void ccgdm_create_grids(DerivedMesh *dm)
numGrids = ccgDM_getNumGrids(dm);
numFaces = ccgSubSurf_getNumFaces(ss);
- /*gridSize = ccgDM_getGridSize(dm);*/ /*UNUSED*/
+ // gridSize = ccgDM_getGridSize(dm); /* UNUSED */
/* compute offset into grid array for each face */
gridOffset = MEM_mallocN(sizeof(int) * numFaces, "ccgdm.gridOffset");
@@ -2089,7 +2089,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
vertidx[s] = POINTER_AS_INT(ccgSubSurf_getVertVertHandle(v));
}
- /*I think this is for interpolating the center vert?*/
+ /* I think this is for interpolating the center vert? */
w2 = w; // + numVerts*(g2_wid-1) * (g2_wid-1); //numVerts*((g2_wid-1) * g2_wid+g2_wid-1);
DM_interp_vert_data(dm, &ccgdm->dm, vertidx, w2, numVerts, vertNum);
if (vertOrigIndex) {
@@ -2099,7 +2099,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
vertNum++;
- /*interpolate per-vert data*/
+ /* Interpolate per-vert data. */
for (s = 0; s < numVerts; s++) {
for (x = 1; x < gridFaces; x++) {
w2 = w + s * numVerts * g2_wid * g2_wid + x * numVerts;
@@ -2114,7 +2114,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
}
}
- /*interpolate per-vert data*/
+ /* Interpolate per-vert data. */
for (s = 0; s < numVerts; s++) {
for (y = 1; y < gridFaces; y++) {
for (x = 1; x < gridFaces; x++) {
@@ -2138,7 +2138,7 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
}
for (s = 0; s < numVerts; s++) {
- /*interpolate per-face data*/
+ /* Interpolate per-face data. */
for (y = 0; y < gridFaces; y++) {
for (x = 0; x < gridFaces; x++) {
w2 = w + s * numVerts * g2_wid * g2_wid + (y * g2_wid + x) * numVerts;
@@ -2161,10 +2161,10 @@ static void set_ccgdm_all_geometry(CCGDerivedMesh *ccgdm,
&dm->loopData, &ccgdm->dm.loopData, loopidx, w2, NULL, numVerts, loopindex2);
loopindex2++;
- /*copy over poly data, e.g. mtexpoly*/
+ /* Copy over poly data, e.g. mtexpoly. */
CustomData_copy_data(&dm->polyData, &ccgdm->dm.polyData, origIndex, faceNum, 1);
- /*set original index data*/
+ /* Set original index data. */
if (faceOrigIndex) {
/* reference the index in 'polyOrigIndex' */
*faceOrigIndex = faceNum;
diff --git a/source/blender/blenkernel/intern/tracking_stabilize.c b/source/blender/blenkernel/intern/tracking_stabilize.c
index 46589a578a8..3dff750edfb 100644
--- a/source/blender/blenkernel/intern/tracking_stabilize.c
+++ b/source/blender/blenkernel/intern/tracking_stabilize.c
@@ -1381,7 +1381,7 @@ ImBuf *BKE_tracking_stabilize_frame(
return ibuf;
}
- /* Allocate frame for stabilization result, copy alpha mode and colorspace. */
+ /* Allocate frame for stabilization result, copy alpha mode and colorspace. */
ibuf_flags = 0;
if (ibuf->rect) {
ibuf_flags |= IB_rect;
diff --git a/source/blender/blenkernel/intern/unit.c b/source/blender/blenkernel/intern/unit.c
index c2fb5ef4238..290b880934e 100644
--- a/source/blender/blenkernel/intern/unit.c
+++ b/source/blender/blenkernel/intern/unit.c
@@ -744,10 +744,10 @@ static const char *unit_find_str(const char *str, const char *substr, bool case_
*
* "1m1cm+2mm" - Original value.
* "1*1#1*0.01#+2*0.001#" - Replace numbers.
- * "1*1+1*0.01 +2*0.001 " - Add add signs if ( + - * / | & ~ < > ^ ! = % ) not found in between.
+ * "1*1+1*0.01 +2*0.001 " - Add plus signs if ( + - * / | & ~ < > ^ ! = % ) not found in between.
*/
-/* Not too strict, (+ - * /) are most common. */
+/* Not too strict, (+ - * /) are most common. */
static bool ch_is_op(char op)
{
switch (op) {
@@ -917,7 +917,7 @@ static int unit_scale_str(char *str,
return 0;
}
- /* XXX - investigate, does not respect len_max properly. */
+ /* XXX - investigate, does not respect len_max properly. */
char *str_found = (char *)unit_find_str(str, replace_str, case_sensitive);
if (str_found == NULL) {
diff --git a/source/blender/blenkernel/intern/volume.cc b/source/blender/blenkernel/intern/volume.cc
index 5fc55aad6a2..272ecc71833 100644
--- a/source/blender/blenkernel/intern/volume.cc
+++ b/source/blender/blenkernel/intern/volume.cc
@@ -1224,7 +1224,7 @@ const VolumeGrid *BKE_volume_grid_active_get_for_read(const Volume *volume)
return BKE_volume_grid_get_for_read(volume, index);
}
-/* Tries to find a grid with the given name. Make sure that that the volume has been loaded. */
+/* Tries to find a grid with the given name. Make sure that the volume has been loaded. */
const VolumeGrid *BKE_volume_grid_find_for_read(const Volume *volume, const char *name)
{
int num_grids = BKE_volume_num_grids(volume);
diff --git a/source/blender/blenkernel/intern/workspace.c b/source/blender/blenkernel/intern/workspace.c
index be67b2370e3..533107b2bf6 100644
--- a/source/blender/blenkernel/intern/workspace.c
+++ b/source/blender/blenkernel/intern/workspace.c
@@ -105,8 +105,8 @@ static void workspace_blend_read_data(BlendDataReader *reader, ID *id)
BLO_read_list(reader, &workspace->tools);
LISTBASE_FOREACH (WorkSpaceDataRelation *, relation, &workspace->hook_layout_relations) {
- /* parent pointer does not belong to workspace data and is therefore restored in lib_link step
- * of window manager.*/
+ /* Parent pointer does not belong to workspace data and is therefore restored in lib_link step
+ * of window manager. */
BLO_read_data_address(reader, &relation->value);
}
diff --git a/source/blender/blenkernel/nla_private.h b/source/blender/blenkernel/nla_private.h
index 71b5a74ddf7..3e13ba602a4 100644
--- a/source/blender/blenkernel/nla_private.h
+++ b/source/blender/blenkernel/nla_private.h
@@ -39,13 +39,13 @@ struct AnimationEvalContext;
typedef struct NlaEvalStrip {
struct NlaEvalStrip *next, *prev;
- NlaTrack *track; /* track that this strip belongs to */
- NlaStrip *strip; /* strip that's being used */
+ NlaTrack *track; /* Track that this strip belongs to. */
+ NlaStrip *strip; /* Strip that's being used. */
- short track_index; /* the index of the track within the list */
- short strip_mode; /* which end of the strip are we looking at */
+ short track_index; /* The index of the track within the list. */
+ short strip_mode; /* Which end of the strip are we looking at. */
- float strip_time; /* time at which which strip is being evaluated */
+ float strip_time; /* Time at which this strip is being evaluated. */
} NlaEvalStrip;
/* NlaEvalStrip->strip_mode */