Added UI controls for specifying logical operations (logical AND, OR,
and NOT) to combine feature edge selection criteria.
This commit is contained in:
@@ -221,6 +221,11 @@ class RENDER_PT_freestyle(RenderButtonsPanel):
|
|||||||
if lineset:
|
if lineset:
|
||||||
col.prop(lineset, "name")
|
col.prop(lineset, "name")
|
||||||
|
|
||||||
|
row = col.row()
|
||||||
|
row.prop(lineset, "selection_negation", expand=True)
|
||||||
|
row = col.row()
|
||||||
|
row.prop(lineset, "selection_combination", expand=True)
|
||||||
|
|
||||||
row = col.row()
|
row = col.row()
|
||||||
sub = row.column()
|
sub = row.column()
|
||||||
sub.prop(lineset, "select_silhouette")
|
sub.prop(lineset, "select_silhouette")
|
||||||
|
|||||||
@@ -16,6 +16,8 @@
|
|||||||
/* FreestyleLineSet::flags */
|
/* FreestyleLineSet::flags */
|
||||||
#define FREESTYLE_LINESET_CURRENT 1
|
#define FREESTYLE_LINESET_CURRENT 1
|
||||||
#define FREESTYLE_LINESET_ENABLED 2
|
#define FREESTYLE_LINESET_ENABLED 2
|
||||||
|
#define FREESTYLE_LINESET_SEL_NOT 4
|
||||||
|
#define FREESTYLE_LINESET_SEL_OR 8
|
||||||
|
|
||||||
/* FreestyleLineSet::selection */
|
/* FreestyleLineSet::selection */
|
||||||
#define FREESTYLE_SEL_SILHOUETTE 1
|
#define FREESTYLE_SEL_SILHOUETTE 1
|
||||||
|
|||||||
@@ -1535,6 +1535,16 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
|
|||||||
StructRNA *srna;
|
StructRNA *srna;
|
||||||
PropertyRNA *prop;
|
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."},
|
||||||
|
{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)."},
|
||||||
|
{0, NULL, 0, NULL, NULL}};
|
||||||
|
|
||||||
static EnumPropertyItem freestyle_ui_mode_items[] = {
|
static EnumPropertyItem freestyle_ui_mode_items[] = {
|
||||||
{FREESTYLE_CONTROL_SCRIPT_MODE, "SCRIPT", 0, "Python Scripting Mode", "Advanced mode for using style modules in Python"},
|
{FREESTYLE_CONTROL_SCRIPT_MODE, "SCRIPT", 0, "Python Scripting Mode", "Advanced mode for using style modules in Python"},
|
||||||
{FREESTYLE_CONTROL_EDITOR_MODE, "EDITOR", 0, "Parameter Editor Mode", "Basic mode for interactive style parameter editing"},
|
{FREESTYLE_CONTROL_EDITOR_MODE, "EDITOR", 0, "Parameter Editor Mode", "Basic mode for interactive style parameter editing"},
|
||||||
@@ -1571,6 +1581,18 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
|
|||||||
RNA_def_property_ui_text(prop, "Enabled", "Enable or disable the line set.");
|
RNA_def_property_ui_text(prop, "Enabled", "Enable or disable the line set.");
|
||||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||||
|
|
||||||
|
prop= RNA_def_property(srna, "selection_negation", PROP_ENUM, PROP_NONE);
|
||||||
|
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
|
||||||
|
RNA_def_property_enum_items(prop, selection_negation_items);
|
||||||
|
RNA_def_property_ui_text(prop, "Selection Negation", "Set the negation operation for selection criteria.");
|
||||||
|
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||||
|
|
||||||
|
prop= RNA_def_property(srna, "selection_combination", PROP_ENUM, PROP_NONE);
|
||||||
|
RNA_def_property_enum_bitflag_sdna(prop, NULL, "flags");
|
||||||
|
RNA_def_property_enum_items(prop, selection_combination_items);
|
||||||
|
RNA_def_property_ui_text(prop, "Selection Combination", "Set the combination operation for selection criteria.");
|
||||||
|
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||||
|
|
||||||
prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
|
prop= RNA_def_property(srna, "objects", PROP_COLLECTION, PROP_NONE);
|
||||||
RNA_def_property_collection_sdna(prop, NULL, "objects", NULL);
|
RNA_def_property_collection_sdna(prop, NULL, "objects", NULL);
|
||||||
RNA_def_property_struct_type(prop, "Object");
|
RNA_def_property_struct_type(prop, "Object");
|
||||||
|
|||||||
Reference in New Issue
Block a user