Exemplo n.º 1
0
    def publishAsset(self, iAObj=None):
        '''Publish the asset defined by the provided *iAObj*.'''

        publishedComponents = []

        totalSteps = self.getTotalSteps(steps=[
            iAObj.options['3dsmax'],
            iAObj.options['alembic'],
        ])
        panelComInstance = panelcom.PanelComInstance.instance()
        panelComInstance.setTotalExportSteps(totalSteps)

        if iAObj.options.get('alembic'):
            if exocortexAlembicAvailable():
                temporaryPath = os.path.join(MaxPlus.PathManager.GetTempDir() +
                                             uuid.uuid4().hex + '.abc')

                publishedComponents.append(
                    FTComponent(componentname='alembic', path=temporaryPath))

                try:
                    exocortexExportAlembic(temporaryPath, iAObj.options)
                except RuntimeError, e:
                    self._reportError(str(e))
            else:
                self._reportError(
                    'Exocortex Crate plugin not available. Cannot publish Alembic.'
                )

            panelComInstance.emitPublishProgressStep()
    def publishContent(self, content, assetVersion, progressCallback=None):
        publishedComponents = []

        for c in content:
            publishfilename = c[0]
            componentName = c[1]

            publishedComponents.append(
                FTComponent(componentname=componentName, path=publishfilename))

        return publishedComponents
    def publishContent(self, content, assetVersion, progressCallback=None):
        '''Return components to publish.'''
        components = []

        for row in content:
            filename = row[0]
            componentName = row[1]

            components.append(
                FTComponent(componentname=componentName, path=filename))

        try:
            node = nuke.toNode(HelpFunctions.safeString(content[0][4]))
            thumbnail = Connector.createThumbNail(node)
            if thumbnail:
                components.append(
                    FTComponent(componentname='thumbnail', path=thumbnail))
        except Exception:
            pass

        return components
    def publishAsset(self, iAObj=None):
        '''Publish the asset defined by the provided *iAObj*.'''

        panelComInstance = panelcom.PanelComInstance.instance()

        if hasattr(iAObj, 'customComponentName'):
            componentName = iAObj.customComponentName
        else:
            componentName = 'houdiniNodes'

        publishedComponents = []

        temporaryPath = HelpFunctions.temporaryFile(suffix='.hip')

        publishedComponents.append(
            FTComponent(
                componentname=componentName,
                path=temporaryPath
            )
        )

        if 'exportMode' in iAObj.options and (
                iAObj.options['exportMode'] == 'Selection') and (
                    componentName == 'houdiniNodes'):
            ''' Publish Selected Nodes'''
            selectednodes = hou.selectedNodes()
            selectednodes[0].parent().saveChildrenToFile(
                selectednodes, [], temporaryPath)

            panelComInstance.emitPublishProgressStep()

        elif componentName == 'houdiniPublishScene' and (
                iAObj.options['exportMode'] == 'Selection'):
            # Publish Main Scene in selection mode
            hou.copyNodesToClipboard(hou.selectedNodes())

            command = "hou.pasteNodesFromClipboard(hou.node('/obj'));\
            hou.hipFile.save('%s')" % (temporaryPath)

            cmd = '%s -c "%s"' % (os.path.join(
                os.getenv('HFS'), 'bin', 'hython'), command)
            os.system(cmd)

        elif componentName == 'houdiniPublishScene':
            # Publish Main Scene
            hou.hipFile.save(temporaryPath)

        panelComInstance.emitPublishProgressStep()

        return publishedComponents, 'Published ' + iAObj.assetType + ' asset'
Exemplo n.º 5
0
    def publishAsset(self, iAObj=None):
        '''Publish the asset defined by the provided *iAObj*.'''
        panelComInstance = panelcom.PanelComInstance.instance()

        if hasattr(iAObj, 'customComponentName'):
            componentName = iAObj.customComponentName
        else:
            componentName = '3dsmax'

        if iAObj.options.get('exportMode') == 'Selection':
            # Check if the selection is empty and abort if it is.
            if selectionEmpty():
                self._reportError('No objects selected to publish.')

            exportSelectedMode = True
        else:
            exportSelectedMode = False

        publishedComponents = []

        temporaryPath = os.path.join(MaxPlus.PathManager.GetTempDir() +
                                     uuid.uuid4().hex + '.max')

        if exportSelectedMode:
            MaxPlus.FileManager.SaveSelected(temporaryPath)
        else:
            MaxPlus.FileManager.Save(temporaryPath, False, False)

        publishedComponents.append(
            FTComponent(componentname=componentName, path=temporaryPath))

        # Handle dependencies.
        dependenciesVersion = []
        for node in getAllFtrackAssetHelperNodes(recurse=True):
            obj = node.Object
            dependencyAssetId = obj.ParameterBlock.assetId.Value
            if dependencyAssetId:
                dependencyVersion = ftrack.AssetVersion(dependencyAssetId)
                dependenciesVersion.append(dependencyVersion)

        if dependenciesVersion:
            currentVersion = ftrack.AssetVersion(iAObj.assetVersionId)
            currentVersion.addUsesVersions(versions=dependenciesVersion)

        panelComInstance.emitPublishProgressStep()
        return publishedComponents, 'Published ' + iAObj.assetType + ' asset'
Exemplo n.º 6
0
    def publishAsset(self, iAObj=None):
        '''Publish the asset defined by the provided *iAObj*.'''

        savedSel = saveSelection()
        selectOnlyCameras()

        if selectionEmpty():
            self._reportError('No cameras selected to publish.')

        totalSteps = self.getTotalSteps(steps=[
            True, iAObj.options['maxPublishScene'], iAObj.options['alembic']
        ])
        panelComInstance = panelcom.PanelComInstance.instance()
        panelComInstance.setTotalExportSteps(totalSteps)

        publishedComponents, message = GenericAsset.publishAsset(self, iAObj)
        if not publishedComponents:
            return publishedComponents, message

        if iAObj.options['maxPublishScene']:
            iAObjCopy = self.getSceneSettingsObj(iAObj)
            sceneComponents, message = GenericAsset.publishAsset(
                self, iAObjCopy)
            publishedComponents += sceneComponents

        if iAObj.options.get('alembic'):
            if exocortexAlembicAvailable():
                temporaryPath = os.path.join(MaxPlus.PathManager.GetTempDir() +
                                             uuid.uuid4().hex + '.abc')

                publishedComponents.append(
                    FTComponent(componentname='alembic', path=temporaryPath))

                try:
                    exocortexExportAlembic(temporaryPath, iAObj.options)
                except RuntimeError, e:
                    self._reportError(str(e))
            else:
                self._reportError(
                    'Exocortex Crate plugin not available. Cannot publish Alembic.'
                )

            panelComInstance.emitPublishProgressStep()
    def publishContent(self, content, assetVersion, progressCallback=None):

        publishedComponents = []

        for c in content:
            filename = c[0]
            componentName = c[1]

            sequenceComponent = FTComponent()

            start = int(float(c[2]))
            end = int(float(c[3]))

            if not start - end == 0:
                sequence_format = u'{0} [{1}-{2}]'.format(filename, start, end)
            else:
                sequence_format = u'{0}'.format(filename, start)

            sequenceIdentifier = sequence_format

            metaData = []

            if not '_proxy' in componentName:
                metaData.append(('img_main', 'True'))

            for meta in c[5]:
                metaData.append((meta[0], meta[1]))

            sequenceComponent.componentname = componentName
            sequenceComponent.path = sequenceIdentifier
            sequenceComponent.metadata = metaData

            publishedComponents.append(sequenceComponent)

        try:
            node = nuke.toNode(HelpFunctions.safeString(content[0][4]))
            thumbnail = Connector.createThumbNail(node)
            if thumbnail:
                publishedComponents.append(
                    FTComponent(componentname='thumbnail', path=thumbnail))
        except:
            print 'Failed to create thumbnail'
            import sys
            traceback.print_exc(file=sys.stdout)

        return publishedComponents
Exemplo n.º 8
0
    def publishAsset(self, iAObj=None):
        '''Publish the asset defined by the provided *iAObj*.'''
        pubMessage = 'Published cameraasset asset'

        # Only export selection when exporting camera
        iAObj.options['exportMode'] = 'Selection'
        publishedComponents = []

        totalSteps = self.getTotalSteps(steps=[
            iAObj.options['cameraBake'], iAObj.options['cameraMaya'],
            iAObj.options['cameraAlembic'], iAObj.options['mayaPublishScene']
        ])
        panelComInstance = panelcom.PanelComInstance.instance()
        panelComInstance.setTotalExportSteps(totalSteps + 1)

        # Get original selection
        nodes = mc.ls(sl=True)

        # Get camera shape and parent transforms
        cameraShape = ''
        for node in nodes:
            if mc.nodeType(node) == 'camera':
                cameraShape = node
            else:
                cameraShapes = mc.listRelatives(node,
                                                allDescendents=True,
                                                type='camera')
                if len(cameraShapes) > 0:
                    # We only care about one camera
                    cameraShape = cameraShapes[0]

        if cameraShape == '':
            return None, 'No camera selected'

        cameraTransform = mc.listRelatives(cameraShape,
                                           type='transform',
                                           parent=True)
        cameraTransform = cameraTransform[0]

        if iAObj.options['cameraBake']:
            tmpCamComponents = mc.duplicate(cameraTransform, un=1, rc=1)
            if mc.nodeType(tmpCamComponents[0]) == 'transform':
                tmpCam = tmpCamComponents[0]
            else:
                tmpCam = mc.ls(tmpCamComponents, type='transform')[0]
            pConstraint = mc.parentConstraint(cameraTransform, tmpCam)
            try:
                mc.parent(tmpCam, world=True)
            except RuntimeError:
                print 'camera already in world space'

            mc.bakeResults(tmpCam,
                           simulation=True,
                           t=(float(iAObj.options['frameStart']),
                              float(iAObj.options['frameEnd'])),
                           sb=1,
                           at=['tx', 'ty', 'tz', 'rx', 'ry', 'rz'],
                           hi='below')

            mc.delete(pConstraint)
            cameraTransform = tmpCam
            panelComInstance.emitPublishProgressStep()

        if iAObj.options['cameraLock']:
            # Get original lock values so we can revert after exporting
            origCamLocktx = mc.getAttr('{0}.tx'.format(cameraTransform),
                                       l=True)
            origCamLockty = mc.getAttr('{0}.ty'.format(cameraTransform),
                                       l=True)
            origCamLocktz = mc.getAttr('{0}.tz'.format(cameraTransform),
                                       l=True)
            origCamLockrx = mc.getAttr('{0}.rx'.format(cameraTransform),
                                       l=True)
            origCamLockry = mc.getAttr('{0}.ry'.format(cameraTransform),
                                       l=True)
            origCamLockrz = mc.getAttr('{0}.rz'.format(cameraTransform),
                                       l=True)
            origCamLocksx = mc.getAttr('{0}.sx'.format(cameraTransform),
                                       l=True)
            origCamLocksy = mc.getAttr('{0}.sy'.format(cameraTransform),
                                       l=True)
            origCamLocksz = mc.getAttr('{0}.sz'.format(cameraTransform),
                                       l=True)

            # Lock transform
            mc.setAttr('{0}.tx'.format(cameraTransform), l=True)
            mc.setAttr('{0}.ty'.format(cameraTransform), l=True)
            mc.setAttr('{0}.tz'.format(cameraTransform), l=True)
            mc.setAttr('{0}.rx'.format(cameraTransform), l=True)
            mc.setAttr('{0}.ry'.format(cameraTransform), l=True)
            mc.setAttr('{0}.rz'.format(cameraTransform), l=True)
            mc.setAttr('{0}.sx'.format(cameraTransform), l=True)
            mc.setAttr('{0}.sy'.format(cameraTransform), l=True)
            mc.setAttr('{0}.sz'.format(cameraTransform), l=True)

        if iAObj.options['cameraMaya']:
            iAObj.setTotalSteps = False
            mayaComponents, message = GenericAsset.publishAsset(self, iAObj)
            publishedComponents += mayaComponents

        if iAObj.options['cameraAlembic']:
            mc.loadPlugin('AbcExport.so', qt=1)
            temporaryPath = HelpFunctions.temporaryFile(suffix='.abc')
            publishedComponents.append(
                FTComponent(componentname='alembic', path=temporaryPath))

            alembicJobArgs = ''
            alembicJobArgs += '-fr {0} {1}'.format(iAObj.options['frameStart'],
                                                   iAObj.options['frameEnd'])
            objCommand = '-root ' + cameraTransform + ' '
            alembicJobArgs += ' ' + objCommand + '-file ' + temporaryPath
            alembicJobArgs += ' -step ' + str(iAObj.options['alembicSteps'])
            try:
                mc.AbcExport(j=alembicJobArgs)
            except:
                import traceback
                var = traceback.format_exc()
                return None, var
            panelComInstance.emitPublishProgressStep()

        if iAObj.options['cameraLock']:
            # Revert camera locks to original
            mc.setAttr('{0}.tx'.format(cameraTransform), l=origCamLocktx)
            mc.setAttr('{0}.ty'.format(cameraTransform), l=origCamLockty)
            mc.setAttr('{0}.tz'.format(cameraTransform), l=origCamLocktz)
            mc.setAttr('{0}.rx'.format(cameraTransform), l=origCamLockrx)
            mc.setAttr('{0}.ry'.format(cameraTransform), l=origCamLockry)
            mc.setAttr('{0}.rz'.format(cameraTransform), l=origCamLockrz)
            mc.setAttr('{0}.sx'.format(cameraTransform), l=origCamLocksx)
            mc.setAttr('{0}.sy'.format(cameraTransform), l=origCamLocksy)
            mc.setAttr('{0}.sz'.format(cameraTransform), l=origCamLocksz)

        if iAObj.options['cameraBake']:
            mc.delete(cameraTransform)
        # Set back original selection
        mc.select(nodes)
        panelComInstance.emitPublishProgressStep()

        if iAObj.options['mayaPublishScene']:
            iAObjCopy = self.getSceneSettingsObj(iAObj)
            sceneComponents, message = GenericAsset.publishAsset(
                self, iAObjCopy)
            publishedComponents += sceneComponents

        return publishedComponents, pubMessage
Exemplo n.º 9
0
    def publishAsset(self, iAObj=None):
        '''Publish the asset defined by the provided *iAObj*.'''

        publishedComponents = []

        totalSteps = self.getTotalSteps(steps=[
            iAObj.options['mayaBinary'], iAObj.options['alembic'],
            iAObj.options['mayaPublishScene']
        ])
        panelComInstance = panelcom.PanelComInstance.instance()
        panelComInstance.setTotalExportSteps(totalSteps)

        if iAObj.options['mayaBinary']:
            iAObj.setTotalSteps = False
            mayaComponents, message = GenericAsset.publishAsset(self, iAObj)
            publishedComponents += mayaComponents

        if iAObj.options['mayaPublishScene']:
            iAObjCopy = self.getSceneSettingsObj(iAObj)
            sceneComponents, message = GenericAsset.publishAsset(
                self, iAObjCopy)
            publishedComponents += sceneComponents

        if iAObj.options.get('alembic'):
            if iAObj.options.get('alembicExportMode') == 'Selection':
                nodes = mc.ls(sl=True, long=True)
                selectednodes = None
            else:
                selectednodes = mc.ls(sl=True, long=True)
                nodes = mc.ls(type='transform', long=True)
            objCommand = ''
            for n in nodes:
                objCommand = objCommand + '-root ' + n + ' '
            mc.loadPlugin('AbcExport.so', qt=1)

            temporaryPath = HelpFunctions.temporaryFile(suffix='.abc')
            publishedComponents.append(
                FTComponent(componentname='alembic', path=temporaryPath))

            alembicJobArgs = ''

            if iAObj.options.get('alembicUvwrite'):
                alembicJobArgs += '-uvWrite '

            if iAObj.options.get('alembicWorldspace'):
                alembicJobArgs += '-worldSpace '

            if iAObj.options.get('alembicWritevisibility'):
                alembicJobArgs += '-writeVisibility '

            if iAObj.options.get('alembicAnimation'):
                alembicJobArgs += '-frameRange {0} {1} -step {2} '.format(
                    iAObj.options['frameStart'], iAObj.options['frameEnd'],
                    iAObj.options['alembicEval'])

            alembicJobArgs += ' ' + objCommand + '-file ' + temporaryPath

            mc.AbcExport(j=alembicJobArgs)

            if selectednodes:
                mc.select(selectednodes)

            panelComInstance.emitPublishProgressStep()

        return publishedComponents, 'Published GeometryAsset asset'
Exemplo n.º 10
0
    def publishAsset(self, iAObj=None):
        '''Publish the asset defined by the provided *iAObj*.'''
        panelComInstance = panelcom.PanelComInstance.instance()

        if hasattr(iAObj, 'customComponentName'):
            componentName = iAObj.customComponentName
        else:
            componentName = 'mayaBinary'

        channels = True
        preserveReferences = False
        constructionHistory = False
        constraints = False
        expressions = False
        shader = False

        if iAObj.options.get('mayaHistory'):
            constructionHistory = iAObj.options['mayaHistory']

        if iAObj.options.get('mayaChannels'):
            channels = iAObj.options['mayaChannels']

        if iAObj.options.get('mayaPreserveref'):
            preserveReferences = iAObj.options['mayaPreserveref']

        if iAObj.options.get('mayaShaders'):
            shader = iAObj.options['mayaShaders']

        if iAObj.options.get('mayaConstraints'):
            constraints = iAObj.options['mayaConstraints']

        if iAObj.options.get('mayaExpressions'):
            expressions = iAObj.options['mayaExpressions']

        if iAObj.options.get('exportMode') == 'Selection':
            exportSelectedMode = True
            exportAllMode = False
        else:
            exportSelectedMode = False
            exportAllMode = True

        publishedComponents = []

        temporaryPath = HelpFunctions.temporaryFile(suffix='.mb')
        publishedComponents.append(
            FTComponent(componentname=componentName, path=temporaryPath))

        mc.file(temporaryPath,
                op='v=0',
                typ='mayaBinary',
                preserveReferences=preserveReferences,
                constructionHistory=constructionHistory,
                channels=channels,
                constraints=constraints,
                expressions=expressions,
                shader=shader,
                exportSelected=exportSelectedMode,
                exportAll=exportAllMode,
                force=True)

        dependenciesVersion = []
        dependencies = mc.ls(type='ftrackAssetNode')
        for dependency in dependencies:
            dependencyAssetId = mc.getAttr('{0}.assetId'.format(dependency))
            if dependencyAssetId:
                dependencyVersion = ftrack.AssetVersion(dependencyAssetId)
                dependenciesVersion.append(dependencyVersion)

        currentVersion = ftrack.AssetVersion(iAObj.assetVersionId)
        currentVersion.addUsesVersions(versions=dependenciesVersion)

        panelComInstance.emitPublishProgressStep()

        return publishedComponents, 'Published ' + iAObj.assetType + ' asset'
    def publishAsset(self, iAObj=None):
        '''Publish the asset defined by the provided *iAObj*.'''

        publishedComponents = []

        totalSteps = self.getTotalSteps(
            steps=[
                iAObj.options['houdiniNodes'],
                iAObj.options['alembic'],
                iAObj.options['houdiniPublishScene']
            ]
        )
        panelComInstance = panelcom.PanelComInstance.instance()
        panelComInstance.setTotalExportSteps(totalSteps)

        objPath = hou.node('/obj')
        cam = hou.selectedNodes()[0]

        bcam = self.bakeCamAnim(cam,
                                [iAObj.options['frameStart'],
                                 iAObj.options['frameEnd']])

        if iAObj.options['houdiniNodes']:

            temporaryPath = HelpFunctions.temporaryFile(suffix='.hip')

            publishedComponents.append(
                FTComponent(
                    componentname='houdiniNodes',
                    path=temporaryPath
                )
            )
            bcam.parent().saveChildrenToFile(
                [bcam], [], temporaryPath)

            panelComInstance.emitPublishProgressStep()

        if iAObj.options.get('houdiniPublishScene'):
            iAObjCopy = self.getSceneSettingsObj(iAObj)
            sceneComponents, message = GenericAsset.publishAsset(
                self, iAObjCopy
            )
            publishedComponents += sceneComponents

        if iAObj.options.get('alembic'):
            ''' Export Alembic'''
            temporaryPath = HelpFunctions.temporaryFile(suffix='.abc')

            publishedComponents.append(
                FTComponent(
                    componentname='alembic',
                    path=temporaryPath
                )
            )

            # Create Rop Net
            ropNet = objPath.createNode('ropnet')

            abcRopnet = ropNet.createNode('alembic')

            if iAObj.options.get('alembicAnimation'):
                # Check Alembic for animation option
                abcRopnet.parm('trange').set(1)
                for i, x in enumerate(
                        ['frameStart', 'frameEnd', 'alembicEval']):
                    abcRopnet.parm('f%d' % (i + 1)).deleteAllKeyframes()
                    abcRopnet.parm('f%d' % (i + 1)).set(iAObj.options[x])
            else:
                abcRopnet.parm('trange').set(0)

            abcRopnet.parm('filename').set(temporaryPath)
            abcRopnet.parm('root').set(bcam.parent().path())
            abcRopnet.parm('objects').set(bcam.path())
            abcRopnet.parm('format').set('hdf5')
            abcRopnet.render()
            ropNet.destroy()

            panelComInstance.emitPublishProgressStep()

        bcam.destroy()

        return publishedComponents, 'Published CameraAsset asset'
    def publishAsset(self, iAObj=None):
        '''Publish the asset defined by the provided *iAObj*.'''

        publishedComponents = []

        totalSteps = self.getTotalSteps(
            steps=[
                iAObj.options['houdiniNodes'],
                iAObj.options['alembic'],
                iAObj.options['houdiniPublishScene']
            ]
        )
        panelComInstance = panelcom.PanelComInstance.instance()
        panelComInstance.setTotalExportSteps(totalSteps)

        if iAObj.options['houdiniNodes']:
            houdiniComponents, message = GenericAsset.publishAsset(
                self, iAObj
            )
            publishedComponents += houdiniComponents

        if iAObj.options.get('houdiniPublishScene'):
            iAObjCopy = self.getSceneSettingsObj(iAObj)
            sceneComponents, message = GenericAsset.publishAsset(
                self, iAObjCopy
            )
            publishedComponents += sceneComponents

        if iAObj.options.get('alembic'):
            ''' Export Alembic'''
            temporaryPath = HelpFunctions.temporaryFile(suffix='.abc')

            publishedComponents.append(
                FTComponent(
                    componentname='alembic',
                    path=temporaryPath
                )
            )

            objPath = hou.node('/obj')

            # Selection Objects Set
            if iAObj.options.get('alembicExportMode') == 'Selection':
                selectednodes = hou.selectedNodes()
                objects = ' '.join([x.path() for x in selectednodes])
            else:
                selectednodes = objPath.glob('*')
                objects = '*'

            # Create Rop Net
            ropNet = objPath.createNode('ropnet')
            print ropNet.path()
            abcRopnet = ropNet.createNode('alembic')

            if iAObj.options.get('alembicAnimation'):
                # Check Alembic for animation option
                abcRopnet.parm('trange').set(1)
                for i, x in enumerate(
                        ['frameStart', 'frameEnd', 'alembicEval']):
                    abcRopnet.parm('f%d' % (i + 1)).deleteAllKeyframes()
                    abcRopnet.parm('f%d' % (i + 1)).set(iAObj.options[x])
            else:
                abcRopnet.parm('trange').set(0)

            abcRopnet.parm('filename').set(temporaryPath)
            abcRopnet.parm('root').set(selectednodes[0].parent().path())
            abcRopnet.parm('objects').set(objects)
            abcRopnet.parm('format').set('hdf5')
            abcRopnet.render()
            ropNet.destroy()

            panelComInstance.emitPublishProgressStep()

        return publishedComponents, 'Published GeometryAsset asset'
Exemplo n.º 13
0
def publishAsset(n, assetName, content, comment, shot, currentTask):
    header = getHeaderKnob(n)

    if not currentTask:
        header.setMessage('Could not find current task', 'warning')
    else:
        publishProgress = nuke.ProgressTask('Publishing assets')
        publishProgress.setProgress(0)
        currentTaskId = currentTask.getId()
        assetType = n['ftrackassettype'].value()

        publishProgress.setMessage('Validating asset types')
        try:
            ftrack.AssetType(assetType)
        except ftrack.FTrackError:
            header.setMessage(
                'No Asset type with short name "{0}" found. Contact your '
                'system administrator to add it.'.format(assetType), 'warning')
            return

        publishProgress.setMessage('Creating new version')
        asset = shot.createAsset(assetName, assetType)
        assetVersion = asset.createVersion(comment=comment,
                                           taskid=currentTaskId)

        if assetType in ['img', 'cam', 'geo', 'render']:
            if assetType == 'img':
                imgAsset = nukeassets.ImageSequenceAsset()
                publishedComponents = imgAsset.publishContent(
                    content,
                    assetVersion,
                    progressCallback=publishProgress.setProgress)

            elif assetType == 'cam':
                camAsset = nukeassets.CameraAsset()
                publishedComponents = camAsset.publishContent(
                    content,
                    assetVersion,
                    progressCallback=publishProgress.setProgress)

            elif assetType == 'geo':
                geoAsset = nukeassets.GeometryAsset()
                publishedComponents = geoAsset.publishContent(
                    content,
                    assetVersion,
                    progressCallback=publishProgress.setProgress)

            elif assetType == 'render':
                renderAsset = nukeassets.RenderAsset()
                publishedComponents = renderAsset.publishContent(
                    content,
                    assetVersion,
                    progressCallback=publishProgress.setProgress)

            if n['fscript'].value():
                if n['fcopy'].value():
                    temporaryPath = HelpFunctions.temporaryFile(suffix='.nk')
                    nuke.scriptSave(temporaryPath)
                    mainPath = temporaryPath
                else:
                    if nuke.Root().name() == 'Root':
                        tmp_script = tempfile.NamedTemporaryFile(suffix='.nk')
                        curScript = nuke.toNode("root").name()
                        nuke.scriptSaveAs(tmp_script.name)
                        mainAbsPath = tmp_script.name
                    else:
                        mainAbsPath = nuke.root()['name'].value()
                    mainPath = mainAbsPath

                publishedComponents.append(
                    FTComponent(componentname='nukescript', path=mainPath))

            if publishedComponents:
                pubObj = FTAssetObject(assetVersionId=assetVersion.getId())
                connector.Connector.publishAssetFiles(
                    publishedComponents,
                    assetVersion,
                    pubObj,
                    copyFiles=n['fcopy'].value(),
                    progressCallback=publishProgress.setProgress)

        else:
            header.setMessage("Can't publish this assettype yet", 'info')
            return

        publishProgress.setMessage('Setting up version dependencies')
        dependencies = get_dependencies()
        if dependencies:
            for name, version in dependencies.items():
                assetVersion.addUsesVersions(versions=version)

        assetVersion.publish()
        publishProgress.setProgress(100)

        header.setMessage('Asset published!')