Commit Graph

26 Commits

Author SHA1 Message Date
Campbell Barton
4612034cf4 patch [#25809] Auto-Registration as utility function.
This removes auto-registration, committed by Martin r30961.
Realize this is a contentious topic but Brecht and myself both would rather opt-in registration.

TODO:
- addons need updating.
- class list will be modified to use weakrefs (should have been done for existing system too).
- will move bpy.types.(un)register functions into bpy.utils.(un)register_class, currently including these functions in a type list is internally ugly, scripts which loop over types also need to check for these.
2011-02-10 23:48:22 +00:00
Campbell Barton
7f3fe8a2df pep8 cleanup 2011-01-01 07:20:34 +00:00
Campbell Barton
73ad13c879 fix for make-dupli-face operator & vector multiplication, tab/space error in last commit. 2010-12-19 07:14:42 +00:00
Campbell Barton
c26cc0afa1 bugfix [#25290] Align on text gives a traceback
[#25284] Traceback error on "System Info" script

- Align was only working on mesh objects, now operate on all objects, missing boundbox's are treated as single points.
- obj.bound_box was returning all nan's for object types with no boundbox.
- ENUM_FLAG type enums were showing no text when displayed in operator redo panel.
2010-12-19 07:05:29 +00:00
Daniel Salazar
9295a53022 Align Objects operator was broken due to incorrect order of vector by
matrix multiplication
2010-12-03 11:05:36 +00:00
Campbell Barton
166980b6fe fix [#24866] object/transform/align objects error 2010-11-22 20:54:26 +00:00
Campbell Barton
111965478a replace self.properties.foo --> self.foo 2010-09-09 18:03:57 +00:00
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