From 1fbfc440acb1b7d900d9e756dac12e73e9557a64 Mon Sep 17 00:00:00 2001 From: Christopher Lackner Date: Thu, 20 Jan 2022 17:03:16 +0100 Subject: [PATCH] shape.name return optional --- libsrc/occ/python_occ_shapes.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libsrc/occ/python_occ_shapes.cpp b/libsrc/occ/python_occ_shapes.cpp index 5c3fbe55..91e94c50 100644 --- a/libsrc/occ/python_occ_shapes.cpp +++ b/libsrc/occ/python_occ_shapes.cpp @@ -719,11 +719,11 @@ DLL_HEADER void ExportNgOCCShapes(py::module &m) return shape; }, py::arg("name"), "sets 'name' property to all solids of shape") - .def_property("name", [](const TopoDS_Shape & self) { + .def_property("name", [](const TopoDS_Shape & self) -> optional { if (auto name = OCCGeometry::global_shape_properties[self.TShape()].name) return *name; else - return string(); + return nullopt; }, [](const TopoDS_Shape & self, optional name) { OCCGeometry::global_shape_properties[self.TShape()].name = name; }, "'name' of shape")