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:
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2008-11-09 16:14:41 +0300
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2008-11-09 16:14:41 +0300
commite77e6dea9762444144f86e66f01669510581d152 (patch)
tree5d098f31ae0ba332efde8d8921730e42a96dfa43 /source/blender/freestyle
parentc3b12b50660deae59345831298c7d6eea9ab580d (diff)
Made changes to enable features line parameters (ridges/valleys and suggestive contours) and add corresponding UI controls to the Freestyle tab in the Scene buttons.
Diffstat (limited to 'source/blender/freestyle')
-rw-r--r--source/blender/freestyle/FRS_freestyle.h6
-rwxr-xr-xsource/blender/freestyle/intern/app_blender/Controller.cpp8
-rw-r--r--source/blender/freestyle/intern/app_blender/api.cpp16
3 files changed, 22 insertions, 8 deletions
diff --git a/source/blender/freestyle/FRS_freestyle.h b/source/blender/freestyle/FRS_freestyle.h
index b736e767835..09672ae14fd 100644
--- a/source/blender/freestyle/FRS_freestyle.h
+++ b/source/blender/freestyle/FRS_freestyle.h
@@ -1,11 +1,17 @@
#ifndef FRS_FREESTYLE_H
#define FRS_FREESTYLE_H
+#define FREESTYLE_SUGGESTIVE_CONTOURS_FLAG 1
+#define FREESTYLE_RIDGES_AND_VALLEYS_FLAG 2
+
#ifdef __cplusplus
extern "C" {
#endif
extern char style_module[255];
+ extern int freestyle_flags;
+ extern float freestyle_sphere_radius;
+ extern float freestyle_dkr_epsilon;
void FRS_initialize();
void FRS_prepare(Render* re);
diff --git a/source/blender/freestyle/intern/app_blender/Controller.cpp b/source/blender/freestyle/intern/app_blender/Controller.cpp
index ddfab81edff..3e9bf347c74 100755
--- a/source/blender/freestyle/intern/app_blender/Controller.cpp
+++ b/source/blender/freestyle/intern/app_blender/Controller.cpp
@@ -1071,14 +1071,6 @@ void Controller::init_options(){
setFrontBufferFlag(false);
setBackBufferFlag(true);
- // Ridges and Valleys
- setComputeRidgesAndValleysFlag( false );
-
- // Suggestive Contours
- setComputeSuggestiveContoursFlag( false );
- setSphereRadius(1);
- setSuggestiveContourKrDerivativeEpsilon(0);
-
// soc: initialize canvas
_Canvas->init();
}
diff --git a/source/blender/freestyle/intern/app_blender/api.cpp b/source/blender/freestyle/intern/app_blender/api.cpp
index b5ed0489c83..d15f1ca9d38 100644
--- a/source/blender/freestyle/intern/app_blender/api.cpp
+++ b/source/blender/freestyle/intern/app_blender/api.cpp
@@ -8,6 +8,8 @@
extern "C" {
#endif
+#include "../../FRS_freestyle.h"
+
#include "DNA_camera_types.h"
#include "render_types.h"
@@ -32,6 +34,9 @@ extern "C" {
static AppGLWidget *view = NULL;
char style_module[255] = "";
+ int freestyle_flags;
+ float freestyle_sphere_radius = 1.0;
+ float freestyle_dkr_epsilon = 0.001;
void FRS_initialize(){
@@ -99,6 +104,17 @@ extern "C" {
controller->InsertStyleModule( 0, style_module );
controller->toggleLayer(0, true);
+ // set parameters
+ controller->setSphereRadius(freestyle_sphere_radius);
+ controller->setComputeRidgesAndValleysFlag((freestyle_flags & FREESTYLE_RIDGES_AND_VALLEYS_FLAG) ? true : false);
+ controller->setComputeSuggestiveContoursFlag((freestyle_flags & FREESTYLE_SUGGESTIVE_CONTOURS_FLAG) ? true : false);
+ controller->setSuggestiveContourKrDerivativeEpsilon(freestyle_dkr_epsilon);
+
+ cout << "Sphere radius : " << controller->getSphereRadius() << endl;
+ cout << "Redges and valleys : " << (controller->getComputeRidgesAndValleysFlag() ? "enabled" : "disabled") << endl;
+ cout << "Suggestive contours : " << (controller->getComputeSuggestiveContoursFlag() ? "enabled" : "disabled") << endl;
+ cout << "Suggestive contour dkr epsilon : " << controller->getSuggestiveContourKrDerivativeEpsilon() << endl;
+
// compute view map
controller->ComputeViewMap();