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
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).
2020-09-07Cleanup: Clang Tidy, readability-inconsistent-declaration-parameter-nameSybren A. Stüvel
No functional changes.
2020-09-02UI: add back Layout.introspectCampbell Barton
Add back this function, removed 2e14b7fb9770b. Useful for checking operators used in menus.
2020-08-20Cleanup: use const variables where possible in the Python APICampbell Barton
2020-08-07Cleanup: Python, Clang-Tidy else-after-return fixesSybren A. Stüvel
This addresses warnings from Clang-Tidy's `readability-else-after-return` rule in the `source/blender/python` module. No functional changes.
2020-07-19Cleanup: spellingCampbell Barton
2020-06-23Cleanup: rename 'name' to 'filepath' for DNA typesCampbell Barton
Using 'name' for the full path of a file reads badly, especially when id.name is used in related code.
2020-05-29PyAPI: support static & class methods for C RNA API methodsCampbell Barton
Previously the static/class flag was ignored, always using class methods.
2020-05-14Cleanup: move assignment out of loopCampbell Barton
2020-05-13PyAPI: support PyGetSetDef when extending RNA typesCampbell Barton
Support extending properties as well as methods.
2020-05-13Cleanup: split RNA type extension methods into it's own APICampbell Barton
This isn't so closely related to the RNA API, it's a way to use the C/Python API to extend RNA types and can be in it's own file.
2020-04-03Cleanup: Rename ExtensionRNA variables from ext to rna_extJulian Eisel
Makes it more clear that code using this is related to the RNA integration of a type. Part of T74432. Also ran clang-format on affected files.
2020-03-25Cleanup: use 'r_' prefix for output argumentsCampbell Barton
Also pass some args as 'const'.
2020-03-19Cleanup/refactor: remove BKE_idcode, in favour of BKE_idtype.Bastien Montagne
Mpving utils from idcode to idtype proved to be somewhat painful for some reasons, but now all looks good. Had to add a fake/empty shell for the special snowflake too, `ID_LINK_PLACEHOLDER/INDEX_ID_NULL`...
2020-03-19Cleanup: `make format` after SortedIncludes changeDalai Felinto
2020-03-13Python: add foreach_get and foreach_set methods to pyrna_prop_arrayBogdan Nagirniak
This allows fast access to various arrays in the Python API. Most notably, `image.pixels` can be accessed much more efficiently now. **Benchmark** Below are the results of a benchmark that compares different ways to set/get all pixel values. I do the tests on 2048x2048 rgba images. The benchmark tests the following dimensions: - Byte vs. float per color channel - Python list vs. numpy array containing floats - `foreach_set` (new) vs. `image.pixels = ...` (old) ``` Pixel amount: 2048 * 2048 = 4.194.304 Byte buffer size: 16.8 mb Float buffer size: 67.1 mb Set pixel colors: byte - new - list: 271 ms byte - new - buffer: 29 ms byte - old - list: 350 ms byte - old - buffer: 2900 ms float - new - list: 249 ms float - new - buffer: 8 ms float - old - list: 330 ms float - old - buffer: 2880 ms Get pixel colors: byte - list: 128 ms byte - buffer: 9 ms float - list: 125 ms float - buffer: 8 ms ``` **Observations** The best set and get speed can be achieved with buffers and a float image, at the cost of higher memory consumption. Furthermore, using buffers when using `pixels = ...` is incredibly slow, because it is not optimized. Optimizing this is possible, but might not be trivial (there were multiple attempts afaik). Float images are faster due to overhead introduced by the api for byte images. If I profiled it correctly, a lot of time is spend in the `[0, 1] -> {0, ..., 255}` conversion. The functions doing that conversion is `unit_float_to_uchar_clamp`. While I have an idea on how it can be optimized, I do not know if it can be done without changing its functionality slightly. Performance wise the best solution would be to not do this conversion at all and accept byte input from the api user directly, but that seems to be a more involved task as well. Differential Revision: https://developer.blender.org/D7053 Reviewers: JacquesLucke, mont29
2020-03-11Cleanup: rename 'private' to 'embedded' for sub-data IDs.Bastien Montagne
'Private' can be a rather confusing term, especially when considering its meaning in programming languages. So now root node trees and master collections are 'embedded' IDs instead.
2020-02-20Cleanup: use named unsigned types in the Python APICampbell Barton
2019-12-20Cleanup: remove redundant 'char *' castsCampbell Barton
2019-11-28Fix (unreported) broken python resgistrable classes checks logic.Bastien Montagne
Logic for registering and checking properties of registrable classes was broken, allowing to ignore some errors. Recent fix rBeb798de101a `broke` the result of the pyapi_idprop_datablock test, because previously that test would fail (i.e. suceed, as it is an 'expected to break test') for a reason it was not designed to check. This is the problem with that kind of tests - you cannot really check that they are failing on the expected reason(s)...
2019-11-24Cleanup: doxygen commentsCampbell Barton
Also correct some outdated symbol references, add missing 'name' commands.
2019-11-20Cleanup: commentsCampbell Barton
2019-11-20Fix T71680: _PyObject_LookupAttr memory leakCampbell Barton
2019-10-16Cleanup: warnings building with Python 3.8Campbell Barton
2019-10-10Cleanup: clang-format, spellingCampbell Barton
2019-10-04Fix T70481: Segfault printing 'private data' evaluated IDs.Bastien Montagne
This commit solves the bug itself (code was broken when real_id owner of the private data ID could not be found), and generates a more sensible representation for all evaluated IDs, makes no sense to display them as being part of `bpy.data....`!
2019-09-30Cleanup: spellingCampbell Barton
2019-09-25Cleanup: remove override's 'static' references in some py API docs strings.Bastien Montagne
2019-09-06Python API: implement an Operator callback for dynamic description.Alexander Gavrilov
Blender UI Layout API allows supplying parameters to operators via button definitions. If an operator behavior strongly depends on its parameters, it may be difficult to write a tooltip that covers all of its operation modes. Thus it is useful to provide a way for the operator to produce different descriptions based on the input info. Reviewers: campbellbarton Differential Revision: https://developer.blender.org/D5709
2019-09-02Return proper RNA path in py console for 'private ID' data.Bastien Montagne
We can now generate a proper path here, make use of it. Note: not sure how property pyrna path is supposed to be accessed? code is similar to the struct pyrna path anyway...
2019-08-23RNA: Cleanup PointerRNA structJacques Lucke
The old layout of `PointerRNA` was confusing for historic reasons: ``` typedef struct PointerRNA { struct { void *data; } id; struct StructRNA *type; void *data; } PointerRNA; ``` This patch updates it to: ``` typedef struct PointerRNA { struct ID *owner_id; struct StructRNA *type; void *data; } PointerRNA; ``` Throughout the code base `id.data` was replaced with `owner_id`. Furthermore, many explicit pointer type casts were added which were implicit before. Some type casts to `ID *` were removed. Reviewers: brecht, campbellbarton Differential Revision: https://developer.blender.org/D5558
2019-08-16PyRNA: include class name in double-register exceptionCampbell Barton
Helps debugging errors when classes are registered twice.
2019-08-01Cleanup: misc spelling fixesCampbell Barton
T68035 by @luzpaz
2019-06-21Cleanup: spelling, grammar, and other correctionsCampbell Barton
D5084 by @nBurn with edits
2019-06-15Cleanup: Rename: Static Override -> Library Override.Bastien Montagne
Better to make internal code naming match official/UI naming to some extent, this will reduce confusion in the future. This is 'breaking' scripts and files that would use that feature, but since it is not yet officially supported nor exposed in 2.80, as far as that release is concerned, it is effectively a 'no functional changes' commit.
2019-05-31Cleanup: style, use braces in source/ (include disabled blocks)Campbell Barton
2019-05-20Cleanup: reorder report argument for pointer assignmentCampbell Barton
Most code uses ReportList argument last (or at least not first) when an optional report list can be passed in.
2019-05-17Python: Raise an error even NO_MAIN data is assigned to objectSergey Sharybin
The goal is to prevent assignment of temporary or evaluated meshes to objects from the main database. Majority of the change is actually related on passing reports around. On a positive side there are more error prints which can become more visible to scripters. There are still possible further improvements in the related areas. For example, disable user counting for evaluated ID datablocks when assignment happens. But can also happen later on as a separate improvement. Reviewers: brecht, campbellbarton, mont29 Reviewed By: brecht Differential Revision: https://developer.blender.org/D4884
2019-05-16Refactor: Simplify ID Property freeingJacques Lucke
This also makes `IDP_CopyProperty` the "opposite" of `IDP_FreeProperty`, which is what I'd expect. Two refactoring steps: * rename IDP_FreeProperty to IDP_FreePropertyContent * new IDP_FreeProperty function that actually frees the property Reviewers: brecht Differential Revision: https://developer.blender.org/D4872
2019-05-01ClangFormat: run with ReflowComments on source/Campbell Barton
Prepare for enabling ReflowComments.
2019-04-29Cleanup: comments (long lines) in pythonCampbell Barton
2019-04-23Cleanup: correct rst string literalsCampbell Barton
2019-04-23Space_node: Add draw backdrop callback.Ray Molenkamp
Add a callback to allow custom node editors to draw their own backdrop. Differential Revision: https://developer.blender.org/D4709 Reviewed by: JacquesLucke
2019-04-18Cleanup: comment blocksCampbell Barton
2019-04-17ClangFormat: format '#if 0' code in source/Campbell Barton
2019-04-17ClangFormat: apply to source, most of internCampbell Barton
Apply clang format as proposed in T53211. For details on usage and instructions for migrating branches without conflicts, see: https://wiki.blender.org/wiki/Tools/ClangFormat