Commit Graph

5275 Commits

Author SHA1 Message Date
ffd0fee97c Cleanup: comment indentation & spelling 2019-02-11 10:51:25 +11:00
7262ac6202 Fix T61332: Python3 syntax errors 2019-02-09 13:10:34 +11:00
9df4602035 PyAPI: message subscribe option arg now optional 2019-02-07 09:36:52 +11:00
eef4077f18 Cleanup: remove redundant doxygen \file argument
Move \ingroup onto same line to be more compact and
make it clear the file is in the group.
2019-02-06 15:45:22 +11:00
40f2afcf1d Cleanup: remove contributors for Python files
Following removal from C source code.

See: 8c68ed6df1
2019-02-05 09:17:00 +11:00
ab5e69e660 Cleanup: remove contributors for CMake files
Following removal from C source code.

See: 8c68ed6df1
2019-02-05 09:10:32 +11:00
ff2dd59d4a PyAPI: use _PyObject_LookupAttr
Unlike PyObject_GetAttr, this avoids setting the attribute error
only to clear it - under some conditions.
2019-02-04 23:35:23 +11:00
7e358b6181 Python: bump minimum version to 3.7
All platforms use 3.7 now, supporting both increases chance some scripts
will fail on older versions.
2019-02-04 22:00:30 +11:00
744f633986 Cleanup: trailing commas
Needed for clan-format not to wrap onto one line.
2019-02-03 14:59:11 +11:00
141c6073ca WM: Event simulation support for Python
This feature is intended only for testing,
to automate simulating user input.

- Enabled by '--enable-event-simulate'.
- Disables handling all real input events.
- Access by calling `Window.event_simulate(..)`
- Disabling `bpy.app.use_event_simulate`
  to allow handling real events (can only disable).

Currently only mouse & keyboard events work well,
NDOF, IME... etc could be added as needed.

See D4286 for example usage.
2019-02-02 15:23:55 +11:00
afcbf7cf13 Cleanup: use G_FLAG_*/G_FILE_* for G.f/fileflags
Was confusing eg: G_AUTOPACK belonged to G.fileflags, G_PICKSEL to G.f.
2019-02-02 13:49:13 +11:00
6cbb4c576a Cleanup: manually remove header text not handled by automation 2019-02-02 01:49:31 +11:00
65ec7ec524 Cleanup: remove redundant, invalid info from headers
BF-admins agree to remove header information that isn't useful,
to reduce noise.

- BEGIN/END license blocks

  Developers should add non license comments as separate comment blocks.
  No need for separator text.

- Contributors

  This is often invalid, outdated or misleading
  especially when splitting files.

  It's more useful to git-blame to find out who has developed the code.

See P901 for script to perform these edits.
2019-02-02 01:36:28 +11:00
68cab3aff6 Cleanup: replace attrib w/ attr
Also rename GPUVertexAttribs to GPUVertAttrLayers,
avoids confusion with GPUVertAttr which isn't closely related.
2019-01-29 08:32:25 +11:00
c0f88ed8a8 Cleanup: sort forward declarations of enum & struct
Done using:
  source/tools/utils_maintenance/c_sort_blocks.py
2019-01-28 21:17:58 +11:00
f20dbc293f Cleanup: blank lines over doxy headers 2019-01-26 21:43:24 +11:00
1e4aab36c2 Cleanup: remove redundant BKE/BLI/BIF headers 2019-01-26 21:20:25 +11:00
2218bf02dd Cleanup: sort cmake file lists 2019-01-25 08:30:33 +11:00
7a353a7037 Fix T60350: Removed objects that are still in the outliner will crash Blender.
We need to force UI to fully redraw, BKE_id_delete & co won't do that
for us.
2019-01-24 17:45:09 +01:00
2e4f1b592f Cleanup: use eGPU prefix for GPU enum types 2019-01-23 14:16:03 +11:00
a93cbb70cd Fix T60643: BMesh operator enum args fail when unset from Python
Error introduced with bmesh operator enum support: 1e6a5eb087
2019-01-22 14:28:17 +11:00
8a61ea7296 Cleanup: add trailing commas
Prevents clang-format merging into a single line.
2019-01-19 13:58:35 +11:00
4c95899098 GPU: Rename GPU_shader_get_uniform to GPU_shader_get_uniform_ensure
This is in order to make the API more multithread friendly inside the
draw manager.

GPU_shader_get_uniform will only serve to query the shader interface and
not do any GL call, making it threadsafe.

For now it only print a warning if the uniform was not queried before.
2019-01-17 19:44:01 +01:00
dfb63653f4 PyAPI: minor change to bpy.app.debug_value exception handling
Use error from int conversion function.
2019-01-17 08:46:36 +11:00
9bfc9d799e PyAPI: Avoid redundant prefix for PyC_Err_Format_Prefix
Only show the exception value type when it's not a string.
2019-01-17 08:43:57 +11:00
debb68024e PyAPI: add PyC_Err_SetString_Prefix for internal use 2019-01-17 08:38:59 +11:00
8102200006 Cleanup/sanitize usages of G.debug_value.
There was no documentation at all, some very bad practices (like using
G.debug_value > 0 as some sort of global debug print switch), and even
an overlapping use of '1' value...

Also, python setter did not check for valid range (since this is a
short, not an int).
2019-01-16 19:43:53 +01:00
514e53bb80 Expose batch IDs deletion in python API.
Follow-up to previous commit.
2019-01-16 12:02:37 +01:00
6439ed844e Cleanup: remove tabs after line start
Allows expanding tabs before running clang-format.
2019-01-11 10:53:21 +11:00
0373ff5e9c Cleanup: end bgl macros w/ semicolon
Needed for clang-format.
2019-01-10 12:38:11 +11:00
0215caeac2 Cleanup: fix typo. 2019-01-07 14:30:45 +01:00
6015a03255 Cleanup: naming for return args 2019-01-07 15:34:16 +11:00
07287ceda1 Fix T58964: drivers_remove fails w/ missing paths 2019-01-07 15:27:59 +11:00
b4a77a351e Cleanup: add trailing commas to structs 2019-01-07 09:15:07 +11:00
9200dc0eb1 Cleanup: preprocessor indentation 2019-01-03 15:52:07 +11:00
72e2a0cfb6 Cleanup: py-gpu error checks
Move gpu initialization checks to the start of each function instead
of mixing with argument parsing.
2019-01-03 01:08:26 +11:00
d07bc44a96 Revert file rename from T59773 fix
Mixing file rename with other changes should be avoided.

Using 'module_py_api' convention here
is in keeping with imbuf, idprop, blf & bmesh.
No reason for gpu to have a different convention.
2019-01-03 00:55:07 +11:00
945007b32e Fix T59773: Raise exception if the gpu module is used in backgound mode.
Instead of crashing, an error message is displayed if a function of the gpu module is called without a GPU context.

Reviewers: brecht, campbellbarton, JacquesLucke, mont29

Subscribers: abdelmatinboulbayam, amir.shehata

Differential Revision: https://developer.blender.org/D4143
2019-01-02 10:01:46 -02:00
1a208f0326 Cleanup: indentation, naming
Use rna naming conventions for unit-settings callbacks.
2019-01-02 17:07:47 +11:00
09f46ef6fa PyRNA: enum no longer returns first item when the value isn't found
This hides errors & makes it confusing to debug mistakes
when the enum items aren't correct.

Return an empty string instead.
2019-01-02 16:39:45 +11:00
bcf0c71433 Cleanup: remove non-existing function declarations 2018-12-31 00:58:54 +11:00
b3e68a83f3 Fix T58734: bvhtree.fromObject - error ( returned NULL without setting an error) in blender 2.8.
Would free evaluated mesh even when it was the one cached in runtime
data by depsgraph evaluation!

Also fixes the asserts about using non-eval object in some cases.
2018-12-27 17:21:17 +01:00
63fcbfc3a7 RNA: naming, user-preferences -> preferences 2018-12-21 12:55:02 +11:00
5921656655 Merge branch 'master' into blender2.8 2018-12-20 12:24:37 +11:00
306bc5fd1a PyAPI: don't truncate enums in exception messages
Not necessary and confusing when only some of the items are displayed.

See: T59044
2018-12-20 12:20:34 +11:00
65bc931306 Cleanup: argument wrapping indentation 2018-12-20 08:03:48 +11:00
d46d8e831c Merge branch 'master' into blender2.8 2018-12-19 10:28:26 +11:00
5c3953010d Cleanup: spelling 2018-12-19 10:18:15 +11:00
2dee1772e1 Py Docs: documentation for draw_handler_add/remove 2018-12-18 12:31:37 +01:00
372fd07a8e Fix paste/append w/ local-view
Paste in local-view wasn't setting local-view bits.
2018-12-18 16:23:38 +11:00