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:
authorSergey Sharybin <sergey.vfx@gmail.com>2016-11-17 17:11:55 +0300
committerSergey Sharybin <sergey.vfx@gmail.com>2016-11-17 17:11:55 +0300
commit0a08d8c892d595eab9aaec46739ef697bcee5cef (patch)
treec3a3ac92aa717a035bd9dfbd1ac3f0075d372d66 /source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
parent0c322c3000a0ddd7ac58c650f30b29d55afd1a97 (diff)
Depsgraph: Use utility macro to iterate over linked list
This will be compiled into same exact code, just saves us from doing annoying type casts all over the place.
Diffstat (limited to 'source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc')
-rw-r--r--source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc11
1 files changed, 4 insertions, 7 deletions
diff --git a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
index 3edb2b7acb7..0fa7a5b1830 100644
--- a/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
+++ b/source/blender/depsgraph/intern/builder/deg_builder_relations_rig.cc
@@ -335,8 +335,8 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob)
*/
RootPChanMap root_map;
bool pose_depends_on_local_transform = false;
- for (bPoseChannel *pchan = (bPoseChannel *)ob->pose->chanbase.first; pchan; pchan = pchan->next) {
- for (bConstraint *con = (bConstraint *)pchan->constraints.first; con; con = con->next) {
+ LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
+ LINKLIST_FOREACH (bConstraint *, con, &pchan->constraints) {
switch (con->type) {
case CONSTRAINT_TYPE_KINEMATIC:
build_ik_pose(ob, pchan, con, &root_map);
@@ -377,7 +377,7 @@ void DepsgraphRelationBuilder::build_rig(Scene *scene, Object *ob)
/* links between operations for each bone */
- for (bPoseChannel *pchan = (bPoseChannel *)ob->pose->chanbase.first; pchan; pchan = pchan->next) {
+ LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
OperationKey bone_local_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL);
OperationKey bone_pose_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_POSE_PARENT);
OperationKey bone_ready_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY);
@@ -441,10 +441,7 @@ void DepsgraphRelationBuilder::build_proxy_rig(Object *ob)
{
OperationKey pose_init_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_INIT);
OperationKey pose_done_key(&ob->id, DEPSNODE_TYPE_EVAL_POSE, DEG_OPCODE_POSE_DONE);
- for (bPoseChannel *pchan = (bPoseChannel *)ob->pose->chanbase.first;
- pchan != NULL;
- pchan = pchan->next)
- {
+ LINKLIST_FOREACH (bPoseChannel *, pchan, &ob->pose->chanbase) {
OperationKey bone_local_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_LOCAL);
OperationKey bone_ready_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_READY);
OperationKey bone_done_key(&ob->id, DEPSNODE_TYPE_BONE, pchan->name, DEG_OPCODE_BONE_DONE);