Commit Graph

19 Commits

Author SHA1 Message Date
Campbell Barton
a6f13f9d7b poll() as a python '@staticmethod' was too limiting and didnt allow useful base class poll functions in many cases.
now rna functions that dont have a 'self' are automatically assumed '@classmethods'.

de-duplicated poll functions and made some minor tweaks too.
2010-08-09 01:37:09 +00:00
Campbell Barton
163f6055d2 bugfix [#23182] Using self.report() inside poll() gives crash
poll() function is now a static method in python, this is more correct, matching C where the operator is not created to run poll.


    def poll(self, context): ...

is now...

    @staticmethod
    def poll(context): ...

Pythons way of doing static methods is a bit odd but cant be helped :|

This does make subclassing poll functions with COMPAT_ENGINES break, so had to modify quite a few scripts for this.
2010-08-05 16:05:30 +00:00
Martin Poirier
5b345524ea RNA Types metaclass registration
See mailing list posts for details [1][2][3]

Addons still need to be fixed; Campbell said he'd do it today.

See any of the py files (outside netrender) in this commit for how to do it (it's rather simple).

[1] http://lists.blender.org/pipermail/bf-committers/2010-February/026328.html
[2] http://lists.blender.org/pipermail/bf-committers/2010-August/028311.html
[3] http://lists.blender.org/pipermail/bf-committers/2010-August/028321.html
2010-08-02 02:55:12 +00:00
Campbell Barton
9a85435e96 rna api:
rename object.matrix --> matrix_world
added object.matrix_local (parent relative matrix)
2010-07-03 17:39:29 +00:00
Campbell Barton
4cf697de89 - for BGE mouse and keyboard events use tuples rather then lists
- pep8 corrections
2010-04-17 19:05:53 +00:00
Campbell Barton
67cfc427ee PyAPI
- added new mathutils.Color() type, use with rna so we can do for eg:
 material.diffuse_color.r = 1.0
 # also has hsv access
 material.diffuse_color.s = 0.6

 - made Mathutils and Geometry module names lowercase.
2010-04-11 14:22:27 +00:00
Campbell Barton
fbb8672da4 replace operator options bl_undo and bl_register with bl_options
eg.
 bl_options = {'REGISTER', 'UNDO', 'BLOCKING', 'GRAB_POINTER'}

This didnt exist when operators were originally wrapped.
2010-03-01 00:03:51 +00:00
Campbell Barton
97bdfe6f1b pep8 cleanup + correction for external player operator return value. 2010-02-22 23:32:58 +00:00
Daniel Salazar
f5cf555e6c Context for Object Align op = Object mode 2010-02-22 13:25:32 +00:00
Daniel Salazar
961207e631 Align Object op: ignore objects other than Mesh type 2010-02-17 08:57:40 +00:00
Campbell Barton
23efeff6a9 [#21177] Text editor
Running scripts directly didnt call the register function, even though this is not essential its good to be able to run a script directly and see changes in the UI.
2010-02-16 09:55:07 +00:00
Daniel Salazar
bd7bfff682 bug #21160, misspell in align objects operator 2010-02-15 10:06:27 +00:00
Daniel Salazar
d300c28e74 Align Object op: Introducing Align Modes Negative Sides / Centers /
Positive Sides. Not the most beautiful code ever but will beautify after everything is
implemented
2010-02-15 06:01:13 +00:00
Campbell Barton
39c04315e2 change python scripts so modules which register with blender have a register() function rather then making import automatically run the register functions (generally considered bad practice by python people) 2010-02-14 11:21:21 +00:00
Daniel Salazar
8f0b1acae2 Align Objects operator: Added align relative to Active object 2010-02-13 23:29:26 +00:00
Campbell Barton
081c1205a3 correct fsf address 2010-02-12 13:34:04 +00:00
Daniel Salazar
bb4f77ffe3 Align Objects operator: added selection center as align center 2010-02-12 05:02:29 +00:00
Daniel Salazar
6b01ab5e23 Align Objects operator: adds option to align relative to 3D cursor as
well as Scene Origin
2010-02-12 01:03:22 +00:00
Daniel Salazar
f0e873cabe New Align Objects operator. Currently it has very little functionality but
already does alignment operations that are very hard to do manually
2010-02-11 23:27:34 +00:00