Small Script for rendering grease pencil keyframes(not every frame)

https://github.com/okuma10/Grease-Nudge/blob/master/Render%20Keyframes%20Only.py

This is mainly for those artists who use grease pencil for storyboarding and don’t know much python(if any) since it’s really a simple script.And who might want to export their frames for adding them to a pdf or to some other storyboard software.

it will do go trough the keyframes of every grease pencil object. Add the numbers to a list -> then will loop trough the numbers -> move the timeline to that number -> render it as well as change the name for every frame in the output scene settings.
render_folder

it will appear as if blender has hanged but it will actually do all the above mentioned stuff.It’s just that won’t do it live. But if you have your system console opened you will see that it’s just saving the files.

Note: this is really quick and rough…no buttons no operators.No smart behavior as well.
You need to have the render file format as single file not video(it won’t change it itself).Also you have to manually add the name in the Output part of the scene settings(it won’t do it for you). Also I noticed that it might change the name and add the “_0000” I added to make the file names sequential,but if that happens it will add another ‘_0000’ to the filename.So you need to watch for that when you re-run the script.
Also I haven’t tested it…but it might crash/not work if you already have the previous renders still in the render folder(I think it won’t overwrite them). Just to make sure…delete/move all the files before re-running the script.

3 Likes

hi
I’m a 2d animator by trade and need your add-on.

I installed it from your github and added it to blender, but
This add-on was not highlighted.

I can’t even confirm that this add-on is installed correctly and I don’t know how to use it.

Please give me some advice.

you are using blender 2.8 right

I tried it with blender 2.82a 2.83 2.90. Is it only compatible with blender 2.80?

No it should work on 2.8+,
Right now I’m on 2.91 and it is working.

after you install it, do you have a yellow exclamation next to the addon in the addons tab in preferences?

By the way @yuu ,
if you read my posts above, sometimes the greasepencil scripts aren’t working as they should, since they sometimes “destroy” keyframes.
I’ve looked up the issue and found that they aren’t destroyed…but there is no way to select them from the dope sheet, since they have the same keyframe position. So, that’s something I have to fix, and not be lazy by referring frames only by their position but using the whole keyframe data object.
Of course a ctrl+z fixes things when it happens, but yeah…just saying

I can’t see Render Keyframes Only.py in the add-on tab.

oooh!!! you want that old render keyframes only script I did a while back.
Sorry I thought you are talking about about keyframeNudge.

Yeah ,that’s a script, you run it through blender’s text editor.You open the file and press run.

But the script is actually useless in 2.9 because we have the option viewport render keyframes.
https://docs.blender.org/manual/en/dev/editors/3dview/viewport_render.html?

But looking at the documentation. It looks like it will output the non keyframes,frames as well. While I think the script just output only the GP keyframes, for all GP objects.

Anyway it’s a script…not an addon. Give it a try and let me know if it works. I can make you a button anywhere on the UI if you find you use the script a lot.

I see. I ran the script, but I got an error.

I would appreciate it if you could make a button on the UI for this feature.

Or I can pay you a fee, could you ask me to create an add-on that renders only the keyframes in GP?
I want to use this feature more simply.

No problem, I will do it for free.
But I’ll work on it later tonight GMT+2.
And will post a link to the script. Also where would you like the button to be

Oh yeah and if possible can you screengrab the error?

Thank you!! Honestly, anywhere is fine. It doesn’t matter where it is, as long as it’s in a view tab or in the output panel of the render settings, or wherever the relevant function is. I’d like to be able to render keyframes with the click of a button, just like the basic ViewPort render.
aa
oops, Here’s a screenshot of the error. I seem to be making some rudimentary mistakes in the use of this script. I’m not familiar with script, sorry, I’m not familiar with script.

@yuu
here you go :
:floppy_disk: Link

One thing you should know though…after installing and enabling the “addon” you won’t find it anywhere. I suppose because blender loads it’s UI scripts once, you would have to restart blender. After the restart you will find it in your 3Dview>View dropdown>Viewport Render GP Keyframes, next to the other Viewport Render operators.

1 Like

I’m sorry, I tried it with my newly installed 2.91 and it worked correctly. I think there may be a conflict with another add-on I’m using. This is my problem and I’ll fix it myself.

P.S. Running it from the admin solved the problem. This add-on is exactly what I wanted. Thank you.

Didn’t saw your problem, but from the last message - yeah the “addon” actually modifies your view space_view3d.py file, in order to add the button in the view dropdown.
If your blender is in program files and you have that annoying "you need admin rights to write to program files’ in Windows, you would have to run blender as admin in order to work. As you did.

Since you are working with GP, maybe you will find this “addon/script” useful:
:floppy_disk: Link
It toggles the onion skin of selected layers in the GP dope sheet.No matter if you have the GP object selected or not.

It’s been a while since I’ve seen you. The add-ons you have created have been very useful in my work. I’ve been trying to migrate to the new 2.91.2 or 2.92, but I’m getting an error and can’t seem to enable it. What is the problem?

I also felt that some improvements could be made, so I prepared an illustration.

GP_2

I use this add-on a lot and if you can improve it, I would like to pay for it. If you can improve it in this way it will be a perfect tool.

Thank you

hi @yuu ,
I’m really happy that you find the addon useful and you use it.

About your error it says that it cannot find space_view3d.py . That’s the file that handles your UI, and trough it I add the button in the view dropdown menu. I don’t think I hard coded parts of it…but it does look like that.

All the tings you say could be improved…well I actually made it by my own ideas…

I think the script takes notice only for the visible layers. So if you hide a layer it shouldn’t be taken in to account when rendering the frames. Still having an option to render the selected layers only is a good idea.

About the first frame…again I thought one would want to have the first frame always rendered.

The naming also makes sense to have the project name in it. But when it comes to having only the “name” there…you mean the ‘layer name_number’?

In the end I have no issue in adding these…the thing I’m wondering is that most of these look like it’s a good idea to make it a toggle instead of dedicated button/operator in the dropdown menu. So…let me know how you would prefer to access these functions…as different options in the view drop down, or maybe as a panel in the View3d or the Grease Pencil Dopesheet?

As for money I won’t take any payment. 1. because it implies that I have to keep support even if I can’t afford to do it, and 2.My idea is these to be free. If you do like to give something back like…buy me a coffee kind of a thing…look in this thread :

Thank you for your reply. I’m glad to hear they can be improved. I’ve donate to you.

The ability to export only the keyframes of the selected layer would be great.
As for the naming, it’s the name you gave to the output path in the output properties. In the case of layer names, for example, I usually work on separate layers for line art and coloring, but I want to export them as a single image, so won’t naming them based on layer names cause problems?
Since the GP Dope Sheet does not have the ability to create groups like collections like the Outliner, I thought it would be more convenient to export multiple layers as “A”, naming them from the output properties.

I thought a layout like Keyframe Nudge Scripts would be good. I also thought it would be simplest to create a button in the header of the GP dopesheet, but I’ll leave that up to you.

thanks for the donation, again… you are not required to, but I’ll definitely get a nice drink and I’ll drink it for your health.

About the issue with the addon for newer versions I actually already fixed that last night.
This morning I figured how to make the render selected layer only thing…
But I was wondering what exactly you want from the selected layer option here are some ideas, let me know which one you want exactly. Of course if none fit what you wanted ,post an image of what you have in mind.


While you are at it…post a image of what you want the file name to be…I mean it’s components. From the image above I think you want to have just the layerName_frameNumber? or layerName_imageNumber?. Also what behaviour you want when there is no layer selected…I mean then the image naming should be different right…like what we have now fileName_frameNumber. Also the frameNumberinstead of imageNumber makes sense if you import the images to another software…I mean you will know what frame they should go…or I’m wrong?

What I’m thinking is that the image to be rendered should only show the selected layer. This is also related to naming, but if you’re rendering keyframes from a single layer, there’s nothing wrong with naming them based on the layer name. However, I’m assuming that you want to render multiple layers as a single image (A), as in
Would it be a problem to use the layer name as a basis for such usage?
In my opinion, naming the image name in the output panel and outputting it as Image Name_Image Number would be fine.

In general, I understand that frame numbers are more reasonable. However, in my personal usage, image numbers are more convenient. If it is possible, is it difficult to make these optional, so that the user can choose which way to number them?

I hope I have successfully conveyed my thoughts to you.
Thank you for your time.

I think I understood what you want exactly, and I think I managed to make it.
I have to make the UI part, and test it on other versions of blender…also on an installed blender, rather than portable which I have.

1 Like