Primitive_uv_sphere_add - keyword "size" unrecognized

Hi,

I was just working through Dr. Sybren Stüvel’s excelleant tutorials,
https://cloud.blender.org/training/scripting-for-artists/5993ed908119170ebb57164b

And running this command in the console:

>>> bpy.ops.mesh.primitive_uv_sphere_add(size=1, location=(1,2,3))

Got the responses:

Traceback (most recent call last):
  File "<blender_console>", line 1, in <module>
  File "G:\PortableAps\PortableApps\BlenderPortable\App\Blender64\2.92\scripts\modules\bpy\ops.py", line 132, in __call__
    ret = _op_call(self.idname_py(), None, kw)
TypeError: Converting py args to operator properties: : keyword "size" unrecognized

I had a look at the current Blender Python API and size is still listed as valid.

Running leaving size out and using location= dah dah works fine.

This also work fine…
bpy.ops.mesh.primitive_uv_sphere_add()

Is this an undocumented change or are there notes elsewhere please?

TIA,
Paul

Blender Version:
2.92.0, branch: master, commit date: 2021-02-24 16:25, hash: 02948a2cab44,
type: Release
build date: 2021-02-25, 09:31:14

Python:
binary path: ‘G:\PortableAps\PortableApps\BlenderPortable\App\Blender64\2.92\python\bin\python.EXE’
version: Python 3.7.7

From within the Python Console just type the part until the “(” and then press the “Tab” key for autocomplete to reveal the rest.

Thanks for that.

So as your image shows, has size been removed since the tutorial I mention was written?

The current full API is back online now after the hack.

https://docs.blender.org/api/2.92/bpy.ops.mesh.html?highlight=primitive_uv_sphere_add#bpy.ops.mesh.primitive_uv_sphere_add

So in the tutorials you just have to expect that things may have changed a bit then.

Thanks.

1 Like