RNA: Add RNA_property_string_set_bytes

This is needed to set values that contain zero bytes
(where the length isn't fixed).
This commit is contained in:
2018-01-15 15:49:16 +11:00
parent 02a01b3505
commit ec52e64a5d
3 changed files with 38 additions and 3 deletions

View File

@@ -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 {