Merge branch 'master' into blender2.8
In addition to pack of conflicts listed below, also had to comment out particle part of new Alembic code... :/ Conflicts: intern/ghost/intern/GHOST_WindowWin32.cpp source/blender/blenkernel/BKE_effect.h source/blender/blenkernel/BKE_pointcache.h source/blender/blenkernel/intern/cloth.c source/blender/blenkernel/intern/depsgraph.c source/blender/blenkernel/intern/dynamicpaint.c source/blender/blenkernel/intern/effect.c source/blender/blenkernel/intern/particle_system.c source/blender/blenkernel/intern/pointcache.c source/blender/blenkernel/intern/rigidbody.c source/blender/blenkernel/intern/smoke.c source/blender/blenkernel/intern/softbody.c source/blender/depsgraph/intern/builder/deg_builder_relations.cc source/blender/gpu/intern/gpu_debug.c source/blender/makesdna/DNA_object_types.h source/blender/makesrna/intern/rna_particle.c
This commit is contained in:
@@ -64,6 +64,7 @@ extern "C" {
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_texture_types.h"
|
||||
#include "DNA_world_types.h"
|
||||
#include "DNA_object_force.h"
|
||||
|
||||
#include "BKE_action.h"
|
||||
#include "BKE_armature.h"
|
||||
@@ -71,6 +72,7 @@ extern "C" {
|
||||
#include "BKE_constraint.h"
|
||||
#include "BKE_curve.h"
|
||||
#include "BKE_effect.h"
|
||||
#include "BKE_collision.h"
|
||||
#include "BKE_fcurve.h"
|
||||
#include "BKE_group.h"
|
||||
#include "BKE_key.h"
|
||||
@@ -241,6 +243,54 @@ void DepsgraphRelationBuilder::add_operation_relation(
|
||||
}
|
||||
}
|
||||
|
||||
void DepsgraphRelationBuilder::add_collision_relations(const OperationKey &key, Scene *scene, Object *ob, Group *group, int layer, bool dupli, const char *name)
|
||||
{
|
||||
unsigned int numcollobj;
|
||||
Object **collobjs = get_collisionobjects_ext(scene, ob, group, layer, &numcollobj, eModifierType_Collision, dupli);
|
||||
|
||||
for (unsigned int i = 0; i < numcollobj; i++)
|
||||
{
|
||||
Object *ob1 = collobjs[i];
|
||||
|
||||
ComponentKey trf_key(&ob1->id, DEPSNODE_TYPE_TRANSFORM);
|
||||
add_relation(trf_key, key, DEPSREL_TYPE_STANDARD, name);
|
||||
|
||||
ComponentKey coll_key(&ob1->id, DEPSNODE_TYPE_GEOMETRY);
|
||||
add_relation(coll_key, key, DEPSREL_TYPE_STANDARD, name);
|
||||
}
|
||||
|
||||
if (collobjs)
|
||||
MEM_freeN(collobjs);
|
||||
}
|
||||
|
||||
void DepsgraphRelationBuilder::add_forcefield_relations(const OperationKey &key, Scene *scene, Object *ob, EffectorWeights *eff, bool add_absorption, const char *name)
|
||||
{
|
||||
ListBase *effectors = pdInitEffectors(scene, ob, eff, false);
|
||||
|
||||
if (effectors) {
|
||||
for (EffectorCache *eff = (EffectorCache *)effectors->first; eff; eff = eff->next) {
|
||||
if (eff->ob != ob) {
|
||||
ComponentKey eff_key(&eff->ob->id, DEPSNODE_TYPE_TRANSFORM);
|
||||
add_relation(eff_key, key, DEPSREL_TYPE_STANDARD, name);
|
||||
}
|
||||
|
||||
if (eff->pd->forcefield == PFIELD_SMOKEFLOW && eff->pd->f_source) {
|
||||
ComponentKey trf_key(&eff->pd->f_source->id, DEPSNODE_TYPE_TRANSFORM);
|
||||
add_relation(trf_key, key, DEPSREL_TYPE_STANDARD, "Smoke Force Domain");
|
||||
|
||||
ComponentKey eff_key(&eff->pd->f_source->id, DEPSNODE_TYPE_GEOMETRY);
|
||||
add_relation(eff_key, key, DEPSREL_TYPE_STANDARD, "Smoke Force Domain");
|
||||
}
|
||||
|
||||
if (add_absorption && (eff->pd->flag & PFIELD_VISIBILITY)) {
|
||||
add_collision_relations(key, scene, ob, NULL, eff->ob->lay, true, "Force Absorption");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pdEndEffectors(&effectors);
|
||||
}
|
||||
|
||||
/* **** Functions to build relations between entities **** */
|
||||
|
||||
void DepsgraphRelationBuilder::build_scene(Main *bmain, Scene *scene)
|
||||
|
||||
@@ -63,6 +63,8 @@ struct bConstraint;
|
||||
struct Scene;
|
||||
struct Tex;
|
||||
struct World;
|
||||
struct EffectorWeights;
|
||||
struct ParticleSystem;
|
||||
|
||||
struct PropertyRNA;
|
||||
|
||||
@@ -244,6 +246,9 @@ struct DepsgraphRelationBuilder
|
||||
void build_compositor(Scene *scene);
|
||||
void build_gpencil(ID *owner, bGPdata *gpd);
|
||||
|
||||
void add_collision_relations(const OperationKey &key, Scene *scene, Object *ob, Group *group, int layer, bool dupli, const char *name);
|
||||
void add_forcefield_relations(const OperationKey &key, Scene *scene, Object *ob, EffectorWeights *eff, bool add_absorption, const char *name);
|
||||
|
||||
template <typename KeyType>
|
||||
OperationDepsNode *find_operation_node(const KeyType &key);
|
||||
|
||||
|
||||
@@ -36,11 +36,15 @@ extern "C" {
|
||||
#include "DNA_cachefile_types.h"
|
||||
#include "DNA_object_types.h"
|
||||
#include "DNA_scene_types.h"
|
||||
#include "DNA_object_force.h"
|
||||
|
||||
#include "BLI_utildefines.h"
|
||||
#include "BLI_ghash.h"
|
||||
|
||||
#include "BKE_main.h"
|
||||
#include "BKE_collision.h"
|
||||
#include "BKE_effect.h"
|
||||
#include "BKE_modifier.h"
|
||||
|
||||
#include "DEG_depsgraph.h"
|
||||
#include "DEG_depsgraph_debug.h"
|
||||
@@ -304,3 +308,45 @@ void DEG_scene_graph_free(Scene *scene)
|
||||
scene->depsgraph = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
void DEG_add_collision_relations(DepsNodeHandle *handle, Scene *scene, Object *ob, Group *group, int layer, unsigned int modifier_type, DEG_CollobjFilterFunction fn, bool dupli, const char *name)
|
||||
{
|
||||
unsigned int numcollobj;
|
||||
Object **collobjs = get_collisionobjects_ext(scene, ob, group, layer, &numcollobj, modifier_type, dupli);
|
||||
|
||||
for (unsigned int i = 0; i < numcollobj; i++) {
|
||||
Object *ob1 = collobjs[i];
|
||||
|
||||
if (!fn || fn(ob1, modifiers_findByType(ob1, (ModifierType)modifier_type))) {
|
||||
DEG_add_object_relation(handle, ob1, DEG_OB_COMP_TRANSFORM, name);
|
||||
DEG_add_object_relation(handle, ob1, DEG_OB_COMP_GEOMETRY, name);
|
||||
}
|
||||
}
|
||||
|
||||
if (collobjs)
|
||||
MEM_freeN(collobjs);
|
||||
}
|
||||
|
||||
void DEG_add_forcefield_relations(DepsNodeHandle *handle, Scene *scene, Object *ob, EffectorWeights *effector_weights, bool add_absorption, int skip_forcefield, const char *name)
|
||||
{
|
||||
ListBase *effectors = pdInitEffectors(scene, ob, effector_weights, false);
|
||||
|
||||
if (effectors) {
|
||||
for (EffectorCache *eff = (EffectorCache*)effectors->first; eff; eff = eff->next) {
|
||||
if (eff->ob != ob && eff->pd->forcefield != skip_forcefield) {
|
||||
DEG_add_object_relation(handle, eff->ob, DEG_OB_COMP_TRANSFORM, name);
|
||||
|
||||
if (eff->pd->forcefield == PFIELD_SMOKEFLOW && eff->pd->f_source) {
|
||||
DEG_add_object_relation(handle, eff->pd->f_source, DEG_OB_COMP_TRANSFORM, "Smoke Force Domain");
|
||||
DEG_add_object_relation(handle, eff->pd->f_source, DEG_OB_COMP_GEOMETRY, "Smoke Force Domain");
|
||||
}
|
||||
|
||||
if (add_absorption && (eff->pd->flag & PFIELD_VISIBILITY)) {
|
||||
DEG_add_collision_relations(handle, scene, ob, NULL, eff->ob->lay, eModifierType_Collision, NULL, true, "Force Absorption");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pdEndEffectors(&effectors);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user