BPY plus – a set of modules to extend the Blender Python API.
BPY plus is an open-source project based on Blender API and extending it with several features and making it easier to use some of “bpy” functions.
You can use BPY plus in your add-ons and scripts in any way for free.
At present it is small, but in the future, it can be extended with more modules.
BPY plus web-page:
The “bpy_plus” package must be placed in the same directory as the project in which it will be used. Copy “bpy_plus” to your project directory. Now you can import “bpy_plus” modules as usual
from bpy_plus import *
This code finds a bounding sphere around selected objects. To display the bounding sphere this code also adds an empty with the type of sphere to the scene and set the bounding sphere location and radius to it.
import bpy from bpy_plus.bounding import Bounding b_sphere = Bounding.sphere( objects=bpy.context.selected_objects, mode='GEOMETRY' ) empty = bpy.data.objects.new(name='empty', object_data=None) empty.empty_display_type = 'SPHERE' empty.location = b_sphere empty.empty_display_size = b_sphere bpy.context.collection.objects.link(object=empty)