Ok here's a patch for an idproperty array type. I've not actually tested it; tell me what you think.<div><br></div><div>Joe<br><br><div class="gmail_quote">On Sat, Dec 27, 2008 at 11:54 PM, joe <span dir="ltr"><<a href="mailto:joeedh@gmail.com">joeedh@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">The group type was originally envisioned as a map. What we need here, it sounds like, is a version of a group that acts as an array. A new type that would do arrays of id properties. The existing array type would than simply be "numerical arrays."<div>
<br></div><div>Anyway, I'll try and prototype some code. It shouldn't be too hard to add a new type that implements an array of ID properties.</div><div><br></div><div><font color="#888888">Joe</font><div><div></div>
<div class="Wj3C7c"><br><br><div class="gmail_quote">On Sat, Dec 27, 2008 at 11:17 PM, Brecht Van Lommel <span dir="ltr"><<a href="mailto:brecht@blender.org" target="_blank">brecht@blender.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><br>
Hi,<br>
<div><br>
joe wrote:<br>
> Could you explain what you need it for? So I can see where it fits into<br>
> the big picture :) It just seems a little klunky to me, having a<br>
> collection of id properties collections.<br>
<br>
</div>I need it to implement an RNA collection of structs. This how I see<br>
the correspondences:<br>
<br>
ID property group ~ C struct ~ RNA struct<br>
ID property ~ C struct member ~ RNA property<br>
ID array property ~ C array or list ~ RNA collection property<br>
<br>
Now, I guess your interpretation of an ID property group is that it is<br>
both a struct and a collection. I could try to implement RNA<br>
collections as ID property groups, but it's a bit messy given that I<br>
would have to work with string keys which I do not have and would need<br>
to create with sprintf("%d", index) or so.<br>
<br>
Brecht.<br>
<div><br>
> On Sat, Dec 27, 2008 at 12:49 AM, Brecht Van Lommel <<a href="mailto:brecht@blender.org" target="_blank">brecht@blender.org</a><br>
</div><div>> <mailto:<a href="mailto:brecht@blender.org" target="_blank">brecht@blender.org</a>>> wrote:<br>
><br>
> Hi,<br>
><br>
> joe wrote:<br>
> > What's the design rationale of supporting arrays of group properties?<br>
> > Seems supporting arrays of id properties in general would be a<br>
> cleaner<br>
> > solution, if it's needed. . .<br>
><br>
> Can you explain the difference to me? The array before supported<br>
> subtypes IDP_INT, ID_FLOAT and IDP_DOUBLE. The logical extension<br>
> seemed to me to just add IDP_GROUP. Isn't the end result basically the<br>
> same?<br>
><br>
> Well, it could be interesting to support mixed id property types in a<br>
> single array, but that is not how the array was implemented here.<br>
> Doing it that way would have been inconsistent with the way IDP_INT,<br>
> IDP_FLOAT and IDP_DOUBLE already work.<br>
><br>
> Brecht.<br>
> _______________________________________________<br>
> Bf-committers mailing list<br>
</div>> <a href="mailto:Bf-committers@blender.org" target="_blank">Bf-committers@blender.org</a> <mailto:<a href="mailto:Bf-committers@blender.org" target="_blank">Bf-committers@blender.org</a>><br>
<div>> <a href="http://lists.blender.org/mailman/listinfo/bf-committers" target="_blank">http://lists.blender.org/mailman/listinfo/bf-committers</a><br>
><br>
><br>
><br>
</div>> ------------------------------------------------------------------------<br>
<div><div></div><div>><br>
> _______________________________________________<br>
> Bf-committers mailing list<br>
> <a href="mailto:Bf-committers@blender.org" target="_blank">Bf-committers@blender.org</a><br>
> <a href="http://lists.blender.org/mailman/listinfo/bf-committers" target="_blank">http://lists.blender.org/mailman/listinfo/bf-committers</a><br>
<br>
_______________________________________________<br>
Bf-committers mailing list<br>
<a href="mailto:Bf-committers@blender.org" target="_blank">Bf-committers@blender.org</a><br>
<a href="http://lists.blender.org/mailman/listinfo/bf-committers" target="_blank">http://lists.blender.org/mailman/listinfo/bf-committers</a><br>
</div></div></blockquote></div><br></div></div></div>
</blockquote></div><br></div>