Campbell Barton
756d1502e4
Fix missing error returns in batch API
2018-10-31 11:55:28 +11:00
Germano Cavalcante
974d158f3f
PyAPI: GPU: improve GPUShader.from_builtin and GPUShader.code_from_builtin description.
2018-10-30 11:38:42 -03:00
Campbell Barton
f711c44b8d
PyAPI: Support for 'None' string args from Python
...
This is needed because some RNA functions differentiate a NULL 'char *'
argument from an empty string.
Previously a NULL argument could be passed when the C definition
defined the default as NULL and the argument wasn't passed
which is a fairly hidden way of handling things.
Now strings use `PROP_NEVER_NULL` by default
which can be cleared for function arguments that allow None -> NULL.
2018-10-30 16:17:46 +11:00
Campbell Barton
c750ebe113
PyAPI: remove GPUVertFormat() creation from a list
...
We already have `attr_add` method,
best not have two ways to do the same thing.
See: D3830
2018-10-29 11:08:55 +11:00
Brecht Van Lommel
41a284212a
Cleanup: fix compiler warnings.
2018-10-28 17:46:51 +01:00
Campbell Barton
065d19e223
Fix parsing single int for uniform_int
...
This worked for float but not int.
2018-10-26 11:59:49 +11:00
Campbell Barton
6c86e1a781
PyAPI: draw handlers now store args in the capsule context
...
Was using the handlers custom-data which crashes
when Blender frees the screen data before Python removes the handler.
2018-10-26 09:30:17 +11:00
Campbell Barton
35991d9990
PyAPI: Temp workaround for crash removing cursor
...
Opening a new file frees the cursors,
add check if the cursor is still valid.
This leaks a Python reference, so a better solution is needed.
2018-10-26 08:49:10 +11:00
Campbell Barton
1d8ba9d618
PyAPI: Make GPUVertFormat() argument optional
2018-10-26 08:06:05 +11:00
Campbell Barton
6ed9fcbabc
PyAPI: rename GPL VertBuf.attr_fill identifier to id
...
This is used elsewhere in the API and its a common abbreviation.
2018-10-25 20:34:23 +11:00
Campbell Barton
1a827e0564
Cleanup: move params into their own struct
2018-10-25 17:20:26 +11:00
Campbell Barton
ce08b07a89
PyAPI: take paint-cursor space/region type args
2018-10-25 16:27:13 +11:00
Campbell Barton
6d49b623e2
WM: space, region type filtering for paint cursor
...
Avoids calling poll on mouse-move for unrelated space/region types.
2018-10-25 16:06:47 +11:00
Campbell Barton
46587b3ccb
PyAPI: support for Python paint cursors
2018-10-25 15:31:02 +11:00
Jacques Lucke
341306995b
Fix: buffer overflow when creating gpu.types.GPUIndexBuf
2018-10-24 10:57:46 +02:00
Campbell Barton
0589368615
GPUShader: shader.uniform_float, matrix parsing
...
Add checks to parse 3x3 or 4x4 matrices,
also use error from `mathutils_array_parse` instead of overwriting.
2018-10-24 18:47:36 +11:00
Campbell Barton
c8ab88fb89
Partially revert "GPUShader: shader.uniform_float parameters"
...
`mathutils_array_parse` is meant to parse 1d arrays of numbers.
Using matrices internal memory layout is confusing since
mathutils matrices are exposed as row major.
Also, the matrix shape wasn't checked for.
Callers that want to handle matrices should check for them explicitly.
2018-10-24 18:47:36 +11:00
Jacques Lucke
fc3d771801
GPUShader: shader.uniform_float parameters
...
Allow to pass in single numbers, sequences and mathutils.* types into `shader.uniform_float`.
Reviewers: mano-wii
Differential Revision: https://developer.blender.org/D3820
2018-10-23 10:19:08 +02:00
Campbell Barton
e5182fa101
Cleanup: rename VertBuf.fill_attribute > attr_fill
2018-10-23 10:50:48 +11:00
Sergey Sharybin
0628fe7a6c
Followup to previous change, reduce number of relations updates
...
Only tag relations update when new f-curve was allocated. This solves
possible too slow keyframe insertion when doing character animation,
but still does proper relation update when new ID component became
animated.
2018-10-22 17:13:19 +02:00
Jacques Lucke
59054d5eba
Python API: fix docstrings
2018-10-22 15:01:25 +02:00
Jacques Lucke
c49142dafe
API Docs: remove 'level' from blf.color arguments
...
Reviewers: brecht
Differential Revision: https://developer.blender.org/D3819
2018-10-22 14:55:18 +02:00
Bastien Montagne
fbf4c11960
Make Static Override optional/hidden by default.
...
That feature will not be ready (or at least, not tested enough) to be
officially part of 2.80 beta. So we disable it by default, hidding it
behind a startup option (`--enable-static-override`), and a python
app var (`bpy.app.use_static_override`).
That way, people who really want to play with it can do it easily, while
not exposing/enabling non-production-ready feature by default.
Note that underlying override code remains active, i.e. files we do have
overridden data-blocks will be loaded correctly according to static override.
2018-10-19 18:38:19 +02:00
Bastien Montagne
d31ea3b89a
Merge branch 'master' into blender2.8
...
Conflicts:
source/blender/blenkernel/BKE_global.h
source/blender/editors/undo/ed_undo.c
2018-10-17 16:50:36 +02:00
Bastien Montagne
496c325ffa
Expose 'debug_io' flag in bpy.app
2018-10-17 16:42:36 +02:00
Germano Cavalcante
e333765d3e
Python GPU: Best description for exceptions
2018-10-12 15:48:55 -03:00
Campbell Barton
66738d4aa0
Merge branch 'master' into blender2.8
2018-10-11 09:08:30 +11:00
Campbell Barton
2083a7e274
Cleanup: style (pointers)
2018-10-11 09:03:39 +11:00
Germano Cavalcante
d29f98e3f2
Python GPU: Use PyC_AsArray_FAST in GPUVertBuf.fill_attribute.
...
This allows you to use other types of sequences besides tuples.
2018-10-10 13:39:03 -03:00
Germano Cavalcante
5e88d103f7
Python GPU: Use PyC_AsArray_FAST when initing GPUIndexBuff.
...
This allows you to use other types of sequences besides tuples.
2018-10-10 13:39:02 -03:00
Brecht Van Lommel
e65784a051
Python API: add loop triangles access, remove tessfaces.
...
Loop triangles are tessellated triangles create from polygons, for renderers
or exporters that need to match Blender's polygon tesselation exactly. These
are a read-only runtime cache.
Tessfaces are a legacy data structure from before Blender supported n-gons,
and were already mostly removed from the C code.
Details on porting code to loop triangles is in the release notes.
Differential Revision: https://developer.blender.org/D3539
2018-10-10 17:43:44 +02:00
Germano Cavalcante
b0b547bd1e
Python GPU: Update shader.from_builtin and shader.code_from_builtin description.
2018-10-09 12:18:28 -03:00
Germano Cavalcante
8fc8131bc9
GPU Python: Use string literals in shader.from_builtin and shader.code_from_builtin.
...
Also, the gpu.shader.builtin submodule becomes obsolete, so it has been removed.
2018-10-09 12:07:06 -03:00
Jacques Lucke
9560fe60e4
Python API: new GPUShader.format_calc() method
...
Reviewers: mano-wii, fclem, campbellbarton
Differential Revision: https://developer.blender.org/D3772
2018-10-09 11:17:29 +02:00
Germano Cavalcante
cf03658adb
Fix misuse of Py_INCREF in module creation.
...
Differential Revision: https://developer.blender.org/D3697
2018-10-08 20:01:55 -03:00
Campbell Barton
d592eb510e
Cleanup: naming
2018-10-09 09:25:33 +11:00
Campbell Barton
d022794cad
Cleanup: rename checks for Python struct strings
...
Using 'format' prefix made this read as if t was for string formatting.
Use 'PyC_StructFmt' prefix instead since these values are compatible
with formatting from Python's 'struct' module.
2018-10-08 08:37:32 +11:00
Germano Cavalcante
1fd1735df0
CPython: use format char utilities in idprop_py_api
2018-10-07 12:24:47 -03:00
Germano Cavalcante
af7967b010
CPython: py_capi_utils: format char utilities do not need to be inline.
2018-10-07 12:22:17 -03:00
Germano Cavalcante
91bfea5b05
CPython: py_capi_utils: use more descriptive names for format string utilities.
2018-10-07 12:21:09 -03:00
Campbell Barton
ee2e30683c
Cleanup: style
2018-10-07 17:49:22 +11:00
Germano Cavalcante
495a7128cb
Cleanup: use the naming convention in py_capi_utils
...
And use inline functions instead of preprocessor directives.
2018-10-06 01:15:15 -03:00
Germano Cavalcante
0f55334413
Cleanup: use new format string utility
2018-10-06 00:13:54 -03:00
Germano Cavalcante
98e62d459a
py_capi_utils: add utilities for format string in struct module style syntax.
2018-10-06 00:13:40 -03:00
Germano Cavalcante
9bd65528e3
GPU Python: optionally init the vertexformat in the vertexbuffer itself.
2018-10-05 17:22:03 -03:00
Germano Cavalcante
550fee8eb6
GPU Python: use _PyArg_ParseTupleAndKeywordsFast.
2018-10-05 14:38:35 -03:00
Germano Cavalcante
eab00bf202
GPU Python: fix crash when calling batch.draw without passing a shader.
2018-10-05 11:55:17 -03:00
Jacques Lucke
564d37c4b6
Python API: new GPUVertFormat constructor and vbo.fill_attribute method
...
Reviewer: fclem
Differential Revision: https://developer.blender.org/D3760
2018-10-05 15:10:56 +02:00
Germano Cavalcante
c15439bcdc
Cleanup: use PyModule_AddIntConstant
2018-10-04 23:53:57 -03:00
Germano Cavalcante
ee6c8be183
GPU Python: rename methods "shader_from_builtin" and "shader_code_from_builtin" to "from_builtin" and "code_from_builtin".
2018-10-04 13:51:21 -03:00