Commit Graph

115 Commits

Author SHA1 Message Date
Campbell Barton
dacdfbe6f3 recent change to keyframe menu broke BVH import, now don't use the operator at all, instead assign the action manually.
Also added bpy.path.display_name_from_filepath(), since filepaths are not ensured to be utf8.
same as calling:  os.path.splitext(os.path.basename(name))[0].encode("utf8", "replace").decode("utf8")
2011-01-03 08:28:22 +00:00
Campbell Barton
7f3fe8a2df pep8 cleanup 2011-01-01 07:20:34 +00:00
Campbell Barton
54343b79e6 remove reload() from builtins since python3 no longer uses this.
use imp.reload now.

Should use import hooks but for now replace imp.reload with our own reload as the builtin reload was replaced before.
2010-12-22 21:39:48 +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
Campbell Barton
77c17d332d fix [#25262] Keyboard shortcut presets can't be made because of wrong folder
New create option when getting a user resource for creating paths.
  bpy.utils.user_resource(type, path, create=False)
2010-12-18 07:22:52 +00:00
Campbell Barton
3256d0fc6a allow addons/modules path so extension authors can develop their own shared modules. 2010-12-11 11:52:28 +00:00
Campbell Barton
6f90a38a54 error in own recent commit 2010-11-22 23:41:00 +00:00
Campbell Barton
1d468c75e7 bugfix [#24805] bpy operator runs in wrong order or is ignored at all 2010-11-22 17:21:18 +00:00
Campbell Barton
593815b23f reloading addons wasn't working. 2010-11-20 04:18:06 +00:00
Campbell Barton
03d8fd4616 - use relative imports for packages
- reload() has been removed from pythons builtins. use imp.reload() instead (still need to apply globally).
- fixed own mistake, not ignoring 'filter_glob' as a keyword argument (broke fbx, obj, 3ds export)
2010-11-20 02:56:58 +00:00
Campbell Barton
7689ac75ad fix for error in recent commit. 2010-11-19 11:57:10 +00:00
Campbell Barton
23fbce5a5f bugfix [#22615] Opening a blend file in python (bpy.ops.wm.open_mainfile() (r29489)
[#22557] bpy.ops.wm.read_homefile() causes segfault (r29372)
2010-11-18 16:33:13 +00:00
Campbell Barton
64ff9d6de4 fix to allow [#24009] to be fixed.
WM_operator_poll() could fail in cases WM_operator_name_call() would succeed because calling the operator would setup the context before calling poll.
this would result in python raising an invalid error or menu items being greyed out.

now python can also check with an operator context:
  bpy.ops.object.editmode_toggle.poll('INVOKE_SCREEN')
2010-11-04 12:59:03 +00:00
Luca Bonavita
406fd33a86 == addons ==
- new (and temporary) directory addons_extern/ to store external projects addons
2010-10-24 16:01:21 +00:00
Campbell Barton
8bb75bb5b6 bugfix [#24155] Operator Cheat Sheet doesn't work properly 2010-10-06 22:29:34 +00:00
Campbell Barton
ab8aa13b82 bugfix [#24087] Blender can not install add-ons unless running with root priviledges
now addon path is created using the same path functions and selecting where to save the startup.blend

also made some minor changes to path handling funcs.
2010-10-03 20:00:22 +00:00
Campbell Barton
ed7ffb111a bugfix [#24116] UV layout exporting doesnt work
in-fact this is unrelated to UV Layout script, just a missing check for an bad state.
2010-10-03 12:22:33 +00:00
Campbell Barton
3dea67a3fd bugfix [#24065] obj export (mtl image path) 2010-10-01 05:19:40 +00:00
Campbell Barton
92954672dc bugfix [#23978] Error installing addon 2010-09-25 06:36:01 +00:00
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
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
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
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
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
7a31417f50 apply UserPrefs and Theme rna naming changes. 2010-08-17 13:14:41 +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
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
Campbell Barton
30d180ff0d bugfix [#23194] export UVs miss the extension file
also made all other exporters do this.

Made some internal changes.
- moved path functions from bpy.utils to bpy.path (similar to os.path)
- added functions...
  bpy.path.ensure_ext(path, ".ext", case_sensitive=False) # simple function to ensure the extension is set.
  bpy.path.resolve_ncase(path) # useful for importing scenes made on windows where the path case doesnt match the files.
2010-08-06 01:40:54 +00:00
Campbell Barton
233df907d0 py/rna update, reload works again.
- fix for reload (f8) crashing, missing incref when creating the script namespace.
- store the module names rather then the modules for reloading incase the modules get out of date.
2010-08-03 03:53:36 +00:00
Campbell Barton
0c62d107e0 minor changes to registration before committing addons fixes 2010-08-02 06:56:31 +00:00
Campbell Barton
55e64f0ba4 minor changes to Martni's commit 30961
- removed the immediate option from C/api and now store in python only, when python loads modules it sets it to False.
- unloading a module would clear the entire TypeMap for all modules, only remove the module types that is being unloaded.
- added some checks for bad class registering, report errors rather then crashing.
2010-08-02 04:20:41 +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
fa9550bba0 fix for un-initialized memory use with thumb's & minor internal improvement for bpy.utils.clean_name() 2010-07-28 07:37:24 +00:00
Campbell Barton
15e94823dd in debug mode report the time to load addon modules. 2010-07-26 09:09:53 +00:00
Campbell Barton
fd31436897 spelling correction: alredy --> already 2010-07-17 18:08:14 +00:00
Andrea Weikert
05fb497f75 == installation paths ==
remove deprecated python BLI_gethome_folder calls

Patch by Brecht, thanks a lot
2010-07-15 20:02:53 +00:00
Campbell Barton
1028284301 pep8, whitespace edits 2010-06-09 19:12:03 +00:00
Campbell Barton
9cbbc9d3af rename some rna properties filename --> filepath
* filename == "foo.ext"
 * filepath == "/path/to/and/including/foo.ext"

this was alredy followed in some places not not everywhere.
2010-06-02 17:58:28 +00:00
Campbell Barton
ed3a7bd299 script reload (f8), is closer to working.
there are internal memory problems which can make it crash still.
If you remove all directories in the scripts folder except for 'modules' and 'ui', it runs without crashes.
2010-06-01 08:15:43 +00:00
Campbell Barton
1658a28a58 - Python console argument '--python-console', option so you can start blender and drop into a python console, (useful for debugging some problems on a renderfarm over ssh)
- Also made it so sys.stdin isnt overwritten anymore, instead the interactive consoel overwrites while it executes and restores after.

- removed hope folder from sphinx patch path
2010-05-30 14:05:58 +00:00
Campbell Barton
80de1162ee clear some pep8 warnings 2010-05-16 12:15:04 +00:00