<div dir="ltr"><div dir="ltr">Report so far. This is to set a baseline for what we have currently.   I set up the default exporter, probably without any texture pull request.<div><br></div><div>bash runimportmichalis.sh<br>Read blend: "C:\Users\jcarl\X3DJSONLD\blend\level.blend"<br>Info: starting X3D export to 'levelExportB.x3d'...<br>missing 'C:\\Users\\jcarl\\X3DJSONLD\\blend\\textures\\Pillar_02.jpg', not copying<br>missing 'C:\\Users\\jcarl\\X3DJSONLD\\blend\\textures\\Soil01.png', not copying<br>missing 'C:\\Users\\jcarl\\X3DJSONLD\\blend\\textures\\Planks_02.jpg', not copying<br>Info: finished X3D export to 'levelExportB.x3d'</div><div><br>Read blend: "C:\Users\jcarl\X3DJSONLD\blend\multiple_textures.blend"<br>Info: starting X3D export to 'multiple_texturesExportB.x3d'...<br>missing 'C:\\Users\\jcarl\\X3DJSONLD\\blend\\textures\\leaf.png', not copying<br>Info: finished X3D export to 'multiple_texturesExportB.x3d'</div><div><br>Read blend: "C:\Users\jcarl\X3DJSONLD\blend\texture_transforms_on_base_texture.blend"<br>Info: starting X3D export to 'texture_transforms_on_base_textureExportB.x3d'...<br>missing 'C:\\Users\\jcarl\\X3DJSONLD\\blend\\textures\\base_texture.png', not copying<br>Info: finished X3D export to 'texture_transforms_on_base_textureExportB.x3d'<br>GPUTexture: Blender Texture Not Loaded!<br>Saved session recovery to "C:\Users\jcarl\AppData\Local\Temp\quit.blend"<br><br>Blender quit</div><div><br></div><div>This was kind of expected with the standard exporter, and the way around this was to export the textures oneself (not ideal!), so I grabbed the images from x3d-tests:</div><div><br></div><div>$ cp `find ~/x3d-tests/blender_tests/texture_transform/ -name '*jpg'` textures/</div><div>$ cp `find ~/x3d-tests/blender_tests/texture_transform/ -name '*png'` textures/</div><div>$ cp textures/*png .<br>$ cp textures/*jpg .</div><div><br></div><div><img src="cid:ii_m5a29wqz0" alt="image.png" width="440" height="357"><br></div><div><br></div><div><img src="cid:ii_m5a2dz541" alt="image.png" width="556" height="410"><br></div><div><br></div><div><img src="cid:ii_m5a2fsx72" alt="image.png" width="553" height="401"><br></div><div><br></div><div>My exporter produced one file at first (see later), without texture:</div><div><br></div><div><img src="cid:ii_m5a2lsb83" alt="image.png" width="562" height="440"><br></div><div><br></div><div>None of the exporters produced a TextureTransform.  There were errors in my runs, including:</div><div><br></div><div>  File "C:\Users\jcarl\AppData\Roaming\Blender Foundation\Blender\4.3\scripts\addons\io_scene_x3dv\blender\exp\x3dv_blender_export.py", line 2667, in export_main<br>    children = b2x_object(None, obj_main, obj_main_children, x3dmodel.Scene, image_textures, x3d_obj).children<br>               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>  File "C:\Users\jcarl\AppData\Roaming\Blender Foundation\Blender\4.3\scripts\addons\io_scene_x3dv\blender\exp\x3dv_blender_export.py", line 2392, in b2x_object<br>    shape = b2xShape(geometry=node)<br>            ^^^^^^^^^^^^^^^^^^^^^^^<br>  File "C:\Users\jcarl\AppData\Roaming\Blender Foundation\Blender\4.3\scripts\addons\io_scene_x3dv\blender\exp\x3dv_blender_export.py", line 2038, in b2xShape<br>    x3d_obj = Shape(appearance=Appearance(), geometry=geometry)<br>              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^<br>  File "C:\Users\jcarl\AppData\Roaming\Blender Foundation\Blender\4.3\scripts\addons\io_scene_x3dv\blender\com\x3dv.py", line 83969, in __init__<br>    self.geometry = geometry<br>    ^^^^^^^^^^^^^<br>  File "C:\Users\jcarl\AppData\Roaming\Blender Foundation\Blender\4.3\scripts\addons\io_scene_x3dv\blender\com\x3dv.py", line 84047, in geometry<br>    raise X3DTypeError(str(geometry) + ' does not match required node type (_X3DGeometryNode,ProtoInstance) and is invalid')<br>io_scene_x3dv.blender.com.x3dv.X3DTypeError: Transform(DEF='TE_Text',USE=None) does not match required node type (_X3DGeometryNode,ProtoInstance) and is invalid<br>Location: C:\Program Files\Blender Foundation\Blender 4.3\4.3\scripts\modules\bpy\ops.py:109<br><br>Saved session recovery to "C:\Users\jcarl\AppData\Local\Temp\quit.blend"<br>... truncated<br>Blender quit</div><div><br></div><div><br></div><div>This is saying that a Shape.geometry can't be set to a Transform!</div><div><br></div><div>This is due to Blender FONT being converted to a default X3D Transform instead of a X3D Text node.  So I applied a patch:</div><div><br></div><div>            elif obj_main.type == "FONT":<br>                x3d_type_str = "Text"<br>                x3d_obj = b2xInstantiate(x3d_type_str, x3d_oid, x3d_name, obj_main, x3d_matrix)</div><div><br></div><div><br></div><div>While the exports ran to completion, there were no textures evident in the output, just white text and a white box.  I have to work on reducing duplicates, but not removing useful stuff.</div><div><br></div><div><img src="cid:ii_m5a3kr584" alt="image.png" width="523" height="432"><br></div><div><br></div><div>I'm going to take a break and see if I can figure out DEF/USE versus similarly named objects. It seems like the default exporter produced some files that I can look at.</div><div><br></div><div>In general, my exporter has a lot of problems with extra USE attributes (*ExportB.x3d is the standard exporter):  The Material USE is particularly pernicious.</div><div><br></div><div>$ grep USE {level,multiple_textures,texture_transforms_on_base_texture}Export*.x3d<br>levelExport.x3d:          <Coordinate USE='CO_coords_ME_Cube_016'><br>levelExport.x3d:          <Normal USE='NO_normals_ME_Cube_016'><br>levelExport.x3d:          <TextureCoordinate USE='TX_Cube_016'><br>levelExport.x3d:        <Material USE='MA_mat_soil'><br>levelExport.x3d:        <Material USE='MA_mat_soil'><br>levelExport.x3d:        <Material USE='MA_mat_pillar'><br>levelExport.x3d:        <Coordinate USE='CO_coords_ME_Cube_016'><br>levelExport.x3d:        <Normal USE='NO_normals_ME_Cube_016'><br>levelExport.x3d:        <TextureCoordinate USE='TX_Cube_016'><br>levelExportB.x3d:                                                       <ImageTexture USE="IM_Soil01_png_001" /><br>levelExportB.x3d:                                                       <Material USE="MA_mat_soil" /><br>levelExportB.x3d:                                                       <Coordinate USE="coords_ME_Cube_016" /></div><div><br>multiple_texturesExport.x3d:        <Material USE='MA_Material_001'><br>multiple_texturesExport.x3d:        <Material USE='MA_Material_006'><br>multiple_texturesExport.x3d:        <Material USE='MA_Material_007'><br>multiple_texturesExport.x3d:        <Material USE='MA_Material_008'><br>multiple_texturesExportB.x3d:                                                   <ImageTexture USE="IM_leaf_png" /><br>multiple_texturesExportB.x3d:                                                   <ImageTexture USE="IM_leaf_png" /><br>multiple_texturesExportB.x3d:                                                   <ImageTexture USE="IM_leaf_png" /></div><div><br>texture_transforms_on_base_textureExport.x3d:        <Material USE='MA_Material_001'><br>texture_transforms_on_base_textureExport.x3d:        <Material USE='MA_Material_002'><br>texture_transforms_on_base_textureExport.x3d:        <Material USE='MA_Material_003'><br>texture_transforms_on_base_textureExport.x3d:        <Material USE='MA_Material_004'><br>texture_transforms_on_base_textureExport.x3d:        <Material USE='MA_Material_005'><br>texture_transforms_on_base_textureExportB.x3d:                                                  <ImageTexture USE="IM_base_texture_png" /><br>texture_transforms_on_base_textureExportB.x3d:                                                  <ImageTexture USE="IM_base_texture_png" /><br>texture_transforms_on_base_textureExportB.x3d:                                                  <ImageTexture USE="IM_base_texture_png" /><br>texture_transforms_on_base_textureExportB.x3d:                                                  <ImageTexture USE="IM_base_texture_png" /></div><div><br></div><div><br></div><div><br></div><div>Indeed there are no Material nodes with a DEF attribute!</div><div><br></div><div>$ grep '<'Material {level,multiple_textures,texture_transforms_on_base_texture}Export.x3d<br>levelExport.x3d:        <Material USE='MA_mat_soil'><br>levelExport.x3d:        <Material USE='MA_mat_soil'><br>levelExport.x3d:        <Material USE='MA_mat_pillar'><br>multiple_texturesExport.x3d:        <Material USE='MA_Material_001'><br>multiple_texturesExport.x3d:        <Material USE='MA_Material_006'><br>multiple_texturesExport.x3d:        <Material USE='MA_Material_007'><br>multiple_texturesExport.x3d:        <Material USE='MA_Material_008'><br>texture_transforms_on_base_textureExport.x3d:        <Material USE='MA_Material_001'><br>texture_transforms_on_base_textureExport.x3d:        <Material USE='MA_Material_002'><br>texture_transforms_on_base_textureExport.x3d:        <Material USE='MA_Material_003'><br>texture_transforms_on_base_textureExport.x3d:        <Material USE='MA_Material_004'><br>texture_transforms_on_base_textureExport.x3d:        <Material USE='MA_Material_005'></div><div><br></div><div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, Dec 28, 2024 at 5:16 PM Michalis Kamburelis <<a href="mailto:michalis.kambi@gmail.com" target="_blank">michalis.kambi@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">John,<br>
<br>
My tests apply to texture transformations (not textures).<br>
<br>
And I didn't test animating anything -- as the current Blender -> X3D<br>
exporter doesn't export any animation at all from what I know. Small<br>
steps, let's add there first basic transformations (transforming<br>
Blender object's location/rotation/scale exported to X3D animating<br>
Transform.translation/rotation/scale would be my suggestions), then<br>
skinned animation, then think about less common use-cases (like<br>
animating texture transformations or texture coordinates).<br>
<br>
Regards,<br>
Michalis<br>
<br>
sob., 28 gru 2024 o 22:37 John Carlson via x3d-public<br>
<<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>> napisał(a):<br>
><br>
> Great examples, Michalis.<br>
><br>
> I note at least three things:<br>
><br>
> 1.  There's no texture animation, but Joe's example has that.  I have not seen if your fps_game example has texture animation or not.<br>
><br>
> 2.  My exporter exports textures (not animations).  I am looking forward to looking at what Vince and Cedric are doing, and if they don’t have animation yet, I will attempt to add it.<br>
><br>
> 3.  I am starting to tie meshes to the empty type objects I am importing, if meshes are present.<br>
><br>
> I’ll send a pic with what i have for Joe Skin export in a bit.<br>
><br>
> John<br>
><br>
> On Fri, Dec 27, 2024 at 7:23 PM Michalis Kamburelis via x3d-public <<a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a>> wrote:<br>
>><br>
>> Vincent and all,<br>
>><br>
>> ( Sorry it took me a while -- Christmas times are busy in offline<br>
>> activities :) )<br>
>><br>
>> 1. I prepared the promised tests of texture transformation in Blender,<br>
>> to help implementing their handling in the Blender -> X3D exporter.<br>
>><br>
>> They are inside the "blender_tests/texture_transform/" of my<br>
>> repository <a href="https://github.com/michaliskambi/x3d-tests/" rel="noreferrer" target="_blank">https://github.com/michaliskambi/x3d-tests/</a> . Browse them<br>
>> through here <a href="https://github.com/michaliskambi/x3d-tests/tree/master/blender_tests/texture_transform" rel="noreferrer" target="_blank">https://github.com/michaliskambi/x3d-tests/tree/master/blender_tests/texture_transform</a><br>
>> . To just download them, it's probably easiest to "git clone" the<br>
>> whole x3d-tests repo.<br>
>><br>
>> The README inside (<br>
>> <a href="https://github.com/michaliskambi/x3d-tests/blob/master/blender_tests/texture_transform/README.md" rel="noreferrer" target="_blank">https://github.com/michaliskambi/x3d-tests/blob/master/blender_tests/texture_transform/README.md</a><br>
>> ) already describes everything. A short summary:<br>
>><br>
>> - I tested transforming base, normal, metallic/roughness textures<br>
>> (same or differently).<br>
>><br>
>> - I added a "real-life example" of using texture transformation (from<br>
>> Castle Game Engine "examples/fps_game" demo,<br>
>> <a href="https://github.com/castle-engine/castle-engine/tree/master/examples/fps_game" rel="noreferrer" target="_blank">https://github.com/castle-engine/castle-engine/tree/master/examples/fps_game</a><br>
>>  ).<br>
>><br>
>> - I added glTF exporter outputs, screenshots from Blender, Castle<br>
>> Model Viewer -> hopefully this all makes it clear what is the desired<br>
>> output.<br>
>><br>
>> - TODO: I planned to do, but did not do this: I wanted to create a<br>
>> "desired" X3D files, crafted by hand, to show how a proper X3D output<br>
>> should look like. Not done yet, simply because of lack of time. I<br>
>> don't want to keep you waiting, so I send you the tests as they are<br>
>> now. Ping me if you think you need these "desired" X3D files :)<br>
>><br>
>> 2. Moreover, I added tests for per-vertex colors.<br>
>><br>
>> This shows per-vertex colors generated using Blender's "Ambient<br>
>> Occlusion" (make areas e.g. behind ears nicely darker even without<br>
>> using real-time shadows) and how they can be multiplied with<br>
>> material(s) in glTF. This is a feature we talked about -- you<br>
>> mentioned you wanted to implement it by "premultiplying" the material<br>
>> * per-vertex color. Hopefully my tests will help make sure it's all<br>
>> correct :)<br>
>><br>
>> They are in:<br>
>><br>
>> <a href="https://github.com/michaliskambi/x3d-tests/tree/master/blender_tests/per_vertex_colors" rel="noreferrer" target="_blank">https://github.com/michaliskambi/x3d-tests/tree/master/blender_tests/per_vertex_colors</a><br>
>><br>
>> Again, I added glTF exporter outputs, screenshots from Blender, Castle<br>
>> Model Viewer -> showing what should happen.<br>
>><br>
>> I hope these are useful! Let me know if anything in this is unclear.<br>
>><br>
>> Regards,<br>
>> Michalis<br>
>><br>
>> _______________________________________________<br>
>> x3d-public mailing list<br>
>> <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
>> <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
><br>
> _______________________________________________<br>
> x3d-public mailing list<br>
> <a href="mailto:x3d-public@web3d.org" target="_blank">x3d-public@web3d.org</a><br>
> <a href="http://web3d.org/mailman/listinfo/x3d-public_web3d.org" rel="noreferrer" target="_blank">http://web3d.org/mailman/listinfo/x3d-public_web3d.org</a><br>
</blockquote></div>
</div>