Merged changes in the trunk up to revision 49478.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Thu, 2 Aug 2012 00:10:05 +0000 (00:10 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Thu, 2 Aug 2012 00:10:05 +0000 (00:10 +0000)
Conflicts resolved:
source/blender/blenkernel/intern/library.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/interface/resources.c
source/blender/makesrna/intern/rna_scene.c

31 files changed:
1  2 
build_files/scons/tools/Blender.py
doc/python_api/sphinx_doc_gen.py
release/scripts/startup/bl_ui/space_view3d.py
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/blenlib/intern/bpath.c
source/blender/blenloader/intern/readfile.c
source/blender/bmesh/bmesh_class.h
source/blender/bmesh/operators/bmo_utils.c
source/blender/editors/animation/anim_channels_defines.c
source/blender/editors/animation/anim_filter.c
source/blender/editors/include/UI_resources.h
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/space_view3d/drawobject.c
source/blender/editors/transform/transform.c
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesdna/intern/makesdna.c
source/blender/makesrna/intern/rna_main.c
source/blender/makesrna/intern/rna_scene.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/render/extern/include/RE_pipeline.h
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c
source/blender/windowmanager/intern/wm_files.c
source/blenderplayer/bad_level_call_stubs/stubs.c

Simple merge
Simple merge
@@@ -363,9 -360,9 +363,12 @@@ int id_copy(ID *id, ID **newid, int tes
                        return 0; /* can't be copied from here */
                case ID_GD:
                        return 0; /* not implemented */
+               case ID_MSK:
+                       if (!test) *newid = (ID *)BKE_mask_copy((Mask *)id);
+                       return 1;
 +              case ID_LS:
 +                      if(!test) *newid= (ID*)FRS_copy_linestyle((FreestyleLineStyle*)id);
 +                      return 1;
        }
        
        return 0;
Simple merge
@@@ -6346,177 -6345,6 +6359,177 @@@ static void lib_link_mask(FileData *fd
        }
  }
  
-               if (linestyle->id.flag & LIB_NEEDLINK) {
-                       linestyle->id.flag -= LIB_NEEDLINK;
 +/* ************ READ LINE STYLE ***************** */
 +
 +static void lib_link_linestyle(FileData *fd, Main *main)
 +{
 +      FreestyleLineStyle *linestyle;
 +      LineStyleModifier *m;
 +
 +      linestyle = main->linestyle.first;
 +      while (linestyle) {
++              if (linestyle->id.flag & LIB_NEED_LINK) {
++                      linestyle->id.flag -= LIB_NEED_LINK;
 +
 +                      if (linestyle->id.properties) IDP_LibLinkProperty(linestyle->id.properties, (fd->flags & FD_FLAGS_SWITCH_ENDIAN), fd);
 +                      if (linestyle->adt) lib_link_animdata(fd, &linestyle->id, linestyle->adt);
 +                      for (m = linestyle->color_modifiers.first; m; m = m->next) {
 +                              switch (m->type) {
 +                              case LS_MODIFIER_DISTANCE_FROM_OBJECT:
 +                                      {
 +                                              LineStyleColorModifier_DistanceFromObject *cm = (LineStyleColorModifier_DistanceFromObject *)m;
 +                                              cm->target = newlibadr(fd, linestyle->id.lib, cm->target);
 +                                      }
 +                                      break;
 +                              }
 +                      }
 +                      for (m = linestyle->alpha_modifiers.first; m; m = m->next){
 +                              switch (m->type) {
 +                              case LS_MODIFIER_DISTANCE_FROM_OBJECT:
 +                                      {
 +                                              LineStyleAlphaModifier_DistanceFromObject *am = (LineStyleAlphaModifier_DistanceFromObject *)m;
 +                                              am->target = newlibadr(fd, linestyle->id.lib, am->target);
 +                                      }
 +                                      break;
 +                              }
 +                      }
 +                      for (m = linestyle->thickness_modifiers.first; m; m = m->next){
 +                              switch (m->type) {
 +                              case LS_MODIFIER_DISTANCE_FROM_OBJECT:
 +                                      {
 +                                              LineStyleThicknessModifier_DistanceFromObject *tm = (LineStyleThicknessModifier_DistanceFromObject *)m;
 +                                              tm->target = newlibadr(fd, linestyle->id.lib, tm->target);
 +                                      }
 +                                      break;
 +                              }
 +                      }
 +              }
 +              linestyle = linestyle->id.next;
 +      }
 +}
 +
 +static void direct_link_linestyle_color_modifier(FileData *fd, LineStyleModifier *modifier)
 +{
 +      switch (modifier->type) {
 +      case LS_MODIFIER_ALONG_STROKE:
 +              {
 +                      LineStyleColorModifier_AlongStroke *m = (LineStyleColorModifier_AlongStroke *)modifier;
 +                      m->color_ramp = newdataadr(fd, m->color_ramp);
 +              }
 +              break;
 +      case LS_MODIFIER_DISTANCE_FROM_CAMERA:
 +              {
 +                      LineStyleColorModifier_DistanceFromCamera *m = (LineStyleColorModifier_DistanceFromCamera *)modifier;
 +                      m->color_ramp = newdataadr(fd, m->color_ramp);
 +              }
 +              break;
 +      case LS_MODIFIER_DISTANCE_FROM_OBJECT:
 +              {
 +                      LineStyleColorModifier_DistanceFromObject *m = (LineStyleColorModifier_DistanceFromObject *)modifier;
 +                      m->color_ramp = newdataadr(fd, m->color_ramp);
 +              }
 +              break;
 +      case LS_MODIFIER_MATERIAL:
 +              {
 +                      LineStyleColorModifier_Material *m = (LineStyleColorModifier_Material *)modifier;
 +                      m->color_ramp = newdataadr(fd, m->color_ramp);
 +              }
 +              break;
 +      }
 +}
 +
 +static void direct_link_linestyle_alpha_modifier(FileData *fd, LineStyleModifier *modifier)
 +{
 +      switch (modifier->type) {
 +      case LS_MODIFIER_ALONG_STROKE:
 +              {
 +                      LineStyleAlphaModifier_AlongStroke *m = (LineStyleAlphaModifier_AlongStroke *)modifier;
 +                      m->curve = newdataadr(fd, m->curve);
 +                      direct_link_curvemapping(fd, m->curve);
 +              }
 +              break;
 +      case LS_MODIFIER_DISTANCE_FROM_CAMERA:
 +              {
 +                      LineStyleAlphaModifier_DistanceFromCamera *m = (LineStyleAlphaModifier_DistanceFromCamera *)modifier;
 +                      m->curve = newdataadr(fd, m->curve);
 +                      direct_link_curvemapping(fd, m->curve);
 +              }
 +              break;
 +      case LS_MODIFIER_DISTANCE_FROM_OBJECT:
 +              {
 +                      LineStyleAlphaModifier_DistanceFromObject *m = (LineStyleAlphaModifier_DistanceFromObject *)modifier;
 +                      m->curve = newdataadr(fd, m->curve);
 +                      direct_link_curvemapping(fd, m->curve);
 +              }
 +              break;
 +      case LS_MODIFIER_MATERIAL:
 +              {
 +                      LineStyleAlphaModifier_Material *m = (LineStyleAlphaModifier_Material *)modifier;
 +                      m->curve = newdataadr(fd, m->curve);
 +                      direct_link_curvemapping(fd, m->curve);
 +              }
 +              break;
 +      }
 +}
 +
 +static void direct_link_linestyle_thickness_modifier(FileData *fd, LineStyleModifier *modifier)
 +{
 +      switch (modifier->type) {
 +      case LS_MODIFIER_ALONG_STROKE:
 +              {
 +                      LineStyleThicknessModifier_AlongStroke *m = (LineStyleThicknessModifier_AlongStroke *)modifier;
 +                      m->curve = newdataadr(fd, m->curve);
 +                      direct_link_curvemapping(fd, m->curve);
 +              }
 +              break;
 +      case LS_MODIFIER_DISTANCE_FROM_CAMERA:
 +              {
 +                      LineStyleThicknessModifier_DistanceFromCamera *m = (LineStyleThicknessModifier_DistanceFromCamera *)modifier;
 +                      m->curve = newdataadr(fd, m->curve);
 +                      direct_link_curvemapping(fd, m->curve);
 +              }
 +              break;
 +      case LS_MODIFIER_DISTANCE_FROM_OBJECT:
 +              {
 +                      LineStyleThicknessModifier_DistanceFromObject *m = (LineStyleThicknessModifier_DistanceFromObject *)modifier;
 +                      m->curve = newdataadr(fd, m->curve);
 +                      direct_link_curvemapping(fd, m->curve);
 +              }
 +              break;
 +      case LS_MODIFIER_MATERIAL:
 +              {
 +                      LineStyleThicknessModifier_Material *m = (LineStyleThicknessModifier_Material *)modifier;
 +                      m->curve = newdataadr(fd, m->curve);
 +                      direct_link_curvemapping(fd, m->curve);
 +              }
 +              break;
 +      }
 +}
 +
 +static void direct_link_linestyle_geometry_modifier(FileData *fd, LineStyleModifier *modifier)
 +{
 +}
 +
 +static void direct_link_linestyle(FileData *fd, FreestyleLineStyle *linestyle)
 +{
 +      LineStyleModifier *modifier;
 +
 +      linestyle->adt= newdataadr(fd, linestyle->adt);
 +      direct_link_animdata(fd, linestyle->adt);
 +      link_list(fd, &linestyle->color_modifiers);
 +      for(modifier=linestyle->color_modifiers.first; modifier; modifier= modifier->next)
 +              direct_link_linestyle_color_modifier(fd, modifier);
 +      link_list(fd, &linestyle->alpha_modifiers);
 +      for(modifier=linestyle->alpha_modifiers.first; modifier; modifier= modifier->next)
 +              direct_link_linestyle_alpha_modifier(fd, modifier);
 +      link_list(fd, &linestyle->thickness_modifiers);
 +      for(modifier=linestyle->thickness_modifiers.first; modifier; modifier= modifier->next)
 +              direct_link_linestyle_thickness_modifier(fd, modifier);
 +      link_list(fd, &linestyle->geometry_modifiers);
 +      for(modifier=linestyle->geometry_modifiers.first; modifier; modifier= modifier->next)
 +              direct_link_linestyle_geometry_modifier(fd, modifier);
 +}
 +
  /* ************** GENERAL & MAIN ******************** */
  
  
@@@ -8040,36 -7882,13 +8071,43 @@@ static void do_versions(FileData *fd, L
                        ntreetype->foreach_nodetree(main, NULL, do_version_ntree_keying_despill_balance);
        }
  
+       if (main->versionfile < 263 || (main->versionfile == 263 && main->subversionfile < 17)) {
+               bNodeTreeType *ntreetype = ntreeGetType(NTREE_COMPOSIT);
+               if (ntreetype && ntreetype->foreach_nodetree)
+                       ntreetype->foreach_nodetree(main, NULL, do_version_ntree_mask_264);
+       }
 +      /* 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 == 0)
 +                                      srl->freestyleConfig.raycasting_algorithm= FREESTYLE_ALGO_CULLED_ADAPTIVE_CUMULATIVE;
 +                      }
 +              }
 +              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! */
  
@@@ -9119,26 -8930,38 +9157,58 @@@ static void expand_movieclip(FileData *
        if (clip->adt)
                expand_animdata(fd, mainvar, clip->adt);
  }
+ static void expand_mask_parent(FileData *fd, Main *mainvar, MaskParent *parent)
+ {
+       if (parent->id) {
+               expand_doit(fd, mainvar, parent->id);
+       }
+ }
+ static void expand_mask(FileData *fd, Main *mainvar, Mask *mask)
+ {
+       MaskLayer *mask_layer;
+       if (mask->adt)
+               expand_animdata(fd, mainvar, mask->adt);
+       for (mask_layer = mask->masklayers.first; mask_layer; mask_layer = mask_layer->next) {
+               MaskSpline *spline;
+               for (spline = mask_layer->splines.first; spline; spline = spline->next) {
+                       int i;
+                       for (i = 0; i < spline->tot_point; i++) {
+                               MaskSplinePoint *point = &spline->points[i];
+                               expand_mask_parent(fd, mainvar, &point->parent);
+                       }
+                       expand_mask_parent(fd, mainvar, &spline->parent);
+               }
+       }
+ }
 +static void expand_linestyle(FileData *fd, Main *mainvar, FreestyleLineStyle *linestyle)
 +{
 +      LineStyleModifier *m;
 +
 +      if (linestyle->adt)
 +              expand_animdata(fd, mainvar, linestyle->adt);
 +      for (m = linestyle->color_modifiers.first; m; m = m->next) {
 +              if (m->type == LS_MODIFIER_DISTANCE_FROM_OBJECT)
 +                      expand_doit(fd, mainvar, ((LineStyleColorModifier_DistanceFromObject *)m)->target);
 +      }
 +      for (m = linestyle->alpha_modifiers.first; m; m = m->next){
 +              if (m->type == LS_MODIFIER_DISTANCE_FROM_OBJECT)
 +                      expand_doit(fd, mainvar, ((LineStyleAlphaModifier_DistanceFromObject *)m)->target);
 +      }
 +      for (m = linestyle->thickness_modifiers.first; m; m = m->next){
 +              if (m->type == LS_MODIFIER_DISTANCE_FROM_OBJECT)
 +                      expand_doit(fd, mainvar, ((LineStyleThicknessModifier_DistanceFromObject *)m)->target);
 +      }
 +}
 +
  static void expand_main(FileData *fd, Main *mainvar)
  {
        ListBase *lbarray[MAX_LIBARRAY];
                                        case ID_MC:
                                                expand_movieclip(fd, mainvar, (MovieClip *)id);
                                                break;
+                                       case ID_MSK:
+                                               expand_mask(fd, mainvar, (Mask *)id);
+                                               break;
 +                                      case ID_LS:
 +                                              expand_linestyle(fd, mainvar, (FreestyleLineStyle *)id);
 +                                              break;
                                        }
                                        
                                        do_it = TRUE;
Simple merge
@@@ -1918,19 -1917,25 +1923,38 @@@ void init_userdef_do_versions(void
                }
        }
  
+       if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 15)) {
+               bTheme *btheme;
+               for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+                       rgba_char_args_set(btheme->tv3d.bone_pose_active, 140, 255, 255, 80);
+               }
+       }
+       if (bmain->versionfile < 263 || (bmain->versionfile == 263 && bmain->subversionfile < 16)) {
+               bTheme *btheme;
+               for (btheme = U.themes.first; btheme; btheme = btheme->next) {
+                       if (btheme->tact.anim_active[3] == 0)
+                               rgba_char_args_set(btheme->tact.anim_active, 204, 112, 26, 102);
+                       if (btheme->tnla.anim_active[3] == 0)
+                               rgba_char_args_set(btheme->tnla.anim_active, 204, 112, 26, 102);
+               }
+       }
 +      /* Freestyle color settings */
 +      {
 +              bTheme *btheme;
 +
 +              for(btheme= U.themes.first; btheme; btheme= btheme->next) {
 +                      /* check for alpha==0 is safe, then color was never set */
 +                      if(btheme->tv3d.freestyle_edge_mark[3]==0) {
 +                              rgba_char_args_set(btheme->tv3d.freestyle_edge_mark, 0x7f, 0xff, 0x7f, 255);
 +                              rgba_char_args_set(btheme->tv3d.freestyle_face_mark, 0x7f, 0xff, 0x7f, 51);
 +                      }
 +              }
 +      }
 +
        /* GL Texture Garbage Collection (variable abused above!) */
        if (U.textimeout == 0) {
                U.texcollectrate = 60;
Simple merge
@@@ -215,10 -215,9 +215,10 @@@ typedef struct ThemeSpace 
        char extra_edge_len[4], extra_face_angle[4], extra_face_area[4], pad3[4];
        char normal[4];
        char vertex_normal[4];
-       char bone_solid[4], bone_pose[4];
+       char bone_solid[4], bone_pose[4], bone_pose_active[4];
        char strip[4], strip_select[4];
        char cframe[4];
 +      char freestyle_edge_mark[4], freestyle_face_mark[4];
        
        char nurb_uline[4], nurb_vline[4];
        char act_spline[4], nurb_sel_uline[4], nurb_sel_vline[4], lastsel_point[4];
@@@ -37,7 -37,7 +37,8 @@@
  #include "DNA_particle_types.h"
  #include "DNA_scene_types.h"
  #include "DNA_userdef_types.h"
+ #include "DNA_world_types.h"
 +#include "DNA_linestyle_types.h"
  
  #include "BLI_math.h"