This commit is contained in:
2011-08-16 18:59:45 +00:00
parent 360fcd73fe
commit c7fce6be2e
200 changed files with 16204 additions and 14830 deletions

View File

@@ -52,6 +52,9 @@
#include "WM_types.h"
#include "MEM_guardedalloc.h"
#include "BLI_ghash.h"
#include "BKE_report.h"
#include "BKE_context.h"
@@ -359,15 +362,18 @@ static PyObject *pyop_as_string(PyObject *UNUSED(self), PyObject *args)
static PyObject *pyop_dir(PyObject *UNUSED(self))
{
GHashIterator *iter= WM_operatortype_iter();
PyObject *list= PyList_New(0), *name;
wmOperatorType *ot;
for(ot= WM_operatortype_first(); ot; ot= ot->next) {
for( ; !BLI_ghashIterator_isDone(iter); BLI_ghashIterator_step(iter)) {
wmOperatorType *ot= BLI_ghashIterator_getValue(iter);
name= PyUnicode_FromString(ot->idname);
PyList_Append(list, name);
Py_DECREF(name);
}
BLI_ghashIterator_free(iter);
return list;
}

View File

@@ -856,7 +856,7 @@ static PyObject *pyrna_prop_str(BPy_PropertyRNA *self)
if(type==PROP_COLLECTION) {
len= pyrna_prop_collection_length(self);
}
else if (RNA_property_array_check(&self->ptr, self->prop)) {
else if (RNA_property_array_check(self->prop)) {
len= pyrna_prop_array_length((BPy_PropertyArrayRNA *)self);
}
@@ -1224,7 +1224,7 @@ PyObject *pyrna_prop_to_py(PointerRNA *ptr, PropertyRNA *prop)
PyObject *ret;
int type= RNA_property_type(prop);
if (RNA_property_array_check(ptr, prop)) {
if (RNA_property_array_check(prop)) {
return pyrna_py_from_array(ptr, prop);
}
@@ -1369,7 +1369,7 @@ static int pyrna_py_to_prop(PointerRNA *ptr, PropertyRNA *prop, void *data, PyOb
int type= RNA_property_type(prop);
if (RNA_property_array_check(ptr, prop)) {
if (RNA_property_array_check(prop)) {
/* done getting the length */
if(pyrna_py_to_array(ptr, prop, data, value, error_prefix) == -1) {
return -1;
@@ -4088,7 +4088,7 @@ static PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *dat
int type= RNA_property_type(prop);
int flag= RNA_property_flag(prop);
if(RNA_property_array_check(ptr, prop)) {
if(RNA_property_array_check(prop)) {
int a, len;
if (flag & PROP_DYNAMIC) {
@@ -5519,7 +5519,7 @@ PyObject *pyrna_prop_CreatePyObject(PointerRNA *ptr, PropertyRNA *prop)
{
BPy_PropertyRNA *pyrna;
if (RNA_property_array_check(ptr, prop) == 0) {
if (RNA_property_array_check(prop) == 0) {
PyTypeObject *type;
if (RNA_property_type(prop) != PROP_COLLECTION) {

View File

@@ -107,7 +107,7 @@ static int pyrna_struct_anim_args_parse(PointerRNA *ptr, const char *error_prefi
return -1;
}
if(RNA_property_array_check(&r_ptr, prop) == 0) {
if(RNA_property_array_check(prop) == 0) {
if((*index) == -1) {
*index= 0;
}

View File

@@ -285,17 +285,20 @@ static char *copy_values(PyObject *seq, PointerRNA *ptr, PropertyRNA *prop, int
int totdim= RNA_property_array_dimension(ptr, prop, NULL);
const int seq_size= PySequence_Size(seq);
/* General note for 'data' being NULL or PySequence_GetItem() failing.
/* Regarding PySequence_GetItem() failing.
*
* This should never be NULL since we validated it, _but_ some triky python
* developer could write their own sequence type which succeeds on
* validating but fails later somehow, so include checks for safety. */
* validating but fails later somehow, so include checks for safety.
*/
/* Note that 'data can be NULL' */
if(seq_size == -1) {
return NULL;
}
for (i= 0; (i < seq_size) && data; i++) {
for (i= 0; i < seq_size; i++) {
PyObject *item= PySequence_GetItem(seq, i);
if(item) {
if (dim + 1 < totdim) {