From BlenderWiki

Jump to: navigation, search
Note: This is an archived version of the Blender Developer Wiki. The current and active wiki is available on wiki.blender.org.

Google Summer of Code 2007 Proposal

Project Title

Recode of Blender's Mesh system to support BMesh

Synopsis

A new mesh system for Blender called BMesh [1] is currently in development. This mesh system will make mesh editing tools easier to code and maintain, will make N-gons possible, and will provide a host of other benefits to both programmers and users. However, before BMesh can be implemented, a variety of fairly major changes must first happen to Blender's underlying Mesh and EditMesh code base. These changes are the focus of this proposal, and will include changing the underlying Mesh structures, modifying Derived Mesh and Custom Data where appropriate, and replacing the current EditMesh system.

Benefits to the Blender Community

This project will benefit Blender artists and users by laying the groundwork for a more advanced mesh editing system. Such a system will support N-gons (a much requested feature) and will pave the way for more advanced and efficient mesh editing tools. Additionally, reworking the mesh systems will allow the creation of a more coherent and powerful Mesh API that will be a great benefit to programmers during future development and maintenance.

Deliverables

Primary:

1. Replace Mesh DNA with updated representation.

2. Make changes to Derived Mesh and the Custom Data APIs.

3. Replace EditMesh with a simple BMesh editmode.

Secondary:

4. Integrate a working, generic tesselator.

5. Recode Mesh tools (as time and BMesh integration allows).

6. Code new tools to utilize the new structure (optional; as time and BMesh integration allows)

Project Details

Primary deliverables

The focus of this project will be the preparation of the source code for an advanced mesh system (specifically BMesh), not the integration of that system. The following deliverables must be completed before BMesh can be integrated within Blender.

Update Mesh DNA

In order to fully support BMesh, the underlying Mesh structure will need to be altered so that BMesh's method of storing face data will be supported, and anything that touches the Mesh data will need to be rewritten. Additionally, a conversion process will need to be developed for reading files containing the previous Mesh representation.

Make changes to Derived Mesh, etc.

Making changes to the underlying Mesh structure will also require that the Derived Mesh and Custom Data code be updated to be compatible with the new Mesh structure. In addition, it may be worth researching methods for making the BMesh editing API available to the modifier stack. Also, most/all of BMesh's extra information (UVs, cols, perhaps even tesselation data, etc.) will be stored as Custom Data, so the associated Custom Data API will require some work as well.

Replace EditMesh

Due to the difference in the way BMesh and EditMesh store and represent data (especially face data), and the strict editing API, Euler operations, and other mesh (de)construction differences that BMesh uses, a gradual conversion from EditMesh to BMesh is probably not practical. As such, the EditMesh system will likely be stripped from the source completely while a simple BMesh editmode is integrated. This will enable us to focus entirely on BMesh's integration, although it may leave the code in an incomplete state after the project's deadline. Hopefully, though, enough work can be completed that the incomplete portions are minimized.

The first goal for this deliverable will be to clean EditMesh completely from the source. The second goal involves the integration of a functioning BMesh "edit mode," which is under development by another author.

Secondary deliverables

The following are listed as secondary deliverables since they depend (more or less) on the integration of the BMesh system code. The full or partial integration of BMesh is not the focus of this proposal, although it is presumed that steps will be taken to integrate BMesh (either by myself or by BMesh's owner) over the course of this project.

Integrate a tesselator

BMesh's support of N-gons requires that a tesselator be written for drawing purposes, and for passing usable data to the current modifier stack. This should be fairly straightforward to implement, and only a bare-bones (possibly pre-made) system will be initially incorporated. However, care will be taken to make sure it is generic enough to make it useful in a wide variety of functions, and that it is abstracted enough to easily swap it for a better tesselator later. If time allows, focus may be put on refining the tesselator if necessary.

Recode Mesh tools

With the integration of BMesh and the removal of EditMesh, effort will be put into porting or rewriting the current mesh tools (tools used in editmode, transforms - grab, scale, rotate, etc., and the modifier stack). It is assumed that the entire conversion process will not be complete before the project deadline, but it is hoped that enough will be done to at least have Blender in a functioning (if incomplete) state.

Code new tools

If things go well enough that I actually find myself with extra time before the project deadline, I will invest the time into coding new mesh editing tools such as beveling, offsetting, or an advanced (or basic) undo system, or by helping with the integration and refinement of BMesh.

Project Schedule

Work can begin as soon as this application is accepted, and I am available full-time this summer. It will probably take about a week for me to become familiar enough with Blender's code base that I can proceed with a good plan and strategy. After that, I imagine that it will take most, if not all, of the SoC time frame to convert the mesh structures, integrate the new mesh code, and refine and stabilize the tools and code. I am not even entirely certain that the whole process can be completed within the time frame, and additional development may need to be done before the code is ready for full integration with a Blender release. I will be available after the deadline for final bug fixes, integration/code-cleanup, and, perhaps, additional development.

Bio

I am a 21 year old computer science student wrapping up my degree from Excelsior College [2] and looking to pursue a graduate degree (in an unrelated field). I live in Abilene, KS (USA), and I have been working with Blender since the summer of 2000, focusing mainly on python scripting (mesh tools), modelling (often technical), and game development (UV-mapping and texturing).

I have been programming for 6 years, with main experience in C/C++, Python, Java, and PHP. Projects have included 4 separate Blender-Python scripts, a basic web content management system, the BPyC [3], and other course-related OpenGL projects such as display techniques (including interaction and animation), light baking, and image/pixel manipulation/filters.

I especially enjoy developing mesh tools and working with mesh data structures. I am drawn to their highly technical nature, their need for new and creative algorithms, the visual products they produce, and the opportunity to see them used by and benefiting artists on a daily basis.

[1] BlenderDev/Bmesh

[2] http://www.excelsior.edu/

[3] http://hhofministries.org/bpyc