diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-10-19 18:03:02 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-10-19 18:03:02 +0400 |
commit | dd96bf6168b60639701dd0ff512806e3fe1b65d0 (patch) | |
tree | 3873125b4f2d05eddfd25cc9e954c6a53149a60b /source/blender/blenkernel | |
parent | 51f11abe45097cbba59626ede06c3832bcc522e2 (diff) |
- added xmirror to the weightpaint options
- made texture_slot return the texture slot for the node texture
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_material.h | 1 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/material.c | 12 |
2 files changed, 13 insertions, 0 deletions
diff --git a/source/blender/blenkernel/BKE_material.h b/source/blender/blenkernel/BKE_material.h index 85316dddedf..3ea7cae2c86 100644 --- a/source/blender/blenkernel/BKE_material.h +++ b/source/blender/blenkernel/BKE_material.h @@ -47,6 +47,7 @@ void test_object_materials(struct ID *id); void init_material(struct Material *ma); struct Material *add_material(char *name); struct Material *copy_material(struct Material *ma); +struct Material *give_node_material(struct Material *ma); /* returns node material or self */ void make_local_material(struct Material *ma); void automatname(struct Material *); diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c index ab700ab283c..c2260e1e761 100644 --- a/source/blender/blenkernel/intern/material.c +++ b/source/blender/blenkernel/intern/material.c @@ -485,6 +485,18 @@ ID *material_from(Object *ob, int act) else return ob->data; } +Material *give_node_material(Material *ma) +{ + if(ma && ma->use_nodes && ma->nodetree) { + bNode *node= nodeGetActiveID(ma->nodetree, ID_MA); + + if(node) + return (Material *)node->id; + } + + return NULL; +} + /* GS reads the memory pointed at in a specific ordering. There are, * however two definitions for it. I have jotted them down here, both, * but I think the first one is actually used. The thing is that |