Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-03-12Cleanup: remove workaround for MSVC PyTypeObject declarationsCampbell Barton
This is no longer needed for MSVC-2017.
2021-03-10Cleanup: unused warning building as a Python moduleCampbell Barton
2021-03-08PyAPI: add bpy.types.BlendFile.temp_data for temporary library loadingCampbell Barton
This adds support for creating a `BlendFile` (internally called `Main`), which is limited to a context. Temporary data can now be created which can then use `.libraries.load()` the same as with `bpy.data`. To prevent errors caused by mixing the temporary ID's with data in `bpy.data` they are tagged as temporary so they can't be assigned to properties, however they can be passed as arguments to functions. Reviewed By: mont29, sybren Ref D10612
2021-03-08readfile: add id_tag_extra argumentCampbell Barton
This allows adding ID tags when linking/loading data. This is needed to implement loading non 'G.main' ID data-blocks, see D10612.
2021-03-08Cleanup: rename offs to offscreenCampbell Barton
2021-03-06Cleanup: commentsCampbell Barton
2021-03-05Cleanup: Use boolean in WM_cursor_waitAntonio Vazquez
2021-03-04Cleanup: Main `foreach ID` code: Remove `MAX_LIBARRAY` and improve comments.Bastien Montagne
The `MAX_LIBARRAY` define was an annoying doublon to the `INDEX_ID_MAX` enum value now defined in `DNA_ID.h`, and it is no more useful. And comments were somewhat outdated. Also added an explanation about chosen order for the `INDEX_ID_<IDTYPE>` order.
2021-03-04PyAPI: use methods for bpy.data.libraries.load & writeCampbell Barton
Replace static methods with regular methods. Now the 'Main' value is taken from the collection. Needed to support multiple 'Main' instances in Python, see T86183.
2021-03-04PyAPI: support methods for collection propertiesCampbell Barton
Previously only static methods were supported. Now C/API functions added to collections can receive a 'self' argument.
2021-03-04Cleanup: use const arraysCampbell Barton
2021-03-04Cleanup: replace Py_CLEAR with Py_DECREF in bpy.app modulesCampbell Barton
In this case, there is no benefit to using Py_CLEAR as the value will never be NULL and can't be used later on.
2021-03-04Fix logic for calling PyObject_GC_UnTrackCampbell Barton
All tracked objects need a matching un-track, also remove redundant Py_XDECREF call.
2021-03-04PyAPI: correct garbage collection for StructRNA typesCampbell Barton
By default objects are no longer GC tracked, this removes some overhead although it's not significant in my own testing. - Only enable GC for StructRNA when 'WITH_PYTHON_SAFETY' is on. - Only track StructRNA when their 'reference' is set. - Add missing NULL check when 'WITH_PYTHON_SAFETY' is on and objects new objects be created.
2021-03-03Cleanup: minor changes to Python RNA pointer assignmentCampbell Barton
Don't assign the BPy_StructRNA a value which can be 'None', instead, set it to NULL.
2021-03-01GPU Python: Implement gpu.texture.from_imageGermano Cavalcante
It can be useful to replace `image.bindcode` and `image.gl_load`. Used for example in https://docs.blender.org/api/current/gpu.html#d-image Reviewed By: brecht Differential Revision: https://developer.blender.org/D10458
2021-02-25Py API: update `bpy.data.orphans_purge` to support new options.Bastien Montagne
This API function can now purge recursively in a single call, and choose to ignore (not purge) local or linked IDs. Default behavior (with not argument) remains unchanged, so no API breackage here.
2021-02-25PyAPI: expose imbuf.types.ImBuf, include in API docsCampbell Barton
Without this, the ImBuf type wasn't part of documentation.
2021-02-24Revert "t"Germano Cavalcante
This reverts commit d3a96e5022e121426c8926d0507effe4e9b4005f.
2021-02-24tGermano Cavalcante
2021-02-24PyAPI: Ensure GIL state only when a callback existsGermano Cavalcante
There are fewer python callbacks than `ARegionType`s. This also broke GTests's `bf_blenderloader_tests`.
2021-02-24PyAPI: Fix memory leak of parameters used for python 'draw_callbacks'Germano Cavalcante
When closing the blender, while the callbacks are removed, the reference count of the object used as `customdata` is not decremented. This commit adds two functions that correctly release the python `draw_callbacks` before releasing all `draw_callbacks`. Differential Revision: https://developer.blender.org/D10478
2021-02-24Cleanup: Move some utilities to 'gpu_py.h'Germano Cavalcante
2021-02-22PyAPI: expose unstable type bpy.props._PropertyDeferredCampbell Barton
Even though this might change, rigify, animation-nodes & translation extraction depend on being able to extract this information.
2021-02-22GPU Python: Use 'PyC_ParseStringEnum' to parse itemsGermano Cavalcante
Currently the GPU module for python has different ways to handle enums. - Organizing items in `PyC_StringEnumItems` arrays and parsing them with `PyC_ParseStringEnum`. - Using dedicated functions for each type of enum (`bpygpu_ParsePrimType`, `pygpu_ParseVertCompType` and `pygpu_ParseVertFetchMode`). Although apparently more efficient (especially `pygpu_ParseVertCompType` which transforms strings into integers for simple comparison), these dedicated functions duplicate functionality, increase the complexity of the code and consequently make it less readable. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D10456
2021-02-22Fix crash auto-completing bpy.types in the Python consoleCampbell Barton
Reference counting error in dc61a63e3f1bb3773677fb009fd787af7bd5c727
2021-02-22Fix missing NULL check on macOS when system-python isn't foundCampbell Barton
Regression from cafd6b519c5f5c4b67d0dfe3d453cd4223b38716. D10494 by @ysano with edits.
2021-02-21PyAPI: use postponed annotations to support Python 3.10Campbell Barton
Support Python 3.10a5 or 3.9x with support explicitly enabled. - Enable Python's postponed annotations for Blender's RNA classes types registered on startup. - Using postponed annotations has implications for how they are defined, since they must evaluate in the modules name-space instead of the classes name-space. See changes to annotations in `release/scripts`. - Use `from __future__ import annotations` at the top of the module to ensure the script will run with Python 3.10. - Old logic is kept since it could be used if PEP-649 is supported. Resolves T83626 Ref D10474
2021-02-21PyAPI: expose bpy_prop_deferred function & keywordsCampbell Barton
While not needed for Blender, Animation Nodes uses this information, expose this information for scripts to access that need it.
2021-02-20PyAPI: use a new type for storing the deferred result of bpy.propsCampbell Barton
This is needed to support Python 3.10's Postponed annotation evaluation. It also simplifies type checking.
2021-02-20Cleanup: spellingCampbell Barton
2021-02-20Cleanup: doxygen sectionsCampbell Barton
2021-02-19PyAPI: include all members in dir(bpy.types)Campbell Barton
C/Python defined types were accessible but not exposed in dir(bpy.types)
2021-02-19PyAPI: use real module for bpy.typesCampbell Barton
This is needed to support `typing.get_type_hints`, which expects each classes module to have a module '__dict__'.
2021-02-18Cleanup: Clang tidy else after returnHans Goudey
2021-02-18Cleanup: remove check for non-annotation properties in classesCampbell Barton
This was added to assist upgrading scripts to Blender 2.8x, now 2.9x is released there is no need to keep this block.
2021-02-18Cleanup: clang-formatCampbell Barton
2021-02-18Cleanup: order shape_len after shape argumentCampbell Barton
This matches nearly all other argument ordering in Blender, including Python mathutils API.
2021-02-18Cleanup: spelling, correct doc-string argumentsCampbell Barton
2021-02-18Cleanup: Python: naming mismatch in bvh.ray_cast.Jeroen Bakker
2021-02-17GPU Python: Rename 'uniform_buffer' to 'uniform_block'Germano Cavalcante
From the the opengl wiki: > Buffer objects are associated with a program's uniform block similarly to the way that texture objects are associated with sampler uniforms.
2021-02-17Cleanup: Abbreviate enums with 'UNSIGNED_' in the nameGermano Cavalcante
2021-02-17Python: gpu module: add new submodules and typesGermano Cavalcante
This commit extends the gpu python API with: ``` gpu.types.Buffer #"__init__", "to_list" gpu.types.GPUTexture #"__init__", "clear", "read", "format" gpu.types.GPUFrameBuffer #"__init__", "bind", "clear", "is_bound", "viewport", ("__enter__", "__exit__" with "GPUFrameBufferStackContext") gpu.types.GPUUniformBuf #"__init__", "update" gpu.state #"blend_set", "blend_get", "depth_test_set", "depth_test_get", "depth_mask_set", "depth_mask_get", "viewport_set", "viewport_get", "line_width_set", "line_width_get", "point_size_set", "color_mask_set", "face_culling_set", "front_facing_set", "program_point_size_set" ``` Add these methods to existing objects: ``` gpu.types.GPUShader #"uniform_sample", "uniform_buffer" ``` Maniphest Tasks: T80481 Differential Revision: https://developer.blender.org/D8826
2021-02-17Cleanup: Use 'pygpu_' prefix in the cpython GPU moduleGermano Cavalcante
`py_` prefix can be confused with the Python's own API's.
2021-02-13Fix T85573: Building with Python 3.10a5 failsCampbell Barton
Replace deprecated _PyUnicode_AsString{AndSize} usage. T83626 still needs to be resolved before 3.10 is usable.
2021-02-12PyAPI: Use PyPreConfig & PyConfig for Python initializationCampbell Barton
Use Python 3.8's API for setting the initial configuration. This replaces a mix of our logic and direct calls to the Python API and has no user visible changes. Using the Python API makes the logic easier to follow and provides utilities such as `PyConfig_SetBytesArgv` that wasn't available in previous releases. Note that this uses Python's utf8/wchar_t conversions, which used to cause problems (see T31506). Since `Py_UTF8Mode` was set, the systems locale isn't used for decoding, allowing us to use Python's utility functions that call `Py_DecodeLocale` internally. Ref D10382
2021-02-12PyAPI: use PyModule_AddType utility functionCampbell Barton
2021-02-12PyAPI: remove Python 3.7x compatibility codeCampbell Barton
This removes Python version checks needed to build with 3.8+ and 3.7x. Ref D10381
2021-02-11Cleanup: Python GPU: Use consistent prefixes for local APIGermano Cavalcante
It was not following the own documentation at the top code that mentions that for local API the prefix is "bpygpu_".
2021-02-10Merge branch 'blender-v2.92-release'Philipp Oeser