From d7262c9be0bb04b93348e111be53b48b226b72e5 Mon Sep 17 00:00:00 2001
From: Maurice Raybaud <mauriceraybaud@hotmail.fr>
Date: Sat, 5 Oct 2019 04:37:58 +0200
Subject: [PATCH] Fixed perfect POV Sphere (no polygons)

post 2.8 API has broken many primitives
---
 render_povray/primitives.py | 4 ++--
 render_povray/ui.py         | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/render_povray/primitives.py b/render_povray/primitives.py
index 547da2408..29897fe3c 100644
--- a/render_povray/primitives.py
+++ b/render_povray/primitives.py
@@ -750,7 +750,7 @@ def pov_sphere_define(context, op, ob, loc):
             bpy.ops.mesh.reveal()
             bpy.ops.mesh.select_all(action='SELECT')
             bpy.ops.mesh.delete(type='VERT')
-            bpy.ops.mesh.primitive_ico_sphere_add(subdivisions=4, size=ob.pov.sphere_radius, location=loc, rotation=obrot)
+            bpy.ops.mesh.primitive_ico_sphere_add(subdivisions=4, radius=ob.pov.sphere_radius, location=loc, rotation=obrot)
             #bpy.ops.transform.rotate(axis=obrot,orient_type='GLOBAL')
             bpy.ops.transform.resize(value=obscale)
             #bpy.ops.transform.rotate(axis=obrot, proportional_size=1)
@@ -762,7 +762,7 @@ def pov_sphere_define(context, op, ob, loc):
             #bpy.ops.transform.rotate(axis=obrot,orient_type='GLOBAL')
 
         if not ob:
-            bpy.ops.mesh.primitive_ico_sphere_add(subdivisions=4, size=R, location=loc)
+            bpy.ops.mesh.primitive_ico_sphere_add(subdivisions=4, radius=R, location=loc)
             ob = context.object
             ob.name =  ob.data.name = "PovSphere"
             ob.pov.object_as = "SPHERE"
diff --git a/render_povray/ui.py b/render_povray/ui.py
index 2a31fd360..5f4157270 100644
--- a/render_povray/ui.py
+++ b/render_povray/ui.py
@@ -2574,7 +2574,7 @@ class OBJECT_PT_povray_obj_sphere(PovDataButtonsPanel, Panel):
                 col.active = obj.pov.unlock_parameters
 
 
-                layout.operator("pov.sphere_update", text="Update",icon="SOLID")
+                layout.operator("pov.sphere_update", text="Update",icon="SHADING_RENDERED")
 
                 #col.label(text="Parameters:")
                 col.prop(obj.pov, "sphere_radius", text="Radius of Sphere")
@@ -2868,7 +2868,7 @@ class BasicShapesMenu(bpy.types.Menu):
         layout.operator_context = 'INVOKE_REGION_WIN'
         layout.operator("pov.addplane", text="Infinite Plane",icon = 'MESH_PLANE')
         layout.operator("pov.addbox", text="Box",icon = 'MESH_CUBE')
-        layout.operator("pov.addsphere", text="Sphere",icon = 'SOLID')
+        layout.operator("pov.addsphere", text="Sphere",icon = 'SHADING_RENDERED')
         layout.operator("pov.addcylinder", text="Cylinder",icon="MESH_CYLINDER")
         layout.operator("pov.cone_add", text="Cone",icon="MESH_CONE")
         layout.operator("pov.addtorus", text="Torus",icon = 'MESH_TORUS')
-- 
GitLab