Import Maya Alembic into Unreal (WITH MATERIALS CONNECTING AUTOMATICALLY) - 2021

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hi amy dilberetta here very often you want your animation to look cool for your shore wheel but you don't want to spend time rendering it out in arnold redshift and the more technology evolves then the less reason there is to go and render stuff out in arnold anyway and this is when you might find yourself rendering animation in a real engine however very often you find yourself in the situation for which you can't simply do an fbx export to send stuff into unreal and you will have to use an alembic cache also known as abc the problem is that when working in unreal alembic caches often are rotated the wrong way around and do not automatically inherit materials in this video i'm going to show you how to properly orient your caches and how to make sure that unreal engine assigns the material automatically to your geometry bits we will start by introducing the alembic and fbx format then we will see how global axes are treated differently between mayan unreal then we will see why in unreal your abc animation may not move through space the way it does in maya we will fix the rotation offset after which we'll finally see how to export materials to unreals in a reliable way and how to store the material names in the olympic cache so that when you import the lmb cache into unreal the materials will be automatically applied in the process we will see the alembic export and import settings that will guarantee a smooth workflow as a bonus we will see how to batch rename objects in a real engine if you are interested just follow along before diving into the details of each step however i'm going to quickly go through the right settings just for those who are more familiar with the format and issue the summary is going to last only two minutes if this is not your case and you're not familiar with the topic just skip this section and go over to the next chapter if none of this is news to you and all you need are just the settings here comes the low down when exporting alembic from maya make sure you enable uv right make sure you have right face sets set to on this will make sure that whichever shading group is applied to whichever phase is stored as a name into the alembic cache although the shader won't be stored the name will be i suggest you enable world space to and if you use multiple uv sets i suggest you enable right uv sets as well the data you need in unreal will be there and then unreal will assign the right shader provided you take some steps first of all you need to export all of your shaders fpx would be a good format but make sure that the rig you are exporting doesn't break the exporting halfway through if you don't know what this means i suggest you watch the full video once you exported your shaders from maya import your fpx file containing the shader into unreal in unreal you have to make sure that the name of each material will be the same or the name of the shading group of your material in maya the shading group not the material the material you have in unreal must carry the same name of the shading group and if your materials carry name spaces because your rig is referenced like in this case you see that we have a namespace there that means that in the olympic settings you have to enable the strip namespaces options so that the namespace will be removed from the name of the shader my suggestion would be to make sure that the material name will be the same of the shading group plus a token at the end and then once in unreal we can batch rename them so that they match the shading group and the alembic importer will find them and then unreal will assign the right shader the alembic import settings in unreal are as an import type geometry cache experimental in particular you want to leave on the flatten track flag that you find on the geometry cache then you scroll down until you find materials and in here you want to enable find materials under conversion settings under rotation x you have to set the offsets to 90 degrees you click on import you wait because it's alembic so you have to wait you're done if any of these isn't clear i really suggest you watch the whole video so let's get started and see in detail what i've just described the alembic import plugin in a real engine is an experimental tool which lets you import olympic caches into the game engine an olympic cache also known as abc is a formal geometry cache that lets you transfer animation between different software packages regardless of the animation rig this is made possible by storing the position of every vertex in space and on every frame of the timeline in practice this format is designed to work regardless of the software and any rig which might be controlling your geometry which is a great feature to have when your pipeline relies on more than one piece of software for this reason geometry caches have been the traditional way of transferring things like cloth simulation between different packages as well as animation data between the animation and lighting and rendering departments the main advantage of caching is that this technique lets you export character animation you would not be able to export via the fbx format the standard interchange format employed to import and export animation in games i am planning to record a video on this topic too as far as my experience goes the disadvantages of caching are mainly free first of all alembic does not export skeletons the second disadvantage is that the resulting files can be fairly big resulting in longer importing times and bigger projects and the third disadvantage i see is that olympic cached geometry does not store the shaders meaning you will need to reapply them at a later stage although i will show you a useful technique to get the shaders to be reapplied automatically once in unreal when your character does not support export through the fbx format and if for whichever reasons you still have no access to pixar's universal scene description format abc may well become your only choice to export your animation to unreal engine or any other software you are going to render in it is relatively easy to check if your character rigs support fbx export if you select your geometry you will see that in the channel box under the input section of your character you will find all the inputs of your character if you find in there any deformer which is not the skin cluster or a blend shape node you will know that the fbx export won't work the way you expect also if you added a poly smooth operation into maya to add tessellation to your geometry but you did that after the skin cluster so you see the skin cluster is at the bottom and the poly smooth is at the top that poly smooth won't be exported as an fpx in practice the only deformers that fbx really supports are skin clusters which you use to bind your geometry to the joint system and blend shape deformers which are often employed for facial animation or corrective blend shapes especially on the shoulders and elbows and knees so for instance in the case of rocket girl this rig you're saying here which in my opinion is a good rig you will see that if you select the geometry you will have the skin cluster that's supported by fbx but then you will have ffd one two and whatever now ffts are generated by lattice deformers and as such they won't translate into fbx's so in practice if i want to keep exactly the same pose i have right now in here i will be forced to do an alembic export i suggest you run these checks on your rig to see if it supports fbx exports remember that the fvx format only supports blend shapes and skin cluster as a way to deform geometry any other deformer you add on top of it won't be seen by the fbx exporter and it will lead to unwanted results so let's see how to export this gizmo from maya to unreal first of all let's have a look at the geometry as you see the geometries composed by a bunch of objects a lot of them in fact and then there is a group above them all which rotates furthermore the z arrow of my gizmo is facing the z-axis of my maya viewport and the rotation happens around the y-axis let's keep that in mind because it's going to come in handy later on so first we select all the geometry we want to export we go under cache olympic cache export selection to alembic if you can't see alembic cache in the cache menu it's because the alembic plugin was not loaded in maya so you want to check that abc export and import are loaded and set to auto load maybe so i'm going to close this thing cache let me cache export selection to alembic by default maya will bake the time slider so it will store every single frame which is visible on the time slider the moment you run the export but we are really interested in seeing more settings so we're going to scroll down until we find the advanced options and here you will see that if we export with the default settings we are going to have a bit of a problem so i'm going to click on export in unreal let's right click into the content browser going to import to game go grab the file and as an import type we are going to employ geometry cache as for the other settings we are not going to change anything notably the flattened tracks is set to on and we will get back to this setting later on i'm going to click on import i'm going to drag this this mode there in the viewport and you see that the first thing i notice is that the z axis is pointing up that's bizarre because in maya is pointing forward the one thing we have to keep in mind is that different software might have different axes so while in maya the vertical axis is the y one in the real the vertical axis is indeed the z axis but let's see if the animation plays so i'm going to hit play in unreal go find the gizmo wait a little bit and it's not playing i wonder why is that it's not playing back into maya there is one thing we need to keep in mind by default the alembic is storing information in local space that is relative to the next available parent of the hierarchy you have selected the next available parent of this hierarchy is gizmo underscore geo and gizmo the score geo is indeed animated see the value changes and there is animation however that's the one node which is being animated the geometry nodes which are underneath as far as the children are concerned the children are not really moving so unless we specify to alembic that we want to store the world space transformations this object won't animate if the animation is only decided by the parent node so i'm going to select the geometry go into cache align the cache export selection to alembic again and in the settings down there i want to make sure that i have world space set to on my documentation explains the settings for the alembic exporter and it specifies that by default the nodes are stored as local space so we are going to turn on the wall space we are going to overwrite our gizmo back into unreal i'm going to delete the gizmo and i'm going to right click import to game and go grab the new export just for safety i'm going to re-import from scratch and if i go and check you see that the animation actually plays through so world space versus local space is an important issue whenever exporting to another software if the objects you want to export are under a parent node that moves you want to make sure that your exporter whichever format you're exporting in supports world space and actually writes it out the rotation issue is kind of easy to fix you just rotate it back by 90 degrees and now you see that it's flat on the floor which is i guess okayish but one thing typical of unreal is that you can reset the position of an object so that it goes back to where it was designed in our case you see that our translation values are different from zero while in maya the object was really the center of the grid in unreal if you click on the yellow arrow next to the channel box it will reset the values so you will see that our gizmo goes back to the center of the grid which is nice the problem is that if we reset the rotation as well the gizmo will go back to being rotated the wrong way which we don't really like we would like to have the rotation set to zero but the gizmo rotated the right way in order to do so you can add a pre-import offset and you do so by right-clicking on the object in the content browser go ray import and you scroll down until the very end until you find the conversion values and the rotation in x you input 90 and from now on the default zero value in the scene of your object will be its import value plus 90. let's go import and now you see that the gizmo we have in the scene when it's rotated to zero in x it is actually in the right position that works very well it's a bit ironical that if you go under the presets and you set them to 3d studio max it actually gives you the value you need for maya i just don't use the presets just in case the presets are changing something else i'm not aware of maybe they're just changing the values in here i really have no idea so now we have solved both the animation issue and the rotation issue now let's ramp up the complexity of this demonstration and let's apply this workflow to a fully fledged character in this case rocket girl rigged by vm comics i want to solve the shading issue i want to be able to transfer the shader as well because now as you have seen the gizmo came out gray and also i want to import the animation and i want to have the shaders automatically applied to the animation first of all we will need to export the shaders into unreal now i am aware of an exporting workflow that makes you select the geometry go export selection export the fbx with whichever preset supports geometry exporting like for instance the autodesk media entertainment one save it somewhere where you can easily retrieve it enjoy all the warnings from the fbx and in unreal go import to game and import the shaders whichever settings you employ in here in the fpx importer doesn't matter too much it seems like the shaders are there i'm a bit suspicious however about the fact that only part of the geometry came through but hey once looking at the geometry stack one can see clearly that there is a poly smooth operation above a screen cluster there are several ffds lattice deformers so they won't go through so probably the missing geometry bits are due to the fact that this rig really isn't compatible with an fbx export however if you check the hypershading maya for this rig you see that we have so many shaders and in unreal we only have a fraction of those so my understanding in here is that sometimes during the exporting bit or the importing one some of the data was not imported or exported correctly because the errors that the fbx generated were stopping the procedure so this stuff in fact is pointless because it's not the complete data we need so i'm going to delete it and i'm going to try another way which in my opinion is a bit more solid so in my i'm going to select the geometry just as if i wanted to export it with alembic then i'm going to hit ctrl d like delta on the keyboard to duplicate it unlock all the channels delete the history and just unparent them shift p just so that they are there i'm going to make a group you don't really need to make a group but i'm doing that just to demonstrate that is indeed a different piece of geometry and now i'm going to select the duplicated geometry please notice that the geometry now is very clean there is nothing in the input section of the geometry so there is nothing that can impede the import or export process even if partially and i'm going to export the selection overwrite the old file enjoy the usual errors and back in unreal import it whichever settings the default settings will work issues there but there are geometry issues and in here you have the complete geometry set which we don't really need so i can delete it and all the shaders known excluded save for the particle cloud the shader glow and lumbered one which however we do not need they are the standard default shaders in maya so you see that by duplicating the geometry of your character before exporting the shaders and the geometry as fbx you have more security of getting the shaders you actually need now if we check the unreal documentation you see that they're real guys they seem to suggest that when we write out the alembic file we need to enable uv right and right face sets in order to get the materials you see it says you will need to enable right face sets if you plan to create materials during import in a real engine as material are created based on blah blah blah blah blah what based on face set names that's interesting the fact that materials will be created based on found phase set names means that we will have to do something in maya to create those face sets and in order to create those face set names what you need to do is to select the faces that you wish to apply a material tool to make your life easier you can hit shift greater than and shift less than to increase and decrease the selection and assign the material to them so the material is no longer assigned to an object but it's assigned to the faces of an object now i do not advocate the idea of assigning materials to faces because in my opinion it makes it a bit harder to work with shaders and also if you change the topology that's going to affect the way that shaders are applied but this is the only way i have found to get the alembic to automatically recognize the material on this rig i already have assigned the material to all the parts so that you don't have to watch me doing it you have seen how to do it on one part and that's enough if i have an animated scene like this one where the character runs through space and the rig is referenced and is referencing the rig we already set up i can simply export this as an alembic the face sets are inherited from the rig whenever you create any new material in maya the material gets created with its node and a shading group node which also controls the way the material is rendered so the face name sets are linked to the name of the shading group not that of the material so in my scene i have renamed the material so that the material carries the same name of the shading group plus a token the idea is that once i will be in unreal i will remove the underscore mtl token and that will give me the name of the shading group if i keep this naming convention as i work with maya then i'm sure i will have a smooth workflow once in a real however i can already hear you moaning about the fact that we have to rename a bunch of shaders manually in unreal by pressing f2 changing the shader and so forth and i would be moaning with view in fact i don't really like this kind of stuff so we need to download a tool which is called a bl utility from art station i'm going to leave a link in the description of this video this tool will give you the ability to battery name items in the content browser why this is not a default feature in unreal beats me i really don't know anyhow as you download it you will find a zip archive which you need to decompress and surprise surprise into the decompressed folder you will find an unreal project which we are going to promptly open because we will need to migrate now this tool from its project to our project it's a good idea to close our project before doing the migration boy the things one person has to do to battery name some items in 2021 but then again thinking of it maybe it's just me being ignorant and if you know a better way to butcher name things in unreal let me know because that's the only way i know how to do it and in a real sure enough you find these scripts in there those we need so in unreal we just right click on the editor utility blueprints folder and in the menu we scroll down until we find migrate and this is the stuff we need to migrate and we're going to need to specify a project onto which we want to migrate and the project is going to be our unreal project the one we are testing and you will need to point the immigration to the content folder so i'm going to copy the content folder path paste it there select it migrate so now we can close this thing and then we open the project onto which we migrated the scripts the scripts are here that's nice we select all of our shaders we right click and we find in the menu scripted actions and in there we have renamed multiple files if you can't see scripted actions is because you have to go under edit plugins and in there you type in script and you should have editor scripting utilities set to enabled that will make sure you will see that tool now right click scripted actions rename multiple files and under replay string we want to find the suffix that every shader has which is underscore mtl and we input that in underscore mtl we replace it with nothing because we want the material names in unreal to carry the name of the shading group in maya which is the same of the material without the mtl token so back to maya it's the big time we can finally select the geometry of our character going to cache alembic cache export selection to alembic and in there into the settings we want to make sure that uv right is set to on right face sets is set to on world space is set to on for double measure we can set to on right uv sets in case your character is working with multiple uv sets it's not the case for rocket girl so it won't change anything for me but if your character has multiple uv sets you might need this one and then one thing that we really have to do with this character is the strip namespaces option why do we need that because as you see from the reference editor this character has been referenced meaning that there is a namespace in front of every node name so if i call the namespace rg stands for rocketgirl you see that the name in the channel box is changing and similarly if i go into the attribute editor and find any shader you will see that the shader has changed the shader is carrying the namespace rg colon followed by the name of the material now if you're going to export the alembic cache without stripping the namespaces so this way what will happen is that the shader will be called rg underscore rg tertiary blah blah blah similarly you see that the shading group has the same issue it's called the first like the namespace and then like the material so this won't line up with the name of the materials we have set in unreal you see we don't have twice rg but this is an issue which we are going to solve by stripping the namespaces in the settings of alembic and then exporting the selection and you may be wondering why did we not strip the namespaces when exporting the fpx and it would be a legitimate question but if you go and check the file we used to export the fbx you will find out that there is no namespace in there because this is the original rig file in fact if i go into the reference editor you see it's empty so we didn't need to strip the namespaces in here because we were exporting from the original rig files so there were no namespaces involved now let's go back and do this export once for all let's do it for humanity let's do it let's do it let's hit that export selection button now and wait exporting is done and if you check the file size we are at a respectable 250 megabytes not bad that's about one megabyte per frame so in a real we're going to right click go import to game go find the file and import it the settings are going to be as import type geometry cache experimental we are going to keep the sampling as it is if you change the frame start and end you might get issues when playing with sequencer in my experience flattened tracks needs to be kept to on and if we scroll down to materials we have to tick the fine material box to on and under the conversion settings the rotation x has to be set to 90 degrees if we click on import we wait a little bit there you go the importing is done it's still compiling shaders but it should be there any second now i'm going to put it into the viewport and guess what we have in here we have the character with all the shaders and we didn't have to do a single thing it's already connected there and all the slots have been automatically assigned i think it's hard to top this one and if i press play the animation is running i think we just stopped this one before we leave let's have a look at one of the importing options that has caused me and other people a lot of troubles until now before doing so however i want you to remember that the material slots right now are in the number of 13 material slots so there is one for each shader if you wanted instead to have one material slot per each piece of geometry what you would have to do would be to go under the import settings of the alembic and under the geometry cache section you want to disable flattened tracks by doing so we will ask unreal to create a material slot for each piece of geometry i would say even more than those you see here in the list and if i go into import now and i ask unreal to re-evaluate its choices once unreal has re-evaluated its choices you scroll down the element list and you see we have now 26 elements that's twice as many as we had earlier on which means that now we can control shaders you see for individual parts of the body as opposed to pear shader so flattened tracks can be a useful tool you just have to decide what's your approach as usual and then act accordingly and this concludes our tutorial i hope you have found this useful and if this is the case please consider liking subscribing and hitting the notification bell and remember luck helps those who prepare hmm you
Info
Channel: Animation Pandemic
Views: 37,023
Rating: undefined out of 5
Keywords: 3d animation, learn 3d animation, networking in animation, professional networking, meet other professionals, networking for introverts
Id: U5rMw6G1KIE
Channel Id: undefined
Length: 26min 31sec (1591 seconds)
Published: Wed Jun 30 2021
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.