Proposal for removing TexFace in 2.8x #51382
This proposal is to drop the ability to store per-face images, (known as TexFace).
TexFace doesn't fit into modern shading pipelines since any material can use any image,
it means materials can't be drawn in batches and need to context switch.
(or we need to prepare material & image combinations in advance).
TexFace is only used by Blender Internal and optionally the Game Engine (when 'Face Textures' is enabled).
Since Blender's drawing code is being re-written, 2.8x is a good opportunity to drop tex-face support.
Ideally we could remove TexFace entirely, however it contains texture coordinates which are used for placing particles (see:
These UV's are stored in either quad or triangules (
so their stored indices wont align with triangle tessellation (
MLoopTri 's for example).
Longer term we can check on version-patching particle data so point into the triangulated indices
(which can still detect quads so particles UV coordinates can be applied as-if to a quad).
But this is a bigger task.
The other main user of per-face images is texture baking.
This code can be made to use materials images (as Cycles does already).
- Remove the
MTFace(keep only the UV's).
- Remove tex-face data for polygons (
This way we can remove per-face-image support from the user perspective, and later remove
MTFace as part of a refactor with no user visible changes.
The down side is that some Blend files do use single material and TexFace to assign images, which will be lost by this change!
We could generate materials as part of versioning code, but from what I've seen images are often assigned from UV mapping, (setting an image in edit-mode assigns face-images), so this could be very annoying too.
So this proposal is to remove them without attempting generate new materials.
+1 for removing TexFace. It has caused a lot of issues for the BGE too.
Other issue from TexFace worth mentioning is that this Image pointer enforces a loop over all faces of all meshes that have that data layer when managing data-blocks (in
BKE_library_foreach_ID_link()) - which is potentially horrible! ;)
Agree with current plan, indeed keeping the UV part for now even for tessface will make things simpler, and don’t think we need to bother about converting those images into materials either.
+1 for simplicity.
People don't use TexFace mapping these days because it's not compatible with Cycles, external render and game engines. If people really need to bring back old BI scenes to 2.8 they can download 2.79 and convert them easily. We might think of providing official addon for 2.79 that do this automatically.
@BartekMoniewski There are already converters included in Material utils. They probably need more work though as they don't produce desirable results all the time, and are not supporting all the material types and the code needs refactor. Still, they could be used as starting point.
Committed to 2.8 branch:
- Remove image member
- Remove all non UV members from the struct.
- Entirely remove
MTexPolystructure and layer type, drawing and update UI & version patch files.
Deleting a branch is permanent. Although the deleted branch may exist for a short time before cleaning up, in most cases it CANNOT be undone. Continue?