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

UvScrollNode does not work on TextureStages generated with panda3d-gltf #134

Open
BartGunshot opened this issue May 28, 2024 · 0 comments
Open

Comments

@BartGunshot
Copy link

BartGunshot commented May 28, 2024

UvScrollNodes do not apply to texture stages on GeomNodes generated by this converter. Demo is attached. Tested with Panda3D 1.10.14 using Python 3.10

This seems to be because UvScrollNodes only apply their texture matrix transform to the "default" TextureStage https://github.com/panda3d/panda3d/blob/adb92428856853019583f398d27c5d34e44a9343/panda/src/pgraphnodes/uvScrollNode.cxx#L119

The converter creates TextureStages via the TextureStage(str) constructor.

texstage = TextureStage(str(i))

This seems to generate TextureStage that differs from the default in a way that the compose does not apply. I've attempted to simply rename the texture stage generated by this converter to what the default is named ("default") but this does not work. I've had to recreate the TextureStage via TextureStage.getDefault() and then re-apply the sort, mode, texcoordName, and even the name. This worked.

A fix for the converter would be to use the TextureStage.getDefault() method of creating a TextureStage and then rename the texture stage to the index. Perhaps its also worth looking upstream to see why the constructor and the getDefault methods of creating TextureStages differ.

when running the demo script, press "Space" to see the working fix applied to the texture stage. Press "alt" to see what happens if you just rename the texture stage
demo.zip

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