Halloween Costume ideas 2015

SVERCHOK / Get To Know Сверчок



On my last post talking about Blend Graph and my impression, I received a comment from NIKITA asking me a challenging question:

"Why not you try Sverchok? It is fun. Or you scare of something?"

I actually smiled at Nikita's comment, because in fact, the simple answer is: Yes, I was indeed scared by Sverchok Add-On. It is very daunting at a glance. Sverchok is very alien and unreal.

I watched the video of Sverchok when it was out back then and it felt kind of complicated that time.
http://www.youtube.com/watch?v=MkgoHZowtTU

(The Sverchok demo video introduction only has only 3415 views at the time I am writing this. I think it should have a lot more views and recognition. I have a feeling that this Add-On is something I will use very often in the future)

The demo video title is in Russian too and how I wish I know Russian :) It is probably Ukrainian language.

I am guessing that:

Сверчок = Sverchok (I will pronounce it correctly eventually)

Sverchok = Cricket in Ukrainian? Love the Ukrainian foods!

Thanks to Nikita, I felt very challenged to get to know this Sverchok Add-On and hopefully I get like it (I do) and can share what we can actually use this for. I will be making and learning at the same time, hopefully I can get used of this Sverchok.

So, this Sunday morning, I decided to sit down in front of Blender and tried to get a grasp on Sverchok Add-On --- that I knew nothing about when I started write this very paragraph.

Like usual, I am trying to collect some information from the Blender Artist Forum and break down the video demo, and hopefully we can understand the topic better.

Bring it on, Sverchok, show me what you can do!

GET SVERCHOK HERE

http://www.blenderartists.org/forum/showthread.php?272679-Addon-WIP-Sverchok-parametric-tool-for-architects/
http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Nodes/Sverchok

More here:
http://nikitron.cc.ua/blend_scripts.html

Follow the path of cricket (Sverchok) here:
http://nikitron.cc.ua/Sverchok_man_02.html

You should know the drill on how to install Add-On in Blender.

After downloading the zip, install it from Blender User Preferences (Install from file...) and so on. You will then be able to see Sverchok Add-On Node to activate the Add-On:


WHAT IS SVERCHOK?

I think the best description is exactly as shown on the Blender Artist Forum, first thread on Sverchok, I recommend you to read it again:
http://www.blenderartists.org/forum/showthread.php?272679-Addon-WIP-Sverchok-parametric-tool-for-architects/

The Sverchok team consists of:
  1. Nikita Gorodetskiy aka nikitron
  2. Alexander Nedovizin aka Cfyzzz 
  3. Linus Yng aka Linusy
  4. Dealga McArdle aka Zeffii, the Blender Scripting Master.
I like how modest the Sverchok developers and artists are when describing themselves. They are obviously brilliant people to provide us with such tool that takes Blender to the next level.

LET'S SEE SVERCHOK

Ok, so just like the Blend Graph Add-On, when working with Node-Based workflow, we will need the Blender Node-Editor as our environment to connect node network.

I normally use Blender's Compositing layout preset. Let's also have the Text Editor too for Sverchok.



Find an icon that takes you to Sverchok Node Tree environment. Next to the tiny Shader Node icon, Compositing Node icon, etc, you will find the Sverchok Node Tree icon.

If you are in the right environment, pressing Shift+A should give you list of Sverchok nodes:


SVERCHOK & RHINO - GRASSHOPPER


We will be working with Nodes and these Sverchok Nodes seem to be able to drill into the Component level and modify Components (Vertex, Edges, Polygons) in a way that you probably never seen. Very powerful indeed.

I was mentioned that Sverchok is based on Rhino - Grasshopper parametric modeling tool. I never had chance to use Rhino - Grasshopper unfortunately. I think some architects are lucky to use Rhino - Grasshopper in understanding parametric modeling and designing buildings.

Not long ago, I did casually read books about Rhino - Grasshopper. Very interesting reads, although I have not got my hands dirty.

I recommend you to Google Search and look into keyword "generative algorithms".
http://blog.rhino3d.com/2012/08/generative-algorithms-e-book-new-edition.html
http://www.grasshopper3d.com/page/tutorials-1
http://grasshopperresources.blogspot.com.au/2010/04/generative-algorithms-by-zubin-khabazi.html

My background is a bit on Houdini, I know a bit of VOP in Houdini. VOP in Houdini is a visual programming way of working with low level components of Mesh.

In Houdini, this means the ability of working with Points, Vector, Matrix, etc. Points is like Vertex. We know that connected Vertex will make Edges, and at least 3 Edge can create a Polygon or Face and so on.

Anyway, I imagine that Sverchok in Blender is like Houdini VOP. It is also similar to Softimage ICE, and a bit like Maya Point SOuP node. However, Sverchok in Blender is truly unique in itself allowing you to model quite advance abstract parametric design in a very intuitive visual kind of way. Of course a little bit of Mathematical thinking is required.

So Sverchock is A BIG THING in Blender!

SVERCHOK NODE TREE

On Compositing panel, click "New" so we can start creating Sverchok node tree network. You might want to enable "F" on Sverchok NodeTree so that the Sverchok Data got saved and not discarded, the next time you open this Blender file you work on.


Shift+A on the Node Editor and look at the list of available Sverchok Nodes.


Read through the Sverchok Wiki to see the list of all nodes that Sverchok Add-On currently have.
http://wiki.blender.org/index.php/Extensions:2.6/Py/Scripts/Nodes/Sverchok

If you are as curious as me, you will probably try creating some nodes and start connecting and plugging noodles and want to see the output right away. Randomly plugging thing and not understanding nodes will get you nowhere.

Don't worry. Don't be scared. We should start with simple thing first.

You want to see something happening, right? Yes, me too. I think we can start with simple nodes that actually create something.

"Generator" is usually node that generate or create something. That is what my intuition told me.

SVERCHOK GENERATOR NODES

I made a Sphere Sverchok node. But Blender 3D View display nothing.


I expect to see something. So by luck or something, I figure out that I need something like Viewer Draw node to be able to see something happening in 3D View.

Bright orange color on Viewer Draw node, I think means that the node is happy with the data we supply and can produce useful output.

Sphere.Vertices => ViewerDraw.vertices



Next, I start tweaking the Node parameter like Radius, U, V. And here, I also connect the Edges OUTPUT to edg_pol INPUT slot.

Sphere.Vertices => ViewerDraw.vertices
Sphere.Edges => Viewer Draw.edg_pol



I am watching Sverchok video while writing this, so I figure that we could also plug Polygons OUTPUT into the INPUT slot of edg_pol.

Sphere.Vertices => ViewerDraw.vertices
Sphere.Polygons => ViewerDraw.edg_pol


Occasionally we may need to press "UPDATE" button on the right side bar to update the Sverchok node tree so that the result will update on 3D View. Careful not to plug random data into the "matrix" slot of the Viewer Draw.

On the Viewer Draw node, there is a button that says "bake". By pressing that button, we can bake out the LIVE parametric geometry we build using Sverchok to a normal mesh geometry.


Just this alone is pretty amazing already. Give it a try yourself using other available Sverchok Generator nodes:

LINE Generator



PLANE Generator


HILBERT Generator (!)


CIRCLE Generator


Some Sverchok Generator nodes are requiring extra additional data for it to produce something useful, such as Voronoi, Image, etc. We will take a look at them later. I promise.

*** Add More Information About Voronoi, etc here ***
UPDATE: Nikita said, Voronoi is not yet fully ready, coming soon once NumPy is integrated in Blender, etc.

Mesh from Image generator is self explanatory.



(I recommend you to slowly go through the Blender Artist forum and check some provided Blend examples on Sverchok. I am doing that as well...)

DIFFERENT TYPE OF DATA

As you already see, the slots of nodes are Color-Coded to represent different type of DATA that you can PLUG to PIPE IN and OUT to be processed to produce a USEFUL OUTPUT.

For those with no programming background, this matter of DATA TYPE might sound complicated, but not to worry what you need to know is the actual Data Structure and how one data can be piped into another.

You will be using these data very often:

  • Vector (3 values)
  • Float
  • Integer (Int)
  • Matrix
  • Array
For example:
A single vertex has Floating value Position in X, Y, Z and is a Vector data type.
A mesh is basically containing an Array (bunch) of data of many types.


For now, at least, we have only used the simplest Sverchok node generators that create some procedural/parametric data to generate vertex/points, edges, or polygons, which then can be baked and output a 3D mesh geometry that we are familiar with. Sverchok node does the complex processing for you.

We can eventually be able to create, mix, process, and mash up our own DATA within the Sverchok environment in a node based workflow.

It does feel kind of abstract at time, because we are working in component level. We can do very unusual thing here that you don't usually think or see when working in Surface/Geometry level with 3D Mesh.

OBJECT IN

So, you know you can do this:
Sverchok Generator => Viewer Data => Output Mesh

You can also do the opposite, if you like to get Mesh data and process it using Sverchok nodes
3D Mesh => Sverchok Nodes



We are not doing anything with our Mesh yet, but here, hopefully you understand how Sverchok can get the data from 3D mesh using Objects In node. I am using the Matrix (Location, Rotation, Scale) of an Empty object so that we can separate it from the original Mesh.

ObjectsIn[Plane].Vertices => ViewerDraw.Vertices
ObjectsIn[Plane].Polygons => ViewerDraw.edg_pol
ObjectsIn[Empty].Matrixes => ViewerDraw.matrix

From Sverchok demo video, we can see how we could "instance/duplicate" of ONE MESH on the CENTER of FACES of ANOTHER MESH, using node tree below:



ObjectIn[Spike].Vertices => ViewerDraw.vertices
ObjectIn[Spike].Polygons => ViewerDraw.edg_pol

ObjectIn[Grid].Vertices => CenterPolygons.Vertices
ObjectIn[Grid].Vertices => CenterPolygons.Poligons

CenterPolygons.Centers => ViewerDraw.matrix

I found this interesting. Apparently we can supply information about Polygons from Grid Mesh, to be used as Center Matrix for another object (the Spike in this case).

I tried changing the Mesh Template, using Cylinder, Torus seems to work, but failed on Sphere and Cone. I have no idea why. Maybe Sverchok developers can explain this.



With the result we get, looks like the Sverchok repetition of mesh is well respecting the Face Normal of the template Mesh that we supplied.

CREATING DATA

I mentioned that we can create our own data. From Sverchok Demo Video, we have this example:



List Series SVK node is generating LIST or Array of data.


  • Vector Data seems to be Color-Coded Orange.
  • Floating Value Data is Color-Coded Green.


Using The Viewer Text node, whenever we press the "view" button, will spit out useful information (the data) about the data piped into it and paste it into Text Editor under name "Sverchok_viewer".

Click the "view" button only once, if you click it twice, sometimes you spit out empty data to the Text.



This should be quite clear. Maybe if you someone with no programmer background, this seems a bit scary, but I do not be scared. Try looking at the NODE we work on and see the PARAMETERS you can adjust and then it is quite easy to understand what it is actually doing.

INPUT => PROCESS => OUTPUT

If you are doing this by Python scripting, you probably write something like below:

myList = []

for i in range(0, 30, 3):
    myList.append(i)
    
print(myList)

It certainly a lot easier to generate that kind of data using Node in Sverchok! However, you will want to study a little bit of programming so that you can find this slightly easier.

The complicated part is more on the Math part and converting Math formula that involves Vector, Matrix, etc.

SORTING FACE INDICES

Remember my old post of Procedural Flipping and how important it is to have Face indices that is sorted. the way we want it?


Now, when working in component level, SORTING of Vertex Indices and Face Indices will be a lot more important.

BEFORE SVERCHOK



AFTER SVERCHOK



We could probably create "procedural flipping" using Sverchok. However, I have no idea how we can "cache" the array values. Maybe we will eventually get there.

TIPS: Displaying Indices (index number of Vertex, Edge, Faces)
bpy.app.debug = True

CREATING YOUR OWN MODIFIERS(!)

Ultimately, using Sverchok, we can actually create our own Blender Modifier using Nodes. If you think of Blender Modifiers like Displace Modifier, Subdivision Surface Modifier, etc, they are all have some complex Math behind it that process your 3D mesh.

Recreating Displace Modifier using Sverchok is probably a good exercise to understand more about Sverchok. But that is more intermediate.

You can see further on the Sverchok video demo, there are few more examples that try to explain how you would work with data using LIST data, etc.

  • There is even one example that is showing you how to create Spiral. The classic example.
  • Another example is showing how we can use Empty position to then modify the Instance Duplications 

TEST SVERCHOK 1: Randomized Surface Z

Here is my silly attempt to pass on Random data value to randomize the Z position of vertex.


TEST SVERCHOK 2: Wave Surface

Next, I think I started to understand Sverchok better. Well, at least in the basic level.

Here, I am using Formula2 node, which is basically a way to take Array Input and apply some Math formula to it. 

I am getting the original Z array positions and Y array positions of mesh  as INPUT for the formula and once processed inside Sverchock node, just simply pipe in back the resulting Vector to get this Wave surface.

I use this formula from Houdini cookbook:
array of Z positions => formula2.x
array of Y positions => formula2.n[0]

x + sin( n[0] * 5) * 0.2

Using those input, I then get a new value of array of Z positions and get the wavy mesh geometry.

(Check Sverchok Wiki and see what Math formula you can use.)



Using similar method, you can get the SPIRAL LINE quite easily. Or other procedural type of LINE creation, how complex all depends on your familiarity with the Math Formula.

REMEMBER:
When saving Blend file, always make remember to save the "Ghost Data Block" otherwise none of your Sverchok node-tree get saved, potentially losing everything. So I will try to remind you this whenever I can.


TEST SVERCHOK 3: Wave Line and Spiral Line



Above is of course similar to Wavy Surface, but we are using Sverchok Line Generator to create Wavy Line. By default Sverchok Line is create Line in X axis. So the positional value that is changing is the X position. I am using the sine of X positions as Array of values that I can use for the Z positions, hence the wavy line.

If we want Spiral, we can disturb the Y positions using cos().



TEST SVERCHOK 4: Epicycloid

Now, this kind of thing seems complex, but not really. It's a good exercise in converting Math Formula that draws 2D or 3D into node-tree. I mean this one is no different to previous example. 




FURTHER ON

That is basically my first 4 hours using Sverchok on Sunday! Quite exciting and very revealing. I really should have looked into Sverchok much earlier. Sorry for being late, better late than never...

I will continue and write more about Sverchok, I think I started to love this new Add-On. I am actually VERY IMPRESSED with what Sverchok can do already.

Sverchok is different to Blend Graph. Blend Graph is working more like on a high object level, would be great to duplicate, offset, replicate animation and such in Object Level.

While Sverchok is a lot more advanced, allowing you to work in deep Component Levels to generate mesh. More like the real procedural/parameteric modeling the way I always dream of to have in Blender!

I think it is a good idea for you to try Sverchok yourself. Start with the Generator, then try doing some Math calculations, and then use the Line Generator to Draw some interesting Line pattern. I think, soon, in no time, many people will start to use Sverchok and hopefully contribute some of their knowledge for others so we all can benefit.

Start learning this Sverchok just like learning a "new language". You will be rewarded.


Post a Comment

MKRdezign

Contact Form

Name

Email *

Message *

Powered by Blogger.
Javascript DisablePlease Enable Javascript To See All Widget