[Bf-python] Making IK flag writable in the Bone class
Toni Alatalo
antont at kyperjokki.fi
Tue Oct 26 02:30:37 CEST 2004
On Mon, 25 Oct 2004, Gilbert, Joseph wrote:
just a few reactions:
> Throwing an error is prob a bit extreme. It should prob do nothing and
> send a console warning imo, but others might have a better idea.
Exception != Error, but RuntimeError might be extreme yes.
would a ValueError be applicable? if not a specialized NoParentException
or something like that.. ValueError does not quite fit but is close?
---from: http://www.python.org/doc/2.3.4/lib/module-exceptions.html ---
exception ValueError
Raised when a built-in operation or function receives an argument that
has the right type but an inappropriate value, and the situation is not
described by a more precise exception such as IndexError.
---end--
anyhow, according to http://c2.com/cgi/wiki?SamuraiPrinciple
some error/exception must be risen when the operation has not been
succesful (or how do you see that applying here?)
> it would be better to leave hasIK() alone and then put a deprecation
> warning in hasIK() and reroute it to getIK() if that's better.
> Yes Bone class must have an ik variable that calls the get/set
> functions.
also, with the (relatively newly introduced) so-called properties in
Python you don't need getters and setters (can wrap them to the properties
which are accessed like attributes - this could be also done in Python
without changing the underlying API that the C part exposes))
~Toni
More information about the Bf-python
mailing list