diff options
author | Bastien Montagne <montagne29@wanadoo.fr> | 2014-04-13 14:18:51 +0400 |
---|---|---|
committer | Bastien Montagne <montagne29@wanadoo.fr> | 2014-04-13 14:19:00 +0400 |
commit | 18e4224142261cd8a1086c5872efb406b82f8330 (patch) | |
tree | a1a9f7680ab45158ec2c2755f76a966532cad8b8 /source/blender/blenloader | |
parent | a872d0b414f406a7d53ce77f7b43e7a831a68fa7 (diff) |
Split Normals I (1/5): basis for split normals (nearly nothing user-visible here):
* Add a new calcLoopNormals function to DerivedMesh struct, and implement it for CDDM and CCGDM (subsurf).
EditDerivedBMesh (edit mode DM) only gets a dummy one in this commit.
* Add a tessellated version of CD_LOOPNORMAL layer (CD_TESSLOOPNORMAL), with relevant code to handle it
(tessellation, rna access, etc.).
* Change auto_smooth options of Mesh (angle now in radian internaly, and toggle is now used to enable/disable
split normals in DM creation process). Note BI render code is not touched here, hence its behavior regarding
this option is now incoherent, will be addressed in a separate commit.
Reviewers: campbellbarton
CC: brecht
Differential Revision: https://developer.blender.org/D365
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_270.c | 11 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_defaults.c | 7 |
2 files changed, 18 insertions, 0 deletions
diff --git a/source/blender/blenloader/intern/versioning_270.c b/source/blender/blenloader/intern/versioning_270.c index d310c836f59..2dd227ef036 100644 --- a/source/blender/blenloader/intern/versioning_270.c +++ b/source/blender/blenloader/intern/versioning_270.c @@ -40,11 +40,13 @@ #include "DNA_space_types.h" #include "DNA_screen_types.h" #include "DNA_object_types.h" +#include "DNA_mesh_types.h" #include "DNA_modifier_types.h" #include "DNA_sdna_types.h" #include "DNA_genfile.h" +#include "BLI_math.h" #include "BKE_main.h" #include "BKE_node.h" @@ -160,4 +162,13 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *main) } } } + + if (!MAIN_VERSION_ATLEAST(main, 270, 2)) { + Mesh *me; + + /* Mesh smoothresh deg->rad. */ + for (me = main->mesh.first; me; me = me->id.next) { + me->smoothresh = DEG2RADF(me->smoothresh); + } + } } diff --git a/source/blender/blenloader/intern/versioning_defaults.c b/source/blender/blenloader/intern/versioning_defaults.c index b14402e72db..d6caf16f7aa 100644 --- a/source/blender/blenloader/intern/versioning_defaults.c +++ b/source/blender/blenloader/intern/versioning_defaults.c @@ -26,6 +26,7 @@ */ #include "BLI_utildefines.h" +#include "BLI_math.h" #include "DNA_freestyle_types.h" #include "DNA_linestyle_types.h" @@ -33,6 +34,7 @@ #include "DNA_screen_types.h" #include "DNA_space_types.h" #include "DNA_userdef_types.h" +#include "DNA_mesh_types.h" #include "BKE_main.h" @@ -45,6 +47,7 @@ void BLO_update_defaults_startup_blend(Main *main) Scene *scene; SceneRenderLayer *srl; FreestyleLineStyle *linestyle; + Mesh *me; for (scene = main->scene.first; scene; scene = scene->id.next) { scene->r.im_format.planes = R_IMF_PLANES_RGBA; @@ -75,5 +78,9 @@ void BLO_update_defaults_startup_blend(Main *main) } } } + + for (me = main->mesh.first; me; me = me->id.next) { + me->smoothresh = DEG2RADF(180.0f); + } } |