[Bf-python] CurNurb/IpoCurve/BezTriple hackery
Joseph Gilbert
jgilbert at TIGR.org
Fri Jun 17 20:30:31 CEST 2005
Yea similar prob with vector. Your getting a py_list that is not a
wrapper. You modify the underlying data - then the py_list goes out of date.
I'll leave implementation to people who know this better (stivs,
willian, you, etc.) but It seems that the way to resolve this - is to
wrap this data when its returned.instead of just a py_list returned. One
possible way of doing this would be to have IpoCurve store a py_list[]
and periodically update it with pointers to bez_triples when neccessary
and only return a pointer to this list to the user. (might work ;o)
Ken Hughes wrote:
> I'm playing with the refactoring of CurNurbs and Ipocurves in the
> BPython interface and want other opinions:
>
> Is it valid to expect this code sequence to not work? (this is in
> the current CVS)
>
> c = Blender.Ipo.Get('ObIpo').Get('LocX')
> p = c.getPoints()[0]
> (x0,y0) = p.getPoints()
> c.addBezier([x,y])
> (x1,y1) = p.getPoints()
>
> By "not work", I mean that p (which wraps a BezTriple) is
> implemented by keeping a pointer to inside the beztriple
> array of Ipocurve c, but is probably no longer valid after
> addBezier() is called since it deletes the old list and
> replaces it with a new list?
>
> In other words, should I be fixing this in any future rewrite
> or just document the behavior?
>
> Ken
>
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python
More information about the Bf-python
mailing list