It's important that frozen types are immutable, add a generic
check that mathutils types can be resized and check the frozen flag.
Also correct the exception types when Vector's cant be resized,
using a ValueError instead of a TypeError as the type is correct.
- Adding `/` to signatures to indicate that arguments are accepted only
as positional.
- Document default values and optional arguments in consistent way with
other docs.
- Use `Literal` for strings to indicate set of allowed string values
(later it can also be used in typing stubs).
- Document some undocumented arguments.
Ref !143278
In most (cases functions returning a PyObject pointer
requires it to be used by the caller, declare functions in the Python
API with the `nodiscard` attribute.
This commit implements #125759.
It removes:
* Blender does not build on big endian systems anymore.
* Support for opening blendfiles written from a big endian system is
removed.
It keeps:
* Support to generate thumbnails from big endian blendfiles.
* BE support in `extern` or `intern` libraries, including Cycles.
* Support to open big endian versions of third party file formats:
- PLY files.
- Some image files (cineon, ...).
Pull Request: https://projects.blender.org/blender/blender/pulls/140138
* Remove `DEG_get_evaluated_object` in favor of `DEG_get_evaluated`.
* Remove `DEG_is_original_object` in favor of `DEG_is_original`.
* Remove `DEG_is_evaluated_object` in favor of `DEG_is_evaluated`.
Pull Request: https://projects.blender.org/blender/blender/pulls/138317
The main issue of 'type-less' standard C allocations is that there is no check on
allocated type possible.
This is a serious source of annoyance (and crashes) when making some
low-level structs non-trivial, as tracking down all usages of these
structs in higher-level other structs and their allocation is... really
painful.
MEM_[cm]allocN<T> templates on the other hand do check that the
given type is trivial, at build time (static assert), which makes such issue...
trivial to catch.
NOTE: New code should strive to use MEM_new (i.e. allocation and
construction) as much as possible, even for trivial PoD types.
Pull Request: https://projects.blender.org/blender/blender/pulls/135852
When called on an object that you cannot get a mesh from (e.g. Empties),
you would run into an unhelpful "SystemError: <built-in method
FromObject of type object at ...> returned NULL without setting an
exception"
Now be more specific in the error message.
Pull Request: https://projects.blender.org/blender/blender/pulls/135162
Fixed use of lists using multiple arguments - `list` only
support a single argument.
Noticed working with fake-bpy-module - providing multiple
arguments to `list` resulted in typing error (e.g. "Too many type
arguments provided for "list"; expected 1 but received 2").
Pull Request: https://projects.blender.org/blender/blender/pulls/134663
When using clangd or running clang-tidy on headers there are
currently many errors. These are noisy in IDEs, make auto fixes
impossible, and break features like code completion, refactoring
and navigation.
This makes source/blender headers work by themselves, which is
generally the goal anyway. But #includes and forward declarations
were often incomplete.
* Add #includes and forward declarations
* Add IWYU pragma: export in a few places
* Remove some unused #includes (but there are many more)
* Tweak ShaderCreateInfo macros to work better with clangd
Some types of headers still have errors, these could be fixed or
worked around with more investigation. Mostly preprocessor
template headers like NOD_static_types.h.
Note that that disabling WITH_UNITY_BUILD is required for clangd to
work properly, otherwise compile_commands.json does not contain
the information for the relevant source files.
For more details see the developer docs:
https://developer.blender.org/docs/handbook/tooling/clangd/
Pull Request: https://projects.blender.org/blender/blender/pulls/132608
Replace plain-text type information with the type syntax used
for Python's type annotations as it's more concise, especially for
callbacks which often didn't include useful type information.
Note that this change only applies to inline doc-strings,
generated doc-strings from RNA need to be updated separately.
Details:
- Many minor corrections were made when "list" was incorrectly used
instead of "sequence".
- Some type information wasn't defined in the doc-strings and has been
added.
- Verbose type info would benefit from support for type aliases.
Match function and declaration names, picking names based on
consistency with related code & clarity.
Also changes for old conventions, missed in previous cleanups:
- name -> filepath
- tname -> newname
- maxlen -> maxncpy
Also refactor definitions into a macro as they were exceeding the
line-length and wrapping.
Ref: !124275
Co-authored-by: Nathan Burnham <nathan@nathanburnham.uk>
Reference identifiers instead of "above" in code comments as these
tends to become outdated. Even when declarations are removed it's at
least clear that the reference no longer exists instead of referring to
whatever is currently above the declaration.
It's also straightforward to search history for a removed identifier.
Corrected 4 cases of references to things that were no longer above
the doc-strings. Noticed other references which look to be incorrect
but need further investigation.
The type for `bpy_struct.keyframe_insert()`'s `options` parameter was
instead applied to a non-existent `flag` parameter.
The description and type for `mathutils.Vector.Repeat()`'s `vector`
parameter was instead applied to a non-existent `tuple` parameter.
Also fix a reference to `BMElemeSeq` instead of `BMElemSeq`.
Ref: !122734
The usage for `points_in_planes` might require different epsilons set
for parallel/intersection determination. This adds those epsilon values
to the bpy function so it benefits script users.
Pull Request: https://projects.blender.org/blender/blender/pulls/120910