Commit Graph

807 Commits

Author SHA1 Message Date
Campbell Barton a2c0a382cd Merge branch 'master' into blender2.8 2018-04-03 14:19:51 +02:00
Campbell Barton 31f2a6755d PyAPI: Add PyC_Tuple_Pack_F64 utility 2018-04-02 19:48:34 +02:00
Campbell Barton 89fdd88906 Merge branch 'master' into blender2.8 2018-04-02 15:18:10 +02:00
Campbell Barton 017c731cf3 Logging: use for Python API
Adds categories "bpy.context" & "bpy.rna"
2018-04-02 13:13:57 +02:00
Campbell Barton f89563a806 Merge branch 'master' into blender2.8 2017-11-29 13:44:59 +11:00
Campbell Barton 0b325ba201 PyAPI: PyC_Err_PrintWithFunc utility function
Move function error printing utility into py_capi_utils.
2017-11-29 13:41:10 +11:00
Antonis Ryakiotakis 4db67aab06 Fix OpenGL extension report in system info operator. 2017-10-23 22:22:22 +03:00
Campbell Barton 54f9a6e5da Merge branch 'master' into blender2.8 2017-10-18 16:40:31 +11:00
Germano Cavalcante 0a435d49ba Fix T53074: Use the pybuffer->itemsize to get the corresponding GLtype
It seems that `typestr` does not always define the final size of the element. And it varies by operating system.

Then use the `typestr` only to know the itemtype is `float` type or not.
2017-10-17 12:06:52 -02:00
Campbell Barton ea606a7847 Merge branch 'master' into blender28 2017-10-06 21:25:33 +11:00
Campbell Barton c454d816a9 Cleanup: style 2017-10-06 16:56:41 +11:00
Sergey Sharybin 63c472b4f9 Merge branch 'master' into blender2.8 2017-10-04 22:18:05 +05:00
Campbell Barton 08f728a3e9 Cleanup: redundant casts 2017-10-04 16:52:55 +11:00
Campbell Barton 92272f56e6 PyAPI: fast keyword parsing for __import__
No functional changes.
2017-10-04 15:54:41 +11:00
Sergey Sharybin 7fdb9e168d Merge branch 'master' into blender2.8 2017-09-28 16:13:09 +05:00
Campbell Barton 1f18523edf Cleanup: switch fall-through warning 2017-09-28 13:41:54 +10:00
Germano Cavalcante 5c6e3ff497 bgl module: extend gl_buffer_type_from_py_format_char function to work with more string formats
Only basic types of character codes were being used
2017-09-27 16:07:06 -03:00
Campbell Barton cc8c064f11 Merge branch 'master' into blender2.8 2017-09-28 03:05:46 +10:00
Campbell Barton 6c98859b77 Cleanup: warning 2017-09-28 02:04:58 +10:00
Germano Cavalcante 2de5e14f53 bgl module: Interpret a buffer as a bgl.Buffer
Differential Revision: https://developer.blender.org/D2857
2017-09-27 11:20:00 -03:00
Sergey Sharybin af170839af Merge branch 'master' into blender2.8 2017-09-19 21:08:14 +05:00
Campbell Barton 60956397ca Cleanup: BLI_utildefines prefix for header-only libs
This allows to have different macro headers without them sharing
similar names to regular C modules.
2017-09-19 20:16:05 +10:00
Campbell Barton cb4884f50b Merge branch 'master' into blender2.8 2017-08-23 20:16:47 +10:00
Campbell Barton b9513706cb Cleanup: mark VA_NARGS_COUNT as public
Was already used in two other headers, remove underscore prefix.
2017-08-23 20:16:17 +10:00
Campbell Barton 37cfa44222 Cleanup: move variadic defines to their own header
So we can use in headers without pulling in many other defines.
2017-08-23 20:16:17 +10:00
Campbell Barton 917d069cdb Merge branch 'master' into blender2.8 2017-08-23 19:21:52 +10:00
Campbell Barton 55861cb234 PyAPI: avoid instantiating args twice in macro
Would cause problems if args included function calls.
2017-08-23 18:48:32 +10:00
Campbell Barton bd935b5aed Merge branch 'master' into blender2.8 2017-08-22 18:21:05 +10:00
Campbell Barton 691ed21842 PyAPI: replace PyC_FromArray with typed functions
This was meant to be generic but introduced possible type errors
and unnecessary complication.
Replace with typed PyC_Tuple_PackArray_* functions.

Also add PyC_Tuple_Pack_* macro which replaces some uses of
Py_BuildValue, with the advantage of not having to parse a string.
2017-08-22 18:10:57 +10:00
Brecht Van Lommel 81a76469ca Fix for recent fix in fc890cd, cstdint is c++11 only so don't use it yet. 2017-08-21 19:05:17 +02:00
Campbell Barton 2530ae6c74 Merge branch 'master' into blender2.8 2017-08-20 21:22:00 +10:00
Campbell Barton e27a59d411 Replace BLI_INLINE w/ Py_LOCAL_INLINE for Python
Recent inclusion caused build error with the BGE.
2017-08-20 21:14:33 +10:00
Campbell Barton 7497488149 Merge branch 'master' into blender2.8 2017-08-20 15:50:15 +10:00
Campbell Barton 46cf33bf01 PyAPI: Make use of PyC_LongAs... API
Avoids setting exceptions inline,
also use Matrix_ParseAny for bmesh.ops.

Some inline exceptions are kept because they show useful details.
2017-08-20 15:49:10 +10:00
Campbell Barton a10a7f42de PyAPI: Integer conversion functions
Python's C-API doesn't provide functions to get
int's at specific integer sizes.

Leaving the caller to check for overflow,
which ended up being ignored in practice.

Add API functions that convert int/uint 8/16/32/64, also bool.
Raising overflow exception for unsupported ranges.
2017-08-20 15:39:08 +10:00
Campbell Barton 193d7d6333 Merge branch 'master' into blender2.8 2017-07-17 13:21:05 +10:00
Campbell Barton 3d1e5bca88 PyAPI: don't use deprecated PyModule_GetFilename
Allows compiling with newer Python versions.
Also add missing decref when compiling as a py-module.
2017-07-17 12:53:55 +10:00
Dalai Felinto e5bf726f44 BGL: Remove deprecated enums
Note: The enums that are deprecated and supported are still there
2017-04-18 16:02:17 +02:00
Alexander Romanov 6f268ac55d Merge branch 'master' into blender2.8 2017-04-13 13:02:39 +03:00
Alexander Romanov a7b3047cef Datablock ID Properties
The absence of datablock properties "will certainly be resolved soon as the need for them is becoming obvious" said the [[http://wiki.blender.org/index.php/Dev:Ref/Release_Notes/2.67/Python_Nodes|Python Nodes release notes]]. So this patch allows Python scripts to create ID Properties which reference datablocks.
This functionality is implemented for `PointerProperty` and now such properties can be created with Python.

In addition to the standard update callback, `PointerProperty` can have a `poll` callback (standard RNA) which is useful for search menus. For details see the test included in this patch.

Original author: @artfunkel

Alexander (Blend4Web Team)

Reviewers: brecht, artfunkel, mont29, campbellbarton

Reviewed By: mont29, campbellbarton

Subscribers: jta, sergey, campbellbarton, wisaac, poseidon4o, mont29, homyachetser, Evgeny_Rodygin, AlexKowel, yurikovelenov, fjuhec, sharlybg, cardboard, duarteframos, blueprintrandom, a.romanov, BYOB, disnel, aditiapratama, bliblubli, dfelinto, lukastoenne

Maniphest Tasks: T37754

Differential Revision: https://developer.blender.org/D113
2017-04-13 12:33:05 +03:00
Bastien Montagne 346964eb3f Merge branch 'master' into blender2.8
Conflicts:
	source/blender/editors/gpencil/drawgpencil.c
2017-04-10 16:53:12 +02:00
Jacques Lucke 73a9ff0d2d PyAPI: Fast buffer access to id property arrays
Support Python's buffer protocol for ID-properties.
2017-04-10 21:12:02 +10:00
Campbell Barton 3f818c7898 Merge branch 'master' into blender2.8 2017-03-20 09:32:40 +11:00
Campbell Barton e392bb4937 PyAPI: add BPY_execute_string_as_string
Utility to execute a string and get the resulting string,
matching BPY_execute_string_as_number.

Not used just yet but generally useful function.
2017-03-18 12:19:03 +11:00
Campbell Barton d863b5182e Cleanup: use return args last and 'r_' prefix. 2017-03-18 09:39:36 +11:00
Mike Erwin b4157dedb0 OpenGL: remove packed imm mode functions from Python API
These are from the ARB_vertex_type_2_10_10_10_rev extension that became part of OpenGL 3.3.

So they are new, but only exist for compatibility with immediate mode, which is old.

Related to T49165 (general OpenGL upgrade)
2017-03-13 14:08:03 -04:00
Mike Erwin 0e40f1bac4 OpenGL: remove GLU functions from Python API
Part of T49042
2017-03-13 14:08:03 -04:00
Campbell Barton c1f43c9dc6 Cleanup: warnings 2017-03-02 00:36:33 +11:00
Brecht Van Lommel e9011100f7 Fix compiler warnings on macOS / clang / c++11. 2017-02-26 00:16:21 +01:00
Martijn Berger 5cbc7b6ed2 bgl do not bind parts of OpenGL that are not exposed in core profiles 2016-11-19 15:07:01 +01:00