def export(self, obj):
        import FBXWrapper as fbx
        import pymel.core as pm

        file = someGlobals.globals['exportPath'] + someGlobals.camera[
            'filename'] + '.fbx'
        confirm = 'Yes'

        if (os.path.isfile(file)):
            confirm = cmds.confirmDialog(
                title='Data Exists on Disk',
                message='Overwrite existing data on disk?',
                button=['Yes', 'No'],
                defaultButton='Yes',
                cancelButton='No',
                dismissString='No')

        if confirm == 'Yes':
            cmds.select(obj, r=True)

            fbx.FBXProperty('Export|IncludeGrp|Animation -v true')
            fbx.FBXProperty('Export|IncludeGrp|CameraGrp|Camera -v true')
            fbx.FBXProperty('Export|AdvOptGrp|Collada|FrameRate -v ' +
                            someGlobals.globals['fps'][0])
            fbx.FBXProperty('Export|AdvOptGrp|Fbx|AsciiFbx -v "ASCII"')

            pm.FBXExport("-f", file, "-s")
Esempio n. 2
0
    def export(self, listName):
        objects = cmds.textScrollList(listName, q=True, ai=True)

        if objects != None:
            validateObjects = self.exportValidate(objects)

            if validateObjects != None:
                import FBXWrapper as fbx
                import pymel.core as pm

                file = someGlobals.globals['exportPath'] + someGlobals.mesh[
                    'filename'] + '.fbx'
                confirm = 'Yes'

                if (os.path.isfile(file)):
                    confirm = cmds.confirmDialog(
                        title='Data Exists on Disk',
                        message='Overwrite existing data on disk?',
                        button=['Yes', 'No'],
                        defaultButton='Yes',
                        cancelButton='No',
                        dismissString='No')

                if confirm == 'Yes':
                    cmds.select(validateObjects, r=True)

                    fbx.FBXProperty(
                        'Export|IncludeGrp|Geometry|SmoothingGroups" -v true')
                    fbx.FBXProperty(
                        'Export|IncludeGrp|Geometry|expHardEdges" -v false')
                    fbx.FBXProperty(
                        'Export|IncludeGrp|Geometry|TangentsandBinormals" -v true'
                    )
                    fbx.FBXProperty(
                        'Export|IncludeGrp|Geometry|SmoothMesh" -v true')
                    fbx.FBXProperty('Export|IncludeGrp|Animation" -v false')
                    fbx.FBXProperty(
                        'Export|IncludeGrp|CameraGrp|Camera" -v false')
                    fbx.FBXProperty(
                        'Export|AdvOptGrp|Fbx|AsciiFbx" -v "ASCII"')

                    pm.FBXExport("-f", file, "-s")
            else:
                someCommons.sprint('No valid mesh objects to export.')
        else:
            someCommons.sprint('Nothing to export.')

        self.check()
Esempio n. 3
0
 def write(self, export_path, preset):
     # set the given preset and export
     preset()
     pm.FBXExport('-s', '-f', export_path)