]> git.mxchange.org Git - flightgear.git/commitdiff
final cosmetics (because I had posted the web-cvs link to the blender list/forum :-)
authormfranz <mfranz>
Mon, 10 Mar 2008 16:31:02 +0000 (16:31 +0000)
committermfranz <mfranz>
Mon, 10 Mar 2008 16:31:02 +0000 (16:31 +0000)
utils/Modeller/uv_export_svg.py
utils/Modeller/uv_import_svg.py

index 51a96519ec43f0536b8032747cb50ec36cb28345..14d87cc9f718c81822e5e14979076aa4963a9a1d 100644 (file)
@@ -71,7 +71,7 @@ class UVFaceGroups:
                        found = []
                        for face in faces.itervalues():
                                for c in face.uv:
-                                       if (tuple(c)) in uvcoords:
+                                       if tuple(c) in uvcoords:
                                                for c in face.uv:
                                                        uvcoords[tuple(c)] = True
                                                found.append(face)
@@ -83,9 +83,9 @@ class UVFaceGroups:
                                del faces[face.index]
 
 
-def hashcolor(name):
-       random.seed(hash(name))
-       c = [random.randint(220, 255), random.randint(120, 220), random.randint(120, 220)]
+def stringcolor(string):
+       random.seed(hash(string))
+       c = [random.randint(220, 255), random.randint(120, 240), random.randint(120, 240)]
        random.shuffle(c)
        return "#%02x%02x%02x" % tuple(c)
 
@@ -117,7 +117,7 @@ def write_svg(path):
 
        for meshname, v in objects.iteritems():
                objname, mesh = v
-               color = FILL_COLOR or hashcolor(meshname)
+               color = FILL_COLOR or stringcolor(meshname)
 
                svg.write('\t<g style="fill:%s; stroke:black stroke-width:1px" inkscape:label="%s" ' \
                                'id="%s">\n' % (color, objname, objname))
index 25fe8c2fa6fd9bcf703649217cb9acf98fbca640..97b3d57cb08b13ccebb4a57a56e3cde297d6bccc 100755 (executable)
@@ -153,7 +153,7 @@ def parse_transform(s):
 
                elif cmd == "matrix":
                        if num == 6:
-                               matrix.multiply(Matrix(arg[0], arg[1], arg[2], arg[3], arg[4], arg[5]))
+                               matrix.multiply(Matrix(*arg))
                                continue
 
                else: