Merge branch 'master' into blender2.8

This commit is contained in:
Sergey Sharybin 2017-03-15 12:48:48 +01:00
commit 79f94674fb
7 changed files with 64 additions and 6 deletions

View File

@ -201,6 +201,11 @@ void BKE_object_eval_uber_data(struct EvaluationContext *eval_ctx,
struct Scene *scene,
struct Object *ob);
void BKE_object_eval_cloth(struct EvaluationContext *eval_ctx,
struct Scene *scene,
struct Object *object);
void BKE_object_handle_data_update(struct EvaluationContext *eval_ctx,
struct Scene *scene,
struct Object *ob);

View File

@ -55,6 +55,7 @@
#include "BKE_editmesh.h"
#include "BKE_object.h"
#include "BKE_particle.h"
#include "BKE_pointcache.h"
#include "BKE_scene.h"
#include "BKE_material.h"
#include "BKE_image.h"
@ -348,3 +349,9 @@ void BKE_object_eval_uber_data(EvaluationContext *eval_ctx,
ob->recalc &= ~(OB_RECALC_DATA | OB_RECALC_TIME);
}
void BKE_object_eval_cloth(EvaluationContext *UNUSED(eval_ctx), Scene *scene, Object *object)
{
DEBUG_PRINT("%s on %s\n", __func__, object->id.name);
BKE_ptcache_object_reset(scene, object, PTCACHE_RESET_DEPSGRAPH);
}

View File

@ -735,7 +735,8 @@ void DepsgraphNodeBuilder::build_particles(Scene *scene, Object *ob)
*/
/* component for all particle systems */
ComponentDepsNode *psys_comp = add_component_node(&ob->id, DEPSNODE_TYPE_EVAL_PARTICLES);
ComponentDepsNode *psys_comp =
add_component_node(&ob->id, DEPSNODE_TYPE_EVAL_PARTICLES);
/* particle systems */
LINKLIST_FOREACH (ParticleSystem *, psys, &ob->particlesystem) {
@ -748,11 +749,12 @@ void DepsgraphNodeBuilder::build_particles(Scene *scene, Object *ob)
/* this particle system */
// TODO: for now, this will just be a placeholder "ubereval" node
add_operation_node(psys_comp,
DEPSOP_TYPE_EXEC, function_bind(BKE_particle_system_eval,
_1,
scene,
ob,
psys),
DEPSOP_TYPE_EXEC,
function_bind(BKE_particle_system_eval,
_1,
scene,
ob,
psys),
DEG_OPCODE_PSYS_EVAL,
psys->name);
}
@ -761,6 +763,20 @@ void DepsgraphNodeBuilder::build_particles(Scene *scene, Object *ob)
// TODO...
}
void DepsgraphNodeBuilder::build_cloth(Scene *scene, Object *object)
{
ComponentDepsNode *cache_comp = add_component_node(&object->id,
DEPSNODE_TYPE_CACHE);
add_operation_node(cache_comp,
DEPSOP_TYPE_EXEC,
function_bind(BKE_object_eval_cloth,
_1,
scene,
object),
DEG_OPCODE_PLACEHOLDER,
"Cloth Modifier");
}
/* Shapekeys */
void DepsgraphNodeBuilder::build_shapekeys(Key *key)
{
@ -822,6 +838,9 @@ void DepsgraphNodeBuilder::build_obdata_geom(Scene *scene, Object *ob)
md),
DEG_OPCODE_GEOMETRY_MODIFIER,
md->name);
if (md->type == eModifierType_Cloth) {
build_cloth(scene, ob);
}
}
/* materials */

View File

@ -132,6 +132,7 @@ struct DepsgraphNodeBuilder {
void build_pose_constraints(Object *ob, bPoseChannel *pchan);
void build_rigidbody(Scene *scene);
void build_particles(Scene *scene, Object *ob);
void build_cloth(Scene *scene, Object *object);
void build_animdata(ID *id);
OperationDepsNode *build_driver(ID *id, FCurve *fcurve);
void build_ik_pose(Scene *scene,

View File

@ -1312,6 +1312,25 @@ void DepsgraphRelationBuilder::build_particles(Scene *scene, Object *ob)
// TODO...
}
void DepsgraphRelationBuilder::build_cloth(Scene * /*scene*/,
Object *object,
ModifierData *md)
{
OperationKey cache_key(&object->id,
DEPSNODE_TYPE_CACHE,
DEG_OPCODE_PLACEHOLDER,
"Cloth Modifier");
/* Cache component affects on modifier. */
OperationKey modifier_key(&object->id,
DEPSNODE_TYPE_GEOMETRY,
DEG_OPCODE_GEOMETRY_MODIFIER,
md->name);
add_relation(cache_key,
modifier_key,
DEPSREL_TYPE_TIME,
"Cloth Cache -> Cloth");
}
/* Shapekeys */
void DepsgraphRelationBuilder::build_shapekeys(ID *obdata, Key *key)
{
@ -1413,6 +1432,10 @@ void DepsgraphRelationBuilder::build_obdata_geom(Main *bmain, Scene *scene, Obje
}
}
if (md->type == eModifierType_Cloth) {
build_cloth(scene, ob, md);
}
prev_mod_key = mod_key;
}
}

View File

@ -58,6 +58,7 @@ struct Main;
struct Mask;
struct Material;
struct MTex;
struct ModifierData;
struct MovieClip;
struct bNodeTree;
struct Object;
@ -205,6 +206,7 @@ struct DepsgraphRelationBuilder
void build_world(World *world);
void build_rigidbody(Scene *scene);
void build_particles(Scene *scene, Object *ob);
void build_cloth(Scene *scene, Object *object, ModifierData *md);
void build_ik_pose(Object *ob,
bPoseChannel *pchan,
bConstraint *con,

View File

@ -310,6 +310,7 @@ int WM_operator_confirm(struct bContext *C, struct wmOperator *op, const struct
struct MenuType *WM_menutype_find(const char *idname, bool quiet) RET_NULL
void WM_operator_stack_clear(struct wmWindowManager *wm) RET_NONE
void WM_operator_handlers_clear(wmWindowManager *wm, struct wmOperatorType *ot) RET_NONE
bool WM_operator_is_repeat(const struct bContext *C, const struct wmOperator *op) RET_ZERO;
void WM_autosave_init(wmWindowManager *wm) RET_NONE
void WM_jobs_kill_all_except(struct wmWindowManager *wm, void *owner) RET_NONE