[Bf-python] Object/Mesh constructors

Campbell Barton ideasman42 at gmail.com
Thu Jul 8 15:36:03 CEST 2010


mesh = bpy.data.meshes.new(name="Foo")
obj = bpy.data.objects.new(name="Foo", object_data=mesh)
bpy.context.scene.objects.link(obj)

On Thu, Jul 8, 2010 at 2:57 PM, David Jagoe <davidjagoe at gmail.com> wrote:
> G'day all,
>
> Is there a better way to add an object than using bpy.ops.object_add
> or (e.g) bpy.ops.mesh.primitive_plane_add?
>
> I've tried to use bpy.types.Mesh.
>
> Ideally I would like something like a normal factory or constructor
> method that returns the object to me so that I can manipulate it
> further. I imagine that such a facility must exist but I can't seem to
> find it.
>
>
> Thanks,
> David
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>



-- 
- Campbell



More information about the Bf-python mailing list