Index: /blender-povray-animation/frams-pov-import.py
===================================================================
--- /blender-povray-animation/frams-pov-import.py	(revision 1306)
+++ /blender-povray-animation/frams-pov-import.py	(revision 1307)
@@ -2,5 +2,6 @@
     "name": "Framsticks POV import & camera manipulator",
     "author": "Szymon Ulatowski, jm soler",
-    "blender": (2, 70, 0),
+    "version": (1, 0, 1),
+    "blender": (2, 80, 0),
     "location": "File > Import-Export",
     "category": "Import-Export",
@@ -140,38 +141,36 @@
 # create an object containing reference to blender cylinder object
 class cylindre: 
-    def __init__(self,nom='cylinderModel',type='cyl',r1=0.1, r2=0.1,h=1.0, n=8,smooth=1): 
-          me=bpy.data.meshes.new(name=nom)
-          r=[r1,r2] 
-          verts=[]
-          for i in range(0,2): 
-              for j in range(0,n): 
-                  z=math.sin(j*math.pi*2/(n))*r[i] 
-                  y=math.cos(j*math.pi*2/(n))*r[i] 
-                  x=float(i)*h 
-                  verts.append((x,y,z))
-
-          vlist=[v for v in range(n)] 
-          vlist.append(0)
-          faces=[]
-          for i in range(n): 
-              faces.append((vlist[i],vlist[i+1],vlist[i+1]+n,vlist[i]+n))
-
-          if type=='cyl': 
-              pos=[[0.0,0.0,0.0],[0.0,0.0,h]] 
-              verts.append((pos[0][0],pos[0][1],pos[0][2]))
-              verts.append((pos[1][0],pos[1][1],pos[1][2]))
-
-              for i in range(n): 
-                  faces.append((vlist[i],vlist[i+1],len(vlist)-2))
-                  faces.append((vlist[i],vlist[i+1],len(vlist)-1))
-
-          me.from_pydata(verts,[],faces)
-          me.update()
-          self.objet=bpy.data.objects.new(nom,me)
-          bpy.context.scene.objects.link(self.objet)
+    def __init__(self, name='cylinderModel', r1=0.1, r2=0.1, h=1.0, n=8, caps=True):
+        self.mesh=bpy.data.meshes.new(name=name)
+        r=[r1,r2] 
+        verts=[]
+        for i in range(0,2): 
+            for j in range(0,n): 
+                z=math.sin(j*math.pi*2/(n))*r[i] 
+                y=math.cos(j*math.pi*2/(n))*r[i] 
+                x=float(i)*h 
+                verts.append((x,y,z))
+                
+        vlist=[v for v in range(n)] 
+        vlist.append(0)
+        faces=[]
+        for i in range(n): 
+            faces.append((vlist[i],vlist[i+1],vlist[i+1]+n,vlist[i]+n))
+
+        if caps:
+            faces.append(tuple(range(n-1,-1,-1)))
+            faces.append(tuple(range(n,2*n)))
+
+        self.mesh.from_pydata(verts,[],faces)
+        self.mesh.update()
+
+    def makeObject(self, name):
+        o = bpy.data.objects.new(name, self.mesh)
+        bpy.context.collection.objects.link(o)
+        return o
 
 # build or update blender objects from a POV file
 def updateBlender(SceneParent,num): 
-    global Folder, Files, Current, RecentlyCreated, RecentlyDisappeared
+    global Folder, Files, Current, RecentlyCreated, RecentlyDisappeared, CylinderMesh, LinkedMesh
     Incoming=analysePOV(os.path.join(Folder,Files[num]))
     RecentlyCreated=[]
@@ -186,11 +185,15 @@
             # create new blender objects
             bcrea=bpy.data.objects.new(oname,None)
-            bpy.context.scene.objects.link(bcrea)
+            bpy.context.collection.objects.link(bcrea)
             bcrea.parent=SceneParent
             newobj.append(bcrea)
             for j in obj['joints']:
-                cyl=cylindre(oname+'_j','tube',0.1,0.1,1.0,6)
-                cyl.objet.parent=bcrea
-                newobj.append(cyl.objet)
+                if not LinkedMesh:
+                    CylinderMesh = None
+                if not CylinderMesh:
+                    CylinderMesh = cylindre(name = 'linked cylinder' if LinkedMesh else oname+'_j', r1=0.1, r2=0.1, h=1.0, n=6)
+                o = CylinderMesh.makeObject(oname+'_j')
+                o.parent=bcrea
+                newobj.append(o)
 
         # update blender loc/rot/scale
@@ -224,4 +227,10 @@
             print('Creature disappeared:',oname)
 
+def setHideWithKeyframe(o,hide):
+    o.hide_render = hide
+    o.hide_viewport = hide
+    o.keyframe_insert(data_path="hide_viewport",frame=bpy.context.scene.frame_current)
+    o.keyframe_insert(data_path="hide_render",frame=bpy.context.scene.frame_current)
+            
 # import a sequence of POV files, create object hiererchy, animate
 def framsImport(startfile): 
@@ -232,4 +241,5 @@
        global  SceneParent
        global  SkipFrames
+       global  CylinderMesh
 
        scanDir(startfile)
@@ -241,6 +251,7 @@
        bpy.context.scene.frame_end=max(bpy.context.scene.frame_end,FirstFrame+FrameCount-1)
 
+       CylinderMesh = None
        SceneParent=bpy.data.objects.new("Framsticks_"+str(FirstFrame),None)
-       bpy.context.scene.objects.link(SceneParent)
+       bpy.context.collection.objects.link(SceneParent)
        SceneParent.framspov_file=startfile
        SceneParent.framspov_frame=FirstFrame
@@ -263,22 +274,18 @@
                    obj=Current[oname]
                    for bo in obj:
-                       bo.hide=True
-                       bo.keyframe_insert(data_path="hide",frame=bpy.context.scene.frame_current)
+                       setHideWithKeyframe(bo,True)
                for oname in RecentlyDisappeared:
                    obj=Current[oname]
                    for bo in obj:
-                       bo.hide=False
-                       bo.keyframe_insert(data_path="hide",frame=bpy.context.scene.frame_current)
+                       setHideWithKeyframe(bo,False)
                bpy.context.scene.frame_set(FirstFrame-FirstPOV+k)
                for oname in RecentlyCreated:
                    obj=Current[oname]
                    for bo in obj:
-                       bo.hide=False
-                       bo.keyframe_insert(data_path="hide",frame=bpy.context.scene.frame_current)
+                       setHideWithKeyframe(bo,False)
                for oname in RecentlyDisappeared:
                    obj=Current[oname]
                    for bo in obj:
-                       bo.hide=True
-                       bo.keyframe_insert(data_path="hide",frame=bpy.context.scene.frame_current)
+                       setHideWithKeyframe(bo,True)
                    Current.pop(oname)
 
@@ -356,19 +363,22 @@
     bl_options = {'UNDO'}
 
-    files = CollectionProperty(name="File Path",
+    files: CollectionProperty(name="File Path",
                           description="File path used for importing",
                           type=bpy.types.OperatorFileListElement)
-    directory = StringProperty()
-
-    framspov_skip = bpy.props.IntProperty(name="Frame step",min=1,max=100)
+    directory: StringProperty()
+
+    framspov_skip: bpy.props.IntProperty(name="Frame step",min=1,max=100)
+
+    framspov_linkedmesh: bpy.props.BoolProperty(name="Linked cylinder mesh", description="Use a single shared cylinder mesh for all sticks", default=True)
 
     filename_ext = ".pov"
-    filter_glob = StringProperty(default="*.pov", options={'HIDDEN'})
+    filter_glob: StringProperty(default="*.pov", options={'HIDDEN'})
 
     def execute(self, context):
-        global FirstFrame, FrameCount,FileName,SkipFrames
+        global FirstFrame, FrameCount,FileName,SkipFrames,LinkedMesh
         FirstFrame = bpy.context.scene.frame_current
         FrameCount = 9999
         SkipFrames = self.framspov_skip
+        LinkedMesh = self.framspov_linkedmesh
         framsImport(os.path.join(self.directory, self.files[0].name))
         return {'FINISHED'}
@@ -421,5 +431,5 @@
     bpy.utils.register_class(VIEW3D_OT_WritePOVCameraPath)
     bpy.utils.register_class(OBJECT_PT_framspov)
-    bpy.types.INFO_MT_file_import.append(menu_func_import)
+    bpy.types.TOPBAR_MT_file_import.append(menu_func_import)
 
 def unregister():
@@ -428,4 +438,3 @@
     bpy.utils.unregister_class(VIEW3D_OT_WritePOVCameraPath)
     bpy.utils.unregister_class(OBJECT_PT_framspov)
-    bpy.types.INFO_MT_file_import.remove(menu_func_import)
-
+    bpy.types.TOPBAR_MT_file_import.remove(menu_func_import)
