[Bf-python] API : pass collection as parameter of python operator

Campbell Barton ideasman42 at gmail.com
Tue Mar 15 03:44:50 CET 2016


Afraid the only 'supported' way is to manually re-create the
collection and copy values.

eg:
http://www.pasteall.org/66371/python

Also, I needed to change the operator to use a CollectionProperty.

Note that you can workaround this by assigning underlying ID-properties,
but this isn't guaranteed to work in the future.

On Fri, Mar 11, 2016 at 9:14 AM, Julien Duroure
<julien.duroure at gmail.com> wrote:
> Hello,
>
> I am looking for a way to pass collection to a python defined operator.
> I tried this code [1], but get following error :
>
> AttributeError: bpy_struct: attribute "collection" from
> OBJECT_OT_example_op" is read-only
>
> Any ideas ?
>
> Julien
>
> [1] : http://www.pasteall.org/66193/python
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> http://lists.blender.org/mailman/listinfo/bf-python
>



-- 
- Campbell



More information about the Bf-python mailing list