Thanks! I just entered the grease pencil chat (apparently during a live meeting haha). I asked to get in touch in order to try some collaboration about a more direct way of synchronizing.
They will probably mention gLTF as well, I guess. Let’s see where it goes.
I don’t know how building blender plugins works, but I guess you can build great stuff without knowing the ins and outs of gLTF … Is that an open exchange format then? Do you have a link to the official specs?
That’s a lot of documentation.
Maybe the Blender docu is enough for the task. The Extensions in Blender can be developed with Python.
Maybe take a look at the “Blender-To-Godot Curve Tool” in the Godot Asset Store. The curve Extension should be python and the source readable,
EDIT:
Every stroke in Grease Pencil can have a material, that could be exported like for an 3D object in glTF. That would be so much better than with SVGs. Way more possibilities. I agree, that SVGs itself could be interesting also, but limited. IMHO you would have to develop some logic to calculate the keyframes or delta yourself, and detect what is similar between the frames, to avoid the brute force one scene per animation frame. That’s the biggest limit in (animated) SVG, that every frame is independent and you have only the timestamps (as far as I understand it right now).
Yes, my thought as well, just array swapping may work fine too. It would be very tightly coupled to the grease pencil export any which way in any case, so might as well key frame the points array of polygons. Calculating and resolving deltas would be slower at runtime than loading arrays in memory, I’m guessing.
I’m not inclined to optimize prematurely.
That is not flexible at all of course, but if it gives you scalable animations it is a bonus.
I don’t know how much overhead a scene with just polygons causes over only arrays in some custom resource, though. Would it really matter all that much?
As far as materials go, that is beyond my expertise at the moment (I get albedo. )
Right, but you could interpret the data as 2D.
You’ll need the import script in godot, too, to read and interpret the extension data. Same as the developer of the “Blender-To-Godot Curve Tool” did. The base for the glTF solution is done by them. Maybe colab with the developer of the addon, or talk to them what their experience with the extension is and what they think about your idea.
Ellie is a brilliant elephant who comes up with novel plans to make sure anyone can play along, however unlikely.
Disclaimer
I make an effort to keep Scalable Vector Shapes 2D fully GPT-free and Claudeless. If want to chip or chime in, without support of any of these technologies? Try it out and raise bugs/issues on the github page.
I studied the sample svg file. It looks like the shapes in each frame have a deterministic ID and are polygons built up from a deterministic number of points.
So I could try and make a very hard coded implementation that sets keyframes on the points array of each shape… This is almost reverse engineering of course. It’d probably also mean comparing and updating styles, etcetera.
The more I think about your project, the more I realize how important it could be in the next months. It has immense potential.
With the upcoming trace renderer in 4.8 as the first lookout to the coming line renderer, it’s the perfect moment to jump onto it, and to base your development on that concept and help to build a cool line renderer base. With the target to render grease pencil in Godot, with animations and materials etc. The possibilities are endless. But it will not work with the SVG route, IMHO it would has to be based on glTF.
And as stated, extra kudos that it would be hand crafted.
I have started a project for myself to have a PoC for my claims.
Strictly following your spirit, not one token was spend.
My concept so far.
" Blender Grease Pencil in Godot
This project is a prove of concept to transfer Grease Pencil from Blender to Godot.
Grease Pencil is a tool to draw vector graphics in Blender. renevanderark on the Godot forum is developing a 2D shape renderer, the open question is how to transfer Grease Pencil data from Blender to Godot.
This project is a PoC following the discussion on the Godot forum:
The concept is based on the project “Scalable Vector Shapes 2D” by renevanderark to render vector graphics in Godot.
License: MIT
For exporting curves from Blender and importing them in Godot the workflow is based on the Godot addon “Blender-To-Godot Curve Tool” by coded-eye on Godot Asset store.
License: MIT
The PoC should show a workflow to accomplish to display Grease Pencil art from Blender in Godot.
Grease Pencil are 3D curves in Blender with parameter like pressure (line width). All parameters can be animated and strokes can have materials.
Blender offers tools to convert Grease Pencil to (animated) SVGs with every frame distinct elements (Flipbook).
The PoC should show that the more flexible way to convert the data is via glTF.
GlTF doesn’t support curves by default. To transfer curves as an glTF, an glTF extension would be required. There is an addon by coded-eye to use glTF extensions to include curves to glTF exports in Blender. The addon provides an import GDScript to import the curve data.
Open questions:
What data is already supported by the “Blender-To-Godot Curve Tool”?
What is the state of the Godot Line Renderer? (analyse the new trace renderer in 4.8, based on a new line renderer)
What is the expected 2D data structure for “Scalable Vector Shapes 2D” that could be extracted from glTF curve data?
How to handle edge cases, grease pencil will not always be planar?
What are the pros/cons with glTF to (animated) SVGs?
Hi @conz3d , I think it’s great that you’re so inspired.
Someone on my discord has encoured me to get in touch with the grease pencil team via their official blender.org chat channel (for which you do need an account)
A specialist on the gLTF format joined that chat channel today offering to answer questions. If you’re serious about this, I think you should (no pressure) get in touch:
Well, in the chat I mentioned our conversation here on the forum, but it may be a bit of a long read by now for someone who may be very busy.
I think they’re enthused enough to want to make some time to spar about your idea, but you may have to join the chat they are on..
Looking up the link..
There is a thread made by hissatsuclaw in which we discuss possibilities of importing their svg animation. There I try to quote your suggestions as best I can, but it’d be better if you explain your thinking and see if we can come to some aligned experiment.
I can help turn it into a mature solution later but have little time to really do research and experiment.