Blender V2.61 - r43446
|
#include <Python.h>
#include "RNA_types.h"
#include "bpy_rna.h"
#include "BKE_global.h"
#include "MEM_guardedalloc.h"
#include "RNA_access.h"
Go to the source code of this file.
Defines | |
#define | USE_MATHUTILS |
#define | MAX_ARRAY_DIMENSION 10 |
Typedefs | |
typedef void(* | ItemConvertFunc )(PyObject *, char *) |
typedef int(* | ItemTypeCheckFunc )(PyObject *) |
typedef void(* | RNA_SetArrayFunc )(PointerRNA *, PropertyRNA *, const char *) |
typedef void(* | RNA_SetIndexFunc )(PointerRNA *, PropertyRNA *, int index, void *) |
Functions | |
static int | validate_array_type (PyObject *seq, int dim, int totdim, int dimsize[], ItemTypeCheckFunc check_item_type, const char *item_type_str, const char *error_prefix) |
static int | count_items (PyObject *seq, int dim) |
static int | validate_array_length (PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, int *totitem, const char *error_prefix) |
static int | validate_array (PyObject *rvalue, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, ItemTypeCheckFunc check_item_type, const char *item_type_str, int *totitem, const char *error_prefix) |
static char * | copy_value_single (PyObject *item, PointerRNA *ptr, PropertyRNA *prop, char *data, unsigned int item_size, int *index, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index) |
static char * | copy_values (PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int dim, char *data, unsigned int item_size, int *index, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index) |
static int | py_to_array (PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, char *param_data, ItemTypeCheckFunc check_item_type, const char *item_type_str, int item_size, ItemConvertFunc convert_item, RNA_SetArrayFunc rna_set_array, const char *error_prefix) |
static int | py_to_array_index (PyObject *py, PointerRNA *ptr, PropertyRNA *prop, int lvalue_dim, int arrayoffset, int index, ItemTypeCheckFunc check_item_type, const char *item_type_str, ItemConvertFunc convert_item, RNA_SetIndexFunc rna_set_index, const char *error_prefix) |
static void | py_to_float (PyObject *py, char *data) |
static void | py_to_int (PyObject *py, char *data) |
static void | py_to_bool (PyObject *py, char *data) |
static int | py_float_check (PyObject *py) |
static int | py_int_check (PyObject *py) |
static int | py_bool_check (PyObject *py) |
static void | float_set_index (PointerRNA *ptr, PropertyRNA *prop, int index, void *value) |
static void | int_set_index (PointerRNA *ptr, PropertyRNA *prop, int index, void *value) |
static void | bool_set_index (PointerRNA *ptr, PropertyRNA *prop, int index, void *value) |
int | pyrna_py_to_array (PointerRNA *ptr, PropertyRNA *prop, char *param_data, PyObject *py, const char *error_prefix) |
int | pyrna_py_to_array_index (PointerRNA *ptr, PropertyRNA *prop, int arraydim, int arrayoffset, int index, PyObject *py, const char *error_prefix) |
PyObject * | pyrna_array_index (PointerRNA *ptr, PropertyRNA *prop, int index) |
PyObject * | pyrna_py_from_array_index (BPy_PropertyArrayRNA *self, PointerRNA *ptr, PropertyRNA *prop, int index) |
PyObject * | pyrna_py_from_array (PointerRNA *ptr, PropertyRNA *prop) |
int | pyrna_array_contains_py (PointerRNA *ptr, PropertyRNA *prop, PyObject *value) |
This file deals with array access for 'BPy_PropertyArrayRNA' from bpy_rna.c
Definition in file bpy_rna_array.c.
#define MAX_ARRAY_DIMENSION 10 |
Definition at line 45 of file bpy_rna_array.c.
Referenced by py_to_array_index(), pyrna_py_from_array_index(), validate_array(), and validate_array_length().
#define USE_MATHUTILS |
Definition at line 39 of file bpy_rna_array.c.
typedef void(* ItemConvertFunc)(PyObject *, char *) |
Definition at line 47 of file bpy_rna_array.c.
typedef int(* ItemTypeCheckFunc)(PyObject *) |
Definition at line 48 of file bpy_rna_array.c.
typedef void(* RNA_SetArrayFunc)(PointerRNA *, PropertyRNA *, const char *) |
Definition at line 49 of file bpy_rna_array.c.
typedef void(* RNA_SetIndexFunc)(PointerRNA *, PropertyRNA *, int index, void *) |
Definition at line 50 of file bpy_rna_array.c.
static void bool_set_index | ( | PointerRNA * | ptr, |
PropertyRNA * | prop, | ||
int | index, | ||
void * | value | ||
) | [static] |
Definition at line 543 of file bpy_rna_array.c.
References RNA_property_boolean_set_index().
Referenced by pyrna_py_to_array_index().
static char* copy_value_single | ( | PyObject * | item, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
char * | data, | ||
unsigned int | item_size, | ||
int * | index, | ||
ItemConvertFunc | convert_item, | ||
RNA_SetIndexFunc | rna_set_index | ||
) | [static] |
Definition at line 316 of file bpy_rna_array.c.
References data.
Referenced by copy_values(), and py_to_array_index().
static char* copy_values | ( | PyObject * | seq, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
int | dim, | ||
char * | data, | ||
unsigned int | item_size, | ||
int * | index, | ||
ItemConvertFunc | convert_item, | ||
RNA_SetIndexFunc | rna_set_index | ||
) | [static] |
Definition at line 335 of file bpy_rna_array.c.
References copy_value_single(), data, i, MatrixObject_Check, NULL, MatrixObject::num_col, MatrixObject::num_row, and RNA_property_array_dimension().
Referenced by py_to_array(), and py_to_array_index().
static int count_items | ( | PyObject * | seq, |
int | dim | ||
) | [static] |
Definition at line 154 of file bpy_rna_array.c.
References i.
Referenced by validate_array_length().
static void float_set_index | ( | PointerRNA * | ptr, |
PropertyRNA * | prop, | ||
int | index, | ||
void * | value | ||
) | [static] |
Definition at line 533 of file bpy_rna_array.c.
References RNA_property_float_set_index().
Referenced by pyrna_py_to_array_index().
static void int_set_index | ( | PointerRNA * | ptr, |
PropertyRNA * | prop, | ||
int | index, | ||
void * | value | ||
) | [static] |
Definition at line 538 of file bpy_rna_array.c.
References RNA_property_int_set_index().
Referenced by pyrna_py_to_array_index().
static int py_bool_check | ( | PyObject * | py | ) | [static] |
Definition at line 528 of file bpy_rna_array.c.
Referenced by pyrna_py_to_array(), and pyrna_py_to_array_index().
static int py_float_check | ( | PyObject * | py | ) | [static] |
Definition at line 516 of file bpy_rna_array.c.
Referenced by pyrna_py_to_array(), and pyrna_py_to_array_index().
static int py_int_check | ( | PyObject * | py | ) | [static] |
Definition at line 522 of file bpy_rna_array.c.
Referenced by pyrna_py_to_array(), and pyrna_py_to_array_index().
static int py_to_array | ( | PyObject * | seq, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
char * | param_data, | ||
ItemTypeCheckFunc | check_item_type, | ||
const char * | item_type_str, | ||
int | item_size, | ||
ItemConvertFunc | convert_item, | ||
RNA_SetArrayFunc | rna_set_array, | ||
const char * | error_prefix | ||
) | [static] |
Definition at line 398 of file bpy_rna_array.c.
References ParameterDynAlloc::array, ParameterDynAlloc::array_tot, copy_values(), data, MEM_callocN(), NULL, PROP_DYNAMIC, RNA_property_flag(), and validate_array().
Referenced by pyrna_py_to_array().
static int py_to_array_index | ( | PyObject * | py, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
int | lvalue_dim, | ||
int | arrayoffset, | ||
int | index, | ||
ItemTypeCheckFunc | check_item_type, | ||
const char * | item_type_str, | ||
ItemConvertFunc | convert_item, | ||
RNA_SetIndexFunc | rna_set_index, | ||
const char * | error_prefix | ||
) | [static] |
Definition at line 452 of file bpy_rna_array.c.
References copy_value_single(), copy_values(), i, MAX_ARRAY_DIMENSION, NULL, RNA_property_array_dimension(), RNA_property_identifier(), RNA_struct_identifier(), PointerRNA::type, and validate_array().
Referenced by pyrna_py_to_array_index().
static void py_to_bool | ( | PyObject * | py, |
char * | data | ||
) | [static] |
Definition at line 511 of file bpy_rna_array.c.
Referenced by pyrna_py_to_array(), and pyrna_py_to_array_index().
static void py_to_float | ( | PyObject * | py, |
char * | data | ||
) | [static] |
Definition at line 501 of file bpy_rna_array.c.
Referenced by pyrna_py_to_array(), and pyrna_py_to_array_index().
static void py_to_int | ( | PyObject * | py, |
char * | data | ||
) | [static] |
Definition at line 506 of file bpy_rna_array.c.
Referenced by pyrna_py_to_array(), and pyrna_py_to_array_index().
int pyrna_array_contains_py | ( | PointerRNA * | ptr, |
PropertyRNA * | prop, | ||
PyObject * | value | ||
) |
Definition at line 713 of file bpy_rna_array.c.
References i, len(), NULL, PROP_BOOLEAN, PROP_FLOAT, PROP_INT, RNA_property_array_dimension(), RNA_property_array_length(), RNA_property_boolean_get_array(), RNA_property_float_get_array(), RNA_property_int_get_array(), and RNA_property_type().
Referenced by pyrna_prop_array_contains().
PyObject* pyrna_array_index | ( | PointerRNA * | ptr, |
PropertyRNA * | prop, | ||
int | index | ||
) |
Definition at line 598 of file bpy_rna_array.c.
References NULL, PROP_BOOLEAN, PROP_FLOAT, PROP_INT, RNA_property_boolean_get_index(), RNA_property_float_get_index(), RNA_property_int_get_index(), and RNA_property_type().
Referenced by pyrna_py_from_array_index(), and pyrna_struct_path_resolve().
PyObject* pyrna_py_from_array | ( | PointerRNA * | ptr, |
PropertyRNA * | prop | ||
) |
Definition at line 700 of file bpy_rna_array.c.
References pyrna_math_object_from_array(), and pyrna_prop_CreatePyObject().
Referenced by pyrna_prop_to_py().
PyObject* pyrna_py_from_array_index | ( | BPy_PropertyArrayRNA * | self, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
int | index | ||
) |
Definition at line 655 of file bpy_rna_array.c.
References BPy_PropertyArrayRNA::arraydim, BPy_PropertyArrayRNA::arrayoffset, G, G_DEBUG, i, len(), MAX_ARRAY_DIMENSION, NULL, pyrna_array_index(), pyrna_prop_CreatePyObject(), RNA_property_array_dimension(), and RNA_property_multi_array_length().
Referenced by pyrna_prop_array_to_py_index().
int pyrna_py_to_array | ( | PointerRNA * | ptr, |
PropertyRNA * | prop, | ||
char * | param_data, | ||
PyObject * | py, | ||
const char * | error_prefix | ||
) |
Definition at line 548 of file bpy_rna_array.c.
References PROP_BOOLEAN, PROP_FLOAT, PROP_INT, py_bool_check(), py_float_check(), py_int_check(), py_to_array(), py_to_bool(), py_to_float(), py_to_int(), RNA_property_boolean_set_array(), RNA_property_float_set_array(), RNA_property_int_set_array(), and RNA_property_type().
Referenced by pyrna_py_to_prop().
int pyrna_py_to_array_index | ( | PointerRNA * | ptr, |
PropertyRNA * | prop, | ||
int | arraydim, | ||
int | arrayoffset, | ||
int | index, | ||
PyObject * | py, | ||
const char * | error_prefix | ||
) |
Definition at line 573 of file bpy_rna_array.c.
References bool_set_index(), float_set_index(), int_set_index(), PROP_BOOLEAN, PROP_FLOAT, PROP_INT, py_bool_check(), py_float_check(), py_int_check(), py_to_array_index(), py_to_bool(), py_to_float(), py_to_int(), and RNA_property_type().
Referenced by pyrna_py_to_prop_array_index().
static int validate_array | ( | PyObject * | rvalue, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
int | lvalue_dim, | ||
ItemTypeCheckFunc | check_item_type, | ||
const char * | item_type_str, | ||
int * | totitem, | ||
const char * | error_prefix | ||
) | [static] |
Definition at line 264 of file bpy_rna_array.c.
References BaseMath_ReadCallback, MatrixObject_Check, MAX_ARRAY_DIMENSION, MatrixObject::num_col, MatrixObject::num_row, PROP_FLOAT, RNA_property_array_dimension(), RNA_property_identifier(), RNA_property_type(), RNA_struct_identifier(), PointerRNA::type, validate_array_length(), and validate_array_type().
Referenced by py_to_array(), and py_to_array_index().
static int validate_array_length | ( | PyObject * | rvalue, |
PointerRNA * | ptr, | ||
PropertyRNA * | prop, | ||
int | lvalue_dim, | ||
int * | totitem, | ||
const char * | error_prefix | ||
) | [static] |
Definition at line 188 of file bpy_rna_array.c.
References count_items(), i, len(), MAX_ARRAY_DIMENSION, PROP_DYNAMIC, RNA_property_array_dimension(), RNA_property_array_length(), RNA_property_flag(), RNA_property_identifier(), RNA_struct_identifier(), and PointerRNA::type.
Referenced by validate_array().
static int validate_array_type | ( | PyObject * | seq, |
int | dim, | ||
int | totdim, | ||
int | dimsize[], | ||
ItemTypeCheckFunc | check_item_type, | ||
const char * | item_type_str, | ||
const char * | error_prefix | ||
) | [static] |
Definition at line 67 of file bpy_rna_array.c.
Referenced by validate_array().