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:
authorCampbell Barton <ideasman42@gmail.com>2019-02-12 03:43:33 +0300
committerCampbell Barton <ideasman42@gmail.com>2019-02-16 01:32:29 +0300
commita2f345468c94e4b8a842ba9a9988237cd5c8194f (patch)
treeb896eed5a54fa6063afe6e467876d47080d0349e /source/blender/makesdna/intern/dna_rename_defs.h
parentbc657ef16eed438a1eb5156e5b46173044905dcc (diff)
DNA: support DNA type & name aliases
This allows us to rename struct & struct members in the source code without changing the file format. This is useful because the code becomes increasingly confusing when names such as oops, ipo & dupli aren't used anywhere except DNA headers. dna_rename_defs.h is used to define renaming operations. The renaming it's self will be done separately.
Diffstat (limited to 'source/blender/makesdna/intern/dna_rename_defs.h')
-rw-r--r--source/blender/makesdna/intern/dna_rename_defs.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/source/blender/makesdna/intern/dna_rename_defs.h b/source/blender/makesdna/intern/dna_rename_defs.h
new file mode 100644
index 00000000000..cdf13e7103d
--- /dev/null
+++ b/source/blender/makesdna/intern/dna_rename_defs.h
@@ -0,0 +1,47 @@
+/*
+ * 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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ * DNA handling
+ */
+
+/** \file \ingroup DNA
+ *
+ * Defines in this header are only used to define blend file storage.
+ * This allows us to rename variables & structs without breaking compatibility.
+ *
+ * - When renaming the member of a struct which has it's self been renamed
+ * refer to the newer name, not the original.
+ *
+ * - Changes here only change generated code for `makesdna.c` and `makesrna.c`
+ * without impacting Blender's run-time, besides allowing us to use the new names.
+ *
+ * - Renaming something that has already been renamed can be done by editing the existing rename macro.
+ * All references to the previous destination name can be removed since they're
+ * never written to disk.
+ *
+ * \see versioning_dna.c for a actual version patching.
+ */
+
+/* No include guard (intentional). */
+
+/* Match RNA names where possible. */
+#if 0
+DNA_STRUCT_RENAME(Lamp, Light)
+DNA_STRUCT_RENAME(SpaceOops, SpaceOutliner)
+DNA_STRUCT_RENAME_ELEM(Camera, YF_dofdist, dof_distance)
+DNA_STRUCT_RENAME_ELEM(Object, dup_group, instance_collection)
+#endif