コード例 #1
0
def checkin():
    print "checkin"
    saveFile()  # save the file before doing anything
    print "save"
    filePath = cmds.file(q=True, sceneName=True)
    print "filePath: " + filePath
    toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filePath)))
    print "toCheckin: " + toCheckin
    toInstall = isRigAsset()
    specialInstallFiles = [os.path.join(os.environ["SHOTS_DIR"], "static/animation")]
    anim = isAnimationAsset()
    references = cmds.ls(references=True)
    loaded = []
    if amu.canCheckin(toCheckin) and saveGeo():  # objs must be saved before checkin
        comment = "Comment"
        commentPrompt = cmds.promptDialog(
            title="Comment",
            message="What changes did you make?",
            button=["OK", "Cancel"],
            defaultButton="OK",
            dismissString="Cancel",
            sf=True,
        )
        if commentPrompt == "OK":
            comment = cmds.promptDialog(query=True, text=True)
        else:
            return
        amu.setComment(toCheckin, comment)
        dest = amu.getCheckinDest(toCheckin)
        # if anim and showConfirmAlembicDialog() == 'Yes':
        #   for ref in references:
        #     if cmds.referenceQuery(ref, isLoaded=True):
        #       loaded.append(ref)
        #       cmds.file(unloadReference=ref)
        #   print loaded
        #   for ref in loaded:
        #     cmds.file(loadReference=ref)
        #     refPath = cmds.referenceQuery(ref, filename=True)
        #     assetName = getAssetName(refPath)
        #     print "\n\n\n\n**************************************************************\n"
        #     print dest
        #     print filePath
        #     print refPath
        #     print assetName
        #     saveFile()
        #     amu.runAlembicConverter(dest, filePath, filename=assetName)
        #     cmds.file(unloadReference=ref)

        #   for ref in loaded:
        #     cmds.file(loadReference=ref)

        saveFile()
        cmds.file(force=True, new=True)  # open new file
        dest = amu.checkin(toCheckin)  # checkin
        toInstall |= dest in specialInstallFiles
        srcFile = amu.getAvailableInstallFiles(dest)[0]
        if toInstall:
            amu.install(dest, srcFile)
    else:
        showFailDialog()
コード例 #2
0
def checkin(node = None):
    """Checks in the selected node.  EXACTLY ONE node may be selected, and it MUST be a digital asset.
        The node must already exist in the database, and USERNAME must have the lock."""
    if not isDigitalAsset(node):
        hou.ui.displayMessage("Not a Digital Asset.")
    else:
        libraryPath = node.type().definition().libraryFilePath() #user checkout folder
        filename = os.path.basename(libraryPath) # otl filename
        toCheckin = os.path.dirname(libraryPath)

        if os.path.exists(os.path.join(toCheckin, ".checkoutInfo")) and amu.canCheckin(toCheckin):
            lockAsset(node, False)
            saveOTL(node)
            node.type().definition().save(libraryPath)
            hou.hda.uninstallFile(libraryPath, change_oplibraries_file=False)
            assetdir = amu.checkin(toCheckin, False)
            assetpath = amu.getAvailableInstallFiles(assetdir)[0]
            amu.install(assetdir, assetpath)
            hou.hda.installFile(os.path.join(OTLDIR, filename), change_oplibraries_file=True)
            hou.hda.uninstallFile("Embedded")
            if isCameraAsset(node) and hou.ui.displayMessage('Export Alembic?'
                                                        , buttons=('Yes','No',)
                                                        , default_choice=0
                                                        , title='Export Alembic') == 0:
                writeCamerasToAlembic(node)
            if isSetAsset(node) and hou.ui.displayMessage('Export Alembic?'
                                                        , buttons=('Yes','No',)
                                                        , default_choice=0
                                                        , title='Export Alembic') == 0:
                writeSetToAlembic(node)
            hou.ui.displayMessage("Checkin Successful!")

        else:
            hou.ui.displayMessage('Can Not Checkin.')
コード例 #3
0
def checkinLightingFile():
    print('checkin lighting file')
    filepath = hou.hipFile.path()
    toCheckin = os.path.join(amu.getUserCheckoutDir(),
                             os.path.basename(os.path.dirname(filepath)))
    backups = os.path.join(toCheckin, 'backup')
    print 'backup = ' + backups
    if os.path.isdir(backups):
        os.system('rm -rf ' + backups)
    if amu.canCheckin(toCheckin):
        response = hou.ui.readInput("What did you change?",
                                    buttons=(
                                        'OK',
                                        'Cancel',
                                    ),
                                    title='Comment')
        if (response[0] != 0):
            return
        comment = response[1]
        hou.hipFile.save()
        hou.hipFile.clear()
        amu.setComment(toCheckin, comment)
        dest = amu.checkin(toCheckin)
        srcFile = amu.getAvailableInstallFiles(dest)[0]
        amu.install(dest, srcFile)
    else:
        hou.ui.displayMessage('Checkin Failed')
コード例 #4
0
def checkin():
        print 'checkin'
        saveFile() # save the file before doing anything
        print 'save'
        filePath = cmds.file(q=True, sceneName=True)
        print 'filePath: '+filePath
        toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filePath)))
        print 'toCheckin: '+toCheckin
        toInstall = isRigAsset()
	specialInstallFiles = [os.path.join(os.environ['SHOTS_DIR'], 'static/animation')]
        anim = isAnimationAsset()
        references = cmds.ls(references=True)
        loaded = []
        if amu.canCheckin(toCheckin) and saveGeo(): # objs must be saved before checkin
		comment = 'Comment'
		commentPrompt = cmds.promptDialog(
				    title='Comment',
				    message='What changes did you make?',
				    button=['OK','Cancel'],
				    defaultButton='OK',
				    dismissString='Cancel',
				sf = True)
		if commentPrompt == 'OK':
			comment = cmds.promptDialog(query=True, text=True);
		else:
			return
		amu.setComment(toCheckin, comment)
                dest = amu.getCheckinDest(toCheckin)
                # if anim and showConfirmAlembicDialog() == 'Yes':
                #   for ref in references:
                #     if cmds.referenceQuery(ref, isLoaded=True):
                #       loaded.append(ref)
                #       cmds.file(unloadReference=ref)
                #   print loaded
                #   for ref in loaded:
                #     cmds.file(loadReference=ref)
                #     refPath = cmds.referenceQuery(ref, filename=True)
                #     assetName = getAssetName(refPath)
                #     print "\n\n\n\n**************************************************************\n"
                #     print dest
                #     print filePath
                #     print refPath
                #     print assetName
                #     saveFile()
                #     amu.runAlembicConverter(dest, filePath, filename=assetName)
                #     cmds.file(unloadReference=ref)

                #   for ref in loaded:
                #     cmds.file(loadReference=ref)

                saveFile()
                cmds.file(force=True, new=True) #open new file
                dest = amu.checkin(toCheckin) #checkin
		toInstall |= (dest in specialInstallFiles)
                srcFile = amu.getAvailableInstallFiles(dest)[0]
                if toInstall:
                    amu.install(dest, srcFile)
        else:
                showFailDialog()
コード例 #5
0
def checkin():
        print 'checkin'
        saveFile() # save the file before doing anything
        print 'save'
        filePath = cmds.file(q=True, sceneName=True)
        print 'filePath: '+filePath
        toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filePath)))
        print 'toCheckin: '+toCheckin
        rig = isRigAsset()
        anim = isAnimationAsset()
        references = cmds.ls(references=True)
        loaded = []
        if amu.canCheckin(toCheckin) and saveGeo(): # objs must be saved before checkin
		comment = 'Comment'
		commentPrompt = cmds.promptDialog(
				    title='Comment',
				    message='What changes did you make?',
				    button=['OK','Cancel'],
				    defaultButton='OK',
				    dismissString='Cancel',
				sf = True)
		if commentPrompt == 'OK':
			comment = cmds.promptDialog(query=True, text=True);
		else:
			return
		amu.setComment(toCheckin, comment)
                dest = amu.getCheckinDest(toCheckin)
                # if anim and showConfirmAlembicDialog() == 'Yes':
                #   for ref in references:
                #     if cmds.referenceQuery(ref, isLoaded=True):
                #       loaded.append(ref)
                #       cmds.file(unloadReference=ref)
                #   print loaded
                #   for ref in loaded:
                #     cmds.file(loadReference=ref)
                #     refPath = cmds.referenceQuery(ref, filename=True)
                #     assetName = getAssetName(refPath)
                #     print "\n\n\n\n**************************************************************\n"
                #     print dest
                #     print filePath
                #     print refPath
                #     print assetName
                #     saveFile()
                #     amu.runAlembicConverter(dest, filePath, filename=assetName)
                #     cmds.file(unloadReference=ref)

                #   for ref in loaded:
                #     cmds.file(loadReference=ref)

                saveFile()
                cmds.file(force=True, new=True) #open new file
                dest = amu.checkin(toCheckin) #checkin
                srcFile = amu.getAvailableInstallFiles(dest)[0]
                if rig:
                    amu.install(dest, srcFile)
        else:
                showFailDialog()
コード例 #6
0
def checkinLightingFile():
    print("checkin lighting file")
    filepath = hou.hipFile.path()
    toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filepath)))
    if amu.canCheckin(toCheckin):
        hou.hipFile.save()
        hou.hipFile.clear()
        dest = amu.checkin(toCheckin, False)
        srcFile = amu.getAvailableInstallFiles(dest)[0]
        amu.install(dest, srcFile)
    else:
        ui.infoWindow("Checkin Failed")
コード例 #7
0
def checkin():
    print 'checkin'
    saveFile()  # save the file before doing anything
    print 'save'
    filePath = cmds.file(q=True, sceneName=True)
    print 'filePath: ' + filePath
    toCheckin = os.path.join(amu.getUserCheckoutDir(),
                             os.path.basename(os.path.dirname(filePath)))
    print 'toCheckin: ' + toCheckin
    rig = isRigAsset()
    anim = isAnimationAsset()
    references = cmds.ls(references=True)
    loaded = []
    if amu.canCheckin(
            toCheckin) and saveGeo():  # objs must be saved before checkin
        dest = amu.getCheckinDest(toCheckin)
        # if anim and showConfirmAlembicDialog() == 'Yes':
        #   for ref in references:
        #     if cmds.referenceQuery(ref, isLoaded=True):
        #       loaded.append(ref)
        #       cmds.file(unloadReference=ref)
        #   print loaded
        #   for ref in loaded:
        #     cmds.file(loadReference=ref)
        #     refPath = cmds.referenceQuery(ref, filename=True)
        #     assetName = getAssetName(refPath)
        #     print "\n\n\n\n**************************************************************\n"
        #     print dest
        #     print filePath
        #     print refPath
        #     print assetName
        #     saveFile()
        #     amu.runAlembicConverter(dest, filePath, filename=assetName)
        #     cmds.file(unloadReference=ref)

        #   for ref in loaded:
        #     cmds.file(loadReference=ref)

        saveFile()
        cmds.file(force=True, new=True)  #open new file
        dest = amu.checkin(toCheckin, anim or rig
                           or os.path.basename(os.path.dirname(filePath))[:32]
                           == 'owned_jeff_apartment_walls_model')  #checkin
        srcFile = amu.getAvailableInstallFiles(dest)[0]
        if rig:
            amu.install(dest, srcFile)
    else:
        showFailDialog()
コード例 #8
0
def checkinLightingFile():
    print('checkin lighting file')
    filepath = hou.hipFile.path()
    toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filepath)))
    backups = os.path.join(toCheckin, 'backup')
    print 'backup = ' + backups
    if os.path.isdir(backups):
        os.system('rm -rf '+backups)
    if amu.canCheckin(toCheckin):
        hou.hipFile.save()
        hou.hipFile.clear()
        dest = amu.checkin(toCheckin, False)
        srcFile = amu.getAvailableInstallFiles(dest)[0]
        amu.install(dest, srcFile)
    else:
        ui.infoWindow('Checkin Failed')
コード例 #9
0
def checkinLightingFile():
    print('checkin lighting file')
    filepath = hou.hipFile.path()
    toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filepath)))
    backups = os.path.join(toCheckin, 'backup')
    print 'backup = ' + backups
    if os.path.isdir(backups):
        os.system('rm -rf '+backups)
    if amu.canCheckin(toCheckin):
        hou.hipFile.save()
        hou.hipFile.clear()
        dest = amu.checkin(toCheckin, False)
        srcFile = amu.getAvailableInstallFiles(dest)[0]
        amu.install(dest, srcFile)
    else:
        ui.infoWindow('Checkin Failed')
コード例 #10
0
def checkinLightingFile():
    print ("checkin lighting file")
    filepath = hou.hipFile.path()
    toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filepath)))
    backups = os.path.join(toCheckin, "backup")
    print "backup = " + backups
    if os.path.isdir(backups):
        os.system("rm -rf " + backups)
    if amu.canCheckin(toCheckin):
        hou.hipFile.save()
        hou.hipFile.clear()
        dest = amu.checkin(toCheckin, False)
        srcFile = amu.getAvailableInstallFiles(dest)[0]
        amu.install(dest, srcFile)
    else:
        hou.ui.displayMessage("Checkin Failed")
コード例 #11
0
def checkin():
        print 'checkin'
        saveFile() # save the file before doing anything
        print 'save'
        filePath = cmds.file(q=True, sceneName=True)
        print 'filePath: '+filePath
        toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filePath)))
        print 'toCheckin: '+toCheckin
        rig = isRigAsset()
        if amu.canCheckin(toCheckin) and saveGeo(): # objs must be saved before checkin
                cmds.file(force=True, new=True) #open new file
                dest = amu.checkin(toCheckin) #checkin
                if rig:
                    srcFile = amu.getAvailableInstallFiles(dest)[0]
                    amu.install(dest, srcFile)
        else:
                showFailDialog()
コード例 #12
0
def checkin(node=None):
    """Checks in the selected node.  EXACTLY ONE node may be selected, and it MUST be a digital asset.
        The node must already exist in the database, and USERNAME must have the lock."""
    if not hou_asset_mgr.isDigitalAsset(node):
        hou.ui.displayMessage("Not a Digital Asset.")
    else:
        libraryPath = node.type().definition().libraryFilePath()  # user checkout folder
        filename = os.path.basename(libraryPath)  # otl filename
        toCheckin = os.path.dirname(libraryPath)

        if os.path.exists(os.path.join(toCheckin, ".checkoutInfo")) and amu.canCheckin(toCheckin):
            response = hou.ui.readInput("What did you change?", buttons=("OK", "Cancel"), title="Comment")
            if response[0] != 0:
                return
            comment = response[1]
            hou_asset_mgr.lockAsset(node, False)
            hou_asset_mgr.saveOTL(node)
            node.type().definition().save(libraryPath)
            hou.hda.uninstallFile(libraryPath, change_oplibraries_file=False)
            amu.setComment(toCheckin, comment)
            assetdir = amu.checkin(toCheckin)
            assetpath = amu.getAvailableInstallFiles(assetdir)[0]
            amu.install(assetdir, assetpath)
            hou.hda.installFile(os.path.join(OTLDIR, filename), change_oplibraries_file=True)
            hou.hda.uninstallFile("Embedded")
            if (
                isCameraAsset(node)
                and hou.ui.displayMessage(
                    "Export Alembic?", buttons=("Yes", "No"), default_choice=0, title="Export Alembic"
                )
                == 0
            ):
                writeCamerasToAlembic(node)
            if (
                isSetAsset(node)
                and hou.ui.displayMessage(
                    "Export Alembic?", buttons=("Yes", "No"), default_choice=0, title="Export Alembic"
                )
                == 0
            ):
                writeSetToAlembic(node)
            hou.ui.displayMessage("Checkin Successful!")

        else:
            hou.ui.displayMessage("Can Not Checkin.")
コード例 #13
0
def checkin():
        print 'checkin'
        saveFile() # save the file before doing anything
        print 'save'
        filePath = cmds.file(q=True, sceneName=True)
        print 'filePath: '+filePath
        toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filePath)))
        print 'toCheckin: '+toCheckin
        rig = isRigAsset()
        anim = isAnimationAsset()
        references = cmds.ls(references=True)
        loaded = []
        if amu.canCheckin(toCheckin) and saveGeo(): # objs must be saved before checkin
                dest = amu.getCheckinDest(toCheckin)
                # if anim and showConfirmAlembicDialog() == 'Yes':
                #   for ref in references:
                #     if cmds.referenceQuery(ref, isLoaded=True):
                #       loaded.append(ref)
                #       cmds.file(unloadReference=ref)
                #   print loaded
                #   for ref in loaded:
                #     cmds.file(loadReference=ref)
                #     refPath = cmds.referenceQuery(ref, filename=True)
                #     assetName = getAssetName(refPath)
                #     print "\n\n\n\n**************************************************************\n"
                #     print dest
                #     print filePath
                #     print refPath
                #     print assetName
                #     saveFile()
                #     amu.runAlembicConverter(dest, filePath, filename=assetName)
                #     cmds.file(unloadReference=ref)

                #   for ref in loaded:
                #     cmds.file(loadReference=ref)

                saveFile()
                cmds.file(force=True, new=True) #open new file
                dest = amu.checkin(toCheckin, anim or rig or os.path.basename(os.path.dirname(filePath))[:32]=='owned_jeff_apartment_walls_model') #checkin
                srcFile = amu.getAvailableInstallFiles(dest)[0]
                if rig:
                    amu.install(dest, srcFile)
        else:
                showFailDialog()
コード例 #14
0
def checkin():
        print 'checkin'
        saveFile() # save the file before doing anything
        print 'save'
        filePath = cmds.file(q=True, sceneName=True)
        print 'filePath: '+filePath
        toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filePath)))
        print 'toCheckin: '+toCheckin
        rig = isRigAsset()
        anim = isAnimationAsset()
        if amu.canCheckin(toCheckin) and saveGeo(): # objs must be saved before checkin
                cmds.file(force=True, new=True) #open new file
                dest = amu.checkin(toCheckin, anim or rig) #checkin
                srcFile = amu.getAvailableInstallFiles(dest)[0]
                if rig:
                    amu.install(dest, srcFile)
                if anim and showConfirmAlembicDialog() == 'Yes':
                    amu.runAlembicConverter(dest, srcFile)
        else:
                showFailDialog()
コード例 #15
0
def checkinLightingFile():
    print('checkin lighting file')
    filepath = hou.hipFile.path()
    toCheckin = os.path.join(amu.getUserCheckoutDir(), os.path.basename(os.path.dirname(filepath)))
    backups = os.path.join(toCheckin, 'backup')
    print 'backup = ' + backups
    if os.path.isdir(backups):
        os.system('rm -rf '+backups)
    if amu.canCheckin(toCheckin):
        response = hou.ui.readInput("What did you change?", buttons=('OK', 'Cancel',), title='Comment')
        if(response[0] != 0):
            return
        comment = response[1]
        hou.hipFile.save()
        hou.hipFile.clear()
        amu.setComment(toCheckin, comment)
        dest = amu.checkin(toCheckin)
        srcFile = amu.getAvailableInstallFiles(dest)[0]
        amu.install(dest, srcFile)
    else:
        hou.ui.displayMessage('Checkin Failed')
コード例 #16
0
def checkin(node = None):
    """Checks in the selected node.  EXACTLY ONE node may be selected, and it MUST be a digital asset.
        The node must already exist in the database, and USERNAME must have the lock."""
    if not hou_asset_mgr.isDigitalAsset(node):
        hou.ui.displayMessage("Not a Digital Asset.")
    else:
        libraryPath = node.type().definition().libraryFilePath() #user checkout folder
        filename = os.path.basename(libraryPath) # otl filename
        toCheckin = os.path.dirname(libraryPath)

        if os.path.exists(os.path.join(toCheckin, ".checkoutInfo")) and amu.canCheckin(toCheckin):
            response = hou.ui.readInput("What did you change?", buttons=('OK', 'Cancel',), title='Comment')
            if(response[0] != 0):
                return
            comment = response[1]
            hou_asset_mgr.lockAsset(node, False)
            hou_asset_mgr.saveOTL(node)
            node.type().definition().save(libraryPath)
            hou.hda.uninstallFile(libraryPath, change_oplibraries_file=False)
            amu.setComment(toCheckin, comment)
            assetdir = amu.checkin(toCheckin)
            assetpath = amu.getAvailableInstallFiles(assetdir)[0]
            amu.install(assetdir, assetpath)
            hou.hda.installFile(os.path.join(OTLDIR, filename), change_oplibraries_file=True)
            hou.hda.uninstallFile("Embedded")
            if isCameraAsset(node) and hou.ui.displayMessage('Export Alembic?'
                                                        , buttons=('Yes','No',)
                                                        , default_choice=0
                                                        , title='Export Alembic') == 0:
                writeCamerasToAlembic(node)
            if isSetAsset(node) and hou.ui.displayMessage('Export Alembic?'
                                                        , buttons=('Yes','No',)
                                                        , default_choice=0
                                                        , title='Export Alembic') == 0:
                writeSetToAlembic(node)
            hou.ui.displayMessage("Checkin Successful!")

        else:
            hou.ui.displayMessage('Can Not Checkin.')