From 47bd0f74c2555252cb88c077bd402054e6aab341 Mon Sep 17 00:00:00 2001 From: Konrad P Date: Tue, 13 Dec 2022 17:32:22 +0100 Subject: [PATCH] Fix for Python >=3.8 dll discovery --- blendermodule/VisualSPHysics.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/blendermodule/VisualSPHysics.py b/blendermodule/VisualSPHysics.py index b7cdfbf..8892f45 100644 --- a/blendermodule/VisualSPHysics.py +++ b/blendermodule/VisualSPHysics.py @@ -26,7 +26,12 @@ import bpy, sys, math, re, os, time, array, ctypes, bmesh, mathutils import xml.etree.ElementTree as ET - +if sys.version_info[1]>=8 and os.name == 'nt': + if "VTK_DLL_PATH" in os.environ: + os.add_dll_directory(os.environ['VTK_DLL_PATH']) + else: + raise ValueError('Python 3.8 and higher requires VTK_DLL_PATH to be set in environment') + import vtkimporter import diffuseparticles