Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/constraint.c
| Show First 20 Lines • Show All 6,248 Lines • ▼ Show 20 Lines | if (ob && ob->proxy) { | ||||
| } | } | ||||
| } | } | ||||
| return false; | return false; | ||||
| } | } | ||||
| /* -------- Target-Matrix Stuff ------- */ | /* -------- Target-Matrix Stuff ------- */ | ||||
| int BKE_constraint_targets_get(struct bConstraint *con, struct ListBase *r_list) | |||||
| { | |||||
| int count = 0; | |||||
sybren: Use `BLI_listbase_clear()`. | |||||
| if (con && r_list) { | |||||
Done Inline ActionsFlip the condition, return early. Same for the other ones, so that the happy flow is going straight down instead of indenting more and more. sybren: Flip the condition, return early. Same for the other ones, so that the happy flow is going… | |||||
| const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con); | |||||
| if (cti) { | |||||
| /* Constraint-specific targets. */ | |||||
| if (cti->get_constraint_targets) { | |||||
| count = cti->get_constraint_targets(con, r_list); | |||||
| } | |||||
| } | |||||
| } | |||||
| return count; | |||||
| } | |||||
Not Done Inline ActionsSimplify: /* Constraint-specific targets. */ if (cti->get_constraint_targets == NULL) { return 0; } return cti->get_constraint_targets(con, r_targets); sybren: Simplify:
```lang=c
/* Constraint-specific targets. */
if (cti->get_constraint_targets ==… | |||||
Done Inline ActionsIt's written this way so a further planned patch (as mentioned this is a part of D9732 split off to simplify review, and I will immediately rebase that one after committing) can simply insert some code without refactoring it again. angavrilov: It's written this way so a further planned patch (as mentioned this is a part of D9732 split… | |||||
| void BKE_constraint_targets_flush(struct bConstraint *con, struct ListBase *list, bool no_copy) | |||||
| { | |||||
| if (con && list) { | |||||
| const bConstraintTypeInfo *cti = BKE_constraint_typeinfo_get(con); | |||||
| if (cti) { | |||||
| /* Release the constraint-specific targets. */ | |||||
| if (cti->flush_constraint_targets) { | |||||
| cti->flush_constraint_targets(con, list, no_copy); | |||||
| } | |||||
| } | |||||
| } | |||||
| } | |||||
| void BKE_constraint_target_matrix_get(struct Depsgraph *depsgraph, | void BKE_constraint_target_matrix_get(struct Depsgraph *depsgraph, | ||||
| Scene *scene, | Scene *scene, | ||||
| bConstraint *con, | bConstraint *con, | ||||
| int index, | int index, | ||||
| short ownertype, | short ownertype, | ||||
| void *ownerdata, | void *ownerdata, | ||||
| float mat[4][4], | float mat[4][4], | ||||
| float ctime) | float ctime) | ||||
| ▲ Show 20 Lines • Show All 392 Lines • Show Last 20 Lines | |||||
Use BLI_listbase_clear().