You're blocking ads, which pay for BlenderNation. Read about other ways to support us.

Custom objects in Blender with Python

10

ownmesh.jpgIf you want to expand Blenders Add-menu with your own custom objects, this tutorial teaches you how to use simple Python scripting to do just that. The tutorial goes through the process of adding a custom plane to the Add=>Mesh-menu.

Go on and read the tutorial.

About Author

Mathias Pedersen

Read more about Mathias Pedersen (The M.h.p.e.) at www.mathiaspedersen.com

10 Comments

  1. It would help if we had a script to generate the Mesh generation part of the script out of a real mesh. So if you model a teapot, you could have the vertex coordinates in a text file. Otherwise, it will be a hard hard job :-)

    Thanks for sharing the tutorial !

  2. to malefico

    just make the script read in the object data. Say, if you have a RenderMan .RIB file with SubsurfMesh made of tri/quad faces: loop through the faces and create them. it's as simple as that. There are three arrays you'd need to read in.

    I'm sure you can do the same with .obj files, etc. Just insert the .obj data into the script and run the script... though... why not just use importer... anyway...

  3. Ideasman42 (Campbell Barton) on

    Open BPyAddMesh.py and look at the bottom.

    There is a commented py script that can be used to write your own custom objects,
    This wasnt included because we didnt want people to use this as a way to store a library of their own objects (library manager)

    But if you want. you can copy it into a py file and write your meshes to scripts from the Mesh->Scripts menu.

  4. Can you also add a function?
    Like the Sphere function(s) (I don't think, the whole geometry is saved, for every single possible sphere)
    That would make noidtluom's suggestion possible :D ( for fractals " + guiswitch for iterations )

Leave A Reply

To add a profile picture to your message, register your email address with Gravatar.com. To protect your email address, create an account on BlenderNation and log in when posting a message.