CodeChicken Lib 1.8.+

CodeChicken Lib 1.8.+

141M Downloads

CCModelBakery needs way to set sprite per quad

MrTJP opened this issue ยท 11 comments

commented

Currently, an entire model can only be baked with a single sprite. This is a problem for models that use multiple TextureAtlasSprites for each of their quads.

commented

There is, setSprite, as long as the quad has finished baking the sprite can be set.

commented

oh, ModelBakery

commented

Easiest way i see is baking each individual part of the model in CCQuadBakery using the start and end vars and just combining the list afterwards.

commented

Hmm. Since each UV has a Tex index, we could provide a multi-icon transformation and grab icons from that as the model bakes

commented

I gotta go out for a bit but when i get back ill whip something up.

commented

Also, it looks like it it is used for(in vanilla at least) re-texturing baked quads in BakedQuadRetextured

commented
commented

We would need a custom UV Transform to obey the current vertex index and change the UV transform based on that, thoughts?

commented

I was thinking a separate UVTransform like BakingIconUVTransform and a Builder for the transform, that essentially builds a start > end vertex range = UVTransform.

commented

The builder would be used to throw errors if ranges overlap.

commented

Yea that sounds good to me. I'm not exactly sure what the texture sprite object in the quad is actually used for (considering UV is part of the vertex data), but it's probably worth making sure they match the actual texture being applied.