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:
Diffstat (limited to 'source/blender/editors/object')
-rw-r--r--source/blender/editors/object/object_add.c8
-rw-r--r--source/blender/editors/object/object_bake.c24
-rw-r--r--source/blender/editors/object/object_bake_api.c3
-rw-r--r--source/blender/editors/object/object_collection.c3
-rw-r--r--source/blender/editors/object/object_constraint.c9
-rw-r--r--source/blender/editors/object/object_data_transfer.c3
-rw-r--r--source/blender/editors/object/object_edit.c8
-rw-r--r--source/blender/editors/object/object_modifier.c9
-rw-r--r--source/blender/editors/object/object_relations.c32
-rw-r--r--source/blender/editors/object/object_select.c3
-rw-r--r--source/blender/editors/object/object_transform.c12
-rw-r--r--source/blender/editors/object/object_vgroup.c16
12 files changed, 86 insertions, 44 deletions
diff --git a/source/blender/editors/object/object_add.c b/source/blender/editors/object/object_add.c
index 7a2b1d8ada2..918b3500a08 100644
--- a/source/blender/editors/object/object_add.c
+++ b/source/blender/editors/object/object_add.c
@@ -1600,8 +1600,9 @@ static void make_object_duplilist_real(bContext *C, Scene *scene, Base *base,
BLI_ghash_insert(dupli_gh, dob, ob_dst);
if (parent_gh) {
void **val;
- /* Due to nature of hash/comparison of this ghash, a lot of duplis may be considered as 'the same',
- * this avoids trying to insert same key several time and raise asserts in debug builds... */
+ /* Due to nature of hash/comparison of this ghash, a lot of duplis may be considered as
+ * 'the same', this avoids trying to insert same key several time and
+ * raise asserts in debug builds... */
if (!BLI_ghash_ensure_p(parent_gh, dob, &val)) {
*val = ob_dst;
}
@@ -1981,7 +1982,8 @@ static int convert_exec(bContext *C, wmOperator *op)
* datablock, but for until we've got granular update
* lets take care by selves.
*/
- /* XXX This may fail/crash, since BKE_vfont_to_curve() accesses evaluated data in some cases (bastien). */
+ /* XXX This may fail/crash, since BKE_vfont_to_curve()
+ * accesses evaluated data in some cases (bastien). */
BKE_vfont_to_curve(newob, FO_EDIT);
newob->type = OB_CURVE;
diff --git a/source/blender/editors/object/object_bake.c b/source/blender/editors/object/object_bake.c
index 5a650d9dc05..b760514ef32 100644
--- a/source/blender/editors/object/object_bake.c
+++ b/source/blender/editors/object/object_bake.c
@@ -120,14 +120,22 @@ typedef struct MultiresBakerJobData {
typedef struct {
Scene *scene;
ListBase data;
- bool bake_clear; /* Clear the images before baking */
- int bake_filter; /* Bake-filter, aka margin */
- short mode; /* mode of baking (displacement, normals, AO) */
- bool use_lores_mesh; /* Use low-resolution mesh when baking displacement maps */
- int number_of_rays; /* Number of rays to be cast when doing AO baking */
- float bias; /* Bias between object and start ray point when doing AO baking */
- int threads; /* Number of threads to be used for baking */
- float user_scale; /* User scale used to scale displacement when baking derivative map. */
+ /** Clear the images before baking */
+ bool bake_clear;
+ /** Bake-filter, aka margin */
+ int bake_filter;
+ /** mode of baking (displacement, normals, AO) */
+ short mode;
+ /** Use low-resolution mesh when baking displacement maps */
+ bool use_lores_mesh;
+ /** Number of rays to be cast when doing AO baking */
+ int number_of_rays;
+ /** Bias between object and start ray point when doing AO baking */
+ float bias;
+ /** Number of threads to be used for baking */
+ int threads;
+ /** User scale used to scale displacement when baking derivative map. */
+ float user_scale;
} MultiresBakeJob;
static bool multiresbake_check(bContext *C, wmOperator *op)
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index 9239e1d1a6f..fca3cc3e9f6 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -655,7 +655,8 @@ static int bake(
const char *custom_cage, const char *filepath, const int width, const int height,
const char *identifier, ScrArea *sa, const char *uv_layer)
{
- /* We build a depsgraph for the baking, so we don't need to change the original data to adjust visibility and modifiers. */
+ /* We build a depsgraph for the baking,
+ * so we don't need to change the original data to adjust visibility and modifiers. */
Depsgraph *depsgraph = DEG_graph_new(scene, view_layer, DAG_EVAL_RENDER);
DEG_graph_build_from_view_layer(depsgraph, bmain, scene, view_layer);
diff --git a/source/blender/editors/object/object_collection.c b/source/blender/editors/object/object_collection.c
index 1a9b69b38ad..c9cdb77ca65 100644
--- a/source/blender/editors/object/object_collection.c
+++ b/source/blender/editors/object/object_collection.c
@@ -562,7 +562,8 @@ void OBJECT_OT_collection_unlink(wmOperatorType *ot)
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO;
}
-static int select_grouped_exec(bContext *C, wmOperator *UNUSED(op)) /* Select objects in the same collection as the active */
+/* Select objects in the same collection as the active */
+static int select_grouped_exec(bContext *C, wmOperator *UNUSED(op))
{
Scene *scene = CTX_data_scene(C);
Collection *collection = CTX_data_pointer_get_type(C, "collection", &RNA_Collection).data;
diff --git a/source/blender/editors/object/object_constraint.c b/source/blender/editors/object/object_constraint.c
index 93ff94edc75..5416079ddf7 100644
--- a/source/blender/editors/object/object_constraint.c
+++ b/source/blender/editors/object/object_constraint.c
@@ -105,7 +105,8 @@ ListBase *get_active_constraints(Object *ob)
return NULL;
}
-/* Find the list that a given constraint belongs to, and/or also get the posechannel this is from (if applicable) */
+/* Find the list that a given constraint belongs to,
+ * and/or also get the posechannel this is from (if applicable) */
ListBase *get_constraint_lb(Object *ob, bConstraint *con, bPoseChannel **r_pchan)
{
if (r_pchan)
@@ -1306,7 +1307,8 @@ static int constraint_delete_exec(bContext *C, wmOperator *UNUSED(op))
if (BKE_constraint_remove_ex(lb, ob, con, true)) {
/* there's no active constraint now, so make sure this is the case */
BKE_constraints_active_set(&ob->constraints, NULL);
- ED_object_constraint_update(bmain, ob); /* needed to set the flags on posebones correctly */
+ /* needed to set the flags on posebones correctly */
+ ED_object_constraint_update(bmain, ob);
/* relatiols */
DEG_relations_tag_update(CTX_data_main(C));
@@ -1637,7 +1639,8 @@ static bool get_new_constraint_target(bContext *C, int con_type, Object **tar_ob
return false;
/* restricted target-type constraints -------------- */
- /* NOTE: for these, we cannot try to add a target object if no valid ones are found, since that doesn't work */
+ /* NOTE: for these, we cannot try to add a target object if no valid ones are found,
+ * since that doesn't work */
/* curve-based constraints - set the only_curve and only_ob flags */
case CONSTRAINT_TYPE_CLAMPTO:
case CONSTRAINT_TYPE_FOLLOWPATH:
diff --git a/source/blender/editors/object/object_data_transfer.c b/source/blender/editors/object/object_data_transfer.c
index ad47e07b2e9..26ba9c31c22 100644
--- a/source/blender/editors/object/object_data_transfer.c
+++ b/source/blender/editors/object/object_data_transfer.c
@@ -71,7 +71,8 @@ static const EnumPropertyItem DT_layer_items[] = {
#if 0 /* XXX For now, would like to finish/merge work from 2014 gsoc first. */
{DT_TYPE_SHAPEKEY, "SHAPEKEYS", 0, "Shapekey(s)", "Transfer active or all shape keys"},
#endif
-#if 0 /* XXX When SkinModifier is enabled, it seems to erase its own CD_MVERT_SKIN layer from final DM :( */
+#if 0 /* XXX When SkinModifier is enabled,
+ * it seems to erase its own CD_MVERT_SKIN layer from final DM :( */
{DT_TYPE_SKIN, "SKIN", 0, "Skin Weight", "Transfer skin weights"},
#endif
{DT_TYPE_BWEIGHT_VERT, "BEVEL_WEIGHT_VERT", 0, "Bevel Weight", "Transfer bevel weights"},
diff --git a/source/blender/editors/object/object_edit.c b/source/blender/editors/object/object_edit.c
index 09ea2188de7..b3d6b7acaa2 100644
--- a/source/blender/editors/object/object_edit.c
+++ b/source/blender/editors/object/object_edit.c
@@ -533,8 +533,10 @@ bool ED_object_editmode_exit_ex(Main *bmain, Scene *scene, Object *obedit, int f
/* flag object caches as outdated */
BKE_ptcache_ids_from_object(&pidlist, obedit, scene, 0);
for (pid = pidlist.first; pid; pid = pid->next) {
- if (pid->type != PTCACHE_TYPE_PARTICLES) /* particles don't need reset on geometry change */
+ /* particles don't need reset on geometry change */
+ if (pid->type != PTCACHE_TYPE_PARTICLES) {
pid->cache->flag |= PTCACHE_OUTDATED;
+ }
}
BLI_freelistN(&pidlist);
@@ -602,7 +604,9 @@ bool ED_object_editmode_enter_ex(Main *bmain, Scene *scene, Object *ob, int flag
ok = 1;
ED_armature_to_edit(ob->data);
/* to ensure all goes in restposition and without striding */
- DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION); /* XXX: should this be ID_RECALC_GEOMETRY? */
+
+ /* XXX: should this be ID_RECALC_GEOMETRY? */
+ DEG_id_tag_update(&ob->id, ID_RECALC_TRANSFORM | ID_RECALC_GEOMETRY | ID_RECALC_ANIMATION);
WM_main_add_notifier(NC_SCENE | ND_MODE | NS_EDITMODE_ARMATURE, scene);
}
diff --git a/source/blender/editors/object/object_modifier.c b/source/blender/editors/object/object_modifier.c
index 79dffa17c7a..02ee1f9c360 100644
--- a/source/blender/editors/object/object_modifier.c
+++ b/source/blender/editors/object/object_modifier.c
@@ -1916,7 +1916,8 @@ static int correctivesmooth_bind_exec(bContext *C, wmOperator *op)
/* signal to modifier to recalculate */
csmd->bind_coords_num = (unsigned int)-1;
- /* 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). */
const int mode = csmd->modifier.mode;
csmd->modifier.mode |= eModifierMode_Realtime;
object_force_modifier_update_for_bind(depsgraph, scene, ob);
@@ -2303,7 +2304,8 @@ static int laplaciandeform_bind_exec(bContext *C, wmOperator *op)
lmd->flag |= MOD_LAPLACIANDEFORM_BIND;
}
- /* 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). */
const int mode = lmd->modifier.mode;
lmd->modifier.mode |= eModifierMode_Realtime;
object_force_modifier_update_for_bind(depsgraph, scene, ob);
@@ -2365,7 +2367,8 @@ static int surfacedeform_bind_exec(bContext *C, wmOperator *op)
smd->flags |= MOD_SDEF_BIND;
}
- /* 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). */
const int mode = smd->modifier.mode;
smd->modifier.mode |= eModifierMode_Realtime;
object_force_modifier_update_for_bind(depsgraph, scene, ob);
diff --git a/source/blender/editors/object/object_relations.c b/source/blender/editors/object/object_relations.c
index 4a306a6c4e3..05d968660f2 100644
--- a/source/blender/editors/object/object_relations.c
+++ b/source/blender/editors/object/object_relations.c
@@ -505,7 +505,8 @@ void ED_object_parent_clear(Object *ob, const int type)
switch (type) {
case CLEAR_PARENT_ALL:
{
- /* for deformers, remove corresponding modifiers to prevent a large number of modifiers building up */
+ /* for deformers, remove corresponding modifiers to prevent
+ * a large number of modifiers building up */
object_remove_parent_deform_modifiers(ob, ob->parent);
/* clear parenting relationship completely */
@@ -514,14 +515,16 @@ void ED_object_parent_clear(Object *ob, const int type)
}
case CLEAR_PARENT_KEEP_TRANSFORM:
{
- /* remove parent, and apply the parented transform result as object's local transforms */
+ /* remove parent, and apply the parented transform
+ * result as object's local transforms */
ob->parent = NULL;
BKE_object_apply_mat4(ob, ob->obmat, true, false);
break;
}
case CLEAR_PARENT_INVERSE:
{
- /* object stays parented, but the parent inverse (i.e. offset from parent to retain binding state)
+ /* object stays parented, but the parent inverse
+ * (i.e. offset from parent to retain binding state)
* is cleared. In other words: nothing to do here! */
break;
}
@@ -632,7 +635,8 @@ bool ED_object_parent_set(ReportList *reports, const bContext *C, Scene *scene,
if ((cu->flag & CU_PATH) == 0) {
cu->flag |= CU_PATH | CU_FOLLOW;
- BKE_displist_make_curveTypes(depsgraph, scene, par, false, false); /* force creation of path data */
+ /* force creation of path data */
+ BKE_displist_make_curveTypes(depsgraph, scene, par, false, false);
}
else {
cu->flag |= CU_FOLLOW;
@@ -1469,7 +1473,8 @@ static int make_links_data_exec(bContext *C, wmOperator *op)
/* new approach, using functions from kernel */
for (a = 0; a < ob_src->totcol; a++) {
Material *ma = give_current_material(ob_src, a + 1);
- assign_material(bmain, ob_dst, ma, a + 1, BKE_MAT_ASSIGN_USERPREF); /* also works with ma==NULL */
+ /* also works with `ma == NULL` */
+ assign_material(bmain, ob_dst, ma, a + 1, BKE_MAT_ASSIGN_USERPREF);
}
DEG_id_tag_update(&ob_dst->id, ID_RECALC_GEOMETRY);
break;
@@ -1868,7 +1873,8 @@ static void single_mat_users(Main *bmain, Scene *scene, ViewLayer *view_layer, V
for (a = 1; a <= ob->totcol; a++) {
ma = give_current_material(ob, a);
if (ma) {
- /* do not test for LIB_TAG_NEW or use newid: this functions guaranteed delivers single_users! */
+ /* do not test for LIB_TAG_NEW or use newid:
+ * this functions guaranteed delivers single_users! */
if (ma->id.us > 1) {
man = BKE_material_copy(bmain, ma);
@@ -2214,8 +2220,9 @@ static void make_override_static_tag_object(Object *obact, Object *ob)
return;
}
- /* Note: all this is very case-by-case bad handling, ultimately we'll want a real full 'automatic', generic
- * handling of all this, will probably require adding some override-aware stuff to library_query code... */
+ /* Note: all this is very case-by-case bad handling, ultimately we'll want a real full
+ * 'automatic', generic handling of all this,
+ * will probably require adding some override-aware stuff to library_query code... */
if (obact->type == OB_ARMATURE && ob->modifiers.first != NULL) {
for (ModifierData *md = ob->modifiers.first; md != NULL; md = md->next) {
@@ -2357,10 +2364,12 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
}
FOREACH_COLLECTION_OBJECT_RECURSIVE_END;
- /* obcollection is no more duplicollection-ing, it merely parents whole collection of overriding instantiated objects. */
+ /* obcollection is no more duplicollection-ing,
+ * it merely parents whole collection of overriding instantiated objects. */
obcollection->dup_group = NULL;
- /* Also, we'd likely want to lock by default things like transformations of implicitly overridden objects? */
+ /* Also, we'd likely want to lock by default things like
+ * transformations of implicitly overridden objects? */
DEG_id_tag_update(&scene->id, 0);
@@ -2380,7 +2389,8 @@ static int make_override_static_exec(bContext *C, wmOperator *op)
success = BKE_override_static_create_from_tag(bmain);
- /* Also, we'd likely want to lock by default things like transformations of implicitly overridden objects? */
+ /* Also, we'd likely want to lock by default things like
+ * transformations of implicitly overridden objects? */
/* Cleanup. */
BKE_main_id_clear_newpoins(bmain);
diff --git a/source/blender/editors/object/object_select.c b/source/blender/editors/object/object_select.c
index 0b032a3111a..48b13698fa7 100644
--- a/source/blender/editors/object/object_select.c
+++ b/source/blender/editors/object/object_select.c
@@ -781,7 +781,8 @@ static bool select_grouped_parent(bContext *C) /* Makes parent active and de-sel
#define COLLECTION_MENU_MAX 24
-static bool select_grouped_collection(bContext *C, Object *ob) /* Select objects in the same group as the active */
+/* Select objects in the same group as the active */
+static bool select_grouped_collection(bContext *C, Object *ob)
{
bool changed = false;
Collection *collection, *ob_collections[COLLECTION_MENU_MAX];
diff --git a/source/blender/editors/object/object_transform.c b/source/blender/editors/object/object_transform.c
index 1620d1f82f9..373b7a4a0aa 100644
--- a/source/blender/editors/object/object_transform.c
+++ b/source/blender/editors/object/object_transform.c
@@ -491,7 +491,8 @@ static int apply_objects_internal(
bool has_unparented_layers = false;
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
- /* Parented layers aren't supported as we can't easily re-evaluate the scene to sample parent movement */
+ /* Parented layers aren't supported as we can't easily re-evaluate
+ * the scene to sample parent movement */
if (gpl->parent == NULL) {
has_unparented_layers = true;
break;
@@ -1122,7 +1123,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
float diff_mat[4][4];
float inverse_diff_mat[4][4];
- /* recalculate all strokes (all layers are considered without evaluating lock attributtes) */
+ /* recalculate all strokes
+ * (all layers are considered without evaluating lock attributtes) */
for (bGPDlayer *gpl = gpd->layers.first; gpl; gpl = gpl->next) {
/* calculate difference matrix */
ED_gpencil_parent_location(depsgraph, obact, gpd, gpl, diff_mat);
@@ -1203,7 +1205,8 @@ static int object_origin_set_exec(bContext *C, wmOperator *op)
BKE_object_where_is_calc(depsgraph, scene, ob_other);
if (ob_other->type == OB_ARMATURE) {
- BKE_pose_where_is(depsgraph, scene, ob_other); /* needed for bone parents */
+ /* needed for bone parents */
+ BKE_pose_where_is(depsgraph, scene, ob_other);
}
ignore_parent_tx(C, bmain, scene, ob_other);
}
@@ -1651,7 +1654,8 @@ static int object_transform_axis_target_modal(bContext *C, wmOperator *op, const
copy_v3_v3(loc, location_world);
madd_v3_v3fl(loc, target_normal, item->xform_dist);
object_apply_location(item->ob, loc);
- copy_v3_v3(item->ob->obmat[3], loc); /* so orient behaves as expected */
+ /* so orient behaves as expected */
+ copy_v3_v3(item->ob->obmat[3], loc);
}
object_orient_to_location(item->ob, item->rot_mat, item->rot_mat[2], location_world);
diff --git a/source/blender/editors/object/object_vgroup.c b/source/blender/editors/object/object_vgroup.c
index 036689509e9..31faa00db43 100644
--- a/source/blender/editors/object/object_vgroup.c
+++ b/source/blender/editors/object/object_vgroup.c
@@ -960,7 +960,9 @@ float ED_vgroup_vert_weight(Object *ob, bDeformGroup *dg, int vertnum)
}
void ED_vgroup_select_by_name(Object *ob, const char *name)
-{ /* note: ob->actdef==0 signals on painting to create a new one, if a bone in posemode is selected */
+{
+ /* note: ob->actdef==0 signals on painting to create a new one,
+ * if a bone in posemode is selected */
ob->actdef = defgroup_name_index(ob, name) + 1;
}
@@ -1946,20 +1948,22 @@ static int inv_cmp_mdef_vert_weights(const void *a1, const void *a2)
{
/* qsort sorts in ascending order. We want descending order to save a memcopy
* so this compare function is inverted from the standard greater than comparison qsort needs.
- * A normal compare function is called with two pointer arguments and should return an integer less than, equal to,
- * or greater than zero corresponding to whether its first argument is considered less than, equal to,
- * or greater than its second argument. This does the opposite. */
+ * A normal compare function is called with two pointer arguments and should return an integer
+ * less than, equal to, or greater than zero corresponding to whether its first argument is
+ * considered less than, equal to, or greater than its second argument.
+ * This does the opposite. */
const struct MDeformWeight *dw1 = a1, *dw2 = a2;
if (dw1->weight < dw2->weight) return 1;
else if (dw1->weight > dw2->weight) return -1;
- else if (&dw1 < &dw2) return 1; /* compare addresses so we have a stable sort algorithm */
+ else if (&dw1 < &dw2) return 1; /* compare address for stable sort algorithm */
else return -1;
}
/* Used for limiting the number of influencing bones per vertex when exporting
* skinned meshes. if all_deform_weights is True, limit all deform modifiers
- * to max_weights regardless of type, otherwise, only limit the number of influencing bones per vertex*/
+ * to max_weights regardless of type, otherwise,
+ * only limit the number of influencing bones per vertex. */
static int vgroup_limit_total_subset(
Object *ob,
const bool *vgroup_validmap,