Cleanup: rename BPy_GetContext -> BPY_context_get

Matching BPY_context_set.
This commit is contained in:
2020-10-15 18:20:15 +11:00
parent 5531697f6d
commit f1aa55b6e9
8 changed files with 34 additions and 34 deletions

View File

@@ -462,7 +462,7 @@ static int mathutils_rna_vector_set(BaseMathObject *bmo, int subtype)
RNA_property_float_set_array(&self->ptr, self->prop, bmo->data);
if (RNA_property_update_check(self->prop)) {
RNA_property_update(BPy_GetContext(), &self->ptr, self->prop);
RNA_property_update(BPY_context_get(), &self->ptr, self->prop);
}
/* Euler order exception. */
@@ -473,7 +473,7 @@ static int mathutils_rna_vector_set(BaseMathObject *bmo, int subtype)
if (order != eul->order) {
RNA_property_enum_set(&self->ptr, prop_eul_order, eul->order);
if (RNA_property_update_check(prop_eul_order)) {
RNA_property_update(BPy_GetContext(), &self->ptr, prop_eul_order);
RNA_property_update(BPY_context_get(), &self->ptr, prop_eul_order);
}
}
}
@@ -522,7 +522,7 @@ static int mathutils_rna_vector_set_index(BaseMathObject *bmo, int UNUSED(subtyp
RNA_property_float_set_index(&self->ptr, self->prop, index, bmo->data[index]);
if (RNA_property_update_check(self->prop)) {
RNA_property_update(BPy_GetContext(), &self->ptr, self->prop);
RNA_property_update(BPY_context_get(), &self->ptr, self->prop);
}
return 0;
@@ -581,7 +581,7 @@ static int mathutils_rna_matrix_set(BaseMathObject *bmo, int UNUSED(subtype))
RNA_property_float_set_array(&self->ptr, self->prop, bmo->data);
if (RNA_property_update_check(self->prop)) {
RNA_property_update(BPy_GetContext(), &self->ptr, self->prop);
RNA_property_update(BPY_context_get(), &self->ptr, self->prop);
}
return 0;
}
@@ -1234,7 +1234,7 @@ static const char *pyrna_enum_as_string(PointerRNA *ptr, PropertyRNA *prop)
const char *result;
bool free = false;
RNA_property_enum_items(BPy_GetContext(), ptr, prop, &item, NULL, &free);
RNA_property_enum_items(BPY_context_get(), ptr, prop, &item, NULL, &free);
if (item) {
result = BPy_enum_as_string(item);
}
@@ -1262,7 +1262,7 @@ static int pyrna_string_to_enum(
return -1;
}
if (!RNA_property_enum_value(BPy_GetContext(), ptr, prop, param, r_value)) {
if (!RNA_property_enum_value(BPY_context_get(), ptr, prop, param, r_value)) {
const char *enum_str = pyrna_enum_as_string(ptr, prop);
PyErr_Format(PyExc_TypeError,
"%.200s enum \"%.200s\" not found in (%s)",
@@ -1404,7 +1404,7 @@ static int pyrna_prop_to_enum_bitfield(
return -1;
}
RNA_property_enum_items(BPy_GetContext(), ptr, prop, &item, NULL, &free);
RNA_property_enum_items(BPY_context_get(), ptr, prop, &item, NULL, &free);
if (item) {
ret = pyrna_set_to_enum_bitfield(item, value, r_value, error_prefix);
@@ -1456,7 +1456,7 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val)
ret = PySet_New(NULL);
if (RNA_property_enum_bitflag_identifiers(BPy_GetContext(), ptr, prop, val, identifier)) {
if (RNA_property_enum_bitflag_identifiers(BPY_context_get(), ptr, prop, val, identifier)) {
int index;
for (index = 0; identifier[index]; index++) {
@@ -1468,7 +1468,7 @@ static PyObject *pyrna_enum_to_py(PointerRNA *ptr, PropertyRNA *prop, int val)
}
else {
const char *identifier;
if (RNA_property_enum_identifier(BPy_GetContext(), ptr, prop, val, &identifier)) {
if (RNA_property_enum_identifier(BPY_context_get(), ptr, prop, val, &identifier)) {
ret = PyUnicode_FromString(identifier);
}
else {
@@ -2217,7 +2217,7 @@ static int pyrna_py_to_prop(
/* Run RNA property functions. */
if (RNA_property_update_check(prop)) {
RNA_property_update(BPy_GetContext(), ptr, prop);
RNA_property_update(BPY_context_get(), ptr, prop);
}
return 0;
@@ -2293,7 +2293,7 @@ static int pyrna_py_to_prop_array_index(BPy_PropertyArrayRNA *self, int index, P
/* Run RNA property functions. */
if (RNA_property_update_check(prop)) {
RNA_property_update(BPy_GetContext(), ptr, prop);
RNA_property_update(BPY_context_get(), ptr, prop);
}
return ret;
@@ -3297,7 +3297,7 @@ static int pyrna_prop_array_ass_subscript(BPy_PropertyArrayRNA *self,
if (ret != -1) {
if (RNA_property_update_check(self->prop)) {
RNA_property_update(BPy_GetContext(), &self->ptr, self->prop);
RNA_property_update(BPY_context_get(), &self->ptr, self->prop);
}
}
@@ -3967,7 +3967,7 @@ PyDoc_STRVAR(pyrna_prop_update_doc,
" however in rare cases it's useful to call explicitly.\n");
static PyObject *pyrna_prop_update(BPy_PropertyRNA *self)
{
RNA_property_update(BPy_GetContext(), &self->ptr, self->prop);
RNA_property_update(BPY_context_get(), &self->ptr, self->prop);
Py_RETURN_NONE;
}
@@ -6299,7 +6299,7 @@ static PyObject *pyrna_func_call(BPy_FunctionRNA *self, PyObject *args, PyObject
if (err == 0) {
/* Call function. */
ReportList reports;
bContext *C = BPy_GetContext();
bContext *C = BPY_context_get();
BKE_reports_init(&reports, RPT_STORE);
RNA_function_call(C, &reports, self_ptr, self_func, &parms);
@@ -8320,7 +8320,7 @@ static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, Param
/* XXX, this is needed because render engine calls without a context
* this should be supported at some point, but at the moment it's not! */
if (C == NULL) {
C = BPy_GetContext();
C = BPY_context_get();
}
/* Annoying! We need to check if the screen gets set to NULL which is a
@@ -8789,7 +8789,7 @@ static PyObject *pyrna_register_class(PyObject *UNUSED(self), PyObject *py_class
}
/* Get the context, so register callback can do necessary refreshes. */
C = BPy_GetContext();
C = BPY_context_get();
/* Call the register callback with reports & identifier. */
BKE_reports_init(&reports, RPT_STORE);
@@ -9000,7 +9000,7 @@ static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_cla
}
/* Get the context, so register callback can do necessary refreshes. */
C = BPy_GetContext();
C = BPY_context_get();
/* Call unregister. */
unreg(CTX_data_main(C), srna); /* Calls bpy_class_free, this decref's py_class. */