[x3d-public] Blender > Exporting rig transforms to HAnim?

Michalis Kamburelis michalis.kambi at gmail.com
Fri Jun 23 06:29:53 PDT 2023


> I believe Michalis has code to transform glTF or glb to XML, but I'm not sure.

John:

I do, i.e. view3dscene, tovrmlx3d and CGE can convert glTF (binary or
not, so .gltf or .glb extensions) to X3D XML (or X3D classic).

BTW: You can export Blender->glTF and then do glTF->X3D using
view3dscene/CGE, to effectively get X3D from Blender. But then it's a
double conversion, and you deal with 2 changes that may lose/mangle
some data. CGE doesn't handle everything, and may never will (
https://github.com/michaliskambi/x3d-tests/wiki/Converting-glTF-to-X3D
), for some stuff I also rely on CGE-specific extensions (though you
can disable their usage).

For the 2nd step, you could also use X_ITE glTF->X3D converter.

Ideal future: The Blender->X3D exporter should be written in Python
and not require any external tools, so it can be used by artists "out
of the box", just like current Blender->glTF. And so it can do things
in way "optimal for X3D", without being tied to glTF. E.g. exporting
skinned animation from Blender to X3D H-Anim is likely easier to do
directly, without "extra step" of expressing them as glTF inverse
transforms along the way.

> A quick peek at gltf export/import: they do a 2-step conversion
> blender scenegraph <=> gltf scenegraph <=> files (.gltf, .glb etc)

Doug: Indeed Blender->glTF Khronos has internally an "intermediate
form" in Python structures along the way. I noticed it in one PR. I
don't know the rationale behind it, but it seemed workable approach
for small changes I was doing around it. And maybe it is actually
beneficial for us? As you say, maybe we can even use this intermediate
form to some extent. All your options seem good to me :), thanks for
pursuing this.

Regards,
Michalis

pt., 23 cze 2023 o 04:03 John Carlson <yottzumm at gmail.com> napisał(a):
>
> I believe Michalis has code to transform glTF or glb to XML, but I'm not sure.
>
> On Thu, Jun 22, 2023 at 9:02 PM John Carlson <yottzumm at gmail.com> wrote:
>>
>> The only “import” i have converts JSON to a python scenegraph.  Unfinished, but works in some cases.  I have a serializer as well, but it's very unfinished.
>>
>> https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/python/x3djsonld.py
>>
>> On Thu, Jun 22, 2023 at 6:14 PM GPU Group <gpugroup at gmail.com> wrote:
>>>
>>> John,
>>> x3d.py looks interesting -- the node classes have XML, JSON, HTML, VRML export functions (missing equivalent import functions?)
>>> - I'll study it
>>> -Doug
>>>
>>> On Thu, Jun 22, 2023 at 4:48 PM John Carlson <yottzumm at gmail.com> wrote:
>>>>
>>>> Check out x3d.py X3DPSAIL for python graph.
>>>> Check out x3djsonld.py (X3DJSONLD) for JSON -> x3d.py structures -> XML, HTML5,VRML, etc.
>>>>
>>>>  x3djsonld.py needs more work.
>>>>
>>>> John
>>>>
>>>> On Thu, Jun 22, 2023 at 4:51 PM GPU Group <gpugroup at gmail.com> wrote:
>>>>>
>>>>> A quick peek at gltf export/import: they do a 2-step conversion
>>>>> blender scenegraph <=> gltf scenegraph <=> files (.gltf, .glb etc)
>>>>> I've seen 2-step before, with collada exporter
>>>>> I don't quite understand the need for the middle format - seems a bit bureaucratic - but working well for them, perhaps easier to maintain 2-way conversions per-node-class. And can export /import to different file formats .x3dv and .x3d from same middle format. They also mention something generated automatically from some specification.
>>>>> Options:
>>>>> 1. do what they do, except with a web3d python scenegraph in the middle
>>>>> a) if someone has one already, use that
>>>>> b) generate one from specifications
>>>>> c) manually create one in python
>>>>> 2. copy their bender <=> gltf part, and change the gltf <=> files part to x3dv,x3d
>>>>> x but would be missing things that gltf doesn't have but web3d does?
>>>>> 3. stick with 1-step, hack / upgrade current x3d exporter using gltf blender <=> gltf as guide to getting all the blender goodies
>>>>>
>>>>> 1.a) Q. does anyone have python web3d node classes suitable for a scenegraph, or b) can generate from specs?
>>>>> Thanks,
>>>>> -Doug
>>>>>
>>>>> On Thu, Jun 22, 2023 at 2:38 PM Brutzman, Donald (Don) (CIV) <brutzman at nps.edu> wrote:
>>>>>>
>>>>>> I too share that Blender->X3D conversion dream, Michalis!  8)
>>>>>>
>>>>>>
>>>>>>
>>>>>> Given that X3D data types are clearly defined with thorough animation/interaction support, and given that you have indeed mapped glTF 2.0 rendering into X3D 4.0 capabilities, it is reasonable for anyone pursuing this effort to expect that complete success of rendering and animation is indeed possible.  Good to know when pursuing worthy goals.
>>>>>>
>>>>>>
>>>>>>
>>>>>> all the best, Don
>>>>>>
>>>>>> --
>>>>>>
>>>>>> Don Brutzman  Naval Postgraduate School, Code USW/Br        brutzman at nps.edu
>>>>>>
>>>>>> Watkins 270,  MOVES Institute, Monterey CA 93943-5000 USA    +1.831.656.2149
>>>>>>
>>>>>> X3D graphics, virtual worlds, navy robotics https://faculty.nps.edu/brutzman
>>>>>>
>>>>>>
>>>>>>
>>>>>> -----Original Message-----
>>>>>> From: x3d-public <x3d-public-bounces at web3d.org> On Behalf Of Michalis Kamburelis
>>>>>> Sent: Thursday, June 22, 2023 9:40 AM
>>>>>> To: GPU Group <gpugroup at gmail.com>
>>>>>> Cc: X3D Graphics public mailing list <x3d-public at web3d.org>
>>>>>> Subject: Re: [x3d-public] Blender > Exporting rig transforms to HAnim?
>>>>>>
>>>>>>
>>>>>>
>>>>>> Blender->glTF exporter from Khronos (
>>>>>>
>>>>>> https://github.com/KhronosGroup/glTF-Blender-IO/ , regularly synched to the version bundled with Blender) has great support for animations.
>>>>>>
>>>>>> Simple animations (changing transformations), shape keys (this means "CoordinateInterpolator" in X3D), skinning (H-Anim in X3D). And it supports some more things too :) Like working textures, PBR, custom properties ("metadata" in X3D).
>>>>>>
>>>>>>
>>>>>>
>>>>>> I indeed dream that someone will have time to upgrade the Blender->X3D exporter to add there these capabilities, and yes, looking at
>>>>>>
>>>>>> Blender->glTF exporter is a reasonable approach for this.
>>>>>>
>>>>>>
>>>>>>
>>>>>> Regards,
>>>>>>
>>>>>> Michalis
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> czw., 22 cze 2023 o 18:31 GPU Group <gpugroup at gmail.com> napisał(a):
>>>>>>
>>>>>> >
>>>>>>
>>>>>> > Thanks Michalis for info.
>>>>>>
>>>>>> > Q. Does another Blender exporter for another format (not x3d) export the rig transforms / animations?
>>>>>>
>>>>>> > Hypothesis: if another exporter does, then it would be possible to copy / adapt code from that exporter to x3d exporter.
>>>>>>
>>>>>> > -Doug
>>>>>>
>>>>>> >
>>>>>>
>>>>>> > On Thu, Jun 22, 2023 at 10:22 AM Michalis Kamburelis <michalis.kambi at gmail.com> wrote:
>>>>>>
>>>>>> >>
>>>>>>
>>>>>> >> The Blender->X3D exporter unfortunately doesn't support animations
>>>>>>
>>>>>> >> (of any kind - even simple transformations, not to mention skinning
>>>>>>
>>>>>> >> animation with H-Anim).
>>>>>>
>>>>>> >>
>>>>>>
>>>>>> >> Regards,
>>>>>>
>>>>>> >> Michalis
>>>>>>
>>>>>> >>
>>>>>>
>>>>>> >>
>>>>>>
>>>>>> >>
>>>>>>
>>>>>> >> czw., 22 cze 2023 o 18:16 GPU Group <gpugroup at gmail.com> napisał(a):
>>>>>>
>>>>>> >> >
>>>>>>
>>>>>> >> > If I make a skin and add a rig in Blender, on export, how do I get any rig transforms to export to HAnim along with the skin?
>>>>>>
>>>>>> >> > When I use the default x3d export, all I see is the skin in an IndexedFaceSet.
>>>>>>
>>>>>> _______________________________________________
>>>>>>
>>>>>> x3d-public mailing list
>>>>>>
>>>>>> x3d-public at web3d.org
>>>>>>
>>>>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org
>>>>>
>>>>> _______________________________________________
>>>>> x3d-public mailing list
>>>>> x3d-public at web3d.org
>>>>> http://web3d.org/mailman/listinfo/x3d-public_web3d.org



More information about the x3d-public mailing list