[Bf-blender-cvs] [f40a88a4ba9] blender2.8: Fix selected to active Cycles Baking
Dalai Felinto
noreply at git.blender.org
Fri Dec 7 17:58:47 CET 2018
Commit: f40a88a4ba9569db3574044f82838a88fc810726
Author: Dalai Felinto
Date: Fri Dec 7 12:15:01 2018 -0200
Branches: blender2.8
https://developer.blender.org/rBf40a88a4ba9569db3574044f82838a88fc810726
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.
===================================================================
M source/blender/editors/object/object_bake_api.c
M source/blender/render/extern/include/RE_bake.h
===================================================================
diff --git a/source/blender/editors/object/object_bake_api.c b/source/blender/editors/object/object_bake_api.c
index b9cc13cda34..90bb853e9d4 100644
--- a/source/blender/editors/object/object_bake_api.c
+++ b/source/blender/editors/object/object_bake_api.c
@@ -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);
}
diff --git a/source/blender/render/extern/include/RE_bake.h b/source/blender/render/extern/include/RE_bake.h
index e7f446f07a7..298bb72a02c 100644
--- a/source/blender/render/extern/include/RE_bake.h
+++ b/source/blender/render/extern/include/RE_bake.h
@@ -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;
More information about the Bf-blender-cvs
mailing list