[Bf-python] How to change a *VectorProperty size?

Goncalo Morgado goncalo.magno at gmail.com
Fri Sep 13 20:14:56 CEST 2019


I see.
What would be the right path to visualise the CollectionProperty items in a
panel? It is my understanding that adding a layout.prop() pointing to the
CollectionProperty will only show the number of items, but not the actual
values.

Thanks again,
Gonçalo




On Fri, Sep 13, 2019 at 1:03 PM Cambell Barton <ideasman42 at gmail.com> wrote:

> This isn't supported. The closest thing we have to this is a collection
> property, where you can define a collection of PropertyGroup items.
> These can be an arbitrary size.
>
> On 2019-09-13 23:37, Goncalo Morgado wrote:
> > Hello,
> >
> > Quick question on VectorProperty's:
> >
> > I've created a scene property named a:
> > bpy.types.Scene.a = bpy.props.IntVectorProperty(
> >      name='a',
> >      description="Frequencies",
> >      size=2,
> >      default=[1, 2]
> > )
> >
> > And now I would like to update it's size dynamically.
> > The idea is to have a panel showing an array of integers which length
> > and values the user would change.
> >
> > I can probably get away with deleting the property and creating a new
> > one with the same name, with the new size. If that's the only solution,
> > and since my IntVectorProperty actually belongs to a PropertyGroup, how
> > would I be able to delete the IntVectorProperty and create a new one
> > inside the PropertyGroup?
> >
> > I hope this makes sense, let me know if you find the question confusing.
> >
> > Thanks in advance,
> > Gonçalo
> >
> >
> >
> >
> >
> > _______________________________________________
> > Bf-python mailing list
> > Bf-python at blender.org
> > https://lists.blender.org/mailman/listinfo/bf-python
> >
> _______________________________________________
> Bf-python mailing list
> Bf-python at blender.org
> https://lists.blender.org/mailman/listinfo/bf-python
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20190913/a75be035/attachment.htm>


More information about the Bf-python mailing list