Thanks Larry for your quick reply!

The previous was silently failing (not erroring, nor writing the attribute), 
after building OpenImageIO 2.0.x the attribute started to write tuples fine and 
images are read as sxr by Nuke ;)

Cheers!

> 
> Well, with v1.5, all bets are off, as too much has changed since then 
> (including the Python bindings being completely re-implemented, changing from 
> Boost.python to pybind11, between 1.8 and 2.0).
> 
> In 2.0, I would expect the following to work:
> 
>     outSpec.attribute(“multiView”, oiio.TypeDesc(oiio.STRING, 2), (“left”, 
> “right”))
> 
> And I think also in 2.0, we made it so that TypeDesc's may interchangeably be 
> passed the string representation as well, so I think that this should also 
> work and maybe be more readable:
> 
>     outSpec.attribute(“multiView”, "string[2]", (“left”, “right”))
> 
> 
> 
>> On Jun 25, 2019, at 10:48 AM, Javier Edo Meseguer <[email protected] 
>> <mailto:[email protected]>> wrote:
>> 
>> I was wondering what the right syntax might be for non-size-1 attributes in 
>> python, the signature seems to suggest that tuples might be valid and it 
>> does not error but can’t seem to find the attributes being added when 
>> checking inside Nuke.
>> 
>> I’m trying to replicate the following in python:
>> 
>> const char* value[2] = {"left”, "right"};
>> OpenImageIO::TypeDesc multiViewAttr(OpenImageIO::TypeDesc::STRING, 2);
>> outSpec.attribute("multiView”, multiViewAttr, values);
>> 
>> I have tried the following without any luck:
>> 
>> outSpec.attribute(“multiView”, oiio.TypeDesc.TypeString, (“left”, “right”))
>> 
>> What is the right way of setting this?
>> 
>> I’m using an ancient version of the python bindings (v1.5-ish), happy to ask 
>> our IT dept to update it if that will make things any better.
>> _______________________________________________
>> Oiio-dev mailing list
>> [email protected] <mailto:[email protected]>
>> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org
> 
> --
> Larry Gritz
> [email protected] <mailto:[email protected]>
> 
> 
> 
> 
> _______________________________________________
> Oiio-dev mailing list
> [email protected]
> http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

_______________________________________________
Oiio-dev mailing list
[email protected]
http://lists.openimageio.org/listinfo.cgi/oiio-dev-openimageio.org

Reply via email to