Skip to content

Commit

Permalink
Another attempted fix to shouldBake.json issue
Browse files Browse the repository at this point in the history
  • Loading branch information
pramberg committed Aug 25, 2023
1 parent 82038f2 commit 4216a0b
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Content/mayaToPainter.py
Original file line number Diff line number Diff line change
Expand Up @@ -538,10 +538,14 @@ def getPathToPainterPlugin():
# current value in the options.
def updateAutoBakeJSON():
pathToPainterPlugin = getPathToPainterPlugin()
with open(pathToPainterPlugin + 'shouldBake.json', 'r') as shouldBakeJSON:
pathToShouldBake = pathToPainterPlugin + 'shouldBake.json'
if not os.path.exists(pathToShouldBake):
return

with open(pathToShouldBake, 'r') as shouldBakeJSON:
obj = json.loads(shouldBakeJSON.read())
obj['shouldBake'] = pm.optionVar["mayaToPainterShouldBake"]
with open(pathToPainterPlugin + 'shouldBake.json', 'w') as shouldBakeJSON:
with open(pathToShouldBake, 'w') as shouldBakeJSON:
json.dump(obj, shouldBakeJSON)


Expand Down

0 comments on commit 4216a0b

Please sign in to comment.