-
-
Notifications
You must be signed in to change notification settings - Fork 624
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
Double-sided material property not applied to objects loaded from gltf #3515
Comments
Thanks for reporting this issue, @maria-korosteleva! |
Hi @falkoschindler, oh, sorry, it should work now! |
@maria-korosteleva The problem you're experiencing is most likely caused by nicegui loading gtlf's into a group that contains all of the gtlf's models. This would mean that in your case the code is trying to change the material of the group instead of the object itself (see here). |
@fabian0702 seems to be right, the GLTF scene is wrapped in a nicegui/nicegui/elements/scene.js Lines 269 to 278 in be557ff
Do you have any idea how we could embed the file differently? Apart from that: The |
@falkoschindler Because gltf files can contain multiple objects, it can be difficult to change the material of just one object. Also, nicegui currently expects objects to be added to the scene immediately and the actual object data to be added later, which the current workaround solves. One possibility would be to change the callback to overwrite the initially created group with the scene instead of adding the scene to it. However, I'm not sure how elegant this would be. |
Ok, I see three problems:
Problem 1 can be easily fixed. Anyway, I wonder if there is a simpler solution somewhere in three.js. In PR #3549 for instance, we basically only had to change one flag to make groups draggable. Maybe there's something for letting child objects inherit their group's material? |
Description
Hi all
I'm trying to display a garment 3D object, loaded as gltf. The material in my glb file is one-sided, so I tried to use the material settings from niceGUI to convert it to a double-sided material as follows:
However, the displayed object is still one-sided (the back of the garment visible through the neck and sleeve holes is not rendered):
Here is how I expect it to look like:
Seems like currently, material setup in gltf object takes precedence over the additional material setup, but I would expect it to be the other way around, for the material properties that are explicitly set
Here is the glb file:
Configured_design_3D_sim.zip
The text was updated successfully, but these errors were encountered: