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>2010-06-26 02:45:42 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-06-26 02:45:42 +0400
commitee61785384b9fa351d57b0803ab1ab44c8498016 (patch)
tree205be39142a6cca2205b2cdd1eb05e56ad7904aa /source/blender/blenkernel
parent4d141cf80821fa0dc9533f24583fbf7e53eab5b4 (diff)
A step toward a new user-friendly GUI for manipulating line style parameters.
This commit is just meant to give the new GUI framework a concrete shape. There is no usefulness in newly introduced elements at the moment. Freestyle options in render layers now include a pull-down menu named Control Mode that allows you to choose either the Python Scripting or Parameter Editor mode. The Python Scripting mode is the conventional way of controlling Freestyle by directly using style modules written in Python. The Parameter Editor is a new control mode that is intended to be used by everyone without relying on Python programming. In the Parameter Editor mode, you can specify multiple line sets for each render layer. A line set defines feature edge selection criteria, as well as a line style for drawing the selected feature edges using specific line stylization parameters. Line style is a new datablock type, meaning that a line style can be shared by multiple line sets (possibly those in different render layers in different scenes). Much more additions are anticipated in subsequent commits to implement UI controls for specifying feature edge selection criteria and line stylization parameters.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_linestyle.h42
-rw-r--r--source/blender/blenkernel/BKE_main.h1
-rw-r--r--source/blender/blenkernel/intern/anim_sys.c7
-rw-r--r--source/blender/blenkernel/intern/library.c14
-rw-r--r--source/blender/blenkernel/intern/linestyle.c58
-rw-r--r--source/blender/blenkernel/intern/scene.c2
6 files changed, 123 insertions, 1 deletions
diff --git a/source/blender/blenkernel/BKE_linestyle.h b/source/blender/blenkernel/BKE_linestyle.h
new file mode 100644
index 00000000000..df7808c1a2b
--- /dev/null
+++ b/source/blender/blenkernel/BKE_linestyle.h
@@ -0,0 +1,42 @@
+/* BKE_linestyle.h
+ *
+ *
+ * $Id: BKE_particle.h 29187 2010-06-03 15:39:02Z kjym3 $
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2010 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#ifndef BKE_LINESTYLE_H
+#define BKE_LINESTYLE_H
+
+#include "DNA_freestyle_types.h"
+
+struct Main;
+
+FreestyleLineStyle *FRS_new_linestyle(char *name, struct Main *main);
+void FRS_free_linestyle(FreestyleLineStyle *linestyle);
+
+#endif
diff --git a/source/blender/blenkernel/BKE_main.h b/source/blender/blenkernel/BKE_main.h
index d4d76b2e6e1..d576556f13c 100644
--- a/source/blender/blenkernel/BKE_main.h
+++ b/source/blender/blenkernel/BKE_main.h
@@ -78,6 +78,7 @@ typedef struct Main {
ListBase particle;
ListBase wm;
ListBase gpencil;
+ ListBase linestyle;
} Main;
diff --git a/source/blender/blenkernel/intern/anim_sys.c b/source/blender/blenkernel/intern/anim_sys.c
index 10c2c1801cb..28eed5a27e8 100644
--- a/source/blender/blenkernel/intern/anim_sys.c
+++ b/source/blender/blenkernel/intern/anim_sys.c
@@ -466,6 +466,7 @@ void BKE_animdata_main_cb (Main *main, ID_AnimData_Edit_Callback func, void *use
ANIMDATA_IDS_CB(main->particle.first); /* particles */
ANIMDATA_IDS_CB(main->object.first); /* objects */
ANIMDATA_IDS_CB(main->world.first); /* worlds */
+ ANIMDATA_IDS_CB(main->linestyle.first); /* linestyles */
/* scenes */
for (id= main->scene.first; id; id= id->next) {
@@ -542,6 +543,9 @@ void BKE_all_animdata_fix_paths_rename (char *prefix, char *oldName, char *newNa
/* worlds */
RENAMEFIX_ANIM_IDS(mainptr->world.first);
+ /* linestyles */
+ RENAMEFIX_ANIM_IDS(mainptr->linestyle.first);
+
/* scenes */
for (id= mainptr->scene.first; id; id= id->next) {
AnimData *adt= BKE_animdata_from_id(id);
@@ -1890,6 +1894,9 @@ void BKE_animsys_evaluate_all_animation (Main *main, float ctime)
/* particles */
EVAL_ANIM_IDS(main->particle.first, ADT_RECALC_ANIM);
+ /* linestyles */
+ EVAL_ANIM_IDS(main->linestyle.first, ADT_RECALC_ANIM);
+
/* objects */
/* ADT_RECALC_ANIM doesn't need to be supplied here, since object AnimData gets
* this tagged by Depsgraph on framechange. This optimisation means that objects
diff --git a/source/blender/blenkernel/intern/library.c b/source/blender/blenkernel/intern/library.c
index 5931bf973af..02118d4a3ef 100644
--- a/source/blender/blenkernel/intern/library.c
+++ b/source/blender/blenkernel/intern/library.c
@@ -99,6 +99,7 @@
#include "BKE_particle.h"
#include "BKE_gpencil.h"
#include "BKE_fcurve.h"
+#include "BKE_linestyle.h"
#define MAX_IDPUP 60 /* was 24 */
@@ -226,6 +227,8 @@ int id_make_local(ID *id, int test)
return 0; /* can't be linked */
case ID_GD:
return 0; /* not implemented */
+ case ID_LS:
+ return 0; /* not implemented */
}
return 0;
@@ -315,6 +318,8 @@ int id_copy(ID *id, ID **newid, int test)
return 0; /* can't be copied from here */
case ID_GD:
return 0; /* not implemented */
+ case ID_LS:
+ return 0; /* not implemented */
}
return 0;
@@ -413,6 +418,8 @@ ListBase *which_libbase(Main *mainlib, short type)
return &(mainlib->wm);
case ID_GD:
return &(mainlib->gpencil);
+ case ID_LS:
+ return &(mainlib->linestyle);
}
return 0;
}
@@ -493,6 +500,7 @@ int set_listbasepointers(Main *main, ListBase **lb)
lb[a++]= &(main->library);
lb[a++]= &(main->wm);
lb[a++]= &(main->gpencil);
+ lb[a++]= &(main->linestyle);
lb[a]= NULL;
@@ -601,6 +609,9 @@ static ID *alloc_libblock_notest(short type)
case ID_GD:
id = MEM_callocN(sizeof(bGPdata), "Grease Pencil");
break;
+ case ID_LS:
+ id = MEM_callocN(sizeof(FreestyleLineStyle), "Freestyle Line Style");
+ break;
}
return id;
}
@@ -806,6 +817,9 @@ void free_libblock(ListBase *lb, void *idv)
case ID_GD:
free_gpencil_data((bGPdata *)id);
break;
+ case ID_LS:
+ FRS_free_linestyle((FreestyleLineStyle *)id);
+ break;
}
if (id->properties) {
diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c
new file mode 100644
index 00000000000..0abf83fe422
--- /dev/null
+++ b/source/blender/blenkernel/intern/linestyle.c
@@ -0,0 +1,58 @@
+/* linestyle.c
+ *
+ * $Id$
+ *
+ * ***** BEGIN GPL LICENSE BLOCK *****
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ *
+ * The Original Code is Copyright (C) 2010 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): none yet.
+ *
+ * ***** END GPL LICENSE BLOCK *****
+ */
+
+#include <stdio.h>
+#include <stdlib.h>
+
+#include "MEM_guardedalloc.h"
+
+#include "BKE_global.h"
+#include "BKE_library.h"
+#include "BKE_linestyle.h"
+#include "BKE_main.h"
+
+FreestyleLineStyle *FRS_new_linestyle(char *name, struct Main *main)
+{
+ FreestyleLineStyle *linestyle;
+
+ if (!main)
+ main = G.main;
+
+ linestyle = (FreestyleLineStyle *)alloc_libblock(&main->linestyle, ID_LS, name);
+
+ /* todo: default parameter settings */
+
+ return linestyle;
+}
+
+void FRS_free_linestyle(FreestyleLineStyle *linestyle)
+{
+
+}
diff --git a/source/blender/blenkernel/intern/scene.c b/source/blender/blenkernel/intern/scene.c
index c85276cd2a2..6d195dc0838 100644
--- a/source/blender/blenkernel/intern/scene.c
+++ b/source/blender/blenkernel/intern/scene.c
@@ -266,7 +266,7 @@ void free_scene(Scene *sce)
}
for(srl= sce->r.layers.first; srl; srl= srl->next) {
- BLI_freelistN( &srl->freestyleConfig.modules);
+ FRS_free_freestyle_config(srl);
}
BLI_freelistN(&sce->markers);