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.

Weekly Report #02

Week two is now over, time for a small summary:

I designated this week to get the basis done. A rough operator skeleton is now in place, custom draw-calls for the UI and first bare minimum geometry generation takes place.

Here a short rundown of the different parts:

Silhouette Operator Skeleton

After abandoning the Idea of the Silhouette Brush the Silhouette Operator is now starting to take shape. In this week i implemented a simple standard modal operator. It has currently three stages.

  1. Invoke, data for the silhouette gets allocated triggered by an alt-leftclick within sculptmode.
  2. Modal, the drawn shape while holding the keys is saved and a visual UI representation is updated.
  3. Exec, from the drawn shape 3D geometry gets generated and attached to the current PBVH. Afterwards data is cleaned up (more or less).

This is just a basis for the operator it will most likely get extended by several stages to be able to make changes after sketching a new shape. Similar to other operators you should be able to change the input values afterwards and may be able to reshape the drawn silhouette.

Custom Draw-Calls

To get a visual feedback the operator needs a fitting UI. In this week I set the foundation for it by registering a custom draw call. Currently only a red contour is drawn but with the draw call in place this can easily be extended! One thing to note: The UI code uses OpenGL immediate draw calls which will get removed in 2.8 and will need to be ported later. -Shouldn’t be much of a problem though.

Geometry Generation

The biggest challenge I faced this week was definitely the geometry generation. The existing sculpting system does not support topology changes with the exception of dyntopo. My current approach aims to make it possible to insert a mesh into the PBVH mesh tree system without rebuilding the whole tree. I am currently at the point where i can insert a mesh into a one-node-tree with it not crashing instantly. I have now got a rough idea of the PBVH structure and i think i will soon be able to insert into more complex topology. It is a lot of pointer reshuffling, buffer updating and indices magic which took longer than expected and I am just at the start. I may need to reevaluate my approach even though i am confident it will work.

The foundation for the Silhouette Operator slowly takes shape. With this I will soon be able to get into a more explorative workflow!

Current Branch status: https://developer.blender.org/rBce2671b0e29ba91e38d88858d5f5aba387d4e0c2
To try the Silhouette Operator press alt-leftclick in sculptmode and draw a shape. When drawn without overlap of a simple object a shape gets generated. (crashes most likely)