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

all textures dissapear when one mesh gets invsible #78

Open
Displee opened this issue May 10, 2021 · 1 comment
Open

all textures dissapear when one mesh gets invsible #78

Displee opened this issue May 10, 2021 · 1 comment

Comments

@Displee
Copy link
Contributor

Displee commented May 10, 2021

Currently there's a dirty bug where textured meshes turn black (their texture gets disposed somehow?) when the visibility of one textured mesh is set to false:
IIuM5R3MZM

This is most likely a threekt bug.

@Displee
Copy link
Contributor Author

Displee commented May 10, 2021

I'm currently using the following workaround after setting a mesh to invisible:

(mesh.parent as Scene).children.forEach {
                        if (it is Mesh) {
                            val material = it.material
                            if (material is MeshBasicMaterial) {
                                material.map?.needsUpdate = true
                            }
                        }
                    }

This will cause all the textures to re-upload, making them visible again.

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