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:
authorJeroen Bakker <j.bakker@atmind.nl>2011-08-04 14:05:14 +0400
committerJeroen Bakker <j.bakker@atmind.nl>2011-08-04 14:05:14 +0400
commit9da70f74d37c7c0001a2705afc8fe5044f63bb0a (patch)
tree6458cde4aa181913f32c5bcb82127b2b7970acd1 /source/blender/editors
parentf3c40df5e334f8a1f106fe71e44c8035ddcac7b1 (diff)
UserPref/Node editor feature: Change the level of noodle curving.
Some people like curved lines, other hate them. This commit will let the user change the level of curving. In UserPreferences=>Themes=>Node editor=>Noodle curving the level can be modified. Allowed range is 0-10 with the default on 5 The patch will default everything to the way blender works ATM. File subversion has been increased otherwise older 258 files got straight lines. The data is stored in the ThemeSpace.noodle_curving the bezierdrawing is done in the drawnode. Also tested the Line cut tool
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/include/UI_resources.h4
-rw-r--r--source/blender/editors/interface/resources.c14
-rw-r--r--source/blender/editors/space_node/drawnode.c4
3 files changed, 17 insertions, 5 deletions
diff --git a/source/blender/editors/include/UI_resources.h b/source/blender/editors/include/UI_resources.h
index 2311aafbb17..d0c2b387445 100644
--- a/source/blender/editors/include/UI_resources.h
+++ b/source/blender/editors/include/UI_resources.h
@@ -242,7 +242,9 @@ enum {
TH_DRAWEXTRA_EDGELEN,
TH_DRAWEXTRA_FACEAREA,
- TH_DRAWEXTRA_FACEANG
+ TH_DRAWEXTRA_FACEANG,
+
+ TH_NODE_CURVING
};
/* XXX WARNING: previous is saved in file, so do not change order! */
diff --git a/source/blender/editors/interface/resources.c b/source/blender/editors/interface/resources.c
index 0c755180b3a..f58383830cb 100644
--- a/source/blender/editors/interface/resources.c
+++ b/source/blender/editors/interface/resources.c
@@ -360,7 +360,9 @@ const unsigned char *UI_ThemeGetColorPtr(bTheme *btheme, int spacetype, int colo
cp= ts->syntaxv; break;
case TH_NODE_GROUP:
cp= ts->syntaxc; break;
-
+ case TH_NODE_CURVING:
+ cp= &ts->noodle_curving; break;
+
case TH_SEQ_MOVIE:
cp= ts->movie; break;
case TH_SEQ_IMAGE:
@@ -787,6 +789,7 @@ void ui_theme_init_default(void)
SETCOL(btheme->tnode.syntaxb, 108, 105, 111, 255); /* operator */
SETCOL(btheme->tnode.syntaxv, 104, 106, 117, 255); /* generator */
SETCOL(btheme->tnode.syntaxc, 105, 117, 110, 255); /* group */
+ btheme->tnode.noodle_curving = 5;
/* space logic */
btheme->tlogic= btheme->tv3d;
@@ -1553,7 +1556,14 @@ void init_userdef_do_versions(void)
/* clear "AUTOKEY_FLAG_ONLYKEYINGSET" flag from userprefs, so that it doesn't linger around from old configs like a ghost */
U.autokey_flag &= ~AUTOKEY_FLAG_ONLYKEYINGSET;
}
-
+
+ if (bmain->versionfile < 258 || (bmain->versionfile == 258 && bmain->subversionfile < 2)) {
+ bTheme *btheme;
+ for(btheme= U.themes.first; btheme; btheme= btheme->next) {
+ btheme->tnode.noodle_curving = 5;
+ }
+ }
+
/* GL Texture Garbage Collection (variable abused above!) */
if (U.textimeout == 0) {
U.texcollectrate = 60;
diff --git a/source/blender/editors/space_node/drawnode.c b/source/blender/editors/space_node/drawnode.c
index 50e657bbb61..c32d05e9c30 100644
--- a/source/blender/editors/space_node/drawnode.c
+++ b/source/blender/editors/space_node/drawnode.c
@@ -1768,8 +1768,8 @@ int node_link_bezier_points(View2D *v2d, SpaceNode *snode, bNodeLink *link, floa
vec[3][0]= snode->mx;
vec[3][1]= snode->my;
}
-
- dist= 0.5f*ABS(vec[0][0] - vec[3][0]);
+
+ dist= UI_GetThemeValue(TH_NODE_CURVING)*0.10f*ABS(vec[0][0] - vec[3][0]);
/* check direction later, for top sockets */
vec[1][0]= vec[0][0]+dist;