From ec52e64a5df7da7637c912d79734b236049e6761 Mon Sep 17 00:00:00 2001 From: Campbell Barton Date: Mon, 15 Jan 2018 15:49:16 +1100 Subject: RNA: Add RNA_property_string_set_bytes This is needed to set values that contain zero bytes (where the length isn't fixed). --- source/blender/python/intern/bpy_rna.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'source/blender/python/intern') diff --git a/source/blender/python/intern/bpy_rna.c b/source/blender/python/intern/bpy_rna.c index deb045c514b..ee593c90d65 100644 --- a/source/blender/python/intern/bpy_rna.c +++ b/source/blender/python/intern/bpy_rna.c @@ -1751,10 +1751,8 @@ static int pyrna_py_to_prop( return -1; } else { - /* same as unicode */ - /* XXX, this is suspect but needed for function calls, need to see if theres a better way */ if (data) *((char **)data) = (char *)param; - else RNA_property_string_set(ptr, prop, param); + else RNA_property_string_set_bytes(ptr, prop, param, PyBytes_Size(value)); } } else { -- cgit v1.2.3