37 switch (modifier_type) {
54 if (
object ==
nullptr) {
64 if (
hash ==
nullptr) {
70 return hash->lookup_default(collection_orig,
nullptr);
80 if (
hash ==
nullptr) {
86 return hash->lookup_default(collection_orig,
nullptr);
118 ListBase *relations = build_collision_relations(deg_graph, collection, modifier_type);
127 if (use_recursive_parents) {
128 object_component_map = MEM_new<blender::Map<Object *, CollisionComponentFlag>>(__func__);
132 Object *ob1 = relation->ob;
136 if (filter_function &&
142 if (use_recursive_parents) {
162 [&handle, &
name, &object_component_map](
Object *ob,
const bool update_mesh) {
167 update_flag |= test_flag;
174 update_flag |= test_flag;
181 update_flag |= test_flag;
194 if (use_recursive_parents) {
195 MEM_delete(object_component_map);
208 ListBase *relations = build_effector_relations(deg_graph, effector_weights->
group);
210 if (relation->ob ==
object) {
213 if (relation->pd->forcefield == skip_forcefield) {
230 if (relation->pd->forcefield ==
PFIELD_FLUIDFLOW && relation->pd->f_source !=
nullptr) {
252 if (
hash ==
nullptr) {
261 return hash->lookup_or_add_cb(collection_id, [&]() {
271 if (
hash ==
nullptr) {
280 return hash->lookup_or_add_cb(collection_id, [&]() {
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)
General operations, lookup, etc. for blender objects.
#define OBJECT_MODIFIER_UPDATE_SUBFRAME_RECURSION_DEFAULT
void BKE_object_modifier_update_subframe_only_callback(Object *ob, bool update_mesh, int parent_recursion_limit, int modifier_type, blender::FunctionRef< void(Object *object, bool update_mesh)> update_or_tag_fn)
#define BLI_assert_msg(a, msg)
#define LISTBASE_FOREACH(type, var, list)
#define ENUM_OPERATORS(_type, _max)
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
T * DEG_get_original(T *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.
BPy_StructRNA * depsgraph
Value & lookup_or_add_default(const Key &key)
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]