fix for one of the issues in [#27035] 3 problems: crash and enum "REGION" not found...
authorCampbell Barton <ideasman42@gmail.com>
Wed, 18 May 2011 09:07:15 +0000 (09:07 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 18 May 2011 09:07:15 +0000 (09:07 +0000)
now constraint macro argument shows as 'NORMAL' rather then '<UNKNOWN ENUM>'

source/blender/makesrna/RNA_access.h
source/blender/makesrna/intern/rna_access.c

index 4672a77bd065ab244da82a79ec1c3101ce313199..f8811a5f464564b6ac157ec76243cf72824b8888 100644 (file)
@@ -903,7 +903,7 @@ int RNA_property_is_idprop(PropertyRNA *prop);
 
 /* python compatible string representation of this property, (must be freed!) */
 char *RNA_property_as_string(struct bContext *C, PointerRNA *ptr, PropertyRNA *prop);
-char *RNA_pointer_as_string(PointerRNA *ptr);
+char *RNA_pointer_as_string(struct bContext *C, PointerRNA *ptr);
 
 /* Function */
 
index 03622ec756fe75d137f112bb7c7befb42c6cd049..a89d52e9fca1e59e805e784d394b2082c4f421ab 100644 (file)
@@ -4036,8 +4036,9 @@ int RNA_property_is_idprop(PropertyRNA *prop)
 }
 
 /* string representation of a property, python
- * compatible but can be used for display too*/
-char *RNA_pointer_as_string(PointerRNA *ptr)
+ * compatible but can be used for display too,
+ * context may be NULL */
+char *RNA_pointer_as_string(bContext *C, PointerRNA *ptr)
 {
        DynStr *dynstr= BLI_dynstr_new();
        char *cstring;
@@ -4057,7 +4058,7 @@ char *RNA_pointer_as_string(PointerRNA *ptr)
                        BLI_dynstr_append(dynstr, ", ");
                first_time= 0;
                
-               cstring = RNA_property_as_string(NULL, ptr, prop);
+               cstring = RNA_property_as_string(C, ptr, prop);
                BLI_dynstr_appendf(dynstr, "\"%s\":%s", propname, cstring);
                MEM_freeN(cstring);
        }
@@ -4175,7 +4176,7 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
        case PROP_POINTER:
        {
                PointerRNA tptr= RNA_property_pointer_get(ptr, prop);
-               cstring= RNA_pointer_as_string(&tptr);
+               cstring= RNA_pointer_as_string(C, &tptr);
                BLI_dynstr_append(dynstr, cstring);
                MEM_freeN(cstring);
                break;
@@ -4194,7 +4195,7 @@ char *RNA_property_as_string(bContext *C, PointerRNA *ptr, PropertyRNA *prop)
                        first_time= 0;
                        
                        /* now get every prop of the collection */
-                       cstring= RNA_pointer_as_string(&itemptr);
+                       cstring= RNA_pointer_as_string(C, &itemptr);
                        BLI_dynstr_append(dynstr, cstring);
                        MEM_freeN(cstring);
                }