Merged changes in the trunk up to revision 46309.

Conflicts resolved:
source/blender/blenloader/intern/readfile.c
source/blender/editors/interface/resources.c
source/blender/editors/mesh/editmesh_tools.c
This commit is contained in:
Tamito Kajiyama
2012-05-05 11:40:42 +00:00
783 changed files with 31199 additions and 23765 deletions

View File

@@ -127,13 +127,13 @@ static PyObject *bpy_blend_paths(PyObject *UNUSED(self), PyObject *args, PyObjec
return NULL;
}
if (absolute) flag |= BPATH_TRAVERSE_ABS;
if (!packed) flag |= BPATH_TRAVERSE_SKIP_PACKED;
if (local) flag |= BPATH_TRAVERSE_SKIP_LIBRARY;
if (absolute) flag |= BLI_BPATH_TRAVERSE_ABS;
if (!packed) flag |= BLI_BPATH_TRAVERSE_SKIP_PACKED;
if (local) flag |= BLI_BPATH_TRAVERSE_SKIP_LIBRARY;
list = PyList_New(0);
bpath_traverse_main(G.main, bpy_blend_paths_visit_cb, flag, (void *)list);
BLI_bpath_traverse_main(G.main, bpy_blend_paths_visit_cb, flag, (void *)list);
return list;
}

View File

@@ -225,7 +225,7 @@ PyObject *BPY_app_handlers_struct(void)
funcstore->func = bpy_app_generic_callback;
funcstore->alloc = 0;
funcstore->arg = SET_INT_IN_POINTER(pos);
BLI_add_cb(funcstore, pos);
BLI_callback_add(funcstore, pos);
}
}

View File

@@ -1071,8 +1071,8 @@ static EnumPropertyItem *enum_items_from_py(PyObject *seq_fast, PyObject *def, i
else {
MEM_freeN(items);
PyErr_SetString(PyExc_TypeError,
"EnumProperty(...): expected an tuple containing "
"(identifier, name description) and optionally a "
"EnumProperty(...): expected a tuple containing "
"(identifier, name, description) and optionally a "
"unique number");
return NULL;
}

View File

@@ -1424,7 +1424,8 @@ int pyrna_pydict_to_props(PointerRNA *ptr, PyObject *kw, int all_args, const cha
totkw = kw ? PyDict_Size(kw) : 0;
RNA_STRUCT_BEGIN (ptr, prop) {
RNA_STRUCT_BEGIN (ptr, prop)
{
arg_name = RNA_property_identifier(prop);
if (strcmp(arg_name, "rna_type") == 0) continue;
@@ -2203,7 +2204,8 @@ int pyrna_prop_collection_subscript_str_lib_pair_ptr(BPy_PropertyRNA *self, PyOb
/* lib is either a valid poniter or NULL,
* either way can do direct comparison with id.lib */
RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) {
RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop)
{
ID *id = itemptr.data; /* always an ID */
if (id->lib == lib && (strncmp(keyname, id->name + 2, sizeof(id->name) - 2) == 0)) {
found = TRUE;
@@ -3346,7 +3348,8 @@ static void pyrna_dir_members_rna(PyObject *list, PointerRNA *ptr)
RNA_pointer_create(NULL, &RNA_Struct, ptr->type, &tptr);
iterprop = RNA_struct_find_property(&tptr, "functions");
RNA_PROP_BEGIN (&tptr, itemptr, iterprop) {
RNA_PROP_BEGIN (&tptr, itemptr, iterprop)
{
idname = RNA_function_identifier(itemptr.data);
pystring = PyUnicode_FromString(idname);
@@ -3365,7 +3368,8 @@ static void pyrna_dir_members_rna(PyObject *list, PointerRNA *ptr)
iterprop = RNA_struct_iterator_property(ptr->type);
RNA_PROP_BEGIN (ptr, itemptr, iterprop) {
RNA_PROP_BEGIN (ptr, itemptr, iterprop)
{
nameptr = RNA_struct_name_get_alloc(&itemptr, name, sizeof(name), &namelen);
if (nameptr) {
@@ -3980,7 +3984,8 @@ static PyObject *pyrna_prop_collection_keys(BPy_PropertyRNA *self)
char name[256], *nameptr;
int namelen;
RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) {
RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop)
{
nameptr = RNA_struct_name_get_alloc(&itemptr, name, sizeof(name), &namelen);
if (nameptr) {
@@ -4017,7 +4022,8 @@ static PyObject *pyrna_prop_collection_items(BPy_PropertyRNA *self)
int namelen;
int i = 0;
RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) {
RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop)
{
if (itemptr.data) {
/* add to python list */
item = PyTuple_New(2);
@@ -4189,7 +4195,8 @@ static PyObject *pyrna_prop_collection_find(BPy_PropertyRNA *self, PyObject *key
PYRNA_PROP_CHECK_OBJ(self);
RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) {
RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop)
{
nameptr = RNA_struct_name_get_alloc(&itemptr, name, sizeof(name), &namelen);
if (nameptr) {
@@ -4220,7 +4227,8 @@ static void foreach_attr_type(BPy_PropertyRNA *self, const char *attr,
*attr_signed = FALSE;
/* note: this is fail with zero length lists, so don't let this get caled in that case */
RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) {
RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop)
{
prop = RNA_struct_find_property(&itemptr, attr);
*raw_type = RNA_property_raw_type(prop);
*attr_tot = RNA_property_array_length(&itemptr, prop);
@@ -6246,6 +6254,31 @@ PyObject *pyrna_prop_CreatePyObject(PointerRNA *ptr, PropertyRNA *prop)
return (PyObject *)pyrna;
}
/* utility func to be used by external modules, *sneaky!* */
PyObject *pyrna_id_CreatePyObject(ID *id)
{
if (id) {
PointerRNA ptr;
RNA_id_pointer_create(id, &ptr);
return pyrna_struct_CreatePyObject(&ptr);
}
else {
Py_RETURN_NONE;
}
}
int pyrna_id_FromPyObject(PyObject *obj, ID **id)
{
if (BPy_StructRNA_Check(obj) && (RNA_struct_is_ID(((BPy_StructRNA *)obj)->ptr.type))) {
*id = ((BPy_StructRNA *)obj)->ptr.id.data;
return TRUE;
}
else {
*id = NULL;
return FALSE;
}
}
void BPY_rna_init(void)
{
#ifdef USE_MATHUTILS // register mathutils callbacks, ok to run more then once.
@@ -6401,7 +6434,8 @@ static PyObject *pyrna_basetype_dir(BPy_BaseTypeRNA *self)
PyObject *ret = PyList_New(0);
PyObject *item;
RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop) {
RNA_PROP_BEGIN (&self->ptr, itemptr, self->prop)
{
StructRNA *srna = itemptr.data;
StructRNA *srna_base = RNA_struct_base(itemptr.data);
/* skip own operators, these double up [#29666] */
@@ -7189,7 +7223,8 @@ void pyrna_alloc_types(void)
RNA_blender_rna_pointer_create(&ptr);
prop = RNA_struct_find_property(&ptr, "structs");
RNA_PROP_BEGIN (&ptr, itemptr, prop) {
RNA_PROP_BEGIN (&ptr, itemptr, prop)
{
PyObject *item = pyrna_struct_Subtype(&itemptr);
if (item == NULL) {
if (PyErr_Occurred()) {
@@ -7217,7 +7252,8 @@ void pyrna_free_types(void)
prop = RNA_struct_find_property(&ptr, "structs");
RNA_PROP_BEGIN (&ptr, itemptr, prop) {
RNA_PROP_BEGIN (&ptr, itemptr, prop)
{
StructRNA *srna = srna_from_ptr(&itemptr);
void *py_ptr = RNA_struct_py_type_get(srna);
@@ -7475,9 +7511,9 @@ static PyObject *pyrna_unregister_class(PyObject *UNUSED(self), PyObject *py_cla
prop_rna = RNA_struct_find_property(&ptr_rna, "structs");
/* loop over all structs */
RNA_PROP_BEGIN (&ptr_rna, itemptr, prop_rna) {
RNA_PROP_BEGIN (&ptr_rna, itemptr, prop_rna)
{
srna_iter = itemptr.data;
if (pyrna_srna_contains_pointer_prop_srna(srna_iter, srna, &prop_identifier)) {
break;