Array Modifier BAD! | Geometry Nodes & Animation Nodes | Blender 3D Free Tutorial

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello so maybe you've seen my latest videos here on the channel about geometry notes and we've looked at one thing which is instancing and i got a few questions here about geometry notes and all of that but i also got a question on one of my older videos here on the channel about animation notes and about instancing in animation notes and the whole performance aspect of it so in this video we're gonna look at geometry notes and animation notes and we're gonna compare a few things maybe this sounds interesting to you i hope you're excited and we're gonna jump right into blender [Music] all right here i am in blender 2.93 alpha and i do have the little blue circle on my mouse pointer so you can see where the mouse is however the screencast keys add-on is not working at the moment that's what you get when you use alpha versions but i will try and explain the keys that i i'm typing probably not that interesting for this video anyway so um how about we get started and we set up our scene here i don't need the stage so i'm going to delete that maybe i'm also going to delete the lights so that we have a very clean setup here um okay we need the camera then we have the shader ball and it consists of several um other objects here and i'm just gonna merge all of that together so that we have a very simple uh scene to start with so ctrl j joins the geometry together so now this is all in one object and we have it here let's maybe call it something let's call it ball okay now so first thing we have to talk about here instancing what is it well you might know maybe you don't know but if you've used blender before i'm sure you do there's two ways to copy objects to duplicate objects first there's the shift d way and then there's the alt d way so what's the difference well let me show you i take this object i go shift d and then i get a copy and i can place it over here i now have two objects in the outliner over here and with the shift d i also copied the mesh data which means they're independent objects now completely independent i can go in here i can pick a vertex i can move it and it doesn't affect the original object at all so um we essentially have the twice the amount of vertices in our scene now so if you're thinking about rendering the more vertices you have in your scene the longer your render is going to take because of course the rendering engine has to take more geometry into account and it needs way more memory on the graphics card so the alternative to this is if you take this and you hit alt d and you'll get the same thing you also get an object over here another one in the outliner but this object now shares its geometry it's mesh information data with the original object so they're both both kind of linked to the same underlying data and when you render this um blender just has to give this one underlying data block to the graphics card so it needs only half the amount of memory well not because this is still in here but let me just show you the difference if i take a vertex here and move it you can see this is both objects are using the same underlying mesh data so if you if you're not planning on changing the mesh itself maybe sculpting or changing something then just use alt d and you save some memory and it's also faster to render okay so these are the two ways to do this now let me just go back a little maybe to this let me delete this guy and that guy so now we know what the difference is so now we have geometry nodes and we know that we can set up a node tree to instance objects two points right we also have animation nodes and we have the object instancer in the animation nodes and now we should take a look at maybe the difference here so shall we start let's start with geometry notes okay how do you instance an object in geometry nodes first of all you need geometry to place or points in 3d space to place the object to um well i'm just gonna go add a plane and go into edit mode move that over here and then maybe just delete these three vertices so i'm just left with this one single vertex over here now with this object that just has one vertex now selected i'm gonna go to geometry nodes create a new node tree which adds this modifier over here i'm sure you're already familiar with that because i've shown that in the previous tutorials now how do we instance this object to that vertex well we just need a point instance node plug it in here and tell geometry nodes which object to instance well let's take this one and since this object over here which is called plane only has one vertex we get one copy now we can also go up here and enable statistics and then we get this information over here so currently our scene has eight objects in it zero are selected so we're interested in this number eight over here we're also interested in the vertices down here um one thing i want to do here is get rid of this subdiv modifier okay so our object our original object here has 11 000 vertices and even though we have another copy here we only have 11 000 vertices um let me prove it to you i take this object which is plain i go into edit mode shift a single vertex add a single vertex if you don't have this option um this is part of the add extra ad extra objects or something um add-on which comes with blender you just have to enable it so let's add another vertex and then we can move that vertex it's just where is it this guy here little orange dot now we have two vertices and if i go out of edit mode we still only have 11 000 vertices because that's how instancing works so this would be the alt d way of copying objects they're all sharing the same mesh data okay so this is the good way to copy it if you don't want to change the mesh if you want to change the message there is no other way you have to have a real physical copy of the mesh but if you just want a completely perfect clone and you're not planning on changing it you want alt d and you want the point instancer from a geometry nodes okay uh now this is already interesting here because this is one object in the outliner it's called plane maybe we should call it a geometry node instances or something like that so we know what it is it's one object in the outliner but we see three objects here and also if you notice over here and now it says we have nine objects so again if i go into edit mode shift a a single vertex now we have 10 objects so this is already kind of weird because we only have one object here but somehow in the background blender counts these instances as objects this is important also notice we still only have 11 000 vertices in this scene because they're uh using the same mesh data okay now how does this work with animation nodes just as a comparison so let's delete this object with the three vertices let's go to animation nodes create a new animation notes note tree and then we need instances um so how can we make some instances well we could just add an object in sensor which object do we want to instance it's not working oh i have to click this one okay so we want to instance the ball and we want i don't know one instance now they're at this in the same location there which you can see because of those like overlapping geometry artifacts that we get so we have to move our copy a little bit over to the side we want to move this over on the x now let's look at our scene here so first of all we have our original ball and then we have this collection here that animation notes creates for us and it puts its instances in there and you can see it created a real object here in the outliner so this is already different uh if i make two instances here now i have two objects here in the outliner remember a few seconds ago we just had that one plane um object in there with the vertices in it and it counted the objects but it didn't actually have objects in the outliner here we have objects in the outliner and of course we have objects over here so now we have eight if i increase this then we have nine also notice we only have eleven thousand vertices because these copies here just like before they're referencing the same underlying mesh data but this already has an issue so they're comparing the instancing here with animation nodes to geometry nodes is exactly this over here because blender has to manage these objects here somehow right it has to take care of the data and visualizing these objects so if we don't have three instances what if we have 30 000 instances then we have 30 000 um objects here in the outliner and this is actually really a problem because it gets very very slow okay now before we go further let's also check something else let's get rid of this animation notes completely so it's not being executed let's disable this so we don't see it now let's also look at something else namely the array modifier because this is quite bad i have to say look at this we have four copies now because of the area modifier on our object it's just one object the ball here this is not forget this this is disabled now right so we have one object our entire scene has six objects because there's the camera and all that but we have one ball object and now we have 44 000 vertices so if i increase the array modifier here now we have 55 000 vertices so compared to um the other two ways of instancing objects this is really not instancing anything this is actually creating geometry which is maybe good if you if you want to add another modifier underneath this one and then i don't know maybe noise or displace or something you have actual geometry to do that with but if you would just want um perfect copies all standing in one line then the area modifier is actually pretty bad because now we have to calculate 122 000 vertices now this is not a huge number for a graphics card or even for cpu rendering you can have several millions of vertices but you see where the problem is if this is just one little asset in your entire scene using the array modifier um is not good so um i just wanted to show you that if you just have this sort of um setup or requirement don't use the array modifier use something else like geometry notes or even animation notes your videos are pieces of art wall art print my video extracts up to 20 000 frames from your video's timeline compresses aligns and enhances them and even overlays the audio waveform and carefully bends everything into a perfect circle after they manually optimize and quality check each artwork you can either download a high resolution image file to print at home or at your favorite print job or they can hand the picture off to a professional printer near you for perfect prints with high quality materials print my video have printing partners all over the world to cut down on shipping costs be environmentally friendly and support local businesses any video can be printed and preserved for eternity your wedding the best vacation ever your favorite music video anything goes head over to printmind.video and hang your own vibrant beautiful one-of-a-kind video print on the wall use the coupon code crispy at checkout to get 10 off let's go back and actually make like a grid of these objects so we can see how to do that in both ways right so maybe we go back to geometry nodes first of all now how do we make a grid of these um shader ball preview objects here in geometry nodes we need geometry so if you think about it there's really only one way to make a grid which is to make a physical grid of vertices and then we use geometry nodes to place this ball onto each vertex so let's go shift a mesh grid and that gives us this object and we have the settings down here so now we have a 10 by 10 grid let me just go into edit mode scale this up and see what that is exactly we have one two three four five six seven eight nine ten vertices by ten vertices okay so this is exactly 100 instances perfect now we take this object we give this object a new geometry nodes node tree and then we just hit shift a and we point instance the ball onto our geometry which is the vertices you can basically forget that the edges and the faces in that grid they are not relevant here which looking at the vertices the points and now we have 100 of our little shader balls okay if i go into edit mode again and i scale up my grid i'm just scaling out um the vertices of the grid i get this now this is very fast as you can see but we have sort of a problem here because what if we wanted to have 20 by 20 instead there's really no way to do this now because this object here without this geometry on it so if i plug that in here is this grid and it's kind of you know there's no way to go what if i wanted to go 15 by 5. i the only really usable way to do this is to get rid of this completely add another grid with 15 by five okay so now we have this grid and then we can go to the modifiers put on this geometry notes modifier and just use whatever geometry node it was this one that instances the object okay so of course this is doable but wouldn't it be nicer if we could just um like plug in 15 by five and it would just update and that's where we can go over to uh animation notes so let's get rid of this again do something in animation notes let's get rid of this grid okay now we go to animation notes we have this object instancer in here already which is instancing the ball that's good now we need a grid well there's two ways to do this first of all there is a mesh generator grid which actually does generate that same mesh with edges and faces and of course the vertices um and we can use that of course or no let me think about it now you know what we're gonna go shift a matrix uh distribute and then this also gives us a grid of points and now we can instance so we wanted 10 by 10 right and we have these vectors which is the location of the final points in this grid this is where we want to instance or move our instances to and how many instances do we need well this many so it's not working because we have to switch on auto execution and i also hit that group here so here we go now we have 10 by 10 and of course we can make it a little bit wider and a little bit longer and you can see we still only have 11 000 vertices so no increase here but now we have 107 objects and they're all in here and this is really the big issue because if you turn this up to 100 by 100 now or even higher then this is going to be so slow that i don't even know if my recording is going to work let's try it i hope it doesn't crash okay you can already see i hope it's still recording i'm waiting okay now it's done so now we have 100 by 100 objects this is already kind of sluggish well it's okay this is okay this this is also still quite fast but um if you do 1000 by 1000 you can forget it this is going to completely uh crash okay so this is how we instance the objects with animation nodes and we get real objects and they are real objects i mean they're using the same mesh data yes but we can go in here and just pick one of them this one and move it around because it's a real it's it's really there as long as this doesn't get executed so if i switch this off now i can just work with this now if i switch it back on and i have i have set to 3 change frame change or property change so if i change something in the tree here maybe this then this animation nodes note 3 gets executed again and of course then my changes are gone but that's that's sort of also a big difference between the geometry nouns and the animation nodes way of instancing objects right so this is what we have here i'm actually quite surprised that this is still kind of really fast because in my tests having 100 by 100 made this outliner here so slow that even just moving the mouse over here it would like update every two three seconds but i think there is a problem here with having all of these objects in here so now naturally what would be the perfect solution to do this well to use the best of both worlds right we want to be able to change our x and y divisions to modify the grid and maybe modify the width and the length here and also we want to have that advantage of the geometry nodes where we don't have 10 000 objects here in the outliner can we do that yes we can um before we go there one thing though to note um i'm sure you've seen this before because if definitely talked about this in other tutorials in animation notes you have this checkbox deep copy and that's exactly the difference between the alt d and the shift d right now we have we have 11 000 vertices so this would be the alt d way of instancing they're all using the same mesh data if you check this deep copy and i'm not going to click it now then um the mesh data is copied 10 000 times okay so maybe you would use that if you plan on doing other things after animation notes and you actually need the real geometry so that's what the deep copy is for so what do we need we don't need an object instancer you can delete that and i already deleted it and you can see now blender is working hard to clean up the 10 000 objects in the outliner so i guess we're just gonna have to wait well you can see what the problem is right that's the problem now it's done and all it had to do is delete all of these objects so having a lot of objects in here is really not good cool now let's think about this we need um geometry for geometry nodes right now we don't have geometry this just generates points in 3d space but they're not geometry can we make geometry out of them yes we can go to a mesh object output where we can plug in a mesh and then we can do mesh combine mesh and here we can plug in the vertices and then we can plug that in here enable it uh click the plus here which gives us an object called target okay and you can see now we have the points in 3d space 100 by 100 grid okay now we have mesh right we have mesh data in this target object um what is this grid i believe this is nothing i'm going to delete it i also can delete this collection because we're not using it anymore we're not instancing anything in animation node all we did is uh now let's create a target object which has points and we can use those points in geometry nodes cool so let's go over to geometry nodes and really the big question here is does this work in the correct order and the answer is yes it does so we're using animation nodes to create the mesh and then we use that mesh in geometry nodes to instance objects well awesome okay let's create a new uh geometry nodes node tree here and all we really want to do is we want to point instance onto these points this shader ball now look at that we have one object in here called target this is still very fast over here because there's just one object in here um but we also have 100 by 100 of these objects and we only have eleven thousand vertices we do have those ten thousand objects here in the scene because remember i showed at the very beginning that for some reason somehow these instances count as objects although they are not in here interesting so and now the big thing is we can go back to animation notes and i can go okay i want 20 by 30. and here we have 20 by 30 or 10 by 50 and then we can stretch this this out a little so we have this and then we can do this now look at that now we have really the best of both worlds like i said we can modify the x the y we can even add ac to it right so if i go c 3 and i pull it up like that now we have three dimensional grid made in animation notes and it's all parametric so we can always go back and change something if we want to and we have this advantage of uh geometry nodes using instances but at the same time having objects that are not visible and it's all very fast and performant awesome all right so you can see this is just stuff that i'm playing around with to figure out how things actually work or seem to work on the inside this is not the greatest piece of art or anything like that and there's some crazy stuff out there already you just have to go onto youtube or twitter and look for some of the things that people come up with how they use geometry nodes which is still i mean extremely limited in its you know the amount of notes that we have and the stuff we can do but there's some crazy math minds out there who actually take this to the to the next level anyways i think this is also interesting to know um how you can sort of combine things here and that it actually works which is surprising to me and also looking at the statistics how many vertices do you have how many objects do you have and like i said well in the outliner as soon as you have tens of thousands of objects in there it just becomes unusable basically so i hope this is not way too technical or boring it's kind of important to know how you can get the best out of your system and you can get the best out of your system if you use instances and you don't copy the mesh data and if you use geometry nodes to create those instances and with that i think this video is done if you liked it thumbs up if you're new here maybe subscribe to the channel i appreciate it thanks for watching crispy [Music] out [Music] you
Info
Channel: Chris P
Views: 13,005
Rating: undefined out of 5
Keywords: cg, 3d, blender, blender3d, b3d, tutorial, how-to, training, learn, eevee, cycles, geometry nodes, geometry, nodes, animation nodes, gn, an, animation, instancing, clone, cloning, array, modifier
Id: XNcbhiEtCLQ
Channel Id: undefined
Length: 29min 54sec (1794 seconds)
Published: Fri Mar 05 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.