Revision: 29035
          
http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=29035
Author:   kjym3
Date:     2010-05-27 23:12:09 +0200 (Thu, 27 May 2010)

Log Message:
-----------
Fixed the __call__ method of UnaryFunction0DVectorViewShape and
UnaryFunction1DVectorViewShape.  The __call__ method now returns
a list whose elements are either a ViewShape or None.

Modified Paths:
--------------
    
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp
    
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp
===================================================================
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp
   2010-05-27 20:47:40 UTC (rev 29034)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction0D/BPy_UnaryFunction0DVectorViewShape.cpp
   2010-05-27 21:12:09 UTC (rev 29035)
@@ -99,10 +99,18 @@
                return NULL;
        }
        PyObject *list = PyList_New(0);
+       PyObject *item;
+       for( unsigned int i = 0; i < self->uf0D_vectorviewshape->result.size(); 
i++) {
+               ViewShape *v = self->uf0D_vectorviewshape->result[i];
+               if (v) {
+                       item = BPy_ViewShape_from_ViewShape(*v);
+               } else {
+                       item = Py_None;
+                       Py_INCREF(item);
+               }
+               PyList_Append(list, item);
+       }
        
-       for( unsigned int i = 0; i < self->uf0D_vectorviewshape->result.size(); 
i++)
-               PyList_Append(list, BPy_ViewShape_from_ViewShape(*( 
self->uf0D_vectorviewshape->result[i] )) );
-       
        return list;
 }
 

Modified: 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp
===================================================================
--- 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp
   2010-05-27 20:47:40 UTC (rev 29034)
+++ 
branches/soc-2008-mxcurioni/source/blender/freestyle/intern/python/UnaryFunction1D/BPy_UnaryFunction1DVectorViewShape.cpp
   2010-05-27 21:12:09 UTC (rev 29035)
@@ -129,10 +129,18 @@
                return NULL;
        }
        PyObject *list = PyList_New(0);
+       PyObject *item;
+       for( unsigned int i = 0; i < self->uf1D_vectorviewshape->result.size(); 
i++) {
+               ViewShape *v = self->uf1D_vectorviewshape->result[i];
+               if (v) {
+                       item = BPy_ViewShape_from_ViewShape(*v);
+               } else {
+                       item = Py_None;
+                       Py_INCREF(item);
+               }
+               PyList_Append(list, item);
+       }
        
-       for( unsigned int i = 0; i < self->uf1D_vectorviewshape->result.size(); 
i++)
-               PyList_Append(list, BPy_ViewShape_from_ViewShape(*( 
self->uf1D_vectorviewshape->result[i] )) );
-       
        return list;
 }
 


_______________________________________________
Bf-blender-cvs mailing list
[email protected]
http://lists.blender.org/mailman/listinfo/bf-blender-cvs

Reply via email to