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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-07-11 11:51:04 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-08-12 05:10:14 +0400
commit87f75299e1b07fd026ecdfa1c993130a60d65280 (patch)
tree28195cd6d00694f8a66a803f62126ae28e250e49 /source/blender/makesrna/intern/rna_linestyle.c
parentd956a074e31b278d06c6ee4841ee735b90ba22ea (diff)
Implemented a basic framework for node-based shaders.
Shader nodes will be used to define materials for stroke rendering, so as to allow users to interactively configure textures.
Diffstat (limited to 'source/blender/makesrna/intern/rna_linestyle.c')
-rw-r--r--source/blender/makesrna/intern/rna_linestyle.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_linestyle.c b/source/blender/makesrna/intern/rna_linestyle.c
index 50b888b0247..f6f329e6b4d 100644
--- a/source/blender/makesrna/intern/rna_linestyle.c
+++ b/source/blender/makesrna/intern/rna_linestyle.c
@@ -87,6 +87,8 @@ EnumPropertyItem linestyle_geometry_modifier_type_items[] = {
#include "BKE_texture.h"
#include "BKE_depsgraph.h"
+#include "ED_node.h"
+
#include "RNA_access.h"
static StructRNA *rna_LineStyle_color_modifier_refine(struct PointerRNA *ptr)
@@ -283,6 +285,16 @@ static void rna_LineStyle_update(Main *UNUSED(bmain), Scene *UNUSED(scene), Poin
WM_main_add_notifier(NC_LINESTYLE, linestyle);
}
+static void rna_LineStyle_use_nodes_update(bContext *C, PointerRNA *ptr)
+{
+ FreestyleLineStyle *linestyle = (FreestyleLineStyle *)ptr->data;
+
+ if (linestyle->use_nodes && linestyle->nodetree == NULL)
+ ED_node_shader_default(C, &linestyle->id);
+
+ rna_LineStyle_update(CTX_data_main(C), CTX_data_scene(C), ptr);
+}
+
static LineStyleModifier *rna_LineStyle_color_modifier_add(FreestyleLineStyle *linestyle, ReportList *reports,
const char *name, int type)
{
@@ -1606,14 +1618,14 @@ static void rna_def_linestyle(BlenderRNA *brna)
/* nodes */
prop = RNA_def_property(srna, "node_tree", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "nodetree");
- RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node based textures");
+ RNA_def_property_ui_text(prop, "Node Tree", "Node tree for node-based shaders");
prop = RNA_def_property(srna, "use_nodes", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "use_nodes", 1);
RNA_def_property_clear_flag(prop, PROP_ANIMATABLE);
RNA_def_property_flag(prop, PROP_CONTEXT_UPDATE);
- RNA_def_property_ui_text(prop, "Use Nodes", "Use texture nodes for the line style");
- RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
+ RNA_def_property_ui_text(prop, "Use Nodes", "Use shader nodes for the line style");
+ RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_use_nodes_update");
}
void RNA_def_linestyle(BlenderRNA *brna)