[AddOn] Blendgraph 2.7 UPDATED (on hiatus)

Hi All,

I have been working on a new AddOn that tries to encompass the functionality of several of my previous AddOns. Blendgraph is the result. Currently you can emulate some of the functionality of RE:Phrase, RE:Lay and RE:ticular.

I offer up this AddOn as platform for new tool developers to use. The Generators section of Blendgraph basically emulates the Tool section of the 3D viewport. So if you are are developing a tool that generates a mesh or multiple objects you may want to consider making it a Blendgraph node instead. The advantage of migrating your Tool based generators to a node is animated parameters and interactive regeneration.

Blendgraph Generators:
A.N.T. Landscape (By Jimmy Hazevoet)
The Parametric Beam Object (Thanks again Revolt Randy!)
Fiber Mesh (Thanks to Liero for the ray cast bounce code!)
The Fractal Tree
The Font Repeater
The Object Repeater (alternate layout code by guy lateur, thanks!)
Regular Solids
Sphere (mesh code by guy lateur, thanks!)
Torus Knot
Missile Attack

Blendgraph Importers:
Meshfoot
File To List

Blendgraph Types:
Integer
Float, Float3
Boolean
String
List

I have an introductory video here:

https://vimeo.com/82848133

There are some development test threads here that explain the nodes.

Was wondering what you were working on. Haven’t been looking in the testing forum.

Was the first to download … I see it’s up to 4 or 5 already while I write this.

This looks great. I haven’t had much time to play around with it… a couple of things I’ve hit up against.

I did try a simple font repeater and driving a float value with a sound driver for the spacing… unfortunately this didn’t work. (not even with a simple “frame” driver) Can you think of some reason drivers won’t work as your inputs? The only message I’m getting to the console is “string”.

So I thought I’d try the fcurve node to spit out my baked props off the speaker. Unfortunately I had a test file full of empties, (hooks to a curve being wiggled with far too many sound channels.) this threw the fcurve node into a frenzy line 83 in bg_node_fcurve because empties have no data

Something like this will fix it


              data_obs = [o for o in context.scene.objects
                           if getattr(o, "data", None) is not None
                           and getattr(o.data, "animation_data", None)
                           is not None]
                for ob in data_obs:
                    ad = ob.data.animation_data
                    if ad != None:
                        ac = ad.action
                        for fc in ac.fcurves:
                            s = "%s%s%s%s%i" % (ob.name, DATA_DELIMITER, fc.data_path, DATA_DELIMITER, fc.array_index)
                            result.append((s,s,s))

Also maybe the data_path would be a better choice for the list there. Particularly for me cos I have the channels on speakers eg [“CH0”] etc.
You can check against the bl_rna of a prop to see if it is an array and needs the fc.array_index.

All that said, this is shit hot. I’ve been looking at drivers with nodes, but looking at this perhaps making a node to output the float might be an easier approach… be a pretty flashy looking node with 1000 channel buttons on it lol. Also I’ve created a dummy driver that spits out the driver locals to a var names / values dictionary . Might pick your brain on how that can be set up as a node. This could very handy.

PS a button to turn on / off the modal handlers would be handy too. It takes F8 completely out of the question.

PPS… make that 11 downloads… that’s more than I get in a year!!!

PPPS the list comp above should prob go all the way to actions. The obs can have animation_data if they have drivers or NLA … which will make the code throw on action being None too.

Saweet Atom! Thanks for staying busy with Blender addon development. I can hardly wait to have more time to test it out…
I’ll post more then…

@batfinger: The fCurve Node is still kind of new. I like the idea of throwing the data_path, however.

Can you think of some reason drivers won’t work as your inputs?

The weird thing about animated properties in nodes is that I can not find the fcurve anywhere in the Graph Editor? (try it, insert a keyframe and try to view the fCurve) This may be part of the problem that drivers are having. This is one of the reasons I have not tested drivers. I don’t know if this is a bug in the Blender Graph Editor window or if there just needs to be a filter to turn on properties?

Might pick your brain on how that can be set up as a node.

Sure, I hoped other coders would find the platform useful enough to code their own nodes against.

PS a button to turn on / off the modal handlers would be handy too.

I do have a modal timer running all the time. This is how I graphically refresh the tree when an update is issued. Is this what you mean by modal handler?

PS: batfinger, after thinking about it, the reason the drivers are not updating is probably because a node.update() is not being issued when the frame changes. Blender does not offer that feature automatically so I am forced to refresh certain nodes, such as generators. You could put an intercept inside reviewNodes of bg_frame_change.py at line #120. Simply construct a detection mechanism for a node with a driver and then issue a node.update() when True.

Oh thanks Atom and happy new years.

This is just so cool. I can’t believe that this sort of thing isn’t built in? But at least you are committed to making it work really well.

Thanks again!

I’m trying to pick my jaw off the floor after watching your demo video! :slight_smile:
What an advancement this is and what a gift for new year’s eve!

Many thanx Atom, cannot wait to test this

I would love to use this but its not worth me downloading and installing a specialized version of blender to use it

was working on some stuff and couldn’t get a render without Blender crashing… tried appending to a new file and other tricks with no luck then remembered I had your addon enabled by default :stuck_out_tongue: it seems like I need to change frame at least once? looks great, not every node worked for me though… love the animation options and auto update but also miss some stuff from nikitron’s tool

shaba you could also be able to test cycles volumetrics, a couple of new modifiers, improved modelling tools and gui changes

was working on some stuff and couldn’t get a render without Blender crashing

This is a new feature for Blender 2.69 release. Try this work around. Click the OpenGL render icon in the 3D viewport to issue a single frame viewport render, then press F12. This is the only way I can successfully render in Blender with this 2.69 release. Otherwise I get a crash on render using Windows or OSX.

NOTE: This is not related to my AddOn, just a tip.

This will be amazing for moGraph! Thanks for all your work Atom.

I must test this cool addon, thanks Atom.

liero: My laptop has a crappy intel chip gpu. The only advantage I see to cycles is with an NVidia chip. Let me know if I am wrong about that. But every cycles render I have seen has been really grainy. Also I would end up having yet another version of blender on my machine. I already have 4 that are decompress and I forget how many that are in zip format.

Atom thanks for noting in the very first post that this requires a newer build of blender. If other devs did this they would have less needless questions about errors with their addons.

Hi All,

Thanks for all the feedback on the font repeater. I have altered the font repeater node parent to be of type Font instead of type Empty. So the characters are parented to a Font object with blank copy and hide_render set to True. This makes it convenient to simply transfer values from the parent to all children when the node is updated. So just animate the parent font and the values will be transferred to all children.

This solves many problems. Like material assignment, font name change, other properties like bevel_start_factor etc…

This new Blendgraph code update (01/04/2014) maps the following font parameters as well as the first material from the parent font.


                        # Use these next lines of code to transfer whatever property from the parent font that you want to drive in the child.
                        
                        # Route all of the Geometry panel parameters.
                        ob.data.extrude = extrude
                        ob.data.offset = mt_parent_font.offset
                        ob.data.bevel_depth = mt_parent_font.bevel_depth
                        ob.data.bevel_resolution = mt_parent_font.bevel_resolution
                        ob.data.bevel_factor_start = mt_parent_font.bevel_factor_start
                        ob.data.bevel_factor_end = mt_parent_font.bevel_factor_end
                        
                        # Route Font panel parameters.
                        if mt_parent_font.font.name != ob.data.font.name:
                            # Font names are different, assign the font.
                            ob.data.font = mt_parent_font.font
                        ob.data.size = mt_parent_font.size

Excessive mapping of all parameters does cause a slow down in the code so I have mapped a few that I use all the time. Feel free to add your own parameters to the transfer section of the code as you see fit.

By using two font repeater nodes you can simulate a cap for a font. Increase the Offset for the second font and decrease the Extrude.

NOTE: I have experienced some strange characters appearing when using various build from buildbot and graphicall. I can safely report that theWindows Graphical JuicyFruit Build works fine with this release.

Attachments


bg_nodes_default_1c.blend (107 KB)

One thing that is buggin me is the spacing issues with the fonts - like in your example the o cutting into the W of “World”.

Here is another example, on top the outcome of the current version of the addon, on the buttom the same text with Blender’s text tools:


Gottfried, thanks for the feedback and the report of the scaling to zero error. I have fixed the scaling to zero error in the 01/05/2014 release.

Spacing is handled on line #263 of bg_node_font_repeater.py.


                        loc_result = [index*spacing,0.0,z_loc]    # Need layout algorithm.

As you can see I have a note that we do need some kind of spacing algorithm. I spent some time working on this for the Re:Phrase AddOn and I have begun the process of porting some of that research and code into the utility.py. My approach is somewhat documented in the returnCharacterWidthViaImportance def on line #855 of utility.py. Basically the concept assigns importance of spacing based upon visual width of the character. This only works for the english alphabet, however.

The current linear based spacing algorithm does work for mono spaced fonts. The default Blender font is not mono spaced. Here is an example of a mono spaced font (Monofonto).


Search DaFont for mono spaced fonts to use.

I can give you an advice for that, since right now I’m developing quite a similar node system called MoBlend (similar by purprose, but different by approach).
So, it might be not the fastest algorithm, but it works fine. Here is the basic idea: First of all - you need to use an actual TextCurve object as, let’s say, reference to proper spacing. As you probably know API gives you acces to every character as a spline (or several splines in case of letters with ‘holes’, such as “B”, “e”, “a” and so on). So, by finding leftmost, rightmost, top and bottom points of the spline you can figure out a bounding box and a center of the character. Then, as you guessed by now, you can place generated font object just in place of actual character in the original reference TextCurve. How to deal with extra splines in ‘holed’ characters? Thats simple. On a next iterration of algorithm you just check - if bounding box of current spline fits to bounding box of the last one, it’s not a next character, skip it.

My overall opinion on your system: one can achieve a very nice results with it, it’s quite powerfull, but it ultimately lacks one thing that i personaly put on a first place - usability. Your system has a very VERY VERY poor design. When motion graphic designer, for example, cant figure out how to use it without detailed explanation or tons of tutorials from autors - it’s already bad, no matter what result you can achive with it. Then again - it’s just my opinion.

Could some usability issues be resolved with some node groups or preset functions? Like Blender’s Quick Effects tools?

First of all this issues could be resolved with thought-out design.
For example: how the hell in the world would one figure out that ‘String’ node could be used to input object data by it’s name?? And for what? It’s not a big deal to add a node with a drop-down list of all objects in .blend. And you SHOULD do it for at least two reasons: first, because it’s quite logical to do so, isn’t it :)) And second - I might have object called “veryLong_and_frustrating to type in another field name”. You want me to type it? You want me to copy/paste it? Oh, please! When you designing your GUI you always have to keep in mind one thing - the users are LAZY! Always! If somewhere in GUI you can make something to be done by one mouse click instead of two - DO IT! :)))
Another example of over hinting literally everything. You have a nice huge warning below the addon description, noticing a user that new nodetree have to be created before all the fun have started. Seriously - do you think that user enabling your addon in a Node category would not be able to figure out that he have to create a new nodetree?? And even if it so - noticing this moment in description is good enough. Then: little triangles and chains next to sockets. What are they for there? It’s pretty obvious that node IS linked WITHOUT icon illustrating this fact. And little triangles… ?? What are these for? Every element in GUI must have explicit purpose. Ask yourself ‘Will it change anything, if i remove this element?’ If the answer is ‘No’ you know what to do.
Another example: List node. So we have a list with elements named as ‘Entry-1’, ‘Entry-2’, ‘Entry-3’, and below the list widget we see ‘value’ field. But why not to display actual values instead of ‘Entry-1’ and so on? What if i have 20 entries for some purpose? Am I have to click on every one of them to find out the value of each?
I can go on and on, and on for countless lacks in your design, but hopefully, you got the idea

Sergusster.: soo… where is this MoBlend ? i’d love to try it out =)