MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/SPlisHSPlasH / redoIt

Method redoIt

Scripts/Maya/SPlisHSPlasH.py:562–581  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

560
561
562 def redoIt(self):
563 sphConfigList = cmds.ls( type='SPHConfigurationNode', long=True )
564 if len(sphConfigList) == 0:
565 cmds.warning("Not saved since no SPH configuration node was found.")
566 return
567
568 if not cmds.pluginInfo("objExport", query=True, loaded=True):
569 cmds.loadPlugin("objExport")
570
571 fileName = cmds.fileDialog2(ff="*.json", fm=0, dir="")
572 scenePath = os.path.dirname(fileName[0])
573
574 scene=self.generateScene(scenePath)
575 if scene == None:
576 return
577
578 f = open(fileName[0], 'w')
579 json_str = json.dumps(scene, sort_keys=True,indent=4, separators=(',', ': '))
580 f.write(json_str)
581 f.close()
582
583 def isUndoable(self):
584 return False

Callers 1

doItMethod · 0.95

Calls 4

generateSceneMethod · 0.95
lenFunction · 0.85
writeMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected