From 6f490f62ae652508d215f8e70b137897de878884 Mon Sep 17 00:00:00 2001 From: Orlando Garcia-Feal Date: Tue, 3 Oct 2023 19:01:43 +0200 Subject: [PATCH] Fix error when loading XML files generated with DesignSPHysics. --- blendermodule/VisualSPHysics.py | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/blendermodule/VisualSPHysics.py b/blendermodule/VisualSPHysics.py index b7cdfbf..4e5adf4 100644 --- a/blendermodule/VisualSPHysics.py +++ b/blendermodule/VisualSPHysics.py @@ -25,7 +25,7 @@ import bpy, sys, math, re, os, time, array, ctypes, bmesh, mathutils import xml.etree.ElementTree as ET - +import traceback import vtkimporter import diffuseparticles @@ -156,9 +156,17 @@ def parseXML(context): fpath = bpy.path.abspath(context.scene.DsphFoamXML) if os.path.isfile(fpath) : + with open(fpath) as f: + xmlString = f.readlines() + # Remove the first comment from xml files generated with DesignSPHysics + if (xmlString[0].count("