imageworks/OpenShadingLanguage — pull request #364 by lgritz (2014-05-01 04:20:33+00:00)
Title: Revise getattribute userdata retrieval

After further thought (and use), I want to revise the way some of the
getattribute thingies I just added are queried -- instead of retrieving (copying)
a whole array, just retrieve a pointer to where the data lives in the group.

Instead of copying the whole array to user space (especially awkwardly
for the userdata_types, since there is no way for TypeDesc to specify
a TypeDesc type!), I changed it so that they are actually retrieving
a pointer. So it looks like this:

ustring *names = NULL;
shadingsys->getattribute (group, "userdata_names",
TypeDesc::PTR, &names);
// now names[0] is the first name, names[1] the second, etc.

This is safer and simpler, and doesn't require coping or allocation, since
the names and types already exist in the group as a contiguous array.

Also, I added one more tag, "userdata_offsets". Suffice it to say that
in a future checking, it will all be clear how and why it's used.