Almost everything nodeable !?
For some time now the plan has existed to make access to Blenders internal data much easier and generic by using the API system called “RNA”. This system declares unified access methods for anything you can see and manipulate in a Blender file: from objects, meshes and lamps to materials, particles and even the user interface elements. It is the same system used also for defining the stuff you can script on with python (though python is not involved so far).
If you watched the previous demo videos, you may have noticed that the Get/Set nodes are all very limited and static, i.e. their input/output sockets do are not changing at all (that is especially annoying with the Set nodes, because you essentially are resetting each of the input values in each node). Well, these problems will be solved soon, here are some first impressions of the generic data nodes (still WIP):
Before any sockets can be added, the type of the data node has to be set (for coders: this is a StructRNA identifier). This is could be simplified further by adding the most common struct types (objects, meshes, particles, etc.) to the menu as shortcuts to predefined nodes and adding a search and/or tab-completion feature. After setting the type, all available properties of that type can be added as sockets (outputs for the GetData node, inputs for SetData). This too could benefit from search/tab-completion.
The “Path” sockets you see in the image are used to define the actual source of the data, i.e. an instance (or collection) of the nodes struct type. This is basically a shortened version of the RNA paths known from python scripting: They point to some entry in the bpy.data namespace. Here are some examples:
| StructRNA | Path | Comment |
|---|---|---|
| Object | objects['MySpaceship'] | plain object data (not a mesh!) |
| Mesh | meshes['MySpaceshipMesh'] | not vertex data, just the mesh properties |
| Mesh | objects['MySpaceship'].data | access to the same mesh via its parent object |
| MeshVertex | meshes['MySpaceshipMesh'].vertices | this actually gives you the vertex data collection, like positions, colors, etc. |
Note that the paths are only really evaluated at runtime (though most often you will end up using the default socket values). Also you may notice in the image that the GetData node has an additional “Path” output too: This can be used to quickly construct chains of data nodes without the use of a third value node just to have a common input for the paths.

Left side: An empty path means the implicit "self" context is used. Right side: A (shortened) RNA path is used to describe the data source.
Not all properties which are part of the RNA can or should be selectable as sockets:
- Read-only properties can not be part of SetData
- Structs that are exclusively part of the GUI system and other sensitive areas not intended for simulation should not be selectable for data node types
- Pointer properties can not be used as sockets. To access primitive properties of their target structs, the RNA path should be refined further and used in other data nodes
- Property collections can be tricky, especially when using varying sizes (but should be possible in the end by putting them into their own unique context)
Important: Collections of primitive types (float, int, etc.) are not to be confused with collection contexts generated from the node path input! The latter are arguably the most important new feature for doing scalable simulations. In short: path inputs define a pointer or collection of pointers, whereas the sockets define primitive properties from the structs their node paths point to.
Last but not least there is one feature that should give the nodes good usability boost: the implicit “self” path. This is a path to the context in which the node tree is executed:
- For particle simulations this would be the particle system
- For mesh modifiers it’s the mesh object
- etc.
Whenever a node has no path input specified, the “self” context (or alternatively called “this”) is used. This means that a node tree (or more often node group) can be easily reused in different contexts without having to retype the data paths every time! Furthermore the “self” path can be redefined by certain nodes, such as special “ForGroup” nodes, which allow the execution of a tree branch for each member of an object group (more on that later).
Cheers
Lukas


I was dreaming with this possibility but i thought that you will be ending up implementing fixed properties, but now you got this, this is astonishing man!!!!!
I was dreaming also with the possibility to use it as driver system, instead of the ugly way to set up drivers in the graph editor, but the node tree are only executed in the animation play time. Is there a possibility to execute the nodes for any object manipulation and UI in the viewport? just something to consider.
This node system is so powerful that deserves its own name, like Blender Crystal perhaps!(better than the Ice right :razz: ;) ) or whatever, just we should start to think a name
The best way of integrating node trees is still an open design question, but luckily changing it does not affect the internals much. Currently the tree is called from a modifier, but that is not the best way to go about it. One possibility could be replacing modifiers with node trees altogether, however that would be quite radical. Good ideas are always welcome! :)
About naming it: internally i call the tree type “simulation nodes”. Have to pick up a biology book to see if there’s some fancy beside DNA and RNA :cool:
codons? :???:
http://en.wikipedia.org/wiki/Genetic_code
There was someone at the 2008 blender conference from Italy speaking about “Using Blender for molecular animation and scientific representation”…
maybe ask them if anybody can get in contact. :grin:
“edit”
note: they might not be directly into genetics but they may know someone
“One possibility could be replacing modifiers with node trees altogether”, why not. each modifier could use a output node, and you select what … just as textures has.
Interesting read, I learn a lot about the RNA. thanks man.
Amazing, how is the RNA system overall speed for this?
cheers
I cannot give a reliable answer yet, but since the RNA is really just used for pointing the nodes at the data it shouldn’t have much impact on actual execution. If a RNA collection uses a slow iterator, getting this data into the tree and back can slow things down, but for array-type data (like vertices or particles) the overhead should be negligible. Using python for this would of course be evil :evil:
ah that’s great news, didn’t expect it :D
WOW!!! This is awesome.. I’m a dev with an active artist brain.. what would you suggest is my best resource for Blender dev ramp up? I do C/C++..
The wiki page contains most documentation, but beware of the versions stuff is about! The best place to ask for help is either the mailing list (bf-committers) or the irc channel.
I can only suggest to find some specific area you’re interested in and try to make a small, self-contained project to get your head around the concepts. That fire sim i made at the start was already too big, which is why i didn’t finish it (besides trouble with the particle system). Modifiers are relatively easy to create in C. Scripting allows you to access just about everything in blender without the intricacies of the C internals if you don’t mind writing in python.
As always, it’s awesome to see work being done on nodes – it’s one of Maya’s strongest features (Maya’s scenes are ENTIRELY node-based, right down to modifiers, texture-maps, and object history), and bringing that to Blender can only make things better. :D
Sorry man, i´m was a Maya TD, and Maya is not node based execution, its only node based referenced elements (elements in scene are nodes to visually connect things, not functions and operations, not programmability here.). Softimage´s ICE, and houdini VEX yes, are node based (visual programming) really, like this Blender brand new system. Now are 3 in this interesting game! :wink:
Lukas, will it possible to develop a “execution once” program with this system, like a script?.
And another question… will be possible to interact with UI and create a UI Tool with? (Actually is not possible in ICE, it´s impossible to “see” UI via ICE to create a tool, like a bidirectional constraint that “see” what element is manipulated at moment and use this as condition to execute things).
I’ve got a small feature request. We need some way to comment the nodes since the trees can be really complex. Some way to comment the nodes is almost a must if you want others too understand your nodes.
:idea: My proposal:
A comment node that just contains text and the possibility to add comments in a grouping node.
Anyway… awesome job so far :smile:
Thanks!! another awesome update. I hope your work makes it into trunk. I wish (mostly)everything in blender was node based.
@phonybone great work!
I have an theoretical question.
Right now I’m work with Computer Vision and Augmented Reality and I searching for an good visual programming tool for video–signal processing, where I can develop nodes by myself.
Some time ago I give a try to Apple’s Quartz Composer: http://cl.ly/2Ec9 It’s works good, but it works only on mac osx ( and I not like objective c too much)
I work with blender periodically, and love this great tool. But I don`t have understanding of internal architecture and data workflows.
Can you tell me, it is possible for nodes to do an realtime video processing job? How often tree of nodes can be updated? What can drive updates, except of animation? It is possible to run update on custom event like “newVideoFrame” from another node like “live video” ?
Thank you.
@Malcolm, peko:
Triggering the node tree execution is currently an ad-hoc solution using an object modifier, just to get a way of seeing results. It would be nice if node trees could be associated to more different events in the scene (frame changes, ui inputs, property updates, etc.), but currently this is somewhat limited by the shortcomings of the dependency graph. In theory that system should allow objects to update when changes happen somewhere else, but it only really works with object motion at the moment. This will without doubt be a next major refactor project for Blender (after 2.5), but it’s out my development scope :roll: . However, the kind of data you can read and/or update from within the tree is almost unlimited with the RNA data nodes :mrgreen:
@peko:
The “simulation” trees are mainly intended for cached simulation of particle effects and the like. Using this for realtime processing of video frames is not guaranteed to work, but i will of course try to reduce overhead as much as possible.
@mutze:
Good idea :grin: . Maybe this could be an integrated feature of the grease pencil system, but i have to find out how it works in detail. There are a couple of other things that should greatly improve usability, first off the ability to rename group node sockets (having 10 sockets named “Value” doesn’t help at all :wink: )
where to download build or source code?
You can download the branch from svn:
svn co https://svn.blender.org/svnroot/bf-blender/branches/particles-2010
Here are some instructions on building blender in general (just make sure you replace the svn path as described above):
http://wiki.blender.org/index.php/Dev:Doc/Building_Blender
You can also find some builds on http://www.graphicall.org/builds/
Be warned though: the current head is not in a very usable state, since i’m currently working on OpenCL implementation and have disabled some features. This will hopefully change in a few days.
I have a request for what some of us have been seeking for quite some time:
A node to let you use specified frames and/ or frame ranges from a video texture.
The uses include:
simple facial expressions and visinemes using texture animation, eg if saying the letter ‘o’ is in frames 117-143 then use those frames as the texture sequentially (perhaps backwards as well?). Should have a way to handle different frame rates. Could use an f-curve to select frame number for input.
You could also use this to drive effects automaticly, eg a person comes to a window and waves after a given event. Or the sun could set, blood could splatter, etc.
May also be helpful for the game engine.
Awesome stuff, keep it up!
I’m looking into building a procedual plant maker…
Trunk = create a curve1 + Bevel1 + Taper1
Branch = curve2 + Bevel2 + Taper2(max diameter = Taper1)
Branch placement = Curve1 length % from bottom x number of branches… and so on, it that possible with the current node setup? Thank you by the way, when I saw the node setup I experianced pure joy.
How is things going? I have seen that you have been working with some opencl and stuff lately but I have no chance testing this since I have no graphic card that supports opencl. Maybe a post about this could be fun? :grin:
Hey Lukas.
I want to know one thing that’s bothering me.
Could your node system actually change the Constraints and Drivers into nodes?
So, for example, you could put a “data path” node, connect it with another data path node and have that other data path be completely driven by the first one.
Explanation here:
http://blenderartists.org/forum/showthread.php?t=197510
I just thought that if setting up drivers was as simple as that, it would be really awesome and intuitive….
This way you would be able to build your own constraints out of math nodes…
Any idea what might be causing the below error when building your branch? I’m using scons on OSX 10.6.4
Configuring library bf_nodes
Cannot continue. Missing argument for BuildBlenderLib bf_cmpnodes
Cole:
you can find a patch here : http://www.pasteall.org/15914/python
it is meant to replace the SConscript file on sources/blender/nodes
it will then compile correctly using scons
Thanks! Worked like a charm.
How do i communicate with Lukas personally? I don’t think i’ll get any response from this blog. :neutral:
Sorry for the long silence here, i have been working on internal stuff that does not really produce new visual goodies, but want to do a post on OpenCL and the way node trees are executed in detail soon. Let me just answer the questions:
@Lyle Walsh, Stephen, FreeMind:
Nodes can be used for a plethora of things, but my time is limited and i want to concentrate on particle nodes in the first place. Try making a detailed design doc (what kind of nodes would you like to see, what exactly should these nodes do with the input data, make a few use cases). Even a bad design doc at least gives people something to discuss and refer to ;)
@FreeMind about the drivers idea:
While it would certainly be a cool alternative for python expressions, node trees would face the same problems as other drivers: there is currently no general way of linking “events” in blender (rna variable updates) to other actions (i.e. drivers). It only really works for object transformations, which is why these are usually used as proxies for driver controls afaik.
You can often find me on the irc channel #blendercoders on freenode, but feel free to just post your questions here or mail me.
@oenvoyage: thanks for the patch, will upload it soon.
Hi, i just compiled you branch to play a little bit, but sadly nothing changes.
I have a NodeTree Modifier on a Mesh with this simple setup: http://www.pasteall.org/pic/6280
But i can’t get the mesh to change in any way. Is there something else that has to be done? And about that compile button which is for openCL i guess: Do i have to specifiy something in my user-config.py in order to have a build with openCL enabled?
Just managed to fix a couple of bugs that should make the branch usable again, just have to reenable the node types again. Control structures and the generic GetData/SetData should be working, a couple of math nodes will follow soon.
In order to use OpenCL you need to specify WITH_OPENCL=True in your user-config.py (and you need to actually have an OpenCL SDK from for hardware installed!). Then you need to specify “–enable-opencl” when starting blender so your command line should look like
blender –enable-opencl
Hi, I can confirm that rev.32430 still does nothing with a nodesetup like tstscr posted (this is without OpenCL enabled) Any ideas? I’ve been updating with every of your commits in the hope to have a working build, but no dice…
keep it up, this is gonna be pretty big :)
Sorry, should have taken a closer look at the actual node tree: you didn’t use a path in the GetData/SetData nodes. This is necessary to tell the nodes which data they should read/modify (the “Type” field is just used to define the RNA type so the right property sockets can be added even without a known path). Here’s a working file: http://www.pasteall.org/blend/3893
Note that you can use the output path to pass the string on to other nodes and avoid copy/pasting it repeatedly. Also i’m planning on making “shortcut” nodes for common data types to make this setup a little easier.
Hi, I’m getting this on your posted blend
read blend: /home/Philipp/Downloads/savetest_106.blend
Memoryblock free: pointer not in memlist
Memoryblock free: pointer not in memlist
Memoryblock free: pointer not in memlist
Memoryblock free: pointer not in memlist
Memoryblock free: pointer not in memlist
Memoryblock free: pointer not in memlist
Memoryblock free: pointer not in memlist
Memoryblock free: pointer not in memlist
Memoryblock free: pointer not in memlist
Memoryblock free: pointer not in memlist
WITH_OPENCL disabled!
Executing operator subtree Program
Executing operator subtree SetData
Speicherzugriffsfehler (Speicherabzug geschrieben)
Should be fixed in r32443, i fixed the memory issues there. If it still doesn’t, please try this file: http://www.pasteall.org/blend/3899
(probably caused by a bad string pointer i use for restoring RNA pointers, this can be persistent in files from older revisions. debug mode doesn’t crash on memory errors, made me a bit lazy about that :???:)
OK, I’m at it again, but still no luck. This time I’m testing from a machine with OpenCL
(1) I’ve added WITH_OPENCL=True to linux2-config.py (there is no user-config.py) >> this doesnt seem to change anything in compilation process
(2) starting blender with “–enable-opencl” only gives me an error: Can’t read file: “/home/Philipp/Apps/BlenderParticles/particles-2010/–enable-opencl”, No such file or directory.
(3) both of your posted blends crash
Executing operator subtree Program
Executing operator subtree SetData
Segmentation fault (core dumped)
OK Used tortiose svn to grab the following:
https://svn.blender.org/svnroot/bf-blender/branches/particles-2010
Directory c:\BlenderNodesSVN\blender
https://svn.blender.org/svnroot/bf-blender/trunk/lib/windows
Directory c:\BlenderNodesSVN\lib\windows
Used cMake, and opened it in vs2010, its all good.
One question, what is the abode of the node code?
any any chance you could give me a tip on how to create my own node?
Forgot to say please, please ? :D oh and thanks phonybone, I think this is still one of the most exciting developments with blender.
I think I’ve found the abode of the node code: Files/intern/simulation/nodes
looks like I’m biting off more than I can chew.. :shock:
“. I am really thankful to this topic because it really gives up to date information `”:
Greetings! This is my 1st comment here so I just wanted to give a quick shout out and tell you I genuinely enjoy reading through your articles. Can you recommend any other blogs/websites/forums that deal with the same subjects? Thank you!
Thx for information.
Hello there! I just would like to give you a big thumbs up for the excellent info you’ve got here on this post. I am coming back to your blog for more soon.
my weblog :: Mutiverso.com