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-07-23PyDocs: Fix syntax errors resulting in warningsAaron Carlisle
2021-07-20Cleanup: use '#if 0' for disabling multiple linesCampbell Barton
2021-07-15Cleanup: replace BLI_assert(!"text") with BLI_assert_msg(0, "text")Campbell Barton
This shows the text as part of the assertion message.
2021-07-14Python API: Add functions to ensure and clear IDPropertiesHans Goudey
This adds id_properties_clear() and id_properties_ensure() functions to RNA structs. This is meant as an initial change based on discussion in review of D9697. However, they may be useful in other situations. The change requires refactoring the internal idproperties callback to return a pointer to the IDProperty pointer, which actually turns out to be quite a nice cleanup. An id_properties attribute could be added in the future potentially. Differential Revision: https://developer.blender.org/D11908
2021-07-03Cleanup: consistent use of tags: NOTE/TODO/FIXME/XXXCampbell Barton
Also use doxy style function reference `#` prefix chars when referencing identifiers.
2021-06-26Cleanup: full sentences in comments, improve comment formattingCampbell Barton
2021-06-24Cleanup: comment blocks, trailing space in commentsCampbell Barton
2021-06-22Cleanup: Spelling MistakesLeon Zandman
This patch fixes many minor spelling mistakes, all in comments or console output. Mostly contractions like can't, won't, don't, its/it's, etc. Differential Revision: https://developer.blender.org/D11663 Reviewed by Harley Acheson
2021-05-14PyAPI: use iterators for ID property methods (keys, values & items)Campbell Barton
- Matches changes in Python 3.x dictionary methods. - Iterating now raises a run-time error if the property-group changes size during iteration. - IDPropertyGroup.iteritems() has been removed. - IDPropertyGroup View & Iterator types have been added. - Some set functionality from dict_keys/values/items aren't yet supported (isdisjoint method and boolean set style operations). Proposed as part of T85675.
2021-05-14Fix memory leak in IDPropertyGroup.pop()Campbell Barton
When popping ID-property groups/arrays, ID-property was removed but not freed. Now the value is converted to a native Python type and freed.
2021-04-23Fix T86765: Custom properties are included in `__dir__`Campbell Barton
Remove custom properties from `__dir__` method result since these can't be accessed using `__getattr__`. Introduced in the 2.5x Python API update.
2021-03-30Python: clarify error message when accessing datablock by librarySybren A. Stüvel
When using `bpy.data.actions[action_name, "nonexistant-library"]`, use the term `filepath` instead of `name` in the error message. Also increase the size to match the file path length. Ref D10253
2021-03-24Cleanup: use new BLI_assert_unreachable macroCampbell Barton
2021-03-12Cleanup: remove workaround for MSVC PyTypeObject declarationsCampbell Barton
This is no longer needed for MSVC-2017.
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-06Cleanup: commentsCampbell Barton
2021-03-05Cleanup: Use boolean in WM_cursor_waitAntonio Vazquez
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-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-02-22Fix crash auto-completing bpy.types in the Python consoleCampbell Barton
Reference counting error in dc61a63e3f1bb3773677fb009fd787af7bd5c727
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-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-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: 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-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: 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-05Cleanup: correct spelling in commentsCampbell Barton
2021-01-20Cleanup: remove extra in trailing asteriskCampbell Barton
Comment blocks not conforming to convention.
2020-11-19Cleanup: Grammar: "Allow to" vs gerund missed in last commitHans Goudey
2020-11-11Cleanup: clang-formatCampbell Barton
2020-11-11Cleanup: use preprocessor version check for PyTypeObject declarationCampbell Barton
While `tp_print` was deprecated, Python 3.8+ uses this for 'tp_vectorcall_offset' which wasn't stated in the comment from efd71aad4f22ec0073d80b8dd296015d3f395aa8. Instead of suppressing clang-tidy, use preprocessor a check since this properly represents the difference between Python versions.
2020-11-06Merge remote-tracking branch 'origin/blender-v2.91-release'Dalai Felinto
2020-11-06Fix T82457: Python error when clicking on a tool in the viewportDalai Felinto
Ths variable was initialized for false, while it was expected to be true.
2020-11-06Cleanup: use ELEM macroCampbell Barton
2020-11-04PyAPI: add Struct.is_property_set(..., ghost) optionCampbell Barton
This exposes the use_ghost argument to RNA_property_is_set_ex.
2020-10-19Spelling: Then Versus ThanHarley Acheson
Corrects incorrect usages of the words 'then' and 'than'. Differential Revision: https://developer.blender.org/D9246 Reviewed by Campbell Barton
2020-10-19Spelling: It's Versus ItsHarley Acheson
Corrects incorrect usage of contraction for 'it is', when possessive 'its' was required. Differential Revision: https://developer.blender.org/D9250 Reviewed by Campbell Barton
2020-10-15Cleanup: rename BPy_GetContext -> BPY_context_getCampbell Barton
Matching BPY_context_set.
2020-10-15Cleanup: remove duplicate context variable (__py_context)Campbell Barton
The context was stored both in __py_context & bpy_context_module. This avoids duplicate functions to update them too.
2020-10-14Cleanup: reduce indentation level in bpy_class_validate_recursiveCampbell Barton
2020-10-14Fix crash starting Blender with Python 3.9Campbell Barton
In 3.8 and older the class held a reference to methods, this is no longer the case in 3.9.
2020-10-10Cleanup: use C comments for descriptive textCampbell Barton
Follow our code style guide by using C-comments for text descriptions.
2020-10-02Cleanup: Use enum for return values in context callbacksSybren A. Stüvel
Define enum `eContextResult` and use its values for returns, instead of just returning 1, 0, or -1 (and always having some comment that explains what -1 means). This also cleans up the mixup between returning `0` and `false`, and `1` and `true`. An inconsistency was discovered during this cleanup, and marked with `TODO(sybren)`. It's not fixed here, as it would consititute a functional change. The enum isn't used everywhere, as enums in C and C++ can have different storage sizes. To prevent issues, callback functions are still declared as returning`int`. To at least make things easier to understand for humans, I marked those with `int /*eContextResult*/`. This is a followup of D9090, and is intended to unify how context callbacks return values. This will make it easier to extend the approach in D9090 to those functions. No functional changes. Differential Revision: https://developer.blender.org/D9095
2020-09-29API Docs: Correct syntax for bpy.utils.register_classAaron Carlisle
2020-09-29API Docs: Use raises field list syntaxAaron Carlisle
See https://www.sphinx-doc.org/en/master/usage/restructuredtext/domains.html#info-field-lists
2020-09-19Cleanup: consistent TODO/FIXME formatting for namesCampbell Barton
Following the most widely used convention for including todo's in the code, that is: `TODO(name):`, `FIXME(name)` ... etc.
2020-09-13Fix printing data from an evaluated depsgraph in PythonCampbell Barton
Printing an evaluated view layer would show: Evaluated Scene 'Scene' - Now __repr__ uses the __str__ fallback for evaluated data, as done in other situations where we can't create a string that would evaluate to the data. - __str__ now shows when the data is evaluated. - __str__ always includes the memory address (which was previously only shown for structs without a name).