 Hey everybody, it's EJ from iDesign.com and today I'm here to show you how you can Loop cloth inside of Cinema 4D. So we all know that cloth is really cool and fun But it's really hard to try to figure out a way that you can get that looping for certain things So I've been beginning to animate a gift So looping is always a big concern with me is how to get my composition my animation to be able to loop seamlessly So I figured out a way that you can loop Cloth inside of Cinema 4D and actually lends itself to not only looping cloth But a lot of other things like Dynamics spline dynamics and stuff like that So today I'm going to be going over how you can create this kind of abstract Optical illusion type thing where I have this Stripe composition with some stripes going across that I have the the cloth kind of undulating So I'm going to show you how to use particle forces to be able to drive cloth Turbulence and wind and then show you how to use the pose morph tag to blend between states and be able to actually blend Be able to loop this cloth simulation. So let's just go and dive right in so the first thing I did to create this little abstract cloth II Thing I'm not quite sure what to call it. I created a spline and The main part of this and I'm not going to bore you actually creating a spline We all know how to create splines right but the main thing to kind of get this really cool composition is by Actually going and making the spline and giving it some nice depth You can see if I have my if I kind of rotate around my scene You can see we have this really nice z-depth on the spline. I'm going to undo that camera move But you can see from my top view and my right view What's going on here and you can kind of With all these views just kind of make sure that everything's really nice and smooth and curvy So everything's going to be nice and wispy once it comes to actually applying your cloth Tag onto this this object eventually So that's so that's the main thing to keep in mind is having this nice depth allows for this really nice Shadow play and ambient occlusion once you actually apply the cloth tag So that really helps it contrast from this just plain flat background is having this really nice depth with your spline that you can then apply Geometry to so that's exactly what we're going to do right now So to create geometry and apply it to go along our spine We're simply going to go ahead create a spline wrap and then we're going to need some geometry to actually wrap around the spline I just created a plane and So if we make the spline wrap a child of the plane We can then choose that spline to use for our spline wrap and right now everything's looking fairly chunky So we need to really up the width segments here to smooth everything out We can also bring down our height segments here And you can see we have a little bit of pinching going on right here But actually we the way I can get around this and to add a little bit more interesting Look to this is to vary the Width of I guess it would be the height of this plane as it goes around So it's not just all thick the same thickness throughout the whole entire Spline wrap here So the way I'm going to do this is just adjust the size of the spline wrap or our object as it's applied to our spline So what I'm going to do I just command-click on the size spline editor And what I'm going to do is just bring down the Spline point here. That's just going to scale down my spline And I can just I can adjust this Busy a handle here and again I have this handle on the Right here. I'm going to do the same thing and just kind of adjust this So we no longer have this kind of odd thing happening where our two So where our spline wrap geometry starts and ends It's going to kind of just peter out right here and doesn't look so awkward as it did before plus giving the giving a nice sense of Or just giving this a different varied width really add some more interesting Contrast to our main object here So again back to the plane object We definitely want to make sure that we have enough width segments Here so I'm just going to actually crank this up to about 200 and maybe increase the height segments to about 30 actually maybe that's a little bit too much Maybe just leave that at 20 We just need enough geometry. So once we apply the cloths Sim There's enough geometry to really let this get some nice wrinkles and stuff like that But we don't need to actually apply too much geometry at this point because We can then apply a cloth tag to it later that can then add Add more subdivisions to it. So I'll show you that a little bit later So once we got this looking all well and good kind of looks like an amber Sam I guess the amber sands are still cool, right? I don't I don't know our amber sands really cool still or is that kind of 2013 But this is this is looking good So what we can do now we need to prepare this so we can apply cloth to it So what I'm gonna do and cloth doesn't actually drive anything. That's a parametrics We need to make this whole thing editable in this state So that means we need this plane with this spline wrap deformation All to be just solid geometry editable geometry and to do that We're gonna select both our plane and our spline wrap We're gonna right-click and we're gonna go to current state to object and then once I do that that's gonna create a copy and I now have this editable plane that if I just go ahead and it's always good to keep a Hidden copy of your original Object here just in case you screw anything up, which in my case I Tend to screw things up. So I always make sure I keep that original Parametric setup, but then just hide it and just kind of stored away and you can even hide that spline as well So now we have this plane. I'll just call this ribbon Just so we can distinguish it from this plane object here And now what we can actually do is apply a cloth tag to this guy. So we're gonna go to Simulation tags cloth and you can see that once I apply cloth everything just kind of falls And that's all well and good, but that's not what we're looking for The first thing I want to do is get rid of gravity get rid of all this wind So I'm just gonna zero out all this stuff Just so we don't have any forces Initially affecting our cloth here So now if I hit play you can see that nothing's really happening and what we can now do is apply like wind and Turbulence to this object Independent of any of the settings here. So in all these other settings, I'm just gonna leave these At its default because they this the defaults actually work pretty well for what I'm trying to achieve here So what we can start doing is in the expert tab here. We can actually include Particle forces. So if we go to our simulate and we go to particles The attractor deflector all this particle Effectors can actually affect cloth as well But the thing is you have to make sure you then whatever Effectors you create you make sure you drag and drop it into this include. So what I'm gonna do I'm gonna grab a turbulence and While I'm in here. I'll also grab a wind Deformer or wind object So turbulence just adds turbulence in turbulent fields in your Composition so what I'm gonna do is again if I hit play nothing is gonna happen because Remember I need to go to my expert tab and just drag and drop these Forces to be included in this cloth simulation. So now if I hit play you can see a little bit of movement But because our strengths are so low on both our wind object and our turbulent object here Nothing's really happening. So let's just go ahead and crank this stuff up And you can really see once I increase the strength to 50 on my turbulence We now have a lot of turbulence going on and that looks pretty cool so again, we can increase the Wind speed to 50 here as well and you can see that it's kind of pushing pushing my Cloth object or my ribbon backwards And that's because with a wind object. We have this visual of a fan and We can turn this different directions and you can see that we actually have a Arrow that tells us which way the wind is going to be blowing So what I want to do is have it blow from left to right and then actually just give it a little tiny bit of Rotation so it's gonna actually be blowing to the left in a little bit towards the screen just to give it a little bit more Interesting movement. So not only is our cloth going to be blowing to the right But it's also going to be pushing forward ever so slightly so now I can hit play and you can see that now our Due to our wind and our turbulence our Ribbon is now floating over to the left there and that's all well and good but what I want to do is Actually pin down Portions of my ribbon here so that they stay in place and then kind of act like a flag Or sail or something So it's pinned down and we have the rest of our object kind of flowing and billowing in the wind So to do that Just gonna go and do a loop selection. So I'm gonna hit you Yeah, my dang whack them. So you and then if you see L Loop selection, I'm gonna hit that and so I'm gonna make a loop selection and I'm gonna select this one edge here Boop right there and then what I'm gonna do to make sure that those are fixed points I'm gonna go to the dresser Go to fixed points and hit set and once you hit set you'll see that we now have some purple Points going on here and if I hit play you'll see that now we have some stationary Points and then we have our cloth kind of billowing and flowing but being still fixed on the one side there So that's looking pretty cool so far I think the one thing I really want to do is add a little bit more turbulence So I'm gonna up the strength to about 200 so now we're getting a lot more turbulence going on And then I'm gonna adjust the scale and what this is gonna do is adjust the scale of the noise That's driving our turbulence field So if I bring that up a little bit more you can see that our noise is much bigger And we have a lot more undulation going on and that looks really really nice So let's just keep it at that So You can see that once we have our simulation going Everything's looking really good, but at the start nothing's really happening at all And to actually fix that There's a really handy option Where say I want my cloth simulation to not just start where everything's flat But I want to start where it's already billowing a little bit so say right about frame 100 This is the state that I want it to start at this is where I want my cloth simulation to start So what we can do to actually accomplish that is go into our cloth tag go into our dresser And we're gonna set the initial state So this is kind of like with the set initial state with dynamics if you're familiar with that But what I'm gonna do is if I hit set and I go to frame zero You can see that where I set that initial state That's actually where our cloth simulation is going to start from Instead of the just flat spline-wrapped ribbon So now we already have effects of this wind Affecting our cloth and then it's gonna start from there So this looks a lot better if you're going to actually want to loop some cloth So you already have some of the cloth simulation started. So now that we have this going on What we can do is Go ahead and start applying some textures. So in my Final render I had this really cool stripey kind of visual Distortion thing going on with the stripes due to the cloths. It's a Some some cool stuff happening there. So what I'm gonna do is just create some stripes And the first thing I'm gonna do is create Stripes for my background. So I'm gonna create a background And just scale up this Scale up this Plane here and then what I'm gonna do I just place this right behind Where my ribbon is gonna be or my cloth And just scale us up a bit more and the reason for this is so Once if we have this close to our object and we add some say ambient occlusion That shading is gonna then affect that background So keep that in mind. That's why I'm positioning my background Plane objects so close to the actual ribbon. So I'll just rename that plane BKG and Then we can add our stripes So what I want to do is just use a luminance. I just want some flat Shading for my background. I'm gonna go to texture and I'm going to create some Do-do-do, where is it? Surfaces we're gonna go to tiles and then under tiles we can change the pattern from squares to lines and I can choose to create just black and white stripes so black here and then We'll change the tile color three to White and then we don't want any bevel. We just want solid black and white here And then we can apply this to our background You can see that our background is really really big right now or our stripes are really really big right now So we can actually go and just bring down this global scale say to about 15 and there we have a Decent amount of stripes going on that might be actually a little bit too thick So that's looking pretty good so let's go ahead and then apply this same stripe material to our cloth or Our ribbon here, so you're gonna see when I render this There's some really weird. We're not weird. This is predict the predictable is we have both of our material tags applied as Projection as UVW so that's kind of why we have this discrepancy with how our Stripes are applied to both of our objects, but in my final composition here We have the stripes kind of applied similarly and then once that cloth kind of undulate. That's what's moves it out of out of Sync with the actual background the vertical or the horizontal stripes back here so to do that I'm actually going to change my Material projection from UVW mapping to camera mapping and now what this is going to do is I'm gonna actually I'm gonna use my camera here as a projector to project that stripe material Onto both the background and the cloth here so the first thing I need to do is actually define a camera and I'm just gonna define the camera we're currently looking through and Then you can see that if I hit render now You don't see anything and that's because we now have the same straight pattern kind of being projected onto both of our Background and our ribbon so it's almost like if you're watching a movie and you're standing in front of a movie projector You're gonna have that movies projection Actually cast onto your body But then your body is gonna kind of cast a shadow after it so that we that's the part that we need to do right now is we need to make it so that our Foreground is not so Just luminant that we actually have some diffuse shading onto it so what I'm gonna do is I'm gonna rename this Background stripes and I'm gonna duplicate this material and I'm just gonna name this ribbon stripes And I can spell stripes see so then what I'm gonna do is apply that to The ribbon and I'm going to activate the color the diffusion and some Reflectance and right away if I hit render You can see that not only is my Are my stripes Now more contrasting to the background you can actually make out the ribbons But we have this nice shading on it So what I'm gonna do is just go ahead. I'm going to add just a little bit of Reflection here just a tiny tiny bit get some for now Let's see. Let's bring the specular. I don't want too much specular going on here Maybe something like that for the luminance I'm gonna bring down the Actually, let's go multiply So we're multiplying this onto Everything here. I'm gonna go ahead and in my diffusion just to get some nice shading I'm gonna go and add some ambient occlusion. I'm gonna make sure that I have this effect luminance So that will actually be seen through my luminance channel So now you can see we have some slight ambient occlusion going on here kind of Defining the edges here and again This is why it was important to have that nice wide depth in my spline that I initially did the spline wrap with What I want to do now is actually just bring down the brightness of my color channel Just because I only want a tiny tiny bit of Diffuse I don't want it to be too overpowering. I want there just to be enough contrast That you can tell enough that there is something in the foreground Which is the cloth that is then I'm gonna get deformed and then Deformed those the stripes on our texture, but you can see we have no deformation of the stripes right now and that's due to the fact that we're still in this camera projection here and While our cloth is undulating that Projection is staying the same because our projector again is just acting like a movie projector It's just shooting on to both of our objects here. So to be able to actually have this so The stripes kind of deform with The undulation of the cloth what we need to do is go to our ribbon Go right click and we're gonna do a stick texture tag And what this is gonna do is stick and record the texture as it is now and then once there's some Deformation happening. It's then gonna move along with it. So you can see That now our stripes are undulating With the flow of the cloth geometry So now we have even more contrast between The background and the foreground because of the fact that we have that stick texture tag Breaking the texture up between the background and the ribbon So now we actually can see what's going on here. We actually see the the form of our ribbon there So that's looking really cool The one thing I want to do is go to the diffusion and let's up the The ambient occlusion just so we can see it a little bit more. Let's maybe even turn down The luminance here a little bit. Maybe let's go add Bring this Luminance down a little bit because I just want to pull in a little bit more shading So I have some soft boxes here that are gonna be casting some shadows, but this is a little bit too bright Let's just bring that all the way down Maybe we need to bring in a little bit more of the color channel just to get more Diffusion happening a little bit more shading happening and maybe even adjust The Specular here Let's see how this looks So what I'm just trying to do right now is just create enough shading so you can get a better sense of the form of the ribbon So let's see What's going on up here? This is where we really have a lot of overlapping here So we're getting some really nice shading down here. That's all well and good One thing I'm noticing right now is some really slight Not pixelation, but polygon distortion going on here and to fix that One thing is going on is we have a little bit too much reflection Alright, so The one thing that's going on is we don't have enough geometry here We're getting a little bit jaggy edges here, especially right down here. So to fix that Really easy just go to your cloth Simulate cloth get a cloth surface and then just put the ribbon underneath the cloth surface and due to the fact that we have by default Subdivisions happening. It's just going to subdivide our geometry. So there's more defined geometry and we're going to get a nice much smoother Cloth simulation more smooth smoother cloth geometry. So now we're going to have some really nice Wrinkles happening, especially right down here. That's looking really nice. Whoops. I stopped my have my whack-a-m pen and every now and then it just likes to stop the Calculation because I think it's thinking that I'm hitting the screen. I'm not all right So again the cloth surface really smoothed everything out really nice and good So really getting some nice shading, especially at the bottom there. You can see We can always fix that and add more Diffusion diffusion going in there by pumping up that color channel a little bit more Which I think I'm going to do right now Yeah, let's keep that to add You bring down the Luminance a little bit All right, I'm getting in a tweak mode. I'm falling into tweak mode. I know I'm sorry. I'm sorry Okay, I'm done. I'm done. Okay. I'm done done with tweak mode Let's actually move let's move on because I get stuck in tweak mode a lot. We're gonna go ahead and We're at the point now where we have our really nice cloth simulation Driven by our turbulence in our wind we have our cloth surface really making this Geometry really nice and smooth Get this really nice wrinkles going down around here at the top and the bottom and even over here we have What do we have we we have our stripes Undulating and deforming that stripe texture on our ribbon due to the fact that we did the stick texture tag So everything's looking really really nice The only thing we need to do is make it so we can loop our cloth Simulation and how we're gonna go about doing that is First we are going to cash This simulation so under the cash you just hit Calculate cash and we're cashing our cloth data. So now we can just scrub through our timeline and our Composition is 150 frames long. So our cloth sim is going 150 frames And you can see the importance of being able to start with the cloth already deformed due to the whole initial state Option there and now what we can do is set this up so we can loop So how we're gonna do that is we're gonna first duplicate the ribbon. So let's rename this ribbon one and We'll rename this ribbon two and by duplicating that we actually just kind of destroyed that cash so we're gonna calculate the cash again on that second ribbon and Because of the fact we didn't change anything They're actually gonna sync up perfectly so I'm actually gonna hide this new ribbon and We're gonna go to my handy dandy one of my most fun things to use I use it almost every project is my Happy pose morph tag and what the pose morph is gonna do is depending on which Things you select down here. It's gonna morph between different states of or different things of different objects different properties of different objects and What I would need to do to loop the Cloth here is record the point Deformation so the point level animation of these objects So I'm going to go ahead and on the basic I'm gonna mix points So the points of my two pieces of geometry my two ribbons here So what I'm gonna do is by default we have a base pose and then a pose we can mix in two So let's just I'm gonna hide my original ribbon and I'm gonna go into My other my second ribbon here. So basically what I need to do and it's just like looping anything So if you're looping something in After-effects you need to make it so the end of your animation looks like the beginning of your animation So how can we do that? Well, something that's very handy is once you cache a cloth simulation We have this offset here where we can actually use this offset to determine Where we want our cloth simulation to start so right now with no offset our cloth simulation starts at frame zero But if I change this to 50, you'll see that my cloth deformation starts at frame 50 So you see what I'm getting at here between Zero in 50 or frame 49. We have the very first frame of our animation In our viewport so if I actually change this to 150, which is the end frame of our animation What's happening is our cloth simulation didn't start So we now have the same cloth Sim frame Or point position of our cloth here same the same on frame one and frame two so now what we have to do is blend between These initial ribbon to blend to this Ribbon to which is then holding the first frame Position of all the points in our cloth simulation. So let me actually just demonstrate that So I'm gonna turn off my second ribbon go to my first ribbon and I'm gonna hit play. So here are our Cache is just played out. We have no offset and basically what we need to do now is Due to the pose morph tag I have my base pose And we have a target and what I need to do is tell it that this is my pose I want to morph from and I want to morph into that ribbon to pose, which is that frame Zero of my cloth sim So I hope I hope that's making sense. So what I need to do is actually define a target and My base pose is gonna be that ribbon one So all that point level animation is gonna be in that base pose and then the point level animation or that frame zero of that of my ribbon sim is Actually gonna be my pose zero So what I'm gonna do is make sure I go to pose zero or I'm just gonna rename this to Initial state. So this is that initial state that we set With that cloth tag drag and drop the ribbon and that's gonna be the target So now you'll see that due to the fact that I Did that we can now Adjust the strength and you can see that there is my frame one And if I go to frame one fifty This is without no Strength on that initial state. This is actually the last frame of the cloth sim in our initial cloth sim So basically all I need to do is at the end of my animation Just make that strength go to 100 and then it will just loop back and that cloth Deformation will be the same due to our morph here All right, so if I didn't have that you can see that this is what my end of my Initial simulation looks like and that doesn't match up at all. That would just be a jump so what I need to do now is I need to go from edit mode to animate mode, so I'm ready and Rare to go ready to animate and what we need to do is set a keyframe to Adjust the strength of that initial state so at the end of it my animation I'm gonna set a keyframe and then as it gets to the end of the animation I'm gonna bring up the strength and basically go back to that initial State of the initial deformation that happens on frame zero of my cached cloth sim so now if I hit play You can see that we have a little bit of jump But you see it frame zero and frame 150 our cloth Looks exactly the same and that's all due to the pose morph doing the point level animation and morphing to that initial state with that offset so our our Ribbon looks the same on This ribbon here and then we just morph to it We morph from the initial cloth sim and we morph to the frame zero That's held in this ribbon so to fix the fact that we have this If I let this play we have this little bit of jump or not even a jump with this like ease in That's all due to the fact that we have With our pose morph strength here. We have an ease in and ease out So basically all we need to do is kind of get rid of that ease in By just adjusting the busy a handle here and making a little bit more sharp. We still want that Actually, you know what we don't even actually need ease in and ease out. We're just gonna change these two keyframes To linear keyframes, so just by hitting that linear keyframe button and now if we hit play You'll see that we still have a little bit of a pause and That's because we're actually duplicating the last and the first frame because remember We're morphing to the Frame zero of our cloth sim due to the ribbon two. So we're actually duplicating Frame zero at frame 150 and then at frame zero. So we have two frame zeros basically so what we can do to fix this is we can either offset or and ribbon one cloth sim by negative one or So what this is going to do is it's already going to start the frame one of our class in one frame earlier so we want that get that one frame overlap or Actually, that's the one way to do it That's the way to do it So now if I hit play You'll see that we no longer have that overlap and if it's a little bit too sudden Actually that looks pretty good, but if you need to keep in mind how you space out your Initial state strength. So if I have this a little bit too fast, you can see that we have a little bit of odd Movement happening there at the very end. It almost like rushes back to that initial position. So When you're looping cloth kind of play around with How many frames it takes for you to morph between those two states? So let that's 50 frames and that's a little bit too much. I feel like That's a little it our cloths him kind of slows down If I set this to maybe 30 frames, let's see how that looks and that looks a little bit more natural It can maybe even speed it up just slightly And I think that looks pretty good right there See again, you can adjust this. So maybe it's an offset of two see if that's a little bit more seamless Or just maybe one You can kind of mess around with this and see what looks more seamless to you, but I think that looks pretty dang good See maybe adjust this So everything just kind of depends on how your cloth looks the speed of how your cloth is undulating That's all gonna determine how you space out this this morph And I think I'm actually gonna I want to try this negative too. I think that's a little bit more seamless right there Negative two frames. Let's see with negative three So, yeah, I mean that that looks pretty pretty good to me So that's basically how you can loop cloth. So what we did was set initial states So our animation started with already some cloth deformation due to our turbulence and our wind We then duplicated our Cashed cloth simulations we cloth that That sim that cloth sim Created a second ribbon that basically just duplicated the cloth sim cashed that as well By offsetting it by 150 frames our cloth sim doesn't actually move from the initial state at all because we offset at 150 frames So basically this state set Holds the initial state of our animation our cloth animation, but then to morph To that between the end of our initial cloth sim to the beginning of the cloth sim We simply used a pose morph tag with some Point mixing to then blend between the two different states With a simple with just a couple key frames and that's how we did it So hopefully that made sense to all of you. We have some nice looping cloth here If you have any questions be sure to hit me in the comment section Pose morph is very very cool, and I hope to do more Cool tutorials with the pose morph. I use it so much And it's a really cool way to blend between different states. So this isn't only limited to Looping using pose morphs for looping cloth think about all the other kind of simulations you can use Or you can use to morph between pose morphs. So you can use spline dynamics you can use Soft body dynamics rigid body dynamics, so you can use the pose morph tag To blend between a lot of different things because look at all the things you can actually record With the pose morph tag so things you can mix you can mix position scale rotation Parameters hierarchy so entire object hierarchies. So Think about morph in between different positions of objects and stuff like that with our rigid body dynamics So it's not only just point level Animation you can mix between with the pose morph tag. So pose morph tag very very powerful tool Even though it's under it's under the character tags But I I've I barely use it for character work I use it a lot for just my my normal motion graphics workflow. So Be sure to play around with that and have fun with this I'd be really anxious to see what you guys come up with. I'd really like to see if you guys come up with some looping cloth simulations I'm gonna make a gif of this So I encourage you guys to make some gifts. I'd love to see what you guys come up with And again as always, thank you guys so much for watching this and I will see you in the next tutorial. Bye guys