Commit Graph

825 Commits

Author SHA1 Message Date
Campbell Barton
97d62f0183 style cleanup 2013-01-15 23:15:32 +00:00
Campbell Barton
039db0906d add user_preference access to _RestrictContext() so addons can access their own preferences on load. 2013-01-15 17:20:52 +00:00
Campbell Barton
a404e3f780 fix issue reported in '[#33876] bpy.path.ensure_ext adds extension twice / extra period if filename empty, just a period or equal to extension'
For python operators that used the ExportHelper mix-in class, an empty file field would become '.ext', entering and existing the text field would become '.ext.ext',
Now only add an extension if the filename part of the path is set, so '.ext' will still become '.ext.ext' but having only the extension isn't so likely to happen in the first place now.

This is a different fix then the changes suggested in the report but I'd prefer to keep path functions stupid+predictable.
2013-01-15 04:33:08 +00:00
Bastien Montagne
819a75113e Some fixes:
* handle nicely multiple empty lines in po files (still have to figure out why po writer sometime output two lines instead of one!)
* fix rtl processing!
2013-01-14 21:41:21 +00:00
Campbell Barton
3475f5137a fix fox AddonPreferences not getting registered automatically and leak when removing the addon (wasnt freeing ID-props). 2013-01-14 10:36:43 +00:00
Bastien Montagne
884d7caa24 Minor updates:
*Made branches' po update multi-process!
*0.8 looks a bit too much a "similarity cutoff" value for messages, changed to 0.75.
2013-01-13 17:43:04 +00:00
Bastien Montagne
cdb5e557b0 Grumph, going quicker than the music! :P 2013-01-13 14:36:50 +00:00
Bastien Montagne
55e3912f25 Big refactor of bl_i18n_utils, switching to an object-based model. Still a bit wip.
Notes:
* Most tools here have been updated, only a few (unused :p ) features should be missing. But some updates are rough for now, and performances are globally worse currently, will address this later (this is only really noticeable when you work over the whole repo, anyway ;) ).
* This update breaks "edit translations" addon, will fix it later, once core (i.e. this module) is considered stable again!
2013-01-12 16:49:06 +00:00
Bastien Montagne
0e676bf50b Adding Uzbek language 2013-01-04 18:19:07 +00:00
Campbell Barton
9dbe85c17e expose common extensions for image/movie/audio types, since python scripts had to do this internally.
- bpy.path.extensions_image
- bpy.path.extensions_movie
- bpy.path.extensions_audio

eg:

  if os.path.splitext(filename)[1].lower() in bpy.path.extensions_image:
      ... we have an image ...
2013-01-04 03:47:37 +00:00
Campbell Barton
ea2224e28d changes needed for EDL import to work again.
- add sequence.update(data=False) function.
- made some sequence vars editable.
- correct some comments.

also rename rna function sequence.getStripElem() --> strip_elem_from_frame()
2013-01-02 16:15:45 +00:00
Bastien Montagne
b3aa368c8f Usual UI messages-related fixes... 2012-12-30 23:21:33 +00:00
Thomas Dinges
f098407f02 i18 Spell check:
* Wrong comma sequence in spell_check_utils.py
2012-12-28 20:32:29 +00:00
Bastien Montagne
c587c985e8 Fix [#33424] Inadequate bake action.
bake_action tries to make kind of a 'visual keying'... On one side, this is rather stupid when you keep constraints (in this case, keying actual loc/rot/scale transforms, i.e. matrix_basis, is enough, doing more would lead to unexpected behavior with some constraints). On the other one, making a good visual keying of bones is *really* tricky, so now using the new object's convert_space() func to compute that (when the user chooses to remove the constraints).

Incidentally, this greatly simplifies the code of bake_action!
2012-12-28 13:34:19 +00:00
Bastien Montagne
7504cf34b4 This commit frees list ui items from their dependencies to Panel, and hence from all the limitations this implied (mostly, the "only one list per panel" one).
It introduces a new (py-extendable and registrable) RNA type, UIList (roughly similar to Panel one), which currently contains only "standard" list's scroll pos and size (but may be expended to include e.g. some filtering data, etc.). This now makes lists completely independent from Panels!

This UIList has a draw_item callback which allows to customize items' drawing from python, that all addons can now use. Incidentally, this also greatly simplifies the C code of this widget, as we do not code any "special case" here anymore!

To make all this work, other changes were also necessary:

* Now all buttons (uiBut struct) have a 'custom_data' void pointer, used currently to store the uiList struct associated with a given uiLayoutListBox.

* DynamicPaintSurface now exposes a new bool, use_color_preview (readonly), saying whether that surface has some 3D view preview data or not.

* UILayout class has now four new (static) functions, to get the actual icon of any RNA object (important e.g. with materials or textures), and to get an enum item's UI name, description and icon.

* UILayout's label() func now takes an optional 'icon_value' integer parameter, which if not zero will override the 'icon' one (mandatory to use "custom" icons as generated for material/texture/... previews).
  Note: not sure whether we should add that one to all UILayout's prop funcs?

Note: will update addons using template list asap.
2012-12-28 09:20:16 +00:00
Bastien Montagne
f339c63584 We now have some Catalan, but no Amharic nor Estonian yet! 2012-12-24 17:55:00 +00:00
Bastien Montagne
ec4fc2e132 Usual minor UI messages tweaks... 2012-12-24 17:40:47 +00:00
Campbell Barton
f25618f29a make Node.links return a tuple, this may you can't do socket.links.append() by mistake.
removed RNAMeta mixin class since you cant register subclasses.

also some minor code cleanup
2012-12-21 12:16:13 +00:00
Lukas Toenne
74ea6d93da Explicit python class for NodeSocket RNA type in bpy_types. This defines a utility property for getting links to or from a node socket, as discussed on bf-committers:
http://lists.blender.org/pipermail/bf-committers/2012-December/038555.html

Note: NodeTree and Node currently use standard python classes generated by bpy for now. The customnodes branch defines such classes as well, with specialized metaclasses for use with ID properties. Not needed in trunk yet.
2012-12-21 11:31:59 +00:00
Campbell Barton
423994bf39 py api: add restrict state context manager (thats python's context not blenders context),
which restricts bpy.context and bpy.data.

enable this for loading scripts in 'startup' too.
2012-12-20 03:56:22 +00:00
Campbell Barton
ef665b3d18 dissallow access to the context while addons import and register.
Since the window manager is needed for keymaps this is kept as an exception.

some addons will need updating, but in every case I've seen addons should not be accessing the context while registering.
(bad stuff! - declaring the scene as a global variable - which crashes when the users loads a new file, manipulating the active object or scene... tsk tsk)
2012-12-19 07:27:23 +00:00
Bastien Montagne
b7e3967134 Adding Amharic (i.e. ethiopic) language. 2012-12-18 09:13:04 +00:00
Bastien Montagne
cfd6282a80 Minor update to i18n spell check stuff... 2012-12-17 20:32:25 +00:00
Campbell Barton
15634fd22e fix for sequence size mismatch when loading themes, addition of alpha channel caused themes not to load. 2012-12-13 09:46:24 +00:00
Campbell Barton
7c2e4e28ba bpy.ops module/caller classes incorrectly had __keys__ rather then __slots__.
also added comments about texface drawing when theres no origindex.
2012-12-06 03:09:06 +00:00
Campbell Barton
0b9be70591 typo's and some style cleanup, also added asserts into BLI_vsnprintf and BLI_sprintfN when invalid args are given. 2012-11-28 06:43:04 +00:00
Campbell Barton
4fe35721e6 bmesh operator api reference - add in 'bmesh' arg at the start of each operator, also use :class: references. 2012-11-28 01:14:11 +00:00
Bastien Montagne
eab58bf994 Spell check updates... 2012-11-26 21:25:50 +00:00
Bastien Montagne
bb7fdc7935 Handle of new BLF_I18N_MSGID_MULTI_CTXT macro, which allows to define a same msgid in up to 16 different contexts at once. 2012-11-23 15:35:16 +00:00
Campbell Barton
b867f9f17e style cleanup: comments & spelling 2012-11-18 01:22:31 +00:00
Campbell Barton
7c3db355b1 remove ifdef'd bevel code, current bevel works better then the previous code.
reduce strlen check in texttool_suggest_add()
use 'del list[:]' rather then 'list[:] = []' in python scripts which clear lists.
2012-11-14 09:45:15 +00:00
Bastien Montagne
aadfcb7a83 Removing again windows' long_locales! :p 2012-11-13 06:29:46 +00:00
Bastien Montagne
d8443cdfb0 New words... 2012-11-07 12:14:35 +00:00
Bastien Montagne
c9307ec6a3 Fix for [#32992] Switching language does nothing under Windows.
Our current intl build for windows is quite old (don't know the exact version), and does not have the new setlocale overwrite. Problem is, new windows dll have no more the gettext_putenv helper, which is currently mandatory to make it work for this OS.

So back for now to the ugly long_locales for win. Best fix is probably to build our own static version of libl, but this is not trivial and will require some time. :/

PS: I had a look over i18n/translation in wxWidget, Qt and boost: all implement their own system, even though wxWidget and boost use po/mo files...
2012-11-02 20:03:15 +00:00
Bastien Montagne
ec67334e25 A few more BMesh errors messages translated, and "automated" translation for modifers too! 2012-10-27 11:12:09 +00:00
Bastien Montagne
5d9d76e3f1 Finally fix the "double operators labels" in current po's: Operator sub-classes do not have custom "Operator" translation_context (while OperatorProperties subclasses do), so skip parsing the first!
Also refactored the "skip dummy messages like "1024" or ": %d", now using a regex!

All this removes about 160 doubles/unneeded messages!
2012-10-27 10:05:38 +00:00
Bastien Montagne
16ced60372 Fix Blender version retrieving... 2012-10-26 17:49:36 +00:00
Bastien Montagne
c9dade4fe0 Big i18n commit: add "reports" from bmesh/readfile/tracking/dynapaint (and a few others), and another bunch of UI messages tweaks/fixes, as well as some BKE_report()<->BKE_reportf()... 2012-10-26 17:32:50 +00:00
Bastien Montagne
7013931b14 Back to generating a pot file into trunk/po of i18n repo (it's useful for translators who want to start a new translation without be able to generate their own po!). 2012-10-26 13:15:14 +00:00
Bastien Montagne
d739536103 Back to "Espanol" (instead os "Castellano"), as it looks to be the standard for softwares... 2012-10-24 10:09:48 +00:00
Bastien Montagne
baa4fc68a8 Separate languages file generation code into its own script (much better this way, so that we can regenerate that file without update whole trunk!).
Also add es_ES (Spanish from Spain) language, as we have a po for it!
2012-10-23 20:39:26 +00:00
Bastien Montagne
40da6bb531 Update of the tools for the new "dynamic" i18n menu, to generate the languages file into locale dir... 2012-10-22 14:17:30 +00:00
Bastien Montagne
95a414955c Remove six languages from Blender UI (rational: very low level of translation, 1-2% at most, and no commit done in branch since more than one year): fi (Finnish), ca (Catalan), bg (Bulgarian), el (Greek), ne (Nepali) and pl (Polish).
Also fix compile in paranoid warning=errors mode for own last commit.
2012-10-20 08:52:54 +00:00
Sergey Sharybin
a75f11d036 Fix #32219: Inconsistent influence of Units Scale on new objects
Made it so meshes, curves, surfaces and metaballs are scaling to a grid cell size,
which makes them behave consistently now.

There're still issues to be resolved still:

- Lattice is not scaled to grid cell size yet, it uses slightly different add
  function which makes scaling a bit tricky and hacky. Would prefer to do a
  bit bigger refactor here, so it's a TODO for now.

- Cameras, speakers and other helpers are not scaling. They don't have data
  on which scale could be applied and perhaps it should be some kind of draw
  scale. Also would consider it's a TODO for now.
2012-10-19 12:53:03 +00:00
Bastien Montagne
b8267a0dfb More UI messages and BKE_reportf<->BKE_report fixes... 2012-10-18 16:25:58 +00:00
Bastien Montagne
45d6eb5dea Adding Estonian and Esperanto iso codes in allowed non-capitalized UI messages... 2012-10-15 17:52:09 +00:00
Bastien Montagne
7b8dc4be0d Few minor fixes to i18n tools (mostly use ordered dicts too for "xgettexted" messages...). 2012-10-14 14:18:30 +00:00
Bastien Montagne
3d6ab52f2b Add translation of reports messages (only direct uses of BKE_report(f)/BKE_reports_append(f) funcs for now). Already adds quite a bunch of new msgids! 2012-10-13 13:55:14 +00:00
Bastien Montagne
9f21b799c4 And more UI messages spell check. 2012-10-13 13:40:05 +00:00
Campbell Barton
ee67123748 code cleanup: minor edits on recent commit. 2012-10-13 11:23:04 +00:00