[Bf-python] Get cursor position

Michel Selten michel.s at home.nl
Wed Sep 3 21:22:21 CEST 2003


On Wed, 2003-09-03 at 19:07, Stephen Swaney wrote:
> Willian Padovani Germano wrote:
> 
> > I'm still thinking about a .SetCursorPos() and same for the view vector.
> > Will discuss with Ton, first, maybe wait to see if someone finds a use for
> > that.
> >
> 
> Here is one vote for a SetCursorPos().
> I would argue for it on the grounds of:
> 
> 1) Symmetry - getting and setting go together like matter and anti-matter.
>     (hmm.  maybe not the *best* analogy. )
> 
> 2)  It would come in handy for randomly placing chunks of rock across
> a Martian landscape.  (Yes, ths *is* a real world problem. )

I agree with Stephen. But there may be some obscure reason why this can
result in problems, so indeed, it would be wise if we asked Ton first.

> On a not totally unrelated note:  Do we have an Official Naming Convention
> for python names?  Specifically, is the first letter of a method name upper
> case
> or lower.  I have seen examples of both styles, sometimes in the same class.

Well, what seems to be the general idea in most modules is that for
exported modules we use a capital. Some modules are not exported like
vector and matrix. These are using lower case.
For functions in a module, we use a capital. (Object.Get(),
Blender.Redraw(), Camera.New()).
For methods on an object, we use a lower case. (in case of an Object:
obj.getLocation(), obj.getMatrix(), obj.setEuler()).
This has never really been discussed, since most function and method
names are copied over from the old Python implementation.

With regards,
	Michel

ps. To get things consistent, I had implemented both the
Object.getSelected() and Object.GetSelected() functions. The first one
though, gives a warning in the console that it's a deprecated function
and will disappear in the future.






More information about the Bf-python mailing list