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-25Cleanup: spelling in comments, stringsCampbell Barton
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-24Cleanup: use "filepath" instead of "filename" for full pathsCampbell Barton
Reserve "filename" when only the name component is used.
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-22Fix T96308: Mesh to BMesh conversion doesn't calculate vertex normalsHans Goudey
Currently there is a "calc_face_normal" argument to mesh to bmesh conversion, but vertex normals had always implicitly inherited whatever dirty state the mesh input's vertex normals were in. Probably they were most often assumed to not be dirty, but this was never really correct in the general case. Ever since the refactor to move vertex normals out of mesh vertices, cfa53e0fbeed7178c7, the copying logic has been explicit: copy the normals when they are not dirty. But it turns out that more control is needed, and sometimes normals should be calculated for the resulting BMesh. This commit adds an option to the conversion to calculate vertex normals, true by default. In almost all places except the decimate and edge split modifiers, I just copied the value of the "calc_face_normals" argument. Differential Revision: https://developer.blender.org/D14406
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-15Docs: correct doc-string for BPY_driver_resetCampbell Barton
Remove outdated reference to "pydrivers.py", also document BPY_DECREF.
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-14Fix gpu.types.GPUTexture not passing data buffer to 3D texturesIyad Ahmed
Missed in rB4430e8a00810ca8df2fa20029c4cb8078e8cdbe6 Reviewed By: mano-wii Differential Revision: https://developer.blender.org/D14333
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-11Fix T94121: PyAPI: ID property group returns wrong type with iter()Campbell Barton
Regression in 265d97556aa0f0f2a0e4dd7584e3b8573bbddd54. Where iterating directly on a property group failed, e.g.: `iter(group)`, tests missed this since only `group.keys()` was checked.
2022-03-10Cleanup: spelling in comments & some minor clarificationsCampbell Barton
2022-03-09Cleanup: fix wrong spelling of texture and indentationBrecht Van Lommel
Contributed by luzpaz. Ref D14271, D14270
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-03-03UV: Edge selection supportSiddhartha Jejurkar
This patch adds edge selection support for UV editing (refer T76545). Developed as a part of GSoC 2021 project - UV Editor Improvements. Previously, selections in the UV editor always flushed down to vertices and this caused multiple issues such as T76343, T78757 and T26676. This patch fixes that by adding edge selection support for all UV operators and adding support for flushing selections between vertices and edges. Updating UV select modes is now done using a separate operator, which also handles select mode flushing and undo for UV select modes. Drawing edges (in UV edge mode) is also updated to match the edit-mesh display in the 3D viewport. Notes on technical changes made with this patch: * MLOOPUV_EDGESEL flag is restored (was removed in rB9fa29fe7652a). * Support for flushing selection between vertices and edges. * Restored the BMLoopUV.select_edge boolean in the Python API. * New operator to update UV select modes and flushing. * UV select mode is now part of editmesh undo. TODOs added with this patch: * Edge support for shortest path operator (currently uses vertex path logic). * Change default theme color instead of reducing contrast with edge-select. * Proper UV element selections for Reveal Hidden operator. Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D12028
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-21Merge branch 'blender-v3.1-release'Hans Goudey
2022-02-21Fix: Avoid potential use of dirty normalsHans Goudey
Instead of accessing the `CD_NORMAL` layer directly, use the proper API for accessing mesh normals. Even if the layer exists, the values might be incorrect due to a deformation. Related to ef0e21f0ae71d, 969c4a45ce09100e, and T95839.
2022-02-21Fix errors in 'gpu.state' documentationGermano Cavalcante
`blend_depth_test_get` --> `depth_test_get` `depth_mask_set_get` --> `depth_mask_get` Thanks to @SBCV for pointing out these inconsistencies.
2022-02-18Fix wrong method name in gpu documentationGermano Cavalcante
`use_program_point_size` --> `program_point_size_set`.
2022-02-16License headers: use SPDX identifiersCampbell Barton
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-14Merge remote-tracking branch 'origin/blender-v3.1-release'Sybren A. Stüvel
2022-02-14Fix segfault calling `id_properties_ui("prop").update()`Sybren A. Stüvel
Fix segfault when calling `some_id.id_properties_ui("propname").update()`, i.e. call the `update()` function without any keyword arguments. In such a case, Python passes `kwargs = NULL`, but `PyDict_Contains()` is not `NULL`-safe.
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