[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [48516] trunk/blender/source/blender: Followup for r.48515
Joshua Leung
aligorith at gmail.com
Tue Jul 3 07:30:22 CEST 2012
Revision: 48516
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=48516
Author: aligorith
Date: 2012-07-03 05:30:19 +0000 (Tue, 03 Jul 2012)
Log Message:
-----------
Followup for r.48515
* Removed material driver creation hack. However, the textures one remains, as
texture eval isn't ready yet
* Shuffled some code
Modified Paths:
--------------
trunk/blender/source/blender/blenkernel/intern/depsgraph.c
trunk/blender/source/blender/editors/animation/drivers.c
Modified: trunk/blender/source/blender/blenkernel/intern/depsgraph.c
===================================================================
--- trunk/blender/source/blender/blenkernel/intern/depsgraph.c 2012-07-03 05:11:37 UTC (rev 48515)
+++ trunk/blender/source/blender/blenkernel/intern/depsgraph.c 2012-07-03 05:30:19 UTC (rev 48516)
@@ -348,8 +348,25 @@
}
/* XXX: forward def for material driver handling... */
-static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Material *ma);
+static void dag_add_material_nodetree_driver_relations(DagForest *dag, DagNode *node, bNodeTree *ntree);
+/* recursive handling for material drivers */
+static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Material *ma)
+{
+ /* material itself */
+ if (ma->adt) {
+ dag_add_driver_relation(ma->adt, dag, node, 1);
+ }
+
+ /* textures */
+ // TODO...
+ //dag_add_texture_driver_relations(DagForest *dag, DagNode *node, ID *id);
+
+ /* material's nodetree */
+ if (ma->nodetree) {
+ dag_add_material_nodetree_driver_relations(dag, node, ma->nodetree);
+ }
+}
/* recursive handling for material nodetree drivers */
static void dag_add_material_nodetree_driver_relations(DagForest *dag, DagNode *node, bNodeTree *ntree)
{
@@ -371,20 +388,8 @@
}
}
-/* recursive handling for material drivers */
-static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Material *ma)
-{
- /* material itself */
- if (ma->adt) {
- dag_add_driver_relation(ma->adt, dag, node, 1);
- }
-
- /* material's nodetree */
- if (ma->nodetree) {
- dag_add_material_nodetree_driver_relations(dag, node, ma->nodetree);
- }
-}
+
static void dag_add_collision_field_relation(DagForest *dag, Scene *scene, Object *ob, DagNode *node)
{
Base *base;
Modified: trunk/blender/source/blender/editors/animation/drivers.c
===================================================================
--- trunk/blender/source/blender/editors/animation/drivers.c 2012-07-03 05:11:37 UTC (rev 48515)
+++ trunk/blender/source/blender/editors/animation/drivers.c 2012-07-03 05:30:19 UTC (rev 48516)
@@ -416,6 +416,7 @@
char *basepath = RNA_path_from_ID_to_property(ptr, prop);
char *path = basepath; /* in case no remapping is needed */
+
/* Remapping will only be performed in the Properties Editor, as only this
* restricts the subspace of options to the 'active' data (a manageable state)
*/
@@ -426,23 +427,6 @@
if (ob && id) {
/* only id-types which can be remapped to go through objects should be considered */
switch (GS(id->name)) {
- case ID_MA: /* materials */
- {
- Material *ma = give_current_material(ob, ob->actcol);
-
- /* assumes: material will only be shown if it is active objects's active material it's ok */
- if ((ID *)ma == id) {
- /* create new path */
- // TODO: use RNA path functions to construct instead?
- path = BLI_sprintfN("material_slots[\"%s\"].material.%s",
- ma->id.name + 2, basepath);
-
- /* free old one */
- MEM_freeN(basepath);
- }
- }
- break;
-
case ID_TE: /* textures */
{
Material *ma = give_current_material(ob, ob->actcol);
@@ -452,6 +436,7 @@
if ((ID *)tex == id) {
/* create new path */
// TODO: use RNA path functions to construct step by step instead?
+ // FIXME: maybe this isn't even needed anymore...
path = BLI_sprintfN("material_slots[\"%s\"].material.texture_slots[\"%s\"].texture.%s",
ma->id.name + 2, tex->id.name + 2, basepath);
More information about the Bf-blender-cvs
mailing list