Commit Graph

10 Commits

Author SHA1 Message Date
Bastien Montagne f0f378d31e Fix #115151, step one: Fallback to `ID_OB` in case of defined unknown ID type.
This is mainly intended to support forward compatibility with future,
unknwon ID types. Actual reported issue will be fixed in next commit.
2023-11-21 18:54:00 +01:00
Campbell Barton 611930e5a8 Cleanup: use std::min/max instead of MIN2/MAX2 macros 2023-11-07 16:33:19 +11:00
Bastien Montagne 445fabeae9 Fix (unreported) crash when loading files with py-defined ID IDProperties.
New code exposing ID Pointers CustomProperties to the UI (b3c7f3c8a9)
would cause invalid data access when calling `as_dict()` on py-defined ID
pointers ID properties, since these have no ID type defined by default.

The code of `as_dict()` will now forcefully generate a valid ID type
value, either by using the type of the currently assigned ID, or falling
back to the Object ID type.

Found while opening some lighting production files from the Pets
Project.
2023-08-23 16:44:56 +02:00
Bastien Montagne b3c7f3c8a9 UI: Add initial UI support for ID pointers custom properties.
Customprops to IDs are supported since years through code, but were
never exposed directly in the UI of customporperties.

This commit mainly:
* Adds a new `DATA_BLOCK` type to UI customprops types.
* Exposes the existing `id_type` settings to python API.

Pull Request: https://projects.blender.org/blender/blender/pulls/110458
2023-08-21 14:14:26 +02:00
Campbell Barton e955c94ed3 License Headers: Set copyright to "Blender Authors", add AUTHORS
Listing the "Blender Foundation" as copyright holder implied the Blender
Foundation holds copyright to files which may include work from many
developers.

While keeping copyright on headers makes sense for isolated libraries,
Blender's own code may be refactored or moved between files in a way
that makes the per file copyright holders less meaningful.

Copyright references to the "Blender Foundation" have been replaced with
"Blender Authors", with the exception of `./extern/` since these this
contains libraries which are more isolated, any changed to license
headers there can be handled on a case-by-case basis.

Some directories in `./intern/` have also been excluded:

- `./intern/cycles/` it's own `AUTHORS` file is planned.
- `./intern/opensubdiv/`.

An "AUTHORS" file has been added, using the chromium projects authors
file as a template.

Design task: #110784

Ref !110783.
2023-08-16 00:20:26 +10:00
Campbell Barton 3af7ed0e8e Cleanup: reduce number of calls to PyUnicode_FromString 2023-08-11 10:03:45 +10:00
Jacques Lucke cc4d5c432c RNA: move headers to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/111022
2023-08-10 22:40:27 +02:00
Campbell Barton d1aac3b08c Cleanup: various non-functional changes for C++ (python, makesrna)
- Remove redundant void, struct.
- Use function style casts.
2023-07-22 11:33:36 +10:00
Campbell Barton 056a7bbb5c Cleanup: ignore GCC cast-function-type warning for PyMethodDef's
PyMethodDef::ml_flags define the function signature making the warning
meaningless.
2023-07-22 11:13:55 +10:00
Jacques Lucke ec05e5a3fc Python: move remaining python files to C++
Also see #103343.

Pull Request: https://projects.blender.org/blender/blender/pulls/110352
2023-07-21 19:41:03 +02:00