-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] Model randomly is rendered wrong. #8
Comments
As a way of testing, I saved the output of my model generator function, and every 1 second passed that output to the plugin, everytime the rendered model varies, like the pictures above. |
New Info, this only happens in the editor, in a packaged game it does not happen. |
Hmm this is really interesting. So the same input renders a different output each time. Can you please test this using UE4.27? This is an useful information to have. If it's confirmed an only UE5 issue then we should check how the data is layed out in UE5 or if we need to populate also another buffer. |
Yes, it is happening in Ue 4.27 as well: Also, this is the code that loads the skeletal mesh:
|
Not sure if it could have to do with hardware, but my machine is running Windows 10, with an i9 10900F (20 cores), GTX 1060 6GB and 32 GB ram. |
Since this issue only happens inside the editor, I tried taking a look in the "WITHEDITOR" sections of the plugin, to see if I could pinpoint where the issue happens, but I didn't understand clearly all these parts, would you care to explain a bit what it is that we have to do differently when inside the editor, versus the packaged game ? I also tried commenting out all those blocks, but that just crashes UE4/5 haha Also, was this made based on the editor's skeletal mesh FBX importer ? |
Essentially the |
There you go: |
Hi, have you solved this issue? I found that the bug is caused by not initializing local variable ‘Weights’ defined in Line 429 in RuntimeSkeletalMeshGenerator.cpp |
No, I haven't, did you solve it ? After reading your comment I tried to call Weights.Empy() on line 430, but that didn't fix it. |
Oh I see, so if a vertex doesn't not have any bind information it fails. and reset all the influences for each weight using this: Weight.InfluenceWeights[InfluenceIndex] = 0;
Weight.InfluenceBones[InfluenceIndex] = INDEX_NONE; it should be something like: for(int i = 0; i < Vertices.Num(); i++)
{
for (int InfluenceIndex = 0; InfluenceIndex < MaxBoneInfluences; InfluenceIndex++)
{
Weights[i].InfluenceWeights[InfluenceIndex] = 0;
Weights[i].InfluenceBones[InfluenceIndex] = INDEX_NONE;
}
} |
I tried that this morning, but it did not solve the issue; Also, in my example all Vertexes are bound to bone 0.
|
@Fransferdy I think maybe it should be written like this: for (int WeightIdx = 0; WeightIdx < Weights.Num(); WeightIdx++)
{
for (int InfluenceIdx= 0; InfluenceIdx< MAX_TOTAL_INFLUENCES; ++InfluenceIdx)
{
Weights[WeightIdx].InfluenceBones[InfluenceIdx] = INDEX_NONE;
Weights[WeightIdx].InfluenceWeights[InfluenceIdx] = 0;
}
} It is not only happens in the Editor, try to use different models. Before fixed, I imported a simple cube in Packaged game, this bug occurred, too(with low possibility). |
I can't see what exactly is the difference between the code @LawlerZhang posted, and the one I posted (except for this variable: MaxBoneInfluences, so I think this constant is the game changer MAX_TOTAL_INFLUENCES) |
Reopening here since I realized I wrote the issue in the wrong place.
Hello, thanks for providing this plugin. After testing for a while, I think the issue is with the plugin, but if it is not I would be glad to know how this is being used elsewhere.
So I started to use this plugin 4 days ago, I have been working to make a model procedurally.
At the end of generation the function save the Model as a test.off file, call the plugin GenerateSkeletalMesh and return the result, which is then loaded in an Actor via blueprints. The blueprint run at Event Begin Play.
The output teste.off file is always correct, you can load it in any tool to check that it is the same everytime, but the output from GenerateSkeletalMesh randomly changes. The function calculates the normals, tangents, uvs, set colors to (0,0,0) and flipnormals to false, set every vertex to the 0 bone.
My function outputs a cylinder/capsule model.
Sometimes the model is rendered correctly, but many times it is rendered in very weird patterns. On my side the result output is always the same, but in the engine the end result changes from play to play in bizarre ways.
You can see the code and the teste.off file here:
I also ported the plugin to UE5 (but the same issues happens in Ue4.27)
Can visualize the teste.off file here:https://3dviewer.net/
https://github.com/Fransferdy/creaturecreator
The text was updated successfully, but these errors were encountered: