Copy link to clipboard
Copied
Hi, All.
I am creating a transition plugin from SDK_CrossDissolve.
By the way, I have a strange issue.
I set all pixel of output to {0,0,0,0} on plugin code, but the background is not transparent and layer image.
How can I set transparent background?
//code
...
PF_LayerDef* dest = output;
char* destData = (char*)dest->data;
...
for (int y = 0; y < output->height; y++)
{
for (int x = 0; x < output->width; x++)
{
((float*)destData)[(y * dest->rowbytes) / 4 + x * 4 + 0] = 0;
((float*)destData)[(y * dest->rowbytes) / 4 + x * 4 + 1] = 0;
((float*)destData)[(y * dest->rowbytes) / 4 + x * 4 + 2] = 0;
((float*)destData)[(y * dest->rowbytes) / 4 + x * 4 + 3] = 0;
}
}
.....
//result
I found this solution .
I set PF_OutFlag2_SUPPORTS_QUERY_DYNAMIC_FLAGS.
It is working as well.
Copy link to clipboard
Copied
Hi, All
I already posted a question before but didn’t get response yet.
So I am posting again with video explanation.
As I showed in the code above, I’ve set all the values (r, g, b, a) of out buffer to 0. (It means out buffer should be transparent)
When I’ve applied sample transition in one layer, out buffer was transparent.
But when I’ve applied transition between two layers, out buffer did not become transparent.
Strange thing is if I change scale, rotation or position values of layer, the out buffer becomes transparent.
I am not sure why this happens.
Would someone help me on this issue?
Recordit: Record screencasts fast & free! with GIF Support!
PS: I’ve tested with SDK_CrossDissolve plugin.
Regards,
Anthonie.
Copy link to clipboard
Copied
Hi Anthonie,
Perhaps it is the way you traverse through the pixel buffer. Because in SDK_CrossDissolve_CPU.cpp, after lines 153-156, if I add another set of lines to set the values to zero, it behaves properly.
Also, since you are working the the CPU render path, make sure in Project Settings, that you have the Renderer set to Software Only.
Copy link to clipboard
Copied
Thank you Zac.
I don't think so.
it is Software Only.
static PF_Err Render(
PF_InData* in_data,
PF_OutData* out_data,
PF_ParamDef* params[],
PF_LayerDef* output)
{
PF_LayerDef* dest = output;
char* destData = (char*)dest->data;
for (int y = 0; y < output->height;
++y)
{
for (int x = 0; x < output->width; ++x)
{
((float*)destData)[y * (dest->rowbytes / 4) + x * 4 + 0] = 0;
((float*)destData)[y * (dest->rowbytes / 4) + x * 4 + 1] = 0;
((float*)destData)[y * (dest->rowbytes / 4) + x * 4 + 2] = 0;
((float*)destData)[y * (dest->rowbytes / 4) + x * 4 + 3] = 0;
}
}
return PF_Err_NONE;
}
I changed the render code like above in SDK_CrossDissolve.
Would you check with the code?
But it still appears same issue.
Regards,
Anthonie.
Copy link to clipboard
Copied
Hi, Zac.
I hope you are doing well.
Can I get any response?
Regards,
Anthonie.
Copy link to clipboard
Copied
Hi, anybody!.
Can I get any help to solve this issue?.
Regards,
Anthonie.
Copy link to clipboard
Copied
Zac gave you a specific suggestion, which he'd tested; in what way does that not work for you?
Because in SDK_CrossDissolve_CPU.cpp, after lines 153-156, if I add another set of lines to set the values to zero, it behaves properly.
Copy link to clipboard
Copied
Thank you.
Actually it is not working (Zac's suggestion).
When I’ve applied sample transition in one layer, out buffer was transparent.
But when I’ve applied transition between two layers, out buffer did not become transparent.
Recordit: Record screencasts fast & free! with GIF Support!
Would you check it with following code again?
static PF_Err Render(
PF_InData* in_data,
PF_OutData* out_data,
PF_ParamDef* params[],
PF_LayerDef* output)
{
PF_LayerDef* dest = output;
char* destData = (char*)dest->data;
for (int y = 0; y < output->height;
++y)
{
for (int x = 0; x < output->width; ++x)
{
((float*)destData)[y * (dest->rowbytes / 4) + x * 4 + 0] = 0;
((float*)destData)[y * (dest->rowbytes / 4) + x * 4 + 1] = 0;
((float*)destData)[y * (dest->rowbytes / 4) + x * 4 + 2] = 0;
((float*)destData)[y * (dest->rowbytes / 4) + x * 4 + 3] = 0;
}
}
return PF_Err_NONE;
}
Regards,
Anthonie.
Copy link to clipboard
Copied
Hi Anthonie,
I tested again and I think you are on to something. I've logged a bug and we will investigate further.
Copy link to clipboard
Copied
The bug ID, by the way, is DVAPR-4208737.
Copy link to clipboard
Copied
Thank you. Zac.
By the way, what do you mean by The bug ID, by the way, is DVAPR-4208737.
Regards,
Anthonie.
Copy link to clipboard
Copied
That's the bug number in our internal bug database.
Copy link to clipboard
Copied
Hi,
I also have this issue.
Is there any news with this bug?
It seems it is cached.
Regards,
Anthonie.
Copy link to clipboard
Copied
I found this solution .
I set PF_OutFlag2_SUPPORTS_QUERY_DYNAMIC_FLAGS.
It is working as well.