diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-06-03 17:21:57 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-06-03 17:24:38 +0300 |
commit | 1f650c402d3b43eee7cb51c7d4f373ba82ac2116 (patch) | |
tree | ba2432fe9424ae545d3758d37ec8ebb0419a2ba5 /source/blender/makesrna/intern/rna_constraint.c | |
parent | e3f2034e7b925bc7e31e65051842cf26d70a20bc (diff) |
Cleanup: style, use braces in RNA
Diffstat (limited to 'source/blender/makesrna/intern/rna_constraint.c')
-rw-r--r-- | source/blender/makesrna/intern/rna_constraint.c | 34 |
1 files changed, 23 insertions, 11 deletions
diff --git a/source/blender/makesrna/intern/rna_constraint.c b/source/blender/makesrna/intern/rna_constraint.c index ac319a545ac..d0dcbe1761c 100644 --- a/source/blender/makesrna/intern/rna_constraint.c +++ b/source/blender/makesrna/intern/rna_constraint.c @@ -381,8 +381,9 @@ static void rna_Constraint_name_set(PointerRNA *ptr, const char *value) ListBase *list = get_constraint_lb(ob, con, NULL); /* if we have the list, check for unique name, otherwise give up */ - if (list) + if (list) { BKE_constraint_unique_name(con, list); + } } /* fix all the animation data which may link to this */ @@ -394,11 +395,12 @@ static char *rna_Constraint_do_compute_path(Object *ob, bConstraint *con) bPoseChannel *pchan; ListBase *lb = get_constraint_lb(ob, con, &pchan); - if (lb == NULL) + if (lb == NULL) { printf("%s: internal error, constraint '%s' not found in object '%s'\n", __func__, con->name, ob->id.name); + } if (pchan) { char name_esc_pchan[sizeof(pchan->name) * 2]; @@ -491,8 +493,9 @@ static void rna_Constraint_influence_update(Main *bmain, Scene *scene, PointerRN { Object *ob = ptr->id.data; - if (ob->pose) + if (ob->pose) { ob->pose->flag |= (POSE_LOCKED | POSE_DO_UNLOCK); + } rna_Constraint_update(bmain, scene, ptr); } @@ -523,10 +526,13 @@ static const EnumPropertyItem *rna_Constraint_owner_space_itemf(bContext *UNUSED Object *ob = (Object *)ptr->id.data; bConstraint *con = (bConstraint *)ptr->data; - if (BLI_findindex(&ob->constraints, con) == -1) + if (BLI_findindex(&ob->constraints, con) == -1) { return owner_space_pchan_items; - else /* object */ + } + else { + /* object */ return space_object_items; + } } static const EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSED(C), @@ -542,15 +548,19 @@ static const EnumPropertyItem *rna_Constraint_target_space_itemf(bContext *UNUSE if (cti && cti->get_constraint_targets) { cti->get_constraint_targets(con, &targets); - for (ct = targets.first; ct; ct = ct->next) - if (ct->tar && ct->tar->type == OB_ARMATURE) + for (ct = targets.first; ct; ct = ct->next) { + if (ct->tar && ct->tar->type == OB_ARMATURE) { break; + } + } - if (cti->flush_constraint_targets) + if (cti->flush_constraint_targets) { cti->flush_constraint_targets(con, &targets, 1); + } - if (ct) + if (ct) { return target_space_pchan_items; + } } return space_object_items; @@ -616,10 +626,12 @@ static int rna_SplineIKConstraint_joint_bindings_get_length(PointerRNA *ptr, bConstraint *con = (bConstraint *)ptr->data; bSplineIKConstraint *ikData = (bSplineIKConstraint *)con->data; - if (ikData) + if (ikData) { length[0] = ikData->numpoints; - else + } + else { length[0] = 256; /* for raw_access, untested */ + } return length[0]; } |