Thanks Lucy ! "You need to allocate the data buffer for the output plane (by calling makeWritable) before attempting to access it (using writableAt())."
So the ImagePlane passes into renderStripe() is not preallocated ? Is this always the case ? Check out the example in NDK docs ( https://www.thefoundry.co.uk/products/nuke/developers/90/ndkdevguide/2d/planariops.html ) No makeWritable() is called on outPlane here. thanks ! Dev void renderStripe(ImagePlane& outPlane) { input0().fetchPlane(outPlane); outPlane.makeUnique() Box box = outPlane.bounds(); foreach(z, outPlane.channels()) { for (Box::iterator it = box.begin(); it != box.end(); it++) { outPlane.writableAt(outPlane.chanNo(z), it.x, it.y) *= 2; } } } On Mon, May 18, 2015 at 3:21 AM, Lucy Wilkes <[email protected]> wrote: > On Fri, May 15, 2015 at 2:14 AM, devMannemela <[email protected]> wrote: > >> Thanks, Frank. >> >> I have been using it, but wanted a confirmation if aborted() is the way >> to go. >> >> Could you please explain what imagePlane.makeUnique() does ? >> and when exactly do we need to call it ? >> >> Hi Dev, > > > makeUnique() will ensure that the image plane has its own data buffer, > which is not shared by any other image plane. This means you can safely > write into it without affecting any other planes. You should make sure the > data buffer for the image plane has been allocated (e.g. by a call to > fetchPlane) before calling makeUnique() on it. > > >> >> In my plugin() (which is a 2 input plugin), >> I create 2 image planes to read my 2 input images >> This function crashes if I don't make my output imgPlane writable. >> > > You need to allocate the data buffer for the output plane (by calling > makeWritable) before attempting to access it (using writableAt()). > > Hope that helps. > > Lucy > > >> Any idea why ? >> >> thanks ! >> Dev >> >> >> Here is a stripped down version.. >> >> void myScalar::renderStripe(ImagePlane &imgPlane) >> { >> // create a new image plane to read input 0 >> ... >> input0().fetchPlane(input0_ImgPlane); >> >> // create another image >> .... >> input1().fetchPlane(input1_imgPlane); >> >> ... >> // now I write the output >> // imgPlane.makeWritable() .... plugin crashes if I don't make >> it writable. >> foreach (z, imgPlane.channels()) >> { >> for (... box iteration...) >> { >> imgPlane.writableAt(it.x, it.y, imgPlane.chanNo(z)) = 1.0; >> } >> } >> } >> >> >> >> >> On Thu, May 14, 2015 at 3:35 PM, Frank Harrison <[email protected]> >> wrote: >> >>> The aborted() state should be set. >>> >>> ImagePlane newPlane = ... ; >>> input.fetchPlane(newPlane); >>> >>> if (aborted()) { >>> // handle or return >>> } >>> >>> >>> hth >>> >>> On 14 May 2015 at 23:23, devMannemela <[email protected]> wrote: >>> >>>> Hi ! >>>> >>>> I am writing a multi-input PlanarIop node. >>>> >>>> When I try to read the input image into an ImagePlane, >>>> Is there a way to check if fetchPlane() call has succeeded or not ? >>>> >>>> >>>> thanks ! >>>> Dev >>>> >>>> >>>> >>>> _______________________________________________ >>>> Nuke-dev mailing list >>>> [email protected], http://forums.thefoundry.co.uk/ >>>> http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev >>>> >>>> >>> >>> >>> -- >>> Frank Harrison >>> Senior Nuke Software Engineer >>> The Foundry >>> Tel: +44 (0)20 7968 6828 - Fax: +44 (0)20 7930 8906 >>> Web: www.thefoundry.co.uk >>> Email: [email protected] >>> >>> _______________________________________________ >>> 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 >> >> > > > -- > Lucy Wilkes > > Senior Software Engineer > The Foundry > 5 Golden Square, London, W1F 9HT > Tel: +44 (0)20 7479 4350 > Web: www.thefoundry.co.uk > Email: [email protected] > > > The Foundry Visionmongers Ltd. > Registered in England and Wales No: 4642027 > > > _______________________________________________ > 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
