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/blenkernel/intern/mesh.c')
-rw-r--r--source/blender/blenkernel/intern/mesh.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/blenkernel/intern/mesh.c b/source/blender/blenkernel/intern/mesh.c
index 2a86b899290..aeef287bb87 100644
--- a/source/blender/blenkernel/intern/mesh.c
+++ b/source/blender/blenkernel/intern/mesh.c
@@ -25,6 +25,7 @@
#include "DNA_defaults.h"
#include "DNA_key_types.h"
+#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
#include "DNA_object_types.h"
@@ -47,6 +48,7 @@
#include "BKE_idtype.h"
#include "BKE_key.h"
#include "BKE_lib_id.h"
+#include "BKE_lib_query.h"
#include "BKE_main.h"
#include "BKE_material.h"
#include "BKE_mesh.h"
@@ -142,6 +144,16 @@ static void mesh_free_data(ID *id)
MEM_SAFE_FREE(mesh->mat);
}
+static void mesh_foreach_id(ID *id, LibraryForeachIDData *data)
+{
+ Mesh *mesh = (Mesh *)id;
+ BKE_LIB_FOREACHID_PROCESS(data, mesh->texcomesh, IDWALK_CB_NEVER_SELF);
+ BKE_LIB_FOREACHID_PROCESS(data, mesh->key, IDWALK_CB_USER);
+ for (int i = 0; i < mesh->totcol; i++) {
+ BKE_LIB_FOREACHID_PROCESS(data, mesh->mat[i], IDWALK_CB_USER);
+ }
+}
+
IDTypeInfo IDType_ID_ME = {
.id_code = ID_ME,
.id_filter = FILTER_ID_ME,
@@ -156,6 +168,7 @@ IDTypeInfo IDType_ID_ME = {
.copy_data = mesh_copy_data,
.free_data = mesh_free_data,
.make_local = NULL,
+ .foreach_id = mesh_foreach_id,
};
enum {
@@ -1128,7 +1141,7 @@ void BKE_mesh_assign_object(Main *bmain, Object *ob, Mesh *me)
BKE_object_materials_test(bmain, ob, (ID *)me);
- test_object_modifiers(ob);
+ BKE_modifiers_test_object(ob);
}
void BKE_mesh_material_index_remove(Mesh *me, short index)