Page 1 of 2

simple loop in canvas

Posted: 23 Oct 2015, 10:16
by anhungxadieu
hi there,

who know how to do a simple loop inside canvas ? :-s

Re: simple loop in canvas

Posted: 23 Oct 2015, 22:00
by EricTRocks
You'll have to use a Function Node to take in the array and create a for loop using code for now:

Code: Select all

for(Integer i=0; i<array.size(); i++ ) {
    // do stuff here.
}

Re: simple loop in canvas

Posted: 24 Oct 2015, 17:22
by Hirazi Blue
Having to inject KL code for something as fundamental as a simple loop would seem to be a serious shortcoming
of Canvas as a truly 'visual'/nodal programming environment ATM, I would think.

Re: simple loop in canvas

Posted: 24 Oct 2015, 18:17
by Mathaeus
From really really small experience, Fabric Canvas seems to be much more 'arrayed', while Houdini wants a loop even for double l in 'hello world' (stupid joke, of course). ICE has decent support for both, while it's still more 'arrayed'.

Re: simple loop in canvas

Posted: 24 Oct 2015, 23:51
by nodeway
Mathaeus wrote:From really really small experience, Fabric Canvas seems to be much more 'arrayed', while Houdini wants a loop even for double l in 'hello world' (stupid joke, of course). ICE has decent support for both, while it's still more 'arrayed'.
Whatever they call it in ICE, under the hood it's looping over array. The plus that it's not hidden in Houdini is that you can optimize loop to do more than just loop over one array and/or do other stuff there too.

Re: simple loop in canvas

Posted: 25 Oct 2015, 00:48
by Mathaeus
mantragora wrote: Whatever they call it in ICE, under the hood it's looping over array. The plus that it's not hidden in Houdini is that you can optimize loop to do more than just loop over one array and/or do other stuff there too.
Yeah most likely it is loop over array, under the hood. Regarding manual optimizing, I'll leave this part to lovers of Mental Ray and products of similar philosophy and age.

Re: simple loop in canvas

Posted: 25 Oct 2015, 01:09
by EricTRocks
Sorry there is a misunderstanding here. There are many nodes in Fabric Engine that already handle arrays and process them just like ICE does. A simple loop which was what the original question was, needs to be done by hand since the specialized nodes that handle arrays already won't be what users may need for simple tasks.

It's my personal opinion that ICE did not handle arrays nicely actually. It was very abstract especially when getting into multi-dimensional arrays. Not being able to see how the arrays were being handles and not having multi-dimensional array handling out of the box (took a few versions to get in there) was something I think was an after thought and could have been worked on a bit more.

Re: simple loop in canvas

Posted: 25 Oct 2015, 01:19
by Mathaeus
EricTRocks wrote:Sorry there is a misunderstanding here. There are many nodes in Fabric Engine that already handle arrays and process them just like ICE does. A simple loop which was what the original question was, needs to be done by hand since the specialized nodes that handle arrays already won't be what users may need for simple tasks.
Yeah, just to illustrate how I'd imagine wonderland :)

Image

Re: simple loop in canvas

Posted: 25 Oct 2015, 12:48
by Hirazi Blue
While the Fabric documentation would seem rather solid, where coding KL is concerned, it could really use some additional love for Canvas, for those of us, who haven't touched KL yet and/or weren't planning on doing so anytime soon.
The simple loop question illustrates this quite nicely, I'm afraid... ;)

PS Now would be a good time for someone to take us newcomers by the hand
with some simple introductory tutorials "Pooby-style"...

Re: simple loop in canvas

Posted: 25 Oct 2015, 13:14
by Pooby
It is my intention to start making "tutorials" as I learn Fabric Canvas.
Canvas in this first iteration is more appropriate for rigging as the system in place to parallel-process data sets such as vertices in a mesh have to be dealt with via KL within a node at this first stage. You can't just string nodes together like ICE and make relax deformers etc yet.
Because I mainly work with deformers, canvas isn't quite at a place where I can use it without a lot of coding and I think that would just put people off more than inspire and motivate.
I'm keen to entice artists to start trying it out so I'm holding off until the point when it's a little more visual programming-centric and friendly to use in this area.

Re: simple loop in canvas

Posted: 25 Oct 2015, 17:27
by Mathaeus
Nevertheless there are unpleasant points, to say politely. For me it was a lack of support for nurbs, while already have some idea how to overcome this. However in my area of interest, which is deformation, hair and so, simple, by user created loop, really isn't something I really need.
If this tells something, Kristinka Hair has literally one node, using ICE Repeat node, which particularly seems to be replaceable by exiting Canvas array preset. On flip side, kH uses a lot of 'loop under hood' simple array operations, like average, summary and so, performed really fast in ICE. Negotiating about such is no option, has to be simple and fast, that's it. - and Canvas equivalents are already present. While in some another, non AD software, functionality is unbelievably, unforgivably dispersed, sometimes partially possible, sometimes not without heavy workaround, all that not really fast.
For another example this thing here on forum does not use any by-user-created-loop, but decent array support could only improve, everything. I'm not proficient with tutorials, but hope I'll be able to share some tool or experience usable for others. In any case, further work on this belongs to FE.

Re: simple loop in canvas

Posted: 26 Oct 2015, 14:30
by Hirazi Blue
@Pooby: Thanks for confirming the suspicion I already had from my short time playing with Canvas.
Do you have any indication Fabric is working on improvements in this respect
or are they happy enough with the situation (Canvas) as-is?
:-?

Re: simple loop in canvas

Posted: 26 Oct 2015, 15:04
by EricTRocks
You can find a response from Borja here regarding this:
http://answers.fabricengine.com/questio ... anvas.html

Re: simple loop in canvas

Posted: 26 Oct 2015, 15:33
by Pooby
Its answered there by Borja, but I spoke to Paul Doyle a while ago, who also mentioned that its on the to-do list.

Its a bit of a roadblock for me at the moment. I was a bit disappointed to find its not there yet, but I'm confident that it'll come and that it'll be more flexible than ICE when it does.
ICE's abstraction makes 90% of deformer work V straightforward, but occasionally makes life overly tricky when dealing with more complex stuff involving arrays. I hope with Fabric they get a good balance with the ease and speed of ICE, but with the added power that comes with deeper access to all elements.

I guess an analogy would be After Effects VS Nuke. AE is very easy to make simple stuff but gets rather convoluted when doing more complex work. Whereas Nuke is always a bit more complex to use, but is less confusing when handling complex tasks.

Re: simple loop in canvas

Posted: 28 Oct 2015, 10:15
by Mathaeus
After a bit of playing tonight, it seems it's not that hard to combine these underlying codes in something new, modify some existing preset, so on. Anyway hardly I can imagine to use FE for experiments for now, I think I'll be sitting on two chairs for a while, Houdini for prototyping, trying to build a final deformer in FE, something alike.
In any case, motivation is huge. If someone will able to create a reliable replacement of Maya deforming tools, I think this will become a gift to humanity, comparable to discovery of antibiotics :)

Re: simple loop in canvas

Posted: 29 Oct 2015, 15:13
by FXDude
Mathaeus wrote:If someone will able to create a reliable replacement of Maya deforming tools, I think this will become a gift to humanity, comparable to discovery of antibiotics [...]


I would personally reserve that description for a reliable alternative to Maya itself, for the sake of fairness, innovation, and 'biodiversity'.