当前位置:网站首页>After UE4 is packaged, mesh has no material problem

After UE4 is packaged, mesh has no material problem

2022-07-07 15:42:00 WhiteTian

Original article , Reprint please indicate the source .

Preface

UE4 Sometimes I will encounter Material Lost problems ( All are DefuaultMaterial Grey material ), It is normal to run under the editor , If you meet , Then you can stop here and see if there is the answer you want .

Solution

1> First confirm whether the resource is Cook

First confirm whether your material has been quoted , In fact, this purpose is to confirm whether your resources are Cook, That is to confirm whether it has been hit by your Pak Inside .
How to confirm :
Look at the picture below , Corresponding to your own project Saved/Cooked/…… Under the table of contents , Find the name of your missing material , See if there is .
 Insert picture description here
When we get here , You should be able to confirm whether you have not been Cook 了 .
without , Confirm according to the following , If any , Don't look at this title .
In fact, the reference relationship is confirmed , Not only for material loss , Anything else uasset May not have been cook On .
First, the engine cook Resources are the following principles
1) You want to pack umap All the referenced resources in it will be cook, Are static in umap Stored in it , For example, you write dynamic in the code Load A resource , At this time, the engine does not know the reference relationship when the resource is packaged . So you need to follow the following steps to specify
2) Specify additional cook The catalog of , In project settings Packaging->Additional Asset Directories to Cook Specified in the path array , After adding it here, your resources will be Cook here we are .
And notice that there is another one next to it Directories to never cook( This path means you don't want to cook Add your path here ), Of course, the resource confirmation you use cannot appear in this path
 Insert picture description here
If your resources are not Cook, Then follow the above steps before packing .

2> Make sure the path of your material is in Chinese

stay 4.25 In engine version , Unfriendly to Chinese resource support , image 4.26.2 It's all right . such as UMG Give up Image Set up a picture ( Chinese pictures or pictures are in Chinese path ), It is found that the setting is not up , English is ok .
I just found 4.25 There is a problem with Chinese , Of course, please confirm whether the engine version you are currently using also has such problems .
If it exists , See if your material is in the Chinese path , If it is , Then basically put it in the English path .

It's better to use English , First, norms , The second is to reduce the time for error finding .

3> The material Usage rules , Confirm what type of resources you have , Then go to the corresponding material Usage match

Every UMaterial There's one on every street Usage An array of properties for , This data determines what your material can be applied to UE In terms of type
( For example, whether it should arrive Skeletal Mesh Bone mesh /Instanced Static Meshes Static grid instances, and so on ) as follows
 Insert picture description here
The principle is actually what your material will be applied to UE In terms of type , If you use this material Usage There is no choice InstanceStaticMesh But you used InstanceStaticMesh On , Then there will be no material .

If you are in a similar situation , You might as well open the material to have a look usage here .
 Insert picture description here
For example, the car in the figure below is packed without material , Resources are also cook 了 , There is no Chinese path . But the material attribute is checked Skeletal Mesh, But I did it through Brush Brush the car into the scene , This type is actually AInstancedFoliageActor, In fact, it is the common function of brushing vegetation . Finally, it corresponds to InstanceStaticMesh On , So I'm in every shader of the car Usage Added in InstanceStaticMesh The option to . Then the packaging effect is right .
 Insert picture description here

4> Load external Pak No material

This article introduces loading a separate Pak There is no material inside

thank you , It's not easy to create , Great Xia, please stay … Move your lovely hands , To a Focus on Go bai
ღ( ´・ᴗ・` ) finger heart <( ̄︶ ̄)>

原网站

版权声明
本文为[WhiteTian]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/02/202202130611316070.html