Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

Using to Drawbot to render

Enthusiast ,
Dec 01, 2013 Dec 01, 2013

Hi Shachar and everyone!

I have a simple question: is it possible to use Drawbot during the Render call and / or render what's drawn on the layer / comp?

Thanx,

François

TOPICS
SDK
2.4K
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Dec 01, 2013 Dec 01, 2013

yo leroy! wassup?

well, you can't call access the comp overlay buffer during a render call,

regardless of drawbot.

you'll have to cache whatever it is you want to render during a "draw"

event call, and use that cache during the render call.

are you trying to use the drawbot tools as drawing tools for the render?

if so, then consider using some 3rd party drawing tools or even the os

tools. there have been some threads here discussing just that.

Translate
Community Expert ,
Dec 01, 2013 Dec 01, 2013

yo leroy! wassup?

well, you can't call access the comp overlay buffer during a render call,

regardless of drawbot.

you'll have to cache whatever it is you want to render during a "draw"

event call, and use that cache during the render call.

are you trying to use the drawbot tools as drawing tools for the render?

if so, then consider using some 3rd party drawing tools or even the os

tools. there have been some threads here discussing just that.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 01, 2013 Dec 01, 2013

Thanx Shachar!

Yes, I have to use (and study first!) Drawbot for one of my plugins, so I was thinking, hey, why not drawing directly?

Do you think it's possible to cache what's rendered by Drawbot?

If not, I'll try some other drawing tool as you said. OpenGL may be? At least there's the GLator sample to help a bit...

Cheers,

François

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 01, 2013 Dec 01, 2013

as far as i can tell, drawbot's data structures are opaque and you can't

retrieve anything from them without using the drawbot suite, which in turn,

doesn't offer any tools for reading.

i only know of a way of drawing using any 3rd party tool and then

translating the resulting buffer to drawbot as an image, but not the other

way around...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 02, 2013 Dec 02, 2013

I think I'll try with OpenGL or Processing.

By the way, do you know a reliable way to copy the buffer into a 3rd party api frame?

This code is from the Glator example:

for (int ix=0; ix < inputP->height; ++ix)

            {

                PF_Pixel8 *pixelDataStart = NULL;

                PF_GET_PIXEL_DATA8( inputP , NULL, &pixelDataStart);

                ::memcpy(    bufferP + (ix * S_GLator_EffectCommonData.mRenderBufferWidthSu ),

                        pixelDataStart + (ix * (inputP->rowbytes)/sizeof(GL_RGBA)),

                        inputP->width * sizeof(GL_RGBA));

            }

It 'works' but fails with large picture... Do you use a similar code?

Cheers,

François

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 02, 2013 Dec 02, 2013

i don't see why that code would fail with large images. where does it fail?

i use a pixel by pixel code, because i don't assume the same RGBA

arrangement is used on both ends.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 02, 2013 Dec 02, 2013

It fails on 'memcpy', when ix >= 1024...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2013 Dec 03, 2013

is sizeof(GL_RGBA) == sizeof(PF_Pixel8)?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 03, 2013 Dec 03, 2013

Yes, sizeof(GL_RGBA) == sizeof(PF_Pixel8) == 4

Is it a problem with the Handle size? I must admit I'm lost with memory stuff...

Thanx,

François

Edit:

I found the error.

S_GLator_EffectCommonData.mRenderBufferWidthSu maximum size was locked to 1024 by default...

For those who need it, it's in GLbase.h

Cheers,

François

Ce message a été modifié par: françois leroy

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2013 Dec 03, 2013

what error message is it giving when failing?

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 03, 2013 Dec 03, 2013

Well, it didn't show any message other than "AE encountered an error during the call of 'GLator'"...

that's why I was lost and had hard time finding the error.

But it 'works' now (I edited the previous post).

I've set the S_GLator_EffectCommonData.mRenderBufferWidthSu maximum size to 2048,

and limited the rendertexture to 2048x2048 too...

I'm not sure this is the best way, but at least it doesn't crash.

The 'sizeof(GL_RGBA)' put me on the good track!

Cheers,

François

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2013 Dec 03, 2013

oh good!

i was way off in my search for the problem...

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 03, 2013 Dec 03, 2013

thanx for the help (as usual) !

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Dec 03, 2013 Dec 03, 2013

i did not help one bit. (but you're welcome... i guess...)

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 05, 2013 Dec 05, 2013

Even though sizeof(GL_RGBA) works in this case, technically it is not right. GL_RGBA is a macro with a constant value. On many compilers, macro constants are treated as integers and hence it results in a size of '4'.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 08, 2013 Dec 08, 2013

Hi Gutsblow,

in fact I didn't change anything with sizeof(GL_RGBA), but with S_GLator_EffectCommonData.mRenderBufferWidthSu which was locked to 1024 in GLbase.h

I just set a higher value (2048) but couldn't find a way to change it according to output size...

Do you have any idea?

Cheers,

François

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 11, 2013 Dec 11, 2013

I don't exactly remember how the GLator sample worked, but I remember that it is not the best way to do OpenGL in AE. You can read through my posts and others' posts in this forum thread which explain various OpenGL related issues in AE

http://forums.adobe.com/thread/1004306

If all you need is 2D rendering, OpenGL is an overkill. The context and buffer management in OpenGL can get very tedious & complicated and not to mention the diverse GPU hardware which have their own way of doing things. You're much better off sticking with a regular 2D drawing library.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Enthusiast ,
Dec 11, 2013 Dec 11, 2013

Hi Gutsblow,

in fact, I was more trying to understand the process of grabing, caching, storing a buffer, using it with a third party api, etc...

OpenGl is well documented, and the SDK provides an example (+ the threads on the forum), that's why I studied this case (and CCU, for direct access to the buffer).

But If you have any other example of 3rd party drawing tool integration (I first thought DrawBot was one of them), I'm really interested!

Thanx,

François

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Dec 16, 2013 Dec 16, 2013

I'm also very interested in seeing an example. I've tried unsuccessfully with openFrameworks.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Dec 18, 2013 Dec 18, 2013
LATEST

openFrameworks isn't the right framework as it does more than image rendering and it's designed to create apps. I would recommend using something just for drawing, like Quartz on the Mac, GDI on Windows or Cairo for both Mac/Win, athough I don't have much experience using these libraries.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines