Houdini In Five Minutes 11: The Foreach Loop

Download project file (.hipnc): www.entagma.com/downloads/fiv...
For more of everything: www.entagma.com
Support us on Patreon: / entagma

Пікірлер: 38

  • @N3.1Kryuk
    @N3.1Kryuk2 жыл бұрын

    Thank you! This is exactly what I was looking for.

  • @anxhelo7383
    @anxhelo73832 жыл бұрын

    im still confused, i understand what it does but i dont understans in which cases do we use for each loop

  • @fallenhoenix1255
    @fallenhoenix12553 жыл бұрын

    Anyone out there know why might my code completion not work in the same way when typing the target geometry string of the detail function like in the video? I'm using relative references the same way. Is there a hotkey or something?

  • @harun3Ddigitalartist
    @harun3Ddigitalartist Жыл бұрын

    thank you bro man...

  • @maximtuts1780
    @maximtuts17802 жыл бұрын

    Where can i learn to make such a cool reflective texture with sun sparkles just like u did in the intro.

  • @blaaablooo5233
    @blaaablooo5233 Жыл бұрын

    Legend!

  • @user-ou7ek3gg7w
    @user-ou7ek3gg7w Жыл бұрын

    Genious!

  • @jack_drums
    @jack_drums4 жыл бұрын

    Hey guys! As an exercise I tried to implement it in VEX, it's extremely faster! I just used a Facet node (with Unique Points checked to "separate" the primitives) and then a Primitive Attribute Wrangler, I'll paste my VEX snippet down here (and a .hip too with the comparison) if anyone is interested! (Does anyone know if it's possible to transform a primitive directly without having to access all its points? I wasn't able to just use/set a @P attribute for them)

  • @jack_drums

    @jack_drums

    4 жыл бұрын

    matrix3 mat; vector pos; int success; //Get per axis rotation amount from Controller (red null) float rotX = ch("../Controller/rotation")*ch("../Controller/rotationX"); float rotY = ch("../Controller/rotation")*ch("../Controller/rotationY"); float rotZ = ch("../Controller/rotation")*ch("../Controller/rotationZ"); //Get primitive points int points[]; points = primpoints(0, @primnum); //Rotate each point of the primitive using the transform matrix matr foreach (int pt; points){ mat = ident(); rotate(mat, radians(@primnum * rotX), {1,0,0}); rotate(mat, radians(@primnum * rotY), {0,1,0}); rotate(mat, radians(@primnum * rotZ), {0,0,1}); pos = pointattrib(0, "P", pt, success); if(success) setpointattrib(0, "P", pt, pos*mat , "set"); }

  • @lveronese

    @lveronese

    4 жыл бұрын

    @@jack_drums thanks for the code, it's extremely faster

  • @mattreed6871

    @mattreed6871

    4 жыл бұрын

    @@jack_drums SO much faster!!!

  • @aboldmule

    @aboldmule

    2 жыл бұрын

    great inspiration and application of linear algebra! Thanks!

  • @jack_drums

    @jack_drums

    2 жыл бұрын

    @@aboldmule Thank you! Glad it helps! ☺️

  • @Zerefthedark
    @Zerefthedark4 жыл бұрын

    I have a doubt .... I tried to replace the pigs head with an alembic animation and the result i got was the entire body rotating instead of the polygons... what should i do to get the polygons rotating

  • @psychedlicavfx6646

    @psychedlicavfx6646

    4 жыл бұрын

    Hard to say as there could be a number of reasons but did you try using Unpack sop right under alembic import?

  • @Zerefthedark

    @Zerefthedark

    4 жыл бұрын

    @@psychedlicavfx6646 thank you for replying 😄. I did, the thing is it works on the first or well the selected frame but not on the rest of the animation 😶. I tried unpacking and also using time shifting and using that to link the animation to geo node but so far no luck 😣

  • @psychedlicavfx6646

    @psychedlicavfx6646

    4 жыл бұрын

    @@Zerefthedark that's strange. maybe write out the geo as a single frame bgeo after unpacking. then read it back in. this way you can diagnose if houdini is having trouble reading the alembic or there is something off in the alembic itself. bit of a hack but it could work. let me know if it works. am curious :)

  • @Zerefthedark

    @Zerefthedark

    4 жыл бұрын

    @@psychedlicavfx6646 ok I will let you know when I try it 😄 thanks for replying tho

  • @Tyson2k55

    @Tyson2k55

    4 жыл бұрын

    DAVID T VARGHESE maybe place an unpack and then a convert node. After the unpack I think it’s still a poly soup. The convert will make it into polygons. I’m no expert though.

  • @undertone_dj
    @undertone_dj3 жыл бұрын

    Hmmm, for some reason, I don't get the same results. When typing the expression for the seed to connect to the iteration attribute of the metadata node, the results deviate for me. It's still green. Tried it twice, and get the same, differing result. I'm on 18.5.483

  • @undertone_dj

    @undertone_dj

    3 жыл бұрын

    Figured it out. Had iteration spelled incorrectly.

  • @Evemy_

    @Evemy_

    8 ай бұрын

    @@undertone_dj Cheers for this, you made me realise I'd made the same mistake 😅

  • @pinkospace9040
    @pinkospace90403 жыл бұрын

    What does it mean to rotate each primitive according to iterations? I imagine each of the primitives to rotate in place, but in the video they are flying around, so I don't understand what is it actually doing? Where is the origin of the primitive's rotation?

  • @Entagma

    @Entagma

    3 жыл бұрын

    Heyhey, the origin of each individual primitive is at {0,0,0}, so that's why they appear to be "flying" around. If you wanted to have the primitives rotate in place you'd first have to translate them so their center is at {0,0,0}, then rotate them, then translate them back. Cheers, Mo

  • @pinkospace9040

    @pinkospace9040

    3 жыл бұрын

    @@Entagma Thank you so much for your reply, so each primitive's origin is at 0,0,0 but they are positioned based on the points they are connected to, which could be anywhere, sorry coming from a 3ds max background, didn't get this until now

  • @Entagma

    @Entagma

    3 жыл бұрын

    Yes, exactly this. :) Cheers, Mo

  • @FullThrottle1091

    @FullThrottle1091

    2 жыл бұрын

    In the transform sop's pivot transform type $CEX $CEY $CEZ in the pivot translate's X Y Z channels respectively to transform around the centroid.

  • @robertschroer5794
    @robertschroer57942 жыл бұрын

    Awesome Tutorial! Isnt Chris Hebert the director of finances at SideFX ? :D

  • @Goten1010
    @Goten10102 жыл бұрын

    why does the for each loop split the individual primitives up? Why wouldnt it keep it as a complete mesh?

  • @Entagma

    @Entagma

    2 жыл бұрын

    Because the foreach loop (as we set it up in this case) is used to execute whatever nodes you put inside the loop body for each primitive separately. If you want to work on the geo as a whole, simply don't use a foreach loop :) Cheers, Mo

  • @Goten1010

    @Goten1010

    2 жыл бұрын

    @@Entagma First of all, thanks for the answer, and thanks for all the great vids you guys do :) I think what I was trying to say was that the vertices between the polygons get split up, instead of the mesh being kept closed. I feel like it isn't intuitive that the loop would do that: after all, it could just, one after the other, transform each polygon, while NOT separating each polygon from the ones next to it(kind of like a displacement would do it). It seems like you wouldn't be able to do that in the loop, right? Sorry, maybe that's a bit stupid to point out, since I can't think of a good example why one would want to do that either at the moment, just something that I noticed^^

  • @FullThrottle1091

    @FullThrottle1091

    2 жыл бұрын

    @@Goten1010 There's For-Each Connected Piece which uses the connectivity sop defining an attribute ("class" by default) that is used for the piece attribute in the block end.

  • @pavelpetrikor
    @pavelpetrikor Жыл бұрын

    First peak of the sound too high and beat my ears every time.

  • @waqar_de
    @waqar_de2 жыл бұрын

    Why are you running in hurries? ... Sounds extremely stupid and enjoying!!! .... Completely loosing the focus what I am trying to achieve 😂... The learning! ... It's not a demo of your performance 😉 ... It's how better I can understand what you have to theater for me as audience.....

  • @wavelogic8471
    @wavelogic84713 жыл бұрын

    This is ridiculous! there is no god forsaken reason to have to type code on a foreach loop in a node interface. Look at unreal engine blueprints to see how it's done.

  • @Entagma

    @Entagma

    3 жыл бұрын

    Thank you for your valuable feedback. Cheers, Mo

  • @vincestevenson9430

    @vincestevenson9430

    7 күн бұрын

    @@Entagma Lovely deadpan passive aggressive reply.