Merged changes in the trunk up to revision 32271.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sun, 3 Oct 2010 11:33:32 +0000 (11:33 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Sun, 3 Oct 2010 11:33:32 +0000 (11:33 +0000)
1  2 
release/scripts/ui/space_dopesheet.py
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenloader/intern/readfile.c
source/blender/editors/animation/anim_channels_edit.c
source/blender/editors/space_outliner/outliner.c
source/blender/editors/transform/transform.c
source/blender/makesrna/intern/makesrna.c
source/blender/makesrna/intern/rna_internal.h
source/creator/CMakeLists.txt
source/creator/creator.c

index e1b92ab4d323bc18b93739848973d5424def04dc,c92097912890244c456587f043e8880451752b32..ac009ff147e56fe138e3882c4c9da0d42ba2e5ae
@@@ -60,8 -60,6 +60,8 @@@ def dopesheet_filter(layout, context)
          row.prop(dopesheet, "show_armatures", text="")
      if bpy.data.particles:
          row.prop(dopesheet, "show_particles", text="")
 +    if bpy.data.linestyles:
 +        row.prop(dopesheet, "show_linestyles", text="")
  
      if bpy.data.groups:
          row = layout.row(align=True)
@@@ -102,7 -100,7 +102,7 @@@ class DOPESHEET_HT_header(bpy.types.Hea
          if st.mode == 'DOPESHEET':
              dopesheet_filter(layout, context)
  
-         elif st.mode == 'ACTION':
+         elif st.mode in ('ACTION','SHAPEKEY'):
              layout.template_ID(st, "action", new="action.new")
  
          if st.mode != 'GPENCIL':
index b4eb1d073a6a8769782e25726d5dd93b56d9ae95,1b6411e4f64acbcd436cd524357c3cb18c24ccb6..c8645f91de813e6d592705b8bbe6576d5cda0dc0
@@@ -31,7 -31,6 +31,7 @@@ SET(IN
        ../avi
        ../blenlib
        ../blenloader
 +      ../freestyle
        ../gpu
        ../ikplugin
        ../imbuf
@@@ -109,13 -108,17 +109,17 @@@ ELSE(WITH_PYTHON
  ENDIF(WITH_PYTHON)
  
  IF(WITH_OPENMP)
 -      ADD_DEFINITIONS(-DPARALLEL=1)
 +              ADD_DEFINITIONS(-DPARALLEL=1)
  ENDIF(WITH_OPENMP)
  
  IF(NOT WITH_FLUID)
        ADD_DEFINITIONS(-DDISABLE_ELBEEM)
  ENDIF(NOT WITH_FLUID)
  
+ IF(WITH_JACK)
+       ADD_DEFINITIONS(-DWITH_JACK)
+ ENDIF(WITH_JACK)
  IF(WITH_LZO)
        LIST(APPEND INC ../../../extern/lzo/minilzo)
        ADD_DEFINITIONS(-DWITH_LZO)
index 5069fddefd66963de0fb9f4ba8a551f446d582ea,bbc66ac14ea41473839476a28772a9d9b81251a4..0345ef26c9ab461a10409724ce1869e6c924cb44
@@@ -7,7 -7,7 +7,7 @@@ incs = '. #/intern/guardedalloc #/inter
  incs += ' ../blenlib ../blenfont ../makesdna ../windowmanager'
  incs += ' ../render/extern/include #/intern/decimation/extern ../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'
@@@ -53,6 -53,9 +53,9 @@@ if env['WITH_BF_CINEON']
  if env['WITH_BF_HDR']:
      defs.append('WITH_HDR')
  
+ if env['WITH_BF_JACK']:
+     defs.append('WITH_JACK')
  if env['WITH_BF_FFMPEG']:
      defs.append('WITH_FFMPEG')
      incs += ' ' + env['BF_FFMPEG_INC']
index 352cc5f85cec5ecfec15c65ee6b580210a8044d4,f24de9c605d003b7fba01b68a68fec00dd3d4fa0..92dd8edaf21d9670b1133da859f253e0e4af01c8
@@@ -63,7 -63,6 +63,7 @@@
  #include "DNA_key_types.h"
  #include "DNA_lattice_types.h"
  #include "DNA_lamp_types.h"
 +#include "DNA_linestyle_types.h"
  #include "DNA_meta_types.h"
  #include "DNA_material_types.h"
  #include "DNA_mesh_types.h"
@@@ -2736,7 -2735,7 +2736,7 @@@ static void direct_link_curve(FileData 
        cu->strinfo= newdataadr(fd, cu->strinfo);       
        cu->tb= newdataadr(fd, cu->tb);
  
-       if(cu->vfont==0) link_list(fd, &(cu->nurb));
+       if(cu->vfont == NULL) link_list(fd, &(cu->nurb));
        else {
                cu->nurb.first=cu->nurb.last= 0;
  
                nu->bp= newdataadr(fd, nu->bp);
                nu->knotsu= newdataadr(fd, nu->knotsu);
                nu->knotsv= newdataadr(fd, nu->knotsv);
-               if (cu->vfont==0) nu->charidx= nu->mat_nr;
+               if (cu->vfont == NULL) nu->charidx= nu->mat_nr;
  
                if(fd->flags & FD_FLAGS_SWITCH_ENDIAN) {
                        switch_endian_knots(nu);
@@@ -2938,6 -2937,7 +2938,7 @@@ static void direct_link_pointcache(File
        cache->simframe= 0;
        cache->edit= NULL;
        cache->free_edit= NULL;
+       cache->cached_frames= NULL;
  }
  
  static void direct_link_pointcache_list(FileData *fd, ListBase *ptcaches, PointCache **ocache)
@@@ -4100,8 -4100,10 +4101,10 @@@ static void direct_link_object(FileDat
        ob->gpulamp.first= ob->gpulamp.last= NULL;
        link_list(fd, &ob->pc_ids);
  
-       if(ob->sculpt)
+       if(ob->sculpt) {
                ob->sculpt= MEM_callocN(sizeof(SculptSession), "reload sculpt session");
+               ob->sculpt->ob= ob;
+       }
  }
  
  /* ************ READ SCENE ***************** */
@@@ -4130,7 -4132,6 +4133,7 @@@ static void lib_link_scene(FileData *fd
        Base *base, *next;
        Sequence *seq;
        SceneRenderLayer *srl;
 +      FreestyleLineSet *fls;
        TimeMarker *marker;
        
        sce= main->scene.first;
                        for(srl= sce->r.layers.first; srl; srl= srl->next) {
                                srl->mat_override= newlibadr_us(fd, sce->id.lib, srl->mat_override);
                                srl->light_override= newlibadr_us(fd, sce->id.lib, srl->light_override);
 +                              for(fls=srl->freestyleConfig.linesets.first; fls; fls= fls->next) {
 +                                      fls->linestyle= newlibadr_us(fd, sce->id.lib, fls->linestyle);
 +                              }
                        }
                        /*Game Settings: Dome Warp Text*/
                        sce->gm.dome.warptext= newlibadr(fd, sce->id.lib, sce->gm.dome.warptext);
@@@ -4249,7 -4247,6 +4252,7 @@@ static void direct_link_scene(FileData 
        Editing *ed;
        Sequence *seq;
        MetaStack *ms;
 +      SceneRenderLayer *srl;
  
        sce->theDag = NULL;
        sce->dagisvalid = 0;
        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)
                direct_link_nodetree(fd, sce->nodetree);
@@@ -5361,138 -5351,6 +5364,138 @@@ static void lib_link_group(FileData *fd
        }
  }
  
 +/* ************ 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_NEEDLINK) {
 +                      linestyle->id.flag -= LIB_NEEDLINK;
 +
 +                      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) {
 +                              if (m->type == LS_MODIFIER_DISTANCE_FROM_OBJECT) {
 +                                      LineStyleColorModifier_DistanceFromObject *cm = (LineStyleColorModifier_DistanceFromObject *)m;
 +                                      cm->target = newlibadr(fd, linestyle->id.lib, cm->target);
 +                              }
 +                      }
 +                      for (m = linestyle->alpha_modifiers.first; m; m = m->next){
 +                              if (m->type == LS_MODIFIER_DISTANCE_FROM_OBJECT) {
 +                                      LineStyleAlphaModifier_DistanceFromObject *am = (LineStyleAlphaModifier_DistanceFromObject *)m;
 +                                      am->target = newlibadr(fd, linestyle->id.lib, am->target);
 +                              }
 +                      }
 +                      for (m = linestyle->thickness_modifiers.first; m; m = m->next){
 +                              if (m->type == LS_MODIFIER_DISTANCE_FROM_OBJECT) {
 +                                      LineStyleThicknessModifier_DistanceFromObject *tm = (LineStyleThicknessModifier_DistanceFromObject *)m;
 +                                      tm->target = newlibadr(fd, linestyle->id.lib, tm->target);
 +                              }
 +                      }
 +              }
 +              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;
 +      }
 +}
 +
 +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;
 +      }
 +}
 +
 +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;
 +      }
 +}
 +
 +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);
 +}
 +
  /* ************** GENERAL & MAIN ******************** */
  
  
@@@ -5526,7 -5384,6 +5529,7 @@@ static char *dataname(short id_code
                case ID_BR: return "Data from BR";
                case ID_PA: return "Data from PA";
                case ID_GD: return "Data from GD";
 +              case ID_LS: return "Data from LS";
        }
        return "Data from Lib Block";
        
@@@ -5693,9 -5550,6 +5696,9 @@@ static BHead *read_libblock(FileData *f
                case ID_GD:
                        direct_link_gpencil(fd, (bGPdata *)id);
                        break;
 +              case ID_LS:
 +                      direct_link_linestyle(fd, (FreestyleLineStyle *)id);
 +                      break;
        }
        
        /*link direct data of ID properties*/
@@@ -11315,7 -11169,6 +11318,7 @@@ static void lib_link_all(FileData *fd, 
        lib_link_nodetree(fd, main);    /* has to be done after scene/materials, this will verify group nodes */
        lib_link_brush(fd, main);
        lib_link_particlesettings(fd, main);
 +      lib_link_linestyle(fd, main);
  
        lib_link_mesh(fd, main);                /* as last: tpage images with users at zero */
  
@@@ -12235,25 -12088,6 +12238,25 @@@ static void expand_sound(FileData *fd, 
        expand_doit(fd, mainvar, snd->ipo); // XXX depreceated - old animation system
  }
  
 +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)
  {
                                                break;
                                        case ID_PA:
                                                expand_particlesettings(fd, mainvar, (ParticleSettings *)id);
 +                                              break;
 +                                      case ID_LS:
 +                                              expand_linestyle(fd, mainvar, (FreestyleLineStyle *)id);
 +                                              break;
                                        }
  
                                        doit= 1;
index 496d41ae4dc8b631fdec860f5e677a0cfa89661b,4414da222a66ae1d182abe22f71f09a241b85d9b..a40beeaa0f88da8a6e967070c1bfe6266c50d8c4
@@@ -155,6 -155,7 +155,7 @@@ void ANIM_set_active_channel (bAnimCont
                        case ANIMTYPE_DSMESH:
                        {
                                /* need to verify that this data is valid for now */
+                               // XXX: ale may be null!
                                if (ale->adt)
                                        ale->adt->flag |= ADT_UI_ACTIVE;
                        }
@@@ -229,7 -230,6 +230,7 @@@ void ANIM_deselect_anim_channels (bAnim
                                case ANIMTYPE_DSMESH:
                                case ANIMTYPE_DSNTREE:
                                case ANIMTYPE_DSTEX:
 +                              case ANIMTYPE_DSLINESTYLE:
                                {
                                        if ((ale->adt) && (ale->adt->flag & ADT_UI_SELECTED))
                                                sel= ACHANNEL_SETFLAG_CLEAR;
                        case ANIMTYPE_DSMESH:
                        case ANIMTYPE_DSNTREE:
                        case ANIMTYPE_DSTEX:
 +                      case ANIMTYPE_DSLINESTYLE:
                        {
                                /* need to verify that this data is valid for now */
                                if (ale->adt) {
@@@ -464,7 -463,7 +465,7 @@@ void ANIM_flush_setting_anim_channels (
                                break;
                        
                        /* store this level as the 'old' level now */
-                       prevLevel= level;
+                       prevLevel= level; // XXX: prevLevel is unused
                }
        }
  }
@@@ -1735,7 -1734,6 +1736,7 @@@ static int mouse_anim_channels (bAnimCo
                case ANIMTYPE_DSMESH:
                case ANIMTYPE_DSNTREE:
                case ANIMTYPE_DSTEX:
 +              case ANIMTYPE_DSLINESTYLE:
                {
                        /* sanity checking... */
                        if (ale->adt) {
  static int animchannels_mouseclick_invoke(bContext *C, wmOperator *op, wmEvent *event)
  {
        bAnimContext ac;
-       Scene *scene;
        ARegion *ar;
        View2D *v2d;
        int mval[2], channel_index;
                return OPERATOR_CANCELLED;
                
        /* get useful pointers from animation context data */
-       scene= ac.scene;
        ar= ac.ar;
        v2d= &ar->v2d;
        
index 7b98b421758ff82f3155b1272b16717c8c37e27e,aaeab9e78434ffab0e44820a5f78d037e759fd15..fafc9024a286cd541060d9f4c84ff74f21c479fc
@@@ -1553,10 -1553,37 +1553,37 @@@ static void outliner_set_flag(SpaceOop
  
  /* --- */
  
+ /* same check needed for both object operation and restrict column button func
+  * return 0 when in edit mode (cannot restrict view or select)
+  * otherwise return 1 */
+ static int common_restrict_check(bContext *C, Scene *scene, Object *ob)
+ {
+       /* Don't allow hide an object in edit mode,
+        * check the bug #22153 and #21609, #23977
+        */
+       Object *obedit= CTX_data_edit_object(C);
+       if (obedit && obedit == ob) {
+               /* found object is hidden, reset */
+               if (ob->restrictflag & OB_RESTRICT_VIEW)
+                       ob->restrictflag &= ~OB_RESTRICT_VIEW;
+               /* found object is unselectable, reset */
+               if (ob->restrictflag & OB_RESTRICT_SELECT)
+                       ob->restrictflag &= ~OB_RESTRICT_SELECT;
+               return 0;
+       }
+       
+       return 1;
+ }
  void object_toggle_visibility_cb(bContext *C, Scene *scene, TreeElement *te, TreeStoreElem *tsep, TreeStoreElem *tselem)
  {
        Base *base= (Base *)te->directdata;
-       if(base || (base= object_in_scene((Object *)tselem->id, scene))) {
+       Object *ob = (Object *)tselem->id;
+       
+       /* add check for edit mode */
+       if(!common_restrict_check(C, scene, ob)) return;
+       
+       if(base || (base= object_in_scene(ob, scene))) {
                if((base->object->restrictflag ^= OB_RESTRICT_VIEW)) {
                        ED_base_object_select(base, BA_DESELECT);
                }
@@@ -1586,7 -1613,7 +1613,7 @@@ void OUTLINER_OT_visibility_toggle(wmOp
        
        /* callbacks */
        ot->exec= outliner_toggle_visibility_exec;
-       ot->poll= ED_operator_outliner_active;
+       ot->poll= ED_operator_outliner_active_no_editobject;
        
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
  }
@@@ -1626,7 -1653,7 +1653,7 @@@ void OUTLINER_OT_selectability_toggle(w
        
        /* callbacks */
        ot->exec= outliner_toggle_selectability_exec;
-       ot->poll= ED_operator_outliner_active;
+       ot->poll= ED_operator_outliner_active_no_editobject;
        
        ot->flag= OPTYPE_REGISTER|OPTYPE_UNDO;
  }
@@@ -3403,6 -3430,7 +3430,7 @@@ static int outliner_object_operation_ex
        else if(event==8) {
                outliner_do_object_operation(C, scene, soops, &soops->tree, object_toggle_renderability_cb);
                str= "Toggle Renderability";
+               WM_event_add_notifier(C, NC_SCENE|ND_OB_RENDER, scene);
        }
  
        ED_undo_push(C, str);
@@@ -4471,6 -4499,11 +4499,6 @@@ static void outliner_draw_iconrow(bCont
        int active;
  
        for(te= lb->first; te; te= te->next) {
 -              
 -              /* exit drawing early */
 -              if((*offsx) - OL_X > xmax)
 -                      break;
 -
                tselem= TREESTORE(te);
                
                /* object hierarchy always, further constrained on level */
@@@ -4838,16 -4871,8 +4866,8 @@@ static void restrictbutton_view_cb(bCon
  {
        Scene *scene = (Scene *)poin;
        Object *ob = (Object *)poin2;
-       Object *obedit= CTX_data_edit_object(C);
  
-       /* Don't allow hide an objet in edit mode,
-        * check the bug #22153 and #21609
-        */
-       if (obedit && obedit == ob) {
-               if (ob->restrictflag & OB_RESTRICT_VIEW)
-                       ob->restrictflag &= ~OB_RESTRICT_VIEW;
-               return;
-       }
+       if(!common_restrict_check(C, scene, ob)) return;
        
        /* deselect objects that are invisible */
        if (ob->restrictflag & OB_RESTRICT_VIEW) {
@@@ -4864,6 -4889,8 +4884,8 @@@ static void restrictbutton_sel_cb(bCont
        Scene *scene = (Scene *)poin;
        Object *ob = (Object *)poin2;
        
+       if(!common_restrict_check(C, scene, ob)) return;
+       
        /* if select restriction has just been turned on */
        if (ob->restrictflag & OB_RESTRICT_SELECT) {
                /* Ouch! There is no backwards pointer from Object to Base, 
  
  static void restrictbutton_rend_cb(bContext *C, void *poin, void *poin2)
  {
-       WM_event_add_notifier(C, NC_SCENE|ND_OB_SELECT, poin);
+       WM_event_add_notifier(C, NC_SCENE|ND_OB_RENDER, poin);
  }
  
  static void restrictbutton_r_lay_cb(bContext *C, void *poin, void *poin2)
index 88d74a443cac1602f7ad6c04d43c83b2d710b7e5,a6fcfb0498206074eaa045cb65ff94b9eb676c67..215cbab8f1b5aef0527af74157a1228273b00f71
@@@ -556,6 -556,9 +556,6 @@@ int transformEvent(TransInfo *t, wmEven
  
        if (event->type == MOUSEMOVE)
        {
 -              if (t->modifiers & MOD_CONSTRAINT_SELECT)
 -                      t->con.mode |= CON_SELECT;
 -
                t->mval[0] = event->x - t->ar->winrct.xmin;
                t->mval[1] = event->y - t->ar->winrct.ymin;
  
@@@ -1696,9 -1699,6 +1696,9 @@@ void transformApply(const bContext *C, 
  {
        if ((t->redraw & TREDRAW_HARD) || (t->draw_handle_apply == NULL && (t->redraw & TREDRAW_SOFT)))
        {
 +              if (t->modifiers & MOD_CONSTRAINT_SELECT)
 +                      t->con.mode |= CON_SELECT;
 +
                selectConstraint(t);
                if (t->transform) {
                        t->transform(t, t->mval);  // calls recalcData()
@@@ -2180,7 -2180,7 +2180,7 @@@ void initWarp(TransInfo *t
                mul_m4_v3(t->viewmat, center);
                sub_v3_v3(center, t->viewmat[3]);
                if (i)
-                       minmax_v3_v3v3(min, max, center);
+                       minmax_v3v3_v3(min, max, center);
                else {
                        copy_v3_v3(max, center);
                        copy_v3_v3(min, center);
index 46ca4d9fca89fe40e70a7ad58650773e49c7b751,721ca00de41676aef2e748ee54d2f6f0ed47214b..f1dfaacf932e635cf79229f98eb1f96f0a9a8d5c
@@@ -364,7 -364,7 +364,7 @@@ static int rna_enum_bitmask(PropertyRN
  
  static int rna_color_quantize(PropertyRNA *prop, PropertyDefRNA *dp)
  {
-       if(prop->type == PROP_FLOAT && prop->subtype == PROP_COLOR)
+       if(prop->type == PROP_FLOAT && (prop->subtype==PROP_COLOR || prop->subtype==PROP_COLOR_GAMMA))
                if(strcmp(dp->dnatype, "float") != 0 && strcmp(dp->dnatype, "double") != 0)
                        return 1;
        
@@@ -2280,7 -2280,6 +2280,7 @@@ RNAProcessItem PROCESS_ITEMS[]= 
        {"rna_key.c", NULL, RNA_def_key},
        {"rna_lamp.c", NULL, RNA_def_lamp},
        {"rna_lattice.c", NULL, RNA_def_lattice},
 +      {"rna_linestyle.c", NULL, RNA_def_linestyle},
        {"rna_main.c", "rna_main_api.c", RNA_def_main},
        {"rna_material.c", "rna_material_api.c", RNA_def_material},
        {"rna_mesh.c", "rna_mesh_api.c", RNA_def_mesh},
index 9845526f02372f5cc86140b0f92fbea522810ab1,cae9e5bb974a1576f31f535c612cdbd4b7ffe5ff..86f00fcfcaa1b7470e82ddfddeb8007bda26b577
@@@ -142,7 -142,6 +142,7 @@@ void RNA_def_image(struct BlenderRNA *b
  void RNA_def_key(struct BlenderRNA *brna);
  void RNA_def_lamp(struct BlenderRNA *brna);
  void RNA_def_lattice(struct BlenderRNA *brna);
 +void RNA_def_linestyle(struct BlenderRNA *brna);
  void RNA_def_main(struct BlenderRNA *brna);
  void RNA_def_material(struct BlenderRNA *brna);
  void RNA_def_mesh(struct BlenderRNA *brna);
@@@ -234,6 -233,7 +234,7 @@@ void RNA_api_keyconfig(struct StructRN
  void RNA_api_keyingset(struct StructRNA *srna);
  void RNA_api_keymap(struct StructRNA *srna);
  void RNA_api_keymapitem(struct StructRNA *srna);
+ void RNA_api_area(struct StructRNA *srna);
  void RNA_api_main(struct StructRNA *srna);
  void RNA_api_material(StructRNA *srna);
  void RNA_api_mesh(struct StructRNA *srna);
@@@ -276,7 -276,6 +277,7 @@@ void RNA_def_main_armatures(BlenderRNA 
  void RNA_def_main_actions(BlenderRNA *brna, PropertyRNA *cprop);
  void RNA_def_main_particles(BlenderRNA *brna, PropertyRNA *cprop);
  void RNA_def_main_gpencil(BlenderRNA *brna, PropertyRNA *cprop);
 +void RNA_def_main_linestyles(BlenderRNA *brna, PropertyRNA *cprop);
  
  /* ID Properties */
  
index 8a656f25dc158b0335692c7a515f537c8e648874,b9918ad45ee5eea4d0f87ad3fa4e612817116dde..bc3e4c623ef18ba7fb2cf0cab45c09d7b06f7ade
@@@ -39,7 -39,6 +39,7 @@@ INCLUDE_DIRECTORIES
        ../blender/render/extern/include
        ../blender/makesdna
        ../blender/gpu
 +      ../blender/freestyle
        ../blender/windowmanager
        ../kernel/gen_messaging
        ../kernel/gen_system
@@@ -308,7 -307,6 +308,6 @@@ IF(WITH_INSTALL
                                POST_BUILD
                                MAIN_DEPENDENCY blender
                                COMMAND copy /Y \"${LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\"
-                               # COMMAND copy /Y \"${LIBDIR}\\samplerate\\lib\\libsamplerate-0.dll\" \"${TARGETDIR}\\\"
                        )
                ELSE(CMAKE_CL_64)
                        ADD_CUSTOM_COMMAND(TARGET blender
                                COMMAND copy /Y \"${LIBDIR}\\gettext\\lib\\gnu_gettext.dll\" \"${TARGETDIR}\\\"
                                COMMAND copy /Y \"${LIBDIR}\\png\\lib\\libpng.dll\" \"${TARGETDIR}\\\"
                                COMMAND copy /Y \"${LIBDIR}\\zlib\\lib\\zlib.dll\" \"${TARGETDIR}\\\"
-                               # COMMAND copy /Y \"${LIBDIR}\\samplerate\\lib\\libsamplerate-0.dll\" \"${TARGETDIR}\\\"
                        )
                ENDIF(CMAKE_CL_64)
                
                                ADD_CUSTOM_COMMAND(TARGET blender
                                        POST_BUILD
                                        MAIN_DEPENDENCY blender
-                                       COMMAND copy /Y \"${LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\"
-                                       COMMAND copy /Y \"${LIBDIR}\\release\\python31_d.zip\" \"${TARGETDIR}\\\"
-                                       COMMAND copy /Y \"${LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\"
-                                       COMMAND copy /Y \"${LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\\"
+                                       COMMAND if not exist \"${TARGETDIR}\\${BLENDER_VERSION}\\python\\lib\" mkdir \"${TARGETDIR}\\${BLENDER_VERSION}\\python\\lib\"
+                                       COMMAND if \"$(ConfigurationName)\" == \"Debug\" copy /Y \"${LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\"
+                                       COMMAND if \"$(ConfigurationName)\" == \"Debug\" xcopy /E /Y \"${LIBDIR}\\release\\python31_d\\*.*\" \"${TARGETDIR}\\${BLENDER_VERSION}\\python\\lib\\\"
+                                       COMMAND if \"$(ConfigurationName)\" == \"RelWithDebInfo\" copy /Y \"${LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\"
+                                       COMMAND if \"$(ConfigurationName)\" == \"RelWithDebInfo\" xcopy /E /Y \"${LIBDIR}\\release\\python31_d\\*.*\" \"${TARGETDIR}\\${BLENDER_VERSION}\\python\\lib\\\"
+                                       COMMAND if \"$(ConfigurationName)\" == \"Release\" copy /Y \"${LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\"
+                                       COMMAND if \"$(ConfigurationName)\" == \"Release\" xcopy /E /Y \"${LIBDIR}\\release\\python31\\*.*\" \"${TARGETDIR}\\${BLENDER_VERSION}\\python\\lib\\\"
+                                       COMMAND if \"$(ConfigurationName)\" == \"MinSizeRel\" copy /Y \"${LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\"
+                                       COMMAND if \"$(ConfigurationName)\" == \"MinSizeRel\" xcopy /E /Y \"${LIBDIR}\\release\\python31\\*.*\" \"${TARGETDIR}\\${BLENDER_VERSION}\\python\\lib\\\"
                                )
                        ELSE(NOT CMAKE_BUILD_TYPE)
                                IF(CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
                                                POST_BUILD
                                                MAIN_DEPENDENCY blender
                                                COMMAND copy /Y \"${LIBDIR}\\python\\lib\\python31_d.dll\" \"${TARGETDIR}\\\"
-                                               COMMAND copy /Y \"${LIBDIR}\\release\\python31_d.zip\" \"${TARGETDIR}\\\"
+                                               COMMAND xcopy /E /Y \"${LIBDIR}\\release\\python31_d\\*.*\" \"${TARGETDIR}\\${BLENDER_VERSION}\\python\\lib\\\"
                                        )
                                ELSE(CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
                                        ADD_CUSTOM_COMMAND(TARGET blender
                                                POST_BUILD
                                                MAIN_DEPENDENCY blender
                                                COMMAND copy /Y \"${LIBDIR}\\python\\lib\\python31.dll\" \"${TARGETDIR}\\\"
-                                               COMMAND copy /Y \"${LIBDIR}\\release\\python31.zip\" \"${TARGETDIR}\\\"
+                                               COMMAND xcopy /E /Y \"${LIBDIR}\\release\\python31\\*.*\" \"${TARGETDIR}\\${BLENDER_VERSION}\\python\\lib\\\"
                                        )
                                ENDIF(CMAKE_BUILD_TYPE STREQUAL Debug OR CMAKE_BUILD_TYPE STREQUAL RelWithDebInfo)
                        ENDIF(NOT CMAKE_BUILD_TYPE)
                                COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avformat-52.dll\" \"${TARGETDIR}\\\"
                                COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avdevice-52.dll\" \"${TARGETDIR}\\\"
                                COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\avutil-50.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libfaac-0.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libfaad-2.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libmp3lame-0.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\libx264-67.dll\" \"${TARGETDIR}\\\"
                                COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\swscale-0.dll\" \"${TARGETDIR}\\\"
-                               COMMAND copy /Y \"${LIBDIR}\\ffmpeg\\lib\\xvidcore.dll\" \"${TARGETDIR}\\\"
                        )
                ENDIF(WITH_FFMPEG)
  
@@@ -505,7 -502,6 +503,7 @@@ ENDIF(CMAKE_SYSTEM_NAME MATCHES "Linux"
                bf_intern_opennl 
                bf_python 
                bf_python_ext 
 +              bf_freestyle
                bf_ikplugin
                bf_modifiers
                bf_blenkernel
diff --combined source/creator/creator.c
index 922e3a71d7646825d9491b945ddaac7d882caa67,8e17bec361fe89f2201d2817ce8eeba09b901063..6b08c3c6a51fa909b200ffbec519874e6ce22b5f
@@@ -96,8 -96,6 +96,8 @@@
  #include "GPU_draw.h"
  #include "GPU_extensions.h"
  
 +#include "FRS_freestyle.h"
 +
  /* for passing information between creator and gameengine */
  #include "SYS_System.h"
  
@@@ -995,7 -993,7 +995,7 @@@ void setupArguments(bContext *C, bArgs 
        BLI_argsAdd(ba, 4, "-E", "--engine", "<engine>\n\tSpecify the render engine\n\tuse -E help to list available engines", set_engine, C);
  
        BLI_argsAdd(ba, 4, "-F", "--render-format", format_doc, set_image_type, C);
-       BLI_argsAdd(ba, 4, "-t", "--threads", "<threads>\n\tUse amount of <threads> for rendering in background\n\t[1-" QUOTE(BLENDER_MAX_THREADS) "], 0 for systems processor count.", set_threads, NULL);
+       BLI_argsAdd(ba, 4, "-t", "--threads", "<threads>\n\tUse amount of <threads> for rendering in background\n\t[1-" STRINGIFY(BLENDER_MAX_THREADS) "], 0 for systems processor count.", set_threads, NULL);
        BLI_argsAdd(ba, 4, "-x", "--use-extension", "<bool>\n\tSet option to add the file extension to the end of the file", set_extension, C);
  
  }
@@@ -1130,10 -1128,6 +1130,10 @@@ int main(int argc, char **argv
        CTX_py_init_set(C, 1);
        WM_keymap_init(C);
  
 +      /* initialize Freestyle */
 +      FRS_initialize();
 +      FRS_set_context(C);
 +
        /* OK we are ready for it */
        BLI_argsParse(ba, 4, load_file, C);