diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-15 12:45:20 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-12-15 12:45:20 +0300 |
commit | f4140f2c8138ec07ba06376c4d0d70d40fca6fad (patch) | |
tree | b6d7d87fed15896b45b1a1cccfea1175bee0f426 | |
parent | 2ddee0ba5ac7f6fa66cd21111e49ea43226d8b3b (diff) | |
parent | c4046e9082f61bfef87173d20c566a065f2602d7 (diff) |
Merge branch 'master' into blender2.8
-rw-r--r-- | source/blender/blenkernel/intern/anim_sys.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/group.c | 2 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/object.c | 8 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/scene.c | 4 | ||||
-rw-r--r-- | source/blender/blenloader/intern/readfile.c | 2 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_legacy.c | 2 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/builder/deg_builder.cc | 2 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph.cc | 2 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/depsgraph_tag.cc | 6 | ||||
-rw-r--r-- | source/blender/depsgraph/intern/eval/deg_eval_flush.cc | 2 | ||||
-rw-r--r-- | source/blender/editors/render/render_update.c | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_ID.h | 29 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_object_types.h | 8 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_scene_types.h | 7 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_text_types.h | 5 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_ID.c | 5 | ||||
-rw-r--r-- | source/blender/modifiers/intern/MOD_correctivesmooth.c | 2 |
17 files changed, 50 insertions, 42 deletions
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c index 34f928ad4b6..f9324b33ebe 100644 --- a/source/blender/blenkernel/intern/anim_sys.c +++ b/source/blender/blenkernel/intern/anim_sys.c @@ -75,6 +75,8 @@ #include "nla_private.h" +#include "atomic_ops.h" + /* ***************************************** */ /* AnimData API */ diff --git a/source/blender/blenkernel/intern/group.c b/source/blender/blenkernel/intern/group.c index 0394c813a14..5b55433c1b9 100644 --- a/source/blender/blenkernel/intern/group.c +++ b/source/blender/blenkernel/intern/group.c @@ -374,7 +374,7 @@ void BKE_group_handle_recalc_and_update(const struct EvaluationContext *eval_ctx /* only do existing tags, as set by regular depsgraph */ FOREACH_GROUP_OBJECT(group, object) { - if (object->id.tag & LIB_TAG_ID_RECALC_ALL) { + if (object->id.recalc & ID_RECALC_ALL) { BKE_object_handle_update(eval_ctx, scene, object); } } diff --git a/source/blender/blenkernel/intern/object.c b/source/blender/blenkernel/intern/object.c index 717d395fc68..66c87ac7a5c 100644 --- a/source/blender/blenkernel/intern/object.c +++ b/source/blender/blenkernel/intern/object.c @@ -2700,9 +2700,9 @@ void BKE_object_handle_update_ex(const EvaluationContext *eval_ctx, const bool do_proxy_update) { const ID *object_data = ob->data; - const bool recalc_object = (ob->id.tag & LIB_TAG_ID_RECALC) != 0; + const bool recalc_object = (ob->id.recalc & ID_RECALC) != 0; const bool recalc_data = - (object_data != NULL) ? ((object_data->tag & LIB_TAG_ID_RECALC_ALL) != 0) + (object_data != NULL) ? ((object_data->recalc & ID_RECALC_ALL) != 0) : 0; if (!recalc_object && ! recalc_data) { object_handle_update_proxy(eval_ctx, scene, ob, do_proxy_update); @@ -2742,7 +2742,7 @@ void BKE_object_handle_update_ex(const EvaluationContext *eval_ctx, BKE_object_handle_data_update(eval_ctx, scene, ob); } - ob->id.tag &= ~LIB_TAG_ID_RECALC_ALL; + ob->id.recalc &= ID_RECALC_ALL; object_handle_update_proxy(eval_ctx, scene, ob, do_proxy_update); } @@ -3725,7 +3725,7 @@ bool BKE_object_modifier_update_subframe( /* was originally OB_RECALC_ALL - TODO - which flags are really needed??? */ /* TODO(sergey): What about animation? */ - ob->id.tag |= LIB_TAG_ID_RECALC_ALL; + ob->id.recalc |= ID_RECALC_ALL; BKE_animsys_evaluate_animdata(scene, &ob->id, ob->adt, frame, ADT_RECALC_ANIM); if (update_mesh) { /* ignore cache clear during subframe updates diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c index c095236733f..22c3da09f13 100644 --- a/source/blender/blenkernel/intern/scene.c +++ b/source/blender/blenkernel/intern/scene.c @@ -1391,8 +1391,8 @@ static void prepare_mesh_for_viewport_render(Main *bmain, Scene *scene) if (obedit) { Mesh *mesh = obedit->data; if ((obedit->type == OB_MESH) && - ((obedit->id.tag & LIB_TAG_ID_RECALC_ALL) || - (mesh->id.tag & LIB_TAG_ID_RECALC_ALL))) + ((obedit->id.recalc & ID_RECALC_ALL) || + (mesh->id.recalc & ID_RECALC_ALL))) { if (check_rendered_viewport_visible(bmain)) { BMesh *bm = mesh->edit_btmesh->bm; diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c index 494c1d5110b..dcd993838e6 100644 --- a/source/blender/blenloader/intern/readfile.c +++ b/source/blender/blenloader/intern/readfile.c @@ -3217,7 +3217,7 @@ static void direct_link_nodetree(FileData *fd, bNodeTree *ntree) ntree->adt = newdataadr(fd, ntree->adt); direct_link_animdata(fd, ntree->adt); - ntree->id.tag &= ~LIB_TAG_ID_RECALC_ALL; + ntree->id.recalc &= ~ID_RECALC_ALL; link_list(fd, &ntree->nodes); for (node = ntree->nodes.first; node; node = node->next) { diff --git a/source/blender/blenloader/intern/versioning_legacy.c b/source/blender/blenloader/intern/versioning_legacy.c index 156a6e3d1c0..39ece4fd143 100644 --- a/source/blender/blenloader/intern/versioning_legacy.c +++ b/source/blender/blenloader/intern/versioning_legacy.c @@ -1871,7 +1871,7 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *main) BKE_pose_tag_recalc(main, ob->pose); /* cannot call stuff now (pointers!), done in setup_app_data */ - ob->id.tag |= LIB_TAG_ID_RECALC_ALL; + ob->id.recalc |= ID_RECALC_ALL; /* new generic xray option */ arm = blo_do_versions_newlibadr(fd, lib, ob->data); diff --git a/source/blender/depsgraph/intern/builder/deg_builder.cc b/source/blender/depsgraph/intern/builder/deg_builder.cc index 20a93673350..1e906d454ac 100644 --- a/source/blender/depsgraph/intern/builder/deg_builder.cc +++ b/source/blender/depsgraph/intern/builder/deg_builder.cc @@ -52,7 +52,7 @@ void deg_graph_build_finalize(Main *bmain, Depsgraph *graph) foreach (IDDepsNode *id_node, graph->id_nodes) { ID *id = id_node->id_orig; id_node->finalize_build(graph); - if ((id->tag & LIB_TAG_ID_RECALC_ALL)) { + if ((id->recalc & ID_RECALC_ALL)) { id_node->tag_update(graph); } /* TODO(sergey): This is not ideal at all, since this forces diff --git a/source/blender/depsgraph/intern/depsgraph.cc b/source/blender/depsgraph/intern/depsgraph.cc index 4fea8b49706..1227db4c1bb 100644 --- a/source/blender/depsgraph/intern/depsgraph.cc +++ b/source/blender/depsgraph/intern/depsgraph.cc @@ -354,7 +354,7 @@ DepsRelation *Depsgraph::add_new_relation(OperationDepsNode *from, if (comp_node->type == DEG_NODE_TYPE_GEOMETRY) { IDDepsNode *id_to = to->owner->owner; IDDepsNode *id_from = from->owner->owner; - if (id_to != id_from && (id_to->id_orig->tag & LIB_TAG_ID_RECALC_ALL)) { + if (id_to != id_from && (id_to->id_orig->recalc & ID_RECALC_ALL)) { if ((id_from->eval_flags & DAG_EVAL_NEED_CPU) == 0) { id_from->tag_update(this); id_from->eval_flags |= DAG_EVAL_NEED_CPU; diff --git a/source/blender/depsgraph/intern/depsgraph_tag.cc b/source/blender/depsgraph/intern/depsgraph_tag.cc index 8d64ca17251..8bbaa8f2021 100644 --- a/source/blender/depsgraph/intern/depsgraph_tag.cc +++ b/source/blender/depsgraph/intern/depsgraph_tag.cc @@ -84,7 +84,7 @@ namespace DEG { void lib_id_recalc_tag(Main *bmain, ID *id) { - id->tag |= LIB_TAG_ID_RECALC; + id->recalc |= ID_RECALC; DEG_id_type_tag(bmain, GS(id->name)); } @@ -608,12 +608,12 @@ void DEG_ids_clear_recalc(Main *bmain) if (id && bmain->id_tag_update[BKE_idcode_to_index(GS(id->name))]) { for (; id; id = (ID *)id->next) { - id->tag &= ~LIB_TAG_ID_RECALC_ALL; + id->recalc &= ~ID_RECALC_ALL; /* Some ID's contain semi-datablock nodetree */ ntree = ntreeFromID(id); if (ntree != NULL) { - ntree->id.tag &= ~LIB_TAG_ID_RECALC_ALL; + ntree->id.recalc &= ~ID_RECALC_ALL; } } } diff --git a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc index fecc9a75a14..c285efd5819 100644 --- a/source/blender/depsgraph/intern/eval/deg_eval_flush.cc +++ b/source/blender/depsgraph/intern/eval/deg_eval_flush.cc @@ -205,7 +205,7 @@ BLI_INLINE void flush_editors_id_update(Main *bmain, * This is because DEG_id_tag_update() sets tags on original * data. */ - id_cow->tag |= (id_orig->tag & LIB_TAG_ID_RECALC_ALL); + id_cow->tag |= (id_orig->recalc & ID_RECALC_ALL); if (deg_copy_on_write_is_expanded(id_cow)) { deg_editors_id_update(update_ctx, id_cow); } diff --git a/source/blender/editors/render/render_update.c b/source/blender/editors/render/render_update.c index a391b13a000..42109662129 100644 --- a/source/blender/editors/render/render_update.c +++ b/source/blender/editors/render/render_update.c @@ -309,7 +309,7 @@ static void material_changed(Main *bmain, Material *ma) BKE_icon_changed(BKE_icon_id_ensure(&ma->id)); /* glsl */ - if (ma->id.tag & LIB_TAG_ID_RECALC) { + if (ma->id.recalc & ID_RECALC) { if (!BLI_listbase_is_empty(&ma->gpumaterial)) { GPU_material_free(&ma->gpumaterial); } @@ -493,7 +493,7 @@ static void world_changed(Main *UNUSED(bmain), World *wo) wo->update_flag = 1; /* glsl */ - if (wo->id.tag & LIB_TAG_ID_RECALC) { + if (wo->id.recalc & ID_RECALC) { if (!BLI_listbase_is_empty(&defmaterial.gpumaterial)) { GPU_material_free(&defmaterial.gpumaterial); } diff --git a/source/blender/makesdna/DNA_ID.h b/source/blender/makesdna/DNA_ID.h index 6f08afd0fe4..78624e17d73 100644 --- a/source/blender/makesdna/DNA_ID.h +++ b/source/blender/makesdna/DNA_ID.h @@ -211,13 +211,14 @@ typedef struct ID { int tag; int us; int icon_id; + int recalc; + int pad; IDProperty *properties; IDOverrideStatic *override_static; /* Reference linked ID which this one overrides. */ + void *pad1; void *py_instance; - - void *pad1; } ID; /** @@ -437,22 +438,24 @@ enum { /* RESET_AFTER_USE tag existing data before linking so we know what is new. */ LIB_TAG_PRE_EXISTING = 1 << 11, - /* RESET_AFTER_USE, used by update code (depsgraph). */ - LIB_TAG_ID_RECALC = 1 << 12, - /* LIB_TAG_AVAILABLE = 1 << 13, */ /* Was used by deprecated flag. */ - /* LIB_TAG_AVAILABLE = 1 << 14, */ /* Was used by deprecated flag. */ - LIB_TAG_ID_RECALC_ALL = (LIB_TAG_ID_RECALC), - /* The datablock is a copy-on-write version. */ - LIB_TAG_COPY_ON_WRITE = 1 << 15, - LIB_TAG_COPY_ON_WRITE_EVAL = 1 << 16, + LIB_TAG_COPY_ON_WRITE = 1 << 12, + LIB_TAG_COPY_ON_WRITE_EVAL = 1 << 13, /* RESET_NEVER tag datablock for freeing etc. behavior (usually set when copying real one into temp/runtime one). */ - LIB_TAG_NO_MAIN = 1 << 17, /* Datablock is not listed in Main database. */ - LIB_TAG_NO_USER_REFCOUNT = 1 << 18, /* Datablock does not refcount usages of other IDs. */ + LIB_TAG_NO_MAIN = 1 << 14, /* Datablock is not listed in Main database. */ + LIB_TAG_NO_USER_REFCOUNT = 1 << 15, /* Datablock does not refcount usages of other IDs. */ /* Datablock was not allocated by standard system (BKE_libblock_alloc), do not free its memory * (usual type-specific freeing is called though). */ - LIB_TAG_NOT_ALLOCATED = 1 << 19, + LIB_TAG_NOT_ALLOCATED = 1 << 16, +}; + +enum { + /* RESET_AFTER_USE, used by update code (depsgraph). */ + ID_RECALC = 1 << 0, + ID_RECALC_DATA = 1 << 1, + ID_RECALC_SKIP_ANIM_TAG = 1 << 2, + ID_RECALC_ALL = (ID_RECALC | ID_RECALC_DATA), }; /* To filter ID types (filter_id) */ diff --git a/source/blender/makesdna/DNA_object_types.h b/source/blender/makesdna/DNA_object_types.h index 78c623f6408..79cf5040d9e 100644 --- a/source/blender/makesdna/DNA_object_types.h +++ b/source/blender/makesdna/DNA_object_types.h @@ -154,6 +154,7 @@ typedef struct Object { bAnimVizSettings avs; /* settings for visualization of object-transform animation */ bMotionPath *mpath; /* motion path cache for this object */ + void *pad1; ListBase constraintChannels DNA_DEPRECATED; // XXX deprecated... old animation system ListBase effect DNA_DEPRECATED; // XXX deprecated... keep for readfile @@ -276,8 +277,6 @@ typedef struct Object { int gameflag; int gameflag2; - struct BulletSoftBody *bsoft; /* settings for game engine bullet soft body */ - char restrictflag; /* for restricting view, select, render etc. accessible in outliner */ char pad3; short softflag; /* softbody settings */ @@ -288,6 +287,7 @@ typedef struct Object { ListBase hooks DNA_DEPRECATED; // XXX deprecated... old animation system ListBase particlesystem; /* particle systems */ + struct BulletSoftBody *bsoft; /* settings for game engine bullet soft body */ struct PartDeflect *pd; /* particle deflector/attractor/collision data */ struct SoftBody *soft; /* if exists, saved in file */ struct Group *dup_group; /* object duplicator for group */ @@ -300,6 +300,7 @@ typedef struct Object { struct FluidsimSettings *fluidsimSettings; /* if fluidsim enabled, store additional settings */ struct DerivedMesh *derivedDeform, *derivedFinal; + void *pad7; uint64_t lastDataMask; /* the custom data layer mask that was last used to calculate derivedDeform and derivedFinal */ uint64_t customdata_mask; /* (extra) custom data layer mask to use for creating derivedmesh, set by depsgraph */ unsigned int state; /* bit masks of game controllers that are active */ @@ -317,6 +318,7 @@ typedef struct Object { float ima_ofs[2]; /* offset for image empties */ ImageUser *iuser; /* must be non-null when oject is an empty image */ + void *pad4; ListBase lodlevels; /* contains data for levels of detail */ LodLevel *currentlod; @@ -326,7 +328,7 @@ typedef struct Object { struct IDProperty *base_collection_properties; /* used by depsgraph, flushed from base */ ListBase drawdata; /* runtime, ObjectEngineData */ - int pad1; + int pad6; int select_color; /* Mesh structure createrd during object evaluaiton. diff --git a/source/blender/makesdna/DNA_scene_types.h b/source/blender/makesdna/DNA_scene_types.h index d25391ca95d..065ee801b84 100644 --- a/source/blender/makesdna/DNA_scene_types.h +++ b/source/blender/makesdna/DNA_scene_types.h @@ -1667,16 +1667,15 @@ typedef struct Scene { /* Grease Pencil */ struct bGPdata *gpd; + /* Movie Tracking */ + struct MovieClip *clip; /* active movie clip */ + /* Physics simulation settings */ struct PhysicsSettings physics_settings; - void *pad6; - uint64_t customdata_mask; /* XXX. runtime flag for drawing, actually belongs in the window, only used by BKE_object_handle_update() */ uint64_t customdata_mask_modal; /* XXX. same as above but for temp operator use (gl renders) */ - /* Movie Tracking */ - struct MovieClip *clip; /* active movie clip */ /* Color Management */ ColorManagedViewSettings view_settings; diff --git a/source/blender/makesdna/DNA_text_types.h b/source/blender/makesdna/DNA_text_types.h index c7969cd30e7..0a9b8c320b5 100644 --- a/source/blender/makesdna/DNA_text_types.h +++ b/source/blender/makesdna/DNA_text_types.h @@ -51,6 +51,7 @@ typedef struct Text { ID id; char *name; + void *compiled; int flags, nlines; @@ -59,10 +60,10 @@ typedef struct Text { int curc, selc; char *undo_buf; + void *pad; int undo_pos, undo_len; - + double mtime; - void *compiled; } Text; #define TXT_TABSIZE 4 diff --git a/source/blender/makesrna/intern/rna_ID.c b/source/blender/makesrna/intern/rna_ID.c index c7446b5674a..cd7e339a2d7 100644 --- a/source/blender/makesrna/intern/rna_ID.c +++ b/source/blender/makesrna/intern/rna_ID.c @@ -783,7 +783,7 @@ static int rna_ID_is_updated_data_get(PointerRNA *ptr) if (data == NULL) { return 0; } - return ((data->tag & LIB_TAG_ID_RECALC_ALL) != 0); + return ((data->recalc & ID_RECALC_ALL) != 0); } static PointerRNA rna_ID_override_reference_get(PointerRNA *ptr) @@ -1037,11 +1037,12 @@ static void rna_def_ID(BlenderRNA *brna) "(initial state is undefined)"); prop = RNA_def_property(srna, "is_updated", PROP_BOOLEAN, PROP_NONE); - RNA_def_property_boolean_sdna(prop, NULL, "tag", LIB_TAG_ID_RECALC); + RNA_def_property_boolean_sdna(prop, NULL, "recalc", ID_RECALC); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_ui_text(prop, "Is Updated", "Data-block is tagged for recalculation"); prop = RNA_def_property(srna, "is_updated_data", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_sdna(prop, NULL, "recalc", ID_RECALC_DATA); RNA_def_property_clear_flag(prop, PROP_EDITABLE); RNA_def_property_boolean_funcs(prop, "rna_ID_is_updated_data_get", NULL); RNA_def_property_ui_text(prop, "Is Updated Data", "Data-block data is tagged for recalculation"); diff --git a/source/blender/modifiers/intern/MOD_correctivesmooth.c b/source/blender/modifiers/intern/MOD_correctivesmooth.c index 716b918d0f0..c43e4144f00 100644 --- a/source/blender/modifiers/intern/MOD_correctivesmooth.c +++ b/source/blender/modifiers/intern/MOD_correctivesmooth.c @@ -575,7 +575,7 @@ static void correctivesmooth_modifier_do( const bool force_delta_cache_update = /* XXX, take care! if mesh data its self changes we need to forcefully recalculate deltas */ ((csmd->rest_source == MOD_CORRECTIVESMOOTH_RESTSOURCE_ORCO) && - (((ID *)ob->data)->tag & LIB_TAG_ID_RECALC)); + (((ID *)ob->data)->recalc & ID_RECALC)); bool use_only_smooth = (csmd->flag & MOD_CORRECTIVESMOOTH_ONLY_SMOOTH) != 0; MDeformVert *dvert = NULL; |