Thank you so much Jonathan, Ivan and Peter. I had a suspicion about the
*ReaderFormat class being the way to add knobs to a *Reader! I think I'd
seen it and wondered about its purpose in the DeepReader examples.

Community!

Thanks again,

-blake

On Thu, Mar 14, 2013 at 4:28 AM, Peter Crossley
<[email protected]>wrote:

>  Hi,
>
> Yes it is possible, but not via the GeoReader. You also need to subclass
> the GeoReaderFormat. I've just realised that this isn't documented in the
> ndk examples, which is an oversight on our part and I'll look into updating
> this.
>
> Basically, if you define my3DReader, you also need to define a
> my3DReaderFormat. Within the format, you then need to implement the knobs
> callback. I've attached a simple example of how to do this with the
> my3dReader example. (note: I haven't tried building this, but should give
> you enough of a starting point to do what you want).
>
> If you want to access the format's knobs from within your reader, you need
> to store the ReadGeo that's passed into the reader's constructor. You can
> then access the handler and it's knobs using something like:
>
>   my3dReaderFormat* pfmt =
> dynamic_cast<my3dReaderFormat*>(_pReadGeo->handler());
>   knob* myKnob =  _pReadGeo->knob("read_on_each_frame");
>
> Also in your my3dReader you need to change:
>
>      GeoReader::Description my3dReader::description("my3d\0",
> my3dReader::Build, my3dReader::Test);
>
> to
>
>     GeoReader::Description my3dReader::description("my3d\0",
> my3dReader::build, my3dReaderFormat::buildformat, my3dReader::test, NULL,
> false);
>
> Hope that helps, let me know if something isn't clear.
>
> Cheers,
>
> Peter.
>
>
>
> On 14/03/2013 02:50, Jonathan Egstad wrote:
>
> It should be possible to add knobs to a GeoReader in 7.0.
>
> Haven't done it yet myself but I believe the Alembic reader leverages this.
>
>  I think it uses the same basic methodology as the Reader class, so you
> can check exrReader.cpp for an example implementation.
>
>  -jonathan
>
> On Mar 13, 2013, at 7:26 PM, Ivan Busquets <[email protected]> wrote:
>
>    Hi Blake,
>
> Unless something has changed in the API recently, I don't think you can.
>  You would need to derive from SourceGeo instead, and then build all the
> knobs you need in there.
>
>  Unfortunately, this means your reader will use a separate node, as
> opposed to the standard ReadGeo.
>
>  I believe Jonathan gave some more details on this a while back.
>
>
>
>
> On Wed, Mar 13, 2013 at 3:47 PM, Blake Sloan <[email protected]> wrote:
>
>> Is it straightforward to add a knob to a GeoReader? I've added the
>> knobs() prototype to the class definition of my derived class and used the
>> usual method to add knobs to the control panel. They don't show up. Is
>> there an example of this anywhere? The my3dReader example does not have
>> custom knobs.
>>
>>  Once again, sorry if this is already well-covered.
>>
>>  -b
>>
>>  --
>> *B*l*a*k*e* S*l*o*a*n
>> *S*o*f*t*w*a*r*e, *C*o*l*o*r*
>> *D*i*g*i*t*a*l* D*o*m*a*i*n*
>>
>> _______________________________________________
>> Nuke-dev mailing list
>> [email protected], http://forums.thefoundry.co.uk/
>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>>
>>
>   _______________________________________________
> Nuke-dev mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>
>
>
> _______________________________________________
> Nuke-dev mailing [email protected], 
> http://forums.thefoundry.co.uk/http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>
>
>
> _______________________________________________
> Nuke-dev mailing list
> [email protected], http://forums.thefoundry.co.uk/
> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev
>
>


-- 
*B*l*a*k*e* S*l*o*a*n
*S*o*f*t*w*a*r*e, *C*o*l*o*r*
*D*i*g*i*t*a*l* D*o*m*a*i*n*
_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

Reply via email to