[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15497] branches/soc-2008-mxcurioni/source /blender/freestyle/intern/python: soc-mx-2008: SWIG dependency - wrapper functions extracted from ModuleWra

2008-07-09 Thread Maxime Curioni
Revision: 15497
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15497
Author:   mxcurioni
Date: 2008-07-09 10:24:13 +0200 (Wed, 09 Jul 2008)

Log Message:
---
soc-mx-2008: SWIG dependency - wrapper functions extracted from 
ModuleWrapper.cpp

Modified Paths:
--

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate0D.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/FalseBP1D.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/Length2DBP1D.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/SameShapeIdBP1D.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/TrueBP1D.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D/ViewMapGradientNormBP1D.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/BinaryPredicate1D.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/CurvePointIterator.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Id.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint/StrokeVertex.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/CurvePoint.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/SVertex.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/ViewVertex/NonTVertex.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/ViewVertex/TVertex.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D/ViewVertex.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0D.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface0DIterator.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/Curve.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/FEdge/FEdgeSharp.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/FEdge/FEdgeSmooth.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/FEdge.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/Stroke.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D/ViewEdge.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Interface1D.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Material.cpp
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Noise.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/Operators.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/SShape.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeAttribute.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/BackboneStretcherShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/BezierCurveShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/CalligraphicShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/ColorNoiseShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/ColorVariationPatternShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/ConstantColorShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/ConstantThicknessShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/ConstrainedIncreasingThicknessShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/GuidingLinesShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/IncreasingColorShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/IncreasingThicknessShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/PolygonalizationShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/SamplingShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/SpatialNoiseShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/StrokeTextureShader.cpp

branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/StrokeShader/TextureAssignerShader.cpp


[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15499] trunk/blender/source/blender/nodes /intern/CMP_nodes/CMP_gamma.c:

2008-07-09 Thread Brecht Van Lommel
Revision: 15499
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15499
Author:   blendix
Date: 2008-07-09 12:13:09 +0200 (Wed, 09 Jul 2008)

Log Message:
---

Fix for bugfix #12075: gamma node check for nan was always
checking red channel.

Modified Paths:
--
trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c

Modified: trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c
===
--- trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c 
2008-07-09 09:21:52 UTC (rev 15498)
+++ trunk/blender/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c 
2008-07-09 10:13:09 UTC (rev 15499)
@@ -47,7 +47,7 @@
int i=0;
for(i=0; i3; i++) {
/* check for negative to avoid nan's */
-   out[i] = (in[0]  0.0f)? pow(in[i],fac[0]): in[0];
+   out[i] = (in[i]  0.0f)? pow(in[i],fac[0]): in[i];
}
out[3] = in[3];
 }


___
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 [15500] trunk/blender/source/blender/imbuf /intern/openexr/openexr_api.cpp: Fix for reported openexr file reading failures.

2008-07-09 Thread Ton Roosendaal
Revision: 15500
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15500
Author:   ton
Date: 2008-07-09 12:51:03 +0200 (Wed, 09 Jul 2008)

Log Message:
---
Fix for reported openexr file reading failures.

For simple RGB(A) files, the channel names in openexr were supposed
to be simply R G B and A too.
Other programs like other names... like lower case, or like ambient.r

Tested with file from renderman.

Modified Paths:
--
trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp

Modified: trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp
===
--- trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp   
2008-07-09 10:13:09 UTC (rev 15499)
+++ trunk/blender/source/blender/imbuf/intern/openexr/openexr_api.cpp   
2008-07-09 10:51:03 UTC (rev 15500)
@@ -842,7 +842,7 @@
 } RGBA;
 
 
-#if 0
+/* debug only */
 static void exr_print_filecontents(InputFile *file)
 {
const ChannelList channels = file-header().channels();
@@ -853,8 +853,29 @@
printf(OpenEXR-load: Found channel %s of type %d\n, i.name(), 
channel.type);
}
 }
-#endif
 
+/* for non-multilayer, map  R G B A channel names to something that's in this 
file */
+static const char *exr_rgba_channelname(InputFile *file, const char *chan)
+{
+   const ChannelList channels = file-header().channels();
+   
+   for (ChannelList::ConstIterator i = channels.begin(); i != 
channels.end(); ++i)
+   {
+   const Channel channel = i.channel();
+   const char *str= i.name();
+   int len= strlen(str);
+   if(len) {
+   if(strcasecmp(chan, str+len-1)==0) {
+   printf(name %s\n, str);
+   return str;
+   }
+   }
+   }
+   return chan;
+}
+
+
+
 static int exr_has_zbuffer(InputFile *file)
 {
const ChannelList channels = file-header().channels();
@@ -896,7 +917,8 @@
//printf(OpenEXR-load: image data window %d %d %d %d\n, 
// dw.min.x, dw.min.y, dw.max.x, dw.max.y);
 
-   // exr_print_filecontents(file);
+   if(0) // debug
+   exr_print_filecontents(file);

is_multi= exr_is_renderresult(file);

@@ -935,11 +957,15 @@
/* but, since we read y-flipped 
(negative y stride) we move to last scanline */
first+= 4*(height-1)*width;

-   frameBuffer.insert (R, Slice (FLOAT,  
(char *) first, xstride, ystride));
-   frameBuffer.insert (G, Slice (FLOAT,  
(char *) (first+1), xstride, ystride));
-   frameBuffer.insert (B, Slice (FLOAT,  
(char *) (first+2), xstride, ystride));
-   
/* 1.0 
is fill value */
-   frameBuffer.insert (A, Slice (FLOAT,  
(char *) (first+3), xstride, ystride, 1, 1, 1.0f));
+   frameBuffer.insert ( 
exr_rgba_channelname(file, R), 
+   
Slice (FLOAT,  (char *) first, xstride, ystride));
+   frameBuffer.insert ( 
exr_rgba_channelname(file, G), 
+   
Slice (FLOAT,  (char *) (first+1), xstride, ystride));
+   frameBuffer.insert ( 
exr_rgba_channelname(file, B), 
+   
Slice (FLOAT,  (char *) (first+2), xstride, ystride));
+   

+   frameBuffer.insert ( 
exr_rgba_channelname(file, A), 
+   
Slice (FLOAT,  (char *) (first+3), xstride, ystride, 1, 1, 1.0f)); /* 1.0 is 
fill value */
 
if(exr_has_zbuffer(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 [15504] trunk/blender/source/gameengine/ Ketsji/KX_GameObject.cpp: bugfix, vector was not checked for zero length before normalizing, closing blender

2008-07-09 Thread Campbell Barton
Revision: 15504
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15504
Author:   campbellbarton
Date: 2008-07-09 17:30:15 +0200 (Wed, 09 Jul 2008)

Log Message:
---
bugfix, vector was not checked for zero length before normalizing, closing 
blender instantly with an assert.

Modified Paths:
--
trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp

Modified: trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp
===
--- trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp2008-07-09 
15:25:34 UTC (rev 15503)
+++ trunk/blender/source/gameengine/Ketsji/KX_GameObject.cpp2008-07-09 
15:30:15 UTC (rev 15504)
@@ -1608,14 +1608,18 @@
other = static_castKX_GameObject*(pyfrom);
fromPoint = other-NodeGetWorldPosition();
}
-
-   if (dist != 0.0f)
-   {
+   
+   if (dist != 0.0f) {
MT_Vector3 toDir = toPoint-fromPoint;
+   if (MT_fuzzyZero(toDir.length2())) {
+   return Py_BuildValue(OOO, Py_None, Py_None, Py_None);
+   }
toDir.normalize();
toPoint = fromPoint + (dist) * toDir;
+   } else if (MT_fuzzyZero((toPoint-fromPoint).length2())) {
+   return Py_BuildValue(OOO, Py_None, Py_None, Py_None);
}
-
+   
MT_Point3 resultPoint;
MT_Vector3 resultNormal;
PHY_IPhysicsEnvironment* pe = GetPhysicsEnvironment();


___
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 [15506] branches/harmonic-skeleton/source/ blender/src/reeb.c: Fix external arc merging bug ( could mess up node degrees)

2008-07-09 Thread Martin Poirier
Revision: 15506
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15506
Author:   theeth
Date: 2008-07-09 20:36:35 +0200 (Wed, 09 Jul 2008)

Log Message:
---
Fix external arc merging bug (could mess up node degrees)

Modified Paths:
--
branches/harmonic-skeleton/source/blender/src/reeb.c

Modified: branches/harmonic-skeleton/source/blender/src/reeb.c
===
--- branches/harmonic-skeleton/source/blender/src/reeb.c2008-07-09 
15:54:53 UTC (rev 15505)
+++ branches/harmonic-skeleton/source/blender/src/reeb.c2008-07-09 
18:36:35 UTC (rev 15506)
@@ -340,26 +340,32 @@
}
 }
 
+#ifdef DEBUG_REEB_NODE
 void NodeDegreeDecrement(ReebGraph *rg, ReebNode *node)
 {
node-degree--;
 
-// if (node-degree == 0)
-// {
-// printf(would remove node %i\n, node-index);
-// }
+   if (node-degree == 0)
+   {
+   printf(would remove node %i\n, node-index);
+   }
 }
 
 void NodeDegreeIncrement(ReebGraph *rg, ReebNode *node)
 {
-// if (node-degree == 0)
-// {
-// printf(first connect node %i\n, node-index);
-// }
+   if (node-degree == 0)
+   {
+   printf(first connect node %i\n, node-index);
+   }
 
node-degree++;
 }
 
+#else
+#define NodeDegreeDecrement(rg, node) {node-degree--;}
+#define NodeDegreeIncrement(rg, node) {node-degree++;}
+#endif
+
 void repositionNodes(ReebGraph *rg)
 {
BArc *arc = NULL;
@@ -992,8 +998,8 @@
{
if (arc-head == srcArc-head  arc-tail == 
srcArc-tail  arc != srcArc)
{
-   ReebNode *head = (ReebNode*)srcArc-head;
-   ReebNode *tail = (ReebNode*)srcArc-tail;
+   ReebNode *head = srcArc-head;
+   ReebNode *tail = srcArc-tail;
mergeArcBuckets(srcArc, arc, head-weight, 
tail-weight);
}
}
@@ -1021,7 +1027,6 @@
{
// v1 or v2 was already newNode, since we're 
removing an arc, decrement degree
NodeDegreeDecrement(rg, newNode);
-   //newNode-degree--;

// If it's srcArc, it'll be removed later, so 
keep it for now
if (arc != srcArc)
@@ -1032,7 +1037,7 @@
}
else
{
-   /* flip arcs that flipped can happen on diamond 
shapes, mostly on null arcs */
+   /* flip arcs that flipped, can happen on 
diamond shapes, mostly on null arcs */
if (arc-head-weight  arc-tail-weight)
{
ReebNode *tmp;
@@ -1048,12 +1053,15 @@
 
if (merging)
{
-   ReebNode *head = (ReebNode*)arc-head;
-   ReebNode *tail = (ReebNode*)arc-tail;
+   ReebNode *head = arc-head;
+   ReebNode *tail = arc-tail;
 
// resize bucket list
resizeArcBuckets(arc);
mergeArcBuckets(arc, srcArc, 
head-weight, tail-weight);
+   
+   /* update length */
+   arc-length += srcArc-length;
}
}
}
@@ -1167,9 +1175,7 @@
{
ReebNode *terminalNode = NULL;
ReebNode *middleNode = NULL;
-   ReebNode *newNode = NULL;
ReebNode *removedNode = NULL;
-   int merging = 0;

// Assign terminal and middle nodes
if (arc-head-degree == 1)
@@ -1186,29 +1192,17 @@
// If middle node is a normal node, it will be removed 
later
if (middleNode-degree == 2)
{
-// continue;
-   merging = 1;
-   newNode = terminalNode;
removedNode = middleNode;
+
+   filterArc(rg, terminalNode, removedNode, arc, 
1);
}
// Otherwise, just plain remove of the arc
else
{

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15508] trunk/blender/source/blender/ radiosity/intern/source/radrender.c: [#17298] surface normal direction compensation for objects with negative sc

2008-07-09 Thread Campbell Barton
Revision: 15508
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15508
Author:   campbellbarton
Date: 2008-07-09 21:15:26 +0200 (Wed, 09 Jul 2008)

Log Message:
---
[#17298] surface normal direction compensation for objects with negative scale 
in rendering with radiosity
from Roelf De Kock (kiemdoder) 

Fixes bug [#7969] Mirroring Object Breaks Radiosity Calculations

- copied from the tracker.
The code in this patch detects whether an object has negative scale (test the 
OB_NEG_SCALE bit in Object.transflag)
and then compensate for the negative scale when the surface normals are 
calculated for a radiosity render.

Modified Paths:
--
trunk/blender/source/blender/radiosity/intern/source/radrender.c

Modified: trunk/blender/source/blender/radiosity/intern/source/radrender.c
===
--- trunk/blender/source/blender/radiosity/intern/source/radrender.c
2008-07-09 19:15:15 UTC (rev 15507)
+++ trunk/blender/source/blender/radiosity/intern/source/radrender.c
2008-07-09 19:15:26 UTC (rev 15508)
@@ -369,9 +369,18 @@
if(vlr-mat-mode  MA_RADIO) {

/* during render, vlr-n gets 
flipped/corrected, we cannot have that */
-   if(vlr-v4) CalcNormFloat4(vlr-v1-co, 
vlr-v2-co, vlr-v3-co, vlr-v4-co, rf-norm);
-   else CalcNormFloat(vlr-v1-co, vlr-v2-co, 
vlr-v3-co, rf-norm);
-   
+   if (obr-ob-transflag  OB_NEG_SCALE){
+   /* The object has negative scale that 
will cause the normals to flip.
+To counter this unwanted 
normal flip, swap vertex 2 and 4 for a quad
+or vertex 2 and 3 (see 
flip_face) for a triangle in the call to CalcNormFloat4 
+in order to flip the normals 
back to the way they were in the original mesh. */
+   if(vlr-v4) CalcNormFloat4(vlr-v1-co, 
vlr-v4-co, vlr-v3-co, vlr-v2-co, rf-norm);
+   else CalcNormFloat(vlr-v1-co, 
vlr-v3-co, vlr-v2-co, rf-norm);
+   }else{
+   if(vlr-v4) CalcNormFloat4(vlr-v1-co, 
vlr-v2-co, vlr-v3-co, vlr-v4-co, rf-norm);
+   else CalcNormFloat(vlr-v1-co, 
vlr-v2-co, vlr-v3-co, rf-norm);
+   }
+
rf-totrad[0]= vlr-mat-emit*vlr-mat-r;
rf-totrad[1]= vlr-mat-emit*vlr-mat-g;
rf-totrad[2]= vlr-mat-emit*vlr-mat-b;


___
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 [15512] branches/blender-2.47: branches/ blender-2.47

2008-07-09 Thread Diego Borghetti
Revision: 15512
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15512
Author:   bdiego
Date: 2008-07-09 23:32:25 +0200 (Wed, 09 Jul 2008)

Log Message:
---
branches/blender-2.47

Merge from trunk:
Revision: 15460
Revision: 15461
Revision: 15462
Revision: 15480
Revision: 15485
Revision: 15488
Revision: 15490
Revision: 15494
Revision: 15550
Revision: 15502
Revision: 15503
Revision: 15505
Revision: 15508

Modified Paths:
--
branches/blender-2.47/intern/ghost/intern/GHOST_SystemWin32.cpp
branches/blender-2.47/source/blender/blenkernel/intern/DerivedMesh.c
branches/blender-2.47/source/blender/blenkernel/intern/library.c
branches/blender-2.47/source/blender/blenkernel/intern/modifier.c
branches/blender-2.47/source/blender/blenkernel/intern/particle.c
branches/blender-2.47/source/blender/blenkernel/intern/particle_system.c
branches/blender-2.47/source/blender/imbuf/intern/openexr/openexr_api.cpp
branches/blender-2.47/source/blender/nodes/intern/CMP_nodes/CMP_gamma.c
branches/blender-2.47/source/blender/radiosity/intern/source/radrender.c
branches/blender-2.47/source/blender/src/buttons_object.c
branches/blender-2.47/source/blender/src/editmesh_add.c
branches/blender-2.47/source/blender/src/edittime.c
branches/blender-2.47/source/gameengine/Expressions/PyObjectPlus.h
branches/blender-2.47/source/gameengine/Ketsji/KX_TouchEventManager.cpp

Modified: branches/blender-2.47/intern/ghost/intern/GHOST_SystemWin32.cpp
===
--- branches/blender-2.47/intern/ghost/intern/GHOST_SystemWin32.cpp 
2008-07-09 21:07:02 UTC (rev 15511)
+++ branches/blender-2.47/intern/ghost/intern/GHOST_SystemWin32.cpp 
2008-07-09 21:32:25 UTC (rev 15512)
@@ -302,6 +302,15 @@
 {
GHOST_TSuccess success = GHOST_System::init();
 
+   /* Disable scaling on high DPI displays on Vista */
+   HMODULE user32 = ::LoadLibraryA(user32.dll);
+   typedef BOOL (WINAPI * LPFNSETPROCESSDPIAWARE)();
+   LPFNSETPROCESSDPIAWARE SetProcessDPIAware =
+   (LPFNSETPROCESSDPIAWARE)GetProcAddress(user32, 
SetProcessDPIAware);
+   if (SetProcessDPIAware)
+   SetProcessDPIAware();
+   FreeLibrary(user32);
+
// Determine whether this system has a high frequency performance 
counter. */
m_hasPerformanceCounter = 
::QueryPerformanceFrequency((LARGE_INTEGER*)m_freq) == TRUE;
if (m_hasPerformanceCounter) {

Modified: branches/blender-2.47/source/blender/blenkernel/intern/DerivedMesh.c
===
--- branches/blender-2.47/source/blender/blenkernel/intern/DerivedMesh.c
2008-07-09 21:07:02 UTC (rev 15511)
+++ branches/blender-2.47/source/blender/blenkernel/intern/DerivedMesh.c
2008-07-09 21:32:25 UTC (rev 15512)
@@ -1052,7 +1052,7 @@
 
/* store vertex indices in tmp union */
for(ev = em-verts.first, i = 0; ev; ev = ev-next, ++i)
-   ev-tmp.l = (long) i++;
+   ev-tmp.l = (long) i;
 
for( ; ee; ee = ee-next, ++edge_r) {
edge_r-crease = (unsigned char) (ee-crease*255.0f);

Modified: branches/blender-2.47/source/blender/blenkernel/intern/library.c
===
--- branches/blender-2.47/source/blender/blenkernel/intern/library.c
2008-07-09 21:07:02 UTC (rev 15511)
+++ branches/blender-2.47/source/blender/blenkernel/intern/library.c
2008-07-09 21:32:25 UTC (rev 15512)
@@ -224,48 +224,50 @@
 /* note: MAX_LIBARRAY define should match this code */
 int set_listbasepointers(Main *main, ListBase **lb)
 {
+   int a = 0;
+
/* BACKWARDS! also watch order of free-ing! (mesh-mat) */
 
-   lb[0]= (main-ipo);
-   lb[1]= (main-key);
-   lb[2]= (main-image);
-   lb[3]= (main-tex);
-   lb[4]= (main-mat);
-   lb[5]= (main-vfont);
+   lb[a++]= (main-ipo);
+   lb[a++]= (main-key);
+   lb[a++]= (main-nodetree);
+   lb[a++]= (main-image);
+   lb[a++]= (main-tex);
+   lb[a++]= (main-mat);
+   lb[a++]= (main-vfont);

/* Important!: When adding a new object type,
 * the specific data should be inserted here 
 */
 
-   lb[6]= (main-armature);
-   lb[7]= (main-action);
+   lb[a++]= (main-armature);
+   lb[a++]= (main-action);
 
-   lb[8]= (main-mesh);
-   lb[9]= (main-curve);
-   lb[10]= (main-mball);
+   lb[a++]= (main-mesh);
+   lb[a++]= (main-curve);
+   lb[a++]= (main-mball);
 
-   lb[11]= (main-wave);
-   lb[12]= (main-latt);
-   lb[13]= (main-lamp);
-   lb[14]= (main-camera);
+   lb[a++]= (main-wave);
+   lb[a++]= (main-latt);
+   lb[a++]= (main-lamp);
+   lb[a++]= 

[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [15514] trunk/blender/source/blender/src/ editnla.c: Apricot Request:

2008-07-09 Thread Joshua Leung
Revision: 15514
  
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=revroot=bf-blenderrevision=15514
Author:   aligorith
Date: 2008-07-10 02:15:57 +0200 (Thu, 10 Jul 2008)

Log Message:
---
Apricot Request:

When changing the active action in the NLA editor with NLA-override off, 
armatures now have their restpose applied before the new action is evaluated. 

I've commented the code here to make it clearer what is going on.

Modified Paths:
--
trunk/blender/source/blender/src/editnla.c

Modified: trunk/blender/source/blender/src/editnla.c
===
--- trunk/blender/source/blender/src/editnla.c  2008-07-10 00:09:43 UTC (rev 
15513)
+++ trunk/blender/source/blender/src/editnla.c  2008-07-10 00:15:57 UTC (rev 
15514)
@@ -501,26 +501,47 @@
 {
bActionStrip *strip;

+   /* make sure all other strips are not active */
for (strip = ob-nlastrips.first; strip; strip=strip-next)
strip-flag = ~ACTSTRIP_ACTIVE;

-   if(act) {
+   /* act is new active strip */
+   if (act) {
+   /* set active flag for this strip */
act-flag |= ACTSTRIP_ACTIVE;
-   
-   if(ob-action!=act-act) {
-   if(ob-action) ob-action-id.us--;
-   if(act-act-id.lib) {
+   
+   /* check if active action will still be the same one */
+   if (ob-action != act-act) {
+   /* clear object's links with its current action (if 
present) */
+   if (ob-action) {
+   ob-action-id.us--;
+   }
+   
+   /* only set object's action to active strip's action if 
possible */
+   if (act-act-id.lib) {
ob-action= NULL;
}
else {
ob-action= act-act;
id_us_plus(ob-action-id);
-   }   
+   }   
+   
+   /* request redrawing in relevant spaces */
allqueue(REDRAWIPO, 0);
allqueue(REDRAWVIEW3D, 0);
allqueue(REDRAWACTION, 0);
allqueue(REDRAWNLA, 0);
-   ob-ctime= -1234567.0f; // eveil! 
+   
+   /* when only showing action (i.e. nla-override off), 
+* reset pose to restpose for armatures 
+*/
+   if ((ob-nlaflag  OB_NLA_OVERRIDE)==0) {
+   if (ob-type == OB_ARMATURE)
+   rest_pose(ob-pose);
+   }
+   
+   /* flush depsgraph */
+   ob-ctime= -1234567.0f; // evil! 
DAG_object_flush_update(G.scene, ob, 
OB_RECALC_OB|OB_RECALC_DATA);
}
}   


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