Changeset View
Changeset View
Standalone View
Standalone View
source/blender/blenkernel/intern/DerivedMesh.cc
| Show First 20 Lines • Show All 609 Lines • ▼ Show 20 Lines | static void mesh_calc_modifier_final_normals(const Mesh *mesh_input, | ||||
| const CustomData_MeshMasks *final_datamask, | const CustomData_MeshMasks *final_datamask, | ||||
| const bool sculpt_dyntopo, | const bool sculpt_dyntopo, | ||||
| Mesh *mesh_final) | Mesh *mesh_final) | ||||
| { | { | ||||
| /* Compute normals. */ | /* Compute normals. */ | ||||
| const bool do_loop_normals = ((mesh_input->flag & ME_AUTOSMOOTH) != 0 || | const bool do_loop_normals = ((mesh_input->flag & ME_AUTOSMOOTH) != 0 || | ||||
| (final_datamask->lmask & CD_MASK_NORMAL) != 0); | (final_datamask->lmask & CD_MASK_NORMAL) != 0); | ||||
| /* Needed as `final_datamask` is not preserved outside modifier stack evaluation. */ | |||||
| mesh_final->runtime.subsurf_do_loop_normals = do_loop_normals; | |||||
brecht: I think we should we do the same in `editbmesh_calc_modifier_final_normals`? | |||||
| if (do_loop_normals) { | if (do_loop_normals) { | ||||
brechtUnsubmitted Done Inline ActionsCould we skip computing loop normals here for the subdiv wrapper? It seems like a waste of time if they are going to be recomputed later, and also is not consistent with the modifier being evaluated as part of the stack, since loop normals would then always be computed after the subdiv modifier. brecht: Could we skip computing loop normals here for the subdiv wrapper? It seems like a waste of time… | |||||
| /* Compute loop normals (NOTE: will compute poly and vert normals as well, if needed!). */ | /* Compute loop normals (NOTE: will compute poly and vert normals as well, if needed!). */ | ||||
| BKE_mesh_calc_normals_split(mesh_final); | BKE_mesh_calc_normals_split(mesh_final); | ||||
| BKE_mesh_tessface_clear(mesh_final); | BKE_mesh_tessface_clear(mesh_final); | ||||
| } | } | ||||
| if (sculpt_dyntopo == false) { | if (sculpt_dyntopo == false) { | ||||
| /* watch this! after 2.75a we move to from tessface to looptri (by default) */ | /* watch this! after 2.75a we move to from tessface to looptri (by default) */ | ||||
| if (final_datamask->fmask & CD_MASK_MFACE) { | if (final_datamask->fmask & CD_MASK_MFACE) { | ||||
| ▲ Show 20 Lines • Show All 1,428 Lines • Show Last 20 Lines | |||||
I think we should we do the same in editbmesh_calc_modifier_final_normals?