Better:
bool default() {
if(!input(0)) return true;
DD::Image::Iop* def = DD::Image::Iop::default_input(DD::Image::OutputContext());
if(!def) return false;
return input(0)->firstOp() == def->firstOp();
}
2013/3/22 ryan <[email protected]>
>
> Fixed it.
>
> In validate:
>
> if (input(0) != default_input(0))
> {
> //do stuff
> }
> else
> {
> set_out_channels(Mask_None);
> copy_info();
>
> }
>
> ryan wrote:
> I need to check for connection on my additional inputs so I overrode
> default input like this:
>
> Op* ThisClass::default_input(int input) const
> {
> if (input == 0)
> {
> DD::Image::Iop::default_input(input);
> }
>
> return 0;
> }
>
>
> Referencing this page:
> http://docs.thefoundry.co.uk/nuke/63/ndkdevguide/split-and-execute/input.html?highlight=default_input
>
>
> The documentation says to return this
> DD::Image::Op::Iop::default_input(input)
>
> Iop does not seem to be in the DD::Image::Op namespace, so returned
> DD::Image::Iop::default_input(input) instead
>
> Regardless, when input0 is disconnected, any call to input0() in _validate
> crashes Nuke.
>
> I thought returning the default input is supposed to allow for calls to be
> made to input0 without having to check for null?
>
>
> I'm checking for null pointers on all inputs to check for connection;
> however, I would like not to have to check for null when accessing input0()
>
> _______________________________________________
> 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