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>2013-03-23 07:00:37 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2013-03-23 07:00:37 +0400
commit62cede96d34d802d97797a635ff8370a5f7556a1 (patch)
treeec56d7f332164b34c31607ed882218ce892c9319 /source/blender/blenkernel/intern/scene.c
parent865e80f0f47b8cda1b126c2130114b833c7c5035 (diff)
A major code update for making the DNA file specification of Freestyle settings
and RNA for it independent of the build flag for enabling Freestyle. Suggested by Sergey Sharybin through a code review of the branch. * Many #ifdef WITH_FREESTYLE blocks were removed to always have Freestyle-specific DNA file specification and RNA for it built in Blender. This will allow Freestyle setting survive even when a non-Freestyle build is used for loading and saving files. It is noted that operations are still conditionally built through #ifdef WITH_FREESTYLE blocks. * To this end, new blenkernel files BKE_freestyle.h and intern/freestyle.c have been added. All API functions in FRS_freestyle_config.h as well as some of those in FRS_freestyle.h were moved to the new files. Now the relocated API functions have BKE_ prefix instead of FRS_.
Diffstat (limited to 'source/blender/blenkernel/intern/scene.c')
-rw-r--r--source/blender/blenkernel/intern/scene.c36
1 files changed, 11 insertions, 25 deletions
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index a942e694f2e..d01d7090d96 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -63,6 +63,7 @@
#include "BKE_colortools.h"
#include "BKE_depsgraph.h"
#include "BKE_fcurve.h"
+#include "BKE_freestyle.h"
#include "BKE_global.h"
#include "BKE_group.h"
#include "BKE_idprop.h"
@@ -87,10 +88,6 @@
//XXX #include "BIF_previewrender.h"
//XXX #include "BIF_editseq.h"
-#ifdef WITH_FREESTYLE
-# include "FRS_freestyle_config.h"
-#endif
-
#ifdef WIN32
#else
#include <sys/time.h>
@@ -144,6 +141,7 @@ static void remove_sequencer_fcurves(Scene *sce)
Scene *BKE_scene_copy(Scene *sce, int type)
{
Scene *scen;
+ SceneRenderLayer *srl, *new_srl;
ToolSettings *ts;
Base *base, *obase;
@@ -212,17 +210,12 @@ Scene *BKE_scene_copy(Scene *sce, int type)
if (type != SCE_COPY_FULL)
remove_sequencer_fcurves(scen);
-#ifdef WITH_FREESTYLE
- {
- SceneRenderLayer *srl, *new_srl;
-
- new_srl = scen->r.layers.first;
- for (srl = sce->r.layers.first; srl; srl = srl->next) {
- FRS_copy_freestyle_config(&new_srl->freestyleConfig, &srl->freestyleConfig);
- new_srl = new_srl->next;
- }
+ /* copy Freestyle settings */
+ new_srl = scen->r.layers.first;
+ for (srl = sce->r.layers.first; srl; srl = srl->next) {
+ BKE_freestyle_config_copy(&new_srl->freestyleConfig, &srl->freestyleConfig);
+ new_srl = new_srl->next;
}
-#endif
}
/* tool settings */
@@ -305,6 +298,7 @@ Scene *BKE_scene_copy(Scene *sce, int type)
void BKE_scene_free(Scene *sce)
{
Base *base;
+ SceneRenderLayer *srl;
/* check all sequences */
BKE_sequencer_clear_scene_in_allseqs(G.main, sce);
@@ -351,15 +345,9 @@ void BKE_scene_free(Scene *sce)
sce->r.ffcodecdata.properties = NULL;
}
-#ifdef WITH_FREESTYLE
- {
- SceneRenderLayer *srl;
-
- for (srl = sce->r.layers.first; srl; srl = srl->next) {
- FRS_free_freestyle_config(&srl->freestyleConfig);
- }
+ for (srl = sce->r.layers.first; srl; srl = srl->next) {
+ BKE_freestyle_config_free(&srl->freestyleConfig);
}
-#endif
BLI_freelistN(&sce->markers);
BLI_freelistN(&sce->transform_spaces);
@@ -1299,9 +1287,7 @@ SceneRenderLayer *BKE_scene_add_render_layer(Scene *sce, const char *name)
srl->lay = (1 << 20) - 1;
srl->layflag = 0x7FFF; /* solid ztra halo edge strand */
srl->passflag = SCE_PASS_COMBINED | SCE_PASS_Z;
-#ifdef WITH_FREESTYLE
- FRS_init_freestyle_config(&srl->freestyleConfig);
-#endif
+ BKE_freestyle_config_init(&srl->freestyleConfig);
return srl;
}