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:
authorBastien Montagne <bastien@blender.org>2020-05-12 19:35:33 +0300
committerBastien Montagne <bastien@blender.org>2020-05-12 19:54:57 +0300
commit5fd64c014fa02b98d650fd6934c0d07a74707c51 (patch)
treec5b3f6a1513323e6a9c01bc3faa0a5f6808d9784 /source/blender/blenkernel/intern/armature.c
parent9996688b71678a0ea9e98027d6cc3ed4c308959d (diff)
Refactor: Move armature foreach_id to new IDTypeInfo structure.
Diffstat (limited to 'source/blender/blenkernel/intern/armature.c')
-rw-r--r--source/blender/blenkernel/intern/armature.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/armature.c b/source/blender/blenkernel/intern/armature.c
index af98992cc01..06a97fc3826 100644
--- a/source/blender/blenkernel/intern/armature.c
+++ b/source/blender/blenkernel/intern/armature.c
@@ -61,6 +61,7 @@
#include "BKE_idtype.h"
#include "BKE_lattice.h"
#include "BKE_lib_id.h"
+#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_object.h"
#include "BKE_scene.h"
@@ -150,6 +151,24 @@ static void armature_free_data(struct ID *id)
}
}
+static void armature_foreach_id_bone(Bone *bone, LibraryForeachIDData *data)
+{
+ IDP_foreach_property(
+ bone->prop, IDP_TYPE_FILTER_ID, BKE_lib_query_idpropertiesForeachIDLink_callback, data);
+
+ LISTBASE_FOREACH (Bone *, curbone, &bone->childbase) {
+ armature_foreach_id_bone(curbone, data);
+ }
+}
+
+static void armature_foreach_id(ID *id, LibraryForeachIDData *data)
+{
+ bArmature *arm = (bArmature *)id;
+ LISTBASE_FOREACH (Bone *, bone, &arm->bonebase) {
+ armature_foreach_id_bone(bone, data);
+ }
+}
+
IDTypeInfo IDType_ID_AR = {
.id_code = ID_AR,
.id_filter = FILTER_ID_AR,
@@ -164,6 +183,7 @@ IDTypeInfo IDType_ID_AR = {
.copy_data = armature_copy_data,
.free_data = armature_free_data,
.make_local = NULL,
+ .foreach_id = armature_foreach_id,
};
/* **************** Generic Functions, data level *************** */