Esempio n. 1
0
 def __init__(self, parent=None):
     super(Asset, self).__init__(parent=None)
     self.studio_image = studioImage.ImageCalibration()
     self._width, self._height = 150, 150
     self.brows_directory = resources.getWorkspacePath()
     self.setup_ui()
     self.studio_print = studioPrint.Print(__name__, self.textedit_console)
Esempio n. 2
0
 def save(self, file_path, name, user_comment=None):
     comment = '%s %s - asset' % (self.tool_kit_name, self.version)
     if user_comment:
         comment = '%s %s - asset\n%s' % (self.tool_kit_name, self.version,
                                          user_comment)
     created_date = datetime.now().strftime('%Y/%d/%B - %I:%M:%S:%p')
     description = 'This data contain information about asset'
     type = 'asset'
     valid = True
     format = self.get_format()
     data = {'name': name, 'path': self.path, 'format': format}
     tag = self.tool_kit_object
     rw = readWrite.ReadWrite(c=comment,
                              cd=created_date,
                              d=description,
                              t=type,
                              v=valid,
                              data=data,
                              tag=tag,
                              path=file_path,
                              name=name,
                              format='asset')
     result, asset_path = rw.create()
     if False in result:
         return result
     studio_image = studioImage.ImageCalibration(path=file_path,
                                                 name=name,
                                                 format='png')
     image_path = studio_image.writeImage(self.image)
     print '\nresult', asset_path, image_path
     return result
Esempio n. 3
0
 def set_source_path(self, widget, tag):
     self.formats = {'file': '(*.ma *.mb)', 'image': '(*.jpg *.tga *.png)'}
     self.q_image,  self.q_image_path = None, None
     title = 'Browse %s' % tag
     current_format = '%s %s' % (tag, self.formats[tag])
     current_file = QtGui.QFileDialog.getOpenFileName(
         self, title, self.brows_directory, current_format)
     if not os.path.isfile(current_file[0]):
         return False, None
     widget.setText(current_file[0])
     self.brows_directory = os.path.dirname(current_file[0])
     if tag == 'image':
         studio_image = studioImage.ImageCalibration()
         self.q_image,  self.q_image_path = studio_image.setStudioSize(
             source_image=current_file[0])
         self.image_to_button(path=self.q_image_path)
         return self.q_image,  self.q_image_path
     return True, current_file[0]