Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2008-12-31 16:16:37 +0300
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2008-12-31 16:16:37 +0300
commitba91587183105fb7edcab3d4f4e37ce0078bd86e (patch)
tree5c07e3461a6c1aaea30397c6d1bbc2e88b588dc9 /source/blender/blenloader
parent28d0bab8ed913629fc02463156bb8fade7dfe886 (diff)
RNA
* Store RNA collections different in ID properties, using a generic ID property array, using the patch provided by Joe. * Fix bug accessing registered operator properties in the wm from the outliner. * In the outliner, only use the RNA icon for RNA data, and use dot again for unknown icon. * Also, show pointer properties data in the second column, and auto expand two levels when opening them. * Added small RNA_struct_defined_properties function to get only the defined properties without builtin and undefined id properties (for py operators).
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r--source/blender/blenloader/intern/readfile.c21
-rw-r--r--source/blender/blenloader/intern/writefile.c19
2 files changed, 39 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index c52a70ab2a4..f1d9223b3c5 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -1346,6 +1346,24 @@ static void test_pointer_array(FileData *fd, void **mat)
void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, FileData *fd);
void IDP_LibLinkProperty(IDProperty *prop, int switch_endian, FileData *fd);
+static void IDP_DirectLinkIDPArray(IDProperty *prop, int switch_endian, FileData *fd)
+{
+ IDProperty **array;
+ int i;
+
+ /*since we didn't save the extra buffer, set totallen to len.*/
+ prop->totallen = prop->len;
+ prop->data.pointer = newdataadr(fd, prop->data.pointer);
+
+ if (switch_endian) {
+ test_pointer_array(fd, prop->data.pointer);
+ array= (IDProperty**) prop->data.pointer;
+
+ for(i=0; i<prop->len; i++)
+ IDP_DirectLinkProperty(array[i], switch_endian, fd);
+ }
+}
+
static void IDP_DirectLinkArray(IDProperty *prop, int switch_endian, FileData *fd)
{
IDProperty **array;
@@ -1407,6 +1425,9 @@ void IDP_DirectLinkProperty(IDProperty *prop, int switch_endian, FileData *fd)
case IDP_ARRAY:
IDP_DirectLinkArray(prop, switch_endian, fd);
break;
+ case IDP_IDPARRAY:
+ IDP_DirectLinkIDPArray(prop, switch_endian, fd);
+ break;
case IDP_DOUBLE:
/*erg, stupid doubles. since I'm storing them
in the same field as int val; val2 in the
diff --git a/source/blender/blenloader/intern/writefile.c b/source/blender/blenloader/intern/writefile.c
index 836e2dd1958..c4b02febe10 100644
--- a/source/blender/blenloader/intern/writefile.c
+++ b/source/blender/blenloader/intern/writefile.c
@@ -391,7 +391,7 @@ static void IDP_WriteArray(IDProperty *prop, void *wd)
if (prop->data.pointer) {
writedata(wd, DATA, MEM_allocN_len(prop->data.pointer), prop->data.pointer);
- if(prop->type == IDP_GROUP) {
+ if(prop->subtype == IDP_GROUP) {
IDProperty **array= prop->data.pointer;
int a;
@@ -401,6 +401,20 @@ static void IDP_WriteArray(IDProperty *prop, void *wd)
}
}
+static void IDP_WriteIDPArray(IDProperty *prop, void *wd)
+{
+ /*REMEMBER to set totalen to len in the linking code!!*/
+ if (prop->data.pointer) {
+ IDProperty **array = prop->data.pointer;
+ int a;
+
+ writedata(wd, DATA, MEM_allocN_len(prop->data.pointer), prop->data.pointer);
+
+ for(a=0; a<prop->len; a++)
+ IDP_WriteProperty(array[a], wd);
+ }
+}
+
static void IDP_WriteString(IDProperty *prop, void *wd)
{
/*REMEMBER to set totalen to len in the linking code!!*/
@@ -429,6 +443,9 @@ void IDP_WriteProperty_OnlyData(IDProperty *prop, void *wd)
case IDP_ARRAY:
IDP_WriteArray(prop, wd);
break;
+ case IDP_IDPARRAY:
+ IDP_WriteIDPArray(prop, wd);
+ break;
}
}