Close

Swinging back to Blender

A project log for Silly software wishlist

Motivation to do some software projects by writing them down.

lion-mclionheadlion mclionhead 07/14/2018 at 21:170 Comments

The idea was to sniff Freecad for GL commands which could be used for deriving a mesh.  It was theorized that it only had access to higher level geometry stages, with tesselation all done in libraries that would require non pedantic methods to extract tesselation info from.  

79 dependencies later, the Freecad source was compiled.  For something which can't export normals, it has a lot of dependencies.  It's more like a PhD study of CAD libraries than a solution to a problem, as open source projects are.  apt get has never worked, because their xpdf package has never worked & lions are too blind to read any newer PDF readers & too lazy to compile xpdf.  Maybe recompiling xpdf would be easier than not having apt get.

The journey begins in View3DInventorViewer::renderScene which renders the 3D view.  glra->apply(this->backgroundroot); draws the stupid gradient background.  glra->apply(this->foregroundroot); draws something in front of the model.  

inherited::actualRedraw();

calls

QuarterWidget::actualRedraw

which calls

 SoRenderManager::render(const SbBool clearwindow, const SbBool clearzbuffer)

which draws the model.  The drawing appeared to be all done in the coin library, but only sections of it were used. 

 Important note: libcoin only compiles properly with cmake, not the included configure file.  The configure file yields the dreaded undefined reference to `ScXMLP::init()' error.

Coin works its way into SoRenderManager::renderSingle where Freecad's wireframe, hidden_line, as_is styles appear.  This blasts out a bunch of SoGLRenderAction's which are lists of SoPathList->SoPath->SoNode.  The SoNodes looked like the items in the scene graph, but never figured out where the scene graph was or where the triangle data 1st appeared.  

SoShape::invokeTriangleCallbacks is called for every triangle.  At this point, continued researching Blender.

Katie Byrne is a 3D modeler who has had a lot of success with Blender.  Important to note his videos have about as many views as the lion kingdom during the best of times, despite showing a woman on the thumbnails.  All his models are made with meshes, extruding sets of faces, deleting & tweeking individual faces by paw.  If any sizes are off, it all gets redone from scratch.  It's like building mountains out of assembly language.

Laylions had an impression that 3D models became too complex in the last 20 years for humans to tweek individual faces by paw, but apparently they still have few enough polygons to use manual labor.

Further problems remaned in the Freecad route, like getting the right vertex order, writing an API to start  & stop the sniffing, & further work on the Freecad models which remaned.  It was deemed easier just to redo everything in Blender, with exported Freecad meshes as guides.  

The method of entering coordinates in Blender isn't nearly accurate enough to use in any real world design, but good enough for a game.  It's manely a click drag interface, with very few text fields.  Making bezier curves in Blender is like building the ancient pyramids with 5000 mouse button combinations.

Blender does have a way to smooth normals, but it didn't work on any meshes exported from Freecad.

Discussions