Changeset View
Changeset View
Standalone View
Standalone View
source/blender/python/intern/bpy_rna.c
| Context not available. | |||||
| } | } | ||||
| /* TODO - multiple return values like with rna functions */ | /* TODO - multiple return values like with rna functions */ | ||||
| static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms) | int BPY_class_call_ex(bContext *C, void *call_func, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms) | ||||
| { | { | ||||
| PyObject *args; | PyObject *args; | ||||
| PyObject *ret = NULL, *py_srna = NULL, *py_class_instance = NULL, *parmitem; | PyObject *ret = NULL, *py_srna = NULL, *py_class_instance = NULL, *parmitem; | ||||
| Context not available. | |||||
| /* Initializing the class worked, now run its invoke function */ | /* Initializing the class worked, now run its invoke function */ | ||||
| if (err != -1 && (is_staticmethod || is_classmethod || py_class_instance)) { | if (err != -1 && (is_staticmethod || is_classmethod || py_class_instance)) { | ||||
| PyObject *item = PyObject_GetAttrString((PyObject *)py_class, RNA_function_identifier(func)); | PyObject *item; | ||||
| if (call_func) | |||||
| item = call_func; | |||||
| else | |||||
| item = PyObject_GetAttrString((PyObject *)py_class, RNA_function_identifier(func)); | |||||
| if (item) { | if (item) { | ||||
| RNA_pointer_create(NULL, &RNA_Function, func, &funcptr); | RNA_pointer_create(NULL, &RNA_Function, func, &funcptr); | ||||
| Context not available. | |||||
| #endif | #endif | ||||
| RNA_parameter_list_end(&iter); | RNA_parameter_list_end(&iter); | ||||
| Py_DECREF(item); | if (!call_func) | ||||
| Py_DECREF(item); | |||||
| Py_DECREF(args); | Py_DECREF(args); | ||||
| } | } | ||||
| else { | else { | ||||
| Context not available. | |||||
| return err; | return err; | ||||
| } | } | ||||
| static int bpy_class_call(bContext *C, PointerRNA *ptr, FunctionRNA *func, ParameterList *parms) | |||||
| { | |||||
| return BPY_class_call_ex(C, NULL, ptr, func, parms); | |||||
| } | |||||
| static void bpy_class_free(void *pyob_ptr) | static void bpy_class_free(void *pyob_ptr) | ||||
| { | { | ||||
| PyObject *self = (PyObject *)pyob_ptr; | PyObject *self = (PyObject *)pyob_ptr; | ||||
| Context not available. | |||||