Bugfix: RNA_path_from_ID_to_struct crashed in automatic nested struct detection.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 27 Oct 2009 21:58:03 +0000 (21:58 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Tue, 27 Oct 2009 21:58:03 +0000 (21:58 +0000)
source/blender/makesrna/intern/rna_access.c

index a963c6a18d2dbeaa9cbb8b5175c4c6c8d27ca315..b7120c58fef4904117b280ece9676bf645463427 100644 (file)
@@ -2435,14 +2435,14 @@ char *RNA_path_from_ID_to_struct(PointerRNA *ptr)
                        /* if type has a path to some ID, use it */
                        ptrpath= ptr->type->path(ptr);
                }
-               else if(ptr->type->nested) {
+               else if(ptr->type->nested && RNA_struct_is_ID(ptr->type->nested)) {
                        PointerRNA parentptr;
                        PropertyRNA *userprop;
                        
                        /* find the property in the struct we're nested in that references this struct, and 
                         * use its identifier as the first part of the path used...
                         */
-                       RNA_pointer_create(ptr->id.data, ptr->type->nested, ptr->data, &parentptr);
+                       RNA_id_pointer_create(ptr->id.data, &parentptr);
                        userprop= RNA_struct_find_nested(&parentptr, ptr->type); 
                        
                        if(userprop)