diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-04-21 17:18:34 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-04-21 23:30:04 +0300 |
commit | 0ac990d088d553c27f5360f62e142e99f087890a (patch) | |
tree | ef3637e9f8086bc937b56777ea9b1f36f97790a4 /source/blender/editors/object | |
parent | f8b2268f4fbe92a1860c525f70fdc293304575ff (diff) |
Cleanup: comments (long lines) in editors
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r-- | source/blender/editors/object/object_add.c | 30 | ||||
-rw-r--r-- | source/blender/editors/object/object_constraint.c | 47 | ||||
-rw-r--r-- | source/blender/editors/object/object_gpencil_modifier.c | 2 | ||||
-rw-r--r-- | source/blender/editors/object/object_modifier.c | 5 | ||||
-rw-r--r-- | source/blender/editors/object/object_relations.c | 36 | ||||
-rw-r--r-- | source/blender/editors/object/object_select.c | 3 | ||||
-rw-r--r-- | source/blender/editors/object/object_shader_fx.c | 6 | ||||
-rw-r--r-- | source/blender/editors/object/object_transform.c | 10 | ||||
-rw-r--r-- | source/blender/editors/object/object_vgroup.c | 11 |
9 files changed, 95 insertions, 55 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c index c050b579aa6..7b6f920e59f 100644 --- a/source/blender/editors/object/object_add.c +++ b/source/blender/editors/object/object_add.c @@ -1421,8 +1421,9 @@ static int object_delete_exec(bContext *C, wmOperator *op) DEG_id_tag_update(&gpd->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY); } - /* This is sort of a quick hack to address T51243 - Proper thing to do here would be to nuke most of all this - * custom scene/object/base handling, and use generic lib remap/query for that. + /* This is sort of a quick hack to address T51243 - + * Proper thing to do here would be to nuke most of all this custom scene/object/base handling, + * and use generic lib remap/query for that. * But this is for later (aka 2.8, once layers & co are settled and working). */ if (use_global && ob->id.lib == NULL) { @@ -1535,8 +1536,10 @@ static void copy_object_set_idnew(bContext *C) /********************* Make Duplicates Real ************************/ /** - * \note regarding hashing dupli-objects when using OB_DUPLICOLLECTION, skip the first member of #DupliObject.persistent_id - * since its a unique index and we only want to know if the group objects are from the same dupli-group instance. + * \note regarding hashing dupli-objects when using OB_DUPLICOLLECTION, + * skip the first member of #DupliObject.persistent_id + * since its a unique index and we only want to know if the group objects are from the same + * dupli-group instance. */ static unsigned int dupliobject_group_hash(const void *ptr) { @@ -1550,8 +1553,10 @@ static unsigned int dupliobject_group_hash(const void *ptr) } /** - * \note regarding hashing dupli-objects when NOT using OB_DUPLICOLLECTION, include the first member of #DupliObject.persistent_id - * since its the index of the vertex/face the object is instantiated on and we want to identify objects on the same vertex/face. + * \note regarding hashing dupli-objects when NOT using OB_DUPLICOLLECTION, + * include the first member of #DupliObject.persistent_id + * since its the index of the vertex/face the object is instantiated on and we want to identify + * objects on the same vertex/face. */ static unsigned int dupliobject_hash(const void *ptr) { @@ -1827,7 +1832,8 @@ static void convert_ensure_curve_cache(Depsgraph *depsgraph, Scene *scene, Objec if (ob->runtime.curve_cache == NULL) { /* Force creation. This is normally not needed but on operator * redo we might end up with an object which isn't evaluated yet. - * Also happens in case we are working on a copy of the object (all its caches have been nuked then). + * Also happens in case we are working on a copy of the object + * (all its caches have been nuked then). */ if (ELEM(ob->type, OB_SURF, OB_CURVE, OB_FONT)) { /* We need 'for render' ON here, to enable computing bevel dipslist if needed. @@ -1932,8 +1938,9 @@ static int convert_exec(bContext *C, wmOperator *op) Base *base = link->ptr.data; Object *ob = base->object; - /* The way object type conversion works currently (enforcing conversion of *all* objects using converted - * object-data, even some un-selected/hidden/another scene ones, sounds totally bad to me. + /* The way object type conversion works currently (enforcing conversion of *all* objects + * using converted object-data, even some un-selected/hidden/another scene ones, + * sounds totally bad to me. * However, changing this is more design than bug-fix, not to mention convoluted code below, * so that will be for later. * But at the very least, do not do that with linked IDs! */ @@ -2269,9 +2276,10 @@ void OBJECT_OT_convert(wmOperatorType *ot) /* * dupflag: a flag made from constants declared in DNA_userdef_types.h - * The flag tells adduplicate() whether to copy data linked to the object, or to reference the existing data. + * The flag tells adduplicate() whether to copy data linked to the object, + * or to reference the existing data. * U.dupflag for default operations or you can construct a flag as python does - * if the dupflag is 0 then no data will be copied (linked duplicate) */ + * if the dupflag is 0 then no data will be copied (linked duplicate). */ /* used below, assumes id.new is correct */ /* leaves selection of base/object unaltered */ diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c index 39eb4b9333c..7a1cf44c0aa 100644 --- a/source/blender/editors/object/object_constraint.c +++ b/source/blender/editors/object/object_constraint.c @@ -586,7 +586,7 @@ static void object_test_constraint(Main *bmain, Object *owner, bConstraint *con) } } -/************************ generic functions for operators using constraint names and data context *********************/ +/*** generic functions for operators using constraint names and data context *********************/ #define EDIT_CONSTRAINT_OWNER_OBJECT 0 #define EDIT_CONSTRAINT_OWNER_BONE 1 @@ -690,20 +690,30 @@ static bConstraint *edit_constraint_property_get(wmOperator *op, Object *ob, int if (pchan) list = &pchan->constraints; else { - //if (G.debug & G_DEBUG) - //printf("edit_constraint_property_get: No active bone for object '%s'\n", (ob) ? ob->id.name + 2 : "<None>"); +#if 0 + if (G.debug & G_DEBUG) { + printf("edit_constraint_property_get: No active bone for object '%s'\n", + (ob) ? ob->id.name + 2 : "<None>"); + } +#endif return NULL; } } else { - //if (G.debug & G_DEBUG) - //printf("edit_constraint_property_get: defaulting to getting list in the standard way\n"); +#if 0 + if (G.debug & G_DEBUG) { + printf("edit_constraint_property_get: defaulting to getting list in the standard way\n"); + } +#endif list = get_active_constraints(ob); } con = BKE_constraints_find_name(list, constraint_name); - //if (G.debug & G_DEBUG) - //printf("constraint found = %p, %s\n", (void *)con, (con) ? con->name : "<Not found>"); +#if 0 + if (G.debug & G_DEBUG) { + printf("constraint found = %p, %s\n", (void *)con, (con) ? con->name : "<Not found>"); + } +#endif if (con && (type != 0) && (con->type != type)) con = NULL; @@ -1275,10 +1285,11 @@ static void object_pose_tag_update(Main *bmain, Object *ob) { BKE_pose_tag_recalc(bmain, ob->pose); /* Checks & sort pose channels. */ if (ob->proxy && ob->adt) { - /* We need to make use of ugly POSE_ANIMATION_WORKAROUND here too, else anim data are not reloaded - * after calling `BKE_pose_rebuild()`, which causes T43872. - * Note that this is a bit wide here, since we cannot be sure whether there are some locked proxy bones - * or not... + /* We need to make use of ugly #POSE_ANIMATION_WORKAROUND here too, + * else anim data are not reloaded after calling `BKE_pose_rebuild()`, + * which causes T43872. + * Note that this is a bit wide here, since we cannot be sure whether there are some locked + * proxy bones or not. * XXX Temp hack until new depsgraph hopefully solves this. */ DEG_id_tag_update(&ob->id, ID_RECALC_ANIMATION); } @@ -1816,7 +1827,8 @@ static int constraint_add_exec( return OPERATOR_CANCELLED; } - /* create a new constraint of the type required, and add it to the active/given constraints list */ + /* Create a new constraint of the type required, + * and add it to the active/given constraints list. */ if (pchan) con = BKE_constraint_add_for_pose(ob, pchan, NULL, type); else @@ -1831,8 +1843,8 @@ static int constraint_add_exec( /* get the target objects, adding them as need be */ if (get_new_constraint_target(C, type, &tar_ob, &tar_pchan, 1)) { - /* method of setting target depends on the type of target we've got - * - by default, just set the first target (distinction here is only for multiple-targeted constraints) + /* Method of setting target depends on the type of target we've got - by default, + * just set the first target (distinction here is only for multiple-targeted constraints). */ if (tar_pchan) set_constraint_nth_target(con, tar_ob, tar_pchan->name, 0); @@ -1881,8 +1893,8 @@ static int constraint_add_exec( if ((ob->type == OB_ARMATURE) && (pchan)) { BKE_pose_tag_recalc(bmain, ob->pose); /* sort pose channels */ if (BKE_constraints_proxylocked_owner(ob, pchan) && ob->adt) { - /* We need to make use of ugly POSE_ANIMATION_WORKAROUND here too, else anim data are not reloaded - * after calling `BKE_pose_rebuild()`, which causes T43872. + /* We need to make use of ugly POSE_ANIMATION_WORKAROUND here too, + * else anim data are not reloaded after calling `BKE_pose_rebuild()`, which causes T43872. * XXX Temp hack until new depsgraph hopefully solves this. */ DEG_id_tag_update(&ob->id, ID_RECALC_ANIMATION); } @@ -2091,7 +2103,8 @@ static int pose_ik_add_exec(bContext *C, wmOperator *op) Object *ob = CTX_data_active_object(C); const bool with_targets = RNA_boolean_get(op->ptr, "with_targets"); - /* add the constraint - all necessary checks should have been done by the invoke() callback already... */ + /* add the constraint - all necessary checks should have + * been done by the invoke() callback already... */ return constraint_add_exec( C, op, ob, get_active_constraints(ob), CONSTRAINT_TYPE_KINEMATIC, with_targets); } diff --git a/source/blender/editors/object/object_gpencil_modifier.c b/source/blender/editors/object/object_gpencil_modifier.c index a726e2c9f00..70e942690d5 100644 --- a/source/blender/editors/object/object_gpencil_modifier.c +++ b/source/blender/editors/object/object_gpencil_modifier.c @@ -379,7 +379,7 @@ void OBJECT_OT_gpencil_modifier_add(wmOperatorType *ot) ot->prop = prop; } -/************************ generic functions for operators using mod names and data context *********************/ +/********** generic functions for operators using mod names and data context *********************/ static int gpencil_edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag) { diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c index 7aae0a41c85..ef55f6a8f4b 100644 --- a/source/blender/editors/object/object_modifier.c +++ b/source/blender/editors/object/object_modifier.c @@ -889,7 +889,7 @@ void OBJECT_OT_modifier_add(wmOperatorType *ot) ot->prop = prop; } -/************************ generic functions for operators using mod names and data context *********************/ +/********** generic functions for operators using mod names and data context *********************/ bool edit_modifier_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag) { @@ -2022,7 +2022,8 @@ static int meshdeform_bind_exec(bContext *C, wmOperator *op) mmd->totinfluence = 0; } else { - /* Force modifier to run, it will call binding routine (this has to happen outside of depsgraph evaluation). */ + /* Force modifier to run, it will call binding routine + * (this has to happen outside of depsgraph evaluation). */ MeshDeformModifierData *mmd_eval = (MeshDeformModifierData *)modifier_get_evaluated( depsgraph, ob, &mmd->modifier); mmd_eval->bindfunc = ED_mesh_deform_bind_callback; diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c index 63cacc21d1c..d47b1fc6533 100644 --- a/source/blender/editors/object/object_relations.c +++ b/source/blender/editors/object/object_relations.c @@ -739,15 +739,18 @@ bool ED_object_parent_set(ReportList *reports, /* don't do anything here, since this is not technically "parenting" */ } else if (ELEM(partype, PAR_CURVE, PAR_LATTICE) || (pararm)) { - /* partype is now set to PAROBJECT so that invisible 'virtual' modifiers don't need to be created - * NOTE: the old (2.4x) method was to set ob->partype = PARSKEL, creating the virtual modifiers + /* partype is now set to PAROBJECT so that invisible 'virtual' + * modifiers don't need to be created. + * NOTE: the old (2.4x) method was to set ob->partype = PARSKEL, + * creating the virtual modifiers. */ ob->partype = PAROBJECT; /* note, dna define, not operator property */ /* ob->partype = PARSKEL; */ /* note, dna define, not operator property */ - /* BUT, to keep the deforms, we need a modifier, and then we need to set the object that it uses - * - We need to ensure that the modifier we're adding doesn't already exist, so we check this by - * assuming that the parent is selected too... + /* BUT, to keep the deforms, we need a modifier, + * and then we need to set the object that it uses + * - We need to ensure that the modifier we're adding doesn't already exist, + * so we check this by assuming that the parent is selected too. */ /* XXX currently this should only happen for meshes, curves, surfaces, * and lattices - this stuff isn't available for metas yet */ @@ -1682,9 +1685,10 @@ static Collection *single_object_users_collection(Main *bmain, } } - /* Since master collection has already be duplicated as part of scene copy, we do not duplictae it here. - * However, this means its children need to be re-added manually here, otherwise their parent lists are empty - * (which will lead to crashes, see T63101). */ + /* Since master collection has already be duplicated as part of scene copy, + * we do not duplictae it here. + * However, this means its children need to be re-added manually here, + * otherwise their parent lists are empty (which will lead to crashes, see T63101). */ CollectionChild *child_next, *child = collection->children.first; CollectionChild *orig_child_last = collection->children.last; for (; child != NULL; child = child_next) { @@ -1713,9 +1717,10 @@ static void single_object_users( single_object_users_collection(bmain, scene, master_collection, flag, copy_collections, true); /* duplicate collections that consist entirely of duplicated objects */ - /* XXX I guess that was designed for calls from 'make single user' operator... But since copy_collection is - * always false then, was not doing anything. And that kind of behavior should be added at operator level, - * not in a utility function also used by rather different code... */ + /* XXX I guess that was designed for calls from 'make single user' operator. + * But since copy_collection is always false then, was not doing anything. + * And that kind of behavior should be added at operator level, + * not in a utility function also used by rather different code. */ #if 0 if (copy_collections) { Collection *collection, *collectionn; @@ -1755,7 +1760,8 @@ static void single_object_users( ID_NEW_REMAP(v3d->camera); } - /* Making single user may affect other scenes if they share with current one some collections in their ViewLayer. */ + /* Making single user may affect other scenes if they share + * with current one some collections in their ViewLayer. */ BKE_main_collection_sync(bmain); } @@ -2148,7 +2154,8 @@ static void make_local_material_tag(Material *ma) ma->id.tag &= ~LIB_TAG_PRE_EXISTING; make_local_animdata_tag(BKE_animdata_from_id(&ma->id)); - /* About nodetrees: root one is made local together with material, others we keep linked for now... */ + /* About nodetrees: root one is made local together with material, + * others we keep linked for now... */ } } @@ -2367,7 +2374,8 @@ static int make_override_static_exec(bContext *C, wmOperator *op) } FOREACH_COLLECTION_OBJECT_RECURSIVE_END; - /* Then, we remove (untag) bone shape objects, you shall never want to override those (hopefully)... */ + /* Then, we remove (untag) bone shape objects, you shall never want to override those + * (hopefully)... */ FOREACH_COLLECTION_OBJECT_RECURSIVE_BEGIN (collection, ob) { if (ob->type == OB_ARMATURE && ob->pose != NULL) { for (bPoseChannel *pchan = ob->pose->chanbase.first; pchan != NULL; pchan = pchan->next) { diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c index 06bd4d76973..94d4e77c279 100644 --- a/source/blender/editors/object/object_select.c +++ b/source/blender/editors/object/object_select.c @@ -470,7 +470,8 @@ enum { }; static const EnumPropertyItem prop_select_linked_types[] = { - //{OBJECT_SELECT_LINKED_IPO, "IPO", 0, "Object IPO", ""}, // XXX deprecated animation system stuff... + /* XXX deprecated animation system stuff. */ + // {OBJECT_SELECT_LINKED_IPO, "IPO", 0, "Object IPO", ""}, {OBJECT_SELECT_LINKED_OBDATA, "OBDATA", 0, "Object Data", ""}, {OBJECT_SELECT_LINKED_MATERIAL, "MATERIAL", 0, "Material", ""}, {OBJECT_SELECT_LINKED_DUPGROUP, "DUPGROUP", 0, "Instanced Collection", ""}, diff --git a/source/blender/editors/object/object_shader_fx.c b/source/blender/editors/object/object_shader_fx.c index 64535d8f281..98c548d76e0 100644 --- a/source/blender/editors/object/object_shader_fx.c +++ b/source/blender/editors/object/object_shader_fx.c @@ -281,7 +281,9 @@ void OBJECT_OT_shaderfx_add(wmOperatorType *ot) BLT_I18NCONTEXT_ID_ID); /* Abused, for "Light"... */ } -/************************ generic functions for operators using names and data context *********************/ +/* -------------------------------------------------------------------- */ +/** \name Generic Functions for Operators Using Names and Data Context + * \{ */ static bool edit_shaderfx_poll_generic(bContext *C, StructRNA *rna_type, int obtype_flag) { @@ -353,6 +355,8 @@ static ShaderFxData *edit_shaderfx_property_get(wmOperator *op, Object *ob, int return fx; } +/** \} */ + /************************ remove shaderfx operator *********************/ static int shaderfx_remove_exec(bContext *C, wmOperator *op) diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c index f2f6afcac81..b7efb22a628 100644 --- a/source/blender/editors/object/object_transform.c +++ b/source/blender/editors/object/object_transform.c @@ -126,7 +126,8 @@ static void object_clear_rot(Object *ob, const bool clear_delta) ob->drotAxis[2] = 0.0f; } - /* check validity of axis - axis should never be 0,0,0 (if so, then we make it rotate about y) */ + /* Check validity of axis - axis should never be 0,0,0 + * (if so, then we make it rotate about y). */ if (IS_EQF(ob->rotAxis[0], ob->rotAxis[1]) && IS_EQF(ob->rotAxis[1], ob->rotAxis[2])) ob->rotAxis[1] = 1.0f; if (IS_EQF(ob->drotAxis[0], ob->drotAxis[1]) && IS_EQF(ob->drotAxis[1], ob->drotAxis[2]) && @@ -1385,11 +1386,12 @@ void OBJECT_OT_origin_set(wmOperatorType *ot) * - campbell. * \{ */ -/* When using multiple objects, apply their relative rotational offset to the active object. */ +/** When using multiple objects, apply their relative rotational offset to the active object. */ #define USE_RELATIVE_ROTATION -/* Disable overlays, ignoring user setting (light wire gets in the way). */ +/** Disable overlays, ignoring user setting (light wire gets in the way). */ #define USE_RENDER_OVERRIDE -/* Calculate a depth if the cursor isn't already over a depth (not essential but feels buggy without). */ +/** Calculate a depth if the cursor isn't already over a depth + * (not essential but feels buggy without). */ #define USE_FAKE_DEPTH_INIT struct XFormAxisItem { diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c index 7ba57801ebe..d03f1974fd6 100644 --- a/source/blender/editors/object/object_vgroup.c +++ b/source/blender/editors/object/object_vgroup.c @@ -245,7 +245,8 @@ bool ED_vgroup_parray_alloc(ID *id, * For use with tools that use ED_vgroup_parray_alloc with \a use_vert_sel == true. * This finds the unselected mirror deform verts and copies the weights to them from the selected. * - * \note \a dvert_array has mirrored weights filled in, in case cleanup operations are needed on both. + * \note \a dvert_array has mirrored weights filled in, + * in case cleanup operations are needed on both. */ void ED_vgroup_parray_mirror_sync(Object *ob, MDeformVert **dvert_array, @@ -376,7 +377,8 @@ bool ED_vgroup_array_copy(Object *ob, Object *ob_from) if (ob == ob_from) return true; - /* in case we copy vgroup between two objects using same data, we only have to care about object side of things. */ + /* In case we copy vgroup between two objects using same data, + * we only have to care about object side of things. */ if (ob->data != ob_from->data) { ED_vgroup_parray_alloc(ob_from->data, &dvert_array_from, &dvert_tot_from, false); ED_vgroup_parray_alloc(ob->data, &dvert_array, &dvert_tot, false); @@ -1227,8 +1229,9 @@ static int *getSurroundingVerts(Mesh *me, int vert, int *count) return verts; } -/* get a single point in space by averaging a point cloud (vectors of size 3) - * coord is the place the average is stored, points is the point cloud, count is the number of points in the cloud +/* Get a single point in space by averaging a point cloud (vectors of size 3) + * coord is the place the average is stored, + * points is the point cloud, count is the number of points in the cloud. */ static void getSingleCoordinate(MVert *points, int count, float coord[3]) { |