How to import MagicaVoxel model into UE4 (2)

Foreword

When the static model of MagicaVoxel could be imported into UE4, I was not satisfied again. By default, the "car collision doll (fog)" of the third-person blueprint is incompatible with the voxel painting style in the scene. So, I thought of creating a third-person blueprint with the voxel-style characters I built myself, so I carried out again Try (who is called UE4's MarketPlace does not have a friendly plugin like Unity).

Before I start, explain the tools I use: MagicaVoxel, Maya2018 (In fact, I do n’t want to use it, but Maya has a strong advantage in some bone processing. Blender should be able to, but I did not find a relevant solution, If you are willing to provide relevant methods, please leave a message in the comment area) , Mixamo, UnrealEditor 4.20.3 (some of the setting options and the interface of the blueprint node may be slightly different from the higher version of UnrealEditor, the specific changes are official Update documents shall prevail)

text

Mixamo is a free online bone binding and bone animation production platform owned by "One Tease" (Adobe) . It is our main tool for building model bone animation this time. The website is www.mixamo.com . Before using Mixamo, please first Register an Adobe account and use it after logging in to Mixamo.

1. Model building

When building a character model, please keep the character model in a T shape with arms extended , as shown in the following figure: (no intention to offend, just do it at hand, looking like an early type Jim with a psychoactive skeleton and a mourning banshee antenna ( Dog head))

(Very ugly, please ignore)
Mixamo's bone binding is only suitable for the character model with an initial T-shape, so be sure to model it this way.
After the modeling is completed, please export the model as a model in obj format for our next modification and upload. After the export is complete, we can see these three files in the corresponding path:

Next, please open Maya, then click "settings / preference" on the "Window" tab , and select again "Preference" (Preference) , click "Settings" (settings) , as follows, please select z for the upper axis:

Since the upward axis of UE4 is the z axis, and Maya defaults to y, please synchronize the two.
Then create a new scene and drag the obj file exported by MagicaVoxel into the scene. In MagicaVoxel, the modeling origin is not located inside the model, and this will happen after importing into Maya:

At this time, please select the "center" pivot in the " modify" tab (prerequisite: please select the model first), which is conducive to the next operation, and then rotate, translate, zoom in, zoom in is extremely important Because the model generated by MagicaVoxel is extremely small in any 3d environment (even in UE4), if you do n’t zoom in, all the bone nodes after binding the bones will almost overlap, which is not conducive to the subsequent operations. Please be sure to enlarge (give a reference value for magnification: between 23 and 25). After processing, export it to obj format. Be careful not to confuse the original obj file. It is recommended to store it separately. At this time, please package the three files exported by Maya into a compressed package in zip format, so that we can upload to Mixamo.

2. Mixamo bone binding and character animation

First of all, please open the Mixamo link given. I will not elaborate on the next upload steps. As long as you speak a little English, you will not worry about how to operate (laughs). You may find that the uploaded model is black during the upload. Don't worry about this problem, we only need to follow the normal steps. After the binding step, please don't hurry to click on the animation effect of the next window. Please download the T-shaped model with the bones bound together:

this pose is really bad, But we can see that the bone binding is very successful:

Download the format please select fbx format, posture on the choice of T-Pose , download it, then select your favorite idle, running animation, one each for download (please tick in the animated weights page InPlace option), note download skin Select the without skin (that does not include the model) option, and remember the total number of frames for each animation. It is recommended to write the number of frames in the file name for later operations.

3. Skeletal animation

Ok, let's hand over all the work to Maya. Please create a new scene, drag the downloaded character T-type fbx file into the scene, select the model and press the H key to hide the model. We only operate on the skeleton. Then click the new bone node icon in the equipment (the bad translation of the official Chinese version, the English version corresponds to Rigging) , and click on a scene on the scene plane to generate a bone node (please change the mouse option to select at this time ) Set its name to Root (the node names of the three fbx models must be the same), and set its translation attribute to 0, 0, 0 (the same is true for the next two animations). To ensure convenient operation.
Then please click on the Hips node of the bone, and at the same time long press the shift key to select the Root node we created, at this time, press the p key to achieve binding, as shown below:

After binding successfully, please export to fbx format and overwrite the original fbx file with the same command. Next, please perform the same bone binding operation on the other two animated fbx files that have been downloaded, and also export them to fbx format, but please set the animation end time to the number of animation frames before exporting (the end of the second step is for everyone to remember The number of frames per animation). as follows:

Both blanks are filled with the total number of frames of the animation. After all the above processing is done, the next step is to import all three resources into UE4

4. Resource import

Please first import the T-shaped model into UE4, and import it according to the settings as shown below:

Next, you can import the remaining two animation files (please select the bone as the bone of the T-type model when importing). After the import is completed, it will be as follows:

The T-Pose.png file is not the file generated after the default import, which I added later, because when importing the model, UE4 did not correctly import the texture file of the material, and the model was "lifeless" white, so I imported the texture in the original obj into the shader and it was normal. After opening the imported model, you will find that the model looks terrible, and it feels like gummy candy (of course, if you like this Q bomb feeling, please ignore it (laugh)), then please put the material in the material ball The gloss and roughness resolution can be set to 0 and 1.
The next step is to create an animated blueprint and a third-person blueprint.

5. Blueprint creation

Please create a new animation blueprint in UE4's content browser, select AnimInstance as the parent class , and select the skeleton example automatically generated by the imported model. Next, please create a new "mixed space 1D", select the same skeleton, and then operate in the mixed space editor as shown below:

Next, please link the nodes of the event graph in the animation blueprint according to the connection method as shown below:

The animation chart in the animation blueprint is set as follows: The

next step is to create the relevant third-person blueprint, which is not described in this section. The successful creation effect is as follows:

Conclusion

At present, the model of MagicaVoxel is imported into a more difficult part of UE4: it has been overcome to create it as a manipulable character. Later, I observed the details of the model specifically. There are no voxel models in some places. For example, the shoulders and crotch are the most obvious. In the relevant discussion forums, some game development guys are asked. They generally divide the character model into several parts and then stitch together. I put it up and put it in Maya or Blender for bone binding. It seems that if I want to achieve a perfect result, there is still a long way to go (program ape goes further and further on the road of TA (laughs)).
If you have any questions about the above steps (especially the part that binds the bones), you can go and see this video of a station B: ( https://www.bilibili.com/video/BV1Zp411d7E4 ), up talk Very fine and no extra words, I also learned some things from him, I highly recommend watching.
With so many words coded, we do n’t ask you to “Like, Collect, and Recommend”, just ask you to indicate the source when reprinting, and hope that our article can help more small friends,ご ざ い ま し た! (All touch, Ali Gado relied on Saimaxi!)

Guess you like

Origin www.cnblogs.com/Pixel-Xi-an/p/12675001.html