Sculpt Branch:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 11 Dec 2009 14:38:02 +0000 (14:38 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 11 Dec 2009 14:38:02 +0000 (14:38 +0000)
svn merge https://svn.blender.org/svnroot/bf-blender/trunk/blender -r25245:25315

1  2 
release/scripts/ui/space_view3d.py
release/scripts/ui/space_view3d_toolbar.py
source/blender/blenkernel/BKE_DerivedMesh.h
source/blender/blenloader/intern/readfile.c
source/blender/editors/object/object_ops.c
source/blender/editors/space_view3d/view3d_draw.c
source/blender/editors/space_view3d/view3d_edit.c
source/blender/editors/space_view3d/view3d_select.c
source/blender/makesdna/DNA_space_types.h
source/blender/makesrna/intern/rna_modifier.c
source/blender/windowmanager/intern/wm_operators.c

Simple merge
index d6d43eacd8509c2094fa1d4379d76c45cfcce7c3,eada820ba89d34391c9eed19682370b6b66f17c2..2937b7b22e7faf90d1e424b1d7913924203c2ee6
@@@ -10132,28 -10182,23 +10132,41 @@@ static void do_versions(FileData *fd, L
                for(sce=main->scene.first; sce; sce=sce->id.next)
                        if(!sce->toolsettings->particle.selectmode)
                                sce->toolsettings->particle.selectmode= SCE_SELECT_PATH;
 +
 +              if (main->versionfile == 250 && main->subversionfile > 1) {
 +                      for(me=main->mesh.first; me; me=me->id.next)
 +                              multires_load_old_250(me);
 +
 +                      for(ob=main->object.first; ob; ob=ob->id.next) {
 +                              MultiresModifierData *mmd = (MultiresModifierData *)modifiers_findByType(ob, eModifierType_Multires);
 +
 +                              if(mmd) {
 +                                      mmd->totlvl--;
 +                                      mmd->lvl--;
 +                                      mmd->sculptlvl= mmd->lvl;
 +                                      mmd->renderlvl= mmd->lvl;
 +                              }
 +                      }
 +              }
        }
  
 +      /* put 2.50 compatibility code here until next subversion bump */
        {
+               Object *ob;
+               
+               /* properly initialise hair clothsim data on old files */
+               for(ob = main->object.first; ob; ob = ob->id.next) {
+                       ModifierData *md;
+                       for(md= ob->modifiers.first; md; md= md->next) {
+                               if (md->type == eModifierType_Cloth) {
+                                       ClothModifierData *clmd = (ClothModifierData *)md;
+                                       if (clmd->sim_parms->velocity_smooth < 0.01f)
+                                               clmd->sim_parms->velocity_smooth = 0.f;
+                               }
+                       }
+               }
        }
 +
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
        /* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */
  
index 036dc811b7273cdc85750842157c0bd08463b45e,5a2040a44aafe20ec5085f3d247d022a7a61c0c4..19667beaaf98292e8f486613b61c8fa9515e9e5d
@@@ -1860,8 -1891,8 +1860,6 @@@ static CustomDataMask get_viewedit_data
                        mask |= CD_MASK_MCOL;
                if(ob->mode & OB_MODE_WEIGHT_PAINT)
                        mask |= CD_MASK_WEIGHT_MCOL;
-               //if(ob->mode & OB_MODE_SCULPT)
-               //      mask |= CD_MASK_MDISPS;
 -              if(ob->mode & OB_MODE_SCULPT)
 -                      mask |= CD_MASK_MDISPS;
        }
  
        return mask;
index 5a534a8ce1480cc7daeeff175bfd50a0c3a3b626,f2683e39c54b379ec33a1259d9424245b684b756..aee2b048f6bd7f2e7024175f0c8d3195852d2805
@@@ -349,46 -348,6 +348,39 @@@ static void rna_MultiresModifier_level_
        *max = mmd->totlvl;
  }
  
- static int rna_MultiresModifier_external_editable(PointerRNA *ptr)
- {
-       MultiresModifierData *mmd = ptr->data;
-       return (G.save_over && mmd->totlvl > 0);
- }
 +static int rna_MultiresModifier_external_get(PointerRNA *ptr)
 +{
 +      Object *ob= (Object*)ptr->id.data;
 +      Mesh *me= ob->data;
 +
 +      return CustomData_external_test(&me->fdata, CD_MDISPS);
 +}
 +
 +static void rna_MultiresModifier_filename_get(PointerRNA *ptr, char *value)
 +{
 +      Object *ob= (Object*)ptr->id.data;
 +      CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
 +
 +      BLI_strncpy(value, (external)? external->filename: "", sizeof(external->filename));
 +}
 +
 +static void rna_MultiresModifier_filename_set(PointerRNA *ptr, const char *value)
 +{
 +      Object *ob= (Object*)ptr->id.data;
 +      CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
 +
 +      if(external)
 +              BLI_strncpy(external->filename, value, sizeof(external->filename));
 +}
 +
 +static int rna_MultiresModifier_filename_length(PointerRNA *ptr)
 +{
 +      Object *ob= (Object*)ptr->id.data;
 +      CustomDataExternal *external= ((Mesh*)ob->data)->fdata.external;
 +
 +      return strlen((external)? external->filename: "");
 +}
 +
  static void modifier_object_set(Object *self, Object **ob_p, int type, PointerRNA value)
  {
        Object *ob= value.data;
@@@ -571,43 -532,11 +563,42 @@@ static void rna_def_modifier_multires(B
  
        rna_def_property_subdivision_common(srna, "simple");
  
 -      prop= RNA_def_property(srna, "level", PROP_INT, PROP_NONE);
 +      prop= RNA_def_property(srna, "levels", PROP_INT, PROP_UNSIGNED);
        RNA_def_property_int_sdna(prop, NULL, "lvl");
 -      RNA_def_property_ui_text(prop, "Level", "");
 +      RNA_def_property_ui_text(prop, "Levels", "Number of subdivisions to use in the viewport.");
        RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
        RNA_def_property_update(prop, 0, "rna_Modifier_update");
-       RNA_def_property_editable_func(prop, "rna_MultiresModifier_external_editable");
 +
 +      prop= RNA_def_property(srna, "sculpt_levels", PROP_INT, PROP_UNSIGNED);
 +      RNA_def_property_int_sdna(prop, NULL, "sculptlvl");
 +      RNA_def_property_ui_text(prop, "Sculpt Levels", "Number of subdivisions to use in sculpt mode.");
 +      RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
 +      RNA_def_property_update(prop, 0, "rna_Modifier_update");
 +
 +      prop= RNA_def_property(srna, "render_levels", PROP_INT, PROP_UNSIGNED);
 +      RNA_def_property_int_sdna(prop, NULL, "renderlvl");
 +      RNA_def_property_ui_text(prop, "Render Levels", "");
 +      RNA_def_property_int_funcs(prop, NULL, NULL, "rna_MultiresModifier_level_range");
 +
 +      prop= RNA_def_property(srna, "total_levels", PROP_INT, PROP_UNSIGNED);
 +      RNA_def_property_int_sdna(prop, NULL, "totlvl");
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_ui_text(prop, "Total Levels", "Number of subdivisions for which displacements are stored.");
 +
 +      prop= RNA_def_property(srna, "external", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_clear_flag(prop, PROP_EDITABLE);
 +      RNA_def_property_boolean_funcs(prop, "rna_MultiresModifier_external_get", NULL);
 +      RNA_def_property_ui_text(prop, "External", "Store multires displacements outside the .blend file, to save memory.");
 +
 +      prop= RNA_def_property(srna, "filename", PROP_STRING, PROP_FILEPATH);
 +      RNA_def_property_string_funcs(prop, "rna_MultiresModifier_filename_get", "rna_MultiresModifier_filename_length", "rna_MultiresModifier_filename_set");
 +      RNA_def_property_ui_text(prop, "Filename", "Path to external displacements file.");
 +      RNA_def_property_update(prop, 0, "rna_Modifier_update");
 +
 +      prop= RNA_def_property(srna, "optimal_display", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_sdna(prop, NULL, "flags", eMultiresModifierFlag_ControlEdges);
 +      RNA_def_property_ui_text(prop, "Optimal Display", "Skip drawing/rendering of interior subdivided edges");
 +      RNA_def_property_update(prop, 0, "rna_Modifier_update");
  }
  
  static void rna_def_modifier_lattice(BlenderRNA *brna)