Commit Graph

352 Commits

Author SHA1 Message Date
Brecht Van Lommel
7428e708ac Fix #23865: F8 reload scripts doesn't work with an addon enabled,
broken with bugfix for #23001.
2010-09-16 18:50:33 +00:00
Campbell Barton
84c4062928 bugfix [#23833] Console Errors (Keymaps)
dont allow non-existing preset paths to be passed to the preset menu.
2010-09-15 13:41:38 +00:00
Campbell Barton
8d0c01e6e2 keyconfig updates/changes
- use preset subclass with funcs for updating the keyconfig
- keyconfig filenames are used for the UI names as with presets (so separation anymore)
- keyconfig's are stored in the preset dir (scripts/cfg dir removed)
- only the active keyconfig script is loaded
- some bugfixes for saving keymaps
- user interactions no longer saves keyconfigs too, I think this needs to be re-worked.

developer note...
multiple keyconfigs at once are not really needed now that they are stored & accessed directly in python.
for now I left it alone but we could consider to remove this capability in the future.
2010-09-14 16:45:24 +00:00
Campbell Barton
74b2022a82 button to remove presets.
note: this is an option to the add preset operator which is a bit odd but easiest since these classes have all the info needed for removal as well.
2010-09-14 04:58:25 +00:00
Campbell Barton
55f7451c52 fix for sphinx doc generation 2010-09-13 13:29:54 +00:00
Campbell Barton
18702a9eef bugfix [#23001] Addons do not unregister properly in Blender 2.5.3
Now reloading the user defaults also unloads/loads addons, resetting the state to the one set in the user preferences.

moved addon functions into bpy.utils
- bpy.utils.addon_enable(name, default_set=True)
- bpy.utils.addon_disable(name, default_set=True)
- bpy.utils.addon_reset_all(name, default_set=True)

the user preference operators now just wrap these.
2010-09-13 04:52:56 +00:00
Campbell Barton
386bd71240 pyrna: replace method for operators forwarding getattr/setattr access from self.* to self.properties.* 2010-09-11 15:13:22 +00:00
Campbell Barton
5559a0d52e rewrote python IDProperty metaclass in C, this was a quick hack to get it working.
The reason this didnt work is all sibclasses of pythons type() or PyType_Type in C, have to have their size set to sizeof(PyHeapTypeObject) rather then sizeof(PyTypeObject) as you might expect.
This is strange since its not a heap-class (defined in pythons runtime), but a static C type, so Im not sure about this, and cant find any documentation but it seems to work ok.
2010-09-10 14:54:50 +00:00
Campbell Barton
111965478a replace self.properties.foo --> self.foo 2010-09-09 18:03:57 +00:00
Campbell Barton
7bd1f9a234 - bugfix, operators were getting their properties registered twice.
- operator properties are now converted into python property() class members which bypass the operator 'properties' member.
  self.properties.mysetting
 ... can now be written as ...
  self.mysetting
- fix for error reloading rigify
2010-09-09 17:41:36 +00:00
Campbell Barton
45cf7633fe remove class methods for defining properties
eg: bpy.types.Scene.BoolProperty()
2010-09-09 06:29:44 +00:00
Campbell Barton
f4be9a6393 support for defining rna class properties as class attributes
eg:
 bpy.types.Scene.myprop = BoolProperty()
 
note, this uses an ugly python metaclass, this should be replaced with a C implimentation which is included but commented out, causing crashes in pythons GC which gives no hint as to where the bug comes from.
2010-09-09 05:37:22 +00:00
Campbell Barton
b58f41e120 addon improvements/fixes
- better error reporting when an addon fails to load
- upload an addon which loads partly but then fails (eg, module loads but class register fails)
- bugfix addon loading, failier to load would leave _bpy_types._register_immediate = False
- added which change on disk are reloaded when enabling.
- bpy.path.module_names() now returns (module_name, module_path) pairs.
2010-09-08 07:30:20 +00:00
Campbell Barton
1a41d2fc29 new bpy function bpy.path.module_names(path, recursive=False)
addon's and python initialization both had this inline.
2010-09-08 04:55:37 +00:00
Campbell Barton
115b256738 ran through pep8 checker 2010-09-07 15:17:42 +00:00
Campbell Barton
0d12c77097 bugfix [#23635] property limits don't work when added via scripting\
also fix for bug where soft limits could be greater then hard limits with bpy.props.* functions.
2010-09-02 14:43:22 +00:00
Campbell Barton
ddbfb05c84 rna context rename
* context.main & bpy.types.Main --> context.blend_data & bpy.types.BlendData
* context.manager --> context.window_manager
2010-09-02 04:53:05 +00:00
Nathan Letwory
81d9a3de43 * add missing imports
* fix indentation: tabs -> spaces
2010-09-01 13:55:41 +00:00
Campbell Barton
a89c526a92 finished moving importers and exporters into python packages (as proposed on the mailing list).
- made operator dir's into python packages
- lazy loading of module which do the actual import and export (faster blender load times)
- general maintanance and small fixes.
- bugfix for exporting x3d materials
- leak fix for exporting 3ds
2010-09-01 12:11:34 +00:00
Campbell Barton
7532bc2325 poll function for py api operator access
eg:
 if bpy.ops.object.mode_set.poll():
     ...
2010-09-01 11:16:11 +00:00
Campbell Barton
16d26b7eb1 cleanup duplicate GPL haeders, blender made 2.4x __bpydoc__ into __doc__, removed version info, (thats what svn logs are for).
also moved create_derived_objects & free_derived_objects into io_utils, used by x3d and 3ds.
2010-09-01 02:48:23 +00:00
Campbell Barton
5036a9d20c use mix-in classes for import export operators, these define the filepath property and invoke function at the moment. 2010-09-01 02:25:49 +00:00
Campbell Barton
b0b787ef38 bugfix [#23534] Custom Properties not showing in OBJECT panel 2010-08-27 06:11:42 +00:00
Campbell Barton
240b164a87 fix some errors in rigify caused by recent api changes 2010-08-27 00:05:00 +00:00
Campbell Barton
50bce31dbb rna api changes
- mesh.add_geometry(v, e, f)  --> mesh.vertices.add(tot), mesh.edges.add(tot), mesh.faces.add(tot)
- mesh.add_material(mat) --> mesh.materials.link(mat)

changed material.link so it always adds a material even if it exists in the list, this behavior is good for users but not scripts since it can mess up indicies (some formats may have the same material set twice).
2010-08-26 22:44:05 +00:00
Campbell Barton
e7c4a0d53b rna api - replace panel properties bl_default_closed and bl_show_header with bl_options which has 2 flags: 'DEFAULT_CLOSED' and 'HIDE_HEADER'.
this matches operators which also uses bl_options like this
2010-08-26 01:05:37 +00:00
Campbell Barton
4f5f868a52 rna data path names which are more likely to break animations.
Added an operator "Update Animation Data",
access from the search menu to update drivers and fcurves.
2010-08-20 06:09:58 +00:00
Campbell Barton
097a6ca926 rna remaining that negates values 2010-08-20 02:08:43 +00:00
Campbell Barton
8e388a8f49 fixes for recent renaming 2010-08-19 14:43:52 +00:00
Campbell Barton
5e53012558 utility function for updating animation system values when RNA changes.
- any numnber of attributes are supported for renaming, eg: modifiers["Foo.Bar"].prop.bar
- the path is resolved in blender so each attribute is type checked against the naming list.
- inherited properties are supported by recursively checking parent classes names aganst the name list.
- fcurves and drivers are currently supported.
2010-08-18 18:00:52 +00:00
Campbell Barton
55ed0f0507 more rna renaming. 2010-08-18 08:26:18 +00:00
Campbell Barton
513a907730 rna rename Bone and Text changes 2010-08-18 07:45:32 +00:00
Campbell Barton
7da5d9faec rna renaming, still only adjusting properties that wont be animated (at least its very unlikely). 2010-08-18 07:14:10 +00:00
Campbell Barton
54e6ea70c0 rna renaming for Render* structs 2010-08-18 04:10:23 +00:00
Campbell Barton
9784a1169d rna naming: verts -> vertices 2010-08-18 03:42:26 +00:00
Campbell Barton
3bd039eff9 apply rna rename most of the show_*, names. 2010-08-17 17:03:52 +00:00
Campbell Barton
b278279c95 document rna functions that have the no_self flag set as classmethods 2010-08-17 14:32:14 +00:00
Campbell Barton
7a31417f50 apply UserPrefs and Theme rna naming changes. 2010-08-17 13:14:41 +00:00
Campbell Barton
5f7045f7af - rna_info.py now outputs array length with types eg. float[16].
- corrected rna property name Controller.states -> state (pointed out by Dalai).
- rna_cleaner_merge script now only merges comment and new name.
2010-08-17 02:42:30 +00:00
Campbell Barton
556b615cf8 mathutils module methods only contained matrix constructors, move these to matrix class methods since this is acceptable in python. eg: dict.fromkeys() and groups them more logically.
mathutils.RotationMatrix -> mathutils.Matrix.Rotation
 mathutils.ScaleMatrix -> mathutils.Matrix.Scale
 mathutils.ShearMatrix -> mathutils.Matrix.Shear
 mathutils.TranslationMatrix -> mathutils.Matrix.Translation
 mathutils.OrthoProjectionMatrix -> mathutils.Matrix.OrthoProjection
2010-08-11 16:40:36 +00:00
Campbell Barton
ab8ccaa709 python declarative UI
- remove XML testing feature
- add 2 modules: bpyml - generic, bpyml_ui - blender spesific. nothing uses these now.

==bpyml_ui module==
defines BPyML_BaseUI and its draw() function which uses the bpyml member of the class instance self.draw_data & self.draw_header_data.

This way declarative ui is opt-in and easy to use by using BPyML_BaseUI as a mix-in class.

==bpyml module==

This module translates a python like XML representation into XML
or simple python blender/ui function calls.

    sometag(arg=10) [
        another(),
        another(key="value")
    ]

# converts into ...

    <sometag arg="10">
        <another/>
        <another key="value" />
    </sometag>
2010-08-11 15:11:30 +00:00
Campbell Barton
d739a1788d small edits to text editor from writing a python editor extension.
- rename TextLine.line -> body, ConsoleLine.line -> body
- minor speedups when setting the body text, also re-allocate console lines if they are < half the length.
- added option to highlight current line in the text editor.
2010-08-11 05:21:43 +00:00
Guillermo S. Romero
95aa8cfa4a Update address in license block. 2010-08-10 21:22:26 +00:00
Campbell Barton
41531e4fb6 include rna parent class names in renaming list 2010-08-10 06:27:29 +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
1bda960348 [#23228] Play rendered animation is not working
own recent commit missed renaming expand -> abspath
2010-08-08 22:49:46 +00:00
Campbell Barton
057aac553b Experemental XML UI, define panels/menus/headers which load at startup like python scripts.
- 2 panels implimented in properties_render_test.xml (Render Dimensions and Stamp)
- only enabled in debug mode.
- poll() functions are not supported yet.
- as stated above experemental, we'll see if this is at all useful, remove if not.
- XML could be replaced with JSON or YAML.
2010-08-07 16:21:15 +00:00
Campbell Barton
048d3dc587 fix for missing import 2010-08-06 13:06:13 +00:00
Campbell Barton
267a7b76e8 adding back pep8 tag removed r31089.
I use this as a tag that the script SHOULD be pep8 compliant, warnings the pep8 checkers give can be fixed later, without this I dont get any warnings.
2010-08-06 03:11:19 +00:00
Guillermo S. Romero
1aecb15c74 SVN maintenance. 2010-08-06 02:26:23 +00:00