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
2022-04-04Cleanup: ensure space after file named in headersCampbell Barton
Add blank lines after file references to avoid them being interpreted as doc-strings the following declarations.
2022-03-28Cleanup: return success from python_script_error_jumpCampbell Barton
Relying on checks for the assignment of return arguments isn't so clear especially when there are multiple return arguments.
2022-03-28Python: select the start-end range of syntax errorsCampbell Barton
Python 3.10's syntax errors can specify a range. Use this for text editor error selection.
2022-03-28Cleanup: variable/argument naming for Python exception accessCampbell Barton
Names filename/filepath/fn were used interchangeably.
2022-03-28Fix text editor failure to move the cursor for syntax errorsCampbell Barton
This broke between 3.0 and 3.1, upgrading to Python 3.10 seems the likely cause as this code didn't change.
2022-03-28Cleanup: early exit when there is no exceptionCampbell Barton
Reduces noise in D9752, no functional change as PyErr_NormalizeException doesn't do anything when there is no exception set.
2022-03-28Cleanup: use "num" as a suffix in: source/blender/pythonCampbell Barton
See T85728
2022-03-25ImBuf: Add support for WebP image formatAaron Carlisle
Currently only supports single image frames (no animation possible). If quality slider is set to 100 then lossless compression will be used, otherwise lossy compression is used. Gives about 35% reduction of filesize save when re-saving splash screens with lossless compression. Also saves much faster, up to 15x faster than PNG with a better compression ratio as a plus. Note, this is currently left disabled until we have WebP libs (see T95206) For testing precompiled libs can be downloaded from Google: https://storage.googleapis.com/downloads.webmproject.org/releases/webp/index.html Differential Revision: https://developer.blender.org/D1598
2022-03-23Cleanup: use ifdef to disable enum string allocationCampbell Barton
Restore variable removed in [0], using an ifdef to avoid the warning. [0]: c3ecfdf40b02f7d12775f1ded2f039d40f1470bb
2022-03-18Cleanup: Compilation warningsSergey Sharybin
Mainly -Wset-but-unused-variable. Makes default compilation on macOS way less noisy. Differential Revision: https://developer.blender.org/D14357
2022-03-15Cleanup: comments in bpy_driver.c, minor correctionsCampbell Barton
2022-03-15Cleanup: de-duplicate Py_DECREF when evaluating PyDriversCampbell Barton
2022-03-15Fix memory leak when there is an error evaluating a PyDriverCampbell Barton
In practice users are unlikely to ever run into this error.
2022-03-14Auto-generate RNA-structs declarations in `RNA_prototypes.h`Julian Eisel
So far it was needed to declare a new RNA struct to `RNA_access.h` manually. Since 9b298cf3dbec we generate a `RNA_prototypes.h` for RNA property declarations. Now this also includes the RNA struct declarations, so they don't have to be added manually anymore. Differential Revision: https://developer.blender.org/D13862 Reviewed by: brecht, campbellbarton
2022-03-14RNA: Generate property declerations header, solving msg-bus C++ incompatibilityJulian Eisel
Lets `makesrna` generate a `RNA_prototypes.h` header with declarations for all RNA properties. This can be included in regular source files when needing to reference RNA properties statically. This solves an issue on MSVC with adding such declarations in functions, like we used to do. See 800fc1736748. Removes any such declarations and the related FIXME comments. Reviewed By: campbellbarton, LazyDodo, brecht Differential Revision: https://developer.blender.org/D13837
2022-03-14Cleanup: use size_t for BLF text API functionsCampbell Barton
Also minor cleanup to txt_sel_to_buf: - Use memcpy instead of strncpy as the strings don't contain nil bytes. - Replace while loops with for loops.
2022-03-11Fix out of order event handling when calling operators from gizmosCampbell Barton
Activating a gizmo used the windows eventstate which may have values newer than the event used to activate the gizmo. This meant transforms check for the key that activated transform could be incorrect. Support passing an event when calling operators to avoid this problem.
2022-03-11Correct error in 1032f111d087e7ba77c16a4af78704019714bd6aCampbell Barton
Thanks to Jacques Lucke for spotting.
2022-03-11Text: use simplified logic for txt_to_bufCampbell Barton
This function was copied from txt_sel_to_buf, including unnecessary complexity to support selection as well as checks for the cursor which don't make sense when copying the whole buffer. Use a simple loop to copy all text into the destination buffer.
2022-03-11RNA: support functions returning allocated stringsCampbell Barton
Now it's possible for a C/RNA function to return a dynamic string, The PROP_NEVER_NULL flag is also supported so a NULL string returns None in Python.
2022-03-11Cleanup: remove unused variableCampbell Barton
2022-03-10Cleanup: spelling in comments & some minor clarificationsCampbell Barton
2022-03-08PyAPI: optimize depsgraph use in PyDriversCampbell Barton
Avoid re-creating & freeing the depsgraph for every driver evaluation. Now the depsgraph is kept in the name-space (matching self), only re-created when the value changes. In a contrived test-case with many drivers this gave ~15% overall speedup for animation playback.
2022-03-08Fix memory leak evaluating PyDriversCampbell Barton
Missed decref in 686ab4c9401a90b22fb17e46c992eb513fe4f693 caused every driver evaluation to create the BPy_StructRNA depsgraph without freeing the previously allocated depsgraph.
2022-03-08Cleanup: spelling in comments, use C++ comments for disabled codeCampbell Barton
2022-03-07Python: Add new `annotation_pre` & `annotation_post` handlersAntonio Vazquez
Annotation tool is used as a general mark tool for many add-ons. To be able to detect when an annotation is done is very handy to integrate the annotation tool in add-ons and other studio workflows. The new callback names are: `annotation_pre` and `annotation_post` Both callbacks are exposed via the Python module `bpy.app.handlers` Example use: ``` import bpy def annotation_starts(gpd): print("Annotation starts") def annotation_done(gpd): print("Annotation done") bpy.app.handlers.annotation_pre.clear() bpy.app.handlers.annotation_pre.append(annotation_starts) bpy.app.handlers.annotation_post.clear() bpy.app.handlers.annotation_post.append(annotation_done) ``` Note: The handlers are called for any annotation tool, including eraser. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D14221
2022-02-22Merge branch 'blender-v3.1-release'Campbell Barton
2022-02-22Python: bump minimum version to 3.10Campbell Barton
Since Python 3.10 is now supported on all platform, bump the minimum version to reduce the number of Python versions that need to be supported simultaneously. Reviewed By: LazyDodo, sybren, mont29, brecht Ref D13943
2022-02-15RNA: add RNA_collection_is_empty & RNA_property_collection_is_emptyCampbell Barton
Some collections needed to be iterated over to count their length. Provide a function to check if the collection is empty to avoid this.
2022-02-15Cleanup: minor changes to Python argument parsing loopCampbell Barton
- Increment the argument index at the end of the loop. Otherwise using the index after incrementing required subtracting 1. - Move error prefix creation into a function: `pyrna_func_error_prefix` so it's possible to create an error prefix without duplicate code. This simplifies further changes for argument parsing from D14047.
2022-02-11File headers: SPDX License migrationCampbell Barton
Use a shorter/simpler license convention, stops the header taking so much space. Follow the SPDX license specification: https://spdx.org/licenses - C/C++/objc/objc++ - Python - Shell Scripts - CMake, GNUmakefile While most of the source tree has been included - `./extern/` was left out. - `./intern/cycles` & `./intern/atomic` are also excluded because they use different header conventions. doc/license/SPDX-license-identifiers.txt has been added to list SPDX all used identifiers. See P2788 for the script that automated these edits. Reviewed By: brecht, mont29, sergey Ref D14069
2022-02-09Cleanup: make file headers more consistentCampbell Barton
Also some descriptive text into doc-strings.
2022-02-04Remove internal proxy code, and deprecate related DNA data.Bastien Montagne
Part of T91671. Not much else to say, this is mainly a massive deletion of code. Note that a few cleanups possible after this proxy removal were kept out of this commit to try to reduce a bit its size. Reviewed By: sergey, brecht Maniphest Tasks: T91671 Differential Revision: https://developer.blender.org/D13995
2022-01-25Fix: Build issue with MSVC + Python 3.10Ray Molenkamp
ssize_t is a posix type pyconfig.h previously supplied for MSVC, it appears to have stopped doing this in the python 3.10 headers. Py_ssize_t is the type of the field this macro actually returns, so best to to use that in our code as well.
2022-01-24Cleanup: Grammar: its self vs. itselfHans Goudey
2022-01-18RNA: display exact integer values without fraction if step is integer.Alexander Gavrilov
Display exact integer values of a floating point fields without a fraction if the step is also an exact integer. This is intended for cases when the value can technically be fractional, but most commonly is supposed to be integer. This handling is not applied if the field has any unit except frames, because integer values aren't special for quantities like length. The fraction is discarded in the normal display mode and when copying the value to clipboard, but not when editing to remind the user that the field allows fractions. Differential Revision: https://developer.blender.org/D13753
2022-01-14Cleanup: spelling in comments, C++ style comments for disabled codeCampbell Barton
Also ensure space at end of comment.
2022-01-14Fix crash caused by exception in Python gizmo target get handlerCampbell Barton
2022-01-07Fix T94708: negative reference count error with Python API callbacksCampbell Barton
Regression in 7972785d7b90771f50534fe3e1101d8adb615fa3 that caused Python callback arguments to be de-referenced twice - potentially accessing freed memory. Making a new-file with a circle-select tool active triggered this (for example). Now arguments aren't de-referenced when Blender it's self has already removed the callback handle.
2022-01-07Cleanup: remove redundant const qualifiers for POD typesCampbell Barton
MSVC used to warn about const mismatch for arguments passed by value. Remove these as newer versions of MSVC no longer show this warning.
2022-01-06Fix T94685: python error adding Space handlers for SpreadsheetPhilipp Oeser
Oversight in {rB9cb5f0a2282a}. Above commit made an entry in `rna_Space_refine()`, but the entry in `rna_Space_refine_reverse()` was missing (and this is what python uses for the Space callbacks). Maniphest Tasks: T94685 Differential Revision: https://developer.blender.org/D13751
2021-12-16Animation: send notifier when keyframe is insertedSybren A. Stüvel
`<some_id>.keyframe_insert()` now sends a notifier that animation data was changed, so that animation-related editors can properly refresh. Since this function is quite high-level (if necessary it creates the Action and FCurves), I thought this would be a suitable location for the notifier. If high keyframing speed is required, it is still recommended to use `FCurveKeyframePoints.insert(options={'FAST'})` instead.
2021-12-14Cleanup: correct unbalanced doxygen groupsCampbell Barton
Also add groups in some files.
2021-12-13Cleanup: use "filepath" term for Main, BlendFileData & FileGlobalCampbell Barton
Use "filepath" which is the current convention for naming full paths. - Main use "name" which isn't obviously a file path. - BlendFileData & FileGlobal used "filename" which is often used for the name component of a path (without the directory).
2021-12-13Cleanup: remove checks for invalid input for Python Run utilitiesCampbell Barton
These arguments must be non-null for useful functionality, there is no need for paranoid checks. The return value in case of invalid input for BPY_run_string_as_number was also wrong (casting -1 to a bool, when false was expected).
2021-12-13Docs: improve on doc-strings for BPY_extern_run.hCampbell Barton
Also add ATTR_NONNULL function attributes.
2021-12-10Cleanup: move public doc-strings into headers for 'python/intern'Campbell Barton
Ref T92709
2021-12-07Cleanup: move public doc-strings into headers for 'blenkernel'Campbell Barton
- Added space below non doc-string comments to make it clear these aren't comments for the symbols directly below them. - Use doxy sections for some headers. - Minor improvements to doc-strings. Ref T92709
2021-12-02Cleanup: move public doc-strings into headers for 'python'Campbell Barton
2021-11-30LibLink/Append: Port `bpy.data.libraries.load` to new ↵Bastien Montagne
`BKE_blendfile_link_append` module. Note that this fully replaces the 'PyCapsule' storage of linked/appended items in the python API code by the generic storage of items in the `BlendfileLinkAppendContext` data. Maniphest Tasks: T91414 Differential Revision: https://developer.blender.org/D13331