38 switch (modifier_type) {
55 if (
object ==
nullptr) {
65 if (
hash ==
nullptr) {
71 return hash->lookup_default(collection_orig,
nullptr);
81 if (
hash ==
nullptr) {
87 return hash->lookup_default(collection_orig,
nullptr);
101 ListBase *relations = build_collision_relations(deg_graph, collection, modifier_type);
103 Object *ob1 = relation->ob;
107 if (filter_function ==
nullptr ||
125 ListBase *relations = build_effector_relations(deg_graph, effector_weights->
group);
127 if (relation->ob ==
object) {
130 if (relation->pd->forcefield == skip_forcefield) {
147 if (relation->pd->forcefield ==
PFIELD_FLUIDFLOW && relation->pd->f_source !=
nullptr) {
169 if (
hash ==
nullptr) {
178 return hash->lookup_or_add_cb(collection_id, [&]() {
188 if (
hash ==
nullptr) {
190 hash = graph->physics_relations[type];
197 return hash->lookup_or_add_cb(collection_id, [&]() {
227 graph->physics_relations[i] =
nullptr;
struct ListBase * BKE_collision_relations_create(struct Depsgraph *depsgraph, struct Collection *collection, unsigned int modifier_type)
void BKE_collision_relations_free(struct ListBase *relations)
struct ListBase * BKE_effector_relations_create(struct Depsgraph *depsgraph, const struct Scene *scene, struct ViewLayer *view_layer, struct Collection *collection)
void BKE_effector_relations_free(struct ListBase *lb)
ModifierData * BKE_modifiers_findby_type(const Object *ob, ModifierType type)
#define BLI_assert_msg(a, msg)
#define LISTBASE_FOREACH(type, var, list)
void DEG_add_object_pointcache_relation(DepsNodeHandle *node_handle, Object *object, eDepsObjectComponentType component, const char *description)
Depsgraph * DEG_get_graph_from_handle(DepsNodeHandle *node_handle)
bool(*)(Object *obj, ModifierData *md) DEG_CollobjFilterFunction
@ DEG_PHYSICS_DYNAMIC_BRUSH
@ DEG_PHYSICS_SMOKE_COLLISION
@ DEG_PHYSICS_RELATIONS_NUM
ID * DEG_get_original_id(ID *id)
Object groups, one object can be in many groups at once.
@ eModifierType_Collision
@ eModifierType_DynamicPaint
Object is a sort of wrapper for general info.
Read Guarded memory(de)allocation.
const Depsgraph * depsgraph
void DEG_add_collision_relations(DepsNodeHandle *handle, Object *object, Collection *collection, uint modifier_type, DEG_CollobjFilterFunction filter_function, const char *name)
static ePhysicsRelationType modifier_to_relation_type(uint modifier_type)
ListBase * DEG_get_collision_relations(const Depsgraph *graph, Collection *collection, uint modifier_type)
ListBase * DEG_get_effector_relations(const Depsgraph *graph, Collection *collection)
void DEG_add_forcefield_relations(DepsNodeHandle *handle, Object *object, EffectorWeights *effector_weights, bool add_absorption, int skip_forcefield, const char *name)
static ID * object_id_safe(T *object)
ListBase * build_collision_relations(Depsgraph *graph, Collection *collection, uint modifier_type)
ListBase * build_effector_relations(Depsgraph *graph, Collection *collection)
void clear_physics_relations(Depsgraph *graph)
struct Collection * group
Map< const ID *, ListBase * > * physics_relations[DEG_PHYSICS_RELATIONS_NUM]