Transfer Your Attributes - Geometry Nodes 101

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
welcome to geometry nodes 101 in this session we're going to be having a look at the attribute transfer node this is kind of like a pumped up version of the attribute capture node in so far as it allows you to take data from one place and use it in somewhere else but this one is so much more than that it doesn't do the same thing as the captcha because you're not like passing things through this spreadsheet so they're not going to get subdivided and stuff like this however it does allow you to take data and transfer it by proximity which is always very useful and by index which means that we can do a lot of really powerful things with sending data from like similar geometries and mapping it in a very direct way so let's have a look at the actual node and go through some of the settings on it if i just add an attribute transfer attribute this is what you'll see so when we have it set to default it's going to be transferring a float attribute from one geometry to and to another one previously in 2.93 you had your target geometry which is where you were bringing data from but it also had your current like your main geometry this is not the case here because it's going to output a field right so it's going to be analyzed essentially at the point of the geometry as you use it that's not really a problem you just need to be aware that the target input is where you're pulling data from so you're pulling information from your target i know this confuses people and so does the geometry proximity node so this one again you're pulling information from your target to process on your current mesh in fact this is also a case on the raycast node again you have the target geometry here but raycast node i'll leave for the next video so for the attribute transfer you can select what kind of attribute you are transferring whether it's a float integer vector and so on and you can look at the uh the transfer module so whether it goes for nearest face interpolated so this can be very useful for for example if you are transferring normals from one thing to another to you know control the rotation for example so let's say you've taken something like iv you've grown it up a wall and now you're instancing with geometry nodes leaves on that iv you're not so worried about the normals of the iv itself you're interested in the normals from the wall so in that case you would transfer a vector attribute from your wall as the target using nearest phase interpolated so it's going to pull the nearest normal essentially from the nearest face onto your iv to use to rotate your leaves so that's quite a simple way i'm going to show you a really fun technique actually of extruding a curve using this but let's have a look through some more of the settings here so nearest face interpolated will transfer the attribute from the nearest face on the surface nearest is going to allow you to use other domains for example point edge face face corner or spline you can also use index and this is where things get really really powerful where you can transfer data from a specific index to another so this is what we're going to use to map a position from a curve onto our object which is going to do the extrusion currently there's no extrusion in geometry nodes no extrusion or solidify but you can actually fake these to a certain degree using either a grid or a box and i'll show you the method so we are interested first of all in creating a spline and i'm actually just going to use one of the ones that come as a commas primitive so let's go ahead and grab a curve spiral we can see this in the viewport i'm going to actually set the height to zero and i might set my star radius a bit lower just so that we have a normal normal little spiral going on there now i need to know how many points are actually on here and i don't want to use this resolution if i set this to three for example then this has one two three four five six seven points i need more accuracy than that right so i'm going to set this up fairly high around 100 to make it smooth and then i'm going to use a curve resample curve and i can set a specific number of points with the resample curve so this is very very important let's go ahead and use an input integer just so that i have this pulled off the node so i can use it in multiple places we're going to set this to 20 for now now what we're going to do is we're actually going to map this spline the positions here onto a grid node and then we're going to pull up half of the grid that's how we're going to fake our extrusion let's add a mesh primitive and i'm just going to show you on the output here so i want to demonstrate how the indexing is done on this grid so for a curve it's fairly straightforward it's just linear along it but for the grid it's important to understand how it works i'm going to increase my my y count to 10 just so we can see this a bit better and i'm going to demonstrate it by deleting vertices so i can pick a vertex to delete one at a time by using an index and a utility compare float so in this case i can say when does this compare flow equal my index value and if so delete it so we can see that there 0 is here and if i increase my b value and we can see this goes along one side and then we have it going along the middle because this has three vertices in the x and then it comes along this final side so this is important we need the same number of points in our resample curve as we have in our y value for the grid and then i need my x value to be two so now i just have two lines essentially in this grid each of which has the same number of vertices as our curve all right so in here i can just delete this delete geometry now we're going to start getting into a little bit of maths but don't worry i'll walk you through it here i want to transfer from my curve so i'm going to select that a position vector so let's grab my input position and this is a vector so we're going to change over to vector join this in like this and we're going by index and i'm just going to set that to point so now what i want to do is i want to map this to my position so i'm going to use a geometry set position node and i'm just going to plug this into the position now we do see something but it's not right okay so we look at this and it says input geometry has unsupported type curve so we just need to convert our curve from before into a mesh there's a node for this curve to mesh just at the top of our curve menu drop this in here and now it's all working perfectly so now what we need to do is we need to control our indices a little bit better now the indices this is it gets a bit confusing here the indices need modulating at 20 in this case right because our spiral goes zero to 19 because it has 20 points and our grid goes zero to 39 so we need to modulate it halfway so it goes 0 to 19 0 to 19 and that's going to give us our correct mapping to do this we can just use an input index node a utility math node plug this in like so set this to modulo and i'm just going to pull that integer as well just looks like this and i can plug this into my index so the next thing we want to do once we have this i know it's disappeared so it can be easy to worry but right now all we need to do is we need to offset in the z axis half of our mesh so essentially we have one row going around the bottom and then we have the top row also going around the bottom right now but our original indices which we still have access to we can use indices which are 20 to 39 essentially our second loop and pull these up so we're going to make a selection i'm going to grab another set position node i'm going to grab a utility compare floats node and we're comparing our index for when it is greater than or equal to because we also need this number 20 so greater than or equal to i will straighten out those noodles so let me just pull these down like so and i'm going to plug this into my selection and i'm going to move this up in the z axis and there you go you can see what we've done there i know the logic here can get a little bit confusing if you're not used to this but essentially we have this transfer attribute and because we can use index rather than nearest right nearest is great if you have two things which are within proximity and you want to transfer data based on proximity so useful to have that being able to transfer normals things like that however if you want true control over your assets having index control and being able to do things like modulo are very very useful here we go so this is our little setup here and i can change my interview at the start and because everything is connected you know this is controlling the sample of our curve and that's why it has to do both right controls the number of points on our curve so it matches how we're controlling our indices on the grid so if i have this higher then we can see that we get this scroll and i can still do things like changing the height on here and you get this kind of extruded look now you can take this further and do a solidify but instead of doing a grid you do a box once you get to the end at this point you can just scale along the normals and the sides will kind of squeeze out as they should do i know that was a little bit of a quick tour of the transfer attribute node it's one that you really just have to use to learn how it works it can be a little bit unintuitive how the target name is because we're transferring attribute from the target coming from the target so that's just something to be aware of there all right hopefully this has been helpful join me in the next session where we're going to be creating a shrink wrap modifier with the raycast node it's pretty interesting technique raycasting is just so much fun it's kind of like transferring attributes but you do it via laser beam instead that's how i think about it i'll see you there [Music]
Info
Channel: Erindale
Views: 5,787
Rating: undefined out of 5
Keywords: attribute, capture, b3d, blender3d, geometrynodes, geometry nodes, procedural, parametric, design, workflow, node, nodevember, tutorial, lecture, easy, beginner
Id: mqOcepGAwq8
Channel Id: undefined
Length: 9min 56sec (596 seconds)
Published: Fri Oct 29 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.