[Bf-python] delCurve()

Johnny Matthews johnny.matthews at gmail.com
Mon Oct 31 02:41:25 CET 2005


no, they call me Bruce!

On 10/30/05, Ken Hughes <khughes at pacific.edu> wrote:
>
> Johnny Matthews wrote:
> > I have this function
> >
> >
> > def verifyIpocurve(ky,index):
> > ipo = ky.getIpo()
> > idx = "Key " + str(index)
> > crv = ipo.getCurve(idx)
> > if crv != None:
> > ipo.delCurve(idx)
> > crv = ipo.addCurve(idx)
> > crv.setInterpolation ("Linear")
> > return crv
> > where ky is a Mesh.getKey() object and index is a shape key index
> >
> > The first time I run this on an object all goes well, but the 2nd time
> > on the same key and index gives "ValueError: Ipo curve already exists"
> > But if the curve already exists, it is supposed to delete it
> > first....any ideas?
>
> Talked this over on IRC, but the bottom like is Key IPOs don't behave
> like other IPOs. They currently all return "Key" as their name, so you
> can't use getCurve() or delCurve() and have it do what you expect.
>
> Seems like the only way to handle is to pass an integer adrcode to it,
> since that's maybe the only way to uniquely identify the curve (BTW,
> Shape Keys can be named anything, so you *could* name them all "Key" or
> "Bruce" if you wanted to).
>
> Ken
> _______________________________________________
> Bf-python mailing list
> Bf-python at projects.blender.org
> http://projects.blender.org/mailman/listinfo/bf-python
>



--
Johnny Matthews
johnny.matthews at gmail.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.blender.org/pipermail/bf-python/attachments/20051030/f3942614/attachment.html>


More information about the Bf-python mailing list