Merged changes in the trunk up to revision 51718.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Mon, 29 Oct 2012 01:09:12 +0000 (01:09 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Mon, 29 Oct 2012 01:09:12 +0000 (01:09 +0000)
Conflicts resolved:
source/blender/blenloader/intern/readfile.c
source/blender/makesrna/intern/rna_scene.c
release/datafiles/startup.blend

62 files changed:
1  2 
build_files/scons/tools/Blender.py
release/datafiles/startup.blend
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/group.c
source/blender/blenkernel/intern/library.c
source/blender/blenkernel/intern/material.c
source/blender/blenkernel/intern/object.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/subsurf_ccg.c
source/blender/blenlib/intern/bpath.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/writefile.c
source/blender/bmesh/bmesh_class.h
source/blender/bmesh/intern/bmesh_construct.c
source/blender/bmesh/operators/bmo_utils.c
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/mesh/editmesh_tools.c
source/blender/editors/mesh/mesh_intern.h
source/blender/editors/mesh/mesh_ops.c
source/blender/editors/space_buttons/buttons_context.c
source/blender/editors/space_buttons/space_buttons.c
source/blender/editors/space_file/filelist.c
source/blender/editors/space_nla/nla_buttons.c
source/blender/editors/space_nla/nla_channels.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/transform/transform.c
source/blender/makesdna/DNA_material_types.h
source/blender/makesdna/DNA_meshdata_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_space_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_ID.c
source/blender/makesrna/intern/rna_action.c
source/blender/makesrna/intern/rna_color.c
source/blender/makesrna/intern/rna_internal.h
source/blender/makesrna/intern/rna_main_api.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_space.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/python/intern/bpy.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/include/render_types.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_result.c
source/blender/render/intern/source/shadeoutput.c
source/blender/windowmanager/WM_types.h
source/blender/windowmanager/intern/wm_files.c
source/blenderplayer/bad_level_call_stubs/stubs.c
source/creator/CMakeLists.txt
source/creator/creator.c

Simple merge
index dee5824,5056246..f8d722a
Binary files differ
@@@ -10,9 -10,9 +10,9 @@@ sources_mask = env.Glob('intern/mask*.c
  
  incs = '. #/intern/guardedalloc #/intern/memutil'
  incs += ' ../blenlib ../blenfont ../makesdna ../windowmanager'
- incs += ' ../render/extern/include #/intern/decimation/extern ../makesrna'
+ incs += ' ../render/extern/include ../makesrna'
  incs += ' ../imbuf ../ikplugin ../avi #/intern/elbeem/extern ../nodes ../modifiers'
 -incs += ' #/intern/iksolver/extern ../blenloader'
 +incs += ' #/intern/iksolver/extern ../blenloader ../freestyle'
  incs += ' #/extern/bullet2/src'
  incs += ' #/intern/opennl/extern #/intern/bsp/extern'
  incs += ' ../gpu #/extern/glew/include'
@@@ -914,20 -914,11 +926,14 @@@ void BKE_libblock_free(ListBase *lb, vo
                case ID_MSK:
                        BKE_mask_free(bmain, (Mask *)id);
                        break;
 +              case ID_LS:
 +                      FRS_free_linestyle((FreestyleLineStyle *)id);
 +                      break;
        }
  
-       if (id->properties) {
-               IDP_FreeProperty(id->properties);
-               MEM_freeN(id->properties);
-       }
        BLI_remlink(lb, id);
  
-       /* this ID may be a driver target! */
-       BKE_animdata_main_cb(bmain, animdata_dtar_clear_cb, (void *)id);
+       BKE_libblock_free_data(id);
  
        MEM_freeN(id);
  }
Simple merge
@@@ -3374,29 -3408,29 +3409,29 @@@ static void lib_link_particlesettings(F
                                        /* special case for only one object in the group */
                                        index_ok = 1;
                                }
 -                              else {
 +                              else { 
-                                       for (; dw; dw=dw->next) {
+                                       for (dw = part->dupliweights.first; dw; dw = dw->next) {
                                                if (dw->index > 0) {
                                                        index_ok = 1;
                                                        break;
                                                }
                                        }
                                }
 -
 +                              
                                if (index_ok) {
                                        /* if we have indexes, let's use them */
-                                       dw = part->dupliweights.first;
-                                       for (; dw; dw=dw->next) {
+                                       for (dw = part->dupliweights.first; dw; dw = dw->next) {
                                                GroupObject *go = (GroupObject *)BLI_findlink(&part->dup_group->gobject, dw->index);
-                                               dw->ob = go ? go->ob : NULL;
+                                               dw->ob = go ? newlibadr(fd, part->id.lib, dw->ob) : NULL;
                                        }
                                }
                                else {
                                        /* otherwise try to get objects from own library (won't work on library linked groups) */
-                                       for (; dw; dw=dw->next)
+                                       for (dw = part->dupliweights.first; dw; dw = dw->next) {
                                                dw->ob = newlibadr(fd, part->id.lib, dw->ob);
 -                                      }
                                }
                        }
++                      }
                        else {
                                part->dupliweights.first = part->dupliweights.last = NULL;
                        }
@@@ -5084,17 -5112,12 +5119,19 @@@ static void direct_link_scene(FileData 
        link_list(fd, &(sce->markers));
        link_list(fd, &(sce->transform_spaces));
        link_list(fd, &(sce->r.layers));
 +
 +      for(srl = sce->r.layers.first; srl; srl = srl->next) {
 +              link_list(fd, &(srl->freestyleConfig.modules));
 +      }
 +      for(srl = sce->r.layers.first; srl; srl = srl->next) {
 +              link_list(fd, &(srl->freestyleConfig.linesets));
 +      }
        
        sce->nodetree = newdataadr(fd, sce->nodetree);
-       if (sce->nodetree)
+       if (sce->nodetree) {
+               direct_link_id(fd, &sce->nodetree->id);
                direct_link_nodetree(fd, sce->nodetree);
+       }
  
        direct_link_view_settings(fd, &sce->view_settings);
  }
@@@ -6730,19 -6585,8 +6771,11 @@@ static BHead *read_libblock(FileData *f
                case ID_MSK:
                        direct_link_mask(fd, (Mask *)id);
                        break;
 +              case ID_LS:
 +                      direct_link_linestyle(fd, (FreestyleLineStyle *)id);
 +                      break;
        }
        
-       /*link direct data of ID properties*/
-       if (id->properties) {
-               id->properties = newdataadr(fd, id->properties);
-               if (id->properties) { /* this case means the data was written incorrectly, it should not happen */
-                       IDP_DirectLinkProperty(id->properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
-               }
-       }
-       
        oldnewmap_free_unused(fd->datamap);
        oldnewmap_clear(fd->datamap);
        
@@@ -8334,39 -8213,40 +8402,73 @@@ static void do_versions(FileData *fd, L
                        do_version_node_cleanup_dynamic_sockets_264(NULL, NULL, ntree);
        }
  
+       if (main->versionfile < 264 || (main->versionfile == 264 && main->subversionfile < 5)) {
+               /* set a unwrapping margin and ABF by default */
+               Scene *scene;
+               for (scene=main->scene.first; scene; scene=scene->id.next) {
+                       if (scene->toolsettings->uvcalc_margin == 0.0f) {
+                               scene->toolsettings->uvcalc_margin = 0.001f;
+                               scene->toolsettings->unwrapper = 0;
+                       }
+               }
+       }
+       if (main->versionfile < 264 || (main->versionfile == 264 && main->subversionfile < 6)) {
+               /* Fix for bug #32982, internal_links list could get corrupted from r51630 onward.
+                * Simply remove bad internal_links lists to avoid NULL pointers.
+                */
+               bNodeTreeType *ntreetype;
+               bNodeTree *ntree;
+               
+               ntreetype = ntreeGetType(NTREE_COMPOSIT);
+               if (ntreetype && ntreetype->foreach_nodetree)
+                       ntreetype->foreach_nodetree(main, NULL, do_version_node_fix_internal_links_264);
+               ntreetype = ntreeGetType(NTREE_SHADER);
+               if (ntreetype && ntreetype->foreach_nodetree)
+                       ntreetype->foreach_nodetree(main, NULL, do_version_node_fix_internal_links_264);
+               ntreetype = ntreeGetType(NTREE_TEXTURE);
+               if (ntreetype && ntreetype->foreach_nodetree)
+                       ntreetype->foreach_nodetree(main, NULL, do_version_node_fix_internal_links_264);
+               
+               for (ntree=main->nodetree.first; ntree; ntree=ntree->id.next)
+                       do_version_node_fix_internal_links_264(NULL, NULL, ntree);
+               
+       }
 +      /* default values in Freestyle settings */
 +      {
 +              Scene *sce;
 +              SceneRenderLayer *srl;
 +              FreestyleLineStyle *linestyle;
 +
 +              for(sce = main->scene.first; sce; sce = sce->id.next) {
 +                      if (sce->r.line_thickness_mode == 0) {
 +                              sce->r.line_thickness_mode= R_LINE_THICKNESS_ABSOLUTE;
 +                              sce->r.unit_line_thickness= 1.f;
 +                      }
 +                      for(srl= sce->r.layers.first; srl; srl= srl->next) {
 +                              if (srl->freestyleConfig.mode == 0)
 +                                      srl->freestyleConfig.mode= FREESTYLE_CONTROL_EDITOR_MODE;
 +                              if (srl->freestyleConfig.raycasting_algorithm == FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE ||
 +                                      srl->freestyleConfig.raycasting_algorithm == FREESTYLE_ALGO_CULLED_ADAPTIVE_TRADITIONAL) {
 +                                      srl->freestyleConfig.raycasting_algorithm= 0; /* deprecated */
 +                                      srl->freestyleConfig.flags |= FREESTYLE_CULLING;
 +                              }
 +                      }
 +              }
 +              for(linestyle = main->linestyle.first; linestyle; linestyle = linestyle->id.next) {
 +                      if (linestyle->thickness_position == 0) {
 +                              linestyle->thickness_position= LS_THICKNESS_CENTER;
 +                              linestyle->thickness_ratio= 0.5f;
 +                      }
 +                      if (linestyle->chaining == 0)
 +                              linestyle->chaining= LS_CHAINING_PLAIN;
 +                      if (linestyle->rounds == 0)
 +                              linestyle->rounds= 3;
 +              }
 +      }
 +
        /* WATCH IT!!!: pointers from libdata have not been converted yet here! */
        /* WATCH IT 2!: Userdef struct init has to be in editors/interface/resources.c! */
  
@@@ -225,10 -225,8 +225,9 @@@ enum 
  
        BM_ELEM_DRAW    = (1 << 5), /* edge display */
  
-       /* we have 1 spare flag which is awesome but since we're limited to 8
-        * only add new flags with care! - campbell */
-       /* BM_ELEM_SPARE  = (1 << 6), */
+       /* spare tag, assumed dirty, use define in each function to name based on use */
+       // _BM_ELEM_TAG_ALT = (1 << 6),  // UNUSED
 +      BM_ELEM_FREESTYLE = (1 << 6), /* used for Freestyle faces and edges */
  
        BM_ELEM_INTERNAL_TAG = (1 << 7) /* for low level internal API tagging,
                                       * since tools may want to tag verts and
@@@ -133,8 -133,8 +133,9 @@@ void MESH_OT_select_random(struct wmOpe
  void MESH_OT_loop_multi_select(struct wmOperatorType *ot);
  void MESH_OT_mark_seam(struct wmOperatorType *ot);
  void MESH_OT_mark_sharp(struct wmOperatorType *ot);
 +void MESH_OT_mark_freestyle_edge(struct wmOperatorType *ot);
  void MESH_OT_vertices_smooth(struct wmOperatorType *ot);
+ void MESH_OT_vertices_smooth_laplacian(struct wmOperatorType *ot);
  void MESH_OT_noise(struct wmOperatorType *ot);
  void MESH_OT_flip_normals(struct wmOperatorType *ot);
  void MESH_OT_solidify(struct wmOperatorType *ot);
@@@ -133,8 -132,8 +133,9 @@@ void ED_operatortypes_mesh(void
        WM_operatortype_append(MESH_OT_loop_multi_select);
        WM_operatortype_append(MESH_OT_mark_seam);
        WM_operatortype_append(MESH_OT_mark_sharp);
 +      WM_operatortype_append(MESH_OT_mark_freestyle_edge);
        WM_operatortype_append(MESH_OT_vertices_smooth);
+       WM_operatortype_append(MESH_OT_vertices_smooth_laplacian);
        WM_operatortype_append(MESH_OT_noise);
        WM_operatortype_append(MESH_OT_flip_normals);
        WM_operatortype_append(MESH_OT_rip);
Simple merge
@@@ -387,15 -386,9 +386,15 @@@ static void rna_def_dopesheet(BlenderRN
        RNA_def_property_ui_icon(prop, ICON_LAMP_DATA, 0);
        RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
        
 +      prop = RNA_def_property(srna, "show_linestyles", PROP_BOOLEAN, PROP_NONE);
 +      RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOLINESTYLE);
 +      RNA_def_property_ui_text(prop, "Display Line Style", "Include visualization of Line Style related Animation data");
 +      RNA_def_property_ui_icon(prop, ICON_BRUSH_DATA, 0); /* FIXME */
 +      RNA_def_property_update(prop, NC_ANIMATION|ND_ANIMCHAN|NA_EDITED, NULL);
 +      
        prop = RNA_def_property(srna, "show_textures", PROP_BOOLEAN, PROP_NONE);
        RNA_def_property_boolean_negative_sdna(prop, NULL, "filterflag", ADS_FILTER_NOTEX);
-       RNA_def_property_ui_text(prop, "Display Texture", "Include visualization of Texture related Animation data");
+       RNA_def_property_ui_text(prop, "Display Texture", "Include visualization of texture related animation data");
        RNA_def_property_ui_icon(prop, ICON_TEXTURE_DATA, 0);
        RNA_def_property_update(prop, NC_ANIMATION | ND_ANIMCHAN | NA_EDITED, NULL);
        
@@@ -1407,49 -1414,12 +1417,55 @@@ static void rna_SceneCamera_update(Mai
                DAG_id_tag_update(&camera->id, 0);
  }
  
+ static void rna_SceneSequencer_update(Main *UNUSED(bmain), Scene *UNUSED(scene), PointerRNA *UNUSED(ptr))
+ {
+       BKE_sequencer_cache_cleanup();
+       BKE_sequencer_preprocessed_cache_cleanup();
+ }
 +static PointerRNA rna_FreestyleLineSet_linestyle_get(PointerRNA *ptr)
 +{
 +      FreestyleLineSet *lineset= (FreestyleLineSet *)ptr->data;
 +
 +      return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineStyle, lineset->linestyle);
 +}
 +
 +static void rna_FreestyleLineSet_linestyle_set(PointerRNA *ptr, PointerRNA value)
 +{
 +      FreestyleLineSet *lineset= (FreestyleLineSet*)ptr->data;
 +
 +      lineset->linestyle->id.us--;
 +      lineset->linestyle = (FreestyleLineStyle *)value.data;
 +      lineset->linestyle->id.us++;
 +}
 +
 +static PointerRNA rna_FreestyleSettings_active_lineset_get(PointerRNA *ptr)
 +{
 +      FreestyleConfig *config= (FreestyleConfig *)ptr->data;
 +      FreestyleLineSet *lineset= FRS_get_active_lineset(config);
 +      return rna_pointer_inherit_refine(ptr, &RNA_FreestyleLineSet, lineset);
 +}
 +
 +static void rna_FreestyleSettings_active_lineset_index_range(PointerRNA *ptr, int *min, int *max)
 +{
 +      FreestyleConfig *config= (FreestyleConfig *)ptr->data;
 +      *min= 0;
 +      *max= BLI_countlist(&config->linesets)-1;
 +      *max= MAX2(0, *max);
 +}
 +
 +static int rna_FreestyleSettings_active_lineset_index_get(PointerRNA *ptr)
 +{
 +      FreestyleConfig *config= (FreestyleConfig *)ptr->data;
 +      return FRS_get_active_lineset_index(config);
 +}
 +
 +static void rna_FreestyleSettings_active_lineset_index_set(PointerRNA *ptr, int value)
 +{
 +      FreestyleConfig *config= (FreestyleConfig *)ptr->data;
 +      FRS_set_active_lineset_index(config, value);
 +}
 +
  #else
  
  static void rna_def_transform_orientation(BlenderRNA *brna)
Simple merge
Simple merge
Simple merge