Commit Graph

629 Commits

Author SHA1 Message Date
58587a3881 replace strncpy with BLI_strncpy, in some cases strncpy was being misused since it doesnt ensure \0 termination.
also dont call CTX_data_scene() twice when checking for function arguments.
2011-09-26 18:51:10 +00:00
0bc5fef976 correct fix for armature selection, also remove international define from generic python C funcs. 2011-09-22 02:33:58 +00:00
280684c35d remove blf.gettext, add blf.unload(font) 2011-09-21 16:06:47 +00:00
f5bb22d088 have blf.gettext even when internationalization is disabled (just passes through). 2011-09-20 15:11:17 +00:00
bba54a051a i18n: fake_gettext is no longer needed for python 2011-09-20 08:38:16 +00:00
6d125e159d i18n: code clean-up
- Move all translation-related declarations to BLF_translation.h
- Reverted some changes to match trunk svn rev40365
2011-09-20 07:39:25 +00:00
0e421f429a modify the python gettext function to pass through the original string when no translation is done, this means the cached info such as byte representation and hash will be kept. 2011-09-20 02:25:57 +00:00
8dbc7a3ba3 Merging r40345 through r40365 from trunk into soc-2011-garlic 2011-09-19 15:47:05 +00:00
9478167493 remove Buffer.list, deprecated before 2.59 release. 2011-09-19 11:55:45 +00:00
0eda51f2ea Fixing issues with i18n stuff:
- Make gettext stuff draw-time. so switching between languages
  can happens without restart now.
- Added option to translate visible interface (menus, buttons, labels)
  and tooltips. Now it's possible to have english UI and localized tooltips.
- Clean-up sources, do not use gettext stuff for things which can be
  collected with RNA.
- Fix issues with windows 64bit and ru_RU locale on my desktop
  (it was codepage issue).
- Added operator "Get Messages" which generates new text block with
  with all strings collected from RNA.
- Changed script for updating blender.pot so now it appends
  messages collected from rna to automatically gathered messages.
  To update .pot you have to re-generate messages.txt using "Get Messages"
  operator and then run update_pot script.
- Clean up old translation stuff which wasn't used and most probably
  wouldn't be used.
- Return back "International Fonts" option, so if it's disabled, no
  gettext lookups happens on draw.
- Merged read_homefile function back. No need in splitting it.

TODO:
- Custom fonts and font size.
  Current font isn't nice at least for russian locale, it's
  difficult to read it.
- Put references to messages.txt so gettext can merge translation when
  name/description of some property changes.
2011-09-15 13:20:18 +00:00
30293dc2ca svn merge -r39834:40222 https://svn.blender.org/svnroot/bf-blender/trunk/blender 2011-09-15 13:02:37 +00:00
264c63ef03 New C/Py api utility function PyC_Err_Format_Prefix() which raises an error with the existing error as a suffix.
Use this to raise errors when assigning a string property fails even though the value to assign *is* a string.


Before:
  TypeError: bpy_struct: item.attr= val: Object.name expected a string type, not str


After:
  TypeError: bpy_struct: item.attr= val: Object.name error assigning string, UnicodeEncodeError('utf-8' codec can't encode character '\udce9' in position 23: surrogates not allowed)
2011-09-15 10:43:55 +00:00
5a900be4d6 attempt to have a threadsafe version of PyC_ExceptionBuffer didnt work with UI script errors, reverting r39886. 2011-09-08 02:14:24 +00:00
9161d3ce4b use Py_ssize_t rather than int when dealing with list sizes (original patch from Fedora but applied changes elsewhere too), also replace PyList_Size with PyList_GET_SIZE where typechecking is already done. 2011-09-06 23:46:20 +00:00
8cc307b4f2 PyC_ExceptionBuffer is now threadsafe, used for converting exceptions into reports. 2011-09-03 06:46:31 +00:00
Xiao Xiangquan
981f7fcd0d merge with trunk r39834 2011-09-01 15:08:32 +00:00
00143a3d55 spaces -> tabs (configure you're editors right!) 2011-09-01 01:48:50 +00:00
Xiao Xiangquan
5b91a783cf fix for windows locale setting 2011-08-31 07:31:02 +00:00
f8ec017900 floats were being promoted to doubles in quite a few cases (using gcc's -Wdouble-promotion), went over render module and use float constants, gives small but consistent speedup - approx 3%. 2011-08-20 17:39:13 +00:00
Xiao Xiangquan
3a8c7be9e4 code clear, insert blf_gettext.c to blf.c 2011-08-12 13:43:21 +00:00
Xiao Xiangquan
287b24926f merge with trunk r38787 2011-07-29 17:42:53 +00:00
35ce13562d script to report deprecated functions of text and their age in days. 2011-07-18 09:49:26 +00:00
7f850ff25d 'bgl' python module.
- add back slicing for buffers, (was previously in 2.4x but not working in py3):
  buf = bgl.Buffer(...)
  ls = buf[:]

- fix for crash with negative index access not being clamped.

- improve repr() function for multi dimensional buffers.

- add back 'list' attribute, but print deprecation warning.
2011-07-17 12:30:23 +00:00
5792bd7cc7 cmake: cleanup include paths, some duplicates and going up some unneeded dirs. 2011-07-17 09:11:13 +00:00
3a6158a8bf move mathutils into its own lib. 2011-07-15 04:01:47 +00:00
Xiao Xiangquan
fa46278e34 merge from trunk 38379 2011-07-14 17:29:53 +00:00
b028cba0e4 many mathutils exception types were wrong, went over all exceptions in mathutils and double checked the're correct. 2011-07-14 09:54:03 +00:00
Nathan Letwory
f70f167237 Shuffle code so it compiles with MSVC too. (Array of unknown size otherwise). 2011-07-14 08:20:19 +00:00
4da4943b5c formatting changes for python mathutils module. 2011-07-14 01:25:05 +00:00
0a46f9a737 rename bgl.Buffer attribute list to a method, to_list() as used for IDProps, also made repr function nicer. 2011-07-13 23:45:47 +00:00
aef6f15b49 minor changes to bgl.Buffer py class
- use getset rather then getattr
- remove verbose Buffer docstring, better use sphinx docs for this
- replace bge.Buffer with the Buffer class and add a __new__ function to the class so it can be called.
- improve error messages
2011-07-13 23:24:21 +00:00
d5984b2d50 fix [#27683] Blender hangs when baking a particle system when a driver is present 2011-07-09 17:41:39 +00:00
aa1668c6f8 fix for own error in intersect_line_sphere_2d(), using 3d function on 2d vectors 2011-07-04 08:13:27 +00:00
33e554799b Minor warning cleanup & fix
- comment/remove assignments from values to themselves.
- add case break statements (no functional change but some source code checkers notice).
- fix python errors when the sculpt brush is None.
2011-06-27 03:36:14 +00:00
31f0b6639a more compact code for recent sphere/line intersection functions. 2011-06-26 17:16:06 +00:00
933a65a76f 2d version of line/circle intersec function. 2011-06-26 11:08:12 +00:00
8eb119a5cd renamed math functions and made public
lambda_cp_line --> line_point_factor_v3
 lambda_cp_line2 --> line_point_factor_v2

correction to previous commit function name
 isect_seg_sphere_v3 --> isect_line_sphere_v3
 ... since its not clipped.

added a clip argument to the python version of the function.
2011-06-26 08:07:09 +00:00
540c2eee56 math func to find the intersection(s) between a segment and a sphere for C/python.
from python:
  i1, i2 = mathutils.geometry.intersect_line_sphere(l1, l2, sphere, radius)
2011-06-26 07:21:19 +00:00
Xiao Xiangquan
b429af10d0 merge from trunk #37722 2011-06-24 03:30:50 +00:00
ccc112a857 fix for error in swizzle assignment leaving an unhandled exception. 2011-06-21 02:15:07 +00:00
Xiao Xiangquan
9a2f36b50f handle SpaceType and UserPref popups 2011-06-20 10:07:46 +00:00
775ea4de92 fix for memory leak converting an idproperty group into a dict 2011-06-17 05:56:17 +00:00
7cbc4c0dd7 IDProperty python module update
- add support for IDProp array slicing, but not resizing.
- rename array attribute type to typecode and use chars 'f', 'd', 'i' which match pythons array module. (was using int's which only have a meaning internally).
- rename function 'convert_to_pyobject' to 'to_dict' and 'to_list' for IDProp group and array types respectively.
- remove 'len' array attribute, calling len(array) is fine.
2011-06-17 05:45:46 +00:00
Xiao Xiangquan
40981d872f merge from trunk r37405 2011-06-15 08:28:56 +00:00
d46da5a09d mathutils support for color arithmetic, also some minor whitespace edits. 2011-06-02 08:29:16 +00:00
09da9d4393 cmake maintenance
blender_add_lib now takes a separate include argument to suppress warnings in system includes (mostly ffmpeg & python).
also only build wm_apple.c on apple+carbon configuration.
2011-05-31 01:15:44 +00:00
Xiao Xiangquan
0fc21dde4e Add BLF_gettext(msgid) for C, and blf.gettext(msgid) for Python. 2011-05-30 11:03:16 +00:00
11014aa34b access pythons code object directly rather than attribute access. 2011-05-29 11:05:52 +00:00
9b5800bcd7 fixed "rather then" -> "rather than" typos all over the place 2011-05-28 13:11:24 +00:00
78d41d061b sphinx docstrng formatting (some lines were getting really long) 2011-05-26 19:13:01 +00:00