Flakes – nodular everything

Flakes is a general purpose nodular programming platform designed for non-programmers, artists, game designers, engineers and bad programmers such as myself. After a long time talking about it, I have something to display. This is not a release yet, but rather an official project announcement.

This is (will be) an add-on and not part of the main Blender distribution.
Flakes is a project name, and may change in the future. Do send me suggestions.

The video has all the info you need, so I won’t repeat anything here.

Edit: Forgot that people watching the embedded version won’t see vimeo description. Here are the screenshots mentioned in the video.
i.imgur.com/7PILS8e.png
i.imgur.com/m17PI9p.png

So, it’s not the particle system everyone seems to want, but something a lot broader. I’m not trying to compete with any existing or future node or particle system. This is just my take on what node system should look like. After significant contemplation I’ve concluded that it is a lot easier to make this from scratch than try to contribute to some existing project. I think I have the right approach and I don’t wish to make compromises about it.

====================================
----Notable characteristics----
Represents a statically typed, functional style programming language.
Very loosely coupled to Blender. Makes it very flexible and easy to implement and modify.
Computation is primarily done with fixed size/shape arrays (for now anyway).
Primarily designed for highly parallel programming.

==================
==== Things to do ====

The following is listing of what I have done and what I will do. I’ll update it as I go. It’s fairly comprehensive list already, but not exhaustive. I’m mainly dumping these here to give a rough outline for all future development.

Base library. Many of these are already done:

basic math:
add, subtract, multiply, divide, round, modulo, root, exponent, logarithm, sin, cos, tan

Array operations and accessors (multidimensional):
slice, concatenate, transpose, reshape, broadcast, sum, intersperse, map, map to slice, apply, fold(reduce), intercalate, filter, delimiter split, predicate split, head, tail, init

Generators:
Linearly interpolated range (aka. Linspace), Perlin noise, random numbers(various distributions), point grid

Matrix basics:
multiply, inverse, determinant, norms, decompositions

Transform matrix ”primitives”:
rotation around axis, scaling, shearing, translation, direction to matrix

Vector:
scalar product (dot product), cross product, normalize, matrix multiply, rotate around vector, scalar components to vector (and back), norms

Program flow:
group functions, group recursion, conditionals(if,case,select)

Blender data:
mesh access: vert locations, normals, faces, edges, wide variety of selection methods ; points to mesh ; points to strands ;

Simple group nodes:
Large collection of convenience functions for end users

Mid term ToDo:
type system
better (actual) compiler
code cleanup and release
operator definitions: blender operations that can be added to menus and bound to keyboard shortcuts
generated GUI elements.
memory bridges to Blender particle system and mesh data (remove python bottlenecks)
complex data structures, unbound functions (for partial application), data lenses
disk cache (memory cache already done)
lazy evaluation (faster and saves a ton of memory and memory access)
infinite lazy lists/arrays
quaternions
more interactivity (is more of none still none? :slight_smile: )

Imperative hacks: for- and while-loop, in-place modifications
–It has proven quite bad practice to use these extensively with nodes, but they might be useful for some low level algorithms and for binding imperative libraries.

Long term ToDo:
BGL gui elements
OpenCL optimized for performance (initially it’s not)
Database access
Eventstream and io system (Functional reactive programming)
XML,HTML,CSS,JSON,SVG handling
Ability to bind arbitrary python libraries: eg. pygame, PyQt/PySide, scipy, django…
True JIT compilation.
Submit lots of patches to pynodes and Blender GUI api

Multiple back end languages: Javascript, QML ,C/C++,SQL, Lua, Haskell etc.
…and frameworks: Ogre, BGE, Torque, webGL/webCL, PyGame
(Just some possibilities. Not going to do them all)

----applications----
Here are some of the things that I will be using this system for. (To do whenever/if I feel like it (tomorrow or five years from now)). Not in any particular order. These are up for grabs. I’m very likely not going to do anywhere nearly all of them.

modifiers: better solidify, better mirror, slice, lathe, better bend, better path deform
cloth and soft body simulation. Good for skin folds, blubber, webbings and wing folds too.
numerical solvers, integrators, function plotters
Bezier paths and better access library for blender splines (most of the code already exists in polydrive)
larger library for matrix computation
tree/forest/foliage generator
terrain generator
hair simulation (basics done)
polygon hair generator (polydrive – partly done)
geomapper (polydrive – mostly done)
remesher (polydrive – partly done)
ropes/knots (polydrive - mostly done)
feathers
particle system(s)
rigging tools: better armature, maybe muscle (also make them portable to games)
road generator
new primitives: tires, treads, ropes, helix, loft, walls, windows, stairs
crowd/flock system
clean booleans
fragmenter
raytracer for engineering applications

Possibilities are many and varied.

wow. This is a very impressive and ambitious project. I look forward to getting to play around with it, whenever it’s at a good place to share. Oh man, I just read the Polydrive thread, not sure how I missed it before. I would certianly be down to support this kind of development in blender. Vector field tools would be so great. I was recently looking into a technique for dynamic crosshatch line drawing textures that needs vector fields representing the primary curvature to automatically splat the texture patches onto the model: http://research.microsoft.com/en-us/um/people/hoppe/hatching.pdf

The possibilities for this kind of node based mesh (and other primitive type) generation and modification are enormous. I am currently doing lots of procedural modelling for 3D printing. Blender is my primary tool, but I’ve had to branch out in order to easily create procedural models, but this kind of system could make it possible to keep much of my workflow inside blender which would be best.

Thanks for your hard work! I’ll be keeping an eye on this thread :slight_smile:

This looks really promising, I’m looking forward to see more stuff.
Good luck! :slight_smile:

I’ll probably make the first real release when I’ve added the type system. Currently there is no clear logic behind how different components can be fitted together, and no error checking, which makes it pretty much unusable by anyone except me.

I will get back to the Polydrive tools once this system has matured a bit. It’s on temporary hold right now. The vector field will be a reusable component in the node system, and not tied to the hair and remesher tools. I’ll hope to use it for a bunch of other things too.

Nodes are definitely the best tool for procedural geometry. There’s a thread floating around, which discusses array modifier improvements, and there seems to be some concern about whether it ever gets accepted. Those sorts of discussions will be rather unnecessary when anyone can just mix together existing components to create such a thing themselves. I’ll do it myself as a small demo once I’ve added some randomness functions and Perlin noise.

so many node addons but this one looks the most advanced

wow! I cannot even graps the full extend of this project, but it sure looks amazing! Nodal system for everything is something I would really like in blender, it could give great flexibility in every part of the workflow in blender!

Really good project, I wish you good luck and I hope to see further news soon! :slight_smile:

Very impressive, even at this early stage.

This is exactly what I wanted to happen to blender :slight_smile: Keep doing demos and can´t wait until you release the addon. Great that you have taken game engines in mind.

@anvilSoup Looks promising and it is great to see what you hsve been up to. It must be nice to finally be able to share something as well?
What seems to be the main difference between Flakes and the Sverchok system?

I have to say I’m not 100% sure how it works and what it can do. I only discovered it couple of weeks ago and I haven’t had time to delve into it too deeply (and then I almost forgot about it, thanks for mentioning). There’s a thread in the scripts section, which I never follow. People should post their bigger projects on the general section so others can actually see them :).

From what I have gathered though, it seems to be mainly about geometry generation/manipulation (do correct me), which is fantastic on it’s own, but I wish to create a system that processes arbitrary data, and has very loose hooks to any system that uses it. That way I never have any restrictions on what I can use it for, be it geometry, particles, operators, games, CFD, finances, heat transfer or whatever else uses a lot of numbers.

Sverchok is a lot less ambitious in scope and started as (and still is but getting better) a bit of a hack. But a useful one.
It is contained inside of blender pynodes without any open cl etc. The goal of sverchok, as you state, geometry manipulation and creation.

I look forward testing flakes.

Go go anvilSoup, great to see ur progress.

WOW, i need this like… CRAZY! :smiley: GREAT work and idea! I really hope this gets done, and man i would even pay for it (but keep the small artists in mind)!
Gosh, maybe talk to Blender or Kickstarter for a funding ? So we can get it faster ? IT IS A H-U-G-E productivity approach that challenges m-a-n-y INHOUSE tools!
Man, if you make this happen, you save MILLIONS Artists from MISSING in-house tools that only Highend TDs can afford!

ALL MY RESPECT MAN!

BTW, Flakes is GREAT! :slight_smile: My advice don’t change the name :wink:

ps: pleasemakeithappenpleasemakeithappenpleasemakeithappenpleasemakeithappenpleasemakeithappenpleasemakeithappenpleasemakeithappenpleasemakeithappenpleasemakeithappenpleasemakeithappenpleasemakeithappenpleasemakeithappen :-)))))))))))))))))

Sounds great! I hope it will be open-source. A back-end for the new Godot engine (script very similar to python; http://www.godotengine.org/wp/ ) would be probably the easiest to do game wise.

AnvilSoup,it’s really interesting(I have an eagle model that needs a decent set of feathers,maybe with your nodal system I can reach a better result than with Blender particles/instances)
This project looks too cool ,I’m really curious to give it a try.

will be nice to see overview of all functions of this addon

It will be open source. I haven’t decided how to license it though. I would like it to be possible to keep the compiler output closed since game devs and engineers appreciate that occasionally.

Perhaps surprisingly, anything that already has a deeply ingrained convenience editor will be rather difficult to integrate to, so godot probably isn’t ideal for that. Earliest experiments I’ll probably do with PyGame or some other python framework (or even bge, though I’m not a fan) since I’m already dealing with python. I’ll likely use Ogre (graphics engine) for the first high performance 3D applications. Ogre is fairly bare-boned, so I have more freedom to do things the way I want.

You definitely can. I’ve made a simple feather system in ICE, but it was really slow and cumbersome to work with. It will be a lot easier in Flakes. I’m quite looking forward doing it myself actually :).

AnvilSoup,really good to know that it will be possible.:eyebrowlift:

Can’t watch the video in full screen because vimeo is known not to work properly on random systems. :frowning:

Might there also be a youtube link or some other alternative?

edit:
nvm, managed to watch on another device. Awesomesause. :slight_smile:

I mentioned Flakes in another thread and it derailed the discussion a bit. I do apologize. Responding to the comments here.

Of course I will create extensive documentation. One can easily get started just by guessing, but there are about a million small tricks that may not be immediately obvious and need to be documented. A bulk of it will probably be just a giant collection of small examples. I kind of detest the way people make tutorials these days. You don’t need a 15 minute video to show how to do something that takes 5 seconds.

[gave an off handed comment here]

I haven’t paid the slightest attention to the gui outlook yet :D. There will be more color, but I don’t yet know if I’ll make them respond to themes. The plan is that users can freely color code their custom types and nodes. On further consideration I think trying to get them work with themes might just look confusing.

[about godot, unity and other engines]

I addressed godot briefly above. It’s probably not ideal since it already has a lot of stuff that I’d have to work around, and a custom language I’d have to make a compiler for. I’m also likely not going to touch Unity or any other closed proprietary system.

Once I’ve figured out the whole integration process, I’ll make some documentation so anyone who is interested in those systems can have a go. It will require some technical skill though.

Aermartin’s latter point is kind of where I’d like to go. I’m starting to lean towards more modular approach. Flakes would probably be ideal as glue code that binds together bunch of libraries, like Ogre, SDL and Bullet (or Box2d or Nape). All high level logic would be in Flakes and all asset creation and scene editing in Blender. Essentially it would be a full game engine of its own.