Skip to main content
Inspiring
March 1, 2020
Answered

PF_WORLD_IS_DEEP strange behavior

  • March 1, 2020
  • 1 reply
  • 636 views

Hi. I have a project with an adjustment layer containing my plugin. Under it are 2 TIFF image files. The comp settings are 16-bit

 

 

 

	if (PF_WORLD_IS_DEEP(output)) 
		ERR(suites.IterateSuite1()->AEGP_IterateGeneric(output->height, &c_data, CopyWorld));

 

 

I click on the TIFF image files and move them in the viewer window. The render gets triggered, and the 16-bit function is called.

However, the rowbytes are passed as half the length it should be (8-bit data instead of 16-bit data). This causes a crash as the rowbytes are now half the length that I have assumed.

Is this expected behaviour? For reference the pointer increment is where the crash occurs.

 

 

	for (int x = 0; x < c_data->dest->width; x++) {
		*out_pixel++ = (*in_pixel++); // alpha
		*out_pixel++ = (*in_pixel++); // red
		*out_pixel++ = (*in_pixel++); // green
		*out_pixel++ = (*in_pixel++); // blue
	}

 

 

 

This topic has been closed for replies.
Correct answer AnmolM

Finally figured it out and I will leave an explanation as it was a tricky bug. If you scroll through the input values quickly or move around the lower layers, the adaptive resolution kicks in.

I added a PF_ABORT after all my PF_NewWorld and PF_CHECKOUT_PARAM calls.

I made sure to check for the err and return it if set after all these calls.

I changed the PF_NewWorld to use output->width, output->height as in Transformer.cpp

AEGP_IterateGeneric gets called with input height from CHECKOUT_PARAM.

 

After all these changes, I can deal with the adaptive parameter.. Perhaps some enlightened soul can explain this to me, as I have fixed the issue but still do not understand the problem completely.

1 reply

AnmolMAuthor
Inspiring
March 1, 2020

EDIT :-

I have isolated this to an issue with AEGP_IterateGeneric.

It seems that if I do an operation, either a change in the parameters of the layers or scrub through the input values of the AE plugin, there are junk values in the src_world and dest_world that I have created via PFWorldSuite()

Perhaps the older threads are not allowed to finish and the new render mixes up with the old render.

Definitely a timing issue.

 

I have added PF_ABORT in various places in my Render() - however, I do not know how to interrupt the CopyWorld function and ensure all the threads are closed before the new Render()

AnmolMAuthorCorrect answer
Inspiring
March 1, 2020

Finally figured it out and I will leave an explanation as it was a tricky bug. If you scroll through the input values quickly or move around the lower layers, the adaptive resolution kicks in.

I added a PF_ABORT after all my PF_NewWorld and PF_CHECKOUT_PARAM calls.

I made sure to check for the err and return it if set after all these calls.

I changed the PF_NewWorld to use output->width, output->height as in Transformer.cpp

AEGP_IterateGeneric gets called with input height from CHECKOUT_PARAM.

 

After all these changes, I can deal with the adaptive parameter.. Perhaps some enlightened soul can explain this to me, as I have fixed the issue but still do not understand the problem completely.