]> git.tdb.fi Git - libs/gl.git/blobdiff - blender/io_mspgl/util.py
Add a Blender operator to export the entire project at once
[libs/gl.git] / blender / io_mspgl / util.py
index 70b005f6df60e84db38ea8c35c03fc0bbcc79123..3b2f718bdb4aebf4399870ad6227b4554e78c347 100644 (file)
@@ -46,7 +46,7 @@ class Progress:
 
        def set_progress(self, value):
                value = self.start+self.delta*value
-               if value>self.last+0.01:
+               if value>self.last+0.001:
                        if self.window_manager:
                                self.window_manager.progress_update(value)
                        self.last = value
@@ -64,9 +64,16 @@ def get_colormap(srgb):
        else:
                return lambda x: x
 
-def image_name(img):
-       fp = img.filepath
-       if fp:
-               return os.path.split(fp)[1]
-       else:
-               return img.name
+def basename(path):
+       if path.startswith("//"):
+               path = path[2:]
+       return os.path.basename(path)
+
+def make_unique(values):
+       seen = set()
+       result = []
+       for i in values:
+               if i not in seen:
+                       result.append(i)
+                       seen.add(i)
+       return result