Exemplo n.º 1
0
    def to_publish(self):
        if self.extend_pub_widget.checkBox_preflight.isChecked():
            print 'Doing preflight'
            for child in self.preflight_widget.listWidget_preflight.data:
                for cb in child.widget.children():
                    if isinstance(cb, QtWidgets.QCheckBox):
                        print cb.isChecked()
                        print cb.objectName()
        if self.extend_pub_widget.checkBox_source_file.isChecked():
            save_maya_file()

        if self.extend_pub_widget.checkBox_export_cache.isChecked():
            caches_dict = self.get_caches_list()
            if caches_dict['abc']:
                print 'Starting cache alembic...'
                self.export_abc_cache(caches_dict['abc'])
                print 'Alembic caches done!'
            if caches_dict['arnold']:
                print 'Starting cache arnold...'
                self.export_arnold_proxy(caches_dict['arnold'])
                print 'Arnold proxy done!'

        # write out json file for lgt import tool
        asset_dict = get_reference_dict()
        write_out_json(file_path=os.path.join(self.path, 'rigging_info.json'), dict=asset_dict)

        # Open folder path and send published email
        foleder_path = config.get_export_root_path(create=True)
        super(PrublishWidget, self).to_publish(foleder_path)
Exemplo n.º 2
0
 def export_abc_cache(self):
     print 'export_abc_cache'
     abc_exporter = ExportAlembic()
     for each in self.extend_pub_widget.listWidget_abc:
         print
         print 'Caching alembic for {}.'.format(each.metadata['asset_name'].name())
         print
         abc_file = each.metadata['asset_name'].name().replace(':', '_')
         self.path = config.get_export_root_path(create=True)
         abc_path = os.path.join(self.path, '{}.abc'.format(abc_file))
         abc_root = each.metadata['abc_root'].name()
         start_frame, end_frame = get_time_range_in_slider()
         batch_export_alembic(abc_exporter, abc_root, abc_path, start_frame, end_frame,
                              args={'stripNamespaces': 1, 'uvWrite': 1, 'writeVisibility': 1,
                                    'writeFaceSets': 1, 'worldSpace': 1, 'eulerFilter': 1,
                                    'step': 0.5})
     abc_exporter.batchRun()
Exemplo n.º 3
0
    def to_publish(self):
        if self.extend_pub_widget.checkBox_preflight.isChecked():
            print 'preflight'
            for child in self.preflight_widget.listWidget_preflight.data:
                print '--------------------'
                print child, dir(child)
                for cb in child.widget.children():
                    if isinstance(cb, QtWidgets.QCheckBox):
                        print cb.isChecked()
                        print cb.objectName()
        if self.extend_pub_widget.checkBox_source_file.isChecked():
            # TODO: get export path
            save_maya_file()

        # Open folder path and send published email
        foleder_path = config.get_export_root_path(create=True)
        super(PrublishWidget, self).to_publish(foleder_path)
Exemplo n.º 4
0
    def export_abc_cache(self):
        print 'export_abc_cache'
        heriarchy = HerirachyChecking()
        heriarchy.asset_filter()

        abc_exporter = ExportAlembic()
        export_lod = self.extend_pub_widget.get_export_lod()
        # Get export LOD
        if export_lod == config.HIGH_GRP:
            mod_root = heriarchy.high_geo
        elif export_lod == config.MID_GRP:
            mod_root = heriarchy.mid_geo
        elif export_lod == config.LOW_GRP:
            mod_root = heriarchy.low_geo
        elif export_lod == 'all':
            mod_root = heriarchy.high_geo.rsplit('_', 1)[0]
        else:
            raise Exception('Please define LOD type in config.py first')
        # abc_file = mod_root.rsplit('_{}'.format(export_lod), 1)[0]
        print
        print 'Export mod_root: ', mod_root
        print 'Export lod: ', export_lod
        print
        self.path = config.get_export_root_path(create=True)
        abc_path = os.path.join(self.path, '{}.abc'.format(mod_root))
        batch_export_alembic(abc_exporter,
                             mod_root,
                             abc_path,
                             1,
                             1,
                             args={
                                 'stripNamespaces': 1,
                                 'uvWrite': 1,
                                 'writeVisibility': 1,
                                 'writeFaceSets': 1,
                                 'worldSpace': 1,
                                 'eulerFilter': 1,
                                 'step': 0.5
                             })
        abc_exporter.batchRun()
Exemplo n.º 5
0
 def export_abc_cache(self):
     print 'export abc cache'
     abc_exporter = ExportAlembic()
     abc_file = pm.ls(sl=True)
     if len(abc_file) == 0:
         warning_text = 'You haven\'t select any objects to export. go on?'
         result = msg_box.show_question_box(self, 'Warning', warning_text)
         if not result:
             return
     elif len(abc_file) == 1:
         pass
     else:
         warning_text = 'You selected {0} objects, it\'ll gonna export {0} abc files, go on?'.format(
             str(len(abc_file)))
         result = msg_box.show_question_box(self, 'Warning', warning_text)
         if not result:
             return
     export_root_path = config.get_export_root_path(create=True)
     for each in abc_file:
         abc_path = os.path.join(export_root_path,
                                 '{}.abc'.format(each.replace(':', '_')))
         start_frame, end_frame = self.get_time_range()
         print 'Export frame range: {}, {} '.format(start_frame, end_frame)
         batch_export_alembic(abc_exporter,
                              each,
                              abc_path,
                              start_frame,
                              end_frame,
                              args={
                                  'stripNamespaces': 1,
                                  'uvWrite': 1,
                                  'writeVisibility': 1,
                                  'writeFaceSets': 1,
                                  'worldSpace': 1,
                                  'eulerFilter': 1,
                                  'step': 0.5
                              })
         abc_exporter.batchRun()
Exemplo n.º 6
0
def export_cam_abc(dup_cam):
    print 'export camera abc.'
    abc_exporter = ExportAlembic()
    export_root_path = config.get_export_root_path(create=True)

    abc_path = os.path.join(export_root_path, 'camera.abc')
    start_frame, end_frame = get_time_range_in_slider()
    print 'Export frame range: {}, {} '.format(start_frame, end_frame)
    batch_export_alembic(abc_exporter,
                         dup_cam,
                         abc_path,
                         start_frame,
                         end_frame,
                         args={
                             'stripNamespaces': 1,
                             'uvWrite': 1,
                             'writeVisibility': 1,
                             'writeFaceSets': 1,
                             'worldSpace': 1,
                             'eulerFilter': 1,
                             'step': 0.5
                         })
    abc_exporter.batchRun()
Exemplo n.º 7
0
    def to_publish(self):
        if self.extend_pub_widget.checkBox_preflight.isChecked():
            print 'preflight'
            for child in self.preflight_widget.listWidget_preflight.data:
                print '--------------------'
                print child, dir(child)
                for cb in child.widget.children():
                    if isinstance(cb, QtWidgets.QCheckBox):
                        print cb.isChecked()
                        print cb.objectName()
        if self.extend_pub_widget.checkBox_source_file.isChecked():
            save_maya_file()

        # super(PrublishWidget, self).to_publish()
        for cache_option in self.extend_pub_widget.widget_cache.children():
            if isinstance(cache_option, QtWidgets.QRadioButton):
                if cache_option.isChecked():
                    self.export_cache(cache_option.objectName())

        if self.extend_pub_widget.checkBox_export_camera.isChecked():
            print 'export cams'
            current_cam = self.extend_pub_widget.comboBox_camera.currentText()
            if current_cam and current_cam != '------None------':
                dup_cam = export_camera.copy_bake_camera(current_cam)
                export_camera.export_cam_abc(dup_cam)
                export_camera.delete_cam(dup_cam)
            elif current_cam == '------None------':
                msg_box.show_message_box(
                    'BFX Playblast Warning',
                    u'No available camera was found in current file.'
                    u'当前文件中没有可用相机')
                return

        # Open folder path and send published email
        foleder_path = config.get_export_root_path(create=True)
        super(PrublishWidget, self).to_publish(foleder_path)
Exemplo n.º 8
0
 def get_export_root_path(self):
     return config.get_export_root_path(create=True)