Merged changes to revision 25007.
authorTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Mon, 30 Nov 2009 00:08:30 +0000 (00:08 +0000)
committerTamito Kajiyama <rd6t-kjym@asahi-net.or.jp>
Mon, 30 Nov 2009 00:08:30 +0000 (00:08 +0000)
The following files were according to the Math Lib reorganization
(see the commit log of revision 24464 for more information):
source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h

The file release/scripts/ui/properties_render.py was also updated
according the RNA UI API renaming in revision 24795.

21 files changed:
1  2 
release/scripts/ui/properties_render.py
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenkernel/intern/scene.c
source/blender/blenloader/intern/readfile.c
source/blender/editors/CMakeLists.txt
source/blender/editors/render/SConscript
source/blender/editors/render/render_shading.c
source/blender/editors/screen/screen_ops.c
source/blender/freestyle/intern/blender_interface/BlenderFileLoader.cpp
source/blender/freestyle/intern/blender_interface/BlenderFileLoader.h
source/blender/makesdna/DNA_scene_types.h
source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_scene.c
source/blender/python/intern/bpy_interface.c
source/blender/render/CMakeLists.txt
source/blender/render/SConscript
source/blender/render/intern/source/pipeline.c
source/blender/windowmanager/CMakeLists.txt
source/blender/windowmanager/SConscript
source/creator/creator.c

index ddc0b552634040615239f79ab77d752735495d0e,35f52552e6bae02bde5a2d25c723c6903895e4c3..913ff98976c33445e3bbe256758cc1f6c7a59c0a
@@@ -86,22 -103,21 +103,22 @@@ class RENDER_PT_layers(RenderButtonsPan
          split = layout.split()
  
          col = split.column()
-         col.itemR(rl, "zmask")
+         col.prop(rl, "zmask")
          row = col.row()
-         row.itemR(rl, "zmask_negate", text="Negate")
+         row.prop(rl, "zmask_negate", text="Negate")
          row.active = rl.zmask
-         col.itemR(rl, "all_z")
+         col.prop(rl, "all_z")
  
          col = split.column()
-         col.itemR(rl, "solid")
-         col.itemR(rl, "halo")
-         col.itemR(rl, "ztransp")
-         col.itemR(rl, "sky")
+         col.prop(rl, "solid")
+         col.prop(rl, "halo")
+         col.prop(rl, "ztransp")
 -
 -        col = split.column()
+         col.prop(rl, "sky")
 +              
 +        col = split.column()
-         col.itemR(rl, "edge")
-         col.itemR(rl, "strand")
-         col.itemR(rl, "freestyle")
+         col.prop(rl, "edge")
+         col.prop(rl, "strand")
++        col.prop(rl, "freestyle")
  
          if rl.zmask:
              split = layout.split()
          split = layout.split()
  
          col = split.column()
-         col.itemL(text="Passes:")
-         col.itemR(rl, "pass_combined")
-         col.itemR(rl, "pass_z")
-         col.itemR(rl, "pass_vector")
-         col.itemR(rl, "pass_normal")
-         col.itemR(rl, "pass_uv")
-         col.itemR(rl, "pass_mist")
-         col.itemR(rl, "pass_object_index")
-         col = split.column()
-         col.itemL()
-         col.itemR(rl, "pass_color")
-         col.itemR(rl, "pass_diffuse")
+         col.label(text="Passes:")
+         col.prop(rl, "pass_combined")
+         col.prop(rl, "pass_z")
+         col.prop(rl, "pass_vector")
+         col.prop(rl, "pass_normal")
+         col.prop(rl, "pass_uv")
+         col.prop(rl, "pass_mist")
+         col.prop(rl, "pass_object_index")
+         if wide_ui:
+             col = split.column()
+         col.label()
+         col.prop(rl, "pass_color")
+         col.prop(rl, "pass_diffuse")
          row = col.row()
-         row.itemR(rl, "pass_specular")
-         row.itemR(rl, "pass_specular_exclude", text="", icon='ICON_X')
+         row.prop(rl, "pass_specular")
+         row.prop(rl, "pass_specular_exclude", text="", icon='ICON_X')
          row = col.row()
-         row.itemR(rl, "pass_shadow")
-         row.itemR(rl, "pass_shadow_exclude", text="", icon='ICON_X')
+         row.prop(rl, "pass_shadow")
+         row.prop(rl, "pass_shadow_exclude", text="", icon='ICON_X')
          row = col.row()
-         row.itemR(rl, "pass_ao")
-         row.itemR(rl, "pass_ao_exclude", text="", icon='ICON_X')
+         row.prop(rl, "pass_ao")
+         row.prop(rl, "pass_ao_exclude", text="", icon='ICON_X')
          row = col.row()
-         row.itemR(rl, "pass_reflection")
-         row.itemR(rl, "pass_reflection_exclude", text="", icon='ICON_X')
+         row.prop(rl, "pass_reflection")
+         row.prop(rl, "pass_reflection_exclude", text="", icon='ICON_X')
          row = col.row()
-         row.itemR(rl, "pass_refraction")
-         row.itemR(rl, "pass_refraction_exclude", text="", icon='ICON_X')
+         row.prop(rl, "pass_refraction")
+         row.prop(rl, "pass_refraction_exclude", text="", icon='ICON_X')
  
-             layout.itemS()
 +        if rl.freestyle:
-             col.itemL(text="Freestyle:")
++            layout.separator()
 +
 +            split = layout.split()
 +
 +            col = split.column()
-             col.itemR(freestyle, "sphere_radius", text="Sphere Radius")
-             col.itemR(freestyle, "ridges_and_valleys", text="Ridges and Valleys")
-             col.itemR(freestyle, "suggestive_contours", text="Suggestive Contours")
-             col.itemR(freestyle, "dkr_epsilon", text="Dkr Epsilon")
++            col.label(text="Freestyle:")
 +            freestyle = rl.freestyle_settings
-             col.itemO("scene.freestyle_module_add", text="Add Style Module")
++            col.prop(freestyle, "sphere_radius", text="Sphere Radius")
++            col.prop(freestyle, "ridges_and_valleys", text="Ridges and Valleys")
++            col.prop(freestyle, "suggestive_contours", text="Suggestive Contours")
++            col.prop(freestyle, "dkr_epsilon", text="Dkr Epsilon")
 +
-                     row.itemR(module, "is_displayed", text="")
-                     row.itemR(module, "module_path", text="")
-                     row.itemO("scene.freestyle_module_remove", icon='ICON_X', text="")
-                     props = row.itemO("scene.freestyle_module_move_up", icon='VICON_MOVE_UP', text="", properties=True)
++            col.operator("scene.freestyle_module_add", text="Add Style Module")
 +
 +            for i, module in enumerate(freestyle.modules):
 +                    box = layout.box()
 +                    box.set_context_pointer("freestyle_module", module)
 +                    row = box.row(align=True)
-                     props = row.itemO("scene.freestyle_module_move_down", icon='VICON_MOVE_DOWN', text="", properties=True)
++                    row.prop(module, "is_displayed", text="")
++                    row.prop(module, "module_path", text="")
++                    row.operator("scene.freestyle_module_remove", icon='ICON_X', text="")
++                    props = row.operator("scene.freestyle_module_move_up", icon='VICON_MOVE_UP', text="")
 +                    props.active = (i > 0)
++                    props = row.operator("scene.freestyle_module_move_down", icon='VICON_MOVE_DOWN', text="")
 +                    props.active = (i < len(freestyle.modules) - 1)
 +
  
  class RENDER_PT_shading(RenderButtonsPanel):
      bl_label = "Shading"
@@@ -258,25 -255,23 +283,29 @@@ class RENDER_PT_post_processing(RenderB
          split = layout.split()
  
          col = split.column()
-         col.itemR(rd, "fields", text="Fields")
+         col.prop(rd, "fields", text="Fields")
          sub = col.column()
          sub.active = rd.fields
-         sub.row().itemR(rd, "field_order", expand=True)
-         sub.itemR(rd, "fields_still", text="Still")
+         sub.row().prop(rd, "field_order", expand=True)
+         sub.prop(rd, "fields_still", text="Still")
  
-         col = split.column()
-         col.itemR(rd, "edge")
+         if wide_ui:
+             col = split.column()
+         else:
+             col.separator()
+         col.prop(rd, "edge")
          sub = col.column()
          sub.active = rd.edge
-         sub.itemR(rd, "edge_threshold", text="Threshold", slider=True)
-         sub.itemR(rd, "edge_color", text="")
+         sub.prop(rd, "edge_threshold", text="Threshold", slider=True)
+         sub.prop(rd, "edge_color", text="")
  
-         layout.itemS()
++        layout.separator()
 +
 +        split = layout.split()
 +        col = split.column()
-         col.itemR(rd, "freestyle", text="Freestyle")
++        col.prop(rd, "freestyle", text="Freestyle")
 +
  
  class RENDER_PT_output(RenderButtonsPanel):
      bl_label = "Output"
Simple merge
index 99dbd9b6140a737dbb5203b31e71760045e442a6,27cb3ad834be20b590feeb2c7a62fda93e74400c..538414267282c6060717e2a76c6af08e79598b96
  #include "BPY_extern.h"
  #endif
  
- #include "BLI_arithb.h"
+ #include "BLI_math.h"
  #include "BLI_blenlib.h"
  
 +#include "FRS_freestyle_config.h"
 +
  //XXX #include "nla.h"
  
  #ifdef WIN32
Simple merge
index ab1c0d1169123d4b1e0a0e77782fac4e0aedf4d1,b1b1165a1fe178be9845bd430e8a10bee0d5eaec..5f5f5138d06dc57de00424f611d530484d7b5c9d
@@@ -5,7 -5,7 +5,7 @@@ sources = env.Glob('*.c'
  
  incs = '../include ../../blenlib ../../blenkernel ../../makesdna ../../imbuf'
  incs += ' ../../windowmanager #/intern/guardedalloc #/extern/glew/include'
- incs += ' #/intern/guardedalloc ../../gpu ../../freestyle'
 -incs += ' ../../gpu'
++incs += ' ../../gpu ../../freestyle'
  incs += ' ../../makesrna ../../render/extern/include  #/intern/elbeem/extern'
  incs += ' ../../blenloader'
  
index f70cdaf8720a4ca7e0ef3ee2ff6d5e70b36a8e92,0000000000000000000000000000000000000000..114dd1bc7e2265f7d13f1c62c918a2e566239e35
mode 100644,000000..100644
--- /dev/null
@@@ -1,416 -1,0 +1,416 @@@
-       Mat4MulMat4(M, obr->ob->imat, obr->ob->obmat); 
 +#include "BlenderFileLoader.h"
 +
 +BlenderFileLoader::BlenderFileLoader(Render *re, SceneRenderLayer* srl)
 +{
 +      _re = re;
 +      _srl = srl;
 +  _Scene = NULL;
 +  _numFacesRead = 0;
 +  _minEdgeSize = DBL_MAX;
 +}
 +
 +BlenderFileLoader::~BlenderFileLoader()
 +{
 +  _Scene = NULL;
 +}
 +
 +NodeGroup* BlenderFileLoader::Load()
 +{
 +      ObjectInstanceRen *obi;
 +      ObjectRen *obr;
 +
 +      cout << "\n===  Importing triangular meshes into Blender  ===" << endl;
 +
 +  // creation of the scene root node
 +  _Scene = new NodeGroup;
 +
 +      int id = 0;
 +      for(obi= (ObjectInstanceRen *) _re->instancetable.first; obi; obi=obi->next) {
 +              if (!(obi->lay & _re->scene->lay & _srl->lay))
 +                      continue;
 +
 +              obr= obi->obr;
 +              
 +              if( obr->totvlak > 0)
 +                      insertShapeNode(obr, ++id);
 +              else
 +                      cout << "  Sorry, only vlak-based shapes are supported." << endl;
 +      }
 +
 +  //Returns the built scene.
 +  return _Scene;
 +}
 +
 +void BlenderFileLoader::insertShapeNode(ObjectRen *obr, int id)
 +{
 +              VlakRen *vlr;
 +      
 +      float minBBox[3];
 +      float maxBBox[3];
 +      
 +      NodeTransform *currentMesh = new NodeTransform;
 +      NodeShape * shape;
 +      
 +      // Mesh *mesh = (Mesh *)ob->data;
 +      //---------------------
 +      // mesh => obr
 +      
 +      // builds the shape:
 +      shape = new NodeShape;
 +      
 +      // We invert the matrix in order to be able to retrieve the shape's coordinates in its local coordinates system (origin is the iNode pivot)
 +      // Lib3dsMatrix M;
 +      // lib3ds_matrix_copy(M, mesh->matrix);
 +      // lib3ds_matrix_inv(M);
 +      //---------------------
 +      // M allows to recover world coordinates from camera coordinates
 +      // M => obr->ob->imat * obr->obmat  (multiplication from left to right)
 +      float M[4][4];
-       Mat4MulVecfl( M, pvtmp);
++      mul_m4_m4m4(M, obr->ob->imat, obr->ob->obmat); 
 +      
 +      // We compute a normal per vertex and manages the smoothing of the shape:
 +      // Lib3dsVector *normalL=(Lib3dsVector*)malloc(3*sizeof(Lib3dsVector)*mesh->faces);
 +      // lib3ds_mesh_calculate_normals(mesh, normalL);
 +      // mesh_calc_normals(mesh->mvert, mesh->totvert, mesh->mface, mesh->totface, NULL);
 +      //---------------------
 +      // already calculated and availabe in vlak ?    
 +      
 +      // We build the rep:
 +      IndexedFaceSet *rep;
 +      unsigned numFaces = 0;
 +      for(int a=0; a < obr->totvlak; a++) {
 +              if((a & 255)==0) vlr= obr->vlaknodes[a>>8].vlak;
 +              else vlr++;
 +      
 +              if(vlr->v4)
 +                      numFaces += 2;
 +              else
 +                      numFaces++;
 +      }
 +      
 +      unsigned vSize = 3*3*numFaces;
 +      float *vertices = new float[vSize];
 +      unsigned nSize = vSize;
 +      float *normals = new float[nSize];
 +      unsigned *numVertexPerFaces = new unsigned[numFaces];
 +      vector<FrsMaterial> meshFrsMaterials;
 +      
 +      IndexedFaceSet::TRIANGLES_STYLE *faceStyle = new IndexedFaceSet::TRIANGLES_STYLE[numFaces];
 +      unsigned i;
 +      for (i = 0; i <numFaces; i++) {
 +        faceStyle[i] = IndexedFaceSet::TRIANGLES;
 +        numVertexPerFaces[i] = 3;
 +      }
 +      
 +      unsigned viSize = 3*numFaces;
 +      unsigned *VIndices = new unsigned[viSize];
 +      unsigned niSize = viSize;
 +      unsigned *NIndices = new unsigned[niSize];
 +      unsigned *MIndices = new unsigned[viSize]; // Material Indices
 +      
 +      
 +      float *pv = vertices;
 +      float *pn = normals;
 +      unsigned *pvi = VIndices;
 +      unsigned *pni = NIndices;
 +      unsigned *pmi = MIndices;
 +      
 +      unsigned currentIndex = 0;
 +      unsigned currentMIndex = 0;
 +      
 +      FrsMaterial tmpMat;
 +      
 +      // we want to find the min and max coordinates as we build the rep. 
 +      // We initialize the min and max values whith the first vertex.
 +      //lib3ds_vector_transform(pvtmp, M, mesh->pointL[mesh->faceL[0].points[0]].pos);
 +      float pvtmp[3];
 +      pvtmp[0] = obr->vertnodes[0].vert->co[0];
 +      pvtmp[1] = obr->vertnodes[0].vert->co[1];
 +      pvtmp[2] = obr->vertnodes[0].vert->co[2];
 +      
-                               Mat4MulVecfl( M, pv);
++      mul_m4_v3( M, pvtmp);
 +      
 +      minBBox[0] = pvtmp[0];
 +      maxBBox[0] = pvtmp[0];
 +      minBBox[1] = pvtmp[1];
 +      maxBBox[1] = pvtmp[1];
 +      minBBox[2] = pvtmp[2];
 +      maxBBox[2] = pvtmp[2];
 +      
 +      int p;
 +      real vert[3][3];
 +      real norm;
 +      for(p=0; p < obr->totvlak; ++p) // we parse the faces of the mesh
 +      {
 +                      VertRen * fv[3];
 +              
 +                // Lib3dsFace *f=&mesh->faceL[p];
 +                // Lib3dsMaterial *mat=0;
 +                      if((p & 255)==0) vlr = obr->vlaknodes[p>>8].vlak;
 +                      else vlr++;
 +                      Material *mat = vlr->mat;
 +      
 +                      if (mat) 
 +                      {
 +                          tmpMat.setDiffuse( mat->r, mat->g, mat->b, mat->alpha );
 +                          tmpMat.setSpecular( mat->specr, mat->specg, mat->specb, mat->spectra);
 +                          float s = 1.0 * (mat->har + 1) / 4 ; // in Blender: [1;511] => in OpenGL: [0;128]
 +                          if(s > 128.f)
 +                            s = 128.f;
 +                          tmpMat.setShininess(s);
 +                      }
 +        
 +                      if(meshFrsMaterials.empty())
 +                      {
 +                              meshFrsMaterials.push_back(tmpMat);
 +                      shape->setFrsMaterial(tmpMat);
 +                      } else {
 +                      // find if the material is aleady in the list
 +                      unsigned i=0;
 +                      bool found = false;
 +              
 +                      for(vector<FrsMaterial>::iterator it=meshFrsMaterials.begin(), itend=meshFrsMaterials.end();
 +                              it!=itend;
 +                              ++it){
 +                                      if(*it == tmpMat){
 +                                              currentMIndex = i;
 +                                              found = true;
 +                                              break;
 +                                      }
 +                                      ++i;
 +                      }
 +              
 +                      if(!found){
 +                              meshFrsMaterials.push_back(tmpMat);
 +                              currentMIndex = meshFrsMaterials.size()-1;
 +                      }
 +                      }
 +      
 +                      unsigned j;
 +                      fv[0] = vlr->v1;
 +                      fv[1] = vlr->v2;
 +                      fv[2] = vlr->v3;
 +                      float *pv_ptr[3];
 +                      for(i=0; i<3; ++i) // we parse the vertices of the face f
 +                      {
 +      
 +                              //lib3ds_vector_transform(pv, M, mesh->pointL[f->points[i]].pos); //fills the cells of the pv array
 +                              for(j=0; j<3; j++)
 +                                      pv[j] = fv[i]->co[j];
-                       Crossf(n, vec01, vec02);
-                       Normalize(n);
++                              mul_m4_v3( M, pv);
 +      
 +                              for(j=0; j<3; j++) // we parse the xyz coordinates of the vertex i
 +                              {
 +                                      if(minBBox[j] > pv[j])
 +                                      minBBox[j] = pv[j];
 +      
 +                                      if(maxBBox[j] < pv[j])
 +                                      maxBBox[j] = pv[j];
 +      
 +                                      vert[i][j] = pv[j];
 +                              }
 +                              
 +                              pv_ptr[i] = pv;
 +                              *pvi = currentIndex;
 +                              *pmi = currentMIndex;
 +
 +                              currentIndex +=3;
 +                              pv += 3;
 +
 +                              pvi++;
 +                              pmi++;
 +                      }
 +                      
 +                      currentIndex -= 9;
 +                                              
 +                      float vec01[3];
 +                      vec01[0] = pv_ptr[1][0] - pv_ptr[0][0]; 
 +                      vec01[1] = pv_ptr[1][1] - pv_ptr[0][1];
 +                      vec01[2] = pv_ptr[1][2] - pv_ptr[0][2];
 +                      
 +                      float vec02[3];
 +                      vec02[0] = pv_ptr[2][0] - pv_ptr[0][0]; 
 +                      vec02[1] = pv_ptr[2][1] - pv_ptr[0][1];
 +                      vec02[2] = pv_ptr[2][2] - pv_ptr[0][2];
 +                      
 +                      float n[3];
-                                       Mat4MulVecfl( M, pv);
++                      cross_v3_v3v3(n, vec01, vec02);
++                      normalize_v3(n);
 +                      
 +                      for(i=0; i<3; ++i) {
 +                              for(j=0; j<3; ++j) {
 +                                      pn[j] = n[j];
 +                              }
 +                              *pni = currentIndex;
 +
 +                              pn += 3;
 +                              pni++;
 +
 +                              currentIndex +=3;
 +                      }
 +      
 +                      for(i=0; i<3; i++)
 +                      {
 +                              norm = 0.0;
 +                              
 +                              for (unsigned j = 0; j < 3; j++)
 +                                      norm += (vert[i][j] - vert[(i+1)%3][j])*(vert[i][j] - vert[(i+1)%3][j]);
 +              
 +                              norm = sqrt(norm);
 +                              if(_minEdgeSize > norm)
 +                                      _minEdgeSize = norm;
 +                      }
 +                      
 +                      ++_numFacesRead;
 +
 +                      
 +                      if(vlr->v4){
 +
 +                              unsigned j;
 +                              fv[0] = vlr->v1;
 +                              fv[1] = vlr->v3;
 +                              fv[2] = vlr->v4;
 +                              float *pv_ptr[3];
 +                              for(i=0; i<3; ++i) // we parse the vertices of the face f
 +                              {
 +
 +                                      //lib3ds_vector_transform(pv, M, mesh->pointL[f->points[i]].pos); //fills the cells of the pv array
 +                                      for(j=0; j<3; j++)
 +                                              pv[j] = fv[i]->co[j];
-                               Crossf(n, vec01, vec02);
-                               Normalize(n);
++                                      mul_m4_v3( M, pv);
 +
 +                                      for(j=0; j<3; j++) // we parse the xyz coordinates of the vertex i
 +                                      {
 +                                              if(minBBox[j] > pv[j])
 +                                              minBBox[j] = pv[j];
 +
 +                                              if(maxBBox[j] < pv[j])
 +                                              maxBBox[j] = pv[j];
 +
 +                                              vert[i][j] = pv[j];
 +                                      }
 +
 +                                      pv_ptr[i] = pv;
 +                                      *pvi = currentIndex;
 +                                      *pmi = currentMIndex;
 +
 +                                      currentIndex +=3;
 +                                      pv += 3;
 +
 +                                      pvi++;
 +                                      pmi++;
 +                              }
 +
 +                              currentIndex -= 9;
 +
 +                              float vec01[3];
 +                              vec01[0] = pv_ptr[1][0] - pv_ptr[0][0]; 
 +                              vec01[1] = pv_ptr[1][1] - pv_ptr[0][1];
 +                              vec01[2] = pv_ptr[1][2] - pv_ptr[0][2];
 +
 +                              float vec02[3];
 +                              vec02[0] = pv_ptr[2][0] - pv_ptr[0][0]; 
 +                              vec02[1] = pv_ptr[2][1] - pv_ptr[0][1];
 +                              vec02[2] = pv_ptr[2][2] - pv_ptr[0][2];
 +
 +                              float n[3];
++                              cross_v3_v3v3(n, vec01, vec02);
++                              normalize_v3(n);
 +                              
 +                              for(i=0; i<3; ++i) {
 +                                      for(j=0; j<3; ++j) {
 +                                              pn[j] = n[j];
 +                                      }
 +                                      *pni = currentIndex;
 +
 +                                      pn += 3;
 +                                      pni++;
 +
 +                                      currentIndex +=3;
 +                              }
 +
 +                              for(i=0; i<3; i++)
 +                              {
 +                                      norm = 0.0;
 +
 +                                      for (unsigned j = 0; j < 3; j++)
 +                                              norm += (vert[i][j] - vert[(i+1)%3][j])*(vert[i][j] - vert[(i+1)%3][j]);
 +
 +                                      norm = sqrt(norm);
 +                                      if(_minEdgeSize > norm)
 +                                              _minEdgeSize = norm;
 +                              }
 +
 +                              ++_numFacesRead;
 +
 +
 +
 +                      }
 +      
 +      }
 +      
 +      // We might have several times the same vertex. We want a clean 
 +      // shape with no real-vertex. Here, we are making a cleaning 
 +      // pass.
 +      real *cleanVertices = NULL;
 +      unsigned   cvSize;
 +      unsigned   *cleanVIndices = NULL;
 +      
 +      GeomCleaner::CleanIndexedVertexArray(
 +        vertices, vSize, 
 +        VIndices, viSize,
 +        &cleanVertices, &cvSize, 
 +        &cleanVIndices);
 +      
 +      real *cleanNormals = NULL;
 +      unsigned   cnSize;
 +      unsigned   *cleanNIndices = NULL;
 +      
 +      GeomCleaner::CleanIndexedVertexArray(
 +        normals, nSize, 
 +        NIndices, niSize,
 +        &cleanNormals, &cnSize, 
 +        &cleanNIndices);
 +      
 +      // format materials array
 +      FrsMaterial** marray = new FrsMaterial*[meshFrsMaterials.size()];
 +      unsigned mindex=0;
 +      for(vector<FrsMaterial>::iterator m=meshFrsMaterials.begin(), mend=meshFrsMaterials.end();
 +          m!=mend;
 +          ++m){
 +        marray[mindex] = new FrsMaterial(*m);
 +        ++mindex;
 +      }
 +      // deallocates memory:
 +      delete [] vertices;
 +      delete [] normals;
 +      delete [] VIndices;
 +      delete [] NIndices;
 +      
 +      // Create the IndexedFaceSet with the retrieved attributes
 +      rep = new IndexedFaceSet(cleanVertices, cvSize, 
 +                               cleanNormals, cnSize,
 +                               marray, meshFrsMaterials.size(),
 +                               0, 0,
 +                               numFaces, numVertexPerFaces, faceStyle,
 +                               cleanVIndices, viSize,
 +                               cleanNIndices, niSize,
 +                               MIndices, viSize,
 +                               0,0,
 +                               0);
 +      // sets the id of the rep
 +      rep->setId(Id(id, 0));
 +      
 +      const BBox<Vec3r> bbox = BBox<Vec3r>(Vec3r(minBBox[0], minBBox[1], minBBox[2]), 
 +                                           Vec3r(maxBBox[0], maxBBox[1], maxBBox[2]));
 +      rep->setBBox(bbox);
 +      shape->AddRep(rep);
 +      
 +      Matrix44r meshMat = Matrix44r::identity();
 +      currentMesh->setMatrix(meshMat);
 +      currentMesh->Translate(0,0,0);
 +      
 +      currentMesh->AddChild(shape);
 +      _Scene->AddChild(currentMesh);
 +      
 +}
index e1a818b4a7f728f66a39bc4eff0de31775008a35,0000000000000000000000000000000000000000..8068eaf1bcf37db0d3695ea7dad036f11298e746
mode 100644,000000..100644
--- /dev/null
@@@ -1,63 -1,0 +1,63 @@@
-       #include "BLI_arithb.h"
 +#ifndef  BLENDER_FILE_LOADER_H
 +# define BLENDER_FILE_LOADER_H
 +
 +# include <string.h>              
 +# include <float.h>
 +
 +# include "../system/FreestyleConfig.h"
 +# include "../scene_graph/NodeGroup.h"
 +# include "../scene_graph/NodeTransform.h"
 +# include "../scene_graph/NodeShape.h"
 +# include "../scene_graph/IndexedFaceSet.h"
 +# include "../geometry/BBox.h"
 +# include "../geometry/Geom.h"
 +# include "../geometry/GeomCleaner.h"
 +
 +#ifdef __cplusplus
 +extern "C" {
 +#endif
 +
 +      #include "DNA_material_types.h"
 +      #include "DNA_scene_types.h"
 +      #include "render_types.h"
 +      #include "renderdatabase.h"
 +      
 +      #include "BKE_mesh.h"
 +      #include "BKE_scene.h"
++      #include "BLI_math.h"
 +      
 +#ifdef __cplusplus
 +}
 +#endif
 +
 +
 +class NodeGroup;
 +
 +class LIB_SCENE_GRAPH_EXPORT BlenderFileLoader
 +{
 +public:
 +  /*! Builds a MaxFileLoader */
 +      BlenderFileLoader(Render *re, SceneRenderLayer* srl);
 +  virtual ~BlenderFileLoader();
 +
 +  /*! Loads the 3D scene and returns a pointer to the scene root node */
 +  NodeGroup * Load();
 +
 +  /*! Gets the number of read faces */
 +  inline unsigned int numFacesRead() {return _numFacesRead;}
 +
 +  /*! Gets the smallest edge size read */
 +  inline real minEdgeSize() {return _minEdgeSize;}
 +
 +protected:
 +      void insertShapeNode(ObjectRen *obr, int id);
 +
 +protected:
 +      Render* _re;
 +      SceneRenderLayer* _srl;
 +  NodeGroup* _Scene;
 +  unsigned _numFacesRead;
 +  real _minEdgeSize;
 +};
 +
 +#endif // BLENDER_FILE_LOADER_H
index f32ad27596095b0851e4f23e91ec7e85eeebb7b5,36653f8c06e7ee89fb38bb3cb6f82368d21daf2b..af67d3d3d5ae04daa4d626a11e2dab92e45291ca
@@@ -203,20 -210,9 +210,10 @@@ extern StructRNA RNA_FModifierGenerator
  extern StructRNA RNA_FModifierLimits;
  extern StructRNA RNA_FModifierNoise;
  extern StructRNA RNA_FModifierPython;
- extern StructRNA RNA_FieldSettings;
- extern StructRNA RNA_FileSelectParams;
- extern StructRNA RNA_FloatProperty;
- extern StructRNA RNA_FloorConstraint;
- extern StructRNA RNA_FluidFluidSettings;
- extern StructRNA RNA_FluidSettings;
- extern StructRNA RNA_FluidSimulationModifier;
+ extern StructRNA RNA_FModifierSound;
  extern StructRNA RNA_FollowPathConstraint;
 +extern StructRNA RNA_FreestyleModuleSettings;
  extern StructRNA RNA_Function;
- extern StructRNA RNA_GPencilFrame;
- extern StructRNA RNA_GPencilLayer;
- extern StructRNA RNA_GPencilStroke;
- extern StructRNA RNA_GPencilStrokePoint;
  extern StructRNA RNA_GameBooleanProperty;
  extern StructRNA RNA_GameFloatProperty;
  extern StructRNA RNA_GameIntProperty;
index bf616ba2a035d13e9642059d0e83ba105f5977ec,9a14717b060f58f12b21123e8e5700653c61bd41..a690c20cde5ed4547f91661e26f26ddaef66dd1f
@@@ -187,10 -188,17 +190,18 @@@ static void bpy_init_modules( void 
                Py_DECREF(py_modpath);
        }
        
-       mod = PyModule_New("bpy");
+       /* stand alone utility modules not related to blender directly */
+       Geometry_Init();
+       Mathutils_Init();
+       BGL_Init();
+       IDProp_Init_Types();
++      Freestyle_Init();
+       mod = PyModule_New("_bpy");
  
        /* add the module so we can import it */
-       PyDict_SetItemString(PySys_GetObject("modules"), "bpy", mod);
+       PyDict_SetItemString(PySys_GetObject("modules"), "_bpy", mod);
        Py_DECREF(mod);
  
        /* run first, initializes rna types */
Simple merge
Simple merge
index 59e9d30093fa2f7b5dfad700693eea9471f7009d,e93b9906dacb9efbe0bf7aba893418f110db29f0..7f1611b7f55645fd22d3b772713dc28ee4959a71
@@@ -36,9 -36,9 +36,10 @@@ SET(INC 
        ../../kernel/gen_system ../readstreamglue
        ../../../intern/elbeem/extern
        ../../../intern/ghost ../../../intern/opennl/extern ../../../extern/glew/include
+       ../python
        ../nodes
        ../gpu
 +      ../freestyle
        ../blenfont
        ${OPENGL_INCLUDE_DIR}
  )
Simple merge