From 62f56175396c4fd652f994b769de66ca60a57486 Mon Sep 17 00:00:00 2001 From: Luke Street Date: Wed, 15 Apr 2020 02:13:11 -0400 Subject: [PATCH] Use empty .blend on create; remove MallocNanoZone workaround --- hecl/blender/hecl_blendershell.py | 3 ++- hecl/lib/Blender/Connection.cpp | 5 ----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/hecl/blender/hecl_blendershell.py b/hecl/blender/hecl_blendershell.py index 01d64b15f..c72b0b589 100644 --- a/hecl/blender/hecl_blendershell.py +++ b/hecl/blender/hecl_blendershell.py @@ -475,7 +475,8 @@ try: if len(cmdargs) >= 4: bpy.ops.wm.open_mainfile(filepath=cmdargs[3]) else: - bpy.ops.wm.read_homefile() + bpy.ops.wm.read_homefile(use_empty=True) + bpy.context.scene.world = bpy.data.worlds.new('World') loaded_blend = cmdargs[1] bpy.context.preferences.filepaths.save_version = 0 if 'FINISHED' in bpy.ops.wm.save_as_mainfile(filepath=cmdargs[1]): diff --git a/hecl/lib/Blender/Connection.cpp b/hecl/lib/Blender/Connection.cpp index 1f68c38fa..b9a1bcdbf 100644 --- a/hecl/lib/Blender/Connection.cpp +++ b/hecl/lib/Blender/Connection.cpp @@ -453,11 +453,6 @@ Connection::Connection(int verbosityLevel) { std::string writefds = fmt::format(FMT_STRING("{}"), m_readpipe[1]); std::string vLevel = fmt::format(FMT_STRING("{}"), verbosityLevel); -#ifdef __APPLE__ - // Undocumented flag that makes Blender not crash ¯\_(ツ)_/¯ - setenv("MallocNanoZone", "1", 1); -#endif - /* Try user-specified blender first */ if (blenderBin) { execlp(blenderBin, blenderBin, "--background", "-P", blenderShellPath.c_str(), "--", readfds.c_str(),