 Hey, Wolverine. All right, are we taping? Yep, everyone hear me? All right, so I guess we're going to get started. So last year at the conference, it was my first blender conference and I was kind of terrified of y'all because I thought I was going to be this sort of poser walking amidst the ascended gods of the blender community. And you know, it turned out I was right. You guys are just amazing. And it was a little bit intimidating. But as I've started to get to know you all, it's just it's mind blowing how down to earth everyone is and how friendly and just everyone's talking about what they're doing these amazing things like it's no big deal. And I wanted to give a special thanks to Vibran for making all of our other presentations look absolutely horrible compared to its awesome tree simulator. So yeah, thanks for that. So last year at the conference when I was terrified, Tom approached me and he asked me if I'd be willing to share what I was doing. So at the open stage talks, I showed this video and I sort of hinted at the idea that our company was building a new cloth engine for blender and we might be releasing it back to the blender community. And I feel like I kind of owe everybody an explanation as to where we are. So this is basically an update on our progress. And this is a video I showed last year. This is our awesome rig in our cycles render of this dress and so on. So a little bit about me. I am a simulation engineer at my company and I discovered computers about 2006. I discovered that they could do more than save text documents. And before that, I was a plumber for most of my adult life, so lots of pipes and things. In 2006, a friend put blender on my computer and a few months later I did my first render basically. And somebody said, wow, you should do this professionally. So I started thinking, oh, maybe. And then I soon found out that blender was basically created for making fantasy robots. But could also be used for rocket powered motorcycles. It can also be used for deadly evil robots. And also, well, for a lot of kittens. So the kittens actually worked out really well for me. Having the kittens in my portfolio landed me a job in architecture. And that's a true story. I don't know exactly how that worked out. So now I pretty much spend all of my time doing this. Yes, very exciting. And this is actually, I mean, the reason this looks so much like real code is that I rendered it in cycles. Okay, so where are we at now? Okay, Gerber technology. It's in Connecticut. Ooh, there's my building. This is where I walk in the door every day. Connecticut, where I'm at here is basically in between Boston and New York. It's about the same distance drive to both of those. Hopefully most people have heard of Boston or New York. I hadn't until I moved to Connecticut. Gerber is a global leader in fashion and textiles. So they have products for manufacturing and for designing clothing and a lot of other things related to fabric, aerospace fabrics and this kind of stuff. And, you know, this is their website and some of their advertisements. They're probably best known for their gigantic scary machines that have a reciprocal cutting head and they will cut everything from silk to, I think I've heard rumors of cutting bulletproof glass with these machines. I know they'll cut Kevlar. So really impressive machines and the software that runs them is basically what I'm working on. More specifically, I'm working on their 3D solution. I forgot my notes on the way here this morning, so see if I can remember where it was that I was going. So we decided to use Blender as our platform for 3D development. And in case anyone is wondering why, I would just say why on earth would you not want to use Blender? It's a 3D development environment. It's a huge tool set that's already available and you have compatibility with so many different kinds of software that's out there already. And you have this awesome group of people who will just do stuff for you because they're awesome. But more specifically, we wanted to leverage a lot of the tools that were already there. So we had this one client in particular creates a lot of sporting goods and a lot of sports wear. And we were trying to sort of get them on board with us with our new 3D product. So they wanted to see the garments that we could generate in our Accumark software with a character on a bicycle. And it was one of those, we have to do this meeting right away, quick throw some together. So I went in and in a couple of hours using the bullet physics setup, I made this character that can ride a bicycle. And so to do the animation, it's a lot easier to just drive a bicycle over a course than it is to actually go through and hand key this kind of stuff. Not only that, but it was an excuse to do something really funny and really cool. I actually used to race mountain bikes and I'll tell you, I could never do the kind of stuff that our avatar Jill here can do on a bicycle. It's really impressive. But we made this really cool video where we rendered this with trees and all the stuff after we did the animations. And it's kind of fun video game that I made in an hour. So there's that too. So another interesting thing, as we're going to these different meetings with a lot of these really big names that you've all heard and a lot of you are wearing clothing that our clients manufactured with our stuff right now. Sometimes the thing that actually seals the deal for us is that we're using Blender. So they say, oh, you're developing a 3D product. How's that going? What are you doing? And they say, well, we're using Blender and they're like, oh, really? Well, yeah, we'll sign up because they already have people on staff who are their resident Blender experts. So in this weird way, Blender has sort of gone viral in the manufacturing industry. I mean, to the point that it's just like everywhere and I don't know if everybody knows that. So there's all these extra opportunities for careers in Blender because of its applications in manufacturing and stuff that you're probably never going to hear about. Unless you've happened to travel in those circles. So we started out using Blender, the internal cloth engine for our beta version of the software. And I actually have a video here of the beta version of our software. So this is all pattern design related stuff that the dressmakers and clothing designers will use. And we don't have a whole lot of time, so I'm going to skip a little bit here. But you position the fabric pieces around the avatar and then see at some point we get to the good part. Start simulation. So it launches Blender and in our beta version, like there was all these problems with the intersections where it was sewing together. So we actually shrunk the avatar down really thin and inflated it back up. So there was all kinds of jokes going around about the inflatable avatars. And it kind of worked, but it was kind of crappy too. And it got us past our beta release. And so the kinds of problems that we ran into with using Blender's built-in cloth simulator. And we go to the Blender cloth fail files. We needed to have collars. And if you've ever tried to work with the bending springs in Blender's built-in cloth simulator, you've probably noticed that the bending springs are not very strong, even when you set them really, really high. And you can do some things if you set the grid size down really small. You know, you have like really big polygons, very little detail in your mesh. You can subsurface it after the fact. I do, you know, like paper or something. But if you want to have a fine grid and bending stiffness, you pretty much might as well forget it. So in another thing you'll notice about the bending springs. When you get to the point where you have really stiff bending springs defined along here, if they flip the other way, well, the bending springs will now hold on the opposite side. So the angle could be positive or negative. And there's nothing to say one or the other if it happens to flip. And that's because of the way the bending springs are calculated. Let me go into wireframe. And so you have a point here and a point here that define a vector that is a bending spring and all of the bending springs are calculated that way. So there's really nothing to say which side of this spring this sort of origin point needs to be on. So we knew we needed a way to get around that problem. Another problem with Blender's built-in cloth engine is that I don't know how to use this laptop. The collision system requires on a margin. So if you want reliable collisions, you need a larger margin. And there's a point where it actually becomes unstable if you have the margin too high because it distorts the mesh too much by making assumptions about what a mesh would be shaped like if it were larger. So that's kind of a problem. And if you set the margin down, let me see if I can find my collision settings. Well, then you get the object that goes through the collision or the cloth goes through the collision object and it doesn't correct itself. And if you've ever worked with the cloth modifier to any extreme level or done anything really interesting with it, you've probably run into this problem. So we knew we needed a better static collision model for external objects. The other problem that turns out to be really interesting but incredibly difficult to solve is the speed of sound problem. And it's basically how quickly forces can propagate through some kind of a substance. And it holds true in the physical world just like it does in simulations. So you'll notice that on the far end, this piece of cloth is not moving at all even though there's all kinds of stretch happening in other places. And that's because you get bending springs that are stretched out up towards the one side where it's pinned. And so these points are needing to move. But once it moves, then you have stretch at the next adjacent point. And so that knows it needs to move. And this stretch gets sort of propagated all the way across the thing. And as a plumber, if you put 200 feet of pipe together and you hit it with a sledge hammer on one end, there's a split second delay before the other end actually moves even with something like cast iron pipe. So everything has its own speed of sound in the real world and everything does in simulations. Also, it just sort of works out that way in the simplest models. So we knew we had to solve that problem. And another interesting thing about Blender's self-collision model is it's using points with a distance defined around the point, which mathematically speaking is essentially what you use to define what a sphere is. So here I have this mesh. The bottom plane here is pinned. It's all one object. And it's using just self-collision. So the top part is a fairly fine weave mesh. And the bottom part is just four vertices in a plane. And this is what the self-collisions do in this situation. It makes these interesting spheres. So I don't know if you knew that about Blender's self-collision model. And if you... I won't take the time to do this here, but if you have a couple of planes that really only consist of a few points or if you have a couple of planes that happen to be staggered, well, there's this space in between these virtual spheres where another sphere of the same size can easily pass through. So if you get a mesh that's slightly staggered, it will basically just pass right through itself without doing anything. And that really didn't work for what we were trying to do. We were obviously needing to solve this self-collision problem. Now, I've, you know, done all this dissing on Blender's cloth engine. I think it's only fair to show some of the things that you can do with Blender's cloth engine. You saw the video last year, right before I left for the presentation, and one of the fashion people came to me and said, oh, I need you to do a whole bunch of renders of runway walks with all these vintage dresses and all these layers and bows and everything. And I was like, oh, I thought I was going to work on my presentation, I guess not. So just like everybody else and throwing it all together at the end. So this is one that I did a couple of days ago. Just we're looking at a really stiff fabric. This is all done with Blender's default cloth engine. And, you know, it looks pretty okay. It behaves kind of like the real dress does. I did some interesting things with offsetting normal maps to get those panels in there with cycles. It's always fun to get a chance to play with cycles. This is a much, the bending stiffness is a lot lower. The technical term we throw around the office is it's more drapey. So in case you're wondering what drapey means, that means bending stiffness value. I'm still kind of wondering, but there's another one of the dresses we did. We were experimenting with having an object follow the surface of another object. So this little tie is sort of hooked to the cloth engine. It's not being calculated. And then as a sort of showpiece, I did this model, which if you've ever worked with Blender's cloth engine, you're probably going, holy crap, how did he do all of that stuff? And believe it or not, you can do all of this with the cloth engine the way that it is now. But I've got this object down here, the skirt actually is a static collision modifier on it. And the top piece is overlapping it. It's not using self-collisions. Let me show the close-up of this. Provided I can find it. So I've got something like 140 separate cloth objects with all these little tassels. This weave here is a separate cloth object from the top. And each one of them is using a hook modifier with a vertex parent. And there's a hook modifier with a vertex parent for every point where this weave stuff connects to the upper part. And I started doing some clicking and assigning and thought, well, this is ridiculous. And I wrote a code that put it all together for me, but you can actually do that without any code. So in case you're wondering, you can still do some pretty awesome stuff with Blender's cloth engine. This was when the senior engineers were saying, you can't do anything with the self-collisions and it's horrible. And so my boss said, go and see if you can do something with self-collisions. So I made this using built-in self-collisions. And under the right circumstances, you can do quite a bit with it. It helps to set the quality up. And another trick that I like to use a lot, here's a freebie for anybody who's doing cloth. Since a larger collision margin gives you a better, more reliable collision, if you put a displace modifier on to pull it back visually, then you essentially get the larger margin without having the cloth be spaced away from the object. And then if you can ever do it, or if you have the option of doing it, if you need layers, instead of using self-collisions, divide the cloth objects up into separate cloth objects and use static collision modifiers on top of them. Maybe some of you know what I'm talking about. This is just a default. We generated it right out of PDS and I clicked the convert to cycles button. It turns all the OpenGL stuff into just a basic cycles render. This is experimenting with address form. So yeah, there's a ton of stuff that we've done already. So yeah, gosh, I wish I had more time. Some of the stuff that we have implemented already, we have a different collision model that allows us to do some pretty complicated stuff. This is running in real time, so we're getting some pretty good speed out of it. This is with our custom cloth engine that we've been developing. This is me attempting to use our pattern design software, which I don't really use, and it becomes pretty clear that I had a lot of coffee this morning. And I think you can tell that I've had a lot of coffee this morning also because I'm really impatient. So it launches in Blender and this is running with the cloth engine that our senior developers came up with. I wanted to show you how our collisions are behaving here. So let's get to the good part. We've gotten rid of the inflatable avatar because we don't need it now. So here I am, I'm basically trying to break it. I'm thinking how can I screw up this thing so that the collisions fail and I start warping it all over the place and dragging it around. Forgive me for skipping ahead here. Oh, it gets better. See, right there, it got better. You get to see Oliver. I've noticed after a while of working on these kinds of models, I just, I don't see it anymore. So when the CEO of the software development team walked by and I had basically a naked figure riding a bicycle, he was just aghast and was like, what's wrong? So you can see the collision got really, really screwed up by all of my dragging it around and messing with it and what not. And I thought, oh, that's probably good enough. It'll fix itself from there. And it does. So this is the interesting part and I really wish I had a lot more time but I'll skip a whole lot of this other stuff that maybe you want to come and talk to me about it in person. So as we're developing, I'm wondering, would it be possible to do some of this with Python? Is there a way? What would be the fastest solution? And I came across NumPy and started working with it and one of the first things I tested was just, is it possible to do, let's see, now this is the wrong set. Is it possible to just even read and write the data with NumPy fast enough to do anything like this? So I did a bunch of preliminary testing type stuff just to see if you could do this. And it turns out that if you're just sort of reading the data and you're doing something to the vertices and updating their positions, it bottlenecks at about 300,000 vertices. So you can do quite a bit before it starts to drop below 30 frames a second. That made me sort of hopeful that I could do this with NumPy. I started basically developing all of my tools with NumPy because it's so incredibly fast and because it's Python so I can debug and prototype really, really quickly. So this was a drawing tool that I made a couple of weeks ago for the fashion people. I have this nice fashion marker that appears and goes over the thing and you can draw on this and anybody who knows Blender really well is probably going big deal. The grease pencil draws on surfaces. What's the point? Well, the grease pencil does not generate baricentric coordinates while you're drawing. So I can actually draw on this while it's moving if I want to and it's just dropping new values into these and dimensional arrays and processing it. And I stood here and drew on this for like, I don't know, until I had over 100,000 data points and it was still running at 60 frames a second with no noticeable lag. And being that it's, yeah, that's kind of cool, isn't it? Being that it's baricentric, that basically means there's a relationship between the faces and the points and the points will always move around and scale with the faces no matter what you do to them. So if I go over here and turn this off, go into edit mode, the line moves with it. I can scale it up or down or whatever and I'm actually running this inside a scene update handler and you can't even tell and it's a lot of math because I didn't do baricentric the easy way. I did it the hard way with a lot of dot products and cross products and close points on plane and all this crazy stuff so that it could actually live outside of the face and they didn't have special cases and all. So really quickly, same client that did the sporting goods stuff wanted to see what would happen to a pair of spandex shorts while the person was riding the bicycle, wanted a visual cue of what happens to the tension on the fabric and oh, wrong one. Here I am wasting time. So as we're pedaling the bicycle, we're seeing that, you know, the fabric is moving a lot but it's kind of hard to tell what's going on. So I have this really simple script. It's just a few lines here that does a whole lot of linear algebra and shows you exactly where the garment is stretching and having actually done a whole lot of bike racing, I can tell you that's very accurate. That is exactly where spandex is uncomfortable. Alright, so pie cloth. So this is basically a first iteration of an attempt to do a cloth engine with just NumPy. And this is all happening in Python in real time, running at 60 frames a second. I mean, that's to me that was like mind blowing that it could do this. It's also single threaded. It's also single threaded running on a laptop. So we needed to think about warp and weft and bias, which is with the weave of a fabric it can stretch differently diagonally or straight up and down or left and right. And I was dividing this up and I was thinking about doing elastic and all this stuff and it occurred to me, what if I just read all of the spring information from another object? So I thought, oh, let's make a proxy idea. So if I use my proxy object then I can read all of my spring data off of something else. And so while this is running, turn on a shape key for example, shrink it, make it grow. Oh, the elastic one's kind of cool to show that. And at any point I can just add an extra shape key here and have a new awesome thing that I could animate. Turn this shape key on and now I've got this new thing. I'm sure you animators who are thinking about cloth could think of a lot of cool things you could do with that. Okay, so on the Ben Spring issue, in reading about the best way to do rotations in Euclidean space, I went to these senior engineers and I was like, well, it looks like quaternions are the best way to do it. Can somebody help me figure out how to do quaternions? And they're like, what are quaternions? So I thought, well, it's not that complicated. Technically you are sending the points out into a theoretical dimension in space and rotating them on a hypersphere with imaginary numbers and then bringing them back halfway. And it's fairly simple. So doing that on n-dimensional numpire rays, I thought, eh, should be easy. And I did eventually figure it out, but my brain almost literally exploded in a fireball that would have been visible from space. So what you can do with this though, because quaternions interpolate so well, you can have stability with really strong bending values. So right now I have no bending stiffness being applied, but I can turn my Ben Springs on and it gets really stiff. It's almost like, I like those transparent plastic things or whatever. And of course I can control the bending stiffness and I can map the bending stiffness to a vertex group and all that stuff is actually really easy to implement. So when I go back to my proxy object and I want to do something cool with the bending springs like put a fold in it. Well, I have this nice fold and my angles are signed angles, which if you work in geometry, you know it's more difficult to come up with signed angles, but I have signed angles so I can go either way. Okay, one last thing. Okay, let me go to my modifiers. This is sort of a tribute to Blender. So I have permission to share my NumPy stuff with the Blender foundation. So it's going back. And I have so much more that I could show you. There's some really amazing stuff I've got that I ran out of time for, so sorry about that.