In Blender, using Python you can create objects via:
import bpy
obdata = bpy.data.meshes.new('name')
ob = bpy.data.objects.new('name', obdata)
This would create an empty mesh, which could later on be linked to a scene etc.
But what if one would like to extend the possibilities a bit, and generate something like a custom mesh type? Something like:
import bpy
obdata = bpy.data.my_custom_mesh_type.new('name')
ob = bpy.data.objects.new('name', obdata)
where my_custom_mesh_type is defined via:
class MyCustomMeshType(bpy.types.Mesh)
...
Is this possible at all?
data.objects.new("name", data)
expects to be one of the known data types, orNone
for an empty object. You can certainly "enhance" the mesh type with inheritance usingmy_enhanced_mesh = MyCustomMeshType(mesh)
but I believe you would still need to passmesh
todata.objects.new(...)
$\endgroup$