Blender V5.3
BPY_extern_run.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
22
23#pragma once
24
25#include "BLI_compiler_attrs.hh"
26#include "BLI_string_ref.hh"
27#include "BLI_sys_types.hh"
28
29namespace blender {
30
31struct ReportList;
32struct Text;
33struct bContext;
34struct IDProperty;
35
36/* `bpy_interface_run.cc` */
37
38/* -------------------------------------------------------------------- */
44
59bool BPY_run_filepath(bContext *C, const char *filepath, ReportList *reports) ATTR_NONNULL(1, 2);
77bool BPY_run_text(bContext *C, Text *text, ReportList *reports, bool do_jump) ATTR_NONNULL(1, 2);
78
80
81/* -------------------------------------------------------------------- */
87
92bool BPY_string_compile_check(const char *expr);
99bool BPY_run_string_exec(bContext *C, const char *imports[], const char *expr);
106bool BPY_run_string_eval(bContext *C, const char *imports[], const char *expr);
107
119
141std::optional<IDProperty *> BPY_run_string_exec_with_locals_return_idprop(
142 bContext *C, StringRefNull script, IDProperty &locals, StringRefNull result_var_name);
143
145
146/* -------------------------------------------------------------------- */
151
167
178[[nodiscard]] bool BPY_run_string_as_number(bContext *C,
179 const char *imports[],
180 const char *expr,
181 BPy_RunErrInfo *err_info,
182 double *r_value) ATTR_NONNULL(1, 3, 5);
195[[nodiscard]] bool BPY_run_string_as_intptr(bContext *C,
196 const char *imports[],
197 const char *expr,
198 BPy_RunErrInfo *err_info,
199 intptr_t *r_value) ATTR_NONNULL(1, 3, 5);
211 const char *imports[],
212 const char *expr,
213 BPy_RunErrInfo *err_info,
214 char **r_value,
215 size_t *r_value_len) ATTR_NONNULL(1, 3, 5, 6);
216
218[[nodiscard]] bool BPY_run_string_as_string(bContext *C,
219 const char *imports[],
220 const char *expr,
221 BPy_RunErrInfo *err_info,
222 char **r_value) ATTR_NONNULL(1, 3, 5);
223
236 const char *imports[],
237 const char *expr,
238 BPy_RunErrInfo *err_info,
239 char **r_value,
240 size_t *r_value_len)
241 ATTR_NONNULL(1, 3, 5, 6);
242
245 const char *imports[],
246 const char *expr,
247 BPy_RunErrInfo *err_info,
248 char **r_value) ATTR_NONNULL(1, 3, 5);
249
251
252} // namespace blender
#define C
Definition RandGen.cpp:29
BMesh Iterators.
bool BPY_run_string_exec_with_locals(bContext *C, StringRefNull script, IDProperty &locals)
bool BPY_run_string_as_number(bContext *C, const char *imports[], const char *expr, BPy_RunErrInfo *err_info, double *r_value) ATTR_NONNULL(1
bool bool bool BPY_run_string_as_string_and_len(bContext *C, const char *imports[], const char *expr, BPy_RunErrInfo *err_info, char **r_value, size_t *r_value_len) ATTR_NONNULL(1
bool bool BPY_run_text(bContext *C, Text *text, ReportList *reports, bool do_jump) ATTR_NONNULL(1
bool BPY_run_filepath(bContext *C, const char *filepath, ReportList *reports) ATTR_NONNULL(1
bool BPY_run_string_eval(bContext *C, const char *imports[], const char *expr)
bool bool BPY_run_string_as_intptr(bContext *C, const char *imports[], const char *expr, BPy_RunErrInfo *err_info, intptr_t *r_value) ATTR_NONNULL(1
std::optional< IDProperty * > BPY_run_string_exec_with_locals_return_idprop(bContext *C, StringRefNull script, IDProperty &locals, StringRefNull result_var_name)
bool BPY_string_compile_check(const char *expr)
bool bool bool bool bool BPY_run_string_as_string_and_len_or_none(bContext *C, const char *imports[], const char *expr, BPy_RunErrInfo *err_info, char **r_value, size_t *r_value_len) ATTR_NONNULL(1
bool BPY_run_string_exec(bContext *C, const char *imports[], const char *expr)
void ATTR_NONNULL(1, 2)
bool bool bool bool BPY_run_string_as_string(bContext *C, const char *imports[], const char *expr, BPy_RunErrInfo *err_info, char **r_value) ATTR_NONNULL(1
_W64 int intptr_t
Definition BKE_text.h:119
bool bool bool bool bool bool BPY_run_string_as_string_or_none(bContext *C, const char *imports[], const char *expr, BPy_RunErrInfo *err_info, char **r_value) ATTR_NONNULL(1