From 7c511f1b47d857f37aa36ee6ed8107cb88eb5c39 Mon Sep 17 00:00:00 2001 From: Iyad Ahmed Date: Mon, 6 Jun 2022 20:57:38 +0300 Subject: STL: Add new C++ based STL importer A new experimentatl STL importer, written in C++. Roughly 7-9x faster than the Python based one. Reviewed By: Aras Pranckevicius, Hans Goudey. Differential Revision: https://developer.blender.org/D14941 --- source/blender/io/common/CMakeLists.txt | 3 +++ source/blender/io/common/IO_orientation.h | 16 ++++++++++++++++ source/blender/io/common/intern/orientation.c | 14 ++++++++++++++ 3 files changed, 33 insertions(+) create mode 100644 source/blender/io/common/IO_orientation.h create mode 100644 source/blender/io/common/intern/orientation.c (limited to 'source/blender/io/common') diff --git a/source/blender/io/common/CMakeLists.txt b/source/blender/io/common/CMakeLists.txt index e80bd850825..a6818c0bf5d 100644 --- a/source/blender/io/common/CMakeLists.txt +++ b/source/blender/io/common/CMakeLists.txt @@ -8,6 +8,7 @@ set(INC ../../depsgraph ../../makesdna ../../../../intern/guardedalloc + ../../makesrna ) set(INC_SYS @@ -19,12 +20,14 @@ set(SRC intern/dupli_persistent_id.cc intern/object_identifier.cc intern/path_util.cc + intern/orientation.c IO_abstract_hierarchy_iterator.h IO_dupli_persistent_id.hh IO_path_util.hh IO_path_util_types.h IO_types.h + IO_orientation.h intern/dupli_parent_finder.hh ) diff --git a/source/blender/io/common/IO_orientation.h b/source/blender/io/common/IO_orientation.h new file mode 100644 index 00000000000..09fcbc7045c --- /dev/null +++ b/source/blender/io/common/IO_orientation.h @@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#pragma once + +#include "RNA_types.h" + +typedef enum { + IO_AXIS_X = 0, + IO_AXIS_Y = 1, + IO_AXIS_Z = 2, + IO_AXIS_NEGATIVE_X = 3, + IO_AXIS_NEGATIVE_Y = 4, + IO_AXIS_NEGATIVE_Z = 5, +} eIOAxis; + +extern const EnumPropertyItem io_transform_axis[]; diff --git a/source/blender/io/common/intern/orientation.c b/source/blender/io/common/intern/orientation.c new file mode 100644 index 00000000000..0ffbaa8fe8e --- /dev/null +++ b/source/blender/io/common/intern/orientation.c @@ -0,0 +1,14 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#include "RNA_types.h" + +#include "IO_orientation.h" + +const EnumPropertyItem io_transform_axis[] = { + {IO_AXIS_X, "X", 0, "X", "Positive X axis"}, + {IO_AXIS_Y, "Y", 0, "Y", "Positive Y axis"}, + {IO_AXIS_Z, "Z", 0, "Z", "Positive Z axis"}, + {IO_AXIS_NEGATIVE_X, "NEGATIVE_X", 0, "-X", "Negative X axis"}, + {IO_AXIS_NEGATIVE_Y, "NEGATIVE_Y", 0, "-Y", "Negative Y axis"}, + {IO_AXIS_NEGATIVE_Z, "NEGATIVE_Z", 0, "-Z", "Negative Z axis"}, + {0, NULL, 0, NULL, NULL}}; -- cgit v1.2.3