Implemented a basic framework for node-based shaders.
[blender-staging.git] / source / blender / nodes / shader / node_shader_tree.c
index 4288b8fbcdcf0c973fb4371af8b94b841442dd5b..629bd7eeea6bc715674dad9e61618b2d45b8c7af 100644 (file)
@@ -38,6 +38,7 @@
 #include "DNA_scene_types.h"
 #include "DNA_space_types.h"
 #include "DNA_world_types.h"
+#include "DNA_linestyle_types.h"
 
 #include "BLI_listbase.h"
 #include "BLI_math.h"
@@ -97,6 +98,16 @@ static void shader_get_from_context(const bContext *C, bNodeTreeType *UNUSED(tre
                        }
                }
        }
+#ifdef WITH_FREESTYLE
+       else if (snode->shaderfrom == SNODE_SHADER_LINESTYLE) {
+               FreestyleLineStyle *linestyle = CTX_data_linestyle_from_scene(scene);
+               if (linestyle) {
+                       *r_from = NULL;
+                       *r_id = &linestyle->id;
+                       *r_ntree = linestyle->nodetree;
+               }
+       }
+#endif
        else { /* SNODE_SHADER_WORLD */
                if (scene->world) {
                        *r_from = NULL;