[Bf-python] vector.negate() question

Toni Alatalo antont at kyperjokki.fi
Tue May 9 16:32:36 CEST 2006


Gilbert, Joseph T. wrote:

>lol you make great points. -vector is really a shorthand for vector.negate(). No harm in having both available.
>  
>

i think -vector should definitely not do anything, but vector1 - vector2 
should return vec_sub(vec1, vec2)
.. that is how python normally works, and how e.g. the soya3d api does it.

~Toni

> 
>________________________________________
>From: bf-python-bounces at projects.blender.org [mailto:bf-python-bounces at projects.blender.org] On Behalf Of Germán Alonso
>Sent: Tuesday, May 09, 2006 7:36 AM
>To: Blender Foundation Python list
>Subject: [Bf-python] vector.negate() question
>
>Good morning to all:
> 
>I'd love to know why vector.negate() has been depreciated, to use -vector instead of it.
> 
>I think that the explicit method would be better and more natural than the minus prefix, as this new can make undesired negations of vectors that may be difficult to detect if you're not used to this behaviour.
> 
>For example when you pass to a function an integer negated you use:
>function( -integer )
>and this don't change the integer variable value, but if you pass a vector:
>function( -vector )
>the vector value changes and you'll have to use:
>function( -Vector(vector) )
>if you don't want the vector variable to change.
> 
>I think this is a little odd, and purpose restore the old vector.negate() method, as is an explicit action instead of being hidden behind the minus symbol.
> 
>Thanks for reading.
> 
>Germán
>_______________________________________________
>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