Reorganization of two view map construction parameters.
* Sphere radius and Kr derivative epsilon were removed from the Parameter Editor mode. Now sphere radius of 1.0 and Kr derivative epsilon of 0.0 are used by default. The rationale of the removal is two-fold: little predictability and very minor artistic values. The effects of these parameters are hard to estimate in advance, which likely leads to a frustration of users due to repeated trials and unpredicted results. Therefore, the two parameters are considered to have quite limited artistic values. Proper definitions of the two parameters more and less require the knowledge of differential geometry and would not make sense to most artists for which the Parameter Editor is intended. * Sphere radius and Kr derivative epsilon are still available in the Python Scripting mode, but now in an "advanced options" section that is disabled and hidden by default. This way new users are properly warned, while expert users with specific technical needs can enable these options if they want. The same default values mentioned above are used when the two parameters are disabled.
This commit is contained in:
@@ -207,12 +207,11 @@ class RENDER_PT_freestyle(RenderButtonsPanel, Panel):
|
||||
col.prop(freestyle, "raycasting_algorithm", text="Raycasting Algorithm")
|
||||
col.prop(freestyle, "mode", text="Control Mode")
|
||||
|
||||
col.label(text="Edge Detection Options:")
|
||||
col.prop(freestyle, "use_smoothness")
|
||||
col.prop(freestyle, "crease_angle")
|
||||
|
||||
if freestyle.mode == "EDITOR":
|
||||
col.label(text="Edge Detection Options:")
|
||||
col.prop(freestyle, "use_smoothness")
|
||||
col.prop(freestyle, "crease_angle")
|
||||
col.prop(freestyle, "sphere_radius")
|
||||
col.prop(freestyle, "kr_derivative_epsilon")
|
||||
|
||||
lineset = freestyle.linesets.active
|
||||
|
||||
@@ -236,15 +235,14 @@ class RENDER_PT_freestyle(RenderButtonsPanel, Panel):
|
||||
|
||||
else: # freestyle.mode == "SCRIPT"
|
||||
|
||||
col.prop(freestyle, "use_smoothness")
|
||||
col.prop(freestyle, "crease_angle")
|
||||
col.prop(freestyle, "sphere_radius")
|
||||
col.prop(freestyle, "use_material_boundaries")
|
||||
col.prop(freestyle, "use_ridges_and_valleys")
|
||||
col.prop(freestyle, "use_suggestive_contours")
|
||||
sub = col.row()
|
||||
sub.prop(freestyle, "kr_derivative_epsilon")
|
||||
sub.active = freestyle.use_suggestive_contours
|
||||
col.prop(freestyle, "use_material_boundaries")
|
||||
col.prop(freestyle, "use_advanced_options")
|
||||
if freestyle.use_advanced_options:
|
||||
col.prop(freestyle, "sphere_radius")
|
||||
col.prop(freestyle, "kr_derivative_epsilon")
|
||||
col.separator()
|
||||
col.operator("scene.freestyle_module_add")
|
||||
|
||||
for i, module in enumerate(freestyle.modules):
|
||||
|
||||
@@ -34,6 +34,9 @@ extern "C" {
|
||||
#include "../../FRS_freestyle.h"
|
||||
#include "../../FRS_freestyle_config.h"
|
||||
|
||||
#define DEFAULT_SPHERE_RADIUS 1.0f
|
||||
#define DEFAULT_DKR_EPSILON 0.0f
|
||||
|
||||
// Freestyle configuration
|
||||
static short freestyle_is_initialized = 0;
|
||||
static Config::Path *pathconfig = NULL;
|
||||
@@ -330,10 +333,15 @@ extern "C" {
|
||||
}
|
||||
|
||||
// set parameters
|
||||
if (config->mode == FREESTYLE_CONTROL_SCRIPT_MODE && (config->flags & FREESTYLE_ADVANCED_OPTIONS_FLAG)) {
|
||||
controller->setSphereRadius( config->sphere_radius );
|
||||
controller->setSuggestiveContourKrDerivativeEpsilon( config->dkr_epsilon );
|
||||
} else {
|
||||
controller->setSphereRadius( DEFAULT_SPHERE_RADIUS );
|
||||
controller->setSuggestiveContourKrDerivativeEpsilon( DEFAULT_DKR_EPSILON );
|
||||
}
|
||||
controller->setFaceSmoothness( (config->flags & FREESTYLE_FACE_SMOOTHNESS_FLAG) ? true : false);
|
||||
controller->setCreaseAngle( config->crease_angle );
|
||||
controller->setSphereRadius( config->sphere_radius );
|
||||
controller->setSuggestiveContourKrDerivativeEpsilon( config->dkr_epsilon ) ;
|
||||
controller->setVisibilityAlgo( config->raycasting_algorithm );
|
||||
|
||||
cout << "Crease angle : " << controller->getCreaseAngle() << endl;
|
||||
@@ -500,8 +508,8 @@ extern "C" {
|
||||
|
||||
config->modules.first = config->modules.last = NULL;
|
||||
config->flags = 0;
|
||||
config->sphere_radius = 1.0f;
|
||||
config->dkr_epsilon = 0.001f;
|
||||
config->sphere_radius = DEFAULT_SPHERE_RADIUS;
|
||||
config->dkr_epsilon = DEFAULT_DKR_EPSILON;
|
||||
config->crease_angle = 134.43f;
|
||||
|
||||
config->linesets.first = config->linesets.last = NULL;
|
||||
|
||||
@@ -40,6 +40,7 @@ struct FreestyleLineStyle;
|
||||
#define FREESTYLE_RIDGES_AND_VALLEYS_FLAG 2
|
||||
#define FREESTYLE_MATERIAL_BOUNDARIES_FLAG 4
|
||||
#define FREESTYLE_FACE_SMOOTHNESS_FLAG 8
|
||||
#define FREESTYLE_ADVANCED_OPTIONS_FLAG 16
|
||||
|
||||
/* FreestyleConfig::mode */
|
||||
#define FREESTYLE_CONTROL_SCRIPT_MODE 1
|
||||
|
||||
@@ -2523,6 +2523,11 @@ static void rna_def_freestyle_settings(BlenderRNA *brna)
|
||||
RNA_def_property_ui_text(prop, "Face Smoothness", "Take face smoothness into account in view map calculation");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "use_advanced_options", PROP_BOOLEAN, PROP_NONE);
|
||||
RNA_def_property_boolean_sdna(prop, NULL, "flags", FREESTYLE_ADVANCED_OPTIONS_FLAG);
|
||||
RNA_def_property_ui_text(prop, "Advanced Edge Detection Options", "Enable advanced edge detection options (sphere radius and Kr derivative epsilon)");
|
||||
RNA_def_property_update(prop, NC_SCENE, NULL);
|
||||
|
||||
prop= RNA_def_property(srna, "sphere_radius", PROP_FLOAT, PROP_NONE);
|
||||
RNA_def_property_float_sdna(prop, NULL, "sphere_radius");
|
||||
RNA_def_property_range(prop, 0.0, 1000.0);
|
||||
|
||||
Reference in New Issue
Block a user