Commit Graph

519 Commits

Author SHA1 Message Date
38f546a614 swap arg order for BM_edge_split(), makes sense to have edge as first
arg.
2012-02-23 05:17:07 +00:00
1f40f01435 correct exception - was using a TypeError when should be a ValueError. 2012-02-22 09:13:29 +00:00
4acab3eb33 Code Cleanup: line length and use Py_ssize_t for PyC_AsArray utility function. 2012-02-05 02:04:26 +00:00
697e77a494 fix [#29666] Duplicate entries in bpy.types
Python operator subclasses and operator types each get their own SRNA, causing double ups for bpy.types.__dir__()

From the operator type - these share names.
* ot->ext.srna
* ot->srna

Note that this conflict is still there, this only disables 'ot->ext.srna' from being included in dir(bpy.types).
2012-02-02 04:43:35 +00:00
57ad3b85d8 fix [#27589] Random crash with python UI
This script was defining an operator within the panels draw function, while its possible to support this its really asking for trouble.

the fix is to raise an error when this happens.

also fix crash passing non classes to register_class/unregister_class
2012-01-18 19:50:44 +00:00
8c9c018c90 note on compating RNA pointers and compare RNA types for RNA-Properties too. 2012-01-15 12:35:40 +00:00
0f34ce27cf fix for error comparing py-struct members
if 2 pyrna structs used the same pointer they could incorrectly compare as true, this caused an error in theme saving because an item could match its parent and stop writing (to prevent recursive writing of same data).

eg:
  context.user_preferences.themes[0].user_interface.wcol_regular == context.user_preferences.themes[0].user_interface
2012-01-13 11:36:32 +00:00
02560d748f add RNA_property_is_set function, use for WM_menu_invoke to avoid double lookup and py api to de-duplicate some checks 2012-01-11 16:48:22 +00:00
f66f33cefc rename RNA_property_is_set() --> RNA_struct_property_is_set() in preperation to add a second version of the function which takes the property rather then its name. 2012-01-11 16:32:12 +00:00
e039a631a9 add bpy collection method .find(key), so you can get the index of an item in a collection, -1 if not found.
use this to replace bge text ui py function.
2012-01-05 06:05:45 +00:00
4f0b7e8c6a py - fix for error which made enums not through errors when assigned non string types 2011-12-29 14:46:26 +00:00
e17fd46c71 formatting edits only to use more consisted style 2011-12-26 12:26:11 +00:00
a8ed803b66 rename internal matrix struct member vars to avoid confusion
Matrix.contigPtr --> matrix
Matrix.row_size --> num_col
Matrix.col_size --> num_row
2011-12-20 04:11:23 +00:00
9c9099a805 formatting edits in py api, no functional changes 2011-12-18 08:50:06 +00:00
3167a9a899 add library support for rna collection __contains__, eg
("Cube", "//lib.blend") in bpy.data.objects
2011-12-03 06:10:32 +00:00
Dalai Felinto
1936b31cd0 renaming BooleanProperty to BoolProperty (rna structs shouldnt affect scripters)
Talked with Brecht and Campbell and they both agreed that bpy.types should match bpy.props
In the ideal world we would rename bpy.props to BooleanProperty. This would break scripts though. So we go for a compromise and at least have some consistency.
2011-12-01 22:08:42 +00:00
d52a811052 minor bpy api edits
- strict check for rna properties
- formatting edits (120 line width)
- use PyDoc_STRVAR macros for getset docstrings
2011-11-26 15:18:30 +00:00
491526e5ed add null check, crashes py 3.3 which isn't released but adding the check is harmless 2011-11-26 02:33:57 +00:00
3b9b6051d9 rename mathutils constructors to match other parts of the bpy/api (no functional changes) 2011-11-24 04:45:36 +00:00
92ed90d2fa pyapi feature from 2.4x
allow collection subscript to contain the library or None.

eg:

  bpy.data.objects["Mesh", "/subsurf_test.blend"]

  bpy.data.scenes["Scene", None]

  # also works with get()
  bpy.data.armatures.get(("some_armature", "//some_lib.blend"), None)
2011-11-17 08:47:34 +00:00
6a340c1eb0 py/rna api was calling RNA_property_type more often then needed (no functional change) 2011-11-15 11:56:54 +00:00
4de917326b de-duplicate some idproperty py api code, also improve some exception messages. 2011-11-15 10:19:44 +00:00
d4d80ee0a1 rename IDProp.c/h to idprop_py_api, since it was same name as BKE idprop.c with case changed. 2011-11-15 09:28:15 +00:00
d6c1009195 bytestring support for py/rna - this is so py can access data which
isn't meant to be accessed as unicode text.
2011-11-15 07:09:41 +00:00
e4269043b4 Moving i18n code to BLF_translation.h
This way, we will be able to use it in non-UI parts of the code too.
2011-11-09 14:13:17 +00:00
2b939904ab documentation - brief descriptions for bpy api files. 2011-11-05 08:21:12 +00:00
62f2218554 macro formatting & remve some unused code. 2011-11-05 05:44:52 +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
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
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
61389bba41 fix spelling mistakes in comments (and in some python error messages), nothing to effect translations. 2011-10-17 06:39:13 +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
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
9d13224e1a fix [#28807] Drivers breaking by undo 2011-10-05 07:28:59 +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
7b398f271e fix for mingw 2011-10-01 15:02:55 +00:00
bfbfe16570 take 2 at fixing the crash... 2011-09-29 09:29:46 +00:00
e5078f196f Attempt to fix error reported by yafaray devs from my commit r40660 2011-09-29 09:19:15 +00:00
b88776ba5a fix for crash with demo mode addon, modal operator loading a blend file would free all window data which was then accessed, causing a crash. 2011-09-28 15:42:55 +00:00
018fa1540e whitespace edits, make formatting for functions consustent at least within the file. 2011-09-28 05:53:40 +00:00
928e2784c6 py api
- use Py_ssize_t when dealing with python sequence sizes
- dont call PySequence_Size(py_b) in a loop (its slow).
- use faster sequence/float parsing in aud.Factory.filter
2011-09-27 05:28:06 +00:00
573ed73be8 change define INTERNATIONAL --> WITH_INTERNATIONAL
also rename backface_culling --> use_backface_culling (which is used elsewhere in rna)
2011-09-26 10:35:47 +00:00
943a026c60 py/rna string subtypes for strings which should be automatically translated:
layout.prop("blah", text="Translate Me!")
2011-09-21 13:53:35 +00:00