Fix selected to active Cycles Baking

Since we started using looptris we no longer need a triangulation
modifier in the highpoly object. In fact having was causing a bug
where baking would be utterly broken.

This fix normal baking. Combined pass still needs a fix to hide the
objects during baking.
This commit is contained in:
Dalai Felinto 2018-12-07 12:15:01 -02:00
parent e9634b6930
commit f40a88a4ba
Notes: blender-bot 2023-02-14 04:38:06 +01:00
Referenced by issue #58970, Cage baking it is not working on Blender 2.8. Same process and objects it is working in Blender 2.79
2 changed files with 0 additions and 13 deletions

View File

@ -856,7 +856,6 @@ static int bake(
/* populate highpoly array */
for (link = selected_objects->first; link; link = link->next) {
TriangulateModifierData *tmd;
Object *ob_iter = link->ptr.data;
if (ob_iter == ob_low)
@ -866,14 +865,6 @@ static int bake(
highpoly[i].ob = ob_iter;
highpoly[i].restrict_flag = ob_iter->restrictflag;
/* triangulating so BVH returns the primitive_id that will be used for rendering */
highpoly[i].tri_mod = ED_object_modifier_add(
reports, bmain, scene, highpoly[i].ob,
"TmpTriangulate", eModifierType_Triangulate);
tmd = (TriangulateModifierData *)highpoly[i].tri_mod;
tmd->quad_method = MOD_TRIANGULATE_QUAD_FIXED;
tmd->ngon_method = MOD_TRIANGULATE_NGON_EARCLIP;
highpoly[i].me = bake_mesh_new_from_object(depsgraph, bmain, scene, highpoly[i].ob);
highpoly[i].ob->restrictflag &= ~OB_RESTRICT_RENDER;
@ -1091,9 +1082,6 @@ cleanup:
for (i = 0; i < tot_highpoly; i++) {
highpoly[i].ob->restrictflag = highpoly[i].restrict_flag;
if (highpoly[i].tri_mod)
ED_object_modifier_remove(reports, bmain, highpoly[i].ob, highpoly[i].tri_mod);
if (highpoly[i].me)
BKE_libblock_free(bmain, highpoly[i].me);
}

View File

@ -59,7 +59,6 @@ typedef struct BakePixel {
typedef struct BakeHighPolyData {
struct Object *ob;
struct ModifierData *tri_mod;
struct Mesh *me;
char restrict_flag;
bool is_flip_object;