BlenderTools
BlenderTools copied to clipboard
Send to Unreal - Add option 'Use Existing Unreal Materials'
Expected: if materials with the same names as in Blender are found in the UE4 project, those materials should be assigned to the imported model. Actual: a new material (with "1" appended to the name) is created and assigned to the imported static mesh. Addon: Send to Unreal Steps to Reproduce the Problem: Open static mesh with multiple assigned materials > clicked Pipeline > Export > Send to Unreal Error Log: None OS: Windows 10 x64 Addon Version: Send to Unreal 1.6.0 Blender Version: i.e. Blender 2.83.3 Unreal Version: i.e. Unreal 4.26.0
@wadim-al this is the same underlying issue as this. Currently a reimport respects the uasset data first, ans the fbx data second. There needs to be python exposed on the unreal side that will allow a call to reassign the material for both static and sketatal mesh uassets. https://github.com/EpicGames/BlenderTools/issues/7 Ill close this and let you follow that issue
@james-baber To be sure you've understood right: expected was that UE had materials already created, and the mesh had never been imported yet, the first import should have found existing materials in UE and use them, but not recreate materials from mesh, if the names are equal. Have you understood my issue as described in this answer? Should I edit or add a new one with "improvement" type? This behavior is described there https://forums.unrealengine.com/development-discussion/rendering/45141-can-you-automatically-assign-materials-to-geometry-on-import?p=452615#post452615
@wadim-al how do you propose the tool would infer which material to assign, just search the entire unreal project for a material that matches the name? Or just within the folder it is importing to? If the whole project, that can be quite a large query depending on the project size. I propose that unless the material is linked to the uasset, then the new material coming from the fbx import should replace the existing materials if the 'materials' option is true. Otherwise not. However that would still require the UE python call to change material on both static and skeletal meshes #7
@james-baber I refer to functionality existed in 2015y - see the referenced post. I do not know if it still exists in non-blender fbx import flow in the latest UE4, was it removed, or just bugged out or whatever. As Send to Unreal is used with both small and large projects, it just can have an option to use "full project search on material import" or to use only recursive subfolder search. In my workflow I don't see any value of creating m_head1 on importing my model when m_head already exists (and is a complex UE4 material, because after that I spend time reassigning all 18 materials from m_matname1 to m_matname inside the UE4 mesh editor/viewer. The goal is to make the flow automatic and to save time. Currently the flow is too slow. I don't need blender materials, because I've already made all materials in UE4. Also, blender materials are much worse than UE4 ones, so I need only material names from the blender, so I do not understand why blender materials are used at all by default. Also, the first export from blender to UE4 causes the materials to recompile, and as I'm having other bugs or problems, I have to delete everything and re-export. This results in spending time in shader recompilation for those unneeded white materials. And not exporting materials is not an option, because I thought the functionality existed in 2015 still works, and because I have to reassign materials after every re-export after cleaning up because of bugs.
UPDATE: https://unreal-engine-issues.herokuapp.com/issue/UE-39020 here it says it is fixed, but the code adds "1" to material. Is this an engine error or this addon's problem?
This is a bi-product of the unreal FBX importer that creates that extra_material1. What send to unreal does is just trigger existing unreal functionality via python. If you want an option like 'Use Existing Unreal Materials' that can be toggled on that would be possible to add once that python call to change material assignments is available. That is also needed to fix #7 . I will change this to a feature request.
Thanks!
Just want to 2nd this feature request. Hopefully it'll be added once it's possible to do so.
I believe this is already possible: https://forums.unrealengine.com/t/can-you-automatically-assign-materials-to-geometry-on-import/33295/3
Its just really poorly docummented (I havent found any official docs on this tbh)
I believe this is already possible: https://forums.unrealengine.com/t/can-you-automatically-assign-materials-to-geometry-on-import/33295/3
Its just really poorly docummented (I havent found any official docs on this tbh)
This link was already referenced to show the expected behavior, and no, it doesn't work like that with Send to Unreal, which is why this issue is opened.
I believe this is already possible: https://forums.unrealengine.com/t/can-you-automatically-assign-materials-to-geometry-on-import/33295/3 Its just really poorly docummented (I havent found any official docs on this tbh)
This link was already referenced to show the expected behavior, and no, it doesn't work like that with Send to Unreal, which is why this issue is opened.
Ah sorry lmao 😅 Didnt see the link.
Maybe this is due to some missing FBX import settings in the addon? Ive never actually used this myself, Ive just known its a thing so Im not sure what settings are necessary for this to work but theres some materials tab when using the UE4 fbx importer UI