Revert "Depsgraph: Implement 'ID_RECALC_GEOMETRY_DEFORM'"

This reverts commits
 bfa3dc91b7,
 52b94049f2,
 ae379714e4,
 a770faa811,
 4ed029fc02,
 101a493ab5 and
 62a2faa7ef.

And fixes T89955.

Changing the dependency graph is a can of worms and the result is
a kind of unpredictable.

A different solution will be planned.
This commit is contained in:
Germano Cavalcante 2021-07-19 10:17:38 -03:00
parent 62a2faa7ef
commit ceb612a79c
Notes: blender-bot 2023-02-14 19:45:25 +01:00
Referenced by issue #90226, Selection in Edit Mode crashes
Referenced by issue #89979, Blender crash: Curve to Mesh Geometry Node
Referenced by issue #89955, Blender crashing in Edit mode.
Referenced by issue #89962, Crash on  newly created mesh when removing only faces
Referenced by issue #89905, Retrieving evaluated mesh when realizing geometry nodes instances can fail
12 changed files with 82 additions and 208 deletions

View File

@ -27,7 +27,6 @@ typedef enum eMeshBatchDirtyMode {
BKE_MESH_BATCH_DIRTY_SELECT,
BKE_MESH_BATCH_DIRTY_SELECT_PAINT,
BKE_MESH_BATCH_DIRTY_SHADING,
BKE_MESH_BATCH_DIRTY_DEFORM,
BKE_MESH_BATCH_DIRTY_UVEDIT_ALL,
BKE_MESH_BATCH_DIRTY_UVEDIT_SELECT,
} eMeshBatchDirtyMode;

View File

@ -374,10 +374,6 @@ void BKE_object_runtime_free_data(struct Object *object);
void BKE_object_batch_cache_dirty_tag(struct Object *ob);
void BKE_object_data_batch_cache_dirty_tag(struct ID *object_data);
void BKE_object_data_eval_batch_cache_dirty_tag(struct Depsgraph *depsgraph,
struct ID *object_data);
void BKE_object_data_eval_batch_cache_deform_tag(struct Depsgraph *depsgraph,
struct ID *object_data);
/* this function returns a superset of the scenes selection based on relationships */

View File

@ -388,30 +388,12 @@ void BKE_object_batch_cache_dirty_tag(Object *ob)
BKE_object_data_batch_cache_dirty_tag(ob->data);
}
void BKE_object_data_eval_batch_cache_dirty_tag(Depsgraph *depsgraph, ID *object_data)
{
DEG_debug_print_eval(depsgraph, __func__, object_data->name, object_data);
BKE_object_data_batch_cache_dirty_tag(object_data);
}
void BKE_object_data_eval_batch_cache_deform_tag(Depsgraph *depsgraph, ID *object_data)
{
DEG_debug_print_eval(depsgraph, __func__, object_data->name, object_data);
switch (GS(object_data->name)) {
case ID_ME:
BKE_mesh_batch_cache_dirty_tag((Mesh *)object_data, BKE_MESH_BATCH_DIRTY_DEFORM);
break;
default:
/* Only mesh is currently supported. */
break;
}
}
void BKE_object_eval_uber_data(Depsgraph *depsgraph, Scene *scene, Object *ob)
{
DEG_debug_print_eval(depsgraph, __func__, ob->id.name, ob);
BLI_assert(ob->type != OB_ARMATURE);
BKE_object_handle_data_update(depsgraph, scene, ob);
BKE_object_batch_cache_dirty_tag(ob);
}
void BKE_object_eval_ptcache_reset(Depsgraph *depsgraph, Scene *scene, Object *object)

View File

@ -1496,7 +1496,7 @@ void DepsgraphNodeBuilder::build_object_data_geometry(Object *object, bool is_ob
add_operation_node(
&object->id,
NodeType::BATCH_CACHE,
OperationCode::BATCH_UPDATE_SELECT,
OperationCode::GEOMETRY_SELECT_UPDATE,
[object_cow](::Depsgraph *depsgraph) { BKE_object_select_update(depsgraph, object_cow); });
}
@ -1517,37 +1517,33 @@ void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata, bool
if (key) {
build_shapekeys(key);
}
/* Geometry evaluation. */
/* Entry operation, takes care of initialization, and some other
* relations which needs to be run prior to actual geometry evaluation. */
op_node = add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_INIT);
op_node->set_as_entry();
add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_DEFORM);
/* Nodes for result of obdata's evaluation, and geometry
* evaluation on object. */
const ID_Type id_type = GS(obdata->name);
switch (id_type) {
case ID_ME: {
add_operation_node(obdata,
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL,
[obdata_cow](::Depsgraph *depsgraph) {
BKE_mesh_eval_geometry(depsgraph, (Mesh *)obdata_cow);
});
op_node = add_operation_node(obdata,
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL,
[obdata_cow](::Depsgraph *depsgraph) {
BKE_mesh_eval_geometry(depsgraph, (Mesh *)obdata_cow);
});
op_node->set_as_entry();
break;
}
case ID_MB: {
add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
op_node = add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
op_node->set_as_entry();
break;
}
case ID_CU: {
add_operation_node(obdata,
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL,
[obdata_cow](::Depsgraph *depsgraph) {
BKE_curve_eval_geometry(depsgraph, (Curve *)obdata_cow);
});
op_node = add_operation_node(obdata,
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL,
[obdata_cow](::Depsgraph *depsgraph) {
BKE_curve_eval_geometry(depsgraph, (Curve *)obdata_cow);
});
op_node->set_as_entry();
/* Make sure objects used for bevel.taper are in the graph.
* NOTE: This objects might be not linked to the scene. */
Curve *cu = (Curve *)obdata;
@ -1563,41 +1559,47 @@ void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata, bool
break;
}
case ID_LT: {
add_operation_node(obdata,
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL,
[obdata_cow](::Depsgraph *depsgraph) {
BKE_lattice_eval_geometry(depsgraph, (Lattice *)obdata_cow);
});
op_node = add_operation_node(obdata,
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL,
[obdata_cow](::Depsgraph *depsgraph) {
BKE_lattice_eval_geometry(depsgraph, (Lattice *)obdata_cow);
});
op_node->set_as_entry();
break;
}
case ID_GD: {
/* GPencil evaluation operations. */
add_operation_node(obdata,
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL,
[obdata_cow](::Depsgraph *depsgraph) {
BKE_gpencil_frame_active_set(depsgraph, (bGPdata *)obdata_cow);
});
op_node = add_operation_node(obdata,
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL,
[obdata_cow](::Depsgraph *depsgraph) {
BKE_gpencil_frame_active_set(depsgraph,
(bGPdata *)obdata_cow);
});
op_node->set_as_entry();
break;
}
case ID_HA: {
add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
op_node = add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
op_node->set_as_entry();
break;
}
case ID_PT: {
add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
op_node = add_operation_node(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
op_node->set_as_entry();
break;
}
case ID_VO: {
/* Volume frame update. */
add_operation_node(obdata,
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL,
[obdata_cow](::Depsgraph *depsgraph) {
BKE_volume_eval_geometry(depsgraph, (Volume *)obdata_cow);
});
op_node = add_operation_node(obdata,
NodeType::GEOMETRY,
OperationCode::GEOMETRY_EVAL,
[obdata_cow](::Depsgraph *depsgraph) {
BKE_volume_eval_geometry(depsgraph, (Volume *)obdata_cow);
});
op_node->set_as_entry();
break;
}
default:
@ -1611,22 +1613,10 @@ void DepsgraphNodeBuilder::build_object_data_geometry_datablock(ID *obdata, bool
/* Batch cache. */
add_operation_node(obdata,
NodeType::BATCH_CACHE,
OperationCode::BATCH_UPDATE_SELECT,
OperationCode::GEOMETRY_SELECT_UPDATE,
[obdata_cow](::Depsgraph *depsgraph) {
BKE_object_data_select_update(depsgraph, obdata_cow);
});
add_operation_node(obdata,
NodeType::BATCH_CACHE,
OperationCode::BATCH_UPDATE_DEFORM,
[obdata_cow](::Depsgraph *depsgraph) {
BKE_object_data_eval_batch_cache_deform_tag(depsgraph, obdata_cow);
});
add_operation_node(obdata,
NodeType::BATCH_CACHE,
OperationCode::BATCH_UPDATE_ALL,
[obdata_cow](::Depsgraph *depsgraph) {
BKE_object_data_eval_batch_cache_dirty_tag(depsgraph, obdata_cow);
});
}
void DepsgraphNodeBuilder::build_armature(bArmature *armature)

View File

@ -647,7 +647,7 @@ void DepsgraphRelationBuilder::build_collection(LayerCollection *from_layer_coll
/* Only create geometry relations to child objects, if they have a geometry component. */
OperationKey object_geometry_key{
&cob->ob->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_INIT};
&cob->ob->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL};
if (find_node(object_geometry_key) != nullptr) {
add_relation(object_geometry_key, collection_geometry_key, "Collection Geometry");
}
@ -1099,14 +1099,7 @@ void DepsgraphRelationBuilder::build_object_pointcache(Object *object)
else {
flag = FLAG_GEOMETRY;
OperationKey geometry_key(&object->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
add_relation(point_cache_key, geometry_key, "Point Cache -> Geometry Eval");
if (object->data) {
/* Geometry may change, so rebuild the Drawing Cache. */
OperationKey object_data_batch_all_key(
(ID *)object->data, NodeType::BATCH_CACHE, OperationCode::BATCH_UPDATE_ALL);
add_relation(
point_cache_key, object_data_batch_all_key, "Point Cache -> Batch Update All");
}
add_relation(point_cache_key, geometry_key, "Point Cache -> Geometry");
}
BLI_assert(flag != -1);
/* Tag that we did handle that component. */
@ -1875,8 +1868,7 @@ void DepsgraphRelationBuilder::build_rigidbody(Scene *scene)
void DepsgraphRelationBuilder::build_particle_systems(Object *object)
{
TimeSourceKey time_src_key;
OperationKey obdata_ubereval_key(
&object->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_INIT);
OperationKey obdata_ubereval_key(&object->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
OperationKey eval_init_key(
&object->id, NodeType::PARTICLE_SYSTEM, OperationCode::PARTICLE_SYSTEM_INIT);
OperationKey eval_done_key(
@ -2024,8 +2016,7 @@ void DepsgraphRelationBuilder::build_particle_system_visualization_object(Object
{
OperationKey psys_key(
&object->id, NodeType::PARTICLE_SYSTEM, OperationCode::PARTICLE_SYSTEM_EVAL, psys->name);
OperationKey obdata_ubereval_key(
&object->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_INIT);
OperationKey obdata_ubereval_key(&object->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
ComponentKey dup_ob_key(&draw_object->id, NodeType::TRANSFORM);
add_relation(dup_ob_key, psys_key, "Particle Object Visualization");
if (draw_object->type == OB_MBALL) {
@ -2082,15 +2073,15 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object)
/* Get nodes for result of obdata's evaluation, and geometry evaluation
* on object. */
ComponentKey obdata_geom_key(obdata, NodeType::GEOMETRY);
OperationKey obdata_ubereval_key(&object->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
ComponentKey geom_key(&object->id, NodeType::GEOMETRY);
/* Link components to each other. */
add_relation(obdata_geom_key, obdata_ubereval_key, "Object Geometry Base Data");
add_relation(obdata_geom_key, geom_key, "Object Geometry Base Data");
OperationKey obdata_ubereval_key(&object->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
/* Special case: modifiers evaluation queries scene for various things like
* data mask to be used. We add relation here to ensure object is never
* evaluated prior to Scene's CoW is ready. */
OperationKey scene_key(&scene_->id, NodeType::PARAMETERS, OperationCode::SCENE_EVAL);
Relation *rel = add_relation(scene_key, geom_init_key, "CoW Relation");
Relation *rel = add_relation(scene_key, obdata_ubereval_key, "CoW Relation");
rel->flag |= RELATION_FLAG_NO_FLUSH;
/* Modifiers */
if (object->modifiers.first != nullptr) {
@ -2100,13 +2091,13 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object)
LISTBASE_FOREACH (ModifierData *, md, &object->modifiers) {
const ModifierTypeInfo *mti = BKE_modifier_get_info((ModifierType)md->type);
if (mti->updateDepsgraph) {
DepsNodeHandle handle = create_node_handle(geom_init_key);
DepsNodeHandle handle = create_node_handle(obdata_ubereval_key);
ctx.node = reinterpret_cast<::DepsNodeHandle *>(&handle);
mti->updateDepsgraph(md, &ctx);
}
if (BKE_object_modifier_use_time(object, md)) {
TimeSourceKey time_src_key;
add_relation(time_src_key, geom_init_key, "Time Source");
add_relation(time_src_key, obdata_ubereval_key, "Time Source");
}
}
}
@ -2119,13 +2110,13 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object)
const GpencilModifierTypeInfo *mti = BKE_gpencil_modifier_get_info(
(GpencilModifierType)md->type);
if (mti->updateDepsgraph) {
DepsNodeHandle handle = create_node_handle(geom_init_key);
DepsNodeHandle handle = create_node_handle(obdata_ubereval_key);
ctx.node = reinterpret_cast<::DepsNodeHandle *>(&handle);
mti->updateDepsgraph(md, &ctx, graph_->mode);
}
if (BKE_object_modifier_gpencil_use_time(object, md)) {
TimeSourceKey time_src_key;
add_relation(time_src_key, geom_init_key, "Time Source");
add_relation(time_src_key, obdata_ubereval_key, "Time Source");
}
}
}
@ -2137,13 +2128,13 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object)
LISTBASE_FOREACH (ShaderFxData *, fx, &object->shader_fx) {
const ShaderFxTypeInfo *fxi = BKE_shaderfx_get_info((ShaderFxType)fx->type);
if (fxi->updateDepsgraph) {
DepsNodeHandle handle = create_node_handle(geom_init_key);
DepsNodeHandle handle = create_node_handle(obdata_ubereval_key);
ctx.node = reinterpret_cast<::DepsNodeHandle *>(&handle);
fxi->updateDepsgraph(fx, &ctx);
}
if (BKE_object_shaderfx_use_time(object, fx)) {
TimeSourceKey time_src_key;
add_relation(time_src_key, geom_init_key, "Time Source");
add_relation(time_src_key, obdata_ubereval_key, "Time Source");
}
}
}
@ -2169,7 +2160,6 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object)
add_relation(mom_transform_key, mom_geom_key, "Metaball Motherball Transform -> Geometry");
}
else {
ComponentKey geom_key(&object->id, NodeType::GEOMETRY);
ComponentKey transform_key(&object->id, NodeType::TRANSFORM);
add_relation(geom_key, mom_geom_key, "Metaball Motherball");
add_relation(transform_key, mom_geom_key, "Metaball Motherball");
@ -2184,7 +2174,9 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object)
* Ideally we need to get rid of this relation. */
if (object_particles_depends_on_time(object)) {
TimeSourceKey time_key;
add_relation(time_key, geom_init_key, "Legacy particle time");
OperationKey obdata_ubereval_key(
&object->id, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
add_relation(time_key, obdata_ubereval_key, "Legacy particle time");
}
/* Object data data-block. */
build_object_data_geometry_datablock((ID *)object->data);
@ -2206,33 +2198,12 @@ void DepsgraphRelationBuilder::build_object_data_geometry(Object *object)
add_relation(final_geometry_key, synchronize_key, "Synchronize to Original");
/* Batch cache. */
OperationKey object_data_select_key(
obdata, NodeType::BATCH_CACHE, OperationCode::BATCH_UPDATE_SELECT);
obdata, NodeType::BATCH_CACHE, OperationCode::GEOMETRY_SELECT_UPDATE);
OperationKey object_select_key(
&object->id, NodeType::BATCH_CACHE, OperationCode::BATCH_UPDATE_SELECT);
&object->id, NodeType::BATCH_CACHE, OperationCode::GEOMETRY_SELECT_UPDATE);
add_relation(object_data_select_key, object_select_key, "Data Selection -> Object Selection");
add_relation(final_geometry_key,
object_select_key,
"Object Geometry -> Select Update",
RELATION_FLAG_NO_FLUSH);
OperationKey object_data_geom_deform_key(
obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_DEFORM);
OperationKey object_data_geom_init_key(
obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_INIT);
OperationKey object_data_batch_deform_key(
obdata, NodeType::BATCH_CACHE, OperationCode::BATCH_UPDATE_DEFORM);
OperationKey object_data_batch_all_key(
obdata, NodeType::BATCH_CACHE, OperationCode::BATCH_UPDATE_ALL);
add_relation(geom_init_key, object_data_batch_all_key, "Object Geometry -> Batch Update All");
add_relation(
object_data_geom_init_key, object_data_batch_all_key, "Data Init -> Batch Update All");
add_relation(object_data_geom_deform_key,
object_data_batch_deform_key,
"Data Deform -> Batch Update Deform");
geom_key, object_select_key, "Object Geometry -> Select Update", RELATION_FLAG_NO_FLUSH);
}
void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata)
@ -2250,13 +2221,8 @@ void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata)
build_shapekeys(key);
}
/* Link object data evaluation node to exit operation. */
OperationKey obdata_geom_deform_key(
obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_DEFORM);
OperationKey obdata_geom_init_key(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_INIT);
OperationKey obdata_geom_eval_key(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL);
OperationKey obdata_geom_done_key(obdata, NodeType::GEOMETRY, OperationCode::GEOMETRY_EVAL_DONE);
add_relation(obdata_geom_init_key, obdata_geom_eval_key, "ObData Init -> Geom Eval");
add_relation(obdata_geom_deform_key, obdata_geom_eval_key, "ObData Deform -> Geom Eval");
add_relation(obdata_geom_eval_key, obdata_geom_done_key, "ObData Geom Eval Done");
/* Type-specific links. */
const ID_Type id_type = GS(obdata->name);
@ -2269,21 +2235,21 @@ void DepsgraphRelationBuilder::build_object_data_geometry_datablock(ID *obdata)
Curve *cu = (Curve *)obdata;
if (cu->bevobj != nullptr) {
ComponentKey bevob_geom_key(&cu->bevobj->id, NodeType::GEOMETRY);
add_relation(bevob_geom_key, obdata_geom_init_key, "Curve Bevel Geometry");
add_relation(bevob_geom_key, obdata_geom_eval_key, "Curve Bevel Geometry");
ComponentKey bevob_key(&cu->bevobj->id, NodeType::TRANSFORM);
add_relation(bevob_key, obdata_geom_init_key, "Curve Bevel Transform");
add_relation(bevob_key, obdata_geom_eval_key, "Curve Bevel Transform");
build_object(cu->bevobj);
}
if (cu->taperobj != nullptr) {
ComponentKey taperob_key(&cu->taperobj->id, NodeType::GEOMETRY);
add_relation(taperob_key, obdata_geom_init_key, "Curve Taper");
add_relation(taperob_key, obdata_geom_eval_key, "Curve Taper");
build_object(cu->taperobj);
}
if (cu->textoncurve != nullptr) {
ComponentKey textoncurve_geom_key(&cu->textoncurve->id, NodeType::GEOMETRY);
add_relation(textoncurve_geom_key, obdata_geom_init_key, "Text on Curve Geometry");
add_relation(textoncurve_geom_key, obdata_geom_eval_key, "Text on Curve Geometry");
ComponentKey textoncurve_key(&cu->textoncurve->id, NodeType::TRANSFORM);
add_relation(textoncurve_key, obdata_geom_init_key, "Text on Curve Transform");
add_relation(textoncurve_key, obdata_geom_eval_key, "Text on Curve Transform");
build_object(cu->textoncurve);
}
break;

View File

@ -117,7 +117,7 @@ void depsgraph_select_tag_to_component_opcode(const ID *id,
}
else if (is_selectable_data_id_type(id_type)) {
*component_type = NodeType::BATCH_CACHE;
*operation_code = OperationCode::BATCH_UPDATE_SELECT;
*operation_code = OperationCode::GEOMETRY_SELECT_UPDATE;
}
else {
*component_type = NodeType::COPY_ON_WRITE;
@ -169,10 +169,6 @@ void depsgraph_tag_to_component_opcode(const ID *id,
case ID_RECALC_GEOMETRY:
depsgraph_geometry_tag_to_component(id, component_type);
break;
case ID_RECALC_GEOMETRY_DEFORM:
depsgraph_geometry_tag_to_component(id, component_type);
*operation_code = OperationCode::GEOMETRY_EVAL_DEFORM;
break;
case ID_RECALC_ANIMATION:
*component_type = NodeType::ANIMATION;
break;
@ -712,8 +708,6 @@ const char *DEG_update_tag_as_string(IDRecalcFlag flag)
return "GEOMETRY";
case ID_RECALC_GEOMETRY_ALL_MODES:
return "GEOMETRY_ALL_MODES";
case ID_RECALC_GEOMETRY_DEFORM:
return "GEOMETRY_DEFORM";
case ID_RECALC_ANIMATION:
return "ANIMATION";
case ID_RECALC_PSYS_REDO:

View File

@ -144,10 +144,7 @@ inline void flush_handle_component_node(IDNode *id_node,
* special component where we don't want all operations to be tagged.
*
* TODO(sergey): Make this a more generic solution. */
if (!ELEM(comp_node->type,
NodeType::PARTICLE_SETTINGS,
NodeType::PARTICLE_SYSTEM,
NodeType::BATCH_CACHE)) {
if (!ELEM(comp_node->type, NodeType::PARTICLE_SETTINGS, NodeType::PARTICLE_SYSTEM)) {
for (OperationNode *op : comp_node->operations) {
op->flag |= DEPSOP_FLAG_NEEDS_UPDATE;
}

View File

@ -98,8 +98,6 @@ const char *operationCodeAsString(OperationCode opcode)
/* Geometry. */
case OperationCode::GEOMETRY_EVAL_INIT:
return "GEOMETRY_EVAL_INIT";
case OperationCode::GEOMETRY_EVAL_DEFORM:
return "GEOMETRY_EVAL_DEFORM";
case OperationCode::GEOMETRY_EVAL:
return "GEOMETRY_EVAL";
case OperationCode::GEOMETRY_EVAL_DONE:
@ -162,12 +160,8 @@ const char *operationCodeAsString(OperationCode opcode)
case OperationCode::FILE_CACHE_UPDATE:
return "FILE_CACHE_UPDATE";
/* Batch cache. */
case OperationCode::BATCH_UPDATE_SELECT:
return "BATCH_UPDATE_SELECT";
case OperationCode::BATCH_UPDATE_DEFORM:
return "BATCH_UPDATE_DEFORM";
case OperationCode::BATCH_UPDATE_ALL:
return "BATCH_UPDATE_ALL";
case OperationCode::GEOMETRY_SELECT_UPDATE:
return "GEOMETRY_SELECT_UPDATE";
/* Masks. */
case OperationCode::MASK_ANIMATION:
return "MASK_ANIMATION";

View File

@ -100,11 +100,7 @@ enum class OperationCode {
/* Initialize evaluation of the geometry. Is an entry operation of geometry
* component. */
GEOMETRY_EVAL_INIT,
/* Evaluate the geometry, including modifiers, and update only batches that
* are affected by deform operations. */
GEOMETRY_EVAL_DEFORM,
/* Evaluate the geometry, including modifiers, but don't update the batch
* cache. */
/* Evaluate the whole geometry, including modifiers. */
GEOMETRY_EVAL,
/* Evaluation of geometry is completely done. */
GEOMETRY_EVAL_DONE,
@ -182,9 +178,7 @@ enum class OperationCode {
WORLD_UPDATE,
/* Batch caches. -------------------------------------------------------- */
BATCH_UPDATE_SELECT,
BATCH_UPDATE_DEFORM,
BATCH_UPDATE_ALL,
GEOMETRY_SELECT_UPDATE,
/* Masks. --------------------------------------------------------------- */
MASK_ANIMATION,

View File

@ -821,17 +821,6 @@ void DRW_mesh_batch_cache_dirty_tag(Mesh *me, eMeshBatchDirtyMode mode)
mesh_batch_cache_discard_shaded_tri(cache);
mesh_batch_cache_discard_uvedit(cache);
break;
case BKE_MESH_BATCH_DIRTY_DEFORM:
FOREACH_MESH_BUFFER_CACHE (cache, mbufcache) {
GPU_VERTBUF_DISCARD_SAFE(mbufcache->vbo.pos_nor);
GPU_VERTBUF_DISCARD_SAFE(mbufcache->vbo.lnor);
GPU_VERTBUF_DISCARD_SAFE(mbufcache->vbo.fdots_pos);
GPU_VERTBUF_DISCARD_SAFE(mbufcache->vbo.fdots_nor);
GPU_INDEXBUF_DISCARD_SAFE(mbufcache->ibo.tris);
}
batch_map = MDEPS_CREATE_MAP(vbo.pos_nor, vbo.lnor, vbo.fdots_pos, vbo.fdots_nor, ibo.tris);
mesh_batch_cache_discard_batch(cache, batch_map);
break;
case BKE_MESH_BATCH_DIRTY_UVEDIT_ALL:
mesh_batch_cache_discard_uvedit(cache);
break;

View File

@ -2067,27 +2067,6 @@ static void tc_mesh_transdata_mirror_apply(TransDataContainer *tc)
}
}
static bool tc_mesh_is_deform_only_update(TransInfo *t, TransDataContainer *tc)
{
if (tc->custom.type.data &&
((struct TransCustomDataMesh *)tc->custom.type.data)->cd_layer_correct) {
return false;
}
Mesh *me_eval = (Mesh *)DEG_get_evaluated_id(t->depsgraph, (ID *)tc->obedit->data);
Mesh *mesh_eval_cage = me_eval->edit_mesh->mesh_eval_cage;
Mesh *mesh_eval_final = me_eval->edit_mesh->mesh_eval_final;
if (mesh_eval_cage && !mesh_eval_cage->runtime.is_original) {
return false;
}
if (mesh_eval_final && mesh_eval_final != mesh_eval_cage &&
!mesh_eval_final->runtime.is_original) {
return false;
}
return me_eval->runtime.deformed_only;
}
void recalcData_mesh(TransInfo *t)
{
bool is_canceling = t->state == TRANS_CANCEL;
@ -2115,10 +2094,7 @@ void recalcData_mesh(TransInfo *t)
tc_mesh_partial_types_calc(t, &partial_state);
FOREACH_TRANS_DATA_CONTAINER (t, tc) {
const bool is_deform_only = tc_mesh_is_deform_only_update(t, tc);
DEG_id_tag_update(tc->obedit->data,
is_deform_only ? ID_RECALC_GEOMETRY_DEFORM : ID_RECALC_GEOMETRY);
DEG_id_tag_update(tc->obedit->data, ID_RECALC_GEOMETRY);
tc_mesh_partial_update(t, tc, &partial_state);
}

View File

@ -621,9 +621,9 @@ typedef enum IDRecalcFlag {
* When a collection gets tagged with this flag, all objects depending on the geometry and
* transforms on any of the objects in the collection are updated. */
ID_RECALC_GEOMETRY = (1 << 1),
/* Same as #ID_RECALC_GEOMETRY, but instead of tagging the batch cache as `dirty_all`, just tags
what matches the deform cache. */
ID_RECALC_GEOMETRY_DEFORM = (1 << 2),
/* ** Animation or time changed and animation is to be re-evaluated. ** */
ID_RECALC_ANIMATION = (1 << 2),
/* ** Particle system changed. ** */
/* Only do pathcache etc. */
@ -683,9 +683,6 @@ typedef enum IDRecalcFlag {
* have to be copied on every update. */
ID_RECALC_PARAMETERS = (1 << 21),
/* ** Animation or time changed and animation is to be re-evaluated. ** */
ID_RECALC_ANIMATION = (1 << 22),
/* Input has changed and datablock is to be reload from disk.
* Applies to movie clips to inform that copy-on-written version is to be refreshed for the new
* input file or for color space changes. */