[TODO] X3D Export: Add support for basic material node setups #34

Open
opened 2024-11-07 22:33:37 +01:00 by Cedric Steiert · 3 comments
Collaborator

Unfortunately the current addon version does not support (or work if implemented already, not checked yet) blender materials node export of any kind.
Basic node setups could be read via blender python api (go through node tree and get the properties of each node used).
More complex node setups would need to get either baked to image texture or processed as glsl shader code (like H3D Extensions did in blender 2.79); this is currently out of scope and may or may not be added.

Blender nodes to get supported:

  • Diffuse
  • Emission
  • Principled BSDF
  • Image Texture (Image and Movie type)
  • Vector (Mapping for texture transforms)
Unfortunately the current addon version does not support (or work if implemented already, not checked yet) blender materials node export of any kind. Basic node setups could be read via blender python api (go through node tree and get the properties of each node used). More complex node setups would need to get either baked to image texture or processed as glsl shader code (like H3D Extensions did in blender 2.79); this is currently out of scope and may or may not be added. Blender nodes to get supported: - [ ] Diffuse - [ ] Emission - [ ] Principled BSDF - [ ] Image Texture (Image and Movie type) - [ ] Vector (Mapping for texture transforms)
Cedric Steiert added the
enhancement
task
labels 2024-11-07 22:33:37 +01:00
Author
Collaborator

@vmarchetti I believe you already started work on supporting image texture nodes of the exporter on your fork? What feature scope do you plan to cover?

@vmarchetti I believe you already started work on supporting image texture nodes of the exporter on your fork? What feature scope do you plan to cover?
Collaborator

I am re-enabling exporting an ImageTexture X3D node in x3d exporter. The new code is in the image-export branch of https://projects.blender.org/vmarchetti/io_scene_x3d . I am testing and my goal is to create a pull-request on Nov 11.

The implementation follows the course you describe, it traverses the material node tree and identifies the case that closely matches X3D's image as texture capabilities; the image is applied as the "Base Color" of Blender BSDF node tree.

Another new feature of the code is that it will write the image to disk as part of the export, even when the image is a "Packed File" in the Blender data. This is intended to support the workflow

import glTF/glb --> edit Blender Scene --> export as X3D

in which case the image may not exist on disk as a separate image file. I'm still thinking about how this would be integrated with the existing path-mode mechanism in blender, which looks like it depends on the image file existing somewhere on disk that can be copied to where the user wants it.

I do intend to next work on the correct export of a Blender node-defined material which will at least for now get mapped into X3D's RGB-based colors. There are other members of the X3D community who will be working on physically based material export once a ground trail is blazed.

I am re-enabling exporting an ImageTexture X3D node in x3d exporter. The new code is in the image-export branch of https://projects.blender.org/vmarchetti/io_scene_x3d . I am testing and my goal is to create a pull-request on Nov 11. The implementation follows the course you describe, it traverses the material node tree and identifies the case that closely matches X3D's image as texture capabilities; the image is applied as the "Base Color" of Blender BSDF node tree. Another new feature of the code is that it will write the image to disk as part of the export, even when the image is a "Packed File" in the Blender data. This is intended to support the workflow import glTF/glb --> edit Blender Scene --> export as X3D in which case the image may not exist on disk as a separate image file. I'm still thinking about how this would be integrated with the existing path-mode mechanism in blender, which looks like it depends on the image file existing somewhere on disk that can be copied to where the user wants it. I do intend to next work on the correct export of a Blender node-defined material which will at least for now get mapped into X3D's RGB-based colors. There are other members of the X3D community who will be working on physically based material export once a ground trail is blazed.
Author
Collaborator

@vmarchetti Alright, great to hear, i'll be happy to merge once finished. So current features being worked on: Export support of the nearest image texure node and copy file to output directory.
Two additional proposals from my side regarding your current work:

  • a drop down Path Mode like the fbx exporter, as it would allow the user to specifiy, whether the texture file should get copied, or an absolute/relative Path get used. Though, i'm unsure if this would be helpful for users or just add ui-complexity...
  • support of movie texture. At least inside blender movie and image textures share the same node, so i'll think adding support for it at this time would be reasonable (could ofc be added later as well). For details on the movie node properties you may look at my previous importer commit c94f3847bb.

Could you already create a WIP Pull Request? Tracking features/bugs being currently worked on as well as open communication would be easier. By the way, don't stress about time; extensions are not bound to any release cycles, so anytime meaningful changes appeared, a new version can get published.

I do intend to next work on the correct export of a Blender node-defined material which will at least for now get mapped into X3D's RGB-based colors.

So support of the above mentioned blender nodes is planned on your side?

@vmarchetti Alright, great to hear, i'll be happy to merge once finished. So current features being worked on: Export support of the nearest image texure node and copy file to output directory. Two additional proposals from my side regarding your current work: - a drop down `Path Mode` like the fbx exporter, as it would allow the user to specifiy, whether the texture file should get copied, or an absolute/relative Path get used. Though, i'm unsure if this would be helpful for users or just add ui-complexity... - support of movie texture. At least inside blender movie and image textures share the same node, so i'll think adding support for it at this time would be reasonable (could ofc be added later as well). For details on the movie node properties you may look at my previous importer commit https://projects.blender.org/extensions/io_scene_x3d/commit/c94f3847bbd79a6775191f472ae65e19a8c6efb0. Could you already create a WIP Pull Request? Tracking features/bugs being currently worked on as well as open communication would be easier. By the way, don't stress about time; extensions are not bound to any release cycles, so anytime meaningful changes appeared, a new version can get published. > I do intend to next work on the correct export of a Blender node-defined material which will at least for now get mapped into X3D's RGB-based colors. So support of the above mentioned blender nodes is planned on your side?
Sign in to join this conversation.
No description provided.