38 switch (modifier_type) {
55 if (
object ==
nullptr) {
66 if (
hash ==
nullptr) {
72 return hash->lookup_default(collection_orig,
nullptr);
83 if (
hash ==
nullptr) {
89 return hash->lookup_default(collection_orig,
nullptr);
121 ListBaseT<CollisionRelation> *relations = build_collision_relations(
122 deg_graph, collection, modifier_type);
131 if (use_recursive_parents) {
132 object_component_map = MEM_new<Map<Object *, CollisionComponentFlag>>(__func__);
136 Object *ob1 = relation.ob;
140 if (filter_function &&
146 if (use_recursive_parents) {
166 [&handle, &name, &object_component_map](
Object *ob,
const bool update_mesh) {
170 if (!flag_is_set(update_flag, test_flag)) {
171 update_flag |= test_flag;
177 if (!flag_is_set(update_flag, test_flag)) {
178 update_flag |= test_flag;
184 if (!flag_is_set(update_flag, test_flag)) {
185 update_flag |= test_flag;
198 if (use_recursive_parents) {
199 MEM_delete(object_component_map);
212 ListBaseT<EffectorRelation> *relations = build_effector_relations(deg_graph,
213 effector_weights->
group);
215 if (relation.ob ==
object) {
218 if (relation.pd->forcefield == skip_forcefield) {
235 if (relation.pd->forcefield ==
PFIELD_FLUIDFLOW && relation.pd->f_source !=
nullptr) {
257 if (
hash ==
nullptr) {
266 return hash->lookup_or_add_cb(collection_id, [&]() {
267 ::blender::Depsgraph *depsgraph =
reinterpret_cast<::blender::Depsgraph *
>(graph);
278 if (
hash ==
nullptr) {
288 return hash->lookup_or_add_cb(collection_id, [&]() {
289 ::blender::Depsgraph *depsgraph =
reinterpret_cast<::blender::Depsgraph *
>(graph);
307 for (ListBaseT<CollisionRelation> *
list :
hash->values()) {
General operations, lookup, etc. for blender objects.
#define OBJECT_MODIFIER_UPDATE_SUBFRAME_RECURSION_DEFAULT
Object groups, one object can be in many groups at once.
Object is a sort of wrapper for general info.
#define BLI_assert_msg(a, msg)
Value & lookup_or_add_default(const Key &key)
ENUM_OPERATORS(Layer::Flags)
ListBaseT< CollisionRelation > * build_collision_relations(Depsgraph *graph, Collection *collection, uint modifier_type)
void clear_physics_relations(Depsgraph *graph)
ListBaseT< EffectorRelation > * build_effector_relations(Depsgraph *graph, Collection *collection)
Depsgraph * DEG_get_graph_from_handle(DepsNodeHandle *node_handle)
void DEG_add_object_pointcache_relation(DepsNodeHandle *node_handle, Object *object, eDepsObjectComponentType component, const char *description)
static ID * object_id_safe(T *object)
@ eModifierType_Collision
@ eModifierType_DynamicPaint
void BKE_object_modifier_update_subframe_only_callback(Object *ob, bool update_mesh, int parent_recursion_limit, int modifier_type, FunctionRef< void(Object *object, bool update_mesh)> update_or_tag_fn)
void BKE_collision_relations_free(ListBaseT< CollisionRelation > *relations)
ListBaseT< EffectorRelation > * DEG_get_effector_relations(const Depsgraph *depsgraph, Collection *collection)
void DEG_add_collision_relations(DepsNodeHandle *handle, Object *object, Collection *collection, unsigned int modifier_type, DEG_CollobjFilterFunction filter_function, const char *name)
static ePhysicsCollisionType modifier_to_collision_type(uint modifier_type)
@ DEG_PHYSICS_SMOKE_COLLISION
@ DEG_PHYSICS_COLLISION_NUM
@ DEG_PHYSICS_DYNAMIC_BRUSH
ModifierData * BKE_modifiers_findby_type(const Object *ob, ModifierType type)
T * DEG_get_original(T *id)
ListBaseT< CollisionRelation > * DEG_get_collision_relations(const Depsgraph *depsgraph, Collection *collection, unsigned int modifier_type)
void BKE_effector_relations_free(ListBaseT< EffectorRelation > *lb)
ListBaseT< CollisionRelation > * BKE_collision_relations_create(struct Depsgraph *depsgraph, struct Collection *collection, unsigned int modifier_type)
ListBaseT< EffectorRelation > * BKE_effector_relations_create(struct Depsgraph *depsgraph, const struct Scene *scene, struct ViewLayer *view_layer, struct Collection *collection)
bool(*)(Object *obj, ModifierData *md) DEG_CollobjFilterFunction
void DEG_add_forcefield_relations(DepsNodeHandle *handle, Object *object, EffectorWeights *eff, bool add_absorption, int skip_forcefield, const char *name)
struct Collection * group
Map< const ID *, ListBaseT< CollisionRelation > * > * physics_relations_collision[DEG_PHYSICS_COLLISION_NUM]
Map< const ID *, ListBaseT< EffectorRelation > * > * physics_relations_effector