How To Create UE4 Dynamic Real Time Hair / Fur using Cinema 4D

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] [Music] [Music] what up what up wimbush here and today i'm excited to show you guys how you can take the hair and animations from cinema 4d bring them into a real and have them running in real time and they're actually dynamic so without further ado let's jump right into it before i get started i just want to give a quick shout out to asus for lending me this 4k monitor this thing is beautiful i've been running all my tutorials and doing all my client work on it lately and then also the studio book pro that i have here at the laptop i've ran a couple of tutorials on that too just click on the link up top you see the star wars tutorial that i ran off this laptop this thing is a beast as well and speaking of beast i know you notice over here in the corner this brand new zydex i think that's how you say xydex but um yeah they they built this beast of a machine here it has an amd threadripper 3 128 gigs of ram running this machine i've been doing a lot of real-time rendering with unreal with this thing since last night and this thing is crazy so i just wanted to give a quick shout out to everybody and let's jump right into the tutorial i'll show you exactly what this piece could do so we're going to get started with cinema 4d actually we're going to get started with miximo just because it's a quick way that we could get some animations and we could get uh um a default character in here so i'm just going to use this default character that we have right here i think his name is like why bot but if you don't have it his name is why bot you just search it and he'll pop up in here and so what i want to do now is before anything i'm going to need to bring in a t-pose and this is a real important part because in unreal engine we're going to start a character off with a t-pose and then we're going to add our animation if we don't start off with the t-pose the hair is not going to connect correctly and it's just going to go all out of whack so this is something i'm really excited about because it took me a long time to figure this out so if i just come over here and type in t-pose up in my search window here there we go we have the t pose right there and so from here we just click download and then i'm going to keep it as an fbx my frame rate i can run it at 24. um you could get 2430 you can't rent it at 60 when i was doing my test there's some stuff inside that um other hair stuff in unreal is kind of beta right now and so if i went anything over 30 it just crashed immediately so 24 or 30 is a good safe number to roll it there leave the skin on and i'm gonna just click download okay so i have my t-pose downloaded now i'm just going to find an animation in my example i just started running so maybe we'll just type in running here see we have maybe we'll do something hey let's do like this scary run you can see like he runs off the screen here so what i'm going to do is click on in place now he's just going to run in place and he's not going to move at all so i'm just going to leave these at the default for right now and just click download so same thing i'm going to do 24 frames per second fbx with skin click download then we'll get this saved and then we're going to bring everything into cinema 4d so let me save it there then i'm going to click open folder and i have my files here that i just downloaded and i'm actually going to let's see i made a folder for this project so i'm going to click and drag these into my cinema 4d folder that i made for this project like originally it was in the download folder so now i have my stuff organized in here actually let me make a folder in here for miximo because i'm going to be saving out fbx's from cinema 4d and so and i'll name this one ue4 actually for ue4 that's unreal 4. so these are my folders that i'm making i'm just organizing right now so this one that says mixamo has my fbx's in here and then later on i'm going to save it out into the folder for ue4 and that's where i'm going to stick my fbx's that i'm going to bring into unreal so let's just click and drag this t-pose in here not going to mess with anything in here just click ok and so now i have my character in here my t-pose and there's one weird thing when you bring in the stuff from mixamo if you see over here on the right-hand side like everything is all grayed out i'm not sure why it does that when you bring it in the cinema but an easy fix that i've come to found is just select everything here hit copy and then just start a new project and then paste it and now you have access to all your stuff in your window down here i'm not sure why it does that but that's what it does so that's just a quick and easy fix to be able to have access to everything down here in that window okay so now what i'm going to do is i'm just going to export it from cinema 4d as an fbx and the reason i'm doing this is just so everything is aligned with my cinema 4d project i know we downloaded the fbx from miximo but doing it this way i was able to keep everything aligned for when i added the hair to it and so let's click ok and i'm going to save this one in the folder for ue4 so i'm going to just name this one t-pose and then click save okay cool so now what i'm going to do is make sure i have my alpha surface selected over here and i'm going to come up to simulate and i'm going to come down and add hair and now you can see that we have hair that's going all out of whack i'm going to fix this up a little bit so let's come down to our guides here and for my root i'm going to do polygon area and then i'm going to bring the length down just a tad bit until we can start seeing like our figure there so maybe somewhere around 25 is cool because we still want to have some type of hair that could bounce around and everything and then for my account right now it's at 17 336. let's just crack this up to like 50 000 give that a second to calculate and then for my segments i'm not sure if this makes a difference but i put 15 on here just to give it a little bit more um i guess detail on there but that's what i did for that is so now we want to make an olympic file for our hair to be able to bring this into unreal so i'm gonna come up to my hair right click and come down to bake as alembic and before i do that we only need one frame of this so i'm going to take my timeline where it says 90 click zero and now we're just going to have like one frame in our timeline here and so now i want to come up to my hair and come down to bake as alembic because all of our dynamics is going to actually come from unreal engine which is really cool this is something that they just added and so where i want to go from here is i'm gonna go for a ue4 i'm gonna click okay okay so now that's exported you can see here the path that it exported to so it says path to alembic and then it has hair dot abc abc stands for alembic and then we're done with this file here but i'm just going to save it as a cinema 4d file just for a reference in case we ever need to go back to it so i'm going to just name this one t-pose and this one will be a dot c4d file this has nothing to do with unreal i'm just saving my project file so i'm gonna click save okay so now let's add in a running fbx that we downloaded from miximo so i'm going to import this if i click play you can see our character is running in place here and before i do anything else i'm going to do the same thing i did before select everything make a copy come over to file new project and let's click paste and then let's click play again let's make sure our project file is at 24 frames per second so it's actually not so i'm gonna come up here to output just come down 24 then we want to make sure that our project is also in 24 so come over to project settings then over here over fbs let me click 24. now our project should be 24 frames per second um everything's going to be running in real time and unreal so we can make this actually a really long loop so let's make this project like 500 frames okay we don't need to worry about render times or anything like that so i've come up here to my upper right hand corner where it says layout here's startup i'm going to click on animate and then you can see down here we have all of our keyframes from mixamo they're already selected so i'm gonna hold down control oops do it like this make sure they're all selected hold down control and just drag them over and what i'm gonna do is you hold down control left click and drag over i had to hit control z let's try this again and drag this over and what i'm going to do is i'm going to drag this out for the entire duration of our scene here so let me do this real quick and this way we'll have a running loop that's like 500 frames okay so when it's all said and done i ended up making it 863 frames i just kept you know doing that method where i will hold down control select all my keyframes left click and drag over and just keep making copies of that and i ended up at 863 here so now if i click play you see that we just have a continuous running loop of this guy just running in place it's going to take a couple of seconds here and that should be good for bringing into unreal so before i do anything else let's go back up to our layout go to my startup then i'm going to come over to file save project as i'm going to name this one running and again this is just for my cinema 4d reference if i ever need to come back to this file i have a saved file for it so i click save for that so now what i want to do is i want to save this out as an fbx animation for what we just created here so what i'm going to do is come up to file come down to export and then let's export in fbx and what i want to make sure i have clicked is i'm going to have it on 2016 for the fbx version and then down here for animation make sure you have tracked and bake all track selected and then that should be good you can leave everything else as you see it here i'll give you guys a second to see everything that i have clicked but i believe these are the only two things that i added everything else was already clicked here so i'm going to click ok and now i'm going to save this into my 4 ue4 folder let me click on save give it a second to export okay so we should be done with cinema 4d now so the next step is to i'm going to close out cinema 4d and click no all right cool so now we're going to get into unreal engine so i'm going to click on my epic games launcher give this a second to launch up and this is real important the hair stuff is added in version 4.24 so make sure you have the latest version of unreal installed right now i'm using a version 4.2 4.2 so i'm going to click launch on here so now we come up with our unreal project browser what i'm going to do is i'm select this one for film television and live events this works now so just click next then i'm just going to start with a blank template click next i'm going to do no starter content raytracing tracing disable by default and then for my project file i'm just going to name this one let's run running here cool so for my project name i named it running here i have my folder selected that i want to put it into so yeah i want to put it in there and then let's click create project and then there's a couple of steps that we're going to need to take to get everything set up for a scene here so now we have unreal opened up so down here in the lower left hand corner it says project file is outdated would you like to update i just click update i'm not sure what it's doing there but everything seems to be fine this is new plugins are available let's click manage because this is kind of important too so you notice that i clicked the template for film and broadcast is so to be able to use those you want to make sure that you have these installed these are free so this is called the odd job media player and this one's called the blackmagic media player so if you're new to unreal it's going to ask you it's going to say okay so you click the film and broadcast go to the marketplace and download these and it would actually take it there so you just make sure you accept and download and then it's automatically enabled for you right off the bat so with that out the way i want to click on here where it says built in and then under search i'm going to type in groom and so this is the new plugin for unreal that will allow us to bring in hair so i want to enable it i'm just going to say plug-in olympic groom importer is the beta version are you sure you want to enable it click yes and then same thing for the groom underneath it click enable it's going to say you know are you sure you want to do this it's a beta version click yes so just to recap we have olympic groom importer selected and we have the groom selected both of them enabled and then down here in the lower right hand corner it's going to say unreal editor must be restarted for the plugin changes to take effect we hit restart now and that's going to enable the plugin it's going to restart real quick it shouldn't take too long but it's going to do this every single time that you start a new project in unreal and if you don't want to go through this like you know if there's a couple of plugins that you want enabled all the time i actually did a tutorial on how to keep it permanently enabled it's actually a text document you have to manipulate some stuff and then you have your plugins here automatically enabled i'll link that down below and up above me here so now we have a room if i type this in now it's all enabled so there's one more step that we're going to need to take before we get started here and so this one is actually in the unreal documentation which i'll link down below as well but if you come over here it will tell you these two options that you're going to have to enable and disable for this stuff to be able to work so i'm just going to select and copy and i'll leave a link to this direct um documentation down below i actually put in a comment so it's easy to find and so you'll be able to click on it and find exactly where i'm at in here and so i'm going to copy it and paste it or copy it and um i'm going to paste it into my settings here so i come up to settings come down to project settings and then up here in the search bar this is one of the cool things about unreal you can kind of just search for what you want and so right here under engine rendering it says optimization support compute compute skin cache and so i want to enable that and then down here in the lower right hand corner you notice it's going to say we need to restart but don't restart yet there's one more thing that we have to disable which is again in this documentation where it says tick animation on skeletal mesh initial which i guess means initiate so i'm gonna select that and copy it just so it's easy to find in here so i'm gonna come back to my search bar here hit ctrl v and you can see that this is enabled and we actually want to disable it and so just to recap you came up to settings come down to project settings you go to that documentation that i just showed you from the unreal site you want to find where it says project settings and it will tell you right here the um two things that you need to enable and disable and then now actually let me close this out so now in our lower right hand corner where it says restart now let's click that so now over here under content browser let's click import and let's find where we had our files remember i made them for ue4 so i want to start with my tpos fbx that i exported from cinema4d so i'm gonna click on that click open and then for this i'm going to import animations even though we had no animations i found out this worked best for me and so make sure you have one click import animations scroll down see if there's anything else i believe everything else is by default so now we just click import all and we should see a bunch of stuff pop up in the content browser here you can ignore all this just click the x so now we have a t-pose and we have a t-pose animation and we have a skeletal mesh so now let's import our running sequence so i clicked on import here has come up to running just click open and now when this is um under skeleton let's click on our t-pose one i think it's already selected but make sure you select that one it says t-pose skeleton and then import animations exported time everything looks good here so now let's click import all and we should be good to go after a few moments again can't ignore that so now we have our running animation and we have our t-pose so before we start with the hair let's get our animation up and ready to go so i'm going to click on t-pose here bring in my character so it's the t-pose is the one that has the purple highlight right here and this is skeletal mesh i bring that into my scene and i can actually delete this little controller this is if you want to make it into like a gaming level that's where your player will start at so i'm just going to delete that and i'm going to click on my t-pose here and my world outliner in the upper right hand corner and under transformation let me just zero everything out okay so now we're in exact zero i know it goes under the floor a little bit here i can actually click on my floor just bring it down because i want to go by the exact zero of my mannequin here so now the next step is to we have to make like an animation sequence which is kind of like an nle editor like this is where we can bring our character in and we can add all of our animations and everything you can also add like your camera and all types of stuff i mean it's pretty cool but that's a whole nother tutorial so we want to come up to cinematics click on this add level sequence and then i'm just going to leave it at default where it says new level sequence i mean you can name it which you want but i'm gonna just leave it at default click save so now you'll notice down here we have a window called sequencer and it looks just like a an elite editor like if you're working in blackmagic resolve or whatnot so what we could do from here is we can make sure we have our character selected here our t-pose come back down to our sequencer click on track and where it says actor to sequencer add t-pose so now we have our t-pose character it's kind of like having a layer in here so if you're used to working in like after effects this is exactly what we're doing so we're bringing our object into our timeline here and this is where we can start adding like the animations and stuff and so where it says animation right here and when i left click and you can see that we have two animations here that we can select from so actually if you wanted to bring in more from miximo you could do that as well and have like a whole bunch of like animation sequences kind of string out so what i want to start with is the t-pose animation and i can actually bring this down a couple i just want to have a t-pose for like a couple of frames here just to get us started off then i'm gonna click over to around five and i'm gonna click on the animation button again and click on running animation and as you can see now we have running animation stringing all the way out and if i come down here to the lower right hand corner i'm just going to left click and drag all the way over until i can see the end i believe it was what like 860 something frames actually right here i want to change this to 24 frames there we go so let me click all the way at the end here boom and then down here in the lower left hand corner i'm gonna left click on where it says set the playback in and that works just like it nle like i was saying so that sets our end frame we have green over here for our start frame so if i come down here click to front now we're going to click play right here and you can see it went right from t pose into our running animation so now we have our animation ready and set to go let me click on pause let me go back to the front and actually hit ctrl s just to save it because now what we want to do is bring in our hair we're bringing in the fun part so what we want to do here is click on import and you remember in cinema 40 how we made the hair alembic file the abc file we want to import this so now this comes up with the groom import options and this is actually brand new so remember when we enabled those groom plugins this is exactly what it's doing because if we didn't enable those then it would come in as an import as it did before like when we did the t-pose or the running animations if that makes sense and it has a completely different menu and it wouldn't work at all so if you don't see this groom import options make sure you go back and enable those plug-ins and then when you enable the um or when you bring in the olympic file you'll see this pop-up and that means you're in the right place and so i'm coming from cinema 4d and so there's a couple of things that we have to do here in the conversion and so for rotation for some reason it doesn't bring in the rotation and the scale exactly right and so this took me a little bit to figure these numbers out but for rotation on the x i found out if it's if you do it at 90 degrees and then for the scale we want to bring it in at negative one now when we bring in our hair it should exactly line up to our t-pose character here so now i'm gonna leave everything else here as is and click import and now it's going to import our hair and once it's done we should see like a hairstyle come down here into our content browser there we go so i'm going to click and drag this into our scene i can drag it around here it's a little bit hard to see but you can see that we have some hair strands in here we'll make it more legible here in a minute but what i'm going to do is come over here to my um my details panel make sure you have hair selected i'm just going to zero out my location here and we have him exactly where we need them to be aligned up to our mannequin here so let me see what's the next step i want to do let's um actually let's bind this to our character so i'm going to take my hair and i'm going to drag it down to my t-pose and you'll see this window open up in the left it will say choose socket or bone we want to select none we don't want to select it to anything or bind it to anything there so i just selected none but down here under um under groom where it says bind groom to skeletal mesh make sure we click that on and that's actually going to bind our hair to our mesh now but if i click play it's not going to do anything because we don't have any of the niagara dynamics in there yet and so we'll get to there in just one second but first let's create a material so we can kind of see what's going on here so down here my content browser if i right click and then come over to material and then let's just name this um i'm gonna name it hair blue just in honor of sonic the hedgehog maybe they just came out and then i'm gonna double click on that and this brings us up to our texture window and so before i do anything else i want to click on this right here and come over to my left hand side under material i want to come under where it says shedding model and i want to click here so now it's telling it that it's going to be a hair texture and in my search panel i'm actually going to type in hair and right here under usage make sure you have this turned on where it says used with hair strands i turn that on and now our material is ready to go so now we have to do is add color and add a little bit of roughness to it so i'm going to start with my base color left click just drag out and then in my search window here i'm gonna type in constant and then under here i'm gonna do a constant for a vector so that should give me my rgb and alpha so over here yeah you see we have rgb and alpha but if i click on the black here it actually brings up a color picker which i like using this one right here instead of the color wheel i just like using the spectrum window so let's find like a cool blue color somewhere around there click ok and then under roughness i'm going to add a constant so click and drag left click drag out and then click on constant and then i'm just going to do a regular constant here and under value i found like point 33 was a good roughness to go with i think that's the one that unreal actually suggested in the documentation so i click on save okay so now we have our material saved i could get out of this window so now we have a blue a hair blue material down here make sure you have the hair selected in the world outliner and i'm just going to click and drag this over here under materials so now we have you can see that it turned our hair blue here but it's still a little bit really thin we can't really see what's going on so our next step is going to be over here under groom we have this little box here called room excuse me it says groom groups desk dsc not sure what that stands for if i click on that and then click on this other down arrow you see we have a attributes window for hair width so i'm just going to click and drag this over to the right and now you can see we have some really thick hair going on there just like what was in my example there we go so you're just going to be floating in the air actually i could turn off atmospheric so we'll just have them running in the dark something like that all right cool so now we have our hairy guy here our hair is still not dynamic yet but i'm gonna hit ctrl s just to save it so let's go back over under the hair so now we're gonna get to the fun part we have to add the niagara dynamics that's a dynamic system and unreal so let's come over to where it says add component right here this green box left click come down to niagara particle system so we want to click on this and now we have a new window come up here this is niagara so where we have this red box right next to it it says none click on this and then over here you'll see it will say groom asset system we click on that oh yeah before that if you're um brand new to unreal like if you just installed the niagara over here you're not going to see these options right here so what you need to do is come down to where it says view options click on that and then make sure you have show engine content and show plugin content because if you don't have those two options installed then it are selected it's not going to show you any of this stuff here so again make sure you go to view options make sure you have show engine content and show plugin content selected and then you'll see the windows that are over here it said we want to click on groom asset system the niagara system there's one in red you click on that and you can see that the hair actually fell down and so now if i come over to my sequencer and there we go now we have our character running in real time so if i come over to perspective let's do a cinematic viewport something like that give us a real cinematic view let's make sure our settings are on cinematic so if i come over to settings image scalability settings i like working on a cinematic just makes it pop a little bit more let's see what else we need to do to make it look good i think that's about it we can bind our lighting a little bit so if you come over to build let's come over maybe set up a medium quality do our build lighting but this is just playing around but yeah that was the basics of it so let me click to start here ah there we go so now we're really getting some shading and everything so what i did was i came up to build lighting and what that does is it's gonna build our scene to the lighting that we have and so we have a source light right here so actually if i rotate this around get something really mysterious look in there could probably even bring a point light so this is just all playing around but yeah you guys get the gist of what's going on so click play and we have running in real time we have our hairy character here so that's exactly how we bring in our animations and our hair from cinema 4d into unreal to be able to run in real time like so so hopefully this helped you guys out you know this is a really exciting time we can actually bring our stuff from cinema 4d and bring it into unreal have it running in real time and we actually bring in our hair now which is really fun so if this did help you out make sure you leave your boy a comment down below subscribe to the channel and until next time keep creating i'll see you in the next video take care you
Info
Channel: WINBUSH
Views: 28,739
Rating: undefined out of 5
Keywords: cinema 4d, unreal engine 4, ue4, unreal, engine, groom, 2.24, unreal engine 2.24, hair, c4d, mixamo, character, animation, real time, winbush, importing, datasmith, plugin
Id: KbbIMzWM7Eo
Channel Id: undefined
Length: 31min 27sec (1887 seconds)
Published: Wed Feb 19 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.