Merged changes in the trunk up to revision 47977.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Fri, 15 Jun 2012 22:18:25 +0000 (22:18 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Fri, 15 Jun 2012 22:18:25 +0000 (22:18 +0000)
22 files changed:
1  2 
doc/python_api/sphinx_doc_gen.py
release/scripts/startup/bl_ui/space_view3d.py
source/blender/blenkernel/intern/anim_sys.c
source/blender/blenkernel/intern/object.c
source/blender/blenlib/CMakeLists.txt
source/blender/blenloader/intern/readfile.c
source/blender/bmesh/intern/bmesh_operators.h
source/blender/bmesh/operators/bmo_utils.c
source/blender/editors/mesh/editmesh_select.c
source/blender/editors/space_view3d/drawobject.c
source/blender/editors/transform/transform.c
source/blender/makesdna/DNA_ID.h
source/blender/makesdna/DNA_action_types.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesdna/DNA_userdef_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_color.c
source/blender/makesrna/intern/rna_userdef.c
source/blender/render/intern/source/convertblender.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/render_result.c
source/creator/creator.c

Simple merge
Simple merge
Simple merge
Simple merge
index c37d7e0e5d8a35fb8b2564288f93ef343337665c,eab152262f8cd560f3f89ef2173f8da7943845a6..a730868dadd676a710f38832d9d8850f287d5498
@@@ -712,11 -709,11 +712,11 @@@ static RenderPart *find_next_pano_slice
        }
                        
        if (best) {
-               float phi= panorama_pixel_rot(re);
+               float phi = panorama_pixel_rot(re);
  
-               R.panodxp= (re->winx - (best->disprect.xmin + best->disprect.xmax) )/2;
-               R.panodxv= ((viewplane->xmax-viewplane->xmin)*R.panodxp)/(float)(re->winx);
+               R.panodxp = (re->winx - (best->disprect.xmin + best->disprect.xmax) ) / 2;
+               R.panodxv = ((viewplane->xmax - viewplane->xmin) * R.panodxp) / (float)(re->winx);
 -
 +              
                /* shift viewplane */
                R.viewplane.xmin = viewplane->xmin + R.panodxv;
                R.viewplane.xmax = viewplane->xmax + R.panodxv;
@@@ -1385,78 -1375,11 +1385,78 @@@ static void ntree_render_scenes(Render 
  /* bad call... need to think over proper method still */
  static void render_composit_stats(void *UNUSED(arg), char *str)
  {
-       R.i.infostr= str;
+       R.i.infostr = str;
        R.stats_draw(R.sdh, &R.i);
-       R.i.infostr= NULL;
+       R.i.infostr = NULL;
  }
  
 +/* invokes Freestyle stroke rendering */
 +static void add_freestyle(Render *re)
 +{
 +      SceneRenderLayer *srl, *actsrl;
 +      LinkData *link;
 +
 +      actsrl = BLI_findlink(&re->r.layers, re->r.actlay);
 +
 +      FRS_init_stroke_rendering(re);
 +
 +      for (srl= (SceneRenderLayer *)re->r.layers.first; srl; srl= srl->next) {
 +
 +              link = (LinkData *)MEM_callocN(sizeof(LinkData), "LinkData to Freestyle render");
 +              BLI_addtail(&re->freestyle_renders, link);
 +
 +              if ((re->r.scemode & R_SINGLE_LAYER) && srl != actsrl)
 +                      continue;
 +              if (FRS_is_freestyle_enabled(srl)) {
 +                      link->data = (void *)FRS_do_stroke_rendering(re, srl);
 +              }
 +      }
 +
 +      FRS_finish_stroke_rendering(re);
 +}
 +
 +/* merges the results of Freestyle stroke rendering into a given render result */
 +static void composite_freestyle_renders(Render *re, int sample)
 +{
 +      Render *freestyle_render;
 +      SceneRenderLayer *srl, *actsrl;
 +      LinkData *link;
 +
 +      actsrl = BLI_findlink(&re->r.layers, re->r.actlay);
 +
 +      link = (LinkData *)re->freestyle_renders.first;
 +      for (srl= (SceneRenderLayer *)re->r.layers.first; srl; srl= srl->next) {
 +              if ((re->r.scemode & R_SINGLE_LAYER) && srl != actsrl)
 +                      continue;
 +              if (FRS_is_freestyle_enabled(srl)) {
 +                      freestyle_render = (Render *)link->data;
 +                      render_result_exr_file_read(freestyle_render, sample);
 +                      FRS_composite_result(re, srl, freestyle_render);
 +                      RE_FreeRenderResult(freestyle_render->result);
 +                      freestyle_render->result = NULL;
 +              }
 +              link = link->next;
 +      }
 +}
 +
 +/* releases temporary scenes and renders for Freestyle stroke rendering */
 +static void free_all_freestyle_renders(Scene *scene)
 +{
 +      Render *re1, *freestyle_render;
 +      LinkData *link;
 +
 +      for (re1= RenderGlobal.renderlist.first; re1; re1= re1->next) {
 +              for (link = (LinkData *)re1->freestyle_renders.first; link; link = link->next) {
 +                      if (link->data) {
 +                              freestyle_render = (Render *)link->data;
 +                              BKE_scene_unlink(G.main, freestyle_render->scene, scene);
 +                              RE_FreeRender(freestyle_render);
 +                      }
 +              }
 +              BLI_freelistN( &re1->freestyle_renders );
 +      }
 +}
 +
  
  /* reads all buffers, calls optional composite, merges in first result->rectf */
  static void do_merge_fullsample(Render *re, bNodeTree *ntree)
@@@ -1689,10 -1610,8 +1689,10 @@@ static void do_render_composite_fields_
                        do_merge_fullsample(re, NULL);
        }
  
 +      free_all_freestyle_renders(re->scene);
 +
        /* weak... the display callback wants an active renderlayer pointer... */
-       re->result->renlay= render_get_active_layer(re, re->result);
+       re->result->renlay = render_get_active_layer(re, re->result);
        re->display_draw(re->ddh, re->result, NULL);
  }
  
@@@ -2143,18 -2062,9 +2143,18 @@@ void RE_BlenderFrame(Render *re, Main *
        BLI_callback_exec(re->main, (ID *)scene, G.afbreek ? BLI_CB_EVT_RENDER_CANCEL : BLI_CB_EVT_RENDER_COMPLETE);
  
        /* UGLY WARNING */
-       G.rendering= 0;
+       G.rendering = 0;
  }
  
 +void RE_RenderFreestyleStrokes(Render *re, Main *bmain, Scene *scene)
 +{
 +      re->result_ok= 0;
 +      if(render_initialize_from_main(re, bmain, scene, NULL, NULL, scene->lay, 0, 0)) {
 +              do_render_fields_blur_3d(re);
 +      }
 +      re->result_ok= 1;
 +}
 +
  static int do_write_image_or_movie(Render *re, Main *bmain, Scene *scene, bMovieHandle *mh, const char *name_override)
  {
        char name[FILE_MAX];
index 968e78899c35df627ab2ade0d1300ca47c18cc02,6f572b43a157fa5952627007a690e2248b077927..745ce77bdda59f33e02ca10075d305b3c39ef5df
@@@ -549,15 -547,14 +549,15 @@@ RenderResult *render_result_new(Render 
                        IMB_exr_add_channel(rr->exrhandle, rl->name, "Combined.A", 0, 0, NULL);
                }
                else
-                       rl->rectf= MEM_mapallocN(rectx*recty*sizeof(float)*4, "Combined rgba");
+                       rl->rectf = MEM_mapallocN(rectx * recty * sizeof(float) * 4, "Combined rgba");
                
                /* note, this has to be in sync with scene.c */
-               rl->lay= (1<<20) -1;
-               rl->layflag= 0x7FFF;    /* solid ztra halo strand */
-               rl->passflag= SCE_PASS_COMBINED;
+               rl->lay = (1 << 20) - 1;
+               rl->layflag = 0x7FFF;    /* solid ztra halo strand */
+               rl->passflag = SCE_PASS_COMBINED;
 +              FRS_add_freestyle_config( srl );
                
-               re->r.actlay= 0;
+               re->r.actlay = 0;
        }
        
        /* border render; calculate offset for use in compositor. compo is centralized coords */
index b1cfabcd5bc95ec82ea59a7c438fc581fddfb496,51846c8936e44e3230d3047176a876370c74dda4..abfd735c124b3eec87f23268bed926a6e6204270
@@@ -1329,14 -1337,14 +1339,18 @@@ int main(int argc, const 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 */
+ #ifndef WITH_PYTHON_MODULE
        BLI_argsParse(ba, 4, load_file, C);
+ #endif
  
+ #ifndef WITH_PYTHON_MODULE
        BLI_argsFree(ba);
+ #endif
  
  #ifdef WIN32
        while (argci) {