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-05-09Merge branch 'blender-v3.2-release'Bastien Montagne
2022-05-09Fix T97927: bpy.utils.units.to_string uses wrong units for velocity, ↵Bastien Montagne
acceleration, lens length, and power `TEMPERATURE` type was also missing, not only the new-ish `TIME_ABSOLUTE` one... Added a static assert on the size of the `bpyunits_ucategories_items` array, and a comment on anonymous enum of `B_UNIT_`, in the hope this won't happen again in the future.
2022-05-09Cleanup: typo in variable name.Bastien Montagne
2022-05-09EEVEE & Viewport: Add a built-in shader called 3D_IMAGE, and expose to the ↵Shashank Shekhar
python API Adds an example python script to the documentation for the 3D_IMAGE shader. The **use-case** is to draw textures with 3D vertex positions, in XR views as well as non-XR views (in a simpler manner). **Testing**: I've tested that this compiles and works on my Macbook (with the example python script included in this change). I don't have access to a Windows or Linux machine right now, but this change doesn't look platform-specific and no new glsl shaders have been added or edited by this change. I'll try to get access to a Windows machine, but if someone does have one, I'd be really grateful if they could try this change. Thanks! **Problem addressed**: The existing 2D_IMAGE shader (exposed in the python API) gets near-clipped when drawn in the XR view, regardless of the near-clip settings. Additionally, the 2D_IMAGE shader only accepts 2D positions for the image vertices, which means drawing textures in 3D requires providing 2D coordinates and then pushing a transform-rotate-scale matrix to the GPU, even for non-XR (i.e. WINDOW) views. The 3D_IMAGE shader is simpler: it accepts 3D vertex positions, and doesn't require any additional work by the scripter. **Workaround**: The current workaround is to use custom shaders in the python script. **Non-intrusive change**: No new glsl shaders were added. This change just bundles two existing shaders: the vertex shader used by the 3D_IMAGE_MODULATE_ALPHA shader, and the fragment shader used by the 2D_IMAGE shader. Reviewed By: #eevee_viewport, jbakker Differential Revision: https://developer.blender.org/D14832
2022-05-06Merge branch 'blender-v3.2-release'Bastien Montagne
2022-05-06Add documentation about Image/ImBuf to python/RNA API.Bastien Montagne
Related to T95616, the relationship between Image ID and ImBuf 'cached' buffers can be fairly confusing when using the RNA API. Reviewed By: campbellbarton, jbakker Differential Revision: https://developer.blender.org/D14833
2022-05-06Cleanup: formatCampbell Barton
2022-05-06Cleanup: spelling in comments, use doxygen commentsCampbell Barton
2022-05-05Docs: Clarify docs for BMesh methodsjon denning
The previous docs for `normal_update` methods of `BMVert`, `BMEdge`, `BMFace`, and `BMesh` were not clear on some behaviors. These behaviors are listed in D14370. This commit updates the docs to be clearer. Reviewed By: Blendify Differential Revision: https://developer.blender.org/D14370
2022-05-05Cleanup: sort cmake file listsCampbell Barton
2022-05-03Fix T97731: Python traceback no longer includes line-numbersCampbell Barton
Regression caused by [0] that caused the error message to be created based on a normalized exception (which hid line numbers). PyC_ExceptionBuffer{_Simple} & BPy_errors_to_report no longer clears the exception. This could have been resolved by changing python_script_error_jump however that would involve changes to reference counting that are more risky (noted in code-comment). [0]: 2d2baeaf04d481f284bc2f098fb6d7ee9268151f
2022-05-03Cleanup: remove redundant PyErr_Clear calls after PyErr_FetchCampbell Barton
2022-04-28Cleanup: unbalanced doxy sections, add some sectionsCampbell Barton
2022-04-26Fix memory leak in Context.temp_overrideCampbell Barton
Add missing check as the context override dict may have been copied since it was assigned, also initialize the context manager with PyType_Ready, while it didn't cause any errors - it's expected that all types are initialized.
2022-04-26Cleanup: use boolean arguments and return valuesCampbell Barton
2022-04-26PyAPI: support persistent handlers for class & static methodsCampbell Barton
Support methods being used as persistent callbacks. Resolves T97555.
2022-04-22Cleanup: spelling in commentsCampbell Barton
2022-04-21gpu.types.GPUBatch: warn about deprecated primitive typesGermano Cavalcante
As `GPU_PRIM_LINE_LOOP` is not supported on Vulkan or Metal and `GPU_PRIM_TRI_FAN` is not supported on Metal, they will be removed in future releases. So it is important to inform users that they are obsolete and may not be supported for a long time. Release Notes: https://wiki.blender.org/wiki/Reference/Release_Notes/3.2/Python_API Reviewed By: campbellbarton Differential Revision: https://developer.blender.org/D14679
2022-04-20Cleanup: Rename CD_MLOOPCOL to CD_PROP_BYTE_COLORHans Goudey
The "PROP" in the name reflects its generic status, and removing "LOOP" makes sense because it is no longer associated with just mesh face corners. In general the goal is to remove extra semantic meaning from the custom data types.
2022-04-20PyAPI: improve deprecation warning for bpy.ops context overrideCampbell Barton
- Increase the stack level so the reported line number references script authors code (not Blender's wrapper function). - Include the operator name and poll/call usage in the warning.
2022-04-20Fix crash passing no arguments to Context.temp_overrideCampbell Barton
2022-04-20PyAPI: temporary context override supportCampbell Barton
Support a way to temporarily override the context from Python. - Added method `Context.temp_override` context manager. - Special support for windowing variables "window", "area" and "region", other context members such as "active_object". - Nesting context overrides is supported. - Previous windowing members are restored when the context exists unless they have been removed. - Overriding context members by passing a dictionary into operators in `bpy.ops` has been deprecated and warns when used. This allows the window in a newly loaded file to be used, see: T92464 Reviewed by: mont29 Ref D13126
2022-04-20PyAPI: utility functions for parsing typed RNA argumentsCampbell Barton
These functions can be used with PyArg_ParseTupleAndKeywords (and related functions) to take typed RNA arguments without having to extract and type-check them separately. No functional changes, extracted from D13126.
2022-04-19PyGPU: remove outdated function 'code_from_builtin'Germano Cavalcante
Since shader sources are now parsed on demand via `GPUShaderCreateInfo`, sources are not available to be read via `GPU_shader_get_builtin_shader_code`. Currently this results in a crash as the code tries to read `NULL` pointers. `GPU_shader_get_builtin_shader_code` was created with the intention of informing the user how a builtin shader works, thus "replacing" detailed documentation. Therefore this function doesn't really have a practical use in an addon. So, instead of updating the function (which would require several changes to the gpu module), remove it and improve the documentation. Release Notes: https://wiki.blender.org/wiki/Reference/Release_Notes/3.2/Python_API#Breaking_Changes Reviewed By: fclem Differential Revision: https://developer.blender.org/D14678
2022-04-14Cleanup: separate format-units for Python argument parsingCampbell Barton
Recent addition to the Python API [0] didn't follow this convention. See [1] for the rationale behind this change. [0]: 9bc678969aaef5e2343d9362648e9a633d1b6e5e [1]: 982aea88e0d74020c62c2054a45eeafa56c8ca30
2022-04-14Cleanup: Clang tidyHans Goudey
2022-04-13Fix some usages of 'GPU_shader_get_uniform_block'Germano Cavalcante
`GPU_shader_get_uniform_block` is marked as deprecated and the value returned does not match what `GPU_uniformbuf_bind` expects. Also, small typo fix in python error message. Differential Revision: https://developer.blender.org/D14638
2022-04-13Docs: correct RST syntax for GPU documentationCampbell Barton
2022-04-13Cleanup: use C++ comments for disabled codeCampbell Barton
Also ensure space around text in C-comment blocks.
2022-04-13gpy.types.GPUUniformBuf: support any object exposing buffer interfaceGermano Cavalcante
Since uniform buffers are generally structs and not sequences, `BPyGPU_BufferType` objects are not suitable for filling the buffer.
2022-04-13gpu.types.Buffer: fill buffer interface with just what is requestedGermano Cavalcante
Use the `flags` parameter to avoid unnecessary allocations.
2022-04-13Fix size of MAT3 and MAT4 in GPUShaderCreateInfo.push_constantGermano Cavalcante
It was being wrongly multiplied by 2.
2022-04-13Fix cases where 'Py_buffer' might not be releasedGermano Cavalcante
2022-04-13Fix possible pointer being freed without being allocated in pygpu moduleGermano Cavalcante
The `clear` method can be called before dealloc, which can mislead buffer ownership.
2022-04-13pyGPU: Port 'StageInterfaceInfo' and 'ShaderCreateInfo' typesGermano Cavalcante
In order to allow GLSL Cross Compilation across platforms, expose in Python the `GPUShaderCreateInfo` strategy as detailed in https://wiki.blender.org/wiki/EEVEE_%26_Viewport/GPU_Module/GLSL_Cross_Compilation The new features can be listed as follows: ``` >>> gpu.types.GPUShaderCreateInfo. define( fragment_out( fragment_source( push_constant( sampler( typedef_source( uniform_buf( vertex_in( vertex_out( vertex_source( >>> gpu.types.GPUStageInterfaceInfo. flat( name no_perspective( smooth( >>> gpu.shader.create_from_info( ``` Reviewed By: fclem, campbellbarton Differential Revision: https://developer.blender.org/D14497
2022-04-12Fix: BMesh Python API errors after vertex_normals additionHans Goudey
64cd927519748bbd50 didn't update the argument parsing strings, and updated the docstring of `from_object` incorrectly. Fixes T97025, T97213
2022-04-11PyGPU: make sure the UniformBuffer is padded to 16 bytesGermano Cavalcante
Alignment with `vec4` is a requirement in C++, so it should be a requirement in Python as well.
2022-04-11Fix crash when creating a 'gpu.types.Buffer'Germano Cavalcante
Buffer creation may crash when passed a PyBuffer with no `shape` defined. (Which is common for strucs).
2022-04-11BMesh Python API: add access to vertex crease layerKévin Dietrich
This simply adds access to the vertex crease layer from Python code. Documentation was modified to remove "Edge" as it is shared between edges and vertices, similarly to bevel weights. Differential Revision: https://developer.blender.org/D14605
2022-04-11Cleanup: malformed C-style comment blocks, spellingCampbell Barton
- Missing star prefix. - Unnecessary indentation. - Blank line after dot-points (otherwise doxygen merges with the previous dot-point). - Use back-slash for doxygen commands. - Correct spelling.
2022-04-08PyAPI: use keyword only arguments for Text.region_{from/to} stringCampbell Barton
This is the convention for most parts of Blender Python API.
2022-04-08Cleanup: separate format-units for Python argument parsingCampbell Barton
With the increased use of multi-character format units and keyword-only arguments these are increasingly difficult to make sense of. Split the string onto multiple lines, one per argument. While verbose it's easier to understand and add new arguments.
2022-04-07Cleanup: add clarifying comment to `bpy_app_getsets`Sybren A. Stüvel
No functional changes.
2022-04-07Cleanup: pass the buffer length into `txt_insert_buf`Campbell Barton
Also remove redundant NULL check.
2022-04-07Text Editor: Get/Set region text APIMatheus Santos
Add the ability to get/set the selected text. **Calling the new methods:** - `bpy.data.texts["Text"].region_as_string()` - `bpy.data.texts["Text"].region_from_string("Replacement")`
2022-04-06Cleanup: spelling & poor wording in code & commentsCampbell Barton
2022-04-06Fix: T78228 Send all python errors to info editorCampbell Barton
Python exceptions are now shown in the info editor, this also resolves an old bug where errors were printed twice. This was originally based on D9752 by @ShadowChaser although many changes have been made from the original patch. Details: - BPy_errors_to_report no longer prints additional output. - BKE_report_print_test was added so it's possible to check if calling BKE_report also printed to the stdout. - Callers to BPy_errors_to_report are responsible for ensuring output is printed to the stdout/stderr. - Python exceptions no longer add a trailing newline, needed to avoid blank-space when displayed in the info-editor.
2022-04-06Fix off by one error placing the text cursor from a Python exceptionCampbell Barton
Off by one error placing text from an error.
2022-04-06Fix accessing an empty context succeeding when it shouldn'tCampbell Barton
Internally an empty string is used to access context member `__dir__`, which caused `getattr(context, "")` to succeed returning None.
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.