Commit Graph

1077 Commits

Author SHA1 Message Date
Campbell Barton
74f7ef1240 Missed changing default arg in addon_utils.disable 2015-06-23 07:25:10 +10:00
Campbell Barton
18f228d593 update hand written rst docs
- minor corrections
- link to new manual
- wrap lines at 120
2015-06-18 08:00:46 +10:00
Bastien Montagne
124b25cf9d Usual minor i18n/UI messages fixes. 2015-06-15 21:38:36 +02:00
Campbell Barton
eb0310950c Fix error enabling an already enabled addon
Would run register() twice causing warning with `register_module()`
which expects new classes to be defined.

Now run unregister() before re-registering.
2015-06-14 22:26:42 +10:00
Campbell Barton
b9fe261255 Fix addon_utils.check
Second return value could be None instead of False.
2015-06-14 21:47:02 +10:00
Campbell Barton
1c81bcffde addon_utils default mismatch /w enable/disable
default_set argument is now False for both.
2015-06-14 05:14:43 +10:00
Campbell Barton
60ddaf045a Python API: use cached translation tables
bpy.path.clean_name() and AddPresetBase.as_filename() were doing
inefficient search-replace of individual characters.

Use cached replacement table instead.
2015-06-13 19:47:32 +10:00
Bastien Montagne
02a496c61c Translations utils: add needed bits to update git repo together with svn trunk. 2015-06-13 11:42:54 +02:00
Campbell Barton
d63615272c Use context manager for reading addon headers 2015-06-08 21:21:54 +10:00
Sybren A. Stüvel
07d51141ae Fix: a broken symlink to an addon resulted in a blank addon tab
The addons tab in the User Settings window would be empty, due to
a FileNotFound error. This error can be caused by a broken symlink,
which is now treated the same was as a file that misses its bl_info
dictionary.
2015-06-08 12:08:43 +02:00
Campbell Barton
99fba34b8d rename wiki -> manual 2015-06-08 11:34:07 +10:00
Campbell Barton
bf010c4a15 Cleanup: pep8 2015-06-07 17:28:02 +10:00
Bastien Montagne
451a077511 I18n extract: better handling of commandline args. 2015-06-03 17:15:00 +02:00
Campbell Barton
f5a471ef86 Python: avoid mutable default param values
D1328 by @yedpodtrzitko
2015-05-31 15:58:58 +10:00
Bastien Montagne
7b743defd4 Fix wrong 'check context' handling in addon i18n messages generator.
Reported (with patch) by yedpodtrzitko (yed podtrzitko), thanks a bunch!

Differential Revision: https://developer.blender.org/D1327
2015-05-29 11:08:26 +02:00
Bastien Montagne
e092a58fb5 I18n message extractor script: py code: do not consider strings inside 'Compare' AST nodes.
Otherwise, we'd get 'MOVIE' from `text="Build Proxy / Timecode" if clip.source == 'MOVIE' else "Build Proxy")`...
2015-05-25 21:17:49 +02:00
Bastien Montagne
a80c1e50bc Fix T44822: python enums' itemf callback did not handle 'NULL' context case.
Enum's itemf callback can be called without context in some cases (UI, doc generation...).
Python's enum properties did not handle this at all - it's kind of odd this did not cause
more trouble and wasn't notice earlier... Probably dynamic enums using context are not
much used in py code.

Note about nodes: those are heavy users of dynamic enum with context. Now,
we expect `NodeCategory.poll()` and `NodeItem.poll()` to always be called with
a valid context (since when there is no context available, we can assume `poll()`
is always True). `NodeCategory.items()`, however, must accept NULL context, so if
you use custom `items` callable for your custom node categories, you may need
to update it (as was done here for builtin `node_group_items()`).
2015-05-25 14:24:49 +02:00
Campbell Barton
f51fef63aa Fix own error deleting previews 2015-05-17 17:26:01 +10:00
Campbell Barton
847ec075eb Cleanup: pep8 2015-05-17 17:26:01 +10:00
Campbell Barton
20e561dd6a PyAPI: Remove release method, just use delitem 2015-05-12 18:43:30 +10:00
Campbell Barton
34c78a659b Doc: add bpy.utils.previews
Updated sphinx_doc_gen.py to better handle pure py-classes.
2015-05-12 18:24:32 +10:00
Campbell Barton
8a231185aa Doc: minor fixes
- check for class/static methods assumed nonzero args.
- subclass references and set-flag items are now sorted.
- use 'order' for Py operator mix-ins,
  so operator settings don't show in random order.
2015-05-12 18:23:24 +10:00
Bastien Montagne
d30f664c04 Expose PreviewImage & custom icons to py API.
This commit mainly:

* Exposes PreviewImage struct in RNA, including ways for user to set images data.
* Adds a new kind of PreviewImage, using a file path and IMB_thumb to get image.
* Adds a new kind of custom icon using PreviewImage, unrelated to ID previews system.
* Adds a python API (utils.previews) to allow python scripts to access those custom previews/icons.

Note that loading image from files' thumbnails is done when needed (deferred loading), not
when defining the custom preview/icon.

WARNING: for release addons who would want to use this, please keep it to a strict minimum, really needed level.
We do not want our UI to explode under hundreds of different flashy icons!

For more info, see also the release notes of Blender 2.75 (http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.75/Addons)
and the example/templates featured with Blender.

Patch by Campbell (ideasman42), Inês (brita) and Bastien (mont29).

Differential Revision: https://developer.blender.org/D1255
2015-05-11 16:37:15 +02:00
Bastien Montagne
929c9de3dc Turn bpy.utils into a package, so that we can easily add submodules to it. 2015-05-02 10:38:51 +02:00
Campbell Barton
0287b39468 Py API: Remove deprecated callback_add 2015-04-23 12:58:49 +10:00
Bastien Montagne
b07c630676 I18n: Add Vietnamese language. 2015-04-20 14:27:20 +02:00
Bastien Montagne
057c7c6fab Cleanup: do not use _reportf() when not doing any string formating!
Also usual minor i18n messages stuff...
2015-04-13 21:00:45 +02:00
Campbell Barton
9b359c1592 Py API: default arg for location_3d_to_region_2d
This function could return None for points behind the view,
note this in the doc-string and add an optional fallback argument.
2015-04-13 14:35:16 +10:00
Campbell Barton
d687428122 Error in own last commit 2015-04-09 21:23:21 +10:00
Campbell Barton
cc6e0b7394 UI: Extend preset menu
- allow for preset menu to change operator defaults.
- allow preset menu to select own kinds of file extensions.
2015-04-09 19:10:00 +10:00
Bastien Montagne
33a9247334 UI i18n cleanup...
And some general style cleanup as well (line length...).
2015-04-06 22:06:06 +02:00
Campbell Barton
b87eaef1f7 Fix T44137: bpy.path.is_subdir fails
`bpy.path.is_subdir("/abc/def/ghi","/abc/de")` incorrectly returned True
2015-03-26 16:32:16 +11:00
Campbell Barton
1c329af74c Fix T44026: ID prop delete leaves names in _RNA_UI 2015-03-26 00:12:28 +11:00
Bastien Montagne
cf365275c2 Fix T44089: All addons do not use same default for orientations.
Transformed 'OrientationHelper' class into 'orientation_helper_factory' function,
which returns an OrientationHelper customized class with specified default axes.
2015-03-24 09:57:11 +01:00
Bastien Montagne
b0bbd34ac2 I18n: update for new akward algo names in UI messages... 2015-03-16 20:55:01 +01:00
Bastien Montagne
9f6f151536 I18n: Do not skip Polish anymore, translation work has started on it. 2015-02-28 21:51:17 +01:00
Campbell Barton
f159ed7746 Workaround T43491: Python readline causes crash
loading 'readline' module could crash blender if 'libedit' was already linked (via LLVM).

Workaround the problem for now since we don't even need readline,
a _real_ fix likely involves changing how LLVM or Python are built.
2015-02-26 22:54:18 +11:00
Sybren A. Stüvel
6920735cff Include SDL information in system info text.
Adds bpy.app.sdl to expose SDL version information.

When SDL is not available on a Linux system, certain Blender features
are silently disabled (like joystick support in the BGE). This change
is the first step towards making it more obvious why something isn't
working.

SDL information is exposed to Python via bpy.app.sdl, in the same way
as OCIO and OIIO information is exposed.

Generated system-info.txt contains SDL loading method (linked or
dynamically loaded by Blender) and SDL version number.

Reviewed by: sergey, campbellbarton

Differential Revision: https://developer.blender.org/D1112
2015-02-18 12:08:20 +01:00
Campbell Barton
652b2b656a Fix bake action visual-keying option
Disabling did nothing
2015-02-17 07:19:48 +11:00
Bastien Montagne
00a3c9afc8 UI messages fixes and cleanup. 2015-02-16 20:38:07 +01:00
Campbell Barton
616eb6818f cleanup 2015-02-13 16:17:00 +11:00
Campbell Barton
e408e632a1 Addons: print short message if an addons missing
Was printing full traceback, harmless but verbose.
2015-02-12 23:44:37 +11:00
Bastien Montagne
2d4980e68e Fix T42510: bake animation wrong result.
Caused by own rBfb7ff31315a1c9 - not surprising code using Object.matrix_local
in other contexts than mere Object parenting fails, since it was using a broken
implementation before...

Note that whole NLA_OT_Bake op would need some love, it is quite brittle in many aspects.
2015-02-03 15:44:20 +01:00
Campbell Barton
7095f47665 cleanup: pep8
also remove empty class parenthesis
2015-01-29 15:35:06 +11:00
Campbell Barton
e17c6f79a5 cleanup: py imports 2015-01-28 16:50:51 +11:00
Campbell Barton
3ff3f563e5 PyAPI: don't adjust prefs when an fails to load
Recent addons commit meant that addons would be enabled even if they weren't found.
This would give an error (which is fine), but also remove from preferences.
2015-01-23 21:18:35 +11:00
Campbell Barton
7733bd5efc PyAPI: avoid scanning all addons on startup
Gives small speedup
2015-01-23 16:38:29 +11:00
Campbell Barton
783b4cd1ca PyAPI: use set.discard instead of set-subtraction 2015-01-23 16:37:56 +11:00
Campbell Barton
3e8c0027a3 Cleanup: replace deprecated imp -> importlib 2015-01-23 12:37:58 +11:00
Campbell Barton
88222fac63 Remove 'addons_extern' was used before git move 2015-01-21 12:56:03 +11:00