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-11-07Cleanup: unify struct declaration style for Python types, update namesCampbell Barton
Use struct identifiers in comments before the value. This has some advantages: - The struct identifiers didn't mix well with other code-comments, where other comments were wrapped onto the next line. - Minor changes could re-align all other comments in the struct. - PyVarObject_HEAD_INIT & tp_name are no longer placed on the same line. Remove overly verbose comments copied from PyTypeObject (Python v2.x), these aren't especially helpful and get outdated. Also corrected some outdated names: - PyTypeObject.tp_print -> tp_vectorcall_offset - PyTypeObject.tp_reserved -> tp_as_async
2022-11-02Cleanup: spelling in commentsCampbell Barton
2022-11-01Cleanup: spelling in commentsCampbell Barton
2022-10-31GPU: Add placeholder for Vulkan backend.Jeroen Bakker
This patch adds a placeholder for the vulkan backend. When activated (`WITH_VULKAN_BACKEND=On` and `--gpu-backend vulkan`) it might open a blender screen, but nothing should be visible as none of the functions are implemented or otherwise crash on a nullptr. This is expected as this is just a placeholder. The goal is to add shader compilation +validation to this backend as one of the next steps so we can validate changes to existing shaders on OpenGL, Metal and Vulkan at the same time. Reviewed By: fclem Differential Revision: https://developer.blender.org/D16338
2022-10-21GPU: Add gpu.platform.backend_type_get function.Jeroen Bakker
Function returns the active GPU backend type.
2022-10-10UI: show the windowing environment in the "About" splashCampbell Barton
Show the windowing environment on non MS-Windows/Apple systems, since X11/WAYLAND are selected startup there was no convenient way for users to know which back-end was being used. Include the windowing environment in the About splash & system-info.txt since it will be useful for handling bug reports. This commit adds a private API call not intended for general use as I would like to be able to remove this later and it's only needed in the specific case of testing if Blender is using WAYLAND or X11 (which maybe be used via XWayland). Python scripts can already inspect the system to check which windowing environment used, the API call is mainly useful for troubleshooting.
2022-10-07Cleanup: redundant parenthesisCampbell Barton
2022-10-06Fix T101591: mathutils.geometry.intersect_line_line 2D vector errorCampbell Barton
Uninitialized stack memory was used when intersecting 2D vectors.
2022-10-05Fix order of include-guard & C++ extern blockCampbell Barton
2022-10-05Fix error in 6b76381e0a52cf15513087e470a4a4c07471acc6Campbell Barton
Missed flipping arguments for caller.
2022-10-04Cleanup: rename BKE_appdir_folder_id_version, improve doc-stringsCampbell Barton
Rename BKE_appdir_folder_id_version to BKE_appdir_resource_path_id_with_version because BKE_appdir_folder_id and BKE_appdir_folder_id_version didn't accept compatible arguments. Also add notes to GHOST_getSystemDir & GHOST_getUserDir that BKE_appdir_resource_path_id(..) should be used instead (in most cases).
2022-10-04Cleanup: replace UNUSED macro with commented args in C++ codeHans Goudey
This is the conventional way of dealing with unused arguments in C++, since it works on all compilers. Regex find and replace: `UNUSED\((\w+)\)` -> `/*$1*/`
2022-10-03Cleanup: fix source comment/documentation typosBrecht Van Lommel
Contributed by luzpaz. Differential Revision: https://developer.blender.org/D16071
2022-09-28Fix GC tracking error for instances of mathutils typesCampbell Barton
Mathutils types were always GC tracked even when it wasn't intended. Not having to track objects speeds up Python execution. In an isolated benchmark created to stress test the GC creating 4-million vectors (re-assigning them 100 times), this gives an overall ~2.5x speedup, see: P3221. Details: Since [0] (which added support for sub-classed mathutils types) tp_alloc was called which defaults to PyType_GenericAlloc which always GC tracked the resulting object when Py_TPFLAGS_HAVE_GC was set. Avoid using PyType_GenericAlloc unless the type is sub-classed, in that case the object is un-tracked. Add asserts that the tracked state is as expected before tracking & un-tracking, to ensure changes to object creation don't cause objects to be tracked unintentionally. Also assign the PyTypeObject.tp_is_gc callback so types optionally GC track objects only do so when an object is referenced. [0]: fbd936494495d0de54eef24a97957e000306785f
2022-09-28Cleanup: improve 2D convex hullChris Blackbourn
Improve correctness, API, comments, memory usage and performance of the 2D convex hull calculation. Pre-requisite for UV packing improvements. Differential Revision: https://developer.blender.org/D16055
2022-09-26Python: Add platform feature support methods to `gpu.capabilities` module.Jeroen Bakker
Depending on the actual platform, Blender will disable features that are known to have a faulty implementation. Add-on developers or users don't have the ability to check what is actually enabled. This patch will add the ability to check for * Compute shader support `gpu.capabilities.compute_shader_support_get()`. * SSBO support `gpu.capabilities.shader_storage_buffer_objects_support_get()`. * Image load/store `gpu.capabilities.shader_image_load_store_support_get()`.
2022-09-26Cleanup: remove redundant parenthesisCampbell Barton
2022-09-25Cleanup: replace C-style casts with functional casts for numeric typesCampbell Barton
Some changes missed from f68cfd6bb078482c4a779a6e26a56e2734edb5b8.
2022-09-25Cleanup: replace C-style casts with functional casts for numeric typesCampbell Barton
2022-09-25Cleanup: remove redundant double parenthesisCampbell Barton
2022-09-24BLF: Refactor of DPIHarley Acheson
Correction of U.dpi to hold actual monitor DPI. Simplify font sizing by omitting DPI as API argument, always using 72 internally. See D15961 for more details. Differential Revision: https://developer.blender.org/D15961 Reviewed by Campbell Barton
2022-09-23Cleanup: spelling in commentsCampbell Barton
2022-09-22PyGPU: Allow single bool in 'GPUShader.uniform_bool' methodGermano Cavalcante
As with the other uniform methods, a single value is expected.
2022-09-21PyAPI: disable IMB color management methods for stand-alone mathutilsCampbell Barton
Allow building a standalone mathutils without including imbuf.
2022-09-21Cleanup: spelling in commentsCampbell Barton
2022-09-19PyGPU: call 'GPU_shader_bind' in 'GPUShader.uniform_' methodsGermano Cavalcante
This simplifies python code. When we call a method like shader.uniform_float("color", (1,1,1,1)), we expect the shader's uniform to be updated regardless of whether the shader is bound or not. And `batch.draw()` already calls `GPU_shader_bind` inside. Differential Revision: https://developer.blender.org/D15929
2022-09-19Cleanup: spellingCampbell Barton
2022-09-19Cleanup: prefer 'arg' over 'params' for sphinx documentationCampbell Barton
While both are supported, 'arg' is in more common use so prefer it.
2022-09-18Build: limit Py_ENABLE_SHARED to modules using Python headersBrecht Van Lommel
And remove Python flags from nodes, no longer needed.
2022-09-17PyDoc: correct parameter doc-strings & exception messageCampbell Barton
2022-09-16Cleanup: spelling in commentsCampbell Barton
2022-09-14Fix reports printing twice when called from Python in background-modeCampbell Barton
Calling operators in background-mode always printed with the assumption that output should never be hidden. However operators called from `bpy.ops` were also printing reports to the `stdout` (needed for the Python console and generally useful). Resolve by adding a flag to signal that the owner of the ReportList is responsible for printing to the `stdout`.
2022-09-10PyGPU: expose 'GPU_SHADER_3D_IMAGE_COLOR'Germano Cavalcante
This shader is required by some addons that need to modulate the alpha of images.
2022-09-09Python: change bpy.app.binary_path behavior WITH_PYTHON_MODULECampbell Barton
The following changes have been made to this attribute with WITH_PYTHON_MODULE is defined: - Defaults to an empty string (instead of pointing to __init__.so). - It's writable, so script authors can point to a valid Blender binary. `where_am_i(..)` is no longer used by BKE_appdir_program_path_init, there is now a separate code-path for setting the initial program directory, calls after this can be used to set the binary path.
2022-09-08Cleanup: correct PyModuleDef.m_slots referenceCampbell Barton
Changed in Python 3.5, match Python's internal name.
2022-09-08Python: ensure the runtime version is compatible WITH_PYTHON_MODULECampbell Barton
When Blender is built as a Python module, exit early if the major and minor versions don't match. Without this, the error message can be cryptic/unhelpful.
2022-09-07Cleanup: Tweak naming for recently added mesh accessorsHans Goudey
Use `verts` instead of `vertices` and `polys` instead of `polygons` in the API added in 05952aa94d33eeb50. This aligns better with existing naming where the shorter names are much more common.
2022-09-06Cleanup: spelling in comments, formatting, move comments into headersCampbell Barton
2022-09-05Mesh: Remove redundant custom data pointersHans Goudey
For copy-on-write, we want to share attribute arrays between meshes where possible. Mutable pointers like `Mesh.mvert` make that difficult by making ownership vague. They also make code more complex by adding redundancy. The simplest solution is just removing them and retrieving layers from `CustomData` as needed. Similar changes have already been applied to curves and point clouds (e9f82d3dc7ee, 410a6efb747f). Removing use of the pointers generally makes code more obvious and more reusable. Mesh data is now accessed with a C++ API (`Mesh::edges()` or `Mesh::edges_for_write()`), and a C API (`BKE_mesh_edges(mesh)`). The CoW changes this commit makes possible are described in T95845 and T95842, and started in D14139 and D14140. The change also simplifies the ongoing mesh struct-of-array refactors from T95965. **RNA/Python Access Performance** Theoretically, accessing mesh elements with the RNA API may become slower, since the layer needs to be found on every random access. However, overhead is already high enough that this doesn't make a noticible differenc, and performance is actually improved in some cases. Random access can be up to 10% faster, but other situations might be a bit slower. Generally using `foreach_get/set` are the best way to improve performance. See the differential revision for more discussion about Python performance. Cycles has been updated to use raw pointers and the internal Blender mesh types, mostly because there is no sense in having this overhead when it's already compiled with Blender. In my tests this roughly halves the Cycles mesh creation time (0.19s to 0.10s for a 1 million face grid). Differential Revision: https://developer.blender.org/D15488
2022-09-02PyGPU: only use 3D shaders and rename string enumsGermano Cavalcante
Since rB6269d66da, creating formats no longer depends solely on the shader, but now depends on the dimensions used to fill the VBOs. This allows 3D shaders to work flawlessly when assigned dimensions are 2D. So there's no real benefit to us having shaders that are limited to 2D use anymore. This limitation makes it difficult to implement other builtin shaders as they indirectly require a 2D version. So this commit removes the 2D versions of the builtin sahders used in Python , renames the string enums but keeps the old enums working for backward compatibility. (This brings parts of the changes reviewed in D15836).
2022-09-01Metal: MTLShader and MTLShaderGenerator implementation.Thomas Dinges
Full support for translation and compilation of shaders in Metal, using GPUShaderCreateInfo. Includes render pipeline state creation and management, enabling all standard GPU viewport rendering features in Metal. Authored by Apple: Michael Parkin-White, Marco Giordano Ref T96261 Reviewed By: fclem Maniphest Tasks: T96261 Differential Revision: https://developer.blender.org/D15563
2022-09-01Cleanup: make formatJacques Lucke
2022-09-01PyGPU: GPUShader: implementation of 'attrs_info_get' methodGermano Cavalcante
With the new `attrs_info_get` method, we can get information about the attributes used in a `GPUShader` and thus have more freedom in the automatic creation of `GPUVertFormat`s Reviewed By: fclem, campbellbarton Differential Revision: https://developer.blender.org/D15764
2022-08-26Cleanup: use booleansCampbell Barton
2022-08-25BLI_math: ensure non-negative matrices for mat3_to_quat calculationsCampbell Barton
Making the callers responsible for this isn't practical as matrices are often passed indirectly to a functions such as mat3_to_axis_angle, BKE_object_mat3_to_rot & BKE_pchan_mat3_to_rot. Or the matrix is combined from other matrices which could be negative. Given quaternions calculated from negative matrices are completely invalid and checking only needs to negate matrices with a negative determinant, move the check into mat3_to_quat and related functions. Add mat3_normalized_to_quat_fast for cases no error checking on the input matrix is needed such as blending rotations.
2022-08-24Merge branch 'blender-v3.3-release'Campbell Barton
2022-08-24Fix Quaternion.rotate(matrix) with negative matricesCampbell Barton
Rotating a quaternion by a negative matrix gave an invalid result. Follow up fix for T94231 which negated negative matrices too.
2022-08-24Merge branch 'blender-v3.3-release'Campbell Barton
2022-08-24Fix T94231: Matrix.to_quaternion() returns invalid rotationCampbell Barton
The result of mat3_normalized_to_quat isn't valid for negative matrices. Isolate the fix to the Matrix.to_quaternion() instead of changing mat3_normalized_to_quat to prevent unintended side effects elsewhere.
2022-08-24Merge branch 'blender-v3.3-release'Campbell Barton