Commit Graph

3408 Commits

Author SHA1 Message Date
87cd81b162 - added docs and examples for bpy.app.handlers
- correct error in own last commit for BKE_screen_find_big_area()
2011-11-04 04:27:46 +00:00
665f602f15 python string conversion
- use _PyUnicode_AsStringAndSize where possible
- use %R for PyErr_Format(...) rather then running repr on the object explicitly 
- use const char
2011-11-03 14:09:18 +00:00
dff93ddecc hopefully fix msvc build error 2011-11-03 12:01:18 +00:00
5eef937436 modify previous api feature to tag functions as permanent, use nicer decorator style, eg:
# --------

import bpy
from bpy.app.handlers import persistent

@persistent
def my_func(scene):
    pass

bpy.app.handlers.frame_change_pre.append(my_func)
2011-11-03 09:13:47 +00:00
e2393d1109 ability to have permanent callbacks that stay active when new blend files are loaded.
this works by tagging functions, eg:

  def my_func(scene):
      pass

  bpy.app.handlers.permanent_tag(my_func, True)  # <-- important bit
  bpy.app.handlers.frame_change_pre.append(my_func)
2011-11-03 06:53:52 +00:00
723e129252 Depsgraph/Python: callbacks and properties to detect datablock changes
* Adds two new python handlers: scene_update_pre() and scene_update_post()
  These run before and after Blender does a scene update on making modifications
  to the scene.
* Datablocks now have an is_updated property. This will be set to true in the
  above callbacks if the datablock was tagged to be updated. This works for the
  most common datablocks used for rendering: object, material, world, lamsp,
  texture, mesh, curve.
* Datablock collections also have an is_updated property. If this is set, it
  means one datablock of this type was added, removed or modified. It's also
  useful as a quick check to avoid looping over all datablocks.
* RenderEngine.view_update() can also check these properties, for interactive
  viewport rendering.

http://wiki.blender.org/index.php/Dev:2.6/Source/Render/UpdateAPI
2011-11-02 20:56:52 +00:00
e29aa363f2 new math function: Quaternion.to_axis_angle().
add in safety checks for inf/nan values which could happen in some cases.
2011-11-02 09:13:04 +00:00
32b34d631a Space types:
* Some cleanup, removed references to already deleted *_header.c files.
* Marked SpaceScript as deprecated and removed header. Will keep space for now though, as some script operators are there and Campbell might want to re-use the space later.
2011-11-01 20:14:58 +00:00
ea2f7c907c == Removal of SpaceSound ==
* Removed old, unused Space Sound space
* Removed data struct and Theme settings
* Old files with an open Audio window will be loaded as Info Space
2011-11-01 19:48:45 +00:00
785de4cbfc == Cleanup of SpaceImasel ==
* removed struct for SpaceType and all usages
* SPACE_IMASEL in enum nees to be kept to identify it in old files
* it is replaces with SPACE_EMPTY on load, which is overridden by SPACE_INFO which has same struct members
* also removed theme settings
2011-11-01 18:27:09 +00:00
797d2bbd88 use_verify option to defvert_sync_mapped and defvert_sync was flipped, also minor edits to defvert_verify_index() - no functional change. 2011-10-31 06:13:20 +00:00
9905094f5d fix own error r41191 getting id property string lengths. 2011-10-31 01:50:04 +00:00
0d63bb005f replace VECCOPY and QUATCOPY with inline funcs. 2011-10-28 12:40:15 +00:00
565fcd8907 fix for error in gpu.export_shader() was missing *4 (only writing 1/4 of the colorband) 2011-10-28 08:53:00 +00:00
4b635d1631 use generic path remapping when making all library data local, previously only image paths were getting corrected, now all paths will (scene image seq strips, pointcache etc) 2011-10-28 04:44:59 +00:00
699030ceb6 use const for readonly strings and set some functions to static 2011-10-27 14:41:26 +00:00
31d401613d bpath
- loop over all sequence images and pointcache
- option not to loop over library / packed data, expose in bpy.utils.blend_paths()
2011-10-27 03:40:12 +00:00
cd852ce1a1 - remove bpath iterator and replace all uses with visitor.
- added flag to optionally receive all paths as absolute.
2011-10-27 01:25:07 +00:00
82c84f4b58 Remove some more $Id$ that still were left after r41227 and r41228. 2011-10-23 19:01:59 +00:00
6105199668 Remove the svn:keywords property. 2011-10-23 18:38:16 +00:00
4a04f72069 remove $Id: tags after discussion on the mailign list: http://markmail.org/message/fp7ozcywxum3ar7n 2011-10-23 17:52:20 +00:00
f5b37d40ca set pythons 'sys.stdout' encoding to utf-8 and use surrogateescape error handler.
without this printing a unicode string may raise an error which is a real pain especially since script authors often forget this and print the path of a file for example on export which can make a script fail outright when writing to paths with certain encodings.
2011-10-23 07:51:21 +00:00
e417e011d5 Code cleanup: file operations merged into single header, some function names
made less cryptic and changed to indicate if they work on files or directories.
2011-10-22 15:35:49 +00:00
ebe63b664b py api - added PyC_UnicodeFromByteAndSize() to match PyUnicode_FromStringAndSize()
also made RNA_property_string_get_alloc() return the length of the new string to avoid having to run strlen on it after.
2011-10-22 10:49:35 +00:00
00735ed9e4 Code cleanup: don't use btempdir/bprogdir/bprogname globals anymore, but wrap
in BLI_ functions.
2011-10-21 17:37:38 +00:00
874c96a2b9 Cleaning i18n code.
Previous state:
Right now, there are "memories" of the "old" (less than a month!) translation way:
* A few remaining calls to BLF_gettext() (only UI_translate_do_iface and UI_translate_do_tooltip should be used).
* The _() macro still also calls BLF_gettext()!

New state:
Here are the changes made by the patch:
* Removing the no more needed _() macro.
* Removing most N_() and _() calls, only keeping the few needed ones (i.e. strings that are in no other way findable by xgettext and/or update_msg script).
* Defining in UI_interface.h IFACE_() and TIP_() macros (resp. for UI_translate_do_iface and UI_translate_do_tooltip).
* Replacing all calls to BLF_gettext by relevant IFACE_ or TIP_ one.
* Replacing all calls to UI_translate_do_iface by IFACE_.
* Replacing all calls to UI_translate_do_tooltip by TIP_.

All this somewhat clarifies and simplifies the code.
On the bf-translations scripts side, this only implies adding IFACE_ and TIP_ as detection markers for xgettext.
It also allows to reduce POTFILES.in quite notably (only 20 files remaining in it).

Please also have a look at those pages:
* Coder POV: http://wiki.blender.org/index.php/Dev:2.5/Source/Interface/Internationalization
* Translator POV: http://wiki.blender.org/index.php/Dev:2.5/Doc/How_to/Translate_Blender
2011-10-20 20:38:26 +00:00
2bd9519e39 BLI_ghash.h was including BLI_blenlib.h, remove from ghash header and include in each file 2011-10-20 13:50:24 +00:00
8d6a554d75 - add BLI_string_utf8.h for unicode functions.
- move font.c unicode functions into string_utf8.c and rename to fit with other BLI_string funcs.
2011-10-20 09:47:05 +00:00
445279524a debug build option WITH_PYTHON_UI_INFO, so you can right click and edit the python source for UI layout directly. 2011-10-20 00:48:00 +00:00
61389bba41 fix spelling mistakes in comments (and in some python error messages), nothing to effect translations. 2011-10-17 06:39:13 +00:00
67c15da97d docs / clenup (no functional code changes)
- added API examples for mathutils.Color/Euler/Quaternion/Matrix.
- corrected own bad spelling matricies --> matrices.
- minor pep8 edits.
- update CMake ignore file list.
2011-10-17 02:20:53 +00:00
7f4bb1f71b spelling corrections in comments and quiet warning 2011-10-15 14:14:22 +00:00
fa3b4e1830 correct collada lib linking order (wasnt building for me), and sphinx doc syntax warning. 2011-10-13 14:10:38 +00:00
fa033e313e correct some invalid exception types. 2011-10-13 01:51:45 +00:00
276e5f7095 formatting edits & remove debug print. 2011-10-13 01:29:08 +00:00
6955c47fac bpy/rna new property attribute 'data', this means its possible to get back the rna-struct which a property uses.
Without this you cant get the bone from an fcurve data path for example, needed to fix bug [#28889].
2011-10-13 00:52:09 +00:00
93e4de7552 fix for py/rna assigning an invalid index. also give better error message in this case. 2011-10-11 05:45:59 +00:00
70cd4b77bb edit error macro formatting (confuses some editors) 2011-10-10 07:10:53 +00:00
bdd7c2d3f4 fix documentation error - [#28862] Method 'difference' doesn't exist in Quaternion object. 2011-10-10 01:14:49 +00:00
e60a7fbc57 correction to RNA class api references (only used for docs) 2011-10-09 02:24:51 +00:00
ee8078fb12 fix for BUILTIN_KSI_WholeCharacter keying custom string/collection/group properties 2011-10-09 02:11:43 +00:00
21eb8b92a0 use newly added ID_BLEND_PATH() in more places. 2011-10-08 11:11:54 +00:00
c27926896f spaces -> tabs (whitespace only changes) 2011-10-06 22:04:01 +00:00
9d13224e1a fix [#28807] Drivers breaking by undo 2011-10-05 07:28:59 +00:00
f7737153e6 filter RNA classes for translation (removes over 1300 lines from messages.txt)
- omit operators tagged as INTERNAL
- omit classes  for internal use: Event, Context, Property, Function, Window.
2011-10-05 03:39:22 +00:00
3b8de8db31 rename rna OperatorTypeMacro --> OperatorMacro, since operators types are just called Operator 2011-10-05 00:19:33 +00:00
acac22f3f2 enable cmake building makesdna with ghash 2011-10-02 12:34:41 +00:00
a1d647e92c remove some redundant checks and compiler warnings. 2011-10-02 12:21:24 +00:00
9a88524f68 support for object data material assignment in python
eg:
 bpy.context.object.data.materials[0] = bpy.data.materials["SomeMaterial"]
2011-10-01 17:54:33 +00:00
975c4e7177 fix for msvc, I thought this was only needed for mingw. 2011-10-01 15:54:36 +00:00