def save(self, file_path, name, image, user_comment=None):
     mobject_arrary = self.getObjectShadingEngine(self.geometry_dag_path)
     net_data = {}
     for index in range(mobject_arrary.length()):
         valid = self.hasValidShadingEngine(
             mobject_arrary[index], object=self.geometry_dag_path)
         if not valid:
             continue
         shader_data = self.get_shader_net(mobject_arrary[index])
         net_data.setdefault(index, shader_data)
     comment = '%s %s - shader networks' % (
         self.tool_kit_name, self.version)
     if user_comment:
         comment = '%s %s - shader networks\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 maya shader networks'
     type = 'shader_net'
     valid = True
     data = net_data
     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='shader')
     result, shader_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(image)
     print '\nresult', shader_path, image_path
     return result
Exemple #2
0
 def __init__(self, parent=None):
     super(Model, self).__init__(parent=None)
     self.studio_image = studioImage.ImageCalibration()
     self.studio_maya = studioMaya.Maya()
     self._width, self._height = 150, 150
     self.setup_ui()