Skip to content

Commit

Permalink
photoshop script fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RichardFrangenberg committed Dec 13, 2018
1 parent c3685b2 commit 9109222
Show file tree
Hide file tree
Showing 17 changed files with 49 additions and 35 deletions.
5 changes: 3 additions & 2 deletions Prism/Plugins/Apps/3dsMax/Scripts/Prism_3dsMax_Integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,10 +174,11 @@ def writeMaxFiles(self, installPath):
origInitFile = os.path.join(integrationBase, "initPrism.py")
shutil.copy2(origInitFile, initPy)

with open(initPy, "r+") as init:
with open(initPy, "r") as init:
initStr = init.read()

with open(initPy, "w") as init:
initStr = initStr.replace("PRISMROOT", "\"%s\"" % self.core.prismRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

prismMenu = os.path.join(maxpath, "PrismMenu.ms")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,10 +168,11 @@ def writeBlenderFiles(self, blenderPath):
shutil.copy2(baseinitfile, initpath)
addedFiles.append(initpath)

with open(initpath, "r+") as init:
with open(initpath, "r") as init:
initStr = init.read()

with open(initpath, "w") as init:
initStr = initStr.replace("PRISMROOT", "\"%s\"" % self.core.prismRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

baseRenderfile = os.path.join(integrationBase, "PrismAutoSaveRender.py")
Expand Down
20 changes: 12 additions & 8 deletions Prism/Plugins/Apps/Fusion/Scripts/Prism_Fusion_Integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,11 @@ def writeFusionFiles(self, fusionpath):
shutil.copy2(origFile, targetFile)
addedFiles.append(targetFile)

with open(targetFile, "r+") as init:
with open(targetFile, "r") as init:
initStr = init.read()
initStr = initStr.replace("PRISMROOT", "\"%s\"" % self.core.prismRoot.replace("\\", "/"))
init.seek(0)

with open(targetFile, "w") as init:
init.write(initStr)

if platform.system() == "Windows":
Expand All @@ -159,10 +160,11 @@ def writeFusionFiles(self, fusionpath):
shutil.copy2(origFile, targetFile)
addedFiles.append(targetFile)

with open(targetFile, "r+") as init:
with open(targetFile, "r") as init:
initStr = init.read()

with open(targetFile, "w") as init:
initStr = initStr.replace("PRISMROOT", "\"%s\"" % self.core.prismRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

for i in ["1 Save Version.py", "2 Save Comment.py", "3 Project Browser.py", "4 Update selected load nodes.py", "5 Settings.py"]:
Expand All @@ -179,10 +181,11 @@ def writeFusionFiles(self, fusionpath):
shutil.copy2(origFile, targetFile)
addedFiles.append(targetFile)

with open(targetFile, "r+") as init:
with open(targetFile, "r") as init:
initStr = init.read()

with open(targetFile, "w") as init:
initStr = initStr.replace("PRISMROOT", "\"%s\"" % self.core.prismRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

for i in ["WritePrism.setting"]:
Expand All @@ -199,10 +202,11 @@ def writeFusionFiles(self, fusionpath):
shutil.copy2(origFile, targetFile)
addedFiles.append(targetFile)

with open(targetFile, "r+") as init:
with open(targetFile, "r") as init:
initStr = init.read()

with open(targetFile, "w") as init:
initStr = initStr.replace("PRISMROOT", "\"%s\"" % self.core.prismRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

if platform.system() in ["Linux", "Darwin"]:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,10 +209,11 @@ def writeHoudiniFiles(self, houdiniPath):
shutil.copy2(origInitFile, initpath)
addedFiles.append(initpath)

with open(initpath, "r+") as init:
with open(initpath, "r") as init:
initStr = init.read()

with open(initpath, "w") as init:
initStr = initStr.replace("PRISMROOT", "\"%s\"" % self.core.prismRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)


Expand Down
5 changes: 3 additions & 2 deletions Prism/Plugins/Apps/Maya/Scripts/Prism_Maya_Integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,10 +204,11 @@ def writeMayaFiles(self, mayaPath):
shutil.copy2(origInitFile, initpath)
addedFiles.append(initpath)

with open(initpath, "r+") as init:
with open(initpath, "r") as init:
initStr = init.read()

with open(initpath, "w") as init:
initStr = initStr.replace("PRISMROOT", "\"%s\"" % self.core.prismRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

shelfpath = os.path.join(mayaPath, "prefs", "shelves", "shelf_Prism.mel")
Expand Down
5 changes: 3 additions & 2 deletions Prism/Plugins/Apps/Natron/Scripts/Prism_Natron_Integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,10 +144,11 @@ def writeNatronFiles(self, natronpath):
with open(initFile, 'a') as initfile:
initfile.write(initString)

with open(initFile, "r+") as init:
with open(initFile, "r") as init:
initStr = init.read()

with open(initFile, "w") as init:
initStr = initStr.replace("PRISMROOT", "\"%s\"" % self.core.prismRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

addedFiles.append(initFile)
Expand Down
5 changes: 3 additions & 2 deletions Prism/Plugins/Apps/Nuke/Scripts/Prism_Nuke_Integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,11 @@ def writeNukeFiles(self, nukepath):
with open(menuFile, 'a') as initfile:
initfile.write(initString)

with open(menuFile, "r+") as init:
with open(menuFile, "r") as init:
initStr = init.read()

with open(menuFile, "w") as init:
initStr = initStr.replace("PRISMROOT", "\"%s\"" % self.core.prismRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

addedFiles.append(menuFile)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
app.system("start "PRISMROOT/Python27/PrismProjectBrowser.exe" "PRISMROOT/Plugins/Apps/Photoshop/Scripts/Prism_Photoshop_MenuTools.py" Tools")
app.system('start "" "PRISMROOT/Python27/PrismProjectBrowser.exe" "PRISMROOT/Plugins/Apps/Photoshop/Scripts/Prism_Photoshop_MenuTools.py" Tools')
Original file line number Diff line number Diff line change
@@ -1 +1 @@
app.system("start "PRISMROOT/Python27/PrismProjectBrowser.exe" "PRISMROOT/Plugins/Apps/Photoshop/Scripts/Prism_Photoshop_MenuTools.py" SaveVersion")
app.system('start "" "PRISMROOT/Python27/PrismProjectBrowser.exe" "PRISMROOT/Plugins/Apps/Photoshop/Scripts/Prism_Photoshop_MenuTools.py" SaveVersion')
Original file line number Diff line number Diff line change
@@ -1 +1 @@
app.system("start "PRISMROOT/Python27/PrismProjectBrowser.exe" "PRISMROOT/Plugins/Apps/Photoshop/Scripts/Prism_Photoshop_MenuTools.py" SaveComment")
app.system('start "" "PRISMROOT/Python27/PrismProjectBrowser.exe" "PRISMROOT/Plugins/Apps/Photoshop/Scripts/Prism_Photoshop_MenuTools.py" SaveComment')
Original file line number Diff line number Diff line change
@@ -1 +1 @@
app.system("start "PRISMROOT/Python27/PrismProjectBrowser.exe" "PRISMROOT/Plugins/Apps/Photoshop/Scripts/Prism_Photoshop_MenuTools.py" Export")
app.system('start "" "PRISMROOT/Python27/PrismProjectBrowser.exe" "PRISMROOT/Plugins/Apps/Photoshop/Scripts/Prism_Photoshop_MenuTools.py" Export')
Original file line number Diff line number Diff line change
@@ -1 +1 @@
app.system("start "PRISMROOT/Python27/PrismProjectBrowser.exe" "PRISMROOT/Plugins/Apps/Photoshop/Scripts/Prism_Photoshop_MenuTools.py" ProjectBrowser")
app.system('start "" "PRISMROOT/Python27/PrismProjectBrowser.exe" "PRISMROOT/Plugins/Apps/Photoshop/Scripts/Prism_Photoshop_MenuTools.py" ProjectBrowser')
Original file line number Diff line number Diff line change
@@ -1 +1 @@
app.system("start \"PRISMROOT/Python27/PrismSettings.exe\" \"PRISMROOT/Plugins/Apps/Photoshop/Scripts/Prism_Photoshop_MenuTools.py\" Settings")
app.system('start "" "PRISMROOT/Python27/PrismSettings.exe" "PRISMROOT/Plugins/Apps/Photoshop/Scripts/Prism_Photoshop_MenuTools.py" Settings')
Original file line number Diff line number Diff line change
Expand Up @@ -140,10 +140,12 @@ def writePhotoshopFiles(self, photoshoppath):

shutil.copy2(origFile, targetFile)

with open(targetFile, "r+") as init:
with open(targetFile, "r") as init:
initStr = init.read()
initStr = initStr.replace("PRISMROOT", "%s" % self.core.prismRoot.replace("\\", "/"))
init.seek(0)

initStr = initStr.replace("PRISMROOT", "%s" % self.core.prismRoot.replace("\\", "/"))

with open(targetFile, "w") as init:
init.write(initStr)

return True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

import os, sys, platform

prismRoot = os.path.abspath(os.path.join(os.pardir, os.pardir, os.pardir, os.pardir, os.pardir, __file__))
prismRoot = os.path.abspath(os.path.join(__file__, os.pardir, os.pardir, os.pardir, os.pardir, os.pardir))

sys.path.append(os.path.join(prismRoot, "Scripts"))
sys.path.append(os.path.join(prismRoot, "PythonLibs", "Python27", "PySide"))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -201,10 +201,11 @@ def createWinStartMenu(self, origin):

for i in [trayLnk, pbLnk, settingsLnk, pMenuSource]:
if os.path.exists(i):
with open(i, "r+") as init:
with open(i, "r") as init:
initStr = init.read()

with open(i, "w") as init:
initStr = initStr.replace("PRISMROOT", self.core.prismRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

if not os.path.exists(os.path.dirname(pMenuTarget)):
Expand Down Expand Up @@ -254,10 +255,11 @@ def createWinStartMenu(self, origin):
settingsLnk = os.path.join(self.core.prismRoot, "Tools", "Prism Settings.app")

if os.path.exists(trayStartupSrc):
with open(trayStartupSrc, "r+") as init:
with open(trayStartupSrc, "r") as init:
initStr = init.read()

with open(trayStartupSrc, "w") as init:
initStr = initStr.replace("PRISMROOT", self.core.prismRoot.replace("\\", "/"))
init.seek(0)
init.write(initStr)

cbPath = os.path.join(self.core.prismRoot, "Tools", "PrismTray.sh")
Expand Down
2 changes: 1 addition & 1 deletion Prism/Scripts/PrismCore.py
Original file line number Diff line number Diff line change
Expand Up @@ -2642,7 +2642,7 @@ def saveVersionInfo(self, location, version, origin=None, fps=None, filenameBase
deps = eval(deps.replace("\\", "/").replace("//", "/"))
deps = str([str(x[0]) for x in deps])

extFiles = self.appPlugin.sm_getExternalFiles(self)[0]
extFiles = getattr(self.appPlugin, "sm_getExternalFiles", lambda x: [[],[]])(self)[0]
extFiles = str(list(set(extFiles)))

data["Dependencies"] = deps
Expand Down

0 comments on commit 9109222

Please sign in to comment.