I don’t speak English, the following content is translated by Google. Possibly confusing syntax, please excuse
test UnrealEngine Version: UnrealEngine-4.27.2-release (source code version)
I am a UE TA, I need to develop check tools to get the number of uvChannels, so I use the blueprint node test, the following is the blueprint test process:
used “EditorUtilityWidget” test:
This is the linking process of the blueprint node:
after running:
But after generating lightmap for StaticMesh, the result is as follows:
The view and UVs display two uvChannels, but the information printed by blueprint is one.
why?
I tried to import a simple sphere model FBX, and the printed information is correct when the lightmap uv is not generated
When I generate the lightmap uv, there is a problem with the number of uvChannels obtained
This problem has troubled me for a long time. After reading a lot of source code, I found a piece of code in the function “EnforceLightmapRestrictions” in the “StaticMesh.cpp” file. I feel that the function “GetNumTexCoords” is what I need, so I Try to create a new node to get the number of uvChannels
New blueprint function:(EditorStaticMeshLibrary.h and EditorStaticMeshLibrary.cpp)
Links to new nodes:
finally got the result I needed:
Finally, I want to know if my new node has fixed the bug of uvChannels, or is it caused by a problem with my operation, or is this the bug of GetUVChannels???
I don’t know much about the underlying logic of UnrealEngine. I don’t know if such a modification will cause any problems. I hope to get a more accurate answer from the developers of UnrealEngine.
Finally, thank you for reading my question
Supplementary note: I have tested both UE_4.27.2 and UE_5.1, the same problem