Skip to content

Commit e0e2300

Browse files
committed
Update ShapeworksRunner.py
1 parent a5e2a78 commit e0e2300

File tree

1 file changed

+6
-14
lines changed

1 file changed

+6
-14
lines changed

ShapeworksRunner/ShapeworksRunner.py

Lines changed: 6 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -487,31 +487,23 @@ def saveProject(self):
487487

488488
def saveGroomedFiles(self):
489489
dir = qt.QFileDialog.getExistingDirectory(None, "Open Directory", self.shapeworksTempDir, qt.QFileDialog.ShowDirsOnly | qt.QFileDialog.DontResolveSymlinks)
490-
#print("Dir to save groomed files:", dir)
491490
with open(self.projectFileName) as projFile:
492491
data = json.load(projFile)
493-
#print(data["data"])
494492
for d in data["data"]:
495-
#print(d["name"])
496-
#print(d["groomed_file"])
497-
_, groomFile = os.path.split(d["groomed_file"])
498-
fullGroomPath = os.path.join(self.shapeworksTempDir, d["groomed_file"])
499-
#print(fullGroomPath)
493+
_, filename = os.path.split(d["groomed_file"])
494+
fileToCopy = os.path.join(self.shapeworksTempDir, d["groomed_file"])
500495
import shutil
501-
shutil.copyfile(fullGroomPath, os.path.join(dir, groomFile))
496+
shutil.copyfile(fileToCopy, os.path.join(dir, filename))
502497

503498
def saveOptimizedFiles(self):
504499
dir = qt.QFileDialog.getExistingDirectory(None, "Open Directory", self.shapeworksTempDir, qt.QFileDialog.ShowDirsOnly | qt.QFileDialog.DontResolveSymlinks)
505500
with open(self.projectFileName) as projFile:
506501
data = json.load(projFile)
507502
for d in data["data"]:
508-
#print(d["name"])
509-
#print(d["groomed_file"])
510-
_, groomFile = os.path.split(d["world_particles_file"])
511-
fullGroomPath = os.path.join(self.shapeworksTempDir, d["world_particles_file"])
512-
#print(fullGroomPath)
503+
_, filename = os.path.split(d["world_particles_file"])
504+
fileToCopy = os.path.join(self.shapeworksTempDir, d["world_particles_file"])
513505
import shutil
514-
shutil.copyfile(fullGroomPath, os.path.join(dir, groomFile))
506+
shutil.copyfile(fileToCopy, os.path.join(dir, filename))
515507

516508
def runShapeworksCommand(self, inputParams, name):
517509
swCmd = "{0}: {1} {2}".format(name, self.shapeworksPath, ' '.join(inputParams))

0 commit comments

Comments
 (0)