[Bf-python] Making IK flag writable in the Bone class

Gilbert, Joseph jgilbert at tigr.org
Fri Oct 22 21:47:28 CEST 2004


The original idea was to have setIK() but this didn't work out so it was
changed to hasIK().  The bone flags are a very dirty mess - ik being one
of the only flags that is relevant (the reason for no getFlags()). But I
think that if you can get this to work well Jonas a get/setIK() method
would look nice.  For some reason I thought that this was a more complex
issue but maybe the answers are simple :) I would suggest that you test
the function well especially in relation to child bone's and their
return data (loc, rot, mat) to see if it is doing well compared to the
ik switch in the UI panel. 

-----Original Message-----
From: bf-python-bounces at projects.blender.org
[mailto:bf-python-bounces at projects.blender.org] On Behalf Of Stephen
Swaney
Sent: Friday, October 22, 2004 2:57 PM
To: Blender Foundation Python list
Subject: Re: [Bf-python] Making IK flag writable in the Bone class

Jonas Petersen wrote:
> 
> Stephen Swaney schrieb:
> > 
> > From an API point of view,  I really, REALLY dislike the idea
> >of overloading a query function to set and unset a flag.
> >
> >
> >
> Me too :)
> 
> But it's done like this in other places as well. So I thought it would
> be ok. Check out NMesh for example. It has 3 "has*" functions, which
all
> have an optional parameter to set the flag.

That doesn't make it any less weird or confusing.  IMHO, stuff like
this should be flagged in the 0-todo.txt file for cleanup and 
deprecation.

We should either follow a get/set function pair style or use
a C++ overloaded method style.

Boolean someFlag();  	    // gets value
None    someFlag( param );  // set value 	

Having a function called hasSomething() that also sets the value
is misleading.  It is also unclear.  Without looking at the code,
is the return value the flag state from before or after the flag 
is set?

-- 
Stephen Swaney			
sswaney at swbell.net
_______________________________________________
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