simple loop in canvas

Forum for users who have migrated or are migrating to the Fabric Engine
anhungxadieu
Posts: 175
Joined: 17 Apr 2014, 10:39
Skype: nguyenvuducthuy

simple loop in canvas

Post by anhungxadieu » 23 Oct 2015, 10:16

hi there,

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

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 01:41
Contact:

Re: simple loop in canvas

Post by EricTRocks » 23 Oct 2015, 22:00

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.
}
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: simple loop in canvas

Post by Hirazi Blue » 24 Oct 2015, 17:22

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.
Stay safe, sane & healthy!

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: simple loop in canvas

Post by Mathaeus » 24 Oct 2015, 18:17

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'.

nodeway

Re: simple loop in canvas

Post by nodeway » 24 Oct 2015, 23:51

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.

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: simple loop in canvas

Post by Mathaeus » 25 Oct 2015, 00:48

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.

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 01:41
Contact:

Re: simple loop in canvas

Post by EricTRocks » 25 Oct 2015, 01:09

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.
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: simple loop in canvas

Post by Mathaeus » 25 Oct 2015, 01:19

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

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: simple loop in canvas

Post by Hirazi Blue » 25 Oct 2015, 12:48

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"...
Stay safe, sane & healthy!

Pooby
Posts: 501
Joined: 27 Aug 2010, 22:25

Re: simple loop in canvas

Post by Pooby » 25 Oct 2015, 13:14

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.

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: simple loop in canvas

Post by Mathaeus » 25 Oct 2015, 17:27

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.

User avatar
Hirazi Blue
Administrator
Posts: 5107
Joined: 04 Jun 2009, 12:15

Re: simple loop in canvas

Post by Hirazi Blue » 26 Oct 2015, 14:30

@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?
:-?
Stay safe, sane & healthy!

EricTRocks
Moderator
Posts: 754
Joined: 25 Nov 2009, 01:41
Contact:

Re: simple loop in canvas

Post by EricTRocks » 26 Oct 2015, 15:04

You can find a response from Borja here regarding this:
http://answers.fabricengine.com/questio ... anvas.html
Eric Thivierge
Lead Kraken Developer, Fabric Engine
http://fabric-engine.github.io/Kraken

Pooby
Posts: 501
Joined: 27 Aug 2010, 22:25

Re: simple loop in canvas

Post by Pooby » 26 Oct 2015, 15:33

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.

User avatar
Mathaeus
Posts: 1778
Joined: 08 Jun 2009, 21:11
Location: Zagreb, Croatia
Contact:

Re: simple loop in canvas

Post by Mathaeus » 28 Oct 2015, 10:15

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 :)

User avatar
FXDude
Posts: 1129
Joined: 19 Jun 2012, 21:59

Re: simple loop in canvas

Post by FXDude » 29 Oct 2015, 15:13

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'.

Post Reply

Who is online

Users browsing this forum: No registered users and 4 guests