Esempio n. 1
0
 def convert_from_skp(self, skp_doc):
     skp_model = skp_doc.model
     name = skp_model.name
     self.model = CPL12_Palette(name)
     for color in skp_model.colors:
         self.model.childs.append(CPL12_Color(color))
     self.model.update_for_save()
Esempio n. 2
0
    def do_load(self):
        self.model = None
        ver = self.readbytes(2)

        if ver == cpl_const.CPLX4_SPOT:
            self.model = CPLX4_SpotPalette()
        elif ver == cpl_const.CPL12:
            self.model = CPL12_Palette()
        elif ver == cpl_const.CPL12_SPOT:
            self.model = CPL12_SpotPalette()
        elif ver == cpl_const.CPL10:
            self.model = CPL10_Palette()
        elif ver == cpl_const.CPL8:
            self.model = CPL8_Palette()
        elif ver == cpl_const.CPL7:
            self.model = CPL7_Palette()
        elif ver == cpl_const.CPL7_UTF:
            self.model = CPL7_PaletteUTF()
        if self.model:
            self.model.parse(self)
            if not self.model.name and self.filepath:
                name = os.path.basename(self.filepath).split('.')[0]
                self.model.name = '%s palette' % name
Esempio n. 3
0
 def new(self):
     self.model = CPL12_Palette()