Commit: fd923fcefba964ab0f5c0cf8e803737db8caf904
Author: Nicholas Bishop
Date: Mon Jan 19 16:01:56 2015 +0100
Branches: cycles-ptex-49
https://developer.blender.org/rBfd923fcefba964ab0f5c0cf8e803737db8caf904
Tesselation for Ptex loop layer
===================================================================
M source/blender/blenkernel/intern/mesh_evaluate.c
===================================================================
diff --git a/source/blender/blenkernel/intern/mesh_evaluate.c
b/source/blender/blenkernel/intern/mesh_evaluate.c
index f12fdeb..8eca275 100644
--- a/source/blender/blenkernel/intern/mesh_evaluate.c
+++ b/source/blender/blenkernel/intern/mesh_evaluate.c
@@ -53,6 +53,7 @@
#include "BKE_customdata.h"
#include "BKE_mesh.h"
#include "BKE_multires.h"
+#include "BKE_ptex.h"
#include "BKE_report.h"
#include "BLI_strict_flags.h"
@@ -2158,6 +2159,7 @@ void BKE_mesh_loops_to_tessdata(CustomData *fdata,
CustomData *ldata, CustomData
const bool hasPCol = CustomData_has_layer(ldata, CD_PREVIEW_MLOOPCOL);
const bool hasOrigSpace = CustomData_has_layer(ldata,
CD_ORIGSPACE_MLOOP);
const bool hasLoopNormal = CustomData_has_layer(ldata, CD_NORMAL);
+ const bool hasPtex = CustomData_has_layer(ldata, CD_LOOP_INTERP);
int findex, i, j;
const int *pidx;
unsigned int (*lidx)[4];
@@ -2222,6 +2224,17 @@ void BKE_mesh_loops_to_tessdata(CustomData *fdata,
CustomData *ldata, CustomData
}
}
}
+
+ if (hasPtex) {
+ MTessFacePtex *dst = CustomData_get_layer(fdata,
CD_TESSFACE_PTEX);
+ const MLoopInterp *src = CustomData_get_layer(ldata,
CD_LOOP_INTERP);
+
+ for (findex = 0, lidx = loopindices; findex < num_faces;
lidx++, findex++, dst++) {
+ const int num_indices = ((mface ? mface[findex].v4 :
(*lidx)[3]) ? 4 : 3);
+
+ BKE_ptex_tess_face_interp(dst, src, *lidx, num_indices);
+ }
+ }
}
/**
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs