Exploring the New Real-Time Car Configurator Sample | Unreal Engine Webinar

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hey everybody my name is daryl robert and welcome to our webinar on working with the car configurator sample project today i have the pleasure of working with david bayless and we're going to be showing you a variety of things david's going to start off by going over the look development approaches that we used for this project and i'll be showing you how you can work with your own custom assets inside of the sample project and set things up like trigger events to open and close the doors as well as changing the color of the vehicle so with that said let's go ahead and jump in there and get started i'll hand it over to david okay so let's talk about the lighting techniques used in this project the project is using a physically based lighting approach to mimic as close as possible to real-world physics the scene is composed of a directional light a skylight a sky atmosphere exponential height fog and the latest volumetric cloud system as a version 4.26 okay so let's first start with the directional light the sun plays a very important role for lighting especially in the scene and the way we approach lighting in the scene was to use physically based values if you look at the real world sun intensity values the sun is measured in lux and for bright sunlight the values average 110 000 lux so if we go into our directional light properties and go into the intensity we can see that value is transposed here in lux so by entering such a high intensity value we would need to adjust our camera exposure to compensate for the lights so let's go to our post process volume and let's go into our exposure settings and we can see that we are clamping this value at the value of 14.2 now if i set this to 1 for example we can see how bright that sun is and it's overexposing the the scene so we would typically go at the higher values and start we can start seeing the car here if i go 12 and 12 we can start seeing that popping a bit more and if i enter a slightly higher value of 15 let's say we are starting to get that exposure set now the way to check the color is actually via the color calibrator so in this level we actually included the color calibration tool for you and this is a really good way for you to check your exposure values in the scene now a good tool to use is the actual pixel inspector so if you go into the windows tool and go to developer tools and then pixel inspector this will bring you a window where you can actually check the gray values so if i place my camera actually to where the sun is hitting and check that gray value we can see that we are hitting that 18 to 20 percent value of gray which is very good so in this scene what we actually did was actually overexpose the scene a little bit for a more photographic look so we entered a value of 14.2 which brightens up the scene has that photographic look and also helps you navigate in the configurator okay so now let's move on to the skylights and what the skylight does is actually capture the distant parts of your level and applies that to the scene as a light so it's important to make sure that the skyline is not stuck inside the car or under the car as it won't efficiently capture the different lighting data of your level so a good placement is actually sitting above the car so what we did here for the skylight was to actually increase the cube map resolution so by default when you drag the skylight in it is set at a resolution of one two eight so if i reset this value by clicking on that little arrow that's gonna bring it back to one two eight we can actually see that we are capturing a low res of the sky here now if we drive that up to 2048 we are capturing much more accurate data from the skylights now what we did with the skylight here is also tweak the skylight threshold so what the sky distance threshold represents is the distance from the skylight at which any geometry should be treated as part of the sky so in this example we actually went with a lower value of 200 which actually brightens a bit more the car and the side of the car but if you want to tweak that value and let's say put it to 500 or 400 what it's going gonna do now is actually treats that part of the ground as a surface and not as a light anymore so in this case it's gonna darken my side of the car slightly more okay so now let's move on to the sky atmosphere so what the sky atmosphere does here actually is giving us control on the look of our sky so what we did here is actually change a couple of values here in the rayleigh scattering if we go back to default we can see that it's much more hazy here but if we lower this to something like three we get a bit more blue sky and another interesting value here is the r direction arrow perspective u distance scale by default it is set to one and we do lose a bit of haze and depth so we do lose a bit of depth in the background here so if i put that back to 10 for example we get a bit more haze and depth we can lower this to a lower value and uh you know you can play around with this um but it is a very nice feature that uh adds realism to our sky okay so let's move on to another new feature that came out with 4.26 which is the volumetric cloud system which really adds a nice touch to sky and to your scene especially with dynamic lighting as i will be soon demonstrating so if i hold ctrl l in my viewport and this actually allows me to control live the sun position in the scene and we can see as soon as i start moving this we actually see the clouds reacting dynamically to the light and we get the nice cloud shadows going on so as soon as you start playing with this it's important to make sure that you are once you have the final look that you are building the reflection captures to update the skylight's sun position so as soon as i do that it updates the skylight capture and gives the accurate look on that car okay so let's talk about the post process volumes and basically what we have here is one for the exterior and one for the interior and the difference basically come between the exposure values so when you place your car in your scene make sure to have that car placed inside this volume which controls the interior exposure so if i move my camera slightly here and slightly blend between the two here we actually see that we are using two different exposure values for the interior and the exterior so right now i'm in the interior and if i go out i'm in the exterior and what that does basically is lighten up the interior of the car so if i go to my post process interior and we can see that our min and max values here are slightly lower than what's at the exterior so if i set that to 14.2 which is like the exterior uh we don't have much light information going on and it's rather hard to see what's uh what's going on in the in the cabin here so i'm going to put that back to 12 and 12 and that basically controls your exposure value for the interior now another quick tip for your car scene is the emissive material so very quickly here i'm just going to drop a sphere and i'm going to be applying a um light material so i'm just gonna be using uh this guy here so if i drop this right now you see it's it's very bright because i've obviously parametered that in advanced but if i bring this value here we can see the power is actually quite intense so if you're used to using relatively low values between 1 to 10 and put that emissive material into the scene and it went as black well that is because the sun intensity is actually so high that it's occluding your emissive material so just make sure to have a high enough intensity on your emissive material now also another tip when working with bloom is actually checking your screen percentage so that is actually driven in the post process volume in the runtime so if we go into the search details and actually look at the screen percentage here we can actually see that in one time it's using a screen resolution of 120. so when working in the editor it's a good practice to use that same value here so i'm using 120 here but let's say if i have my default screen percentage set at 100 we can actually see that bloom reacting to my screen percentage so if you are playing with a screen percentage in the post process make sure to have that same value in the editor so you can actually see the difference in the bloom intensity okay so now let's talk ray tracing so this sample project was made with the intent to demonstrate the weight tracing capabilities with automotive in unreal so we are using three ray tracing features here which are reflections ambient occlusion and shadows so we're going to start with the reflections here so that is controlled in the post process volume and if we go down to the rendering features we can see that our reflections here are set to ray traced so if i switch back to screen space we can actually see it does a quite a decent job but we are losing a bit of self uh bounce reflection here on the rim as well as losing a bit of definition here so if i switch that back to ray tracing we can see especially in the headlights all the metallic bounce uh going on here and uh we're getting some really nice south shadowing here in the wheels compared to screen space reflections now the second way tracing we use is the way traced ambient occlusion so that is particularly nice for your car shadows if i turn that off for example we immediately lose that light occlusion going under the car so that is a feature that is limited with screen space ao and uh way traced ao counters that and adds a nice feature now the last of all is the waitress shadow so weight rate shadows is actually controlled with the directional lights and um what we can do here is actually play with the source angle here so if we put a value of -4 for example we get some soft shadows going on here which is pretty easy it is also useful for contact shadows inside the car for example or also outside so if i play around with the light here and control l bats and let's try and get some some nice shadows on the car seat for example and we can see here like i can play around with the the source angle get softer shadows i'll put that back to normal and if i scroll down and we can actually turn off raytraced shadows so if i turn that off this is using the default uh shadow method uh that's uh you know definitely lacking some some definition here and as soon as i turn that back on we get all that weight raised lighting information that is able to evaluate the objects in the scene in a much more accurate way okay last but not least let's talk about the console variations used in this project so the first one i want to talk about is the reflection denoiser so if i change the light here just slightly so we get the car in the shadow the area a bit more and by default when you turn on weight tracing it's going to apply a denoiser so we actually turn that off in the project files but for the sake of the demo i'm going to turn it back on so the console command for it is are the reflections.denoiser one and that is always turned on by default but what it does here is actually blur um the reflection samples here and actually we're losing a lot of definition from the the salt ground here so what we did in the console commands is turn that denoiser off so as soon as i turn it off we get way more reflection detail going on the car panes now a second one that we used is uh actually ssgi which stands for screen space global illumination and that is also enabled in the project so right now it is turned to one but if we turn that to zero for example we see just slightly a loss of definition in the light bound so if i change the light here slightly uh and let's turn that back on we get a bit more light bounce going out under the car here now the last uh console variation that we used here which is uh nice to show is the new temporal aaa algorithm so this is driven by the this command called r.temporal aaa algorithm and right now it is set to 1. so if you want to switch back to the default method that would be r temporal a algorithm zero and that um that falls back to the normal uh the reason that we use that is just the for sharper definition uh on the tire for example and on the dirt it pops out a bit more but more specifically more interesting in the interior of the car so if i change that back to zero uh we can see that on the the console here we're losing a bit of that crispness on the text so if i go back to one it's now much more clearer and it's a nice new feature of 426 that doesn't cost too much on the performance that's awesome david thanks for that so what i'm going to be doing is showing you how you can import in your own assets into the sample project and begin hooking them up to some of the logic that already exists in this project so let's go ahead and jump into the configurator by clicking the play button now if you guys have played around with the configurator i'm sure you've realized there is a ton of functionality built into this sample project so for today's presentation we're going to focus in on a few key pieces of functionality primarily we're going to be looking at how the animation system works and how it's triggered by these hot spots all right so here we are inside of the id4 project that we got from vw and what we want to do is get this vehicle added into the sample project you'll notice that the id4 is already added into a blueprint so everything for the id4 lives on this bp export id4 blueprint so all we have to do is navigate to where that blueprint lives in the content browser right click on top of it go to asset actions move migrate so when we bring that up it's going to give us a list of everything that's going to get migrated across all the materials all the textures all the static meshes any logic that lives inside of that blueprint any lights that were in that blueprint basically all this stuff is going to get migrated over to the car configurator sample project so we'll just hit ok it's going to basically ask where do you want to send it so we're going to put it in the configurator content folder and we'll just say select folder now it's going to give me a pop-up saying that some stuff already exists here they're both using the automotive material packs so some of these are redundant so we'll just say okay you can see that it's copied across a bunch of files so if we jump back into our car configurator project and we go into this cars folder into the export folder you can see there is the blueprint for the id4 so all we have to do to see this is just drag and drop it into our level right now the way this is set up the id4 has all of its geometry and one blueprint and the audi has all of its information in another blueprint and that's not really what we want ideally we want to get the id4 geometry into the audi blueprint because that audi blueprint has a lot of the logic for the way the car configurator works so we don't really need the id4 hanging out like this we're gonna we're gonna do this in a slightly different way so we can go ahead and delete that id4 and let's jump into the audi blueprint and start getting it set up so that the audi can go away and the id4 can uh can take over to place all right so let's go ahead and find that audi blueprint by going to the content folder going into car configurator car blueprints here you can see we have the audi a5 blueprint as well as the control rig for the audi these are two of the three things needed to get the animation working on the car configurator the third being the focus point blueprint which is the hot spots that you saw on the doors kind of the trigger events that start the animation off so we'll be looking at that a bit later on in the presentation let's go ahead and jump into that a5 blueprint and begin exploring what it does so in the event graph is where the animation logic kind of happens so something like a door animation is really straightforward it's just interpolating between two different values if you look at something like the convertible top the logic is a bit more complicated but it's still kind of the same idea where there's a rest state and an execution state and it's interpolating between those two values now the animation logic even for things like the dynamic materials for the hmi are also handled in this event graph so you can go ahead and explore around this guy so ultimately what happens is this animation information drives the control rig which in turn moves a skeleton that carries these static meshes that relationship between the static meshes and that's moving skeleton is also handled and set up inside of the audi a5 blueprint so if we jump over to the viewport you can see that obviously the audi lives inside of here there's all the static meshes and if we look in the components on the left-hand side here you can see that there are a bunch of fixed points for all the different hard animated areas of the vehicle so something like the left door has parented below all that the static meshes for the for the for that audi so this is really great because what this means is if i want to set up the id4 i have these nulls or these anchor points that i can just parent the id4 static meshes underneath and all the offsets of those local pivots is handled for me automatically so this is really pretty awesome you also notice that the control rig is inside of this blueprint and that control rig matches you know these these points these points are actually positioned by that control rig so if we go into the control rig and just search for bone and we display the bones of that skeleton you can see that you know they they literally line up if we grab this left front door here you can see that that pivot point is actually exactly in the same spot as that that you know control rig of that that bone for that door so all that information is basically being generated inside of this audi a5 blueprint so what we want to do is we want to hide or get rid of the static meshes for the audi because we're you know we want to get this id4 hooked up so i could just take these static meshes and delete them the problem with that is there's some dependencies inside of here and if i start deleting that stuff i'm just going to have to go through and troubleshoot and find all the things that got broken in the blueprint code so instead of deleting them what i'm going to do is i'm going to hide them and because i want to be able to turn the audi on and off and the id4 on and off instead of hiding them um you know in a simple way i'm actually going to create a little bit of blueprint code that lets me make a switch to turn that on and off and it's it's actually only a few nodes to do it and i'll show it to you now so now we're going to go ahead and we're going to tag all the audi static meshes so that i can easily select them with a blueprint node so i'm going to search in my details panel for tag and i'm going to go and select everything that's below the skeletal mesh and i'm going to deselect all my anchor points because i do not want to tag those i only want to tag the static meshes all right so with that done i'm just going to go over here and click the plus sign next to array elements and we'll call this a5 and we'll go ahead and we'll compile the blueprint okay next step is to search by right clicking in the construction script and look for get all components by tag we're going to set the tag name to be a5 and we're going to switch the component class to be a static mesh component so now that we've done that we're going to go ahead and we're just going to pull off the array and do a four each so we're going to run through that array and we're going to hook this up so that it executes we're going to run through that array and we're going to set visibility on everything that's in that's been tagged with a5 so we'll just do a set visibility and we'll grab the array element into the target and the next step is to just promote the visibility variable and we can give that a name it's a bit more meaningful so we'll delete that and just call this car visibility and let's just go ahead and drag that over here we'll compile this as soon as i compile it under default values you're going to see that that car visibility is now now turned off so if we go back to the viewport you can see that we've obviously gotten rid of most of those static meshes if i turn this on they're going to come back but you'll notice that the top is still there those convertible tops are still there and if we search for top you can see that these are not actually static meshes they're they're different so what we want to do is we want to get those also have their visibility turned off so we can just drag those out and we'll drag out the one from the cinematic and we'll just put those into target also so now if we go ahead and compile this and look in our viewport you can see that everything is hidden now here's the thing that's kind of cool if we expand this down you'll notice in the editor also everything is is is turned and visible now i have the audi b5 blueprint highlighted and you can see that a few few variables are actually disposed or exposed under default but my car visibility is not exposed and the way i if i wanted to modify that in the actual editor without having to go to the blueprint all i have to do is turn on that eyeball to make it visible and recompile it so as soon as i do that you can see that it's going to show up and i now have the ability to modify that directly inside of the editor which is uh which is pretty cool so let's go ahead and let's let's play this back now notice what happens when i play it back you're going to immediately see some issues um actually let's stop that guy and let's turn that off and then hit play all right so car is not visible but the top is and when it comes to a rest spot here you're going to see as soon as that ui came on the seats popped on and the car door popped on so what that's telling me is something is dynamically changing that visibility attribute so what we're going to do is we're going to turn on hidden in game which is just another another node that we can add into our blueprint that will basically make sure that those guys do not display in runtime so we'll go back to the control construction script and we'll just branch off set visibility and we'll search out for hidden and there's a couple of hidden in games so we don't want to set actor hidden in game we want to grab this one at the top here that just says set hidden in game pretty straightforward now again we need to give it the array element as a target as well as the tops so we'll just wire those guys together and this new hidden variable we want to have driven from that same car visibility but it needs to be the opposite so that's really simple to do by dragging out and searching for not bullying and wiring the not bullying into that and now if we go ahead and we compile this and kind of shrink this guy down and hit play you're going to see that it's going to behave the way that you would expect so nothing's visible we do our camera fly up everything looks cool the little ui element comes on where we used to see the seats in this in the door panel show up and it's all still invisible so we've got our audi hidden now which is awesome so let's go ahead and stop this from playing back so the next thing that we want to do is we want to add into this audi a5 blueprint the id4 geometry so that it is now part of this same blueprint so let's go ahead and do that this is actually the easiest thing we're going to do probably today all right so this is a copy and paste operation so we're just going to go ahead and browse and get the id4 blueprint opened up click on this guy so here we'll hop into the viewport and you can see there's the id4 geometry so what we want to do is we just want to hold down the shift key to close this down and then expand it back out to make sure all the children are exposed and we're going to scroll to the bottom and just shift select all of these we're going to right click to copy it and then we can jump back over into the audi blueprint and then again right click to paste in all that information now this will take a couple of seconds to process so don't be alarmed if it takes a little bit of time all right cool so we have the id4 pasted in and we'll just kind of zoom out here a little bit and you'll notice that the bloom is very strong in this uh in this blue current view and that's because there's a couple of incandescent parts on the car the headlights as well as a tail light so i'll just switch this to unlit to make it a bit easier to see and the next thing that we want to do is we want to make sure that the id4 is positioned in the exact same space that the audi was so we're going to go ahead and turn that audi back on with that switch that we built earlier and with that done we're going to position the root of this id4 just forward a bit and then down a bit so that they line up with each other okay so that's looking pretty good so let's just go ahead and save this and compile it and we're ready to go next we need to export out the audi a5 blueprint that includes the id4 geometry as well as the skeleton to maya to create a new skeleton that's going to match the id4s fixed points so go ahead and select the a5 in the outliner zero out any transforms that might exist in the level and then with it selected go to file export selection to save out the fbx file all right so here we are in maya with the fbx file imported and the first thing i'm going to do is just unparent a couple of things to make it a bit easier to work with so we'll grab the id4 as well as that root node for the skeleton and the mesh that's bound to that skeleton and we'll just do a simple edit unparent and with that done i can go ahead and hide the display of the audi just so it's a little bit easier to work with so we've got this skeleton inside of here that came across that was originally set up for the audi and we want to change its fixed points to match the pivot point of that wheel so it's really simple just grab that node hit my up arrow key to jump up one level hold down my shift key to add to my selection and then we're going to run a modify match transforms match translate as soon as i do that you can see that pivot point now jumped up so i'm going to do this for all the wheels really quickly again just holding down my shift key to add a selection and then using my g key to repeat my last function inside of maya so up arrow key shift g you know just takes a second to do this all right so with that done the next thing i'm going to do is set up this door and i'm not going to do the whole car because uh you know we're quickly running out of time i'm just going to kind of position these guys where i think that the pivot point might be appropriate for that so we'll just push that just into the inside edge of that door and kind of scooch that guy back a little bit we can kind of do the same thing for the uh for the trunk you know grab that guy translate it up push it forward a bit to where that hinge might be all right that looks pretty good and then the final thing that i want to do is add in a new bone for this back door so we'll just jump over to our top view i'll grab my joint tool i'm just going to click and then hold down shift to draw a straight line hit return to complete that function and then we'll just kind of push that guy up a little bit sort of where i think it should should be kind of push it back in ever so slightly and what we want to do is we want to parent that into that cluster of bone so we'll just hit the p key to do that so with that done we're going to go ahead and grab the context of this so we'll just ctrl c that and paste it into the name of this guy so that it's not joint 51 and we'll call this a rear door l rear door perfect so now that we've done that the next thing that we need to do is export this skeleton out to uh to become our new id4 skeleton so we'll grab our root and it's very important that you grab the piece of geometry that has the skin cluster associated with it for the skeleton to come across into unreal correctly it needs to have a piece of geometry bound to it so that's just a little tiny helper it's basically a little tiny cluster of you know one polygon essentially that's that's going to help us with that so we'll do an export selection and we'll save this out as an fbx file okay so here we are back in unreal let's just go ahead and undo that rotation and translation offset that we did to get the vehicle back kind of to where it should be i'm going to go ahead and turn off the display of that audi we don't really need to see that anymore so we can just turn that guy off so we just have the id4 in our in our scene now so let's go ahead and jump up to our content folder we'll go into car config and we'll go into car and convertible top and this is where the skeleton lives so this was the original audi skeleton if we double click on this guy and sometimes if they don't show up you just need to say bones display all hierarchy that might be such as only selected so that is the audi skeleton so what we're going to do is we're going to import in and you can just kind of pull this up here a new skeleton so we'll just do import and if we go into id4 here we've got this guy this b version that we just saved out so when you import this in you want to set it to be clear you don't want to overwrite or modify a skeleton that already exists so we're going to bring the skeleton mesh in we're going to import that in and you're going to want to make sure that you have uh you know use t reference set to uh zero and then also update skeleton reference so make sure both of those are turned on and that's set to none we'll do an import all it's going to go through and bring that guy in which is kind of cool and now we've got this new skeleton and you can see that we now have obviously that trunk is in a different position and we've got this new this new uh this new bone that we added in for uh for this guy which is which is pretty cool all right so with that done let's go ahead and just uh save this guy out all right so let's jump up to where that control rig lives so we'll go into car blueprint and double click on the audi control rig so the way this is set up is pretty straightforward we've got in our rig hierarchy we've got the audi skeleton as well as a control system these controls are handles that are basically going to drive those bones with forward kinematics and that's all set up in this forward solve so essentially you can see that it's going through and it's saying let's find the um you know root control and have that drive the transform of the root bone so it finds the root and the chassis hooks those guys up and then after the chassis it runs through and does a for each loop to hook up the control rigs on all the children so it's a really simple forward solve for the majority of what's going on in the car there are some things that are a little more complex for the front wheel turning as well as the simulated rotation of the wheels so these are also little rigs that are slightly more complex and then obviously the trunk pistons are the most complex it's worth noting that there are some nodes in here like all the stuff on the right this is kind of dirty laundry it shouldn't have been included in the project it's not being used as well as these nodes on the top so really the majority of what we're looking at is really this kind of forward solve for the doors and the trunk and all the stuff like that and then there's a setup script that we'll talk a bit about more in just a second so what we want to do is we want to get a control rig that's going to drive the id4 skeleton so we're going to switch the skeleton from the audi skeleton over to the id4 skeleton as soon as we do that the bones disappear until i hit the compile button as soon as i compile this they're going to come back in but they still look exactly the same as the audi skeleton so what we need to do is we actually just need to select one of the bones in the rig hierarchy and give it a little kick by going to refresh skeleton mesh and selecting the id4 skeleton mesh so as soon as i do that you can see it's updated and it's giving me this new bone here for the rear door you'll notice that it's not selected and that's because it doesn't have a control handle driving that so you also notice that it didn't update the fixed position for the wheels that were out a little bit further and that that kind of trunk thing that was a little bit taller so to get these control handles to update the position we need to re-run the setup so by doing that it's going to basically automatically snap those guys to the correct position as soon as i wire in this setup execute into into the setup event so as soon as i did that you can see the trunks now up there the wheels kind of got pushed out which is which is really cool and it does exactly what we what we needed and what we wanted so we'll compile that guy so the next thing that we need to do is we need to go ahead and create a control handle that's going to drive the position of that rear door so we're going to literally just take the left door which is this guy right here and we're going to duplicate it so we'll just hit ctrl w and we're going to give this a new name and we're going to match the name of that rear that rear bone so instead of ctrl 2 we're going to call this control and then instead of front we're just going to switch this over to rear and as soon as i hit return you can see that it added in that and snapped to the correct position that new that new you know that new handle that new control handle which is exactly what you'd want now the final thing that we're going to do is we're going to come down here to our our forward solve and we're going to tell it to propagate to the children bone and by doing that now when i rotate that handle that we just added you can see that bone goes along for the ride so with that done we can go ahead and compile this and we've basically set up the you know the control rig we got it in the extra bone and all the offsets are now correct for the id4 so it's that simple to uh to modify the way the skeletal structure works in a control ring so the next thing we want to do is get the id4 hooked up to that custom control rig that we just set up so this is easily done inside of the audi blueprint so we'll just double click on that to jump into it and what we want to do is we want to make the doors and the trunk go along for the ride of these placeholders that already exist in the skeleton so you can see this left front door is obviously aligned and ready to go so what we're going to do is we're just going to go expand out our list of our geometry that lives on this underneath this id4 root and we're going to grab this left front door and we're just going to make a simple uh relationship to those a simple parenting operation so we'll just grab that guy and we'll continue to scroll up here and we're just going to drop it underneath that left front door placeholder so with that done you can see we've now got our left front door and it's going to be underneath that that point and it's going to go along for the ride of that control rigs for the left front door pretty straight forward so we're going to do the same thing for the for the tailgate so we can just actually to make this one go a little bit faster we can search for tail and we can just grab uh we can just grab this tailgate right here and just drag and drop that underneath the trunk pivot point and you can see that's now parented underneath that correctly looks pretty awesome it's ready to go so the final thing that we're going to want to do is we're going to want to get this rear door added in and if you remember we added this bone in so if you look underneath the skeleton there's no rear door null waiting to carry that rear door geometry along for the ride so we need to add that that functionality into this skeleton mesh so how do you do that well it's pretty straightforward the first thing you're going to want to do is go into that skeleton mesh and you're going to want to make sure that it's set to be that id4 um skeleton mesh that we imported in previously so we'll just go ahead and we'll set that up so with that done the next thing that we're going to do is we're going to add in a new a new placeholder a new static mesh component so if with the skeleton mesh highlighted go to add component and click on the static mesh and we're going to add a new static mesh node into the hierarchy we'll give this a name that's a little bit more meaningful so we'll just call it l underscore um i think we'll call it rear door so now that we've done that the final thing that we need to do is just make this uh hook the socket up to this so go over to socket in the details panel click on the search button and if you just search for l i think underscore rear door is going to come up so we've done that so as soon as i do that you can see that that point now snapped exactly to uh where you'd expect it to be attached to that bone on the control ring so we now have our placeholder that we can use to parent in the hierarchy of this left rear door so let's just again drag this up to the to that placeholder and drop it on there all right so we'll just parent that in and now you can see that our left rear door is underneath underneath that and everything's set up and ready to go so the next thing that we need to do is start to add in the logic that's going to make this back door move all right so here we are inside of the event graph that has all the animation logic and what we're going to do is basically match what's happening on these front doors onto the back door so it's just a few nodes to create the animation state so the first thing that we're going to do is jump into the animation variables and we're just going to duplicate out so it's made up of a few things a bullion a little branch and then two different rotational values that get set so the first thing that we're going to do is we're going to say is left door open and we're going to duplicate that so with that duplicate made let's go ahead and just give this a name so we'll just call is left or open rear and we can go ahead and drag that into our scene and we're going to do a get on that guy then the next thing that we're going to do is we're going to drag that same is left door open rear and do a set so we're going to pull off the get and do a knot so i'm not bullying to get the opposite effect of that and with that done we can go ahead and just sort of wire these guys up to sort of trigger that in there the next thing that we want to do is grab this left door scale this is a float that basically adjusts the speed of the animation so again we'll just highlight that hit ctrl w to go ahead and duplicate it we'll call it left or scale rear again we can just drag that up and we're going to go ahead and do a set on that guy and we'll wire this in and we're going to grab this animation speed variable and just duplicate it and pull it up here and sort of wire that in so the next thing that we need to do is get this branch so we'll just highlight that duplicate it with ctrl w and make these connections so that's starting to look pretty good so the final thing that we want to do is go ahead and set the rotational values to um to the two different states the open and the closed state for the door so we're going to grab this left door rotator again hit ctrl w to duplicate that we'll call it left door rotator rear and we can go ahead and just drag that out and we're going to basically do a set so we can expand this out split that guy so that's zero zero zero for the false state and then we can control w that to go ahead and grab the true state and we're going to set this to a value of 45. so the next thing that we want to do is now that we've got our little logic that's going to basically set our two different rotational values we want that to drive the control rig that's going to carry those static meshes along and that's done in a slightly different area so if we kind of pan across here over to the side you can see there is this anim car part section and this is doing a the pre-forward solve so you can see that this is constantly running and it's grabbing um the control rig so the left front door control so we're going to take this and we're going to duplicate it and what we want to do with this is make this drive that left rear door so remember when we created that um in the control rig so it was called left r-e-a-r door so we'll do that and then the final thing we need to do is hook up those same variables that we just made so we'll grab our rotator and we'll do a get on that guy and put that into the target we're going to grab the scale and we'll do again do a get put that into oops scale and then the final one that we want to grab is the um is it open so we'll grab that and we'll say get on that guy and wire that in so now if we just put this into the path so that they execute as it kind of flows through we should be set with that so the final thing that we need to do now is go ahead and have the execution of this get triggered you can see the trigger down here is being driven by this switch so we need to add a new enumerator into this switch for the rear door so that's easily done by jumping back out into the content browser going down into car and oops let's go back in here to shared i'm sorry and go into blueprint and here you can see the car animation enumerator so we're going to add a new enumerator in and we'll just call it uh door rear we'll go ahead and we'll save this out now the other thing that we need to do is we also need to hook up the audio event there's actually some dependencies between these so sometimes if the audio event hasn't been added to the trigger effect it will actually not work um so let's just make sure that we go into the car audio data also and create a new channel for that for row six we're going to have it trigger out rear door and then we're going to give it the door open cue so we'll say uh the open sound and then we're going to give it the door exit closed sound so we can save that out we can save that we'll jump back in here oops let's bring that audi back up here and expand that out and we'll just grab this rear door and we'll bring it up here and kind of go over into this guy wire that in double click on this just to add a little node in there just to kind of tidy that up so this is all looking like we've got it set properly let's go ahead and let's compile this and see if it actually works or if we get a warning or an error so we'll click the compile button so we got a little warning that popped up here and this happens sometimes when you duplicate these rotator attributes these rotator variables sometimes when you duplicate them for some reason they just they just don't work out so if you just give this a new name we'll just call it door 2 and then hit recompile on this you'll see that it's going to clear that warning out the logic's all fine everything's good but sometimes when you do duplicate those you got to give them a little kick to kind of clean them up so and if you wanted to you could actually go back and and change that name back to whatever you want after you after you've given it that kind of that kick to refresh it so um just a little little tip there so with that done let's go ahead and jump out to uh out to the editor and let's hit our g key to uh display everything so you can see that we've already got a focus point right here that was done for the driver door we want to add in another focus point for that rear door and that actually lives in this same shared blueprints folder so we're going to drag out the bp focus point and i'm just going to drop it on the door of the car there and then we can kind of zoom in on that guy and the arrow you want to have facing out sort of toward the camera something sort of like that the final step is going to be to specify what animation this focus point wants to drive so we're going to have it drive door rear and i think with any luck this is going to go ahead and not work let's hit play and see what happens all right so there's the id4 animation's looking good we're flying in you can see pop-up of our little focus points it sort of just sort of happens right there and if we click on the first door it opens up it does what you'd expect we can close that guy back down let's give this guy a shot so there's the the back door that we hooked up with that extended uh control rig and then of course we've also got the ability to open up the uh the trunk again based on the modification that we made to that to that control rig so that is uh that's the basics of how you can go ahead and set up the uh the control rig to work with the id4 so we're gonna finish off by checking out how we can go ahead and start to wire in some of these paint color swatches right now none of that stuff is hooked up and i'll walk you through the process of getting that set up on the id4 it's really pretty straightforward so to change the color of the vehicle is actually quite simple because it's all set up using the variant manager so let's check out how to do it if we jump up to the shared directory and bring up the car variant you can see the variant managers checking out and doing a few things it's changing the car paint on the audi as well as some of the options like the wheels and the different trim levels so what we want to do is we want to capture the car paint properties for the id4 you'll notice that the actors have already been populated into the car paint variants and for the audi we're managing a variety of static meshes with their material assignments so it's quite a bit of quite a bit of static meshes inside of here to make it a bit simpler on the id4 what i've done is in the id4 i've added in a custom variable that gives me one slot that's going to assign the material to multiple static meshes so what we want to do is we want to add that car paint variable into the properties that the variant manager is watching and keeping track of so that's simply done by clicking the plus button next to the properties with all the actors selected so we're going to bring up the list of properties that we could capture and tell it to start managing car paint so we'll hit select on that and now all i have to do is go into each one of the colors so we'll pick tango red and if we kind of move this up here a little bit and just scroll that up if we go down to the bottom of the list here you can see we're now looking at the car paint and all we need to do is browse to where that cherry paint is by clicking the browse button and you can see it kind of takes us right to that directory and what we're going to do is we're going to map this cherry paint into the car paint attribute by clicking the arrow so as soon as we do that you can see the names change to register that change in the variant manager all you have to do is double click on the swatch so now the car has been changed to the uh to the red carpet pretty straightforward so we're gonna do the same thing for the black let's go ahead and just grab that audi we'll go and we'll browse to the to the black car paint select that guy come over here and click the map button that little arrow and then double click on the variant to go ahead and set that so now we've got a red id4 and a black id4 so let's say we wanted to add in another swatch into the variant manager it's actually super simple to do all you have to do is right click on top of the variant that's uh that's in there and say duplicate now if we scroll down to the bottom of the list you can see that we have another black so we're going to change the name of that to yellow we'll go in here and we'll click on the actor we'll grab this car paint and we're just going to assign to that the yellow the id4 yellow car paint and again double click on the swatch to go ahead and set that color now to make this look a little bit better i'm just going to kind of fly in here get really close to that right click on top of that and say set from viewport so that we have a nice little swatch for that guy so with that done we can now close this down and let's play it back and see what we have so we'll start up the configurator in runtime we'll fly up onto the id4 you'll notice that it takes the red variant it's always going to take the first variant in the list if you wanted to change that just reorder the color swatches as we fly around this obviously all the other stuff that we hooked up is still there and still doing its cool stuff and if we go to the paint swatches we can now really simply change between the variants that we took the time to go through and and set up for the id4 so that is basically it for today i'd like to thank you all for taking the time to watch the webinar um i hope you guys enjoyed it we will be doing a few tips and tricks based off the product configurator so make sure you stay tuned to our communication channels to find out when those tips and tricks are coming out cheers everybody
Info
Channel: Unreal Engine
Views: 57,590
Rating: undefined out of 5
Keywords: Unreal Engine, Epic Games, UE4, Unreal, Game Engine, Game Dev, Game Development, real-time car configurator, digital showroom, configurator sample project, variant manager, automotive, real-time, real-time ray tracing
Id: vsqxVJQla2Y
Channel Id: undefined
Length: 53min 11sec (3191 seconds)
Published: Fri Apr 23 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.