[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17467] branches/sim_physics/source/ blender/render/intern/source/convertblender.c: missed a header in last commit

2008-11-14 Thread Matt Ebb
Revision: 17467
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17467
Author:   broken
Date: 2008-11-15 05:31:12 +0100 (Sat, 15 Nov 2008)

Log Message:
---
missed a header in last commit

Modified Paths:
--
branches/sim_physics/source/blender/render/intern/source/convertblender.c

Modified: 
branches/sim_physics/source/blender/render/intern/source/convertblender.c
===
--- branches/sim_physics/source/blender/render/intern/source/convertblender.c   
2008-11-15 04:16:46 UTC (rev 17466)
+++ branches/sim_physics/source/blender/render/intern/source/convertblender.c   
2008-11-15 04:31:12 UTC (rev 17467)
@@ -113,6 +113,7 @@
 #include "shading.h"
 #include "strand.h"
 #include "texture.h"
+#include "volume_precache.h"
 #include "sss.h"
 #include "strand.h"
 #include "zbuf.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 [17466] branches/sim_physics/source/ blender/render/intern: cleaned some code and split volume precaching into a new file

2008-11-14 Thread Matt Ebb
Revision: 17466
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17466
Author:   broken
Date: 2008-11-15 05:16:46 +0100 (Sat, 15 Nov 2008)

Log Message:
---
cleaned some code and split volume precaching into a new file

Modified Paths:
--
branches/sim_physics/source/blender/render/intern/include/volumetric.h
branches/sim_physics/source/blender/render/intern/source/volumetric.c

Added Paths:
---
branches/sim_physics/source/blender/render/intern/include/volume_precache.h
branches/sim_physics/source/blender/render/intern/source/volume_precache.c

Added: 
branches/sim_physics/source/blender/render/intern/include/volume_precache.h
===
--- branches/sim_physics/source/blender/render/intern/include/volume_precache.h 
(rev 0)
+++ branches/sim_physics/source/blender/render/intern/include/volume_precache.h 
2008-11-15 04:16:46 UTC (rev 17466)
@@ -0,0 +1,30 @@
+/**
+ *
+ * * 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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Matt Ebb.
+ *
+ * * END GPL LICENSE BLOCK *
+ */
+ 
+void volume_precache(Render *re);
+void free_volume_precache(Render *re);
\ No newline at end of file

Modified: branches/sim_physics/source/blender/render/intern/include/volumetric.h
===
--- branches/sim_physics/source/blender/render/intern/include/volumetric.h  
2008-11-15 02:58:47 UTC (rev 17465)
+++ branches/sim_physics/source/blender/render/intern/include/volumetric.h  
2008-11-15 04:16:46 UTC (rev 17466)
@@ -21,12 +21,23 @@
  *
  * The Original Code is: all of this file.
  *
- * Contributor(s): Farsthary (Raul FHernandez), Matt Ebb.
+ * Contributor(s): Matt Ebb.
  *
  * * END GPL LICENSE BLOCK *
  */
 
+float vol_get_stepsize(struct ShadeInput *shi, int context);
+float vol_get_density(struct ShadeInput *shi, float *co);
+void vol_get_scattering(ShadeInput *shi, float *scatter, float *co, float 
stepsize, float density);
+
 void volume_trace(struct ShadeInput *shi, struct ShadeResult *shr);
 void volume_trace_shadow(struct ShadeInput *shi, struct ShadeResult *shr, 
struct Isect *last_is);
-void volume_precache(Render *re);
-void free_volume_precache(Render *re);
\ No newline at end of file
+
+#define STEPSIZE_VIEW  0
+#define STEPSIZE_SHADE 1
+
+#define VOL_IS_BACKFACE1
+#define VOL_IS_SAMEMATERIAL2
+
+#define VOL_BOUNDS_DEPTH   0
+#define VOL_BOUNDS_SS  1
\ No newline at end of file

Added: 
branches/sim_physics/source/blender/render/intern/source/volume_precache.c
===
--- branches/sim_physics/source/blender/render/intern/source/volume_precache.c  
(rev 0)
+++ branches/sim_physics/source/blender/render/intern/source/volume_precache.c  
2008-11-15 04:16:46 UTC (rev 17466)
@@ -0,0 +1,356 @@
+/**
+ *
+ * * 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) 2001-2002 by NaN Holding BV.
+ * All rights reserved.
+ *
+ * The Original Code is: all of this file.
+ *
+ * Contributor(s): Matt Ebb.
+ *
+ * * END GPL LICENSE BLOCK *
+ */
+
+#include 
+#include 
+#include 
+#include 
+
+#include "MEM_guardedalloc.h"
+
+#include "BL

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17439] trunk/blender/source/blender/src: Removed support for nested texture trees, minor ui enhancements

2008-11-14 Thread Robin Allen
Revision: 17439
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17439
Author:   kakbarnf
Date: 2008-11-13 10:57:11 +0100 (Thu, 13 Nov 2008)

Log Message:
---
Removed support for nested texture trees, minor ui enhancements

Modified Paths:
--
trunk/blender/source/blender/src/buttons_shading.c
trunk/blender/source/blender/src/drawnode.c
trunk/blender/source/blender/src/editnode.c

Modified: trunk/blender/source/blender/src/buttons_shading.c
===
--- trunk/blender/source/blender/src/buttons_shading.c  2008-11-13 04:15:19 UTC 
(rev 17438)
+++ trunk/blender/source/blender/src/buttons_shading.c  2008-11-13 09:57:11 UTC 
(rev 17439)
@@ -3700,7 +3700,8 @@

if(mtex->tex->use_nodes) {
char *menustr = ntreeTexOutputMenu(mtex->tex->nodetree);
-   uiDefButS(block, MENU, B_MATPRV, menustr, 100, 100, 
163, 20, &mtex->which_output, 0, 0, 0, 0, "Which output to use, for 
multi-output textures");
+   uiDefBut(block, LABEL, 0, "Use Output:", 100, 100, 163, 
20, 0, 0, 0, 0, 0, "");
+   uiDefButS(block, MENU, B_MATPRV, menustr, 100, 80, 163, 
20, &mtex->which_output, 0, 0, 0, 0, "Which output to use, for multi-output 
textures");
free(menustr);
}
}

Modified: trunk/blender/source/blender/src/drawnode.c
===
--- trunk/blender/source/blender/src/drawnode.c 2008-11-13 04:15:19 UTC (rev 
17438)
+++ trunk/blender/source/blender/src/drawnode.c 2008-11-13 09:57:11 UTC (rev 
17439)
@@ -494,7 +494,12 @@
 
 static int node_buts_texture(uiBlock *block, bNodeTree *ntree, bNode *node, 
rctf *butr)
 {
-   short multi = (node->id && ((Tex*)node->id)->use_nodes && (node->type 
!= CMP_NODE_TEXTURE));
+   short multi = (
+   node->id &&
+   ((Tex*)node->id)->use_nodes &&
+   (node->type != CMP_NODE_TEXTURE) &&
+   (node->type != TEX_NODE_TEXTURE)
+   );

if(block) {
uiBut *bt;

Modified: trunk/blender/source/blender/src/editnode.c
===
--- trunk/blender/source/blender/src/editnode.c 2008-11-13 04:15:19 UTC (rev 
17438)
+++ trunk/blender/source/blender/src/editnode.c 2008-11-13 09:57:11 UTC (rev 
17439)
@@ -180,6 +180,7 @@
}
else if(snode->treetype==NTREE_TEXTURE) {
ntreeTexUpdatePreviews(snode->nodetree);
+   BIF_preview_changed(ID_TE);
}
 }
 


___
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 [17465] branches/projection-paint/source/ blender/src/imagepaint.c: made undo on multiple images works

2008-11-14 Thread Campbell Barton
Revision: 17465
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17465
Author:   campbellbarton
Date: 2008-11-15 03:58:47 +0100 (Sat, 15 Nov 2008)

Log Message:
---
made undo on multiple images works

Modified Paths:
--
branches/projection-paint/source/blender/src/imagepaint.c

Modified: branches/projection-paint/source/blender/src/imagepaint.c
===
--- branches/projection-paint/source/blender/src/imagepaint.c   2008-11-14 
20:54:50 UTC (rev 17464)
+++ branches/projection-paint/source/blender/src/imagepaint.c   2008-11-15 
02:58:47 UTC (rev 17465)
@@ -2163,25 +2163,37 @@
}

INIT_MINMAX2(ps->viewMin2D, ps->viewMax2D);
-   
-   for(a=0; a < ps->dm_totvert; a++, projScreenCo++) {
-   VECCOPY((*projScreenCo), ps->dm_mvert[a].co);   
-   (*projScreenCo)[3] = 1.0;
-   
-   Mat4MulVec4fl(ps->projectMat, (*projScreenCo));
-   
-   if( (*projScreenCo)[3] > 0.001 ) {
+
+   if (ps->projectIsOrtho) {
+   for(a=0; a < ps->dm_totvert; a++, projScreenCo++) {
+   VECCOPY((*projScreenCo), ps->dm_mvert[a].co);
+   Mat4MulVecfl(ps->projectMat, (*projScreenCo));
+
/* screen space, not clamped */
-   (*projScreenCo)[0] = 
(float)(curarea->winx/2.0)+(curarea->winx/2.0)*(*projScreenCo)[0]/(*projScreenCo)[3];
  
-   (*projScreenCo)[1] = 
(float)(curarea->winy/2.0)+(curarea->winy/2.0)*(*projScreenCo)[1]/(*projScreenCo)[3];
-   (*projScreenCo)[2] = 
(*projScreenCo)[2]/(*projScreenCo)[3]; /* Use the depth for bucket point 
occlusion */
+   (*projScreenCo)[0] = 
(float)(curarea->winx/2.0)+(curarea->winx/2.0)*(*projScreenCo)[0];
+   (*projScreenCo)[1] = 
(float)(curarea->winy/2.0)+(curarea->winy/2.0)*(*projScreenCo)[1];
DO_MINMAX2((*projScreenCo), ps->viewMin2D, 
ps->viewMax2D);
-   } else {
-   /* TODO - deal with cases where 1 side of a face goes 
behind the view ? */
-   (*projScreenCo)[0] = (*projScreenCo)[1] = MAXFLOAT;
}
+   } else {
+   for(a=0; a < ps->dm_totvert; a++, projScreenCo++) {
+   VECCOPY((*projScreenCo), ps->dm_mvert[a].co);
+   (*projScreenCo)[3] = 1.0;
+
+   Mat4MulVec4fl(ps->projectMat, (*projScreenCo));
+
+   if( (*projScreenCo)[3] > 0.001 ) {
+   /* screen space, not clamped */
+   (*projScreenCo)[0] = 
(float)(curarea->winx/2.0)+(curarea->winx/2.0)*(*projScreenCo)[0]/(*projScreenCo)[3];
+   (*projScreenCo)[1] = 
(float)(curarea->winy/2.0)+(curarea->winy/2.0)*(*projScreenCo)[1]/(*projScreenCo)[3];
+   (*projScreenCo)[2] = 
(*projScreenCo)[2]/(*projScreenCo)[3]; /* Use the depth for bucket point 
occlusion */
+   DO_MINMAX2((*projScreenCo), ps->viewMin2D, 
ps->viewMax2D);
+   } else {
+   /* TODO - deal with cases where 1 side of a 
face goes behind the view ? */
+   (*projScreenCo)[0] = MAXFLOAT;
+   }
+   }
}
-   
+
/* setup clone offset */
if (ps->tool == PAINT_TOOL_CLONE) {
float projCo[4];
@@ -2224,7 +2236,17 @@

for( a = 0, tf = ps->dm_mtface, mf = ps->dm_mface; a < ps->dm_totface; 
mf++, tf++, a++ ) {
if (tf->tpage && ((G.f & G_FACESELECT)==0 || mf->flag & 
ME_FACE_SEL)) {
-   
+
+   if (!ps->projectIsOrtho) {
+   if (
ps->projectVertScreenCos[mf->v1][0]==MAXFLOAT ||
+   
ps->projectVertScreenCos[mf->v2][0]==MAXFLOAT ||
+   
ps->projectVertScreenCos[mf->v3][0]==MAXFLOAT ||
+   (mf->v4 && 
ps->projectVertScreenCos[mf->v4][0]==MAXFLOAT)
+   ) {
+   continue;
+   }
+   }
+
if (ps->projectIsBackfaceCull) {
/* TODO - we dont really need the normal, just 
the direction, save a sqrt? */
if (mf->v4) 
CalcNormFloat4(ps->dm_mvert[mf->v1].co, ps->dm_mvert[mf->v2].co, 
ps->dm_mvert[mf->v3].co, ps->dm_mvert[mf->v4].co, f_no);
@@ -2361,7 +2383,7 @@

if 
(last_undo_grid[tile_index]==NULL) {
   

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17464] branches/soc-2008-unclezeiv/source /blender/blenloader/intern/readfile.c: forgot to update do_versions: files saved with blender 2.48 (or trun

2008-11-14 Thread Davide Vercelli
Revision: 17464
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17464
Author:   unclezeiv
Date: 2008-11-14 21:54:50 +0100 (Fri, 14 Nov 2008)

Log Message:
---
forgot to update do_versions: files saved with blender 2.48 (or trunk) would 
not have lightcuts related values correctly initialized

Modified Paths:
--
branches/soc-2008-unclezeiv/source/blender/blenloader/intern/readfile.c

Modified: 
branches/soc-2008-unclezeiv/source/blender/blenloader/intern/readfile.c
===
--- branches/soc-2008-unclezeiv/source/blender/blenloader/intern/readfile.c 
2008-11-14 19:39:12 UTC (rev 17463)
+++ branches/soc-2008-unclezeiv/source/blender/blenloader/intern/readfile.c 
2008-11-14 20:54:50 UTC (rev 17464)
@@ -7821,40 +7821,6 @@
ob->pd->f_noise = 0.0;
}
}
-   
-   /* lightcuts stuff */
-   if(main->versionfile <= 247) {
-   Scene *sce= main->scene.first;
-   RenderData *r;
-   
-   while(sce) {
-   r= &sce->r;
-   if(r) {
-   if(r->lightcuts_max_error<=0.0)
-   r->lightcuts_max_error= 0.02;
-   if(r->lightcuts_max_cut<=0)
-   r->lightcuts_max_cut= 1000;
-   if(r->lightcuts_indir_fac<=0.0f)
-   r->lightcuts_indir_fac= 100.0f;
-   if(r->lightcuts_env_map<=0.0f)
-   r->lightcuts_env_map= 4096.0f;
-   if(r->lightcuts_area_lights<=0)
-   r->lightcuts_area_lights= 4000;
-   if(r->lightcuts_indir_dist<=0.0f)
-   r->lightcuts_indir_dist= 5.0f;
-   if(r->lightcuts_color_weight==0)
-   r->lightcuts_color_weight= 1;
-   if(r->lightcuts_env_map_fac==0.0f)
-   r->lightcuts_env_map_fac= 1.0f;
-   if(r->lightcuts_indir_bounces==0)
-   r->lightcuts_indir_bounces= 1;
-   if(r->lightcuts_meshlights==0)
-   r->lightcuts_meshlights= 4000;
-   }
-   
-   sce= sce->id.next;
-   }
-   }
 
if (main->versionfile < 247 || (main->versionfile == 247 && 
main->subversionfile < 2)){
Object *ob;
@@ -7987,6 +7953,40 @@
}
}

+   /* lightcuts stuff */
+   if(main->versionfile <= 248) {
+   Scene *sce= main->scene.first;
+   RenderData *r;
+
+   while(sce) {
+   r= &sce->r;
+   if(r) {
+   if(r->lightcuts_max_error<=0.0)
+   r->lightcuts_max_error= 0.02;
+   if(r->lightcuts_max_cut<=0)
+   r->lightcuts_max_cut= 1000;
+   if(r->lightcuts_indir_fac<=0.0f)
+   r->lightcuts_indir_fac= 100.0f;
+   if(r->lightcuts_env_map<=0.0f)
+   r->lightcuts_env_map= 4096.0f;
+   if(r->lightcuts_area_lights<=0)
+   r->lightcuts_area_lights= 4000;
+   if(r->lightcuts_indir_dist<=0.0f)
+   r->lightcuts_indir_dist= 5.0f;
+   if(r->lightcuts_color_weight==0)
+   r->lightcuts_color_weight= 1;
+   if(r->lightcuts_env_map_fac==0.0f)
+   r->lightcuts_env_map_fac= 1.0f;
+   if(r->lightcuts_indir_bounces==0)
+   r->lightcuts_indir_bounces= 1;
+   if(r->lightcuts_meshlights==0)
+   r->lightcuts_meshlights= 4000;
+   }
+
+   sce= sce->id.next;
+   }
+   }
+   
/* WATCH IT!!!: pointers from libdata have not been converted yet here! 
*/
/* WATCH IT 2!: Userdef struct init has to be in src/usiblender.c! */
 


___
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 [17463] branches/blender2.5/blender/source /blender/makesrna/intern/rna_rna.c:

2008-11-14 Thread Brecht Van Lommel
Revision: 17463
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17463
Author:   blendix
Date: 2008-11-14 20:39:12 +0100 (Fri, 14 Nov 2008)

Log Message:
---

RNA: fix small capitalization mistake.

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesrna/intern/rna_rna.c

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_rna.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_rna.c
2008-11-14 18:46:57 UTC (rev 17462)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_rna.c
2008-11-14 19:39:12 UTC (rev 17463)
@@ -438,13 +438,13 @@
prop= RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Struct_name_get", 
"rna_Struct_name_length", NULL);
-   RNA_def_property_ui_text(prop, "name", "human readable name.");
+   RNA_def_property_ui_text(prop, "Name", "Human readable name.");
RNA_def_struct_name_property(srna, prop);
 
prop= RNA_def_property(srna, "identifier", PROP_STRING, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);
RNA_def_property_string_funcs(prop, "rna_Struct_identifier_get", 
"rna_Struct_identifier_length", NULL);
-   RNA_def_property_ui_text(prop, "identifier", "unique name used in the 
code and scripting.");
+   RNA_def_property_ui_text(prop, "Identifier", "Unique name used in the 
code and scripting.");
 
prop= RNA_def_property(srna, "name_property", PROP_POINTER, PROP_NONE);
RNA_def_property_flag(prop, PROP_NOT_EDITABLE);


___
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 [17462] branches/blender2.5/blender/source /blender:

2008-11-14 Thread Brecht Van Lommel
Revision: 17462
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17462
Author:   blendix
Date: 2008-11-14 19:46:57 +0100 (Fri, 14 Nov 2008)

Log Message:
---

RNA
* Rename cname to identifier.
* Rename PropertyEnumItem to EnumPropertyItem.
* Wrapped min/max/step/precision, pointer type for RNA.
* Draw FLT_MAX a bit better in buttons.

Modified Paths:
--
branches/blender2.5/blender/source/blender/editors/interface/interface.c
branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
branches/blender2.5/blender/source/blender/makesrna/RNA_define.h
branches/blender2.5/blender/source/blender/makesrna/RNA_types.h
branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_dependency.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_rna.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c

Modified: 
branches/blender2.5/blender/source/blender/editors/interface/interface.c
===
--- branches/blender2.5/blender/source/blender/editors/interface/interface.c
2008-11-14 17:33:15 UTC (rev 17461)
+++ branches/blender2.5/blender/source/blender/editors/interface/interface.c
2008-11-14 18:46:57 UTC (rev 17462)
@@ -27,6 +27,7 @@
  * * END GPL LICENSE BLOCK *
  */
 
+#include 
 #include 
 #include 
  
@@ -1514,7 +1515,9 @@
value= ui_get_but_val(but);
 
if(ui_is_but_float(but)) {
-   if(but->a2) { /* amount of digits defined */
+   if(value == FLT_MAX) sprintf(but->drawstr, "%sFLT_MAX", 
but->str);
+   else if(value == -FLT_MAX) sprintf(but->drawstr, 
"%s-FLT_MAX", but->str);
+   else if(but->a2) { /* amount of digits defined */
if(but->a2==1) sprintf(but->drawstr, "%s%.1f", 
but->str, value);
else if(but->a2==2) sprintf(but->drawstr, 
"%s%.2f", but->str, value);
else if(but->a2==3) sprintf(but->drawstr, 
"%s%.3f", but->str, value);
@@ -2261,7 +2264,7 @@
break;
}
case PROP_ENUM: {
-   const PropertyEnumItem *item;
+   const EnumPropertyItem *item;
DynStr *dynstr;
char *menu;
int i, totitem;

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2008-11-14 17:33:15 UTC (rev 17461)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2008-11-14 18:46:57 UTC (rev 17462)
@@ -39,7 +39,7 @@
 
 /* Structs */
 
-const char *RNA_struct_cname(PointerRNA *ptr);
+const char *RNA_struct_identifier(PointerRNA *ptr);
 const char *RNA_struct_ui_name(PointerRNA *ptr);
 
 PropertyRNA *RNA_struct_name_property(PointerRNA *ptr);
@@ -52,7 +52,7 @@
 
 /* Property Information */
 
-const char *RNA_property_cname(PropertyRNA *prop, PointerRNA *ptr);
+const char *RNA_property_identifier(PropertyRNA *prop, PointerRNA *ptr);
 PropertyType RNA_property_type(PropertyRNA *prop, PointerRNA *ptr);
 PropertySubType RNA_property_subtype(PropertyRNA *prop, PointerRNA *ptr);
 
@@ -66,7 +66,7 @@
 
 int RNA_property_string_maxlength(PropertyRNA *prop, PointerRNA *ptr);
 
-void RNA_property_enum_items(PropertyRNA *prop, PointerRNA *ptr, const 
PropertyEnumItem **item, int *totitem);
+void RNA_property_enum_items(PropertyRNA *prop, PointerRNA *ptr, const 
EnumPropertyItem **item, int *totitem);
 
 const char *RNA_property_ui_name(PropertyRNA *prop, PointerRNA *ptr);
 const char *RNA_property_ui_description(PropertyRNA *prop, PointerRNA *ptr);

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_define.h
===
--- branches/blender2.5/blender/source/blender/makesrna/RNA_define.h
2008-11-14 17:33:15 UTC (rev 17461)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_define.h
2008-11-14 18:46:57 UTC (rev 17462)
@@ -43,14 +43,14 @@
 
 /* Struct */
 
-StructRNA *RNA_def_struct(BlenderRNA *brna, const char *cname, const char 
*name);
+StructRNA *RNA_def_struct(BlenderRNA *brna, const char *identifier, const char 
*name);
 void RNA_def_struct_sdna(StructRNA *srna, const char *structname);
 void RNA_def_struct_name_property(StructRNA *srna, PropertyRNA *prop);
 void RNA_def_struct_flag(StructRNA *srna, int flag);
 
 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17461] branches/etch-a-ton/source/blender /src: Pkey toggle sketching panel

2008-11-14 Thread Martin Poirier
Revision: 17461
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17461
Author:   theeth
Date: 2008-11-14 18:33:15 +0100 (Fri, 14 Nov 2008)

Log Message:
---
Pkey toggle sketching panel

(it used to do select parent, but that's already done with [ and ] for 
children, no need for a second key).

Modified Paths:
--
branches/etch-a-ton/source/blender/src/editarmature_sketch.c
branches/etch-a-ton/source/blender/src/space.c

Modified: branches/etch-a-ton/source/blender/src/editarmature_sketch.c
===
--- branches/etch-a-ton/source/blender/src/editarmature_sketch.c
2008-11-14 17:30:55 UTC (rev 17460)
+++ branches/etch-a-ton/source/blender/src/editarmature_sketch.c
2008-11-14 17:33:15 UTC (rev 17461)
@@ -209,7 +209,6 @@
if (TEMPLATES_CURRENT == 0 && G.scene->toolsettings->skgen_template != 
NULL)
{
GHashIterator ghi;
-   int index = 0;
BLI_ghashIterator_init(&ghi, TEMPLATES_HASH);

while (!BLI_ghashIterator_isDone(&ghi))
@@ -217,11 +216,9 @@
Object *ob = BLI_ghashIterator_getValue(&ghi);
int key = (int)BLI_ghashIterator_getKey(&ghi);

-   index++;
-   
if (ob == G.scene->toolsettings->skgen_template)
{
-   TEMPLATES_CURRENT = index;
+   TEMPLATES_CURRENT = key;
break;
}


Modified: branches/etch-a-ton/source/blender/src/space.c
===
--- branches/etch-a-ton/source/blender/src/space.c  2008-11-14 17:30:55 UTC 
(rev 17460)
+++ branches/etch-a-ton/source/blender/src/space.c  2008-11-14 17:33:15 UTC 
(rev 17461)
@@ -2516,8 +2516,11 @@

else if(G.qual==LR_ALTKEY && 
G.obedit->type==OB_ARMATURE)
clear_bone_parent();
-   else if((G.qual==0) && 
(G.obedit->type==OB_ARMATURE)) 
-   
armature_select_hierarchy(BONE_SELECT_PARENT, 1); // 1 = add to selection
+   else if((G.qual==0) && 
(G.obedit->type==OB_ARMATURE))
+   { 
+   toggle_blockhandler(curarea, 
VIEW3D_HANDLER_BONESKETCH, UI_PNL_TO_MOUSE);
+   allqueue(REDRAWVIEW3D, 0);
+   }
else 
if((G.qual==(LR_CTRLKEY|LR_ALTKEY)) && (G.obedit->type==OB_ARMATURE))
separate_armature();
else if((G.qual==0) && 
G.obedit->type==OB_MESH)


___
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 [17460] branches/projection-paint/source/ blender/src/imagepaint.c: tile based undo' s now works while projection painting.

2008-11-14 Thread Campbell Barton
Revision: 17460
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17460
Author:   campbellbarton
Date: 2008-11-14 18:30:55 +0100 (Fri, 14 Nov 2008)

Log Message:
---
tile based undo's now works while projection painting.
TODO - float buffer support & for some reason painting on multiple images at 
once dosnt restore the tiles to the right image then undoing.

Modified Paths:
--
branches/projection-paint/source/blender/src/imagepaint.c

Modified: branches/projection-paint/source/blender/src/imagepaint.c
===
--- branches/projection-paint/source/blender/src/imagepaint.c   2008-11-14 
17:05:25 UTC (rev 17459)
+++ branches/projection-paint/source/blender/src/imagepaint.c   2008-11-14 
17:30:55 UTC (rev 17460)
@@ -244,6 +244,7 @@
 
 typedef struct ProjectPixel {
float projCo2D[2]; /* the floating point screen projection of this 
pixel */
+   char origColor[4];
short x_px, y_px;
void *pixel;
short image_index; /* if anyone wants to paint onto more then 32000 
images they can bite me */
@@ -301,6 +302,31 @@
tile->y*IMAPAINT_TILE_SIZE, 0, 0, IMAPAINT_TILE_SIZE, 
IMAPAINT_TILE_SIZE);
 }
 
+static UndoTile *undo_init_tile(ID *id, ImBuf *ibuf, ImBuf **tmpibuf, int 
x_tile, int y_tile)
+{
+   UndoTile *tile;
+   int allocsize;
+   
+   if (*tmpibuf==NULL)
+   *tmpibuf = IMB_allocImBuf(IMAPAINT_TILE_SIZE, 
IMAPAINT_TILE_SIZE, 32, IB_rectfloat|IB_rect, 0);
+   
+   tile= MEM_callocN(sizeof(UndoTile), "ImaUndoTile");
+   tile->id= *id;
+   tile->x= x_tile;
+   tile->y= y_tile;
+
+   allocsize= IMAPAINT_TILE_SIZE*IMAPAINT_TILE_SIZE*4;
+   allocsize *= (ibuf->rect_float)? sizeof(float): sizeof(char);
+   tile->rect= MEM_mapallocN(allocsize, "ImaUndoRect");
+
+   undo_copy_tile(tile, *tmpibuf, ibuf, 0);
+   curundo->undosize += allocsize;
+
+   BLI_addtail(&curundo->tiles, tile);
+   
+   return tile;
+}
+
 static void undo_restore(UndoElem *undo)
 {
Image *ima = NULL;
@@ -1327,8 +1353,10 @@

if (ibuf->rect_float) {
projPixel->pixel = (void *) ((( float * ) 
ibuf->rect_float) + (( x + y * ibuf->x ) * pixel_size));
+   /* TODO float support for origColor */
} else {
projPixel->pixel = (void *) ((( char * ) ibuf->rect) + 
(( x + y * ibuf->x ) * pixel_size));
+   *((unsigned int *)projPixel->origColor) = *((unsigned 
int *)projPixel->pixel);
}

VECCOPY2D(projPixel->projCo2D, pixelScreenCo);
@@ -2258,16 +2286,16 @@
ps->projectImBufs = BLI_memarena_alloc( ps->projectArena, sizeof(ImBuf 
*) * ps->projectImageTotal);
*(ps->projectPartialRedraws) = BLI_memarena_alloc( ps->projectArena, 
sizeof(ImagePaintPartialRedraw) * ps->projectImageTotal * 
PROJ_BOUNDBOX_SQUARED);

-   for (a=1; a< ps->projectImageTotal; a++) {
-   ps->projectPartialRedraws[a] = *(ps->projectPartialRedraws) + 
(a * PROJ_BOUNDBOX_SQUARED);
-   }
-   // calloced - memset(ps->projectPartialRedraws, 0, 
sizeof(ImagePaintPartialRedraw) * ps->projectImageTotal);
-   
for (node= image_LinkList, i=0; node; node= node->next, i++) {
ps->projectImages[i] = node->link;
ps->projectImages[i]->id.flag &= ~LIB_DOIT;
ps->projectImBufs[i] = BKE_image_get_ibuf(ps->projectImages[i], 
NULL);
+   
+   ps->projectPartialRedraws[i] = *(ps->projectPartialRedraws) + 
(i * PROJ_BOUNDBOX_SQUARED);
}
+   
+   // calloced - memset(ps->projectPartialRedraws, 0, 
sizeof(ImagePaintPartialRedraw) * ps->projectImageTotal);
+   
/* we have built the array, discard the linked list */
BLI_linklist_free(image_LinkList, NULL);
 }
@@ -2275,6 +2303,85 @@
 static void project_paint_end( ProjectPaintState *ps )
 {
int a;
+   
+   /* build undo data from original pixel colors */
+   if(U.uiflag & USER_GLOBALUNDO) {
+   ProjectPixel *projPixel;
+   ImBuf *ibuf, *tmpibuf = NULL;
+   LinkNode *pixel_node;
+   UndoTile *tile;
+   UndoTile ***image_undo_tiles = (UndoTile 
***)BLI_memarena_alloc( ps->projectArena, sizeof(UndoTile ***) * 
ps->projectImageTotal);
+   int bucket_index = (ps->bucketsX * ps->bucketsY) - 1; /* we 
could get an X/Y but easier to loop through all possible buckets */
+   int tile_index;
+   int x_round, y_round;
+   int x_tile, y_tile;
+   
+   /* context */
+   int last_image_index = -1;
+   int last_tile_width;
+   ImBuf *last_ibuf;
+   Image *last_ima;
+ 

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

2008-11-14 Thread Brecht Van Lommel
Revision: 17459
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17459
Author:   blendix
Date: 2008-11-14 18:05:25 +0100 (Fri, 14 Nov 2008)

Log Message:
---

RNA
* Added RNA list viewer. This is currently drawn in the outliner
  window, the UI is limited but it is just intended to test RNA
  at the moment.
* Added UI names for currently wrapped properties.
* Made iterating collections a bit more convenient.

Modified Paths:
--
branches/blender2.5/blender/source/Makefile
branches/blender2.5/blender/source/blender/editors/Makefile
branches/blender2.5/blender/source/blender/editors/SConscript
branches/blender2.5/blender/source/blender/editors/include/ED_area.h
branches/blender2.5/blender/source/blender/editors/interface/interface.c
branches/blender2.5/blender/source/blender/editors/screen/spacetypes.c
branches/blender2.5/blender/source/blender/makesdna/DNA_space_types.h
branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
branches/blender2.5/blender/source/blender/makesrna/RNA_types.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_main.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_mesh.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_rna.c

Added Paths:
---
branches/blender2.5/blender/source/blender/editors/space_outliner/
branches/blender2.5/blender/source/blender/editors/space_outliner/Makefile
branches/blender2.5/blender/source/blender/editors/space_outliner/SConscript

branches/blender2.5/blender/source/blender/editors/space_outliner/outliner_intern.h

branches/blender2.5/blender/source/blender/editors/space_outliner/outliner_ops.c

branches/blender2.5/blender/source/blender/editors/space_outliner/space_outliner.c

Modified: branches/blender2.5/blender/source/Makefile
===
--- branches/blender2.5/blender/source/Makefile 2008-11-14 16:09:23 UTC (rev 
17458)
+++ branches/blender2.5/blender/source/Makefile 2008-11-14 17:05:25 UTC (rev 
17459)
@@ -234,6 +234,7 @@
 PULIB += $(NAN_ELBEEM)/lib/$(DEBUG_DIR)libelbeem.a
 PULIB += $(OCGDIR)/blender/readblenfile/$(DEBUG_DIR)libreadblenfile.a
 PULIB += $(OCGDIR)/blender/ed_screen/libed_screen.a
+PULIB += $(OCGDIR)/blender/ed_outliner/libed_outliner.a
 PULIB += $(OCGDIR)/blender/ed_time/libed_time.a
 PULIB += $(OCGDIR)/blender/ed_view3d/libed_view3d.a
 PULIB += $(OCGDIR)/blender/ed_interface/libed_interface.a

Modified: branches/blender2.5/blender/source/blender/editors/Makefile
===
--- branches/blender2.5/blender/source/blender/editors/Makefile 2008-11-14 
16:09:23 UTC (rev 17458)
+++ branches/blender2.5/blender/source/blender/editors/Makefile 2008-11-14 
17:05:25 UTC (rev 17459)
@@ -29,6 +29,6 @@
 # Bounces make to subdirectories.
 
 SOURCEDIR = source/blender/editors
-DIRS = datafiles screen space_time space_view3d interface
+DIRS = datafiles screen space_outliner space_time space_view3d interface
 
 include nan_subdirs.mk

Modified: branches/blender2.5/blender/source/blender/editors/SConscript
===
--- branches/blender2.5/blender/source/blender/editors/SConscript   
2008-11-14 16:09:23 UTC (rev 17458)
+++ branches/blender2.5/blender/source/blender/editors/SConscript   
2008-11-14 17:05:25 UTC (rev 17459)
@@ -6,6 +6,7 @@
'interface/SConscript',
'mesh/SConscript',
'object/SConscript',
+   'space_outliner/SConscript',
'space_time/SConscript',
'space_view3d/SConscript',
'transform/SConscript',

Modified: branches/blender2.5/blender/source/blender/editors/include/ED_area.h
===
--- branches/blender2.5/blender/source/blender/editors/include/ED_area.h
2008-11-14 16:09:23 UTC (rev 17458)
+++ branches/blender2.5/blender/source/blender/editors/include/ED_area.h
2008-11-14 17:05:25 UTC (rev 17459)
@@ -32,6 +32,7 @@
 /* the pluginnable API for export to editors */
 
 /* calls for registering default spaces */
+void ED_spacetype_outliner(void);
 void ED_spacetype_time(void);
 void ED_spacetype_view3d(void);
 

Modified: 
branches/blender2.5/blender/source/blender/editors/interface/interface.c
===
--- branches/blender2.5/blender/source/blender/editors/interface/interface.c
2008-11-14 16:09:23 UTC (rev 17458)
+++ branches/blender2.5/blender/s

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17458] branches/etch-a-ton: Merging trunk 17342:17457

2008-11-14 Thread Martin Poirier
Revision: 17458
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17458
Author:   theeth
Date: 2008-11-14 17:09:23 +0100 (Fri, 14 Nov 2008)

Log Message:
---
Merging trunk 17342:17457

Modified Paths:
--
branches/etch-a-ton/SConstruct
branches/etch-a-ton/config/linuxcross-config.py
branches/etch-a-ton/config/win32-mingw-config.py
branches/etch-a-ton/config/win32-vc-config.py
branches/etch-a-ton/doc/blender-scons.txt
branches/etch-a-ton/intern/SoundSystem/intern/SND_Utils.cpp
branches/etch-a-ton/intern/elbeem/SConscript
branches/etch-a-ton/release/scripts/image_edit.py
branches/etch-a-ton/source/Makefile
branches/etch-a-ton/source/blender/blenkernel/BKE_bad_level_calls.h
branches/etch-a-ton/source/blender/blenkernel/BKE_node.h
branches/etch-a-ton/source/blender/blenkernel/SConscript
branches/etch-a-ton/source/blender/blenkernel/bad_level_call_stubs/stubs.c
branches/etch-a-ton/source/blender/blenkernel/intern/displist.c
branches/etch-a-ton/source/blender/blenkernel/intern/library.c
branches/etch-a-ton/source/blender/blenkernel/intern/material.c
branches/etch-a-ton/source/blender/blenkernel/intern/node.c
branches/etch-a-ton/source/blender/blenkernel/intern/texture.c
branches/etch-a-ton/source/blender/blenlib/BLI_blenlib.h
branches/etch-a-ton/source/blender/blenlib/BLI_linklist.h
branches/etch-a-ton/source/blender/blenlib/BLI_memarena.h
branches/etch-a-ton/source/blender/blenlib/SConscript
branches/etch-a-ton/source/blender/blenlib/intern/BLI_linklist.c
branches/etch-a-ton/source/blender/blenlib/intern/BLI_memarena.c
branches/etch-a-ton/source/blender/blenlib/intern/threads.c
branches/etch-a-ton/source/blender/blenloader/SConscript
branches/etch-a-ton/source/blender/blenloader/intern/readfile.c
branches/etch-a-ton/source/blender/blenloader/intern/writefile.c
branches/etch-a-ton/source/blender/imbuf/SConscript
branches/etch-a-ton/source/blender/imbuf/intern/imageprocess.c
branches/etch-a-ton/source/blender/include/BIF_editarmature.h
branches/etch-a-ton/source/blender/include/BSE_node.h
branches/etch-a-ton/source/blender/include/blendef.h
branches/etch-a-ton/source/blender/include/butspace.h
branches/etch-a-ton/source/blender/include/transform.h
branches/etch-a-ton/source/blender/makesdna/DNA_armature_types.h
branches/etch-a-ton/source/blender/makesdna/DNA_node_types.h
branches/etch-a-ton/source/blender/makesdna/DNA_object_types.h
branches/etch-a-ton/source/blender/makesdna/DNA_texture_types.h
branches/etch-a-ton/source/blender/makesdna/intern/SConscript
branches/etch-a-ton/source/blender/nodes/CMakeLists.txt
branches/etch-a-ton/source/blender/nodes/Makefile
branches/etch-a-ton/source/blender/nodes/SConscript
branches/etch-a-ton/source/blender/nodes/intern/SHD_nodes/SHD_texture.c
branches/etch-a-ton/source/blender/nodes/intern/SHD_util.c
branches/etch-a-ton/source/blender/python/BPY_interface.c
branches/etch-a-ton/source/blender/python/api2_2x/Draw.c
branches/etch-a-ton/source/blender/python/api2_2x/doc/Draw.py
branches/etch-a-ton/source/blender/render/SConscript
branches/etch-a-ton/source/blender/render/extern/include/RE_shader_ext.h
branches/etch-a-ton/source/blender/render/intern/include/pixelshading.h
branches/etch-a-ton/source/blender/render/intern/include/texture.h
branches/etch-a-ton/source/blender/render/intern/source/convertblender.c
branches/etch-a-ton/source/blender/render/intern/source/pixelshading.c
branches/etch-a-ton/source/blender/render/intern/source/rayshade.c
branches/etch-a-ton/source/blender/render/intern/source/rendercore.c
branches/etch-a-ton/source/blender/render/intern/source/texture.c
branches/etch-a-ton/source/blender/src/SConscript
branches/etch-a-ton/source/blender/src/butspace.c
branches/etch-a-ton/source/blender/src/buttons_editing.c
branches/etch-a-ton/source/blender/src/buttons_shading.c
branches/etch-a-ton/source/blender/src/drawnode.c
branches/etch-a-ton/source/blender/src/editnode.c
branches/etch-a-ton/source/blender/src/gpencil.c
branches/etch-a-ton/source/blender/src/header_node.c
branches/etch-a-ton/source/blender/src/headerbuttons.c
branches/etch-a-ton/source/blender/src/interface_draw.c
branches/etch-a-ton/source/blender/src/poselib.c
branches/etch-a-ton/source/blender/src/seqaudio.c
branches/etch-a-ton/source/blender/src/toolbox.c
branches/etch-a-ton/source/blender/src/transform.c
branches/etch-a-ton/source/blender/src/transform_conversions.c
branches/etch-a-ton/source/blender/src/transform_generics.c
branches/etch-a-ton/source/blender/src/transform_orientations.c
branches/etch-a-ton/source/creator/SConscript

branches/etch-a-ton/source/gameengine/BlenderRoutines/BL_KetsjiEmbedStart.cpp
branches/

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17457] branches/etch-a-ton/source/blender /src/editarmature_retarget.c: Reset max cost to FLT_MAX ( this fixes a bug with early culling)

2008-11-14 Thread Martin Poirier
Revision: 17457
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17457
Author:   theeth
Date: 2008-11-14 16:46:51 +0100 (Fri, 14 Nov 2008)

Log Message:
---
Reset max cost to FLT_MAX (this fixes a bug with early culling)

Optimization when number of buckets == number of joints

Modified Paths:
--
branches/etch-a-ton/source/blender/src/editarmature_retarget.c

Modified: branches/etch-a-ton/source/blender/src/editarmature_retarget.c
===
--- branches/etch-a-ton/source/blender/src/editarmature_retarget.c  
2008-11-14 14:34:19 UTC (rev 17456)
+++ branches/etch-a-ton/source/blender/src/editarmature_retarget.c  
2008-11-14 15:46:51 UTC (rev 17457)
@@ -1936,7 +1936,7 @@
 }
 #endif
 
-#define MAX_COST 100 /* FIX ME */
+#define MAX_COST FLT_MAX /* FIX ME */
 
 static float costDistance(ReebArcIterator *iter, float *vec0, float *vec1, int 
i0, int i1)
 {
@@ -2174,10 +2174,7 @@
ReebArc *earc = iarc->link_mesh;
float min_cost = FLT_MAX;
float *vec0, *vec1, *vec2;
-   float **vec_cache;
-   float *cost_cache;
int *best_positions;
-   int *positions;
int nb_edges = BLI_countlist(&iarc->edges);
int nb_joints = nb_edges - 1;
RetargetMethod method = METHOD_MEMOIZE;
@@ -2189,10 +2186,7 @@
return;
}
 
-   positions = MEM_callocN(sizeof(int) * nb_joints, "Aggresive positions");
-   best_positions = MEM_callocN(sizeof(int) * nb_joints, "Best Aggresive 
positions");
-   cost_cache = MEM_callocN(sizeof(float) * nb_edges, "Cost cache");
-   vec_cache = MEM_callocN(sizeof(float*) * (nb_edges + 1), "Vec cache");
+   best_positions = MEM_callocN(sizeof(int) * nb_joints, "Best positions");

if (testFlipArc(iarc, inode_start))
{
@@ -2204,23 +2198,18 @@
node_start = earc->head;
node_end = earc->tail;
}
-   
-   /* init with first values */
-   for (i = 0; i < nb_joints; i++)
+
+   /* equal number of joints and potential position, just fill them in */
+   if (nb_joints == earc->bcount)
{
-   positions[i] = i + 1;
-   //positions[i] = (earc->bcount / nb_edges) * (i + 1);
+   int i;
+   
+   /* init with first values */
+   for (i = 0; i < nb_joints; i++)
+   {
+   best_positions[i] = i + 1;
+   }
}
-   
-   /* init cost cache */
-   for (i = 0; i < nb_edges; i++)
-   {
-   cost_cache[i] = 0;
-   }
-   
-   vec_cache[0] = node_start->p;
-   vec_cache[nb_edges] = node_end->p;
-
if (method == METHOD_MEMOIZE)
{
int nb_positions = earc->bcount;
@@ -2252,10 +2241,32 @@
/* BRUTE FORCE */
else if (method == METHOD_BRUTE_FORCE)
{
+   float **vec_cache;
+   float *cost_cache;
+   int *positions;
int last_index = 0;
int first_pass = 1;
int must_move = nb_joints - 1;

+   positions = MEM_callocN(sizeof(int) * nb_joints, "Aggresive 
positions");
+   cost_cache = MEM_callocN(sizeof(float) * nb_edges, "Cost 
cache");
+   vec_cache = MEM_callocN(sizeof(float*) * (nb_edges + 1), "Vec 
cache");
+   
+   /* init with first values */
+   for (i = 0; i < nb_joints; i++)
+   {
+   positions[i] = i + 1;
+   }
+   
+   /* init cost cache */
+   for (i = 0; i < nb_edges; i++)
+   {
+   cost_cache[i] = 0;
+   }
+   
+   vec_cache[0] = node_start->p;
+   vec_cache[nb_edges] = node_end->p;  
+   
while(1)
{
float cost = 0;
@@ -2390,6 +2401,10 @@
memcpy(best_positions, positions, sizeof(int) * 
nb_joints);
}
}
+   
+   MEM_freeN(positions);
+   MEM_freeN(cost_cache);
+   MEM_freeN(vec_cache);
}
 
vec0 = node_start->p;
@@ -2427,11 +2442,8 @@

vec0 = vec1;
}
-   
-   MEM_freeN(positions);
+
MEM_freeN(best_positions);
-   MEM_freeN(cost_cache);
-   MEM_freeN(vec_cache);
 }
 
 static void retargetArctoArcLength(RigGraph *rigg, RigArc *iarc, RigNode 
*inode_start)


___
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 [17456] branches/blender2.5/blender/source /blender/makesrna:

2008-11-14 Thread Brecht Van Lommel
Revision: 17456
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17456
Author:   blendix
Date: 2008-11-14 15:34:19 +0100 (Fri, 14 Nov 2008)

Log Message:
---

RNA
* Added accessor functions for structs and properties instead of
  direct access, in preparation of wrapping ID properties.
* Added more error prints for wrong defines.
* Wrap RNA data structures with RNA.
* Disable dependency code for now to avoid confusion.

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
branches/blender2.5/blender/source/blender/makesrna/RNA_define.h
branches/blender2.5/blender/source/blender/makesrna/RNA_types.h
branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_access.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_define.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_dependency.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_internal.h
branches/blender2.5/blender/source/blender/makesrna/intern/rna_object.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c

Added Paths:
---
branches/blender2.5/blender/source/blender/makesrna/intern/rna_rna.c

Modified: branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
===
--- branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2008-11-14 11:15:53 UTC (rev 17455)
+++ branches/blender2.5/blender/source/blender/makesrna/RNA_access.h
2008-11-14 14:34:19 UTC (rev 17456)
@@ -25,12 +25,9 @@
 #ifndef RNA_ACCESS
 #define RNA_ACCESS
 
+#include "RNA_types.h"
+
 struct bContext;
-struct BlenderRNA;
-struct StructRNA;
-struct PropertyRNA;
-struct PointerRNA;
-struct CollectionPropertyIterator;
 struct Main;
 
 /* Pointer
@@ -38,54 +35,85 @@
  * Currently only an RNA pointer to Main can be obtained, this
  * should  be extended to allow making other pointers as well. */
 
-void RNA_pointer_main_get(struct Main *main, struct PointerRNA *r_ptr);
+void RNA_pointer_main_get(struct Main *main, PointerRNA *r_ptr);
 
-/* Property
+/* Structs */
+
+const char *RNA_struct_cname(PointerRNA *ptr);
+const char *RNA_struct_ui_name(PointerRNA *ptr);
+
+PropertyRNA *RNA_struct_name_property(PointerRNA *ptr);
+PropertyRNA *RNA_struct_iterator_property(PointerRNA *ptr);
+
+/* Properties
  *
  * Access to struct properties. All this works with RNA pointers rather than
  * direct pointers to the data. */
 
-int RNA_property_editable(struct PropertyRNA *prop, struct PointerRNA *ptr);
-int RNA_property_evaluated(struct PropertyRNA *prop, struct PointerRNA *ptr);
+/* Property Information */
 
-void RNA_property_notify(struct PropertyRNA *prop, struct bContext *C, struct 
PointerRNA *ptr);
+const char *RNA_property_cname(PropertyRNA *prop, PointerRNA *ptr);
+PropertyType RNA_property_type(PropertyRNA *prop, PointerRNA *ptr);
+PropertySubType RNA_property_subtype(PropertyRNA *prop, PointerRNA *ptr);
 
-int RNA_property_boolean_get(struct PropertyRNA *prop, struct PointerRNA *ptr);
-void RNA_property_boolean_set(struct PropertyRNA *prop, struct PointerRNA 
*ptr, int value);
-int RNA_property_boolean_get_array(struct PropertyRNA *prop, struct PointerRNA 
*ptr, int index);
-void RNA_property_boolean_set_array(struct PropertyRNA *prop, struct 
PointerRNA *ptr, int index, int value);
+int RNA_property_array_length(PropertyRNA *prop, PointerRNA *ptr);
 
-int RNA_property_int_get(struct PropertyRNA *prop, struct PointerRNA *ptr);
-void RNA_property_int_set(struct PropertyRNA *prop, struct PointerRNA *ptr, 
int value);
-int RNA_property_int_get_array(struct PropertyRNA *prop, struct PointerRNA 
*ptr, int index);
-void RNA_property_int_set_array(struct PropertyRNA *prop, struct PointerRNA 
*ptr, int index, int value);
+void RNA_property_int_range(PropertyRNA *prop, PointerRNA *ptr, int *hardmin, 
int *hardmax);
+void RNA_property_int_ui_range(PropertyRNA *prop, PointerRNA *ptr, int 
*softmin, int *softmax, int *step);
 
-float RNA_property_float_get(struct PropertyRNA *prop, struct PointerRNA *ptr);
-void RNA_property_float_set(struct PropertyRNA *prop, struct PointerRNA *ptr, 
float value);
-float RNA_property_float_get_array(struct PropertyRNA *prop, struct PointerRNA 
*ptr, int index);
-void RNA_property_float_set_array(struct PropertyRNA *prop, struct PointerRNA 
*ptr, int index, float value);
+void RNA_property_float_range(PropertyRNA *prop, PointerRNA *ptr, float 
*hardmin, float *hardmax);
+void RNA_property_float_ui_range(PropertyRNA *prop, PointerRNA *ptr, float 
*softmin, float *softmax, float *step, float *precision);
 
-void RNA_property_string_get(struct PropertyRNA *prop, struct PointerRNA *ptr, 
char *value);
-char *RNA_property_string_get_alloc(struct PropertyRNA *prop, struct 
PointerRNA *ptr, char *fixedbuf,

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [17455] branches/blender2.5/blender/source /blender/makesrna/intern:

2008-11-14 Thread Brecht Van Lommel
Revision: 17455
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=17455
Author:   blendix
Date: 2008-11-14 12:15:53 +0100 (Fri, 14 Nov 2008)

Log Message:
---

RNA Tweaks:
* Added an error for RNA enums without items.
* Added to scene layer set callback.

Modified Paths:
--
branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c   
2008-11-14 06:01:06 UTC (rev 17454)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/makesrna.c   
2008-11-14 11:15:53 UTC (rev 17455)
@@ -565,6 +565,10 @@
 
fprintf(f, "};\n\n");
}
+   else {
+   fprintf(stderr, "rna_generate_structs: 
%s.%s, enum must have items defined.\n", srna->cname, prop->cname);
+   DefRNA.error= 1;
+   }
break;
}
case PROP_BOOLEAN: {

Modified: branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c
===
--- branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c  
2008-11-14 06:01:06 UTC (rev 17454)
+++ branches/blender2.5/blender/source/blender/makesrna/intern/rna_scene.c  
2008-11-14 11:15:53 UTC (rev 17455)
@@ -41,6 +41,18 @@
return ((Base*)iter->internal)->object;
 }
 
+static void rna_Scene_layer_set(PointerRNA *ptr, int index, int value)
+{
+   Scene *scene= (Scene*)ptr->data;
+
+   if(value) scene->lay |= (1lay |= (1