Skip to content
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

Layer Masks Set to Erroneous Value Regardless of Import Settings #100

Open
stultvox opened this issue Mar 18, 2024 · 0 comments
Open

Layer Masks Set to Erroneous Value Regardless of Import Settings #100

stultvox opened this issue Mar 18, 2024 · 0 comments

Comments

@stultvox
Copy link

When a VRM model is imported, with only layer 1 selected, the model loads as if only layer 3 is selected.

At first, the only thing I noticed was that the lighting was not behaving as expected on the imported VRM models.
When I iterated through the MeshInstance3D objects in the VRM and printed the values for each layer, that's when I found it was all set to 3.
VRM_LayerBug

I did attempt reimporting the model with different layer settings. None of them seemed to make a difference in the outcome.
I also recalled that I had previously imported a gltf with the layer 3 set to true. So I imported another gltf file with the layer set to 1, and then imported a new VRM model, and it was still set to 3. So I do not believed it's picking it up from other imported gltf files.

I was able to work around the issue by iterating through all the layers in each MeshInstance3D for each VRM model, set them all to false, then set layer 1 (the desired layer) to true, placing that code in the ready function for the scene. It's not ideal, but it does work.

all_children = get_all_children($Characters)
for _i in all_children:
    if _i is MeshInstance3D:
        for _y in range(1,21):
            _i.set_layer_mask_value(_y,false)
        _i.set_layer_mask_value(1,true)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant