[Bf-blender-cvs] [0df85e0] depsgraph_refactor: Removed deprecated build code, all the functions have now been ported to the new 2-pass build system.

Lukas Tönne noreply at git.blender.org
Sat Apr 12 09:34:32 CEST 2014


Commit: 0df85e04cd9362c5fcb4431706ae84bf0c2cc58e
Author: Lukas Tönne
Date:   Sat Apr 12 09:28:14 2014 +0200
https://developer.blender.org/rB0df85e04cd9362c5fcb4431706ae84bf0c2cc58e

Removed deprecated build code, all the functions have now been ported to
the new 2-pass build system.

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

M	source/blender/depsgraph/intern/depsgraph_build.cpp
D	source/blender/depsgraph/intern/depsgraph_build_deprecated.cpp

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

diff --git a/source/blender/depsgraph/intern/depsgraph_build.cpp b/source/blender/depsgraph/intern/depsgraph_build.cpp
index 1b7940b..8903104 100644
--- a/source/blender/depsgraph/intern/depsgraph_build.cpp
+++ b/source/blender/depsgraph/intern/depsgraph_build.cpp
@@ -351,9 +351,6 @@ void DEG_graph_build_from_scene(Depsgraph *graph, Main *bmain, Scene *scene)
 	relation_builder.build_scene(scene);
 	
 #if 0
-	/* build graph for scene and all attached data */
-	DepsNode *scene_node = deg_build_scene_graph(graph, bmain, scene);
-	
 	/* ensure that all implicit constraints between nodes are satisfied */
 	DEG_graph_validate_links(graph);
 	
diff --git a/source/blender/depsgraph/intern/depsgraph_build_deprecated.cpp b/source/blender/depsgraph/intern/depsgraph_build_deprecated.cpp
deleted file mode 100644
index ca447df..0000000
--- a/source/blender/depsgraph/intern/depsgraph_build_deprecated.cpp
+++ /dev/null
@@ -1,1609 +0,0 @@
-/*
- * ***** 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_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_types.h"
-#include "depsgraph_build.h"
-#include "depsgraph_eval.h"
-#include "depsgraph_intern.h"
-
-#include "depsgraph_util_string.h"
-
-#include "stubs.h" // XXX: REMOVE THIS INCLUDE ONCE DEPSGRAPH REFACTOR PROJECT IS DONE!!!
-
-/* ************************************************* */
-/* AnimData */
-
-/* Build graph node(s) for Driver
- * < id: ID-Block that driver is attached to
- * < fcu: Driver-FCurve
- */
-static DepsNode *deg_build_driver_rel(Depsgraph *graph, ID *id, FCurve *fcu)
-{
-	ChannelDriver *driver = fcu->driver;
-	DriverVar *dvar;
-	
-	OperationDepsNode *driver_op = NULL;
-	DepsNode *driver_node = NULL; /* same as driver_op, just cast to the relevant type */
-	DepsNode *affected_node = NULL;
-	
-	
-	/* create data node for this driver ..................................... */
-	string name = string_format("Driver @ %p", driver);
-	
-	driver_op = graph->add_operation(id, NULL, DEPSNODE_TYPE_OP_DRIVER,
-	                                 DEPSOP_TYPE_EXEC, BKE_animsys_eval_driver,
-	                                 name);
-	driver_node = (DepsNode *)driver_op;
-	
-	/* RNA pointer to driver, to provide as context for execution */
-	RNA_pointer_create(id, &RNA_FCurve, fcu, &driver_op->ptr);
-	
-	/* tag "scripted expression" drivers as needing Python (due to GIL issues, etc.) */
-	if (driver->type == DRIVER_TYPE_PYTHON) {
-		driver_node->flag |= DEPSOP_FLAG_USES_PYTHON;
-	}
-	
-	/* create dependency between driver and data affected by it */
-	// XXX: this should return a parameter context for dealing with this...
-	affected_node = graph->get_node_from_rna_path(id, fcu->rna_path);
-	if (affected_node) {
-		/* make data dependent on driver */
-		graph->add_new_relation(driver_node, affected_node, DEPSREL_TYPE_DRIVER, 
-		                     "[Driver -> Data] DepsRel");
-		
-		/* ensure that affected prop's update callbacks will be triggered once done */
-		// TODO: implement this once the functionality to add these links exists in RNA
-		// XXX: the data itself could also set this, if it were to be truly initialised later?
-	}
-	
-	/* loop over variables to get the target relationships */
-	for (dvar = (DriverVar *)driver->variables.first; dvar; dvar = dvar->next) {
-		/* only used targets */
-		DRIVER_TARGETS_USED_LOOPER(dvar) 
-		{
-			if (dtar->id) {
-				DepsNode *target_node = NULL;
-				
-				/* special handling for directly-named bones... */
-				if ((dtar->flag & DTAR_FLAG_STRUCT_REF) && (dtar->pchan_name[0])) {
-					Object *ob = (Object *)dtar->id;
-					bPoseChannel *pchan = BKE_pose_channel_find_name(ob->pose, dtar->pchan_name);
-					
-					/* get node associated with bone */
-					target_node = graph->get_node(dtar->id, pchan->name, DEPSNODE_TYPE_BONE, NULL);
-				}
-				else {
-					/* resolve path to get node... */
-					target_node = graph->get_node_from_rna_path(dtar->id, dtar->rna_path);
-				}
-				
-				/* make driver dependent on this node */
-				graph->add_new_relation(target_node, driver_node, DEPSREL_TYPE_DRIVER_TARGET,
-				                     "[Target -> Driver] DepsRel");
-			}
-		}
-		DRIVER_TARGETS_LOOPER_END
-	}
-	
-	/* return driver node created */
-	return driver_node;
-}
-
-/* Build graph nodes for AnimData block 
- * < scene_node: Scene that ID-block this lives on belongs to
- * < id: ID-Block which hosts the AnimData
- */
-static void deg_build_animdata_graph(Depsgraph *graph, Scene *scene, ID *id)
-{
-	AnimData *adt = BKE_animdata_from_id(id);
-	DepsNode *adt_node = NULL;
-	FCurve *fcu;
-	
-	if (adt == NULL)
-		return;
-	
-	/* animation */
-	if (adt->action || adt->nla_tracks.first) {
-		DepsNode *time_src;
-		
-		/* create "animation" data node for this block */
-		adt_node = graph->get_node(id, NULL, DEPSNODE_TYPE_ANIMATION, "Animation");
-		
-		/* wire up dependency to time source */
-		// NOTE: this assumes that timesource was already added as one of first steps!
-		time_src = graph->find_node(NULL, NULL, DEPSNODE_TYPE_TIMESOURCE, NULL);
-		graph->add_new_relation(time_src, adt_node, DEPSREL_TYPE_TIME, 
-		                     "[TimeSrc -> Animation] DepsRel");
-		                     
-		// XXX: Hook up specific update callbacks for special properties which may need it...
-	}
-	
-	/* drivers */
-	for (fcu = (FCurve *)adt->drivers.first; fcu; fcu = fcu->next) {
-		/* create driver */
-		DepsNode *driver_node = deg_build_driver_rel(graph, id, fcu);
-		
-		/* hook up update callback associated with F-Curve */
-		// ...
-		
-		/* prevent driver from occurring before own animation... */
-		// NOTE: probably not strictly needed (anim before parameters anyway)...
-		if (adt_node) {
-			graph->add_new_relation(adt_node, driver_node, DEPSREL_TYPE_OPERATION, 
-			                     "[AnimData Before Drivers] DepsRel");
-		}
-	}
-}
-
-
-/* ************************************************* */
-/* Rigs */
-
-/* Constraints - Objects or Bones 
- * < container: (ComponentDepsNode) component that constraint nodes will operate within
- *               Typically this will either be Transform or Bone components.
- */
-static void deg_build_constraints_graph(Depsgraph *graph, Scene *scene, 
-                                        Object *ob, bPoseChannel *pchan,
-                                        ListBase *constraints, 
-                                        DepsNode *container)
-{
-	OperationDepsNode *constraintStackOp;
-	DepsNode *constraintStackNode;
-	eDepsNode_Type stackNodeType;
-	string subdata_name;
-	
-	bConstraint *con;
-	
-	
-	/* == Constraints Graph Notes ==
-	 * For constraints, we currently only add a operation node to the Transform
-	 * or Bone components (depending on whichever type of owner we have).
-	 * This represents the entire constraints stack, which is for now just
-	 * executed as a single monolithic block. At least initially, this should
-	 * be sufficient for ensuring that the porting/refactoring process remains
-	 * manageable. 
-	 * 
-	 * However, when the time comes for developing "node-based" constraints,
-	 * we'll need to split this up into pre/post nodes for "constraint stack
-	 * evaluation" + operation nodes for each constraint (i.e. the contents
-	 * of the loop body used in the current "solve_constraints()" operation).
-	 *
-	 * -- Aligorith, August 2013 
-	 */
-	
-	/* create node for constraint stack */
-	if (pchan) {
-		stackNodeType = DEPSNODE_TYPE_OP_BONE;
-		subdata_name = pchan->name;
-	}
-	else {
-		stackNodeType = DEPSNODE_TYPE_OP_TRANSFORM;
-	}
-	
-	constraintStackOp = graph->add_operation(&ob->id, subdata_name, stackNodeType,
-	                                         DEPSOP_TYP

@@ Diff output truncated at 10240 characters. @@




More information about the Bf-blender-cvs mailing list