Merge branch 'master' into blender2.8

This commit is contained in:
2017-12-15 10:45:20 +01:00
17 changed files with 50 additions and 42 deletions

View File

@@ -75,6 +75,8 @@
#include "nla_private.h"
#include "atomic_ops.h"
/* ***************************************** */
/* AnimData API */

View File

@@ -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);
}
}

View File

@@ -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

View File

@@ -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;

View File

@@ -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) {

View File

@@ -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);

View File

@@ -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

View File

@@ -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;

View File

@@ -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;
}
}
}

View File

@@ -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);
}

View File

@@ -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);
}

View File

@@ -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) */

View File

@@ -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.

View File

@@ -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;

View File

@@ -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

View File

@@ -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");

View File

@@ -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;