[Bf-blender-cvs] [269b14f] master: Freestyle: Fix for viewport render not updating with changes of Freestyle settings.
Tamito Kajiyama
noreply at git.blender.org
Fri Jun 6 02:59:12 CEST 2014
Commit: 269b14f184bc93af0267f472f03c4b9852a45adb
Author: Tamito Kajiyama
Date: Fri Jun 6 00:56:04 2014 +0900
https://developer.blender.org/rB269b14f184bc93af0267f472f03c4b9852a45adb
Freestyle: Fix for viewport render not updating with changes of Freestyle settings.
===================================================================
M source/blender/editors/render/render_shading.c
M source/blender/makesrna/intern/rna_linestyle.c
M source/blender/makesrna/intern/rna_scene.c
===================================================================
diff --git a/source/blender/editors/render/render_shading.c b/source/blender/editors/render/render_shading.c
index f0d418b..9cc672f 100644
--- a/source/blender/editors/render/render_shading.c
+++ b/source/blender/editors/render/render_shading.c
@@ -652,6 +652,7 @@ static int freestyle_module_remove_exec(bContext *C, wmOperator *UNUSED(op))
BKE_freestyle_module_delete(&srl->freestyleConfig, module);
+ DAG_id_tag_update(&scene->id, 0);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
return OPERATOR_FINISHED;
@@ -686,6 +687,7 @@ static int freestyle_module_move_exec(bContext *C, wmOperator *op)
else {
BKE_freestyle_module_move_down(&srl->freestyleConfig, module);
}
+ DAG_id_tag_update(&scene->id, 0);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
return OPERATOR_FINISHED;
@@ -722,6 +724,7 @@ static int freestyle_lineset_add_exec(bContext *C, wmOperator *UNUSED(op))
BKE_freestyle_lineset_add(&srl->freestyleConfig, NULL);
+ DAG_id_tag_update(&scene->id, 0);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
return OPERATOR_FINISHED;
@@ -760,8 +763,6 @@ static int freestyle_lineset_copy_exec(bContext *C, wmOperator *UNUSED(op))
FRS_copy_active_lineset(&srl->freestyleConfig);
- WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
-
return OPERATOR_FINISHED;
}
@@ -787,6 +788,7 @@ static int freestyle_lineset_paste_exec(bContext *C, wmOperator *UNUSED(op))
FRS_paste_active_lineset(&srl->freestyleConfig);
+ DAG_id_tag_update(&scene->id, 0);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
return OPERATOR_FINISHED;
@@ -814,6 +816,7 @@ static int freestyle_lineset_remove_exec(bContext *C, wmOperator *UNUSED(op))
FRS_delete_active_lineset(&srl->freestyleConfig);
+ DAG_id_tag_update(&scene->id, 0);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
return OPERATOR_FINISHED;
@@ -846,6 +849,7 @@ static int freestyle_lineset_move_exec(bContext *C, wmOperator *op)
else {
FRS_move_active_lineset_down(&srl->freestyleConfig);
}
+ DAG_id_tag_update(&scene->id, 0);
WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
return OPERATOR_FINISHED;
@@ -892,8 +896,8 @@ static int freestyle_linestyle_new_exec(bContext *C, wmOperator *op)
else {
lineset->linestyle = BKE_new_linestyle("LineStyle", NULL);
}
-
- WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
+ DAG_id_tag_update(&lineset->linestyle->id, 0);
+ WM_event_add_notifier(C, NC_LINESTYLE, lineset->linestyle);
return OPERATOR_FINISHED;
}
@@ -928,7 +932,8 @@ static int freestyle_color_modifier_add_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "Unknown line color modifier type");
return OPERATOR_CANCELLED;
}
- WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
+ DAG_id_tag_update(&lineset->linestyle->id, 0);
+ WM_event_add_notifier(C, NC_LINESTYLE, lineset->linestyle);
return OPERATOR_FINISHED;
}
@@ -967,7 +972,8 @@ static int freestyle_alpha_modifier_add_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "Unknown alpha transparency modifier type");
return OPERATOR_CANCELLED;
}
- WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
+ DAG_id_tag_update(&lineset->linestyle->id, 0);
+ WM_event_add_notifier(C, NC_LINESTYLE, lineset->linestyle);
return OPERATOR_FINISHED;
}
@@ -1006,7 +1012,8 @@ static int freestyle_thickness_modifier_add_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "Unknown line thickness modifier type");
return OPERATOR_CANCELLED;
}
- WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
+ DAG_id_tag_update(&lineset->linestyle->id, 0);
+ WM_event_add_notifier(C, NC_LINESTYLE, lineset->linestyle);
return OPERATOR_FINISHED;
}
@@ -1045,7 +1052,8 @@ static int freestyle_geometry_modifier_add_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "Unknown stroke geometry modifier type");
return OPERATOR_CANCELLED;
}
- WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
+ DAG_id_tag_update(&lineset->linestyle->id, 0);
+ WM_event_add_notifier(C, NC_LINESTYLE, lineset->linestyle);
return OPERATOR_FINISHED;
}
@@ -1111,7 +1119,8 @@ static int freestyle_modifier_remove_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
return OPERATOR_CANCELLED;
}
- WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
+ DAG_id_tag_update(&lineset->linestyle->id, 0);
+ WM_event_add_notifier(C, NC_LINESTYLE, lineset->linestyle);
return OPERATOR_FINISHED;
}
@@ -1160,7 +1169,8 @@ static int freestyle_modifier_copy_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
return OPERATOR_CANCELLED;
}
- WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
+ DAG_id_tag_update(&lineset->linestyle->id, 0);
+ WM_event_add_notifier(C, NC_LINESTYLE, lineset->linestyle);
return OPERATOR_FINISHED;
}
@@ -1210,7 +1220,8 @@ static int freestyle_modifier_move_exec(bContext *C, wmOperator *op)
BKE_report(op->reports, RPT_ERROR, "The object the data pointer refers to is not a valid modifier");
return OPERATOR_CANCELLED;
}
- WM_event_add_notifier(C, NC_SCENE | ND_RENDER_OPTIONS, scene);
+ DAG_id_tag_update(&lineset->linestyle->id, 0);
+ WM_event_add_notifier(C, NC_LINESTYLE, lineset->linestyle);
return OPERATOR_FINISHED;
}
diff --git a/source/blender/makesrna/intern/rna_linestyle.c b/source/blender/makesrna/intern/rna_linestyle.c
index 31f5f53..ef3ed40 100644
--- a/source/blender/makesrna/intern/rna_linestyle.c
+++ b/source/blender/makesrna/intern/rna_linestyle.c
@@ -559,13 +559,13 @@ static void rna_def_modifier_type_common(StructRNA *srna, EnumPropertyItem *modi
RNA_def_property_enum_sdna(prop, NULL, "modifier.blend");
RNA_def_property_enum_items(prop, (color) ? ramp_blend_items : value_blend_items);
RNA_def_property_ui_text(prop, "Blend", "Specify how the modifier value is blended into the base value");
- RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+ RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
prop = RNA_def_property(srna, "influence", PROP_FLOAT, PROP_FACTOR);
RNA_def_property_float_sdna(prop, NULL, "modifier.influence");
RNA_def_property_range(prop, 0.0f, 1.0f);
RNA_def_property_ui_text(prop, "Influence", "Influence factor by which the modifier changes the property");
- RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+ RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
}
prop = RNA_def_property(srna, "use", PROP_BOOLEAN, PROP_NONE);
@@ -609,18 +609,18 @@ static void rna_def_modifier_color_ramp_common(StructRNA *srna, int range)
RNA_def_property_pointer_sdna(prop, NULL, "color_ramp");
RNA_def_property_struct_type(prop, "ColorRamp");
RNA_def_property_ui_text(prop, "Color Ramp", "Color ramp used to change line color");
- RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+ RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
if (range) {
prop = RNA_def_property(srna, "range_min", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "range_min");
RNA_def_property_ui_text(prop, "Range Min", "Lower bound of the input range the mapping is applied");
- RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+ RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
prop = RNA_def_property(srna, "range_max", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "range_max");
RNA_def_property_ui_text(prop, "Range Max", "Upper bound of the input range the mapping is applied");
- RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+ RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
}
}
@@ -638,41 +638,41 @@ static void rna_def_modifier_curve_common(StructRNA *srna, bool range, bool valu
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
RNA_def_property_enum_items(prop, mapping_items);
RNA_def_property_ui_text(prop, "Mapping", "Select the mapping type");
- RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+ RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
prop = RNA_def_property(srna, "invert", PROP_BOOLEAN, PROP_NONE);
RNA_def_property_boolean_sdna(prop, NULL, "flags", LS_MODIFIER_INVERT);
RNA_def_property_ui_text(prop, "Invert", "Invert the fade-out direction of the linear mapping");
- RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+ RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
prop = RNA_def_property(srna, "curve", PROP_POINTER, PROP_NONE);
RNA_def_property_pointer_sdna(prop, NULL, "curve");
RNA_def_property_struct_type(prop, "CurveMapping");
RNA_def_property_ui_text(prop, "Curve", "Curve used for the curve mapping");
- RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+ RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
if (range) {
prop = RNA_def_property(srna, "range_min", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "range_min");
RNA_def_property_ui_text(prop, "Range Min", "Lower bound of the input range the mapping is applied");
- RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+ RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
prop = RNA_def_property(srna, "range_max", PROP_FLOAT, PROP_DISTANCE);
RNA_def_property_float_sdna(prop, NULL, "range_max");
RNA_def_property_ui_text(prop, "Range Max", "Upper bound of the input range the mapping is applied");
- RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+ RNA_def_property_update(prop, NC_LINESTYLE, "rna_LineStyle_update");
}
if (value) {
prop = RNA_def_property(srna, "value_min", PROP_FLOAT, PROP_NONE);
RNA_def_property_float_sdna(prop, NULL, "value_min");
RNA_def_property_ui_text(prop, "Value Min", "Minimum output value of the mapping");
- RNA_def_property_update(prop, NC_LINESTYLE, NULL);
+ RNA_def_property_update(prop, NC_LINESTYLE, "rna_Li
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list