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>2014-04-18 09:59:02 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2014-04-18 10:02:45 +0400
commitf60a66f41784de388a01c4c882c969730d675375 (patch)
treea469d0acdfa48cefa2611837d268f2c636225372 /source/blender/blenloader
parent6a94e73a854286f711bffa81d351d640b4cf3675 (diff)
Freestyle: New options for sorting to arrange the stacking order of lines.
Line styles now have a set of new options for rearranging the stacking order of lines. This gives artists more control to determine which lines should be drawn on top of others. Two available sort keys are the distance from camera and curvilinear 2D length. Since the distance of a line from camera may vary over vertices, another option called integration type is used to compute the sort key for a line from the values computed at individual vertices. Available integration types are MEAN, MIN, MAX, FIRST and LAST (see the tool tips for more detail).
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/versioning_270.c11
-rw-r--r--source/blender/blenloader/intern/versioning_defaults.c7
2 files changed, 16 insertions, 2 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c
index 2dd227ef036..41b95064ac6 100644
--- a/source/blender/blenloader/intern/versioning_270.c
+++ b/source/blender/blenloader/intern/versioning_270.c
@@ -43,6 +43,7 @@
#include "DNA_mesh_types.h"
#include "DNA_modifier_types.h"
#include "DNA_sdna_types.h"
+#include "DNA_linestyle_types.h"
#include "DNA_genfile.h"
@@ -171,4 +172,14 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main)
me->smoothresh = DEG2RADF(me->smoothresh);
}
}
+
+ if (!MAIN_VERSION_ATLEAST(main, 270, 3)) {
+ FreestyleLineStyle *linestyle;
+
+ for (linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) {
+ linestyle->flag |= LS_NO_SORTING;
+ linestyle->sort_key = LS_SORT_KEY_DISTANCE_FROM_CAMERA;
+ linestyle->integration_type = LS_INTEGRATION_MEAN;
+ }
+ }
}
diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c
index d6caf16f7aa..b455ef016b2 100644
--- a/source/blender/blenloader/intern/versioning_defaults.c
+++ b/source/blender/blenloader/intern/versioning_defaults.c
@@ -59,8 +59,11 @@ void BLO_update_defaults_startup_blend(Main *main)
}
}
- for (linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next)
- linestyle->flag = LS_SAME_OBJECT;
+ for (linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) {
+ linestyle->flag = LS_SAME_OBJECT | LS_NO_SORTING;
+ linestyle->sort_key = LS_SORT_KEY_DISTANCE_FROM_CAMERA;
+ linestyle->integration_type = LS_INTEGRATION_MEAN;
+ }
{
bScreen *screen;