Add missing stuff in new scene code to properly init skeletor params properly.
authorMartin Poirier <theeth@yahoo.com>
Tue, 12 Aug 2008 19:56:03 +0000 (19:56 +0000)
committerMartin Poirier <theeth@yahoo.com>
Tue, 12 Aug 2008 19:56:03 +0000 (19:56 +0000)
Add sanity check on file load to fix old files (won't be merged in trunk).

source/blender/blenkernel/intern/scene.c
source/blender/blenloader/intern/readfile.c

index 553107dd2648aa782251243f34a72664ebcec1bb..6102ee9a5d760404c2c3c4ed4feb3118e9a65bb4 100644 (file)
@@ -252,6 +252,21 @@ Scene *add_scene(char *name)
        sce->toolsettings->select_thresh= 0.01f;
        sce->toolsettings->jointrilimit = 0.8f;
 
+       sce->toolsettings->skgen_resolution = 100;
+       sce->toolsettings->skgen_threshold_internal     = 0.01f;
+       sce->toolsettings->skgen_threshold_external     = 0.01f;
+       sce->toolsettings->skgen_angle_limit                    = 45.0f;
+       sce->toolsettings->skgen_length_ratio                   = 1.3f;
+       sce->toolsettings->skgen_length_limit                   = 1.5f;
+       sce->toolsettings->skgen_correlation_limit              = 0.98f;
+       sce->toolsettings->skgen_symmetry_limit                 = 0.1f;
+       sce->toolsettings->skgen_postpro = SKGEN_SMOOTH;
+       sce->toolsettings->skgen_postpro_passes = 1;
+       sce->toolsettings->skgen_options = SKGEN_FILTER_INTERNAL|SKGEN_FILTER_EXTERNAL|SKGEN_FILTER_SMART|SKGEN_HARMONIC|SKGEN_SUB_CORRELATION|SKGEN_STICK_TO_EMBEDDING;
+       sce->toolsettings->skgen_subdivisions[0] = SKGEN_SUB_CORRELATION;
+       sce->toolsettings->skgen_subdivisions[1] = SKGEN_SUB_LENGTH;
+       sce->toolsettings->skgen_subdivisions[2] = SKGEN_SUB_ANGLE;
+
        pset= &sce->toolsettings->particle;
        pset->flag= PE_KEEP_LENGTHS|PE_LOCK_FIRST|PE_DEFLECT_EMITTER;
        pset->emitterdist= 0.25f;
index ad19cde3c9ba963ad5700bd4cdb848b396056286..c399ca13437d48bdc99ecbfaedfbeb0e4ffc5842 100644 (file)
@@ -7343,6 +7343,24 @@ static void do_versions(FileData *fd, Library *lib, Main *main)
                        }
                }
        }
+       
+       /* sanity check for skgen
+        * */
+       {
+               Scene *sce;
+               for(sce=main->scene.first; sce; sce = sce->id.next)
+               {
+                       if (sce->toolsettings->skgen_subdivisions[0] == sce->toolsettings->skgen_subdivisions[1] ||
+                               sce->toolsettings->skgen_subdivisions[0] == sce->toolsettings->skgen_subdivisions[2] ||
+                               sce->toolsettings->skgen_subdivisions[1] == sce->toolsettings->skgen_subdivisions[2])
+                       {
+                                       sce->toolsettings->skgen_subdivisions[0] = SKGEN_SUB_CORRELATION;
+                                       sce->toolsettings->skgen_subdivisions[1] = SKGEN_SUB_LENGTH;
+                                       sce->toolsettings->skgen_subdivisions[2] = SKGEN_SUB_ANGLE;
+                       }
+               }
+       }
+       
 
        if ((main->versionfile < 245) || (main->versionfile == 245 && main->subversionfile < 2)) {
                Image *ima;