X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=utils%2FModeller%2Fuv_export_svg.py;h=af703793cbef6da21065c87815508c71b1758f09;hb=030742fa4ae7d99facb517381da71fa404c4ee2b;hp=51a96519ec43f0536b8032747cb50ec36cb28345;hpb=435cd3ca8f6d605d05748a23276a7327dc16f410;p=flightgear.git diff --git a/utils/Modeller/uv_export_svg.py b/utils/Modeller/uv_export_svg.py index 51a96519e..af703793c 100644 --- a/utils/Modeller/uv_export_svg.py +++ b/utils/Modeller/uv_export_svg.py @@ -8,7 +8,7 @@ # """ __author__ = "Melchior FRANZ < mfranz # aon : at >" -__url__ = "http://www.flightgear.org/" +__url__ = ["http://www.flightgear.org/", "http://cvs.flightgear.org/viewvc/source/utils/Modeller/uv_export_svg.py"] __version__ = "0.1" __bpydoc__ = """\ Saves the UV mappings of all selected objects to an SVG file. The uv_import_svg.py @@ -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\n' % (color, objname, objname))