Request for a Tutorial on Blocks

PoobyPooby Posts: 122

Hi,

I'm excited to see Blocks added. I can comprehend that they are an important addition to Fabric.
However, if I am entirely honest, after watching and reading up on them, I still don't really have a clear idea what they are and how to use them.

It would be really great if someone could make an idiot-proof tutorial/ overview of making a tool and how the use of Blocks improve what was there before.

I'm sure I'm not the only one who would benefit from vicariously following the thought process of someone putting them into a graph to achieve something interesting.

thanks
Paul

I'm primarily trying to help the visual programming development, in my own small way, through providing feedback on Canvas.

Comments

  • scaronscaron Fabric for Houdini Posts: 171

    Hey Paul!

    I agree, its a bit of an 'Inception' scenario. I am still learning it myself... I understand why to use it and when to but not confidently how to build up my own just yet. Fortunately there are preset nodes to at least get you past the issue with having to write code for some tasks. Does the Deform preset not help you make some progress? There are two, one already setup for a PolygonMesh and another which works for all Geometry types (lines/curves, points/particles). The difference is the PolygonMesh preset supports normals where the Geometry one just works with positions.

    I think it might help to think of the block as the ICE Tree/operator. Since the loop in ICE is inherent of how it operates. Also, think about how ICE provides these built-in attributes which are always available to you, that isn't the case for Canvas and when designing a Block consider you need to provide those attributes to your loop/operator. I think the Image.Modify node can show you how getting the surrounding pixel is a required extra step which you have to compute yourself. In the case of getting neighboring vertices for a smooth op, you would need to also provide that neighboring information prior to the Block.

    If this still doesn't help, then I think we should base the tutorial you request around some similar task in ICE. Either point us to one of your awesome ICE tutorials you would like to port or maybe show a simple ICE graph we can use to guide the tutorial?

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Moin, Paul,

    I intend to do an extensive tutorial based on an idea and then trying to approach problem the various solutions on the way. However, that may not be what you would want to see in terms of explaining blocks specifically.

    If you are - basically - familiar with "loops", then I'd say the fundamental improvement to loops (which have been there before) is that blocks allow you to separate what is being done from how it is being done. There is still a loop construction "around" the block, but the user is not required to even see that any more.

    Say you have a deformer. That deformer will need to loop over all points in a polygonMesh and adjust positions, maybe normals. This is the loop, that is now being handled transparently. What now can be exposed (as a "block") to the user is the specific "what is being done to deform each point".
    So in the (exposed) block you only see those nodes that deal with ONE individual point (and that block is being executed for each point in the mesh automatically). This allows you to approach problems much easier, since you can "switch out" the deformation part (the block) and try "something else" without having to touch the rest of the graph.

    Would a tutorial based on this outline suffice?

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

  • PoobyPooby Posts: 122

    Thanks very much for both posts. They are helping me build the picture up. To be honest, anything showing more of them is useful to me.
    So it sounds like, albeit in a very different manner, its dealing with a similar issue as context in ICE.. Ie. you can just getpointposition and deform all those points in ICE without having to think about the fact that internally, its a loop on an array.

    I'm primarily trying to help the visual programming development, in my own small way, through providing feedback on Canvas.

  • scaronscaron Fabric for Houdini Posts: 171
    edited July 2016

    Paul, have you had a chance to look at the examples in... 'Samples\Canvas\Blocks' ?

    Oh, and check this video from Eric Mootz, especially wait till the end where he builds one of his examples up from scratch.

  • PoobyPooby Posts: 122

    Thanks. I think I have the jist of it now. This video helps a lot.
    I did look at the samples, but was imagining something different, so it threw me off. I was thinking of blocks as something more along the lines of functions and I couldn't make sense of it

    I'm primarily trying to help the visual programming development, in my own small way, through providing feedback on Canvas.

  • malbrechtmalbrecht Fabric for Houdini Posts: 752 ✭✭✭

    Well, in a way a block is a "function", if you consider that it can do with local variables (that have no scope outside the block) and that it is "fully encapsulated". But if you are familiar with how loops work in general, it's probably better to understand a block as the "core" of the loop, as it is always embedded in one.

    Marc


    Marc Albrecht - marc-albrecht.de - does things.

Sign In or Register to comment.