[Bf-python] Python API interface to Add->Mesh

Yehoshua Sapir yasapir at gmail.com
Thu May 25 12:42:56 CEST 2006


By the way... There's an "Scripts>Add" menu in the Scripts panel. Is
this for meant for Python scripts to be included in the Add menu?

On 5/23/06, Willian Padovani Germano <wgermano at superig.com.br> wrote:
> Hi Ken,
>
> Ken Hughes wrote:
> > I'm looking at adding support to the API for creating mesh objects such
> > as cubes, UVspheres, suzannes, etc.  I've pulled the guts out of
> > add_primitiveMesh() and moved into a separate function which can be
> > called from the Mesh API code.
>
> Ah, good addition, this is an old request :).
>
> > My question: how should this be presented in the API?  Something like
> > Mesh.Cube(), Mesh.UVSphere(verts=32), etc., or Mesh.Add(CUBE),
> > Mesh.Add(UVSPHERE,verts=32),. etc?
>
> Mesh.Cube(), etc. looks nicer, but I guess Mesh.Add would be cleaner
> (also easier to learn about in docs), since it groups all possible
> meshes in a single function.
>
> Another possibility is to have a submodule: Mesh.Add or Mesh.Primitives
> or something, to group all the functions:
>
> from Blender import Mesh.Primitives
> cube = Mesh.Primitives.Cube()
>
> # or if the script author prefers:
>
> from Mesh.Primitives import *
> cube = Cube()
> monkey = Suzanne()
>
> --
> Willian
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python
>


More information about the Bf-python mailing list