So I was using the triangle mesh softbody that used the .linkGeom() command to apply colors and textures like shown in the manual. The applied textures however, don’t receive the rotation of the softbody which results in a weird texture display where the texture stays in one spot and gets cut off. When i rotate the body through the .setHpr() command, the texture follows the transform.
I tested if the softbody shares its transform states with parented nodes but only seems to share it’s position and not rotation / scale. How would I fix this issue?
It would be hard to show you my code as it is made up of various classes in different scripts. But here is how I make the softbody and add the geometry to it (scene = render; scene.bulletworld = bulletworld):
I don’t think it’s difficult to write a minimal example, but I noticed a problem, you’re using a texture coordinate generator. This approach is unlikely to work, you should use the texture coordinates of the geom node.
I tried using mapped UV models with textures but it still had the same result. Keep in mind I still applied the texture from the model onto it manually as it didn’t apply any texture at default / automatically like normal model loading does. I also checked the models geom’s texture coords and they all matched to a replicated model loaded normally.
Interesting, it works for me, perhaps you interpreted the bullet examples incorrectly. In 8 hours I will be able to provide you with a working code sample.
I looked into the geom’s UV coords of the softbody and found that every patch’s coords are set to
(0.0, 0.0). Its weird how the models geom’s Data2f did not go over to the softbodys geom data.
your code works for .bam files, but I am also trying to get other formats like gltf to work as well.
when I load something either than a .bam, this error appears:
geom = model.node().modify_geom(0)
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'panda3d.core.ModelRoot' object has no attribute 'modify_geom'
is there a way to allow other formats to also work with the softbody?
You have misinterpreted this circumstance again, there is no difference what format the difference is in how you find the geom object in the hierarchy.
This answer provides an example of how to get exactly the data that is needed, but for this you need to know the hierarchy.
I just tested again and added random UV data to the geom that is sent to make the softbody and the textures now show in a way. All I need right now is a way to extract UV data from a loaded model.
Anyway, you’re off topic. So it has nothing to do with the soft body. The author of the examples for bullet used geometry generation to visualize the body, but not as a way to create visible geometry.