diff options
author | Campbell Barton <ideasman42@gmail.com> | 2010-01-08 16:52:38 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2010-01-08 16:52:38 +0300 |
commit | a868e8623ca7218dfa363962e178293f4a8f0690 (patch) | |
tree | 2c0e08b1b9b810b60c7b19d9dac4fd6e2fb41c36 /source/blender/python/intern | |
parent | 7079047538da71961102478a23cccdbd62c7cf9d (diff) |
- RNA support for returning copied strings from functions, flagging strings as PROP_THICK_WRAP does this.
- scene.render_data.frame_path(frame=num), returns the output path for rending images of video.
- scene.render_data.file_extension, readonly attribute, gives the extension ".jpg", ".mov" etc
- player support was guessing names, use the above functions to get the actual names used, accounting for #'s replacing numbers.
Diffstat (limited to 'source/blender/python/intern')
-rw-r--r-- | source/blender/python/intern/bpy_rna.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index 5e255baf341..34e4599f463 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -2325,6 +2325,8 @@ static int foreach_compat_buffer(RawPropertyType raw_type, int attr_signed, cons return (f=='f') ? 1:0; case PROP_RAW_DOUBLE: return (f=='d') ? 1:0; + case PROP_RAW_UNSET: + return 0; } return 0; @@ -2389,6 +2391,9 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set) case PROP_RAW_DOUBLE: ((double *)array)[i]= (double)PyFloat_AsDouble(item); break; + case PROP_RAW_UNSET: + /* should never happen */ + break; } Py_DECREF(item); @@ -2440,6 +2445,9 @@ static PyObject *foreach_getset(BPy_PropertyRNA *self, PyObject *args, int set) case PROP_RAW_DOUBLE: item= PyFloat_FromDouble( (double) ((double *)array)[i] ); break; + case PROP_RAW_UNSET: + /* should never happen */ + break; } PySequence_SetItem(seq, i, item); @@ -2584,7 +2592,7 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data) { PyObject *ret; int type = RNA_property_type(prop); - + int flag = RNA_property_flag(prop); int a; if(RNA_property_array_check(ptr, prop)) { @@ -2647,7 +2655,10 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data) break; case PROP_STRING: { - ret = PyUnicode_FromString( *(char**)data ); + if(flag & PROP_THICK_WRAP) + ret = PyUnicode_FromString( (char*)data ); + else + ret = PyUnicode_FromString( *(char**)data ); break; } case PROP_ENUM: @@ -2659,7 +2670,6 @@ PyObject *pyrna_param_to_py(PointerRNA *ptr, PropertyRNA *prop, void *data) { PointerRNA newptr; StructRNA *type= RNA_property_pointer_type(ptr, prop); - int flag = RNA_property_flag(prop); if(flag & PROP_RNAPTR) { /* in this case we get the full ptr */ |