[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [30248] branches/soc-2008-mxcurioni: Rearranged the organization of UI controls for feature edge selection
Tamito Kajiyama
rd6t-kjym at asahi-net.or.jp
Tue Jul 13 01:31:15 CEST 2010
Revision: 30248
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=30248
Author: kjym3
Date: 2010-07-13 01:31:15 +0200 (Tue, 13 Jul 2010)
Log Message:
-----------
Rearranged the organization of UI controls for feature edge selection
criteria. Now the Inclusive/Exclusive and Logical AND/OR options are
only applied to feature edge types, while the conditions on visibility
and edge types are always combined by logical conjunction. Also, the
crease angle, sphere radius and Kr derivative epsilon are treated as
render layer-specific options instead of lineset-specific options.
Modified Paths:
--------------
branches/soc-2008-mxcurioni/release/scripts/ui/properties_render.py
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_freestyle_types.h
branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_scene.c
Modified: branches/soc-2008-mxcurioni/release/scripts/ui/properties_render.py
===================================================================
--- branches/soc-2008-mxcurioni/release/scripts/ui/properties_render.py 2010-07-12 23:01:05 UTC (rev 30247)
+++ branches/soc-2008-mxcurioni/release/scripts/ui/properties_render.py 2010-07-12 23:31:15 UTC (rev 30248)
@@ -197,6 +197,12 @@
col.prop(freestyle, "mode", text="Control Mode")
if freestyle.mode == "EDITOR":
+ col.label(text="Edge Detection Options:")
+ col.prop(freestyle, "crease_angle")
+ col.prop(freestyle, "sphere_radius")
+ sub = col.row()
+ sub.prop(freestyle, "dkr_epsilon")
+ sub.active = any(lineset.select_suggestive_contour for lineset in freestyle.linesets)
lineset = freestyle.active_lineset
@@ -220,31 +226,10 @@
if lineset:
col.prop(lineset, "name")
+ col.prop(lineset, "select_by_visibility")
+ col.prop(lineset, "select_by_edge_types")
- row = col.row()
- row.prop(lineset, "selection_negation", expand=True)
- row = col.row()
- row.prop(lineset, "selection_combination", expand=True)
-
- row = col.row()
- sub = row.column()
- sub.prop(lineset, "select_silhouette")
- sub.prop(lineset, "select_border")
- sub.prop(lineset, "select_crease")
- sub.prop(lineset, "select_ridge")
- sub.prop(lineset, "select_valley")
- sub.prop(lineset, "select_suggestive_contour")
- sub.prop(lineset, "select_material_boundary")
- sub = row.column()
- sub.prop(lineset, "select_contour")
- sub.prop(lineset, "select_external_contour")
- sub.prop(lineset, "select_visibility")
- col.prop(lineset, "crease_angle")
- col.prop(lineset, "sphere_radius")
- if lineset.select_suggestive_contour:
- col.label(text="Suggestive Contours:")
- col.prop(lineset, "dkr_epsilon")
- if lineset.select_visibility:
+ if lineset.select_by_visibility:
col.label(text="Visibility:")
sub = col.row(align=True)
sub.prop(lineset, "visibility", expand=True)
@@ -253,6 +238,26 @@
sub.prop(lineset, "qi_start")
sub.prop(lineset, "qi_end")
+ if lineset.select_by_edge_types:
+ col.label(text="Edge Types:")
+ row = col.row()
+ row.prop(lineset, "edge_type_negation", expand=True)
+ row = col.row()
+ row.prop(lineset, "edge_type_combination", expand=True)
+
+ row = col.row()
+ sub = row.column()
+ sub.prop(lineset, "select_silhouette")
+ sub.prop(lineset, "select_border")
+ sub.prop(lineset, "select_crease")
+ sub.prop(lineset, "select_ridge")
+ sub.prop(lineset, "select_valley")
+ sub.prop(lineset, "select_suggestive_contour")
+ sub.prop(lineset, "select_material_boundary")
+ sub = row.column()
+ sub.prop(lineset, "select_contour")
+ sub.prop(lineset, "select_external_contour")
+
else: # freestyle.mode == "SCRIPT"
col.prop(freestyle, "crease_angle")
Modified: branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp 2010-07-12 23:01:05 UTC (rev 30247)
+++ branches/soc-2008-mxcurioni/source/blender/freestyle/intern/blender_interface/FRS_freestyle.cpp 2010-07-12 23:31:15 UTC (rev 30248)
@@ -373,12 +373,10 @@
lineset->linestyle = FRS_new_linestyle("LineStyle", NULL);
lineset->flags |= FREESTYLE_LINESET_ENABLED;
lineset->selection = 0;
- lineset->crease_angle = 134.43f;
- lineset->sphere_radius = 1.0f;
- lineset->dkr_epsilon = 0.001f;
lineset->qi = FREESTYLE_QI_VISIBLE;
lineset->qi_start = 0;
lineset->qi_end = 100;
+ lineset->edge_types = 0;
lineset->objects.first = lineset->objects.last = NULL;
if (lineset_index > 0)
sprintf(lineset->name, "LineSet %i", lineset_index+1);
Modified: branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_freestyle_types.h
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_freestyle_types.h 2010-07-12 23:01:05 UTC (rev 30247)
+++ branches/soc-2008-mxcurioni/source/blender/makesdna/DNA_freestyle_types.h 2010-07-12 23:31:15 UTC (rev 30248)
@@ -16,21 +16,24 @@
/* FreestyleLineSet::flags */
#define FREESTYLE_LINESET_CURRENT 1
#define FREESTYLE_LINESET_ENABLED 2
-#define FREESTYLE_LINESET_SEL_NOT 4
-#define FREESTYLE_LINESET_SEL_OR 8
+#define FREESTYLE_LINESET_FE_NOT 4
+#define FREESTYLE_LINESET_FE_OR 8
/* FreestyleLineSet::selection */
-#define FREESTYLE_SEL_SILHOUETTE 1
-#define FREESTYLE_SEL_BORDER 2
-#define FREESTYLE_SEL_CREASE 4
-#define FREESTYLE_SEL_RIDGE 8
-#define FREESTYLE_SEL_VALLEY 16
-#define FREESTYLE_SEL_SUGGESTIVE_CONTOUR 32
-#define FREESTYLE_SEL_MATERIAL_BOUNDARY 64
-#define FREESTYLE_SEL_CONTOUR 128
-#define FREESTYLE_SEL_EXTERNAL_CONTOUR 256
-#define FREESTYLE_SEL_VISIBILITY 512
+#define FREESTYLE_SEL_VISIBILITY 1
+#define FREESTYLE_SEL_EDGE_TYPES 2
+/* FreestyleLineSet::fedge_types */
+#define FREESTYLE_FE_SILHOUETTE 1
+#define FREESTYLE_FE_BORDER 2
+#define FREESTYLE_FE_CREASE 4
+#define FREESTYLE_FE_RIDGE 8
+#define FREESTYLE_FE_VALLEY 16
+#define FREESTYLE_FE_SUGGESTIVE_CONTOUR 32
+#define FREESTYLE_FE_MATERIAL_BOUNDARY 64
+#define FREESTYLE_FE_CONTOUR 128
+#define FREESTYLE_FE_EXTERNAL_CONTOUR 512
+
/* FreestyleLineSet::qi */
#define FREESTYLE_QI_VISIBLE 1
#define FREESTYLE_QI_HIDDEN 2
@@ -46,14 +49,12 @@
char name[32]; /* line set name */
int flags;
- int selection; /* feature edge selection */
- float crease_angle;
- float sphere_radius;
- float dkr_epsilon;
+ int selection; /* selection criteria */
short qi; /* quantitative invisibility */
- short pad;
+ short pad1;
int qi_start, qi_end;
+ int edge_types; /* feature edge types */
FreestyleLineStyle *linestyle; /* line style */
Modified: branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_scene.c
===================================================================
--- branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_scene.c 2010-07-12 23:01:05 UTC (rev 30247)
+++ branches/soc-2008-mxcurioni/source/blender/makesrna/intern/rna_scene.c 2010-07-12 23:31:15 UTC (rev 30248)
@@ -1535,14 +1535,14 @@
StructRNA *srna;
PropertyRNA *prop;
- static EnumPropertyItem selection_negation_items[] = {
- {0, "INCLUSIVE", 0, "Inclusive", "Select feature edges satisfying the given selection criteria."},
- {FREESTYLE_LINESET_SEL_NOT, "EXCLUSIVE", 0, "Exclusive", "Select feature edges not satisfying the given selection criteria."},
+ static EnumPropertyItem negation_items[] = {
+ {0, "INCLUSIVE", 0, "Inclusive", "Select feature edges satisfying the given edge type conditions."},
+ {FREESTYLE_LINESET_FE_NOT, "EXCLUSIVE", 0, "Exclusive", "Select feature edges not satisfying the given edge type conditions."},
{0, NULL, 0, NULL, NULL}};
- static EnumPropertyItem selection_combination_items[] = {
- {0, "AND", 0, "Logical AND", "Combine selection criteria by logical AND (logical conjunction)."},
- {FREESTYLE_LINESET_SEL_OR, "OR", 0, "Logical OR", "Combine selection criteria by logical OR (logical disjunction)."},
+ static EnumPropertyItem combination_items[] = {
+ {0, "AND", 0, "Logical AND", "Combine feature edge type conditions by logical AND (logical conjunction)."},
+ {FREESTYLE_LINESET_FE_OR, "OR", 0, "Logical OR", "Combine feature edge type conditions by logical OR (logical disjunction)."},
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem freestyle_ui_mode_items[] = {
@@ -1551,9 +1551,9 @@
{0, NULL, 0, NULL, NULL}};
static EnumPropertyItem visibility_items[] ={
- {FREESTYLE_QI_VISIBLE, "VISIBLE", 0, "Visible", "Select visible edges."},
- {FREESTYLE_QI_HIDDEN, "HIDDEN", 0, "Hidden", "Select hidden edges."},
- {FREESTYLE_QI_RANGE, "RANGE", 0, "QI Range", "Select edges within a range of quantitative invisibility (QI) values."},
+ {FREESTYLE_QI_VISIBLE, "VISIBLE", 0, "Visible", "Select visible feature edges."},
+ {FREESTYLE_QI_HIDDEN, "HIDDEN", 0, "Hidden", "Select hidden feature edges."},
+ {FREESTYLE_QI_RANGE, "RANGE", 0, "QI Range", "Select feature edges within a range of quantitative invisibility (QI) values."},
{0, NULL, 0, NULL, NULL}};
/* FreestyleLineSet */
@@ -1581,16 +1581,26 @@
RNA_def_property_ui_text(prop, "Enabled", "Enable or disable the line set.");
RNA_def_property_update(prop, NC_SCENE, NULL);
- prop= RNA_def_property(srna, "selection_negation", PROP_ENUM, PROP_NONE);
+ prop= RNA_def_property(srna, "select_by_visibility", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "selection", FREESTYLE_SEL_VISIBILITY);
+ RNA_def_property_ui_text(prop, "Selection by Visibility", "Select feature edges based on visibility.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "select_by_edge_types", PROP_BOOLEAN, PROP_NONE);
+ RNA_def_property_boolean_sdna(prop, NULL, "selection", FREESTYLE_SEL_EDGE_TYPES);
+ RNA_def_property_ui_text(prop, "Selection by Edge Types", "Select feature edges based on edge types.");
+ RNA_def_property_update(prop, NC_SCENE, NULL);
+
+ prop= RNA_def_property(srna, "edge_type_negation", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
- RNA_def_property_enum_items(prop, selection_negation_items);
@@ Diff output truncated at 10240 characters. @@
More information about the Bf-blender-cvs
mailing list