[Bf-blender-cvs] [eea939f] depsgraph_refactor: Merge branch 'master' into depsgraph_refactor

Sergey Sharybin noreply at git.blender.org
Wed Apr 1 15:52:50 CEST 2015


Commit: eea939fe18ebebbe465d6746d6eebd7e98b56e75
Author: Sergey Sharybin
Date:   Wed Apr 1 16:40:39 2015 +0500
Branches: depsgraph_refactor
https://developer.blender.org/rBeea939fe18ebebbe465d6746d6eebd7e98b56e75

Merge branch 'master' into depsgraph_refactor

Conflicts:
	source/blender/blenkernel/intern/scene.c
	source/blender/modifiers/intern/MOD_util.h

===================================================================



===================================================================

diff --cc source/blender/blenkernel/BKE_armature.h
index 5732785,de767d3..5bdf360
--- a/source/blender/blenkernel/BKE_armature.h
+++ b/source/blender/blenkernel/BKE_armature.h
@@@ -145,54 -142,6 +142,55 @@@ void b_bone_spline_setup(struct bPoseCh
  #define PBONE_SELECTABLE(arm, bone) \
  	(PBONE_VISIBLE(arm, bone) && !((bone)->flag & BONE_UNSELECTABLE))
  
 +/* Evaluation helpers */
 +struct bKinematicConstraint;
++struct bPose;
 +struct bSplineIKConstraint;
 +struct EvaluationContext;
 +
 +struct bPoseChannel *BKE_armature_ik_solver_find_root(struct bPoseChannel *pchan,
 +                                                      struct bKinematicConstraint *data);
 +struct bPoseChannel* BKE_armature_splineik_solver_find_root(struct bPoseChannel *pchan,
 +                                                            struct bSplineIKConstraint *data);
 +
 +void BKE_pose_splineik_init_tree(struct Scene *scene, struct Object *ob, float ctime);
 +void BKE_splineik_execute_tree(struct Scene *scene, struct Object *ob, struct bPoseChannel *pchan_root, float ctime);
 +
 +void BKE_pose_eval_init(struct EvaluationContext *eval_ctx,
 +                        struct Scene *scene,
 +                        struct Object *ob,
 +                        struct bPose *pose);
 +
 +void BKE_pose_eval_bone(struct EvaluationContext *eval_ctx,
 +                        struct Scene *scene,
 +                        struct Object *ob,
 +                        struct bPoseChannel *pchan);
 +
 +void BKE_pose_constraints_evaluate(struct EvaluationContext *eval_ctx,
 +                                   struct Object *ob,
 +                                   struct bPoseChannel *pchan);
 +
 +void BKE_pose_bone_done(struct EvaluationContext *eval_ctx,
 +                        struct bPoseChannel *pchan);
 +
 +void BKE_pose_iktree_evaluate(struct EvaluationContext *eval_ctx,
 +                              struct Scene *scene,
 +                              struct Object *ob,
 +                              struct bPoseChannel *rootchan);
 +
 +void BKE_pose_splineik_evaluate(struct EvaluationContext *eval_ctx,
 +                                struct Scene *scene,
 +                                struct Object *ob,
 +                                struct bPoseChannel *rootchan);
 +
 +void BKE_pose_eval_flush(struct EvaluationContext *eval_ctx,
 +                         struct Scene *scene,
 +                         struct Object *ob,
 +                         struct bPose *pose);
 +
 +void BKE_pose_eval_proxy_copy(struct EvaluationContext *eval_ctx,
 +                              struct Object *ob);
 +
  #ifdef __cplusplus
  }
  #endif
diff --cc source/blender/blenkernel/intern/scene.c
index e3eb306,f51dadf..70a7058
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@@ -1715,19 -1688,9 +1715,19 @@@ void BKE_scene_update_tagged(Evaluation
  	 *
  	 * in the future this should handle updates for all datablocks, not
  	 * only objects and scenes. - brecht */
 -	scene_update_tagged_recursive(eval_ctx, bmain, scene, scene);
 +#ifdef WITH_LEGACY_DEPSGRAPH
 +	if (use_new_eval) {
 +		DEG_evaluate_on_refresh(eval_ctx, scene->depsgraph, scene);
 +	}
 +	else {
 +		scene_update_tagged_recursive(eval_ctx, bmain, scene, scene);
 +	}
 +#else
 +	DEG_evaluate_on_refresh(eval_ctx, bmain, scene->depsgraph, scene);
 +#endif
 +
  	/* update sound system animation (TODO, move to depsgraph) */
- 	sound_update_scene(bmain, scene);
+ 	BKE_sound_update_scene(bmain, scene);
  
  	/* extra call here to recalc scene animation (for sequencer) */
  	{
@@@ -1815,12 -1767,9 +1815,12 @@@ void BKE_scene_update_for_newframe_ex(E
  	 * this needs to be done on start frame but animation playback usually starts one frame later
  	 * we need to do it here to avoid rebuilding the world on every simulation change, which can be very expensive
  	 */
 -	scene_rebuild_rbw_recursive(sce, ctime);
 -
 +	if (!use_new_eval) {
 +		scene_rebuild_rbw_recursive(sce, ctime);
 +	}
 +#endif
 +	
- 	sound_set_cfra(sce->r.cfra);
+ 	BKE_sound_set_cfra(sce->r.cfra);
  	
  	/* clear animation overrides */
  	/* XXX TODO... */
@@@ -1868,32 -1809,14 +1868,32 @@@
  
  	/* run rigidbody sim */
  	/* NOTE: current position is so that rigidbody sim affects other objects, might change in the future */
 -	scene_do_rb_simulation_recursive(sce, ctime);
 -
 +#ifdef WITH_LEGACY_DEPSGRAPH
 +	if (!use_new_eval) {
 +		scene_do_rb_simulation_recursive(sce, ctime);
 +	}
 +#endif
 +	
  	/* BKE_object_handle_update() on all objects, groups and sets */
 -	scene_update_tagged_recursive(eval_ctx, bmain, sce, sce);
 +#ifdef WITH_LEGACY_DEPSGRAPH
 +	if (use_new_eval) {
 +		DEG_evaluate_on_framechange(eval_ctx, bmain, sce->depsgraph, ctime, lay);
 +	}
 +	else {
 +		scene_update_tagged_recursive(eval_ctx, bmain, sce, sce);
 +	}
 +#else
 +	DEG_evaluate_on_framechange(eval_ctx, bmain, sce->depsgraph, ctime, lay);
 +#endif
 +
  	/* update sound system animation (TODO, move to depsgraph) */
- 	sound_update_scene(bmain, sce);
+ 	BKE_sound_update_scene(bmain, sce);
  
 -	scene_depsgraph_hack(eval_ctx, sce, sce);
 +#ifdef WITH_LEGACY_DEPSGRAPH
 +	if (!use_new_eval) {
 +		scene_depsgraph_hack(eval_ctx, sce, sce);
 +	}
 +#endif
  
  	/* notify editors and python about recalc */
  	BLI_callback_exec(bmain, &sce->id, BLI_CB_EVT_SCENE_UPDATE_POST);
diff --cc source/blender/depsgraph/intern/depsgraph_build_relations.cpp
index 3f6af4c,0000000..6258314
mode 100644,000000..100644
--- a/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build_relations.cpp
@@@ -1,1781 -1,0 +1,1781 @@@
 +/*
 + * ***** BEGIN GPL LICENSE BLOCK *****
 + *
 + * This program is free software; you can redistribute it and/or
 + * modify it under the terms of the GNU General Public License
 + * as published by the Free Software Foundation; either version 2
 + * of the License, or (at your option) any later version.
 + *
 + * This program is distributed in the hope that it will be useful,
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 + * GNU General Public License for more details.
 + *
 + * You should have received a copy of the GNU General Public License
 + * along with this program; if not, write to the Free Software Foundation,
 + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
 + *
 + * The Original Code is Copyright (C) 2013 Blender Foundation.
 + * All rights reserved.
 + *
 + * Original Author: Joshua Leung
 + * Contributor(s): Based on original depsgraph.c code - Blender Foundation (2005-2013)
 + *
 + * ***** END GPL LICENSE BLOCK *****
 + *
 + * Methods for constructing depsgraph
 + */
 +
 +#include <stdio.h>
 +#include <stdlib.h>
 +#include <string.h>
 +
 +#include "MEM_guardedalloc.h"
 +
 +extern "C" {
 +#include "BLI_blenlib.h"
 +#include "BLI_string.h"
 +#include "BLI_utildefines.h"
 +
 +#include "DNA_action_types.h"
 +#include "DNA_anim_types.h"
 +#include "DNA_armature_types.h"
 +#include "DNA_camera_types.h"
 +#include "DNA_constraint_types.h"
 +#include "DNA_curve_types.h"
 +#include "DNA_effect_types.h"
 +#include "DNA_gpencil_types.h"
 +#include "DNA_group_types.h"
 +#include "DNA_key_types.h"
 +#include "DNA_lamp_types.h"
 +#include "DNA_material_types.h"
 +#include "DNA_mesh_types.h"
 +#include "DNA_meta_types.h"
 +#include "DNA_node_types.h"
 +#include "DNA_particle_types.h"
 +#include "DNA_object_types.h"
 +#include "DNA_rigidbody_types.h"
 +#include "DNA_scene_types.h"
 +#include "DNA_texture_types.h"
 +#include "DNA_world_types.h"
 +
 +#include "BKE_action.h"
 +#include "BKE_armature.h"
 +#include "BKE_animsys.h"
 +#include "BKE_constraint.h"
 +#include "BKE_curve.h"
 +#include "BKE_effect.h"
 +#include "BKE_fcurve.h"
 +#include "BKE_group.h"
 +#include "BKE_key.h"
 +#include "BKE_library.h"
 +#include "BKE_main.h"
 +#include "BKE_material.h"
 +#include "BKE_mball.h"
 +#include "BKE_modifier.h"
 +#include "BKE_node.h"
 +#include "BKE_object.h"
 +#include "BKE_particle.h"
 +#include "BKE_rigidbody.h"
 +#include "BKE_sound.h"
 +#include "BKE_texture.h"
 +#include "BKE_tracking.h"
 +#include "BKE_world.h"
 +
 +#include "DEG_depsgraph.h"
 +#include "DEG_depsgraph_build.h"
 +
 +#include "RNA_access.h"
 +#include "RNA_types.h"
 +} /* extern "C" */
 +
 +#include "depsnode.h"
 +#include "depsnode_component.h"
 +#include "depsnode_operation.h"
 +#include "depsgraph_build.h"
 +#include "depsgraph_debug.h"
 +#include "depsgraph_eval.h"
 +#include "depsgraph_intern.h"
 +#include "depsgraph_types.h"
 +
 +#include "depsgraph_util_pchanmap.h"
 +
 +/* ***************** */
 +/* Relations Builder */
 +
 +/* **** General purpose functions ****  */
 +
 +RNAPathKey::RNAPathKey(ID *id, const string &path) :
 +    id(id)
 +{
 +	/* create ID pointer for root of path lookup */
 +	PointerRNA id_ptr;
 +	RNA_id_pointer_create(id, &id_ptr);
 +	/* try to resolve path... */
 +	if (!RNA_path_resolve(&id_ptr, path.c_str(), &this->ptr, &this->prop)) {
 +		this->ptr = PointerRNA_NULL;
 +		this->prop = NULL;
 +	}
 +}
 +
 +DepsgraphRelationBuilder::DepsgraphRelationBuilder(Depsgraph *graph) :
 +    m_graph(graph)
 +{
 +}
 +
 +RootDepsNode *DepsgraphRelationBuilder::find_node(const RootKey &key) const
 +{
 +	(void)key;
 +	BLI_assert(!"Doesn't seem to be correct");
 +	return m_graph->root_node;
 +}
 +
 +TimeSourceDepsNode *DepsgraphRelationBuilder::find_node(
 +        const TimeSourceKey &key) const
 +{
 +	if (key.id) {
 +		/* XXX TODO */
 +		return NULL;
 +	}
 +	else {
 +		return m_graph->root_node->time_source;
 +	}
 +}
 +
 +ComponentDepsNode *DepsgraphRelationBuilder::find_node(
 +        const ComponentKey &key) const
 +{
 +	IDDepsNode *id_node = m_graph->find_id_node(key.id);
 +	if (!id_node) {
 +		fprintf(stderr, "find_node component: Could not find ID %s\n",
 +		        (key.id != NULL) ? key.id->name : "<null>");
 +		return NULL;
 +	}
 +
 +	ComponentDepsNode *node = id_node->find_component(key.type, key.name);
 +	return node;
 +}
 +
 +OperationDepsNode *DepsgraphRelationBuilder::find_node(
 +        const OperationKey &key) const
 +{
 +	IDDepsNode *id_node = m_graph->find_id_node(key.id);
 +	if 

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list