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

Geometry with different TexMatrixAttribs won't flatten #1392

Closed
janEntikan opened this issue Nov 12, 2022 · 1 comment
Closed

Geometry with different TexMatrixAttribs won't flatten #1392

janEntikan opened this issue Nov 12, 2022 · 1 comment
Labels
Milestone

Comments

@janEntikan
Copy link
Contributor

Calling flattenStrong() on geometry where different texture scales are set won't flatten, where I expect them to be applied to the UVs.
It appears this only happens to models with multiple TextureStages.

from direct.showbase.ShowBase import ShowBase

base = ShowBase()
root = render.attach_new_node("root")
model = loader.load_model("cube.bam")
model.clear_model_nodes()

for i in range(1,5):
    c = model.copy_to(root)
    for stage in c.find_all_texture_stages():
        c.set_tex_scale(stage, (i,i))

root.flatten_strong()
render.ls()
render.analyze()

cube.bam here is the default blender cube with a texture applied and exported with blend2bam using gltf (thus producing a TextureStage setup for pbr). If you change cube.bam to models/smiley the flattening seems work fine.

examp.zip
(Zip file containing above example, the cube model and a texture.)

@rdb rdb added the bug label Nov 13, 2022
@rdb rdb added this to the 1.10.13 milestone Nov 13, 2022
@rdb
Copy link
Member

rdb commented Nov 13, 2022

Classifying as bug. Panda refuses to flatten a TexMatrixAttrib onto a texcoord set if this texcoord set is used by more than one stage, which is sensible if the stages have different texture transforms, but if they have the same transform, then Panda should be smart enough to detect this and apply it anyway.

@rdb rdb closed this as completed in fe94e43 Nov 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants