[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [60200] trunk/blender/source/blender/ python/intern/bpy_rna.c: Update foreach_get/_set doc.

Bastien Montagne montagne29 at wanadoo.fr
Tue Sep 17 16:02:14 CEST 2013


Revision: 60200
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=60200
Author:   mont29
Date:     2013-09-17 14:02:13 +0000 (Tue, 17 Sep 2013)
Log Message:
-----------
Update foreach_get/_set doc.

Modified Paths:
--------------
    trunk/blender/source/blender/python/intern/bpy_rna.c

Modified: trunk/blender/source/blender/python/intern/bpy_rna.c
===================================================================
--- trunk/blender/source/blender/python/intern/bpy_rna.c	2013-09-17 13:50:25 UTC (rev 60199)
+++ trunk/blender/source/blender/python/intern/bpy_rna.c	2013-09-17 14:02:13 UTC (rev 60200)
@@ -4601,12 +4601,15 @@
 "\n"
 "   This is a function to give fast access to attributes within a collection.\n"
 "\n"
+"   Only works for 'basic type' properties (bool, int and float)!\n"
+"   Multi-dimensional arrays (like array of vectors) will be flattened into seq.\n"
+"\n"
 "   .. code-block:: python\n"
 "\n"
 "      collection.foreach_get(attr, someseq)\n"
 "\n"
 "      # Python equivalent\n"
-"      for i in range(len(seq)): someseq[i] = getattr(collection, attr)\n"
+"      for i in range(len(seq)): someseq[i] = getattr(collection[i], attr)\n"
 "\n"
 );
 static PyObject *pyrna_prop_collection_foreach_get(BPy_PropertyRNA *self, PyObject *args)
@@ -4621,6 +4624,9 @@
 "\n"
 "   This is a function to give fast access to attributes within a collection.\n"
 "\n"
+"   Only works for 'basic type' properties (bool, int and float)!\n"
+"   seq must be uni-dimensional, multi-dimensional arrays (like array of vectors) will be re-created from it.\n"
+"\n"
 "   .. code-block:: python\n"
 "\n"
 "      collection.foreach_set(attr, seq)\n"




More information about the Bf-blender-cvs mailing list