Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoshua Leung <aligorith@gmail.com>2012-07-03 09:30:19 +0400
committerJoshua Leung <aligorith@gmail.com>2012-07-03 09:30:19 +0400
commitd58cb1beaa20ca7803a5adaf5ebb1e9ccfc79970 (patch)
tree19b36d283da021c52a085a368e1cab6cf625b1c6
parentc960d1692f4003c186b616806aa0c79e71ce4cb5 (diff)
Followup for r.48515
* Removed material driver creation hack. However, the textures one remains, as texture eval isn't ready yet * Shuffled some code
-rw-r--r--source/blender/blenkernel/intern/depsgraph.c7
-rw-r--r--source/blender/editors/animation/drivers.c19
2 files changed, 8 insertions, 18 deletions
diff --git a/source/blender/blenkernel/intern/depsgraph.c b/source/blender/blenkernel/intern/depsgraph.c
index 99c3b17dee2..65d36d665db 100644
--- a/source/blender/blenkernel/intern/depsgraph.c
+++ b/source/blender/blenkernel/intern/depsgraph.c
@@ -66,6 +66,7 @@
#include "BKE_library.h"
#include "BKE_main.h"
#include "BKE_node.h"
+#include "BKE_material.h"
#include "BKE_mball.h"
#include "BKE_modifier.h"
#include "BKE_object.h"
@@ -311,7 +312,7 @@ static void dag_add_driver_relation(AnimData *adt, DagForest *dag, DagNode *node
for (fcu = adt->drivers.first; fcu; fcu = fcu->next) {
ChannelDriver *driver = fcu->driver;
DriverVar *dvar;
- int isdata_fcu = isdata || (fcu->rna_path && strstr(fcu->rna_path, "modifiers["));
+ int isdata_fcu = (isdata) || (fcu->rna_path && strstr(fcu->rna_path, "modifiers["));
/* loop over variables to get the target relationships */
for (dvar = driver->variables.first; dvar; dvar = dvar->next) {
@@ -379,6 +380,10 @@ static void dag_add_material_driver_relations(DagForest *dag, DagNode *node, Mat
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);
diff --git a/source/blender/editors/animation/drivers.c b/source/blender/editors/animation/drivers.c
index 4a5966948ae..672e11ac613 100644
--- a/source/blender/editors/animation/drivers.c
+++ b/source/blender/editors/animation/drivers.c
@@ -416,6 +416,7 @@ static char *get_driver_path_hack(bContext *C, PointerRNA *ptr, PropertyRNA *pro
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 @@ static char *get_driver_path_hack(bContext *C, PointerRNA *ptr, PropertyRNA *pro
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 @@ static char *get_driver_path_hack(bContext *C, PointerRNA *ptr, PropertyRNA *pro
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);