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
diff options
context:
space:
mode:
authorYann Lanthony <yann-lty>2021-07-22 13:46:54 +0300
committerJeroen Bakker <jeroen@blender.org>2021-07-26 09:44:01 +0300
commit59b77cd68848e56461c36287eba713079135f071 (patch)
tree35834ebf7ad3c47b6c0fb122bfcbc921840e6148
parent05ffe05ebcd36688e3f3c178e3797aeffb1eb647 (diff)
Fix T89733: Py API: bpy.data.orphans_purge argument parsing
On Windows, using `bpy.data.orphans_purge` with some arguments (eg: `do_recursive=True`) does not produce the expected results. This is due to arguments not being parsed correctly on this platform with the current code. The proposed fix is based on how other functions with boolean attributes are exposed to the Python API. Reviewed By: #python_api, mont29 Maniphest Tasks: T89733 Differential Revision: https://developer.blender.org/D11963
-rw-r--r--source/blender/python/intern/bpy_rna_id_collection.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_rna_id_collection.c b/source/blender/python/intern/bpy_rna_id_collection.c
index d4127b26629..c5ae494fabd 100644
--- a/source/blender/python/intern/bpy_rna_id_collection.c
+++ b/source/blender/python/intern/bpy_rna_id_collection.c
@@ -377,9 +377,16 @@ static PyObject *bpy_orphans_purge(PyObject *UNUSED(self), PyObject *args, PyObj
bool do_recursive_cleanup = false;
static const char *_keywords[] = {"do_local_ids", "do_linked_ids", "do_recursive", NULL};
- static _PyArg_Parser _parser = {"|$ppp:orphans_purge", _keywords, 0};
- if (!_PyArg_ParseTupleAndKeywordsFast(
- args, kwds, &_parser, &do_local_ids, &do_linked_ids, &do_recursive_cleanup)) {
+ static _PyArg_Parser _parser = {"|O&O&O&:orphans_purge", _keywords, 0};
+ if (!_PyArg_ParseTupleAndKeywordsFast(args,
+ kwds,
+ &_parser,
+ PyC_ParseBool,
+ &do_local_ids,
+ PyC_ParseBool,
+ &do_linked_ids,
+ PyC_ParseBool,
+ &do_recursive_cleanup)) {
return NULL;
}