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-07-20 21:57:33 +0400
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>2010-07-20 21:57:33 +0400
commitbd68a728691032b918b437113c842e5ec715bc85 (patch)
tree414c44d612677201c1ff855e017c9e2614a46f5c /source/blender/makesdna/DNA_linestyle_types.h
parent472491d8d9e69e9920a191d93ffbf77fabab6a91 (diff)
A WIP commit for proof-of-concept implementations of line style modifiers.
A number of UI elements were newly introduced to control line color, alpha transparency and line thickness by means of base color/alpha/thickness plus modifiers that alter the base values. To begin with, three basic modifiers were prototyped with the aim of putting the new UI framework in practice and evaluating if it works properly. The Parameter Editor mode is still in a work-in-progress state and totally useless from users' viewpoint.
Diffstat (limited to 'source/blender/makesdna/DNA_linestyle_types.h')
-rw-r--r--source/blender/makesdna/DNA_linestyle_types.h192
1 files changed, 192 insertions, 0 deletions
diff --git a/source/blender/makesdna/DNA_linestyle_types.h b/source/blender/makesdna/DNA_linestyle_types.h
new file mode 100644
index 00000000000..2d6f4951875
--- /dev/null
+++ b/source/blender/makesdna/DNA_linestyle_types.h
@@ -0,0 +1,192 @@
+/* DNA_linestyle_types.h
+ *
+ * $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 *****
+ */
+
+#ifndef DNA_LINESTYLE_TYPES_H
+#define DNA_LINESTYLE_TYPES_H
+
+#include "DNA_listBase.h"
+#include "DNA_ID.h"
+
+struct ColorBand;
+struct CurveMapping;
+
+typedef struct LineStyleModifier {
+ struct LineStyleModifier *next, *prev;
+
+ char name[32];
+ int type;
+ float influence;
+ int flags;
+ int pad;
+} LineStyleModifier;
+
+/* LineStyleColorModifier::type */
+#define LS_MODIFIER_ALONG_STROKE 1
+#define LS_MODIFIER_DISTANCE_FROM_CAMERA 2
+#define LS_MODIFIER_DISTANCE_FROM_OBJECT 3
+#define LS_MODIFIER_NUM 4
+
+/* LineStyleColorModifier::flags */
+#define LS_MODIFIER_ENABLED 1
+#define LS_MODIFIER_EXPANDED 2
+
+/* flags (for alpha & thickness) */
+#define LS_MODIFIER_USE_CURVE 1
+#define LS_MODIFIER_INVERT 2
+
+/* blend (for alpha & thickness) */
+#define LS_VALUE_ADD 1
+#define LS_VALUE_MUL 2
+#define LS_VALUE_SUB 3
+#define LS_VALUE_DIV 4
+#define LS_VALUE_MIN 5
+#define LS_VALUE_MAX 6
+
+/* Along Stroke modifiers */
+
+typedef struct LineStyleColorModifier_AlongStroke {
+ struct LineStyleModifier modifier;
+
+ struct ColorBand *color_ramp;
+ int blend;
+ int pad;
+
+} LineStyleColorModifier_AlongStroke;
+
+typedef struct LineStyleAlphaModifier_AlongStroke {
+ struct LineStyleModifier modifier;
+
+ struct CurveMapping *curve;
+ int blend;
+ int flags;
+
+} LineStyleAlphaModifier_AlongStroke;
+
+typedef struct LineStyleThicknessModifier_AlongStroke {
+ struct LineStyleModifier modifier;
+
+ struct CurveMapping *curve;
+ int blend;
+ int flags;
+ float value_min, value_max;
+
+} LineStyleThicknessModifier_AlongStroke;
+
+/* Distance from Camera modifiers */
+
+typedef struct LineStyleColorModifier_DistanceFromCamera {
+ struct LineStyleModifier modifier;
+
+ struct ColorBand *color_ramp;
+ int blend;
+ float range_min, range_max;
+ int pad;
+
+} LineStyleColorModifier_DistanceFromCamera;
+
+typedef struct LineStyleAlphaModifier_DistanceFromCamera {
+ struct LineStyleModifier modifier;
+
+ struct CurveMapping *curve;
+ int blend;
+ int flags;
+ float range_min, range_max;
+
+} LineStyleAlphaModifier_DistanceFromCamera;
+
+typedef struct LineStyleThicknessModifier_DistanceFromCamera {
+ struct LineStyleModifier modifier;
+
+ struct CurveMapping *curve;
+ int blend;
+ int flags;
+ float range_min, range_max;
+ float value_min, value_max;
+
+} LineStyleThicknessModifier_DistanceFromCamera;
+
+/* Distance from Object modifiers */
+
+typedef struct LineStyleColorModifier_DistanceFromObject {
+ struct LineStyleModifier modifier;
+
+ struct Object *target;
+ struct ColorBand *color_ramp;
+ int blend;
+ float range_min, range_max;
+ int pad;
+
+} LineStyleColorModifier_DistanceFromObject;
+
+typedef struct LineStyleAlphaModifier_DistanceFromObject {
+ struct LineStyleModifier modifier;
+
+ struct Object *target;
+ struct CurveMapping *curve;
+ int blend;
+ int flags;
+ float range_min, range_max;
+
+} LineStyleAlphaModifier_DistanceFromObject;
+
+typedef struct LineStyleThicknessModifier_DistanceFromObject {
+ struct LineStyleModifier modifier;
+
+ struct Object *target;
+ struct CurveMapping *curve;
+ int blend;
+ int flags;
+ float range_min, range_max;
+ float value_min, value_max;
+
+} LineStyleThicknessModifier_DistanceFromObject;
+
+/* FreestyleLineStyle::panel */
+#define LS_PANEL_COLOR 1
+#define LS_PANEL_ALPHA 2
+#define LS_PANEL_THICKNESS 3
+#define LS_PANEL_STROKES 4
+#define LS_PANEL_DISTORT 5
+#define LS_PANEL_MISC 6
+
+typedef struct FreestyleLineStyle {
+ ID id;
+
+ float r, g, b, alpha;
+ float thickness;
+ int panel; /* for UI */
+
+ ListBase color_modifiers;
+ ListBase alpha_modifiers;
+ ListBase thickness_modifiers;
+
+} FreestyleLineStyle;
+
+#endif