diff options
author | Campbell Barton <ideasman42@gmail.com> | 2021-04-20 04:57:28 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2021-04-20 05:07:01 +0300 |
commit | ebe04bd3cafaa1f88bd51eee5b3e7bef38ae69bc (patch) | |
tree | 7af16c8b05e7732b939ed40816ce9388364576af /source/blender/python/intern/bpy_rna_operator.h | |
parent | 985ccba77c6e907ae55ac47d8ac56d1e84b46286 (diff) |
PyAPI: support Operator.poll functions 'disabled' hint
Python scripts can now define the reason it's poll function fails using:
`Operator.poll_message_set(message, ...)`
This supports both regular text as well as delaying message creation
using a callback which should be used in situations where constructing
detailed messages is too much overhead for a poll function.
Ref D11001
Diffstat (limited to 'source/blender/python/intern/bpy_rna_operator.h')
-rw-r--r-- | source/blender/python/intern/bpy_rna_operator.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/source/blender/python/intern/bpy_rna_operator.h b/source/blender/python/intern/bpy_rna_operator.h new file mode 100644 index 00000000000..8040d8a492a --- /dev/null +++ b/source/blender/python/intern/bpy_rna_operator.h @@ -0,0 +1,31 @@ +/* + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + +/** \file + * \ingroup pythonintern + */ + +#pragma once + +#ifdef __cplusplus +extern "C" { +#endif + +extern PyMethodDef BPY_rna_operator_poll_message_set_method_def; + +#ifdef __cplusplus +} +#endif |