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
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')
-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
-rw-r--r--source/blender/src/buttons_scene.c4
4 files changed, 26 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();
diff --git a/source/blender/src/buttons_scene.c b/source/blender/src/buttons_scene.c
index fec7818cdeb..e69095ee5ca 100644
--- a/source/blender/src/buttons_scene.c
+++ b/source/blender/src/buttons_scene.c
@@ -3311,6 +3311,10 @@ static void render_panel_freestyle()
uiBlockBeginAlign(block);
uiDefIconBut(block, BUT, B_FS_FRS, ICON_FILESEL, 10, 190, 20, 20, 0, 0, 0, 0, 0, "Open Fileselect to get style module");
uiDefBut(block, TEX,0,"", 31, 190, 279, 20, style_module, 0.0,79.0, 0, 0, "Style module path name");
+ uiDefButF(block, NUM, B_NOP, "Sphere Radius", 10,170,300,20, &freestyle_sphere_radius, 0.0f, 100.0f, 10, 2, "Sphere radius (x mean edge size)");
+ uiDefButBitI(block, TOG, FREESTYLE_RIDGES_AND_VALLEYS_FLAG, B_NOP, "Ridges and Valleys", 10, 150, 150, 20, &freestyle_flags, 0, 0, 0, 0, "Compute ridges and valleys");
+ uiDefButBitI(block, TOG, FREESTYLE_SUGGESTIVE_CONTOURS_FLAG, B_NOP, "Suggestive Contours", 10, 130, 150, 20, &freestyle_flags, 0, 0, 0, 0, "Compute suggestive contours");
+ uiDefButF(block, NUM, B_NOP, "kr Derivative Epsilon", 10,110,300,20, &freestyle_dkr_epsilon, 0.0f, 10.0f, 0.1, 3, "Suggestive contour kr derivative epsilon");
uiBlockEndAlign(block);