Campbell Barton
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
Campbell Barton
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
Campbell Barton
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
Campbell Barton
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
Campbell Barton
a59ba9a519
- turn RNA_warning into a macro which includes the function name (was being written in manually but had incorrect func names in places).
...
- add __func__ define to BLI_utildefines.h for MSVC.
2011-09-09 01:29:53 +00:00
Campbell Barton
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
Campbell Barton
0cd5dce245
whitespace edits
2011-09-03 02:15:49 +00:00
Campbell Barton
a8e49cd55a
use a fixed 32byte buffer for getting an rna string from python. gives a slight speedup when drawing heavy UI's
2011-09-01 09:47:21 +00:00
Brecht Van Lommel
b3704f45c4
Fixes for snprintf usage:
...
* replace by BLI_snprintf in various places, note _snprintf on windows
does not properly null terminate the string.
* fix overflow in sequencer proxy code due to buffer being smaller than
specified size.
* fix some usage of snprintf as strcpy, this is will go wrong if the
string contains % characters.
* remove BLI_dynstr_printf function in gpu module, use BLI_dynstr_appendf
2011-08-30 10:07:50 +00:00
Campbell Barton
a9dea3afe9
correct missing bpy doc references.
2011-08-26 18:48:48 +00:00
Campbell Barton
291ae8822d
executing operators that changed the context from the console wasnt returning an operator set/flag.
2011-08-25 17:59:37 +00:00
Campbell Barton
9436769cd4
error when a python operator gave an incorrect return value was near useless, re-raise a more comprehensive error which includes the operator name.
2011-08-25 17:54:30 +00:00
Campbell Barton
166970f68e
bpy-rna - simplify enum string/set parsing.
2011-08-25 17:01:33 +00:00
Campbell Barton
82e622f158
fix [ #28356 ] Import export STL files, problem in script in version r39307
...
& correct some bad comments.
2011-08-24 14:22:41 +00:00
Campbell Barton
a937729f38
properly escape chars for pythons bpy objects __repr__
2011-08-22 18:13:37 +00:00
Campbell Barton
2c1182664c
minor speedup to python/rna api keyword argument lookups.
...
- dont use hash lookups in this case because converting the string to unicode and doing a hash lookup is slower then looping over the keys and comparing (which avoids creating and throwning away a unicode string).
2011-08-19 10:38:34 +00:00
Campbell Barton
561b49e925
minor style change
2011-08-19 10:35:47 +00:00
Campbell Barton
2bd016fe3f
formatting edits, no functional changes.
2011-08-18 12:20:10 +00:00
Campbell Barton
540f0c64b5
add in asserts for when array/non array RNA funcions are used incorrectly, would have made previous fix a lot easier to find.
...
also remove unused argument from RNA_property_array_check.
2011-08-14 10:28:18 +00:00
Campbell Barton
3a82a690ab
ifdef out support for for python owning and freeing BPy_StructRNA because this is only used for doc generation and it makes _every_ blender/python instance 4 bytes bigger - vertex/bezier point/object/scene/group etc.
2011-08-05 16:29:38 +00:00
Campbell Barton
85fe36ab61
pyrna - add own callable function type rather then using a standard python method, gives small speedup drawing buttons since every layout.prop/col/operator/menu etc creates and throws away one of these.
2011-08-05 16:21:37 +00:00
Campbell Barton
f4293067c1
py api: sphinx doc corrections, pep8 cleanup and style edits, also added __all__ to some modules which were missing it.
2011-07-31 03:15:37 +00:00
Campbell Barton
d163ce5595
bpy fix for crash/assert on running dir() on a non collection property + some other minor corrections.
2011-07-30 13:18:04 +00:00
Campbell Barton
35ce13562d
script to report deprecated functions of text and their age in days.
2011-07-18 09:49:26 +00:00
Campbell Barton
3a6158a8bf
move mathutils into its own lib.
2011-07-15 04:01:47 +00:00
Campbell Barton
7370ba1839
fix for NULL pointer usages
2011-07-09 19:59:32 +00:00
Campbell Barton
d33b63c5d8
update cmake checker to ignore file list and add some headers to the source list.
2011-06-21 17:00:34 +00:00
Campbell Barton
a50aa13fac
py api: make all classes __init__ functions in a readonly state, except for operators.
...
In bug [#27701 ], the panels __init__ function (which runs on every draw), was adding new rna properties.
2011-06-21 08:09:42 +00:00
Campbell Barton
82216030e9
py-api: store frequently used strings as unicode PyObject's to avoid creating/distroying every time.
...
also fix for cmake warning
2011-06-18 08:45:45 +00:00
Campbell Barton
1356082063
fix [ #27681 ] Python: crash assigning a 'set' to an array
2011-06-17 02:22:38 +00:00
Campbell Barton
e44ae2c2a9
disable the readonly state while rna property callbacks run.
2011-06-07 16:08:49 +00:00
Campbell Barton
d46da5a09d
mathutils support for color arithmetic, also some minor whitespace edits.
2011-06-02 08:29:16 +00:00
Campbell Barton
11014aa34b
access pythons code object directly rather than attribute access.
2011-05-29 11:05:52 +00:00
M.G. Kishalmi
9b5800bcd7
fixed "rather then" -> "rather than" typos all over the place
2011-05-28 13:11:24 +00:00
Campbell Barton
78d41d061b
sphinx docstrng formatting (some lines were getting really long)
2011-05-26 19:13:01 +00:00
Campbell Barton
15289c6048
use PyDoc_STRVAR macro, so its possible to build without docstrings.
2011-05-24 16:05:51 +00:00
Brecht Van Lommel
66f51ba5d1
RNA: make mechanism used by operators to keep python instance alive more generic, to be used by render engine later.
2011-05-18 11:21:10 +00:00
Brecht Van Lommel
178ba76b09
RNA: pass Main rather than Context to register/unregister callbacks.
2011-05-18 10:56:26 +00:00
Campbell Barton
ba5d18b41f
py/rna debugging option (defaults to off), which quickly exposes errors with RNA functions holding string pointers by making a temp copy of the string and freeing after the function is called.
2011-05-06 03:29:55 +00:00
Campbell Barton
f86565c90e
whitespace edits for bpy api, split some really long lines.
2011-04-30 13:58:31 +00:00
Campbell Barton
f9f771cd01
converted more mixed tab/space indentations to tabs. only whitespace changes.
2011-04-21 15:53:30 +00:00
Campbell Barton
6bb626f253
minor changes
...
- remove some warnings
- fix typos
- cmake allow in-source build (when WITH_IN_SOURCE_BUILD is defined)
- cmake, use an explicit list of rna files (don't glob)
2011-04-21 05:49:47 +00:00
Campbell Barton
70cd0803ab
add new subtype PROP_COORDS, for generic coordinates that are not to be changed by units.
2011-04-08 13:32:56 +00:00
Campbell Barton
6b3f5ecd18
change to fcurve keyframe coords broke simplify addon since the property
...
was no longer wrapped by python as a vector. now fixed size float arrays
with PROP_NONE subtype are wrapped as vectors since its convenient to
have x/y access.
2011-04-08 01:40:54 +00:00
Martin Poirier
371a7b477d
Fix register method order. Was broken when Campbell moved it to the C implementation.
...
register has to be called AFTER the type is registered while unregister has to be called BEFORE it's unregistered.
2011-04-02 14:58:58 +00:00
Campbell Barton
66a1259153
fix for crash when running blender with define WITH_PYTHON_SAFETY & no startup.blend was found.
...
was calling python function when python was not initialized.
2011-03-31 04:43:26 +00:00
Campbell Barton
bf1e2ce41e
color gamma (such as theme colors), were not being wrapped by python as 'mathutils.Color' types
2011-03-28 13:47:39 +00:00
Campbell Barton
587bbc4213
fix [ #26616 ] Line of code make Blender crash
2011-03-27 06:56:37 +00:00
Campbell Barton
f87b37b3ef
allow unregistered rna classes to have rna properties assigned before registration.
...
this is useful for the register() class method which is called before the class gets structRNA assigned.
eg:
class MyClass(bpy.types.PropertyGroup):
@classmethod
def register(cls):
cls.name = StringProperty() # assigned but registration is delayed.
2011-03-23 12:44:22 +00:00
Campbell Barton
1b80538fea
fix [ #25688 ] undocumted functions in pyapi
...
expose collection function docs.
2011-03-22 04:28:51 +00:00