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:
authorClément Foucault <foucault.clem@gmail.com>2018-07-10 15:14:55 +0300
committerClément Foucault <foucault.clem@gmail.com>2018-07-10 16:31:34 +0300
commit873d7f7e14e080f75e75ed7c6c07f326e588cecb (patch)
treeb0147308da930199bbdfea7a2cc4a5c17938b10f /source/blender/blenkernel
parentdfd192ce41f7e4923db0642f22a587862656bbdd (diff)
DrawData: Change drawdata to a generic struct shared accross ID types
This makes tagging much more generic and make the world updates more in line with the new tagging system (Depsgraph).
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_world.h6
-rw-r--r--source/blender/blenkernel/intern/object.c11
-rw-r--r--source/blender/blenkernel/intern/world.c13
3 files changed, 9 insertions, 21 deletions
diff --git a/source/blender/blenkernel/BKE_world.h b/source/blender/blenkernel/BKE_world.h
index f703fefec97..6a9a75828e5 100644
--- a/source/blender/blenkernel/BKE_world.h
+++ b/source/blender/blenkernel/BKE_world.h
@@ -44,10 +44,4 @@ struct World *BKE_world_copy(struct Main *bmain, const struct World *wrld);
struct World *BKE_world_localize(struct World *wrld);
void BKE_world_make_local(struct Main *bmain, struct World *wrld, const bool lib_local);
-/* Evaluation. */
-
-struct Depsgraph;
-
-void BKE_world_eval(struct Depsgraph *depsgraph, struct World *world);
-
#endif
diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c
index a7c13ab2a81..95e408f593e 100644
--- a/source/blender/blenkernel/intern/object.c
+++ b/source/blender/blenkernel/intern/object.c
@@ -424,6 +424,8 @@ void BKE_object_free(Object *ob)
{
BKE_animdata_free((ID *)ob, false);
+ DRW_drawdata_free((ID *)ob);
+
/* BKE_<id>_free shall never touch to ID->us. Never ever. */
BKE_object_free_modifiers(ob, LIB_ID_CREATE_NO_USER_REFCOUNT);
@@ -451,13 +453,6 @@ void BKE_object_free(Object *ob)
sbFree(ob);
- for (ObjectEngineData *oed = ob->drawdata.first; oed; oed = oed->next) {
- if (oed->free != NULL) {
- oed->free(oed);
- }
- }
- BLI_freelistN(&ob->drawdata);
-
BKE_sculptsession_free(ob);
BLI_freelistN(&ob->pc_ids);
@@ -1210,7 +1205,7 @@ void BKE_object_copy_data(Main *UNUSED(bmain), Object *ob_dst, const Object *ob_
ob_dst->derivedFinal = NULL;
BLI_listbase_clear(&ob_dst->gpulamp);
- BLI_listbase_clear(&ob_dst->drawdata);
+ BLI_listbase_clear((ListBase *)&ob_dst->drawdata);
BLI_listbase_clear(&ob_dst->pc_ids);
ob_dst->avs = ob_src->avs;
diff --git a/source/blender/blenkernel/intern/world.c b/source/blender/blenkernel/intern/world.c
index 69096ad7a08..3e1a9a4f57b 100644
--- a/source/blender/blenkernel/intern/world.c
+++ b/source/blender/blenkernel/intern/world.c
@@ -53,6 +53,8 @@
#include "BKE_node.h"
#include "BKE_world.h"
+#include "DRW_engine.h"
+
#include "DEG_depsgraph.h"
#include "GPU_material.h"
@@ -62,6 +64,8 @@ void BKE_world_free(World *wrld)
{
BKE_animdata_free((ID *)wrld, false);
+ DRW_drawdata_free((ID *)wrld);
+
/* is no lib link block, but world extension */
if (wrld->nodetree) {
ntreeFreeTree(wrld->nodetree);
@@ -119,6 +123,7 @@ void BKE_world_copy_data(Main *bmain, World *wrld_dst, const World *wrld_src, co
}
BLI_listbase_clear(&wrld_dst->gpumaterial);
+ BLI_listbase_clear((ListBase *)&wrld_dst->drawdata);
if ((flag & LIB_ID_COPY_NO_PREVIEW) == 0) {
BKE_previewimg_id_copy(&wrld_dst->id, &wrld_src->id);
@@ -154,6 +159,7 @@ World *BKE_world_localize(World *wrld)
wrldn->preview = NULL;
BLI_listbase_clear(&wrldn->gpumaterial);
+ BLI_listbase_clear((ListBase *)&wrldn->drawdata);
return wrldn;
}
@@ -163,10 +169,3 @@ void BKE_world_make_local(Main *bmain, World *wrld, const bool lib_local)
BKE_id_make_local_generic(bmain, &wrld->id, true, lib_local);
}
-void BKE_world_eval(struct Depsgraph *depsgraph, World *world)
-{
- DEG_debug_print_eval(depsgraph, __func__, world->id.name, world);
- if (!BLI_listbase_is_empty(&world->gpumaterial)) {
- world->update_flag = 1;
- }
-}