[Bf-blender-cvs] [51a461dcab3] blender-v2.90-release: Cleanup: spelling, use full sentences for object_dupli.c
Campbell Barton
noreply at git.blender.org
Thu Aug 13 07:45:40 CEST 2020
Commit: 51a461dcab386297d693ec238baf88f91fdcea65
Author: Campbell Barton
Date: Thu Aug 13 09:49:49 2020 +1000
Branches: blender-v2.90-release
https://developer.blender.org/rB51a461dcab386297d693ec238baf88f91fdcea65
Cleanup: spelling, use full sentences for object_dupli.c
===================================================================
M source/blender/blenkernel/intern/object_dupli.c
===================================================================
diff --git a/source/blender/blenkernel/intern/object_dupli.c b/source/blender/blenkernel/intern/object_dupli.c
index c0ca7cb8355..22643e54f94 100644
--- a/source/blender/blenkernel/intern/object_dupli.c
+++ b/source/blender/blenkernel/intern/object_dupli.c
@@ -83,11 +83,11 @@ typedef struct DupliContext {
const struct DupliGenerator *gen;
/** Result containers. */
- ListBase *duplilist; /* legacy doubly-linked list */
+ ListBase *duplilist; /* Legacy doubly-linked list. */
} DupliContext;
typedef struct DupliGenerator {
- short type; /* dupli type */
+ short type; /* Dupli Type, see members of #OB_DUPLI. */
void (*make_duplis)(const DupliContext *ctx);
} DupliGenerator;
@@ -159,7 +159,7 @@ static DupliObject *make_dupli(const DupliContext *ctx,
DupliObject *dob;
int i;
- /* add a DupliObject instance to the result container */
+ /* Add a #DupliObject instance to the result container. */
if (ctx->duplilist) {
dob = MEM_callocN(sizeof(DupliObject), "dupli object");
BLI_addtail(ctx->duplilist, dob);
@@ -172,28 +172,28 @@ static DupliObject *make_dupli(const DupliContext *ctx,
mul_m4_m4m4(dob->mat, (float(*)[4])ctx->space_mat, mat);
dob->type = ctx->gen->type;
- /* set persistent id, which is an array with a persistent index for each level
+ /* Set persistent id, which is an array with a persistent index for each level
* (particle number, vertex number, ..). by comparing this we can find the same
- * dupli object between frames, which is needed for motion blur. last level
- * goes first in the array. */
+ * dupli-object between frames, which is needed for motion blur.
+ * The last level is ordered first in the array. */
dob->persistent_id[0] = index;
for (i = 1; i < ctx->level + 1; i++) {
dob->persistent_id[i] = ctx->persistent_id[ctx->level - i];
}
- /* fill rest of values with INT_MAX which index will never have as value */
+ /* Fill rest of values with #INT_MAX which index will never have as value. */
for (; i < MAX_DUPLI_RECUR; i++) {
dob->persistent_id[i] = INT_MAX;
}
- /* metaballs never draw in duplis, they are instead merged into one by the basis
- * mball outside of the group. this does mean that if that mball is not in the
+ /* Meta-balls never draw in duplis, they are instead merged into one by the basis
+ * meta-ball outside of the group. this does mean that if that meta-ball is not in the
* scene, they will not show up at all, limitation that should be solved once. */
if (ob->type == OB_MBALL) {
dob->no_draw = true;
}
- /* random number */
- /* the logic here is designed to match Cycles */
+ /* Random number.
+ * The logic here is designed to match Cycles. */
dob->random_id = BLI_hash_string(dob->ob->id.name + 2);
if (dob->persistent_id[0] != INT_MAX) {
@@ -213,16 +213,16 @@ static DupliObject *make_dupli(const DupliContext *ctx,
}
/**
- * Recursive dupli objects.
+ * Recursive dupli-objects.
*
- * \param space_mat: is the local dupli space (excluding dupli #Object.obmat).
+ * \param space_mat: is the local dupli-space (excluding dupli #Object.obmat).
*/
static void make_recursive_duplis(const DupliContext *ctx,
Object *ob,
const float space_mat[4][4],
int index)
{
- /* simple preventing of too deep nested collections with MAX_DUPLI_RECUR */
+ /* Simple preventing of too deep nested collections with #MAX_DUPLI_RECUR. */
if (ctx->level < MAX_DUPLI_RECUR) {
DupliContext rctx;
copy_dupli_context(&rctx, ctx, ob, space_mat, index);
@@ -268,9 +268,9 @@ static void make_child_duplis(const DupliContext *ctx,
DupliContext pctx;
copy_dupli_context(&pctx, ctx, ctx->object, NULL, _base_id);
- /* metaballs have a different dupli handling */
+ /* Meta-balls have a different dupli handling. */
if (ob->type != OB_MBALL) {
- ob->flag |= OB_DONE; /* doesn't render */
+ ob->flag |= OB_DONE; /* Doesn't render. */
}
make_child_duplis_cb(&pctx, userdata, ob);
}
@@ -286,9 +286,9 @@ static void make_child_duplis(const DupliContext *ctx,
DupliContext pctx;
copy_dupli_context(&pctx, ctx, ctx->object, NULL, baseid);
- /* metaballs have a different dupli handling */
+ /* Meta-balls have a different dupli-handling. */
if (ob->type != OB_MBALL) {
- ob->flag |= OB_DONE; /* doesn't render */
+ ob->flag |= OB_DONE; /* Doesn't render. */
}
make_child_duplis_cb(&pctx, userdata, ob);
@@ -314,23 +314,23 @@ static void make_duplis_collection(const DupliContext *ctx)
}
collection = ob->instance_collection;
- /* combine collection offset and obmat */
+ /* Combine collection offset and `obmat`. */
unit_m4(collection_mat);
sub_v3_v3(collection_mat[3], collection->instance_offset);
mul_m4_m4m4(collection_mat, ob->obmat, collection_mat);
- /* don't access 'ob->obmat' from now on. */
+ /* Don't access 'ob->obmat' from now on. */
eEvaluationMode mode = DEG_get_mode(ctx->depsgraph);
FOREACH_COLLECTION_VISIBLE_OBJECT_RECURSIVE_BEGIN (collection, cob, mode) {
if (cob != ob) {
float mat[4][4];
- /* collection dupli offset, should apply after everything else */
+ /* Collection dupli-offset, should apply after everything else. */
mul_m4_m4m4(mat, collection_mat, cob->obmat);
make_dupli(ctx, cob, mat, _base_id);
- /* recursion */
+ /* Recursion. */
make_recursive_duplis(ctx, cob, collection_mat, _base_id);
}
}
@@ -356,7 +356,8 @@ typedef struct VertexDupliData {
bool use_rotation;
const DupliContext *ctx;
- Object *inst_ob; /* object to instantiate (argument for vertex map callback) */
+ /* Object to instantiate (argument for vertex map callback). */
+ Object *inst_ob;
float child_imat[4][4];
} VertexDupliData;
@@ -371,7 +372,7 @@ static void get_duplivert_transform(const float co[3],
const float size[3] = {1.0f, 1.0f, 1.0f};
if (use_rotation) {
- /* construct rotation matrix from normals */
+ /* Construct rotation matrix from normals. */
float nor_f[3];
nor_f[0] = (float)-no[0];
nor_f[1] = (float)-no[1];
@@ -394,16 +395,15 @@ static void vertex_dupli(const VertexDupliData *vdd,
DupliObject *dob;
float obmat[4][4], space_mat[4][4];
- /* obmat is transform to vertex */
+ /* `obmat` is transform to vertex. */
get_duplivert_transform(co, no, vdd->use_rotation, inst_ob->trackflag, inst_ob->upflag, obmat);
- /* make offset relative to inst_ob using relative child transform */
+ /* Make offset relative to inst_ob using relative child transform. */
mul_mat3_m4_v3((float(*)[4])vdd->child_imat, obmat[3]);
- /* apply obmat _after_ the local vertex transform */
+ /* Apply `obmat` _after_ the local vertex transform. */
mul_m4_m4m4(obmat, inst_ob->obmat, obmat);
- /* space matrix is constructed by removing obmat transform,
- * this yields the worldspace transform for recursive duplis
- */
+ /* Space matrix is constructed by removing `obmat` transform,
+ * this yields the world-space transform for recursive duplis. */
mul_m4_m4m4(space_mat, obmat, inst_ob->imat);
dob = make_dupli(vdd->ctx, vdd->inst_ob, obmat, index);
@@ -412,7 +412,7 @@ static void vertex_dupli(const VertexDupliData *vdd,
copy_v3_v3(dob->orco, vdd->orco[index]);
}
- /* recursion */
+ /* Recursion. */
make_recursive_duplis(vdd->ctx, vdd->inst_ob, space_mat, index);
}
@@ -423,7 +423,7 @@ static void make_child_duplis_verts(const DupliContext *ctx, void *userdata, Obj
vdd->inst_ob = child;
invert_m4_m4(child->imat, child->obmat);
- /* relative transform from parent to child space */
+ /* Relative transform from parent to child space. */
mul_m4_m4m4(vdd->child_imat, child->imat, ctx->object->obmat);
const MVert *mvert = me_eval->mvert;
@@ -440,7 +440,7 @@ static void make_duplis_verts(const DupliContext *ctx)
vdd.ctx = ctx;
vdd.use_rotation = parent->transflag & OB_DUPLIROT;
- /* gather mesh info */
+ /* Gather mesh info. */
{
vdd.edit_mesh = BKE_editmesh_from_object(parent);
@@ -495,7 +495,7 @@ static Object *find_family_object(
ch_utf8_len = BLI_str_utf8_from_unicode(ch, ch_utf8);
ch_utf8[ch_utf8_len] = '\0';
- ch_utf8_len += 1; /* compare with null terminator */
+ ch_utf8_len += 1; /* Compare with null terminator. */
for (ob = bmain->objects.first; ob; ob = ob->id.next) {
if (STREQLEN(ob->id.name + 2 + family_len, ch_utf8, ch_utf8_len)) {
@@ -505,7 +505,7 @@ static Object *find_family_object(
}
}
- /* inserted value can be NULL, just to save searches in future */
+ /* Inserted value can be NULL, just to save searches in future. */
BLI_ghash_insert(family_gh, ch_key, ob);
}
@@ -525,14 +525,14 @@ static void make_duplis_font(const DupliContext *ctx)
const char32_t *text = NULL;
bool text_free = false;
- /* font dupliverts not supported inside collections */
+ /* Font dupli-verts not supported inside collections. */
if (ctx->collection) {
return;
}
copy_m4_m4(pmat, par->obmat);
- /* in par the family name is stored, use this to find the other objects */
+ /* In `par` the family name is stored, use this to find the other objects. */
BKE_vfont_to_curve_ex(
par, par->data, FO_DUPLI, NULL, &text, &text_len, &text_free, &chartransdata);
@@ -548,7 +548,7 @@ static void make_duplis_font(const DupliContext *ctx)
ct = chartransdata;
- /* cache result */
+ /* Cache result. */
family_len = strlen(cu->family);
family_gh = BLI_ghash_int_new_ex(__func__, 256);
@@ -558,9 +558,9 @@ static void make_duplis_font(const DupliContext *ctx)
/* Advance matching BLI_str_utf8_as_utf32. */
for (a = 0; a < text_len; a++, ct++) {
- /* XXX That G.main is *really* ugly, but not sure what to do here...
- * Definitively don't think it would be safe to put back Main *bmain pointer
- * in DupliContext as done in 2.7x? */
+ /* XXX That G.main is *really* ugly, but not sure wha
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list