Here’s a short demo of one of the scripts that you can find on the DVD in the Mango SVN scripts folder. It’s called space_node_viewer_bookmark.py.
It’s a small utility to make navigating huge node-trees a bit easier, and we had a lot of those.
All the time while I was working with these huge node setups I thought that I would love to be able to define certain checkpoints in the node-tree to be able to quickly connect the viewer node to them to check out the result without having to zoom and scroll like crazy. Also jumping to the last node or comparing the result before and after some nodes was something that I always wanted to have.
But I always thought it would be super hard and complicated to do, involving some advanced C coding etc. But one day I asked Campbell what he thought about that and he said “No, that wouldn’t be hard at all! In fact, it’s probably just a few lines of python”.
Well, that was quite some motivation for me to seriously try to learn python.
So Campbell gave me a few hints and showed me how to approach the problem. It took me quite a few days and a lot more hints from the awesome and always helpful Campbell, but eventually I had it working. Yay!
So what it does is to define a list of bookmarks (or slots/tags whatever you want to call it), that get assigned with a hotkey (e.g. Shift+O) as a property to a node. You can then “call” that bookmark with a second hotkey (e.g. “O”) and that will connect the viewer node and center the view there. I made 3 different keys, U, I and O for 3 different “checkpoint nodes”. They also have different colors so that you can tell them apart. The colors are also used to re-assign the tags on load, because the “tag-property” does not get saved. So Blender uses the colors to determine and re-assign the tags to the node, so that when you open up a blendfile that had these tags they will still work.
You can also clear the bookmarks with alt+b.
There are 4 more hotkeys, 2 quite useful, 2 maybe not so much. With the keys J and K you can go to the leftest or lowest node in the tree. Might be helpful to quickly center the view to different areas. The other 2 keys are L and P. These do not center the view to that node, only connect the viewer node to the last node before viewer and composite (L-Key) or the previous node (P-Key), and I found that quite handy.
It’s one of my first own scripts that I wrote, so it’s probably not perfect. So if you know python and want to change all this, just do it!
But that’s the cool thing, because Blender is open source you can really hack in your own stuff into Blender. That’s so awesome, and a great motiviation for me to try to learn more python.
And for those of you who are (like me) intimidated of python or code: Personally, I am really an idiot when it comes to math and code etc, so if I can manage to write at least do a few lines of code, then you can do too!
And most importantly, if anyone of you who are better in code than me thinks he can do this better or improve the script, by all means, go ahead! I think there is a lot more stuff that can be improved!
There are many more scripts and addons like this on the Tears of Steel DVD that you can check out and use.
So! –> http://www.blender3d.org/e-shop/product_info_n.php?products_id=143