Beispiel #1
0
def createPartLine(color, matrix, filename):
    lDrawCode = color.code() if color else LicColor.black().code()
    l = [PartCommand, str(lDrawCode)]
    m = GLToLDMatrix(matrix)
    l += [str(x)[:-2] if str(x).endswith(".0") else str(x) for x in m]
    l.append(filename)
    line = ' '.join(l)
    return line + lineTerm
Beispiel #2
0
def createPartLine(color, matrix, filename):
    lDrawCode = color.code() if color else LicColor.black().code()
    l = [PartCommand, str(lDrawCode)]
    m = GLToLDMatrix(matrix)
    l += [str(x)[:-2] if str(x).endswith(".0") else str(x) for x in m]
    l.append(filename)
    line = ' '.join(l)
    return line + lineTerm
Beispiel #3
0
 def __loadLDrawColors(self):
     self.colorDict = LicColorDict()
     try:
         LicImporters.LDrawImporter.importColorFile(self.getProxy())
         self.colorDict.licColors = False;
     except IOError as e:
         # Could not load LDConfig.ldr.  Fall back to internal color definitions from LDrawColors.py (TODO: update those colors!)
         self.colorDict.licColors = True;
         for colorCode, color in LDrawColors.colors.iteritems():
             newColor = None if color[0] is None else LicColor(*color)
             self.colorDict[colorCode] = newColor
             if (newColor):
                 newColor.originalRGBA = list(newColor.rgba)
                 newColor.edgeColor = LicColor.black()
Beispiel #4
0
 def addColor(self, colorCode, r = 1.0, g = 1.0, b = 1.0, a = 1.0, name = 'Black'):
     newColor = None if r is None else LicColor(r, g, b, a, name, colorCode)
     self.__instructions.colorDict[colorCode] = newColor
     if (newColor):
         newColor.originalRGBA = list(newColor.rgba)
         newColor.edgeColor = LicColor.black()