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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-10-17 17:32:43 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-10-17 17:32:43 +0400
commit20585a8b8dc50bc1a090f2d44066540839ee7303 (patch)
tree508d1240624ed64ae88ee824a52efd08e8a810e2 /source/blender/blenkernel
parentd08b06f773c754c70886901b8964c8093f920a75 (diff)
Render: local light group option for materials, blender internal feature from
the render branch. When a material is linked in and has a light group override, this can now use a local group in the scene file, by replacing the linked light group with a local group that has the same name. A use case might be controlling the specular highlight on linked character's eyes per scene. Patch from render branch by Pablo Vazquez.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/intern/material.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/source/blender/blenkernel/intern/material.c b/source/blender/blenkernel/intern/material.c
index bea0e33da9a..7d5ed058cca 100644
--- a/source/blender/blenkernel/intern/material.c
+++ b/source/blender/blenkernel/intern/material.c
@@ -38,6 +38,7 @@
#include "DNA_anim_types.h"
#include "DNA_curve_types.h"
+#include "DNA_group_types.h"
#include "DNA_material_types.h"
#include "DNA_mesh_types.h"
#include "DNA_meshdata_types.h"
@@ -980,6 +981,15 @@ static void do_init_render_material(Material *ma, int r_mode, float *amb)
/* parses the geom+tex nodes */
if (ma->nodetree && ma->use_nodes)
ntreeShaderGetTexcoMode(ma->nodetree, r_mode, &ma->texco, &ma->mode_l);
+
+ /* local group override */
+ if((ma->shade_flag & MA_GROUP_LOCAL) && ma->id.lib && ma->group && ma->group->id.lib) {
+ Group *group;
+
+ for(group= G.main->group.first; group; group= group->id.next)
+ if(!group->id.lib && strcmp(group->id.name, ma->group->id.name) == 0)
+ ma->group = group;
+ }
}
static void init_render_nodetree(bNodeTree *ntree, Material *basemat, int r_mode, float *amb)