Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Export grease pencil #925

Open
fire opened this issue Feb 14, 2020 · 15 comments
Open

Export grease pencil #925

fire opened this issue Feb 14, 2020 · 15 comments
Labels
enhancement New feature or request exporter This involves or affects the export process

Comments

@fire
Copy link

fire commented Feb 14, 2020

Describe the bug
Output does not match blender splash art

To Reproduce
Steps to reproduce the behavior:

  1. Go to 'https://cloud.blender.org/p/gallery/5e46a80442fa9613e1cd1fca'
  2. Download
  3. Open in blender 2.81
  4. Export as glb
  5. Open as glb

Expected behavior
Should resemble Splash Art

Screenshots

image

Screenshot from 2020-02-14 10-29-46

Screenshot from 2020-02-14 10-31-04

.blend file/ .gltf
See link for blend file.

Version

  • OS: Linux Fedora 31
  • Blender Version 2.81 and gltf io 1.2.6

Additional context

Add any other context about the problem here.

I think grease pencils should be exportable.

@donmccurdy
Copy link
Contributor

Two issues here:

1. Export grease pencil

This is probably possible, but probably not trivial. I'm not sure whether it would be better to export grease pencil as lines (no thickness, but easier to style later in the application) or meshes (closer to what you see in Blender, but much harder to style in the engine later). #717 would be relevant.

2. Export this custom material shader

I don't see how we can export this to anything standard without help from Blender's developers... it needs to be baked to an unlit material.

Screen Shot 2020-02-14 at 11 08 16 AM

@donmccurdy
Copy link
Contributor

I like the art a lot though 😍

@fire
Copy link
Author

fire commented Feb 14, 2020

From a pipeline point of view, most people using the pencil tool won't spend time in the engine modifying the output. So meshes (closer to what you see in Blender) requires less steps in the pipeline. Less steps in the pipeline is a good goal.

It's fine if the shader for the 2.82 splash art doesn't appear. Although it IS possible to bake a view dependent colouring for a specific camera, that's not general purpose.

@donmccurdy donmccurdy changed the title Blender 2.82 splash art does not match gltf Export grease pencil Feb 14, 2020
@donmccurdy donmccurdy added the enhancement New feature or request label Feb 14, 2020
@donmccurdy
Copy link
Contributor

donmccurdy commented Feb 14, 2020

Either lines, meshes, or both with an option. At the moment we don't support lines either though. I'll mark this is a feature request for grease pencil.

It's fine if the shader for the 2.82 splash art doesn't appear. Although it IS possible to bake a view dependent colouring for a specific camera, that's not general purpose.

Ideas (and PRs!) for baking arbitrary shader graphs to Principled BSDF or unlit materials are welcome, but this feels like too much for a single exporter to invent... a utility in the Blender Python API would be preferable. Kind of like the NVIDIA MDL Distiller, but for Blender's node graph.

@fire
Copy link
Author

fire commented Feb 14, 2020

https://sketchfab.com/3d-models/mirrors-edge-apartment-interior-scene-9804e9f2fe284070b081c96ceaf8af96 has an example blend file for baking everything to emission.

For the grease pencil to mesh, I couldn't get it working in the ui, but the theory is that you run the documented command.

https://docs.blender.org/manual/en/2.79/interface/grease_pencil/convert_to_geometry.html (note 2.79)

@donmccurdy
Copy link
Contributor

donmccurdy commented Feb 14, 2020

Are you saying the exporter should bake everything to emission for the user? I understand that it can be done, and that it's common practice for artists to do this, but it's highly sensitive to UV unwrapping and texture sizes, so it doesn't seem realistic (or performant) to do this automatically in this exporter.

@fire
Copy link
Author

fire commented Feb 14, 2020

I personally am ok if node graphs aren't baked. Just throwing out ideas.

Personally I would add https://www.materialx.org/assets/MaterialX.v1.35.Final.pdf to Blender. It may already exist!

@fire
Copy link
Author

fire commented Feb 14, 2020

I'll ping https://twitter.com/dfelinto to see if he has anything to say about blender cycles -> osl -> texture sheets.

https://code.blender.org/2014/02/cycles-baking/

@donmccurdy
Copy link
Contributor

Good resources! To be clear, I think many of the steps you're describing would be awesome in their own right:

  1. Blender node graph -> OSL (or -> MaterialX Standard Nodes)
  2. OSL -> Principled BSDF (with simple texture/scalar inputs)

I would guess these are features that should be in Blender core, or a dedicated addon, for now though... if the glTF exporter (and other exporters) can use them, all the better. :)

@donmccurdy
Copy link
Contributor

I'm also pretty sure the code he talks about in https://code.blender.org/2014/02/cycles-baking/ did get merged? Or at least I think that's what's happening when I bake in Cycles now... I just haven't so far felt that the steps were workable for automation so much as an artist-guided process.

@julienduroure julienduroure added the exporter This involves or affects the export process label Feb 20, 2020
@fire
Copy link
Author

fire commented Feb 25, 2020

The OSL nodes for MaterialX are here. https://github.com/materialx/MaterialX/tree/master/libraries/stdlib/osl

@donmccurdy
Copy link
Contributor

Lines can be exported as of #717. Convert To -> Path works nicely with Grease Pencil, perhaps we should make that happen automatically when a Grease Pencil object is exported.

Screen Shot 2021-02-23 at 9 59 19 PM

I'm worried that the rest of this (baking node graphs, OSL) are a pretty large increase in the scope of this addon, with no one volunteering to implement and maintain that. So I think we would need to stop at exporting something that Blender's Python API can generate for us, here.

@fire
Copy link
Author

fire commented Feb 25, 2021

Lines can be exported as of #717. Convert To -> Path works nicely with Grease Pencil, perhaps we should make that happen automatically when a Grease Pencil object is exported.

Makes sense. Scope the feature to export grease pencil.

@BLE77
Copy link

BLE77 commented Nov 9, 2021

Is there still not A way to export the grease pencil to GLB? The only work around ican think of thats not really actually a work around but really cheesing, would b exporting a vid of the animations and then putting it on a plane transparently but that would only work if I kepted it 2d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request exporter This involves or affects the export process
Projects
None yet
Development

No branches or pull requests

4 participants