diff options
author | Julian Eisel <julian@blender.org> | 2020-03-26 23:03:42 +0300 |
---|---|---|
committer | Julian Eisel <julian@blender.org> | 2020-03-26 23:18:45 +0300 |
commit | c94b6209861ca7cc3985b53474feed7d94c0221a (patch) | |
tree | 752054f0dca1338cda5cf8ad4f6d18573fcca3b9 /source/blender/blenkernel/intern/object_update.c | |
parent | 357ed79cb93f9d655501a828c6cddd68282de62d (diff) | |
parent | afb1a64ccb81b7ed792f64151986f40f53af8da5 (diff) |
Merge branch 'master' into wm-drag-drop-rewrite
Diffstat (limited to 'source/blender/blenkernel/intern/object_update.c')
-rw-r--r-- | source/blender/blenkernel/intern/object_update.c | 48 |
1 files changed, 39 insertions, 9 deletions
diff --git a/source/blender/blenkernel/intern/object_update.c b/source/blender/blenkernel/intern/object_update.c index 366fd0950fa..dd06e4f1753 100644 --- a/source/blender/blenkernel/intern/object_update.c +++ b/source/blender/blenkernel/intern/object_update.c @@ -24,39 +24,43 @@ #include "DNA_anim_types.h" #include "DNA_collection_types.h" #include "DNA_constraint_types.h" +#include "DNA_gpencil_types.h" #include "DNA_key_types.h" #include "DNA_material_types.h" #include "DNA_mesh_types.h" #include "DNA_scene_types.h" #include "BLI_blenlib.h" -#include "BLI_utildefines.h" -#include "BLI_threads.h" #include "BLI_math.h" +#include "BLI_threads.h" +#include "BLI_utildefines.h" +#include "BKE_DerivedMesh.h" +#include "BKE_action.h" #include "BKE_animsys.h" #include "BKE_armature.h" -#include "BKE_action.h" #include "BKE_constraint.h" #include "BKE_curve.h" -#include "BKE_DerivedMesh.h" #include "BKE_displist.h" #include "BKE_editmesh.h" #include "BKE_effect.h" +#include "BKE_gpencil.h" #include "BKE_gpencil_modifier.h" +#include "BKE_hair.h" #include "BKE_image.h" #include "BKE_key.h" +#include "BKE_lattice.h" #include "BKE_layer.h" #include "BKE_light.h" -#include "BKE_lattice.h" #include "BKE_material.h" #include "BKE_mball.h" #include "BKE_mesh.h" #include "BKE_object.h" #include "BKE_particle.h" #include "BKE_pointcache.h" +#include "BKE_pointcloud.h" #include "BKE_scene.h" -#include "BKE_gpencil.h" +#include "BKE_volume.h" #include "MEM_guardedalloc.h" @@ -150,6 +154,11 @@ void BKE_object_eval_transform_final(Depsgraph *depsgraph, Object *ob) else { ob->transflag &= ~OB_NEG_SCALE; } + + /* Assign evaluated version. */ + if ((ob->type == OB_GPENCIL) && (ob->runtime.gpd_eval != NULL)) { + ob->data = ob->runtime.gpd_eval; + } } void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *ob) @@ -213,8 +222,20 @@ void BKE_object_handle_data_update(Depsgraph *depsgraph, Scene *scene, Object *o case OB_LATTICE: BKE_lattice_modifiers_calc(depsgraph, scene, ob); break; - case OB_GPENCIL: + case OB_GPENCIL: { + BKE_gpencil_prepare_eval_data(depsgraph, scene, ob); BKE_gpencil_modifiers_calc(depsgraph, scene, ob); + BKE_gpencil_update_layer_parent(depsgraph, ob); + break; + } + case OB_HAIR: + BKE_hair_data_update(depsgraph, scene, ob); + break; + case OB_POINTCLOUD: + BKE_pointcloud_data_update(depsgraph, scene, ob); + break; + case OB_VOLUME: + BKE_volume_data_update(depsgraph, scene, ob); break; } @@ -345,6 +366,15 @@ void BKE_object_batch_cache_dirty_tag(Object *ob) case OB_GPENCIL: BKE_gpencil_batch_cache_dirty_tag(ob->data); break; + case OB_HAIR: + BKE_hair_batch_cache_dirty_tag(ob->data, BKE_HAIR_BATCH_DIRTY_ALL); + break; + case OB_POINTCLOUD: + BKE_pointcloud_batch_cache_dirty_tag(ob->data, BKE_POINTCLOUD_BATCH_DIRTY_ALL); + break; + case OB_VOLUME: + BKE_volume_batch_cache_dirty_tag(ob->data, BKE_VOLUME_BATCH_DIRTY_ALL); + break; } } @@ -398,8 +428,8 @@ void BKE_object_data_select_update(Depsgraph *depsgraph, ID *object_data) void BKE_object_select_update(Depsgraph *depsgraph, Object *object) { DEG_debug_print_eval(depsgraph, __func__, object->id.name, object); - if (object->type == OB_MESH && !object->runtime.is_mesh_eval_owned) { - Mesh *mesh_input = object->runtime.mesh_orig; + if (object->type == OB_MESH && !object->runtime.is_data_eval_owned) { + Mesh *mesh_input = (Mesh *)object->runtime.data_orig; Mesh_Runtime *mesh_runtime = &mesh_input->runtime; BLI_mutex_lock(mesh_runtime->eval_mutex); BKE_object_data_select_update(depsgraph, object->data); |