Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2018-09-06 15:28:14 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2018-10-10 18:43:44 +0300
commite65784a0519e25e9ca560ab63758287cea45f123 (patch)
tree2452488152b951d029f68b34f20803254066b27b /source/blender/render
parent468474a653c976615306254dfcc33a85a0b872a1 (diff)
Python API: add loop triangles access, remove tessfaces.
Loop triangles are tessellated triangles create from polygons, for renderers or exporters that need to match Blender's polygon tesselation exactly. These are a read-only runtime cache. Tessfaces are a legacy data structure from before Blender supported n-gons, and were already mostly removed from the C code. Details on porting code to loop triangles is in the release notes. Differential Revision: https://developer.blender.org/D3539
Diffstat (limited to 'source/blender/render')
-rw-r--r--source/blender/render/intern/source/bake_api.c45
1 files changed, 0 insertions, 45 deletions
diff --git a/source/blender/render/intern/source/bake_api.c b/source/blender/render/intern/source/bake_api.c
index f60105e029d..12c13bcac81 100644
--- a/source/blender/render/intern/source/bake_api.c
+++ b/source/blender/render/intern/source/bake_api.c
@@ -86,9 +86,6 @@
#include "render_types.h"
#include "zbuf.h"
-/* Remove when Cycles moves from MFace to MLoopTri */
-#define USE_MFACE_WORKAROUND
-
typedef struct BakeDataZSpan {
BakePixel *pixel_array;
int primitive_id;
@@ -393,27 +390,6 @@ static bool cast_ray_highpoly(
return hit_mesh != -1;
}
-#ifdef USE_MFACE_WORKAROUND
-/**
- * Until cycles moves to #MLoopTri, we need to keep face-rotation in sync with #test_index_face
- *
- * We only need to consider quads since #BKE_mesh_recalc_tessellation doesn't execute this on triangles.
- */
-static void test_index_face_looptri(const MPoly *mp, MLoop *mloop, MLoopTri *lt)
-{
- if (mp->totloop == 4) {
- if (UNLIKELY((mloop[mp->loopstart + 2].v == 0) ||
- (mloop[mp->loopstart + 3].v == 0)))
- {
- /* remap: (2, 3, 0, 1) */
- unsigned int l = mp->loopstart;
- ARRAY_SET_ITEMS(lt[0].tri, l + 2, l + 3, l + 0);
- ARRAY_SET_ITEMS(lt[1].tri, l + 2, l + 0, l + 1);
- }
- }
-}
-#endif
-
/**
* This function populates an array of verts for the triangles of a mesh
* Tangent and Normals are also stored
@@ -433,10 +409,6 @@ static TriTessFace *mesh_calc_tri_tessface(
unsigned int mpoly_prev = UINT_MAX;
float no[3];
-#ifdef USE_MFACE_WORKAROUND
- unsigned int mpoly_prev_testindex = UINT_MAX;
-#endif
-
mvert = CustomData_get_layer(&me->vdata, CD_MVERT);
looptri = MEM_mallocN(sizeof(*looptri) * tottri, __func__);
triangles = MEM_mallocN(sizeof(TriTessFace) * tottri, __func__);
@@ -463,13 +435,6 @@ static TriTessFace *mesh_calc_tri_tessface(
const MLoopTri *lt = &looptri[i];
const MPoly *mp = &me->mpoly[lt->poly];
-#ifdef USE_MFACE_WORKAROUND
- if (lt->poly != mpoly_prev_testindex) {
- test_index_face_looptri(mp, me->mloop, &looptri[i]);
- mpoly_prev_testindex = lt->poly;
- }
-#endif
-
triangles[i].mverts[0] = &mvert[me->mloop[lt->tri[0]].v];
triangles[i].mverts[1] = &mvert[me->mloop[lt->tri[1]].v];
triangles[i].mverts[2] = &mvert[me->mloop[lt->tri[2]].v];
@@ -662,9 +627,6 @@ void RE_bake_pixels_populate(
const MLoopUV *mloopuv;
const int tottri = poly_to_tri_count(me->totpoly, me->totloop);
MLoopTri *looptri;
-#ifdef USE_MFACE_WORKAROUND
- unsigned int mpoly_prev_testindex = UINT_MAX;
-#endif
if ((uv_layer == NULL) || (uv_layer[0] == '\0')) {
mloopuv = CustomData_get_layer(&me->ldata, CD_MLOOPUV);
@@ -714,13 +676,6 @@ void RE_bake_pixels_populate(
bd.bk_image = &bake_images->data[image_id];
bd.primitive_id = ++p_id;
-#ifdef USE_MFACE_WORKAROUND
- if (lt->poly != mpoly_prev_testindex) {
- test_index_face_looptri(mp, me->mloop, &looptri[i]);
- mpoly_prev_testindex = lt->poly;
- }
-#endif
-
for (a = 0; a < 3; a++) {
const float *uv = mloopuv[lt->tri[a]].uv;