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:
authorAntony Riakiotakis <kalast@gmail.com>2014-09-08 20:15:42 +0400
committerAntony Riakiotakis <kalast@gmail.com>2014-09-08 20:15:42 +0400
commitd9ffc99e66d659ac887d801b9cc071b4c3f9b8ab (patch)
treed88e83b5a9edab115081641d26c811b6aa22296a /source/blender/makesrna/intern/rna_linestyle.c
parent551ebaa3dd758bc1975548c28766bfa3159d3846 (diff)
parentb1490e39dd1017e51984d8a34d226e869bbb25df (diff)
Merge branch 'master' into soc-2014-viewport_fxsoc-2014-viewport_fx
I have resolved some differences, for instance selection code which was more or less a stub, to be the same as master. This will have to be fixed later. Conflicts: CMakeLists.txt intern/ghost/CMakeLists.txt intern/ghost/intern/GHOST_SystemWin32.cpp intern/ghost/intern/GHOST_Window.cpp intern/ghost/intern/GHOST_WindowWin32.cpp intern/ghost/intern/GHOST_WindowX11.cpp source/blender/blenlib/BLI_math_matrix.h source/blender/blenlib/intern/math_matrix.c source/blender/gpu/CMakeLists.txt source/blender/gpu/GPU_select.h source/blender/gpu/intern/gpu_buffers.c source/blender/gpu/intern/gpu_draw.c source/blender/gpu/intern/gpu_extensions.c source/blender/gpu/intern/gpu_select.c source/blender/gpu/shaders/gpu_shader_simple_vert.glsl source/blender/nodes/CMakeLists.txt
Diffstat (limited to 'source/blender/makesrna/intern/rna_linestyle.c')
-rw-r--r--source/blender/makesrna/intern/rna_linestyle.c38
1 files changed, 25 insertions, 13 deletions
diff --git a/source/blender/makesrna/intern/rna_linestyle.c b/source/blender/makesrna/intern/rna_linestyle.c
index faff39e679a..96b81f12620 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,10 +285,20 @@ 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)
+ BKE_linestyle_default_shader(C, linestyle);
+
+ 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)
{
- LineStyleModifier *modifier = BKE_add_linestyle_color_modifier(linestyle, name, type);
+ LineStyleModifier *modifier = BKE_linestyle_color_modifier_add(linestyle, name, type);
if (!modifier) {
BKE_report(reports, RPT_ERROR, "Failed to add the color modifier");
@@ -304,7 +316,7 @@ static void rna_LineStyle_color_modifier_remove(FreestyleLineStyle *linestyle, R
{
LineStyleModifier *modifier = modifier_ptr->data;
- if (BKE_remove_linestyle_color_modifier(linestyle, modifier) == -1) {
+ if (BKE_linestyle_color_modifier_remove(linestyle, modifier) == -1) {
BKE_reportf(reports, RPT_ERROR, "Color modifier '%s' could not be removed", modifier->name);
return;
}
@@ -318,7 +330,7 @@ static void rna_LineStyle_color_modifier_remove(FreestyleLineStyle *linestyle, R
static LineStyleModifier *rna_LineStyle_alpha_modifier_add(FreestyleLineStyle *linestyle, ReportList *reports,
const char *name, int type)
{
- LineStyleModifier *modifier = BKE_add_linestyle_alpha_modifier(linestyle, name, type);
+ LineStyleModifier *modifier = BKE_linestyle_alpha_modifier_add(linestyle, name, type);
if (!modifier) {
BKE_report(reports, RPT_ERROR, "Failed to add the alpha modifier");
@@ -336,7 +348,7 @@ static void rna_LineStyle_alpha_modifier_remove(FreestyleLineStyle *linestyle, R
{
LineStyleModifier *modifier = modifier_ptr->data;
- if (BKE_remove_linestyle_alpha_modifier(linestyle, modifier) == -1) {
+ if (BKE_linestyle_alpha_modifier_remove(linestyle, modifier) == -1) {
BKE_reportf(reports, RPT_ERROR, "Alpha modifier '%s' could not be removed", modifier->name);
return;
}
@@ -350,7 +362,7 @@ static void rna_LineStyle_alpha_modifier_remove(FreestyleLineStyle *linestyle, R
static LineStyleModifier *rna_LineStyle_thickness_modifier_add(FreestyleLineStyle *linestyle, ReportList *reports,
const char *name, int type)
{
- LineStyleModifier *modifier = BKE_add_linestyle_thickness_modifier(linestyle, name, type);
+ LineStyleModifier *modifier = BKE_linestyle_thickness_modifier_add(linestyle, name, type);
if (!modifier) {
BKE_report(reports, RPT_ERROR, "Failed to add the thickness modifier");
@@ -368,7 +380,7 @@ static void rna_LineStyle_thickness_modifier_remove(FreestyleLineStyle *linestyl
{
LineStyleModifier *modifier = modifier_ptr->data;
- if (BKE_remove_linestyle_thickness_modifier(linestyle, modifier) == -1) {
+ if (BKE_linestyle_thickness_modifier_remove(linestyle, modifier) == -1) {
BKE_reportf(reports, RPT_ERROR, "Thickness modifier '%s' could not be removed", modifier->name);
return;
}
@@ -382,7 +394,7 @@ static void rna_LineStyle_thickness_modifier_remove(FreestyleLineStyle *linestyl
static LineStyleModifier *rna_LineStyle_geometry_modifier_add(FreestyleLineStyle *linestyle, ReportList *reports,
const char *name, int type)
{
- LineStyleModifier *modifier = BKE_add_linestyle_geometry_modifier(linestyle, name, type);
+ LineStyleModifier *modifier = BKE_linestyle_geometry_modifier_add(linestyle, name, type);
if (!modifier) {
BKE_report(reports, RPT_ERROR, "Failed to add the geometry modifier");
@@ -400,7 +412,7 @@ static void rna_LineStyle_geometry_modifier_remove(FreestyleLineStyle *linestyle
{
LineStyleModifier *modifier = modifier_ptr->data;
- if (BKE_remove_linestyle_geometry_modifier(linestyle, modifier) == -1) {
+ if (BKE_linestyle_geometry_modifier_remove(linestyle, modifier) == -1) {
BKE_reportf(reports, RPT_ERROR, "Geometry modifier '%s' could not be removed", modifier->name);
return;
}
@@ -500,7 +512,7 @@ static void rna_def_linestyle_mtex(BlenderRNA *brna)
prop = RNA_def_property(srna, "use_tips", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "texflag", MTEX_TIPS);
- RNA_def_property_ui_text(prop, "Use tips", "Lower half of the texture is for tips of the stroke");
+ RNA_def_property_ui_text(prop, "Use Tips", "Lower half of the texture is for tips of the stroke");
RNA_def_property_update(prop, 0, "rna_LineStyle_update");
prop = RNA_def_property(srna, "texture_coords", PROP_ENUM, PROP_NONE);
@@ -571,6 +583,7 @@ static void rna_def_modifier_type_common(StructRNA *srna, EnumPropertyItem *modi
prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "modifier.flags", LS_MODIFIER_ENABLED);
RNA_def_property_ui_text(prop, "Use", "Enable or disable this modifier during stroke rendering");
+ RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
prop = RNA_def_property(srna, "expanded", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "modifier.flags", LS_MODIFIER_EXPANDED);
@@ -1337,7 +1350,6 @@ static void rna_def_linestyle(BlenderRNA *brna)
RNA_def_property_enum_bitflag_sdna(prop, NULL, "panel");
RNA_def_property_enum_items(prop, panel_items);
RNA_def_property_ui_text(prop, "Panel", "Select the property panel to be shown");
- RNA_def_property_update(prop, NC_LINESTYLE, NULL);
prop = RNA_def_property(srna, "color", PROP_FLOAT, PROP_COLOR);
RNA_def_property_float_sdna(prop, NULL, "r");
@@ -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)