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>2011-04-27 18:36:02 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-04-27 18:36:02 +0400
commit4e235c184b534d31b651ac0449a1b55a000639fc (patch)
tree9f6c464131b04b7f35f82c651ac9248cbab71866 /source/blender/editors/space_node/space_node.c
parentda376e0237517543aa21740ee2363234ee1c20ae (diff)
Blender modifications for Cycles integration.
Some notes about code status: * The Blender modifications were fairly quickly put together, much more code polish and work is needed to get this to a state where it can be committed to trunk. Files created with this version may not work in future versions. * Only simple path tracing is supported currently, but we intend to provide finer control, and more options where it makes sense. * For GPU rendering, only CUDA works currently. The intention is to have the same kernel code compile for C++/OpenCL/CUDA, some more work is needed to get OpenCL functional. * There are two shading backends: GPU compatible and Open Shading Language. Unfortunately, OSL only runs on the CPU currently, getting this to run on the GPU would be a major undertaking, and is unlikely to be supported soon. Additionally, it's not possible yet to write custom OSL shaders. * There is some code for adaptive subdivision and displacement, but it's far from finished. The intention is to eventually have a nice unified bump and displacement system. * The code currently has a number of fairly heavy dependencies: Boost, OpenImageIO, GLEW, GLUT, and optionally OSL, Partio. This makes it difficult to compile, we'll try to eliminate some, it may take a while before it becomes easy to compile this.
Diffstat (limited to 'source/blender/editors/space_node/space_node.c')
-rw-r--r--source/blender/editors/space_node/space_node.c22
1 files changed, 18 insertions, 4 deletions
diff --git a/source/blender/editors/space_node/space_node.c b/source/blender/editors/space_node/space_node.c
index 1c2f604a650..3147e5d7a38 100644
--- a/source/blender/editors/space_node/space_node.c
+++ b/source/blender/editors/space_node/space_node.c
@@ -34,10 +34,12 @@
#include <string.h>
#include <stdio.h>
+#include "DNA_lamp_types.h"
+#include "DNA_material_types.h"
#include "DNA_node_types.h"
#include "DNA_object_types.h"
-#include "DNA_material_types.h"
#include "DNA_scene_types.h"
+#include "DNA_world_types.h"
#include "MEM_guardedalloc.h"
@@ -252,9 +254,21 @@ static void node_area_refresh(const struct bContext *C, struct ScrArea *sa)
if(snode->nodetree) {
if(snode->treetype==NTREE_SHADER) {
- Material *ma= (Material *)snode->id;
- if(ma->use_nodes)
- ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER);
+ if(GS(snode->id->name) == ID_MA) {
+ Material *ma= (Material *)snode->id;
+ if(ma->use_nodes)
+ ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER);
+ }
+ else if(GS(snode->id->name) == ID_LA) {
+ Lamp *la= (Lamp *)snode->id;
+ if(la->use_nodes)
+ ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER);
+ }
+ else if(GS(snode->id->name) == ID_WO) {
+ World *wo= (World *)snode->id;
+ if(wo->use_nodes)
+ ED_preview_shader_job(C, sa, snode->id, NULL, NULL, 100, 100, PR_NODE_RENDER);
+ }
}
else if(snode->treetype==NTREE_COMPOSIT) {
Scene *scene= (Scene *)snode->id;