[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21260] branches/blender2.5/blender/source /blender/editors/space_file/file_panels.c: 2.5 file browser

2009-06-30 Thread Andrea Weikert
Revision: 21260
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21260
Author:   elubie
Date: 2009-06-30 08:27:48 +0200 (Tue, 30 Jun 2009)

Log Message:
---
2.5 file browser
* adding GPL copyright header.

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/space_file/file_panels.c

Modified: 
branches/blender2.5/blender/source/blender/editors/space_file/file_panels.c
===
--- branches/blender2.5/blender/source/blender/editors/space_file/file_panels.c 
2009-06-30 05:56:41 UTC (rev 21259)
+++ branches/blender2.5/blender/source/blender/editors/space_file/file_panels.c 
2009-06-30 06:27:48 UTC (rev 21260)
@@ -1,3 +1,31 @@
+/**
+ * $Id$
+ *
+ * * BEGIN GPL LICENSE BLOCK *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. 
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ * 
+ * Contributor(s): Blender Foundation, Andrea Weikert
+ *
+ * * END GPL LICENSE BLOCK *
+ */
+
 #include BKE_context.h
 #include BKE_screen.h
 


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21261] branches/soc-2009-yukishiro/source /blender/sh: fix some silly mistakes

2009-06-30 Thread Jingyuan Huang
Revision: 21261
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21261
Author:   yukishiro
Date: 2009-06-30 08:31:21 +0200 (Tue, 30 Jun 2009)

Log Message:
---
fix some silly mistakes

Modified Paths:
--
branches/soc-2009-yukishiro/source/blender/sh/SH_api.h
branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c

Modified: branches/soc-2009-yukishiro/source/blender/sh/SH_api.h
===
--- branches/soc-2009-yukishiro/source/blender/sh/SH_api.h  2009-06-30 
06:27:48 UTC (rev 21260)
+++ branches/soc-2009-yukishiro/source/blender/sh/SH_api.h  2009-06-30 
06:31:21 UTC (rev 21261)
@@ -39,7 +39,7 @@
 
 void SH_computeSceneCoefficients(struct Scene *scene, unsigned int 
customdata_mask, 
 short compute_shadow, short recompute);
-void SH_computeMeshCoefficients(struct Object *ob, int compute_shadow, 
unsigned int customdata_mask);
+void SH_computeMeshCoefficients(struct Scene *scene, struct Object *ob, 
unsigned int customdata_mask);
 void SH_computeLightCoefficients(struct LightEnv *env);
 
 void SH_rotateLightEnv(struct LightEnv *env, float quat[4]);

Modified: branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c
===
--- branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c  
2009-06-30 06:27:48 UTC (rev 21260)
+++ branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c  
2009-06-30 06:31:21 UTC (rev 21261)
@@ -945,7 +945,7 @@
}
 
no[0] = -n[0]; // TODO
-   no[1] = n[1];
+   no[1] = -n[1];
no[2] = n[2];
 
for (channel = 0; channel  3; channel++) {


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21262] branches/soc-2009-chingachgook/ source/blender/collada/DocumentExporter.cpp: Export textures mapped to diffuse, ambient, specular, emission an

2009-06-30 Thread Chingiz Dyussenov
Revision: 21262
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21262
Author:   chingachgook
Date: 2009-06-30 11:10:37 +0200 (Tue, 30 Jun 2009)

Log Message:
---
Export textures mapped to diffuse, ambient, specular, emission and reflective 
colors.
Input is always assumed to be UV.

Texture/UV set mapping is not done yet.

Modified Paths:
--
branches/soc-2009-chingachgook/source/blender/collada/DocumentExporter.cpp

Modified: 
branches/soc-2009-chingachgook/source/blender/collada/DocumentExporter.cpp
===
--- branches/soc-2009-chingachgook/source/blender/collada/DocumentExporter.cpp  
2009-06-30 06:31:21 UTC (rev 21261)
+++ branches/soc-2009-chingachgook/source/blender/collada/DocumentExporter.cpp  
2009-06-30 09:10:37 UTC (rev 21262)
@@ -583,45 +583,13 @@
 
void operator()(Material *ma)
{
+   std::vectorint mtexindices = countmtex(ma);
openEffect(std::string(ma-id.name) + -effect);

COLLADASW::EffectProfile ep(mSW);
-   
ep.setProfileType(COLLADASW::EffectProfile::COMMON);
-   
-   std::vectorint mtexindices = countmtex(ma);
-   
-   //for (int a = 0; a  mtexindices.size(); a++) {
-   
-   //open profile_common
ep.openProfile();
-   /*
-   //need this for making each texcoord unique
-   char texcoord[30];
-   sprintf(texcoord, %d, a);
-   
-   //newparam surface init_from
-   Image *ima = ma-mtex[mtexindices[a]]-tex-ima;
-   COLLADASW::Surface 
surface(COLLADASW::Surface::SURFACE_TYPE_2D,
-  
ima-id.name + COLLADASW::Surface::SURFACE_SID_SUFFIX);
-   COLLADASW::SurfaceInitOption 
sio(COLLADASW::SurfaceInitOption::INIT_FROM);
-   sio.setImageReference(ima-id.name);
-   surface.setInitOption(sio);
-   
-   //newparam sampler source
-   COLLADASW::Sampler 
sampler(COLLADASW::Sampler::SAMPLER_TYPE_2D,
-  
ima-id.name + COLLADASW::Surface::SURFACE_SID_SUFFIX);
-   
-   //lambert diffuse texture 
-   COLLADASW::Texture texture(ima-id.name);
-   texture.setTexcoord(std::string(myUVs) + texcoord);
-   texture.setSurface(surface);
-   texture.setSampler(sampler);
-   
-   //texture
-   COLLADASW::ColorOrTexture cot(texture);
-   ep.setDiffuse(cot);
-   */
+   // set shader type - one of three blinn, phong or lambert
if (ma-spec_shader == MA_SPEC_BLINN) {
ep.setShaderType(COLLADASW::EffectProfile::BLINN);
}
@@ -629,70 +597,150 @@
ep.setShaderType(COLLADASW::EffectProfile::PHONG);
}
else {
-   // XXX write error 
+   // XXX write warning Current shader type is not 
supported 
ep.setShaderType(COLLADASW::EffectProfile::LAMBERT);
}
-   
-   // emission 
-   COLLADASW::ColorOrTexture cot_col = getcol(0.0f, 0.0f, 0.0f, 
1.0f);
-   ep.setEmission(cot_col);
-   
-   // diffuse
-   cot_col = getcol(ma-r, ma-g, ma-b, 1.0f);
-   ep.setDiffuse(cot_col);
-   
+   // index of refraction
+   if (ma-mode  MA_RAYTRANSP) {
+   ep.setIndexOfRefraction(ma-ang);
+   }
+   else {
+   ep.setIndexOfRefraction(1.0f);
+   }
+   // transparency
+   ep.setTransparency(ma-alpha);
+   // shininess
+   ep.setShininess(ma-spec);
+   // emission
+   COLLADASW::ColorOrTexture cot = getcol(0.0f, 0.0f, 0.0f, 1.0f);
+   ep.setEmission(cot);
+   // diffuse 
+   cot = getcol(ma-r, ma-g, ma-b, 1.0f);
+   ep.setDiffuse(cot);
// ambient
-   cot_col = getcol(ma-ambr, ma-ambg, ma-ambb, 1.0f);
-   ep.setAmbient(cot_col);
-   
+   cot = getcol(ma-ambr, ma-ambg, ma-ambb, 1.0f);
+   ep.setAmbient(cot);
// reflective, reflectivity
if (ma-mode  

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21263] branches/blender2.5/blender/source /blender: python access to RNA arrays.

2009-06-30 Thread Campbell Barton
Revision: 21263
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21263
Author:   campbellbarton
Date: 2009-06-30 14:52:16 +0200 (Tue, 30 Jun 2009)

Log Message:
---
python access to RNA arrays.

coords = array.array('f', [0.0]) * len(me.verts) * 3
m.verts.foreach_get('co', coords)

the reverse works with set also.
currently works for python buffers or sequences (slower)

Quick speed test with 1,179,654 verts.

*foreach_get*
list 0.377
array 0.032
py 10.29

*foreach_set*
list 0.184
array 0.028
py 9.79


where python was done like this...

 i= 0
 for v in m.verts:
   co = v.co
   l[i] = co[0]; l[i+1] = co[0]; l[i+2] = co[0]
   i+=3


some of the error checking here needs to be cleaned up to account for different 
invalid bad inputs.

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2009-06-30 09:10:37 UTC (rev 21262)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2009-06-30 12:52:16 UTC (rev 21263)
@@ -606,7 +606,10 @@
 int RNA_property_collection_raw_array(PointerRNA *ptr, PropertyRNA *prop, 
PropertyRNA *itemprop, RawArray *array);
 int RNA_property_collection_raw_get(struct ReportList *reports, PointerRNA 
*ptr, PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int 
len);
 int RNA_property_collection_raw_set(struct ReportList *reports, PointerRNA 
*ptr, PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int 
len);
+int RNA_raw_type_sizeof(RawPropertyType type);
+RawPropertyType RNA_property_raw_type(PropertyRNA *prop);
 
+
 /* to create ID property groups */
 void RNA_property_pointer_add(PointerRNA *ptr, PropertyRNA *prop);
 void RNA_property_pointer_remove(PointerRNA *ptr, PropertyRNA *prop);

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c 
2009-06-30 09:10:37 UTC (rev 21262)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c 
2009-06-30 12:52:16 UTC (rev 21263)
@@ -1580,6 +1580,17 @@
} \
 }
 
+int RNA_raw_type_sizeof(RawPropertyType type)
+{
+   switch(type) {
+   case PROP_RAW_CHAR: return sizeof(char);
+   case PROP_RAW_SHORT: return sizeof(short);
+   case PROP_RAW_INT: return sizeof(int);
+   case PROP_RAW_FLOAT: return sizeof(float);
+   case PROP_RAW_DOUBLE: return sizeof(double);
+   }
+}
+
 static int rna_raw_access(ReportList *reports, PointerRNA *ptr, PropertyRNA 
*prop, char *propname, void *inarray, RawPropertyType intype, int inlen, int 
set)
 {
StructRNA *ptype;
@@ -1630,15 +1641,8 @@
int a, size;
 
itemlen= (itemlen == 0)? 1: itemlen;
+   size= RNA_raw_type_sizeof(out.type) * itemlen;
 
-   switch(out.type) {
-   case PROP_RAW_CHAR: size= 
sizeof(char)*itemlen; break;
-   case PROP_RAW_SHORT: size= 
sizeof(short)*itemlen; break;
-   case PROP_RAW_INT: size= 
sizeof(int)*itemlen; break;
-   case PROP_RAW_FLOAT: size= 
sizeof(float)*itemlen; break;
-   case PROP_RAW_DOUBLE: size= 
sizeof(double)*itemlen; break;
-   }
-
for(a=0; aout.len; a++) {
if(set) memcpy(outp, inp, size);
else memcpy(inp, outp, size);
@@ -1819,6 +1823,11 @@
}
 }
 
+RawPropertyType RNA_property_raw_type(PropertyRNA *prop)
+{
+   return prop-rawtype;
+}
+
 int RNA_property_collection_raw_get(ReportList *reports, PointerRNA *ptr, 
PropertyRNA *prop, char *propname, void *array, RawPropertyType type, int len)
 {
return rna_raw_access(reports, ptr, prop, propname, array, type, len, 
0);

Modified: branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c
===
--- branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c  
2009-06-30 09:10:37 UTC (rev 21262)
+++ branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c  
2009-06-30 12:52:16 UTC (rev 21263)
@@ -1130,7 +1130,7 @@
return pyrna_py_to_prop(self-ptr, prop, NULL, value);
 }
 
-PyObject 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21264] branches/soc-2009-jaguarandi/ source/blender/render/intern: *reserved RayObject align offset 0 for private usage inside each structure

2009-06-30 Thread André Pinto
Revision: 21264
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21264
Author:   jaguarandi
Date: 2009-06-30 16:05:33 +0200 (Tue, 30 Jun 2009)

Log Message:
---
*reserved RayObject align offset 0 for private usage inside each structure
point is that other structures like trees can then distiguish between other 
nodes or rayobject primitives
withouth needing any other variable.
(Note yet used but will reduce memory by a nice factor (linear to the 
number of primitives))

Modified Paths:
--

branches/soc-2009-jaguarandi/source/blender/render/intern/include/rayobject.h
branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject.c

branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject_bvh.c

branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject_instance.c

branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject_mesh.c

branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject_octree.c
branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayshade.c

Modified: 
branches/soc-2009-jaguarandi/source/blender/render/intern/include/rayobject.h
===
--- 
branches/soc-2009-jaguarandi/source/blender/render/intern/include/rayobject.h   
2009-06-30 12:52:16 UTC (rev 21263)
+++ 
branches/soc-2009-jaguarandi/source/blender/render/intern/include/rayobject.h   
2009-06-30 14:05:33 UTC (rev 21264)
@@ -58,13 +58,15 @@
only 2 are used:
 
 addr2  - type of object
-   0   RayFace
-   1   RayObject (generic with API callbacks)
-   2   unused
+   0   Self (reserved for each structure)
+   1   RayFace
+   2   RayObject (generic with API callbacks)
3   unused
 
-   0 was choosed to RayFace because thats the one where speed will be 
needed.
-   
+   0 means it's reserved and has it own meaning inside each ray 
acceleration structure
+   (this way each structure can use the allign offset to determine if a 
node represents a
+RayObject primitive, which can be used to save memory)
+
You actually don't need to care about this if you are only using the API
described on RE_raytrace.h
  */
@@ -101,10 +103,13 @@
 } RayObjectAPI;
 
 //TODO use intptr_t
-#define RayObject_align(o) ((RayObject*)(((int)o)(~3)))
-#define RayObject_unalign(o)   ((RayObject*)(((int)o)|1))
-#define RayObject_isFace(o)int)o)3) == 0)
+#define RayObject_align(o) 
((RayObject*)(((int)o)(~3)))
+#define RayObject_unalignRayFace(o)((RayObject*)(((int)o)|1))
+#define RayObject_unalignRayAPI(o) ((RayObject*)(((int)o)|2))
+
 #define RayObject_isAligned(o) int)o)3) == 0)
+#define RayObject_isRayFace(o) int)o)3) == 1)
+#define RayObject_isRayAPI(o)  int)o)3) == 2)
 
 /*
  * Extend min/max coords so that the rayobject is inside them

Modified: 
branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject.c
===
--- 
branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject.c
2009-06-30 12:52:16 UTC (rev 21263)
+++ 
branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject.c
2009-06-30 14:05:33 UTC (rev 21264)
@@ -255,7 +255,7 @@
 
is-hit.ob   = face-ob;
is-hit.face = face-face;
-   is-last_hit = (RayObject*)face;
+   is-last_hit = (RayObject*) RayObject_unalignRayFace(face);
return 1;
}
 
@@ -289,15 +289,16 @@
 
 int RE_rayobject_intersect(RayObject *r, Isect *i)
 {
-   if(RayObject_isFace(r))
+   if(RayObject_isRayFace(r))
{
-   return intersect_rayface( (RayFace*) r, i);
+   return intersect_rayface( (RayFace*) RayObject_align(r), i);
}
-   else
+   else if(RayObject_isRayAPI(r))
{
r = RayObject_align( r );
return r-api-raycast( r, i );
}
+   else assert(0);
 }
 
 void RE_rayobject_add(RayObject *r, RayObject *o)
@@ -320,19 +321,20 @@
 
 void RE_rayobject_merge_bb(RayObject *r, float *min, float *max)
 {
-   if(RayObject_isFace(r))
+   if(RayObject_isRayFace(r))
{
-   RayFace *face = (RayFace*)r;
+   RayFace *face = (RayFace*) RayObject_align(r);
DO_MINMAX( face-v1, min, max );
DO_MINMAX( face-v2, min, max );
DO_MINMAX( face-v3, min, max );
if(face-v4) DO_MINMAX( face-v4, min, max );
}
-   else
+   else if(RayObject_isRayAPI(r))
{
r = RayObject_align( 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21265] branches/blender2.5/blender/ CMakeLists.txt: windows cmake uses python26 now, make sure your lib/ windows is up to date (requires an additiona

2009-06-30 Thread Shaul Kedem
Revision: 21265
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21265
Author:   shul
Date: 2009-06-30 20:20:12 +0200 (Tue, 30 Jun 2009)

Log Message:
---
windows cmake uses python26 now, make sure your lib/windows is up to date 
(requires an additional svn update, in lib/windows

Modified Paths:
--
branches/blender2.5/blender/CMakeLists.txt

Modified: branches/blender2.5/blender/CMakeLists.txt
===
--- branches/blender2.5/blender/CMakeLists.txt  2009-06-30 14:05:33 UTC (rev 
21264)
+++ branches/blender2.5/blender/CMakeLists.txt  2009-06-30 18:20:12 UTC (rev 
21265)
@@ -193,10 +193,10 @@
   ENDIF(CMAKE_CL_64)
 
   SET(PYTHON ${LIBDIR}/python)
-  SET(PYTHON_VERSION 2.5)
+  SET(PYTHON_VERSION 2.6)
   SET(PYTHON_INC ${PYTHON}/include/python${PYTHON_VERSION})
   SET(PYTHON_BINARY python)
-  SET(PYTHON_LIB python25)
+  SET(PYTHON_LIB python26)
   SET(PYTHON_LIBPATH ${PYTHON}/lib)
 
   IF(CMAKE_CL_64)


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21266] branches/blender2.5/blender/ projectfiles_vc9: 2.5 MSVC projectfiles

2009-06-30 Thread Andrea Weikert
Revision: 21266
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21266
Author:   elubie
Date: 2009-06-30 20:20:45 +0200 (Tue, 30 Jun 2009)

Log Message:
---
2.5 MSVC projectfiles
* moving projectfiles to python 2.6 to avoid recurring issues with python 
migration

Modified Paths:
--

branches/blender2.5/blender/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
branches/blender2.5/blender/projectfiles_vc9/blender/blender.vcproj

branches/blender2.5/blender/projectfiles_vc9/blender/blenkernel/BKE_blenkernel.vcproj

branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj

branches/blender2.5/blender/projectfiles_vc9/blender/makesrna/RNA_makesrna.vcproj
branches/blender2.5/blender/projectfiles_vc9/blender/makesrna/RNA_rna.vcproj
branches/blender2.5/blender/projectfiles_vc9/blender/nodes/nodes.vcproj

branches/blender2.5/blender/projectfiles_vc9/gameengine/blenderhook/KX_blenderhook.vcproj

branches/blender2.5/blender/projectfiles_vc9/gameengine/converter/KX_converter.vcproj

branches/blender2.5/blender/projectfiles_vc9/gameengine/expression/EXP_expressions.vcproj

branches/blender2.5/blender/projectfiles_vc9/gameengine/gamelogic/SCA_GameLogic.vcproj

branches/blender2.5/blender/projectfiles_vc9/gameengine/gameplayer/axctl/GP_axctl.vcproj

branches/blender2.5/blender/projectfiles_vc9/gameengine/gameplayer/common/GP_common.vcproj

branches/blender2.5/blender/projectfiles_vc9/gameengine/gameplayer/ghost/GP_ghost.vcproj

branches/blender2.5/blender/projectfiles_vc9/gameengine/ketsji/KX_ketsji.vcproj

branches/blender2.5/blender/projectfiles_vc9/gameengine/ketsji/network/KX_network.vcproj

branches/blender2.5/blender/projectfiles_vc9/gameengine/physics/PHY_Physics/PHY_Bullet/PHY_Bullet.vcproj

branches/blender2.5/blender/projectfiles_vc9/gameengine/rasterizer/RAS_rasterizer.vcproj

branches/blender2.5/blender/projectfiles_vc9/gameengine/videotexture/TEX_Video.vcproj
branches/blender2.5/blender/projectfiles_vc9/kernel/system/SYS_system.vcproj

Modified: 
branches/blender2.5/blender/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
===
--- 
branches/blender2.5/blender/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
   2009-06-30 18:20:12 UTC (rev 21265)
+++ 
branches/blender2.5/blender/projectfiles_vc9/blender/BPY_python/BPY_python.vcproj
   2009-06-30 18:20:45 UTC (rev 21266)
@@ -43,7 +43,7 @@
Tool
Name=VCCLCompilerTool
Optimization=0
-   
AdditionalIncludeDirectories=..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.5;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\sourc
 e\blender\editors\include
+   
AdditionalIncludeDirectories=..\..\..\..\build\msvc_9\intern\bsp\include;..\..\..\..\build\msvc_9\intern\bmfont\include;..\..\..\..\build\msvc_9\intern\iksolver\include;..\..\..\..\build\msvc_9\intern\guardedalloc\include;..\..\..\..\lib\windows\python\include\python2.6;..\..\..\..\lib\windows\ffmpeg\include;..\..\..\source\blender;..\..\..\source\blender\avi;..\..\..\source\blender\img;..\..\..\source\blender\imbuf;..\..\..\source\blender\blenlib;..\..\..\source\blender\python;..\..\..\source\blender\include;..\..\..\source\blender\blenkernel;..\..\..\source\blender\makesrna;..\..\..\source\blender\makesdna;..\..\..\source\blender\blenloader;..\..\..\source\blender\renderconverter;..\..\..\source\blender\render\extern\include;..\..\..\source\blender\radiosity\extern\include;..\..\..\source\kernel\gen_system;..\..\..\source\gameengine\SoundSystem;..\..\..\..\build\msvc_9\extern\glew\include;..\..\..\source\blender\gpu;..\..\..\source\blender\windowmanager;..\..\..\sourc
 e\blender\editors\include

PreprocessorDefinitions=_DEBUG,WIN32,_LIB;WITH_FFMPEG
BasicRuntimeChecks=3
RuntimeLibrary=1
@@ -120,7 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21267] branches/blender2.5/blender/source /blender/editors/space_file: 2.5 filebrowser

2009-06-30 Thread Andrea Weikert
Revision: 21267
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21267
Author:   elubie
Date: 2009-06-30 20:29:30 +0200 (Tue, 30 Jun 2009)

Log Message:
---
2.5 filebrowser 
* Hide dot operator (HKEY) for theeth 

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/space_file/file_intern.h
branches/blender2.5/blender/source/blender/editors/space_file/file_ops.c
branches/blender2.5/blender/source/blender/editors/space_file/space_file.c

Modified: 
branches/blender2.5/blender/source/blender/editors/space_file/file_intern.h
===
--- branches/blender2.5/blender/source/blender/editors/space_file/file_intern.h 
2009-06-30 18:20:45 UTC (rev 21266)
+++ branches/blender2.5/blender/source/blender/editors/space_file/file_intern.h 
2009-06-30 18:29:30 UTC (rev 21267)
@@ -60,6 +60,7 @@
 void FILE_OT_select_bookmark(struct wmOperatorType *ot);
 void FILE_OT_add_bookmark(struct wmOperatorType *ot);
 void FILE_OT_delete_bookmark(struct wmOperatorType *ot);
+void FILE_OT_hidedot(struct wmOperatorType *ot);
 void FILE_OT_loadimages(struct wmOperatorType *ot);
 void FILE_OT_exec(struct wmOperatorType *ot);
 void FILE_OT_cancel(struct wmOperatorType *ot);

Modified: 
branches/blender2.5/blender/source/blender/editors/space_file/file_ops.c
===
--- branches/blender2.5/blender/source/blender/editors/space_file/file_ops.c
2009-06-30 18:20:45 UTC (rev 21266)
+++ branches/blender2.5/blender/source/blender/editors/space_file/file_ops.c
2009-06-30 18:29:30 UTC (rev 21267)
@@ -606,6 +606,33 @@
ot-poll= ED_operator_file_active; /* - important, handler is on 
window level */
 }
 
+int file_hidedot_exec(bContext *C, wmOperator *unused)
+{
+   SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C);
+   
+   if(sfile-params) {
+   sfile-params-flag ^= FILE_HIDE_DOT;
+   filelist_free(sfile-files);
+   sfile-params-active_file = -1;
+   WM_event_add_notifier(C, NC_FILE|ND_FILELIST, NULL);
+   }
+   
+   return OPERATOR_FINISHED;
+
+}
+
+
+void FILE_OT_hidedot(struct wmOperatorType *ot)
+{
+   /* identifiers */
+   ot-name= Toggle Hide Dot Files;
+   ot-idname= FILE_OT_hidedot;
+   
+   /* api callbacks */
+   ot-exec= file_hidedot_exec;
+   ot-poll= ED_operator_file_active; /* - important, handler is on 
window level */
+}
+
 struct ARegion *file_buttons_region(struct ScrArea *sa)
 {
ARegion *ar, *arnew;

Modified: 
branches/blender2.5/blender/source/blender/editors/space_file/space_file.c
===
--- branches/blender2.5/blender/source/blender/editors/space_file/space_file.c  
2009-06-30 18:20:45 UTC (rev 21266)
+++ branches/blender2.5/blender/source/blender/editors/space_file/space_file.c  
2009-06-30 18:29:30 UTC (rev 21267)
@@ -294,6 +294,7 @@
WM_operatortype_append(FILE_OT_bookmark_toggle);
WM_operatortype_append(FILE_OT_add_bookmark);
WM_operatortype_append(FILE_OT_delete_bookmark);
+   WM_operatortype_append(FILE_OT_hidedot);
 }
 
 /* NOTE: do not add .blend file reading on this level */
@@ -307,8 +308,9 @@
WM_keymap_add_item(keymap, FILE_OT_highlight, MOUSEMOVE, KM_ANY, 0, 
0);
WM_keymap_add_item(keymap, FILE_OT_parent, PKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, FILE_OT_add_bookmark, BKEY, KM_PRESS, 
KM_CTRL, 0);
+   WM_keymap_add_item(keymap, FILE_OT_hidedot, HKEY, KM_PRESS, 0, 0);
WM_keymap_add_item(keymap, FILE_OT_loadimages, TIMER1, KM_ANY, 
KM_ANY, 0);
-
+   
keymap= WM_keymap_listbase(wm, FileBookmark, SPACE_FILE, 0);
WM_keymap_add_item(keymap, FILE_OT_select_bookmark, LEFTMOUSE, 
KM_PRESS, 0, 0);
 }


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21268] branches/blender2.5/blender/source /blender: RNA

2009-06-30 Thread Brecht Van Lommel
Revision: 21268
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21268
Author:   blendix
Date: 2009-06-30 21:10:14 +0200 (Tue, 30 Jun 2009)

Log Message:
---
RNA

* Add Image.dirty boolean.
* Added Window struct, with editable Window.screen.
* Make Screen.scene editable.

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesdna/DNA_screen_types.h

branches/blender2.5/blender/source/blender/makesdna/DNA_windowmanager_types.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_context.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_image.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_screen.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_wm.c

Modified: branches/blender2.5/blender/source/blender/makesdna/DNA_screen_types.h
===
--- branches/blender2.5/blender/source/blender/makesdna/DNA_screen_types.h  
2009-06-30 18:29:30 UTC (rev 21267)
+++ branches/blender2.5/blender/source/blender/makesdna/DNA_screen_types.h  
2009-06-30 19:10:14 UTC (rev 21268)
@@ -53,6 +53,7 @@
ListBase regionbase;/* screen level regions 
(menus), runtime only */

struct Scene *scene;
+   struct Scene *newscene; /* temporary when 
switching */

short full; /* fade 
out? */
short winid;/* winid from 
WM, starts with 1 */

Modified: 
branches/blender2.5/blender/source/blender/makesdna/DNA_windowmanager_types.h
===
--- 
branches/blender2.5/blender/source/blender/makesdna/DNA_windowmanager_types.h   
2009-06-30 18:29:30 UTC (rev 21267)
+++ 
branches/blender2.5/blender/source/blender/makesdna/DNA_windowmanager_types.h   
2009-06-30 19:10:14 UTC (rev 21268)
@@ -88,7 +88,8 @@

int winid, pad; /* winid also in screens, is for retrieving 
this window after read */

-   struct bScreen *screen; /* active screen */
+   struct bScreen *screen; /* active screen */
+   struct bScreen *newscreen;  /* temporary when switching */
char screenname[32];/* MAX_ID_NAME for matching window with active 
screen after file read */

short posx, posy, sizex, sizey; /* window coords */

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c 
2009-06-30 18:29:30 UTC (rev 21267)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c 
2009-06-30 19:10:14 UTC (rev 21268)
@@ -1588,6 +1588,7 @@
case PROP_RAW_INT: return sizeof(int);
case PROP_RAW_FLOAT: return sizeof(float);
case PROP_RAW_DOUBLE: return sizeof(double);
+   default: return 0;
}
 }
 

Modified: 
branches/blender2.5/blender/source/blender/makesrna/intern/rna_context.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_context.c
2009-06-30 18:29:30 UTC (rev 21267)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_context.c
2009-06-30 19:10:14 UTC (rev 21268)
@@ -40,11 +40,11 @@
return rna_pointer_inherit_refine(ptr, RNA_WindowManager, 
CTX_wm_manager(C));
 }
 
-/*static PointerRNA rna_Context_window_get(PointerRNA *ptr)
+static PointerRNA rna_Context_window_get(PointerRNA *ptr)
 {
bContext *C= (bContext*)ptr-data;
return rna_pointer_inherit_refine(ptr, RNA_Window, CTX_wm_window(C));
-}*/
+}
 
 static PointerRNA rna_Context_screen_get(PointerRNA *ptr)
 {
@@ -113,10 +113,10 @@
RNA_def_property_struct_type(prop, WindowManager);
RNA_def_property_pointer_funcs(prop, rna_Context_manager_get, NULL, 
NULL);
 
-   /* prop= RNA_def_property(srna, window, PROP_POINTER, PROP_NONE);
+   prop= RNA_def_property(srna, window, PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
RNA_def_property_struct_type(prop, Window);
-   RNA_def_property_pointer_funcs(prop, rna_Context_window_get, NULL, 
NULL); */
+   RNA_def_property_pointer_funcs(prop, rna_Context_window_get, NULL, 
NULL);
 
prop= RNA_def_property(srna, screen, PROP_POINTER, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_image.c
===
--- 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21270] branches/blender2.5/blender/source /creator/CMakeLists.txt: second part of python2.6 upgrade in cmake, now it will copy the dlls too

2009-06-30 Thread Shaul Kedem
Revision: 21270
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21270
Author:   shul
Date: 2009-06-30 21:29:40 +0200 (Tue, 30 Jun 2009)

Log Message:
---
second part of python2.6 upgrade in cmake, now it will copy the dlls too

Modified Paths:
--
branches/blender2.5/blender/source/creator/CMakeLists.txt

Modified: branches/blender2.5/blender/source/creator/CMakeLists.txt
===
--- branches/blender2.5/blender/source/creator/CMakeLists.txt   2009-06-30 
19:20:45 UTC (rev 21269)
+++ branches/blender2.5/blender/source/creator/CMakeLists.txt   2009-06-30 
19:29:40 UTC (rev 21270)
@@ -151,7 +151,7 @@
 COMMAND xcopy /E /Y \${WIN_SOURCE_DIR}\\release\\ui\\*.*\ 
\${TARGETDIR}\\.blender\\ui\
 COMMAND xcopy /E /Y \${WIN_SOURCE_DIR}\\release\\plugins\\*.*\ 
\${TARGETDIR}\\plugins\
 COMMAND copy /Y \${WIN_SOURCE_DIR}\\release\\text\\*.*\ \${TARGETDIR}\
-COMMAND copy /Y 
\${WIN_SOURCE_DIR}\\release\\windows\\extra\\python25.zip\ \${TARGETDIR}\\\
+COMMAND copy /Y 
\${WIN_SOURCE_DIR}\\release\\windows\\extra\\python26.zip\ \${TARGETDIR}\\\
   )
   
   FILE(TO_NATIVE_PATH ${LIBDIR} WIN_LIBDIR)
@@ -164,7 +164,8 @@
 COMMAND copy /Y \${WIN_LIBDIR}\\sdl\\lib\\SDL.dll\ \${TARGETDIR}\\\
 COMMAND copy /Y \${WIN_LIBDIR}\\zlib\\lib\\zlib.dll\ \${TARGETDIR}\\\
 COMMAND copy /Y \${WIN_LIBDIR}\\tiff\\lib\\libtiff.dll\ 
\${TARGETDIR}\\\
-COMMAND copy /Y \${WIN_LIBDIR}\\python\\lib\\python25.dll\ 
\${TARGETDIR}\\\
+COMMAND copy /Y \${WIN_LIBDIR}\\python\\lib\\python26.dll\ 
\${TARGETDIR}\\\
+COMMAND copy /Y \${WIN_LIBDIR}\\python\\lib\\python26_d.dll\ 
\${TARGETDIR}\\\
 COMMAND copy /Y \${WIN_LIBDIR}\\pthreads\\lib\\pthreadVC2.dll\ 
\${TARGETDIR}\\\
   )
 


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21273] branches/blender2.5/blender/ projectfiles_vc9/blender/editors/ED_editors.vcproj: 2.5 MSVC projectfiles

2009-06-30 Thread Andrea Weikert
Revision: 21273
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21273
Author:   elubie
Date: 2009-06-30 22:31:58 +0200 (Tue, 30 Jun 2009)

Log Message:
---
2.5 MSVC projectfiles
* small maintenance: editors/info_header.c removed, editors/info_ops.c added

Modified Paths:
--

branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj

Modified: 
branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj
===
--- 
branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj  
2009-06-30 20:14:53 UTC (rev 21272)
+++ 
branches/blender2.5/blender/projectfiles_vc9/blender/editors/ED_editors.vcproj  
2009-06-30 20:31:58 UTC (rev 21273)
@@ -799,11 +799,11 @@
Name=space_info

File
-   
RelativePath=..\..\..\source\blender\editors\space_info\info_header.c
+   
RelativePath=..\..\..\source\blender\editors\space_info\info_intern.h

/File
File
-   
RelativePath=..\..\..\source\blender\editors\space_info\info_intern.h
+   
RelativePath=..\..\..\source\blender\editors\space_info\info_ops.c

/File
File


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21274] branches/blender2.5/blender/ release/ui/space_info.py: SVN maintenance.

2009-06-30 Thread gsr b3d
Revision: 21274
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21274
Author:   gsrb3d
Date: 2009-06-30 22:32:45 +0200 (Tue, 30 Jun 2009)

Log Message:
---
SVN maintenance.

Property Changed:

branches/blender2.5/blender/release/ui/space_info.py


Property changes on: branches/blender2.5/blender/release/ui/space_info.py
___
Name: svn:keywords
   + Author Date Id Revision
Name: svn:eol-style
   + native


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21275] branches/blender2.5/blender: 2. 5 filebrowser

2009-06-30 Thread Andrea Weikert
Revision: 21275
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21275
Author:   elubie
Date: 2009-06-30 22:34:00 +0200 (Tue, 30 Jun 2009)

Log Message:
---
2.5 filebrowser
* show only name of the last directory for the bookmark
* small fix of projectfile: header BLI_fileops.h was moved
Note: full path should appear in tool tip later, also for renaming bookmarks 
later on.

Modified Paths:
--

branches/blender2.5/blender/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj
branches/blender2.5/blender/source/blender/blenlib/BLI_util.h
branches/blender2.5/blender/source/blender/blenlib/intern/util.c
branches/blender2.5/blender/source/blender/editors/space_file/file_panels.c

Modified: 
branches/blender2.5/blender/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj
===
--- 
branches/blender2.5/blender/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj 
2009-06-30 20:32:45 UTC (rev 21274)
+++ 
branches/blender2.5/blender/projectfiles_vc9/blender/blenlib/BLI_blenlib.vcproj 
2009-06-30 20:34:00 UTC (rev 21275)
@@ -652,7 +652,7 @@

/File
File
-   
RelativePath=..\..\..\source\blender\blenlib\intern\BLI_fileops.h
+   
RelativePath=..\..\..\source\blender\blenlib\BLI_fileops.h

/File
File

Modified: branches/blender2.5/blender/source/blender/blenlib/BLI_util.h
===
--- branches/blender2.5/blender/source/blender/blenlib/BLI_util.h   
2009-06-30 20:32:45 UTC (rev 21274)
+++ branches/blender2.5/blender/source/blender/blenlib/BLI_util.h   
2009-06-30 20:34:00 UTC (rev 21275)
@@ -50,6 +50,7 @@
 void BLI_split_dirfile(char *string, char *dir, char *file);
 void BLI_split_dirfile_basic(const char *string, char *dir, char *file);
 void BLI_join_dirfile(char *string, const char *dir, const char *file);
+void BLI_getlastdir(const char* dir, char *last, int maxlen);
 int BLI_testextensie(const char *str, const char *ext);
 void BLI_uniquename(struct ListBase *list, void *vlink, char defname[], char 
delim, short name_offs, short len);
 void BLI_newname(char * name, int add);

Modified: branches/blender2.5/blender/source/blender/blenlib/intern/util.c
===
--- branches/blender2.5/blender/source/blender/blenlib/intern/util.c
2009-06-30 20:32:45 UTC (rev 21274)
+++ branches/blender2.5/blender/source/blender/blenlib/intern/util.c
2009-06-30 20:34:00 UTC (rev 21275)
@@ -736,6 +736,25 @@
}
 }
 
+void BLI_getlastdir(const char* dir, char *last, int maxlen)
+{
+   char *s = dir;
+   char *lslash = NULL;
+   char *prevslash = NULL;
+   while (*s) {
+   if ((*s == '\\') || (*s == '/')) {
+   prevslash = lslash;
+   lslash = s;
+   }
+   s++;
+   }
+   if (prevslash) {
+   BLI_strncpy(last, prevslash+1, maxlen);
+   } else {
+   BLI_strncpy(last, dir, maxlen);
+   }
+}
+
 char *BLI_gethome(void) {
#if !defined(WIN32)
return getenv(HOME);

Modified: 
branches/blender2.5/blender/source/blender/editors/space_file/file_panels.c
===
--- branches/blender2.5/blender/source/blender/editors/space_file/file_panels.c 
2009-06-30 20:32:45 UTC (rev 21274)
+++ branches/blender2.5/blender/source/blender/editors/space_file/file_panels.c 
2009-06-30 20:34:00 UTC (rev 21275)
@@ -69,9 +69,19 @@
uiBlockSetEmboss(block, UI_EMBOSSP);
uiBlockBeginAlign(block);
for (i=0; i nentries;++i) {
+   char dir[FILE_MAX];
+   char temp[FILE_MAX];
uiLayout* layout = uiLayoutRow(pa-layout, 
UI_LAYOUT_ALIGN_LEFT);
-   char *fname = fsmenu_get_entry(fsmenu, category, i);
-   uiItemStringO(layout, fname, icon, FILE_OT_select_bookmark, 
dir, fname);
+   char *entry = fsmenu_get_entry(fsmenu, category, i);
+
+   /* create nice bookmark name, shows last directory in the full 
path currently */
+   BLI_strncpy(temp, entry, FILE_MAX);
+   BLI_add_slash(temp);
+   BLI_getlastdir(temp, dir, FILE_MAX);
+   BLI_del_slash(dir);
+
+   /* operator shows the short bookmark name, should eventually 
have tooltip */
+   uiItemStringO(layout, dir, icon, FILE_OT_select_bookmark, 
dir, entry);
if (allow_delete  fsmenu_can_save(fsmenu, category, i) )
uiItemIntO(layout, , ICON_X, 
FILE_OT_delete_bookmark, index, i);
}



[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21276] branches/blender2.5/blender/source /blender/python/intern/bpy_rna.c: disabling foreach_get/set for python2.x, since it uses new buffer api.

2009-06-30 Thread Campbell Barton
Revision: 21276
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21276
Author:   campbellbarton
Date: 2009-06-30 23:59:21 +0200 (Tue, 30 Jun 2009)

Log Message:
---
disabling foreach_get/set for python2.x, since it uses new buffer api.

Modified Paths:
--
branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c

Modified: branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c
===
--- branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c  
2009-06-30 20:34:00 UTC (rev 21275)
+++ branches/blender2.5/blender/source/blender/python/intern/bpy_rna.c  
2009-06-30 21:59:21 UTC (rev 21276)
@@ -1225,6 +1225,7 @@
return ret;
 }
 
+#if (PY_VERSION_HEX = 0x0300) /* foreach needs py3 */
 static void foreach_attr_type( BPy_PropertyRNA *self, char *attr,
/* 
values to assign */

RawPropertyType *raw_type, int *attr_tot, int *attr_signed )
@@ -1457,8 +1458,8 @@
 {
return foreach_getset(self, args, 1);
 }
+#endif /* #if (PY_VERSION_HEX = 0x0300) */
 
-
 /* A bit of a kludge, make a list out of a collection or array,
  * then return the lists iter function, not especially fast but convenient for 
now */
 PyObject *pyrna_prop_iter(BPy_PropertyRNA *self)
@@ -1502,9 +1503,11 @@
{items, (PyCFunction)pyrna_prop_items, METH_NOARGS,NULL},
{values, (PyCFunction)pyrna_prop_values, METH_NOARGS, NULL},
 
+#if (PY_VERSION_HEX = 0x0300)
/* array accessor function */
{foreach_get, (PyCFunction)pyrna_prop_foreach_get, METH_VARARGS, 
NULL},
{foreach_set, (PyCFunction)pyrna_prop_foreach_set, METH_VARARGS, 
NULL},
+#endif
{NULL, NULL, 0, NULL}
 };
 


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21277] branches/soc-2009-jaguarandi/ source/blender/render: *Added initial code of rayobject_rtbuild

2009-06-30 Thread André Pinto
Revision: 21277
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21277
Author:   jaguarandi
Date: 2009-07-01 00:07:42 +0200 (Wed, 01 Jul 2009)

Log Message:
---
*Added initial code of rayobject_rtbuild
 An helper class to build trees

Modified Paths:
--

branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h
branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayshade.c

Added Paths:
---

branches/soc-2009-jaguarandi/source/blender/render/intern/include/rayobject_rtbuild.h

branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject_blibvh.c

branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject_rtbuild.c

Removed Paths:
-

branches/soc-2009-jaguarandi/source/blender/render/intern/source/rayobject_bvh.c

Modified: 
branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h
===
--- 
branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h 
2009-06-30 21:59:21 UTC (rev 21276)
+++ 
branches/soc-2009-jaguarandi/source/blender/render/extern/include/RE_raytrace.h 
2009-06-30 22:07:42 UTC (rev 21277)
@@ -47,7 +47,7 @@
 
 /* RayObject constructors */
 RayObject* RE_rayobject_octree_create(int ocres, int size);
-RayObject* RE_rayobject_bvh_create(int size);
+RayObject* RE_rayobject_blibvh_create(int size);
 RayObject* RE_rayobject_instance_create(RayObject *target, float 
transform[][4], void *ob, void *target_ob);
 
 //RayObject* RayObject_derivedmesh_create(struct DerivedMesh*, void *ob);
@@ -59,8 +59,13 @@
float start[3];
float vec[3];
float labda;
+
+   /* length of vec, configured by RE_rayobject_raycast */
+   int   bv_index[6];
+   float idot_axis[3];
+   float dist;

-   float dist; /* length of vec, configured by RE_rayobject_raycast */
+
 /* float end[3];- not used */
 
float u, v;

Added: 
branches/soc-2009-jaguarandi/source/blender/render/intern/include/rayobject_rtbuild.h
===
--- 
branches/soc-2009-jaguarandi/source/blender/render/intern/include/rayobject_rtbuild.h
   (rev 0)
+++ 
branches/soc-2009-jaguarandi/source/blender/render/intern/include/rayobject_rtbuild.h
   2009-06-30 22:07:42 UTC (rev 21277)
@@ -0,0 +1,84 @@
+/**
+ * $Id$
+ *
+ * * BEGIN GPL LICENSE BLOCK *
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU General Public License
+ * as published by the Free Software Foundation; either version 2
+ * of the License, or (at your option) any later version. 
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
+ *
+ * The Original Code is Copyright (C) 2009 Blender Foundation.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): André Pinto.
+ *
+ * * END GPL LICENSE BLOCK *
+ */
+#ifndef RE_RAYOBJECT_RTBUILD_H
+#define RE_RAYOBJECT_RTBUILD_H
+
+#include rayobject.h
+
+/*
+ * Ray Tree Builder
+ * this structs helps building any type of tree
+ * it contains several methods to organiza/split nodes
+ * allowing to create a given tree on the fly.
+ *
+ * Idea is that other trees BVH, BIH can use this code to
+ * generate with simple calls, and then convert to the theirs
+ * specific structure on the fly.
+ */
+#define MAX_CHILDS 32
+typedef struct RTBuilder
+{
+   /* list to all primitives in this tree */
+   RayObject **begin, **end;
+   
+   /* axis used (if any) on the split method */
+   int split_axis;
+   
+   /* links to child partitions calculated during splitting */
+   RayObject **child[MAX_CHILDS+1];
+
+} RTBuilder;
+
+/* used during creation */
+RTBuilder* rtbuild_create(int size);
+void rtbuild_free(RTBuilder *b);
+void rtbuild_add(RTBuilder *b, RayObject *o);
+int rtbuild_size(RTBuilder *b);
+
+/* used during tree reorganization */
+RTBuilder* rtbuild_get_child(RTBuilder *b, int child, RTBuilder *tmp);
+void rtbuild_mean_split(RTBuilder *b, int nchilds, int axis);
+void rtbuild_mean_split_largest_axis(RTBuilder *b, int nchilds);
+
+/*
+static BVHNode *bvh_rearrange(BVHTree *tree, RTBuilder *b)
+{
+   int i;
+   int nc = rtbuild_mean_split_largest_axis(b, BVH_NCHILDS);
+   RTBuilder tmp;
+   
+   BVHNode *bvh = 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21278] branches/blender2.5/blender/source /blender: 2.5/Sculpt:

2009-06-30 Thread Nicholas Bishop
Revision: 21278
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21278
Author:   nicholasbishop
Date: 2009-07-01 01:06:50 +0200 (Wed, 01 Jul 2009)

Log Message:
---
2.5/Sculpt:

== Re-added smooth stroke ==

UI: toggle is just in the sculpt menu for now. Also changes the sculpt paint 
cursor slightly, draws a line between previous and current locations.

It's a different implementation than in 2.4, works like this:

The stroke interpolates between the last mouse location and the current 
location, weighted towards the previous location. If the stroke gets within a 
certain radius of the current mouse location, the stroke stops. This radius 
allows for sharp turns in the stroke.

Todo: there are two hard-coded parameters that should become user settable, 
that's the weighting between previous and current locations, and most 
important, the no-update radius.

Note also that this option was added as a per-brush flag, worth discussing 
whether that's the correct place, or whether it should be a sculpt setting like 
symmetry?

== Improved stroke spacing ==
The previous implementation of stroke spacing simply guaranteed that stroke 
dots would not occur any closer than the space setting. It now forces stroke 
dots to always be the specified distance apart.

Todo: Performance gets pretty awful with a small spacing setting, this needs 
optimization.

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c

branches/blender2.5/blender/source/blender/editors/space_view3d/view3d_header.c
branches/blender2.5/blender/source/blender/makesdna/DNA_brush_types.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_brush.c

Modified: 
branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c
===
--- branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c
2009-06-30 22:07:42 UTC (rev 21277)
+++ branches/blender2.5/blender/source/blender/editors/sculpt_paint/sculpt.c
2009-06-30 23:06:50 UTC (rev 21278)
@@ -156,7 +156,6 @@
float old_grab_location[3];
int symmetry; /* Symmetry index between 0 and 7 */
float view_normal[3], view_normal_symmetry[3];
-   int last_dot[2]; /* Last location of stroke application */
int last_rake[2]; /* Last location of updating rake rotation */
 } StrokeCache;
 
@@ -849,15 +848,6 @@
const char symm = sd-flags  7;
int i;
 
-   /* Brush spacing: only apply dot if next dot is far enough away */
-   if((sd-brush-flag  BRUSH_SPACE)  !(sd-brush-flag  
BRUSH_ANCHORED)  !cache-first_time) {
-   int dx = cache-last_dot[0] - cache-mouse[0];
-   int dy = cache-last_dot[1] - cache-mouse[1];
-   if(sqrt(dx*dx+dy*dy)  sd-brush-spacing)
-   return;
-   }
-   memcpy(cache-last_dot, cache-mouse, sizeof(int) * 2);
-
VecCopyf(cache-location, cache-true_location);
VecCopyf(cache-grab_delta_symmetry, cache-grab_delta);
cache-symmetry = 0;
@@ -1050,16 +1040,21 @@
 {
Sculpt *sd= CTX_data_tool_settings(C)-sculpt;

-   glTranslatef((float)x, (float)y, 0.0f);
-   
glColor4ub(255, 100, 100, 128);
glEnable( GL_LINE_SMOOTH );
glEnable(GL_BLEND);
+
+   glTranslatef((float)x, (float)y, 0.0f);
glutil_draw_lined_arc(0.0, M_PI*2.0, sd-brush-size, 40);
+   glTranslatef((float)-x, (float)-y, 0.0f);
+
+   if(sd-session  sd-session-cache  sd-brush  (sd-brush-flag  
BRUSH_SMOOTH_STROKE)) {
+   ARegion *ar = CTX_wm_region(C);
+   sdrawline(x, y, sd-session-cache-mouse[0] - ar-winrct.xmin, 
sd-session-cache-mouse[1] - ar-winrct.ymin);
+   }
+
glDisable(GL_BLEND);
glDisable( GL_LINE_SMOOTH );
-   
-   glTranslatef((float)-x, (float)-y, 0.0f);
 }
 
 static void toggle_paint_cursor(bContext *C)
@@ -1202,6 +1197,9 @@
RNA_int_get_array(op-ptr, initial_mouse, cache-initial_mouse);
cache-depth = RNA_float_get(op-ptr, depth);
 
+   cache-mouse[0] = cache-initial_mouse[0];
+   cache-mouse[1] = cache-initial_mouse[1];
+
/* Truly temporary data that isn't stored in properties */
 
view3d_set_viewcontext(C, cache-vc);
@@ -1407,13 +1405,99 @@
ED_region_tag_redraw(ar);
 }
 
+/* Returns zero if no sculpt changes should be made, non-zero otherwise */
+static int sculpt_smooth_stroke(Sculpt *s, int output[2], wmEvent *event)
+{
+   output[0] = event-x;
+   output[1] = event-y;
+
+   if(s-brush-flag  BRUSH_SMOOTH_STROKE  s-brush-sculpt_tool != 
SCULPT_TOOL_GRAB) {
+   StrokeCache *cache = s-session-cache;
+   float u = .9, v = 1.0 - u;
+   int dx = cache-mouse[0] - event-x, dy = cache-mouse[1] - 
event-y;
+   int radius = 50;
+
+   /* If the 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21279] branches/soc-2009-aligorith/source /blender/editors: NLA SoC: Renamed a few options for the Mirror operators since their purpose wasn' t clear

2009-06-30 Thread Joshua Leung
Revision: 21279
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21279
Author:   aligorith
Date: 2009-07-01 03:17:58 +0200 (Wed, 01 Jul 2009)

Log Message:
---
NLA SoC: Renamed a few options for the Mirror operators since their purpose 
wasn't clear (in practice)

Modified Paths:
--

branches/soc-2009-aligorith/source/blender/editors/space_action/action_edit.c

branches/soc-2009-aligorith/source/blender/editors/space_action/action_header.c
branches/soc-2009-aligorith/source/blender/editors/space_graph/graph_edit.c

branches/soc-2009-aligorith/source/blender/editors/space_graph/graph_header.c

Modified: 
branches/soc-2009-aligorith/source/blender/editors/space_action/action_edit.c
===
--- 
branches/soc-2009-aligorith/source/blender/editors/space_action/action_edit.c   
2009-06-30 23:06:50 UTC (rev 21278)
+++ 
branches/soc-2009-aligorith/source/blender/editors/space_action/action_edit.c   
2009-07-01 01:17:58 UTC (rev 21279)
@@ -1198,10 +1198,10 @@
 
 /* defines for mirror keyframes tool */
 EnumPropertyItem prop_actkeys_mirror_types[] = {
-   {ACTKEYS_MIRROR_CFRA, CFRA, 0, Current frame, },
-   {ACTKEYS_MIRROR_YAXIS, YAXIS, 0, Vertical Axis, },
-   {ACTKEYS_MIRROR_XAXIS, XAXIS, 0, Horizontal Axis, },
-   {ACTKEYS_MIRROR_MARKER, MARKER, 0, First Selected Marker, },
+   {ACTKEYS_MIRROR_CFRA, CFRA, 0, By Times over Current frame, },
+   {ACTKEYS_MIRROR_YAXIS, YAXIS, 0, By Times over Time=0, },
+   {ACTKEYS_MIRROR_XAXIS, XAXIS, 0, By Values over Value=0, },
+   {ACTKEYS_MIRROR_MARKER, MARKER, 0, By Times over First Selected 
Marker, },
{0, NULL, 0, NULL, NULL}
 };
 

Modified: 
branches/soc-2009-aligorith/source/blender/editors/space_action/action_header.c
===
--- 
branches/soc-2009-aligorith/source/blender/editors/space_action/action_header.c 
2009-06-30 23:06:50 UTC (rev 21278)
+++ 
branches/soc-2009-aligorith/source/blender/editors/space_action/action_header.c 
2009-07-01 01:17:58 UTC (rev 21279)
@@ -167,18 +167,18 @@
 
 static void act_edit_snapmenu(bContext *C, uiLayout *layout, void *arg_unused)
 {
-   uiItemEnumO(layout, To Current Frame, 0, ACT_OT_snap, mode, 
ACTKEYS_SNAP_CFRA);
-   uiItemEnumO(layout, To Nearest Frame, 0, ACT_OT_snap, mode, 
ACTKEYS_SNAP_NEAREST_FRAME);
-   uiItemEnumO(layout, To Nearest Second, 0, ACT_OT_snap, mode, 
ACTKEYS_SNAP_NEAREST_SECOND);
-   uiItemEnumO(layout, To Nearest Marker, 0, ACT_OT_snap, mode, 
ACTKEYS_SNAP_NEAREST_MARKER);
+   uiItemEnumO(layout, NULL, 0, ACT_OT_snap, type, ACTKEYS_SNAP_CFRA);
+   uiItemEnumO(layout, NULL, 0, ACT_OT_snap, type, 
ACTKEYS_SNAP_NEAREST_FRAME);
+   uiItemEnumO(layout, NULL, 0, ACT_OT_snap, type, 
ACTKEYS_SNAP_NEAREST_SECOND);
+   uiItemEnumO(layout, NULL, 0, ACT_OT_snap, type, 
ACTKEYS_SNAP_NEAREST_MARKER);
 }
 
 static void act_edit_mirrormenu(bContext *C, uiLayout *layout, void 
*arg_unused)
 {
-   uiItemEnumO(layout, Over Current Frame, 0, ACT_OT_mirror, mode, 
ACTKEYS_MIRROR_CFRA);
-   uiItemEnumO(layout, Over Vertical Axis, 0, ACT_OT_mirror, mode, 
ACTKEYS_MIRROR_YAXIS);
-   uiItemEnumO(layout, Over Horizontal Axis, 0, ACT_OT_mirror, mode, 
ACTKEYS_MIRROR_XAXIS);
-   uiItemEnumO(layout, Over Selected Marker, 0, ACT_OT_mirror, mode, 
ACTKEYS_MIRROR_MARKER);
+   uiItemEnumO(layout, NULL, 0, ACT_OT_mirror, type, 
ACTKEYS_MIRROR_CFRA);
+   uiItemEnumO(layout, NULL, 0, ACT_OT_mirror, type, 
ACTKEYS_MIRROR_YAXIS);
+   uiItemEnumO(layout, NULL, 0, ACT_OT_mirror, type, 
ACTKEYS_MIRROR_XAXIS);
+   uiItemEnumO(layout, NULL, 0, ACT_OT_mirror, type, 
ACTKEYS_MIRROR_MARKER);
 }
 
 static void act_edit_handlesmenu(bContext *C, uiLayout *layout, void 
*arg_unused)

Modified: 
branches/soc-2009-aligorith/source/blender/editors/space_graph/graph_edit.c
===
--- branches/soc-2009-aligorith/source/blender/editors/space_graph/graph_edit.c 
2009-06-30 23:06:50 UTC (rev 21278)
+++ branches/soc-2009-aligorith/source/blender/editors/space_graph/graph_edit.c 
2009-07-01 01:17:58 UTC (rev 21279)
@@ -1581,10 +1581,10 @@
 
 /* defines for mirror keyframes tool */
 EnumPropertyItem prop_graphkeys_mirror_types[] = {
-   {GRAPHKEYS_MIRROR_CFRA, CFRA, 0, Current frame, },
-   {GRAPHKEYS_MIRROR_YAXIS, YAXIS, 0, Vertical Axis, },
-   {GRAPHKEYS_MIRROR_XAXIS, XAXIS, 0, Horizontal Axis, },
-   {GRAPHKEYS_MIRROR_MARKER, MARKER, 0, First Selected Marker, },
+   {GRAPHKEYS_MIRROR_CFRA, CFRA, 0, By Times over Current frame, },
+   {GRAPHKEYS_MIRROR_YAXIS, YAXIS, 0, By Times over Time=0, },
+   {GRAPHKEYS_MIRROR_XAXIS, XAXIS, 0, By Values over Value=0, },
+   {GRAPHKEYS_MIRROR_MARKER, MARKER, 0, By Times over First Selected 
Marker, },
{0, 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21280] branches/soc-2009-yukishiro/source /blender: improve rotation.

2009-06-30 Thread Jingyuan Huang
Revision: 21280
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21280
Author:   yukishiro
Date: 2009-07-01 06:38:53 +0200 (Wed, 01 Jul 2009)

Log Message:
---
improve rotation. QuatToEul doesn't give me the right euler...

Modified Paths:
--

branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c
branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c

Modified: 
branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c
===
--- 
branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c   
2009-07-01 01:17:58 UTC (rev 21279)
+++ 
branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c   
2009-07-01 04:38:53 UTC (rev 21280)
@@ -583,28 +583,20 @@
switch(event-type) {
case MOUSEMOVE: // use trackball
{
-   float phi, si, q1[4], dvec[3], newvec[3];
+   float phi, si, rvec[4], dvec[3], newvec[3];
calctrackballvec(rop-ar-winrct, event-x, event-y, 
newvec);
 
VecSubf(dvec, newvec, rop-trackvec);
-
si= sqrt(dvec[0]*dvec[0]+ dvec[1]*dvec[1]+ 
dvec[2]*dvec[2]);
si/= (2.0*TRACKBALLSIZE);

-   Crossf(q1+1, rop-trackvec, newvec);
-   Normalize(q1+1);
+   Crossf(rvec+1, rop-trackvec, newvec);
+   Normalize(rvec+1);

while (si  1.0) si -= 2.0;
-   phi = si * M_PI / 2.0;
+   rvec[0] = si * M_PI;
 
-   si= sin(phi);
-   q1[0]= cos(phi);
-   q1[1]*= si;
-   q1[2]*= si;
-   q1[3]*= si;
-
-   SH_rotateLightEnv(env, q1);
-
+   SH_rotateLightEnv(env, rvec);
calctrackballvec(rop-ar-winrct, event-x, event-y, 
rop-trackvec);
 
WM_event_add_notifier(C, NC_LIGHTENV|ND_SH_RESULT, 
NULL);

Modified: branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c
===
--- branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c  
2009-07-01 01:17:58 UTC (rev 21279)
+++ branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c  
2009-07-01 04:38:53 UTC (rev 21280)
@@ -758,15 +758,58 @@
 }
 }
 
-void SH_rotateLightEnv(LightEnv *env, float *quat)
+static void rotvec_to_matrix(float rvec[4], float mat[][3])
 {
+   // rotation vec to matrix
+   float theta = rvec[0];
+   float x = rvec[1];
+   float y = rvec[2];
+   float z = rvec[3];
+   float c = cos(theta);
+   float s = sin(theta);
+
+   mat[0][0] = c + (1-c) * x * x;
+   mat[0][1] = (1-c) * x * y + z * s;
+   mat[0][2] = (1-c) * x * z - y * s;
+   mat[1][0] = (1-c) * y * x - z * s;
+   mat[1][1] = c + (1-c) * y * y;
+   mat[1][2] = (1-c) * y * z + x * s;
+   mat[2][0] = (1-c) * z * x + y * s;
+   mat[2][1] = (1-c) * z * y - x * s;
+   mat[2][2] = c + (1-c) * z * z;
+
+}
+
+static void matrix_to_eul(float mat[][3], float eul[3])
+{
+   if (mat[2][2]  0.) {
+   eul[0] = atan2(mat[0][1], mat[1][1]);
+   eul[1] = eul[2] = 0.0;
+   } 
+   else if (mat[2][2]  -0.) {
+   eul[0] = atan2(mat[0][1], mat[1][1]);
+   eul[1] = M_PI;
+   eul[2] = 0.0;
+   }
+   else {
+   eul[0] = atan2(mat[2][1], mat[2][0]);
+   eul[1] = acos(mat[2][2]);
+   eul[2] = atan2(mat[1][2], -mat[0][2]);
+   }
+}
+
+void SH_rotateLightEnv(LightEnv *env, float *rvec)
+{
int deg, l, m, n;
float eul[3];
+   float mat[3][3];
float new_coeffs[25][3];
ShWigner wigner;
 
-   QuatToEul(quat, eul);
-
+   // rotation vec to euler
+   rotvec_to_matrix(rvec, mat);
+   matrix_to_eul(mat, eul);
+   
// create wigner
deg = env-degree;
wigner = allocate_ShWigner(deg);


___
Bf-blender-cvs mailing list
Bf-blender-cvs@blender.org
http://lists.blender.org/mailman/listinfo/bf-blender-cvs


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [21281] branches/soc-2009-yukishiro/source /blender: fix light rotation

2009-06-30 Thread Jingyuan Huang
Revision: 21281
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=21281
Author:   yukishiro
Date: 2009-07-01 07:57:27 +0200 (Wed, 01 Jul 2009)

Log Message:
---
fix light rotation

Modified Paths:
--

branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c
branches/soc-2009-yukishiro/source/blender/sh/SH_api.h
branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c

Modified: 
branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c
===
--- 
branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c   
2009-07-01 04:38:53 UTC (rev 21280)
+++ 
branches/soc-2009-yukishiro/source/blender/editors/sculpt_paint/paint_light.c   
2009-07-01 05:57:27 UTC (rev 21281)
@@ -578,6 +578,7 @@
 static int light_paint_rotate_modal(bContext *C, wmOperator *op, wmEvent 
*event)
 {
RotateOperation *rop= op-customdata;
+   RegionView3D *rv3d = rop-rv3d;
LightEnv *env= CTX_data_scene(C)-lightenv;
 
switch(event-type) {
@@ -596,7 +597,7 @@
while (si  1.0) si -= 2.0;
rvec[0] = si * M_PI;
 
-   SH_rotateLightEnv(env, rvec);
+   SH_rotateLightEnv(env, rvec, rv3d-viewmat, 
rv3d-viewinv);
calctrackballvec(rop-ar-winrct, event-x, event-y, 
rop-trackvec);
 
WM_event_add_notifier(C, NC_LIGHTENV|ND_SH_RESULT, 
NULL);

Modified: branches/soc-2009-yukishiro/source/blender/sh/SH_api.h
===
--- branches/soc-2009-yukishiro/source/blender/sh/SH_api.h  2009-07-01 
04:38:53 UTC (rev 21280)
+++ branches/soc-2009-yukishiro/source/blender/sh/SH_api.h  2009-07-01 
05:57:27 UTC (rev 21281)
@@ -42,7 +42,7 @@
 void SH_computeMeshCoefficients(struct Scene *scene, struct Object *ob, 
unsigned int customdata_mask);
 void SH_computeLightCoefficients(struct LightEnv *env);
 
-void SH_rotateLightEnv(struct LightEnv *env, float quat[4]);
+void SH_rotateLightEnv(struct LightEnv *env, float quat[4], float 
viewmat[][4], float viewinv[][4]);
 
 void SH_reconstructLightProbe(struct LightEnv *env, struct ImBuf *ibuf);
 void SH_lightProbePreview(struct LightEnv *env, int width, int height,

Modified: branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c
===
--- branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c  
2009-07-01 04:38:53 UTC (rev 21280)
+++ branches/soc-2009-yukishiro/source/blender/sh/intern/compute.c  
2009-07-01 05:57:27 UTC (rev 21281)
@@ -769,46 +769,49 @@
float s = sin(theta);
 
mat[0][0] = c + (1-c) * x * x;
-   mat[0][1] = (1-c) * x * y + z * s;
-   mat[0][2] = (1-c) * x * z - y * s;
-   mat[1][0] = (1-c) * y * x - z * s;
+   mat[1][0] = (1-c) * x * y + z * s;
+   mat[2][0] = (1-c) * x * z - y * s;
+   mat[0][1] = (1-c) * y * x - z * s;
mat[1][1] = c + (1-c) * y * y;
-   mat[1][2] = (1-c) * y * z + x * s;
-   mat[2][0] = (1-c) * z * x + y * s;
-   mat[2][1] = (1-c) * z * y - x * s;
+   mat[2][1] = (1-c) * y * z + x * s;
+   mat[0][2] = (1-c) * z * x + y * s;
+   mat[1][2] = (1-c) * z * y - x * s;
mat[2][2] = c + (1-c) * z * z;
-
 }
 
-static void matrix_to_eul(float mat[][3], float eul[3])
+static void matrix_to_eul(float mat[][4], float eul[3])
 {
if (mat[2][2]  0.) {
-   eul[0] = atan2(mat[0][1], mat[1][1]);
+   eul[0] = atan2(mat[1][0], mat[1][1]);
eul[1] = eul[2] = 0.0;
} 
else if (mat[2][2]  -0.) {
-   eul[0] = atan2(mat[0][1], mat[1][1]);
+   eul[0] = atan2(mat[1][0], mat[1][1]);
eul[1] = M_PI;
eul[2] = 0.0;
}
else {
-   eul[0] = atan2(mat[2][1], mat[2][0]);
+   eul[0] = atan2(mat[1][2], mat[0][2]);
eul[1] = acos(mat[2][2]);
-   eul[2] = atan2(mat[1][2], -mat[0][2]);
+   eul[2] = atan2(mat[2][1], -mat[2][0]);
}
 }
 
-void SH_rotateLightEnv(LightEnv *env, float *rvec)
+void SH_rotateLightEnv(LightEnv *env, float *rvec, float viewmat[][4], float 
viewinv[][4])
 {
int deg, l, m, n;
float eul[3];
-   float mat[3][3];
+   float mat[3][3], tmat[4][4], fmat[4][4];
float new_coeffs[25][3];
ShWigner wigner;
 
// rotation vec to euler
rotvec_to_matrix(rvec, mat);
-   matrix_to_eul(mat, eul);
+
+   Mat4MulMat43(tmat, viewinv, mat); // m1 = m3 * m2
+   Mat4MulMat4(fmat, viewmat, tmat); // m1 = m2 * m3
+
+   matrix_to_eul(fmat, eul);

// create wigner
deg = env-degree;


___