예제 #1
0
def prismInit(prismArgs=[]):
    Dir = os.path.join(
        os.path.abspath(
            os.path.join(
                __file__,
                os.pardir,
                os.pardir,
                os.pardir,
                os.pardir,
                os.pardir,
                os.pardir,
                "Scripts",
            )
        )
    )

    if Dir not in sys.path:
        sys.path.append(Dir)

    if "hython" in os.path.basename(sys.executable).lower() and "noUI" not in prismArgs:
        prismArgs.append("noUI")

    import PrismCore

    pcore = PrismCore.PrismCore(app="Houdini", prismArgs=prismArgs)
    return pcore
예제 #2
0
def prismInit(prismArgs=[]):
    Dir = os.path.join(PRISMROOT, "Scripts")

    if Dir not in sys.path:
        sys.path.append(Dir)

    import PrismCore
    pcore = PrismCore.PrismCore(app="Houdini", prismArgs=prismArgs)
    return pcore
예제 #3
0
def prismInit():
    Dir = os.path.join(PRISMROOT, "Scripts")

    if Dir not in sys.path:
        sys.path.append(Dir)

    import PrismCore
    pcore = PrismCore.PrismCore(app="PluginEmtpy")
    return pcore
예제 #4
0
def startInstaller_Windows():
    if sys.argv[-1] != "asadmin":
        force_elevated()
        sys.exit()
    else:
        import PrismCore

        pc = PrismCore.PrismCore()
        if sys.argv[-2] == "uninstall":
            pc.openInstaller(uninstall=True)
        else:
            pc.openInstaller()
예제 #5
0
def prismInit(prismArgs=[]):
    prismRoot = os.getenv("PRISM_ROOT")
    if not prismRoot:
        prismRoot = PRISMROOT

    scriptDir = os.path.join(prismRoot, "Scripts")

    if scriptDir not in sys.path:
        sys.path.append(scriptDir)

    import PrismCore

    pcore = PrismCore.PrismCore(app="Maya", prismArgs=prismArgs)
    return pcore
예제 #6
0
def startInstaller_Windows():
	from win32com.shell import shell, shellcon
	documents = shell.SHGetFolderPath(0, shellcon.CSIDL_PERSONAL, None, 0)

	if sys.argv[-1] != 'asadmin':
		force_elevated()
		sys.exit()
	else:
		import PrismCore
		pc = PrismCore.PrismCore()
		if sys.argv[-2] == "uninstall":
			pc.openInstaller(uninstall=True)
		else:
			pc.openInstaller()
예제 #7
0
파일: PrismInit.py 프로젝트: tws0002/Prism
def prismInit():
    if platform.system() == "Windows":
        Dir = os.path.join(os.getenv('LocalAppdata'), "Prism", "Scripts")
    elif platform.system() == "Linux":
        Dir = "/usr/local/Prism/Scripts"
    elif platform.system() == "Darwin":
        Dir = "/Applications/Prism/Prism/Scripts"

    if Dir not in sys.path:
        sys.path.append(Dir)

    import PrismCore
    pcore = PrismCore.PrismCore(app="Maya")
    return pcore
예제 #8
0
def prismInit():
    prismRoot = os.getenv("PRISM_ROOT")
    if not prismRoot:
        prismRoot = PRISMROOT

    scriptDir = os.path.join(prismRoot, "Scripts")

    if scriptDir not in sys.path:
        sys.path.append(scriptDir)

    import PrismCore

    pcore = PrismCore.PrismCore(app="PluginEmtpy")
    return pcore
예제 #9
0
def startInstaller_Mac():
	try:
		if os.getuid() != 0:
			QMessageBox.warning(QWidget(), "Prism Installation", "Please run this installer as root to continue.")
			sys.exit()
			return

		import PrismCore
		pc = PrismCore.PrismCore()
		if sys.argv[-1] == "uninstall":
			pc.openInstaller(uninstall=True)
		else:
			pc.openInstaller()

	except Exception as e:
		exc_type, exc_obj, exc_tb = sys.exc_info()
		QMessageBox.warning(QWidget(), "Prism Installation", "Errors occurred during the installation.\n The installation is possibly incomplete.\n\n%s\n%s\n%s" % (str(e), exc_type, exc_tb.tb_lineno))
예제 #10
0
def startInstaller_Mac():
    try:
        if not checkRootUser():
            return

        import PrismCore

        pc = PrismCore.PrismCore()
        if sys.argv[-1] == "uninstall":
            pc.openInstaller(uninstall=True)
        else:
            pc.openInstaller()

    except Exception as e:
        exc_type, exc_obj, exc_tb = sys.exc_info()
        QMessageBox.warning(
            QWidget(),
            "Prism Installation",
            "Errors occurred during the installation.\n The installation is possibly incomplete.\n\n%s\n%s\n%s"
            % (str(e), exc_type, exc_tb.tb_lineno),
        )
예제 #11
0
			pythonPath = os.path.join(self.core.prismRoot, "Python27", "PrismTray.exe")
			for i in [slavePath, pythonPath]:
				if not os.path.exists(i):
					QMessageBox.warning(self.core.messageParent, "Script missing", "%s does not exist." % os.path.basename(i))
					return None

			command = ['%s' % pythonPath, '%s' % slavePath]
		elif platform.system() == "Linux":
			command = 'bash %s/Tools/PrismTray.sh' % self.core.prismRoot
		elif platform.system() == "Darwin":
			command = 'bash %s/Tools/PrismTray.sh' % self.core.prismRoot

		subprocess.Popen(command, shell=True)


	@err_decorator
	def enterEvent(self, event):
		QApplication.restoreOverrideCursor()



if __name__ == "__main__":
	qapp = QApplication(sys.argv)
	qapp.setStyleSheet(qdarkstyle.load_stylesheet(pyside=True))
	appIcon = QIcon(os.path.join(os.path.dirname(os.path.abspath(__file__)), "UserInterfacesPrism", "p_tray.png"))
	qapp.setWindowIcon(appIcon)
	import PrismCore
	pc = PrismCore.PrismCore(prismArgs=["loadProject", "silent"])

	pc.prismSettings()
	qapp.exec_()
예제 #12
0
import sys, os, platform
if os.path.basename(sys.executable) != "hython.exe":
    Dir = os.path.join(PRISMROOT, "Scripts")

    if Dir not in sys.path:
        sys.path.append(Dir)

    import PrismCore
    pcore = PrismCore.PrismCore(app="Houdini")
예제 #13
0
        self.inipath = inipath
        self.core.changeProject(self.inipath)

        self.pc = ProjectCreated.ProjectCreated(self.e_name.text(),
                                                core=self.core,
                                                basepath=path)
        self.pc.exec_()

        self.close()

    @err_decorator
    def closeEvent(self, event):
        self.setParent(None)


if __name__ == "__main__":
    qapp = QApplication(sys.argv)
    qapp.setStyleSheet(qdarkstyle.load_stylesheet(pyside=True))
    appIcon = QIcon(
        os.path.join(os.path.dirname(os.path.abspath(__file__)),
                     "UserInterfacesPrism", "p_tray.png"))
    qapp.setWindowIcon(appIcon)
    import PrismCore
    pc = PrismCore.PrismCore()
    try:
        pc.createProject()
    except Exception as e:
        exc_type, exc_obj, exc_tb = sys.exc_info()
        print("ERROR -- %s\n%s\n%s" % (str(e), exc_type, exc_tb.tb_lineno))

    qapp.exec_()
예제 #14
0
    prismRoot = PRISMROOT

sys.path.append(os.path.join(prismRoot, "Scripts"))
sys.path.append(os.path.join(prismRoot, "PythonLibs", "Python27", "PySide"))
sys.path.append(os.path.join(prismRoot, "PythonLibs", "Python37", "PySide"))

try:
    from PySide2.QtCore import *
    from PySide2.QtGui import *
    from PySide2.QtWidgets import *
except:
    from PySide.QtCore import *
    from PySide.QtGui import *

qapp = QApplication.instance()
if qapp == None:
    qapp = QApplication(sys.argv)

import PrismCore

pcore = PrismCore.PrismCore(app="Fusion")
pcore.appPlugin.fusion = fusion

curPrj = pcore.getConfig("globals", "current project")
if curPrj is not None and curPrj != "":
    pcore.changeProject(curPrj, openUi="prismSettings", settingsTab=0)
else:
    pcore.prismSettings()

qapp.exec_()
예제 #15
0
try:
    from PySide2.QtCore import *
    from PySide2.QtGui import *
    from PySide2.QtWidgets import *
    psVersion = 2
except:
    from PySide.QtCore import *
    from PySide.QtGui import *
    psVersion = 1

qapp = QApplication.instance()
if qapp == None:
    qapp = QApplication(sys.argv)

import PrismCore
pcore = PrismCore.PrismCore(app="Photoshop")

curPrj = pcore.getConfig("globals", "current project")
pcore.changeProject(curPrj)

result = False
if sys.argv[1] == "Tools":
    result = pcore.appPlugin.openPhotoshopTools()
elif sys.argv[1] == "SaveVersion":
    pcore.saveScene()
elif sys.argv[1] == "SaveComment":
    pcore.saveWithComment()
elif sys.argv[1] == "Export":
    result = pcore.appPlugin.exportImage()
elif sys.argv[1] == "ProjectBrowser":
    result = pcore.projectBrowser()
예제 #16
0
def prismInit():
	import PrismCore
	pcore = PrismCore.PrismCore(app="Blender")
	return pcore
예제 #17
0
import bpy
from bpy import context as context

from pathlib import Path

import PrismCore

global pcore
pcore = PrismCore.PrismCore(app="Blender")


def renderPngPasses(context):
    ''' 
        this function will setup PNG and output passes as well
    '''
    pcore.projectPath
    pcore.scenePath  # points to workflow dir
    pcore.shotPath  # points to shots folder
    pcore.fileInPipeline(bpy.data.filepath)
    bfp = Path(bpy.data.filepath)
    #filename = bpy.path.basename(bpy.data.filepath)
    filename = bfp.name
    filepath = bfp.parent
    shotdir = bfp.parent.parent.parent.parent
    if shotdir.is_dir():
        rendDir = shotdir.joinpath("Rendering", "3dRender")
    # now get file version string
    verInfo = filename.split(pcore.filenameSeparator)[4]  # .sequenceSeparato
    verFormat = pcore.versionFormat

    # create / output dir exists
예제 #18
0
import os, sys, platform

prismRoot = PRISMROOT

sys.path.append(os.path.join(prismRoot, "Scripts"))
sys.path.append(os.path.join(prismRoot, "PythonLibs", "Python27", "PySide"))

try:
	from PySide2.QtCore import *
	from PySide2.QtGui import *
	from PySide2.QtWidgets import *
except:
	from PySide.QtCore import *
	from PySide.QtGui import *

qapp = QApplication.instance()
if qapp == None:
  qapp = QApplication(sys.argv)


import PrismCore
pcore = PrismCore.PrismCore(app='Fusion')
pcore.appPlugin.fusion = fusion

curPrj = pcore.getConfig("globals", "current project")
if curPrj is not None and curPrj != "":
	pcore.changeProject(curPrj)
	pcore.saveScene()
else:
	QMessageBox.warning(pcore.messageParent, "Prism warning", "No project is active.\nPlease set a project in the Prism Settings or by opening the Project Browser.")
예제 #19
0
                            continue
                        p = psutil.Process(proc.pid)

                        if not "SYSTEM" in p.username():
                            proc.kill()

        except Exception as e:
            exc_type, exc_obj, exc_tb = sys.exc_info()
            self.trayIcon.showMessage(
                "Unknown Error",
                "openSettings - %s - %s - %s" % (str(e), exc_type, exc_tb.tb_lineno),
                icon=QSystemTrayIcon.Critical,
            )

    def exitTray(self):
        qApp.quit()


if __name__ == "__main__":
    qApp = QApplication(sys.argv)
    qApp.setQuitOnLastWindowClosed(False)
    qApp.setStyleSheet(qdarkstyle.load_stylesheet(pyside=True))

    if not QSystemTrayIcon.isSystemTrayAvailable():
        QMessageBox.critical(None, "PrismTray", "Could not launch PrismTray. Tray icons are not supported on this OS.")
        sys.exit(1)

    pc = PrismCore.PrismCore(prismArgs=["loadProject", "noProjectBrowser", "tray"])
    pc.startTray()
    sys.exit(qApp.exec_())
예제 #20
0
#>>>PrismStart
import nuke
if not nuke.env["studio"] and nuke.env.get("gui"):
    import sys, os

    Dir = os.path.join(PRISMROOT, "Scripts")
    if Dir not in sys.path:
        sys.path.append(Dir)

    import PrismCore
    pcore = PrismCore.PrismCore(app="Nuke")
#<<<PrismEnd
예제 #21
0
try:
    from PySide2.QtCore import *
    from PySide2.QtGui import *
    from PySide2.QtWidgets import *
except:
    from PySide.QtCore import *
    from PySide.QtGui import *

qapp = QApplication.instance()
if qapp == None:
    qapp = QApplication(sys.argv)

import PrismCore

pcore = PrismCore.PrismCore(app='Fusion', prismArgs=["parentWindows"])
pcore.appPlugin.fusion = fusion

curPrj = pcore.getConfig('globals', 'current project')
if curPrj is not None and curPrj != "":
    pcore.changeProject(curPrj)
    tool = comp.ActiveTool
    try:
        versionPath = os.path.dirname(tool.GetAttrs()["TOOLST_Clip_Name"][1])
        if not os.path.exists(versionPath):
            versionPath = os.path.dirname(versionPath)
    except:
        versionPath = ""

    if os.path.exists(versionPath):
        pcore.openFolder(versionPath)
예제 #22
0
import os
import sys

prismRoot = os.getenv("PRISM_ROOT")
if not prismRoot:
    prismRoot = PRISMROOT

scriptDir = os.path.join(prismRoot, "Scripts")
if scriptDir not in sys.path:
    sys.path.append(scriptDir)

import PrismCore

pcore = PrismCore.PrismCore(app="3dsMax")
예제 #23
0
파일: initGui.py 프로젝트: tws0002/Prism
#>>>PrismStart
if not NatronEngine.natron.isBackground():
    import sys, os, platform

    if platform.system() == "Windows":
        prismRoot = os.path.join(os.getenv('LocalAppdata'), "Prism")
    elif platform.system() == "Linux":
        prismRoot = "/usr/local/Prism"
    elif platform.system() == "Darwin":
        prismRoot = "/Applications/Prism/Prism"

    Dir = os.path.join(prismRoot, "Scripts")
    if Dir not in sys.path:
        sys.path.append(Dir)

    import PrismCore
    pcore = PrismCore.PrismCore(app="Natron")


def writePrismParamChanged(thisParam, thisNode, thisGroup, app, userEdited):
    pcore.plugin.wpParamChanged(thisParam, thisNode, thisGroup, app,
                                userEdited)


#<<<PrismEnd