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

John Carlson yottzumm at gmail.com
Tue Jun 27 19:54:13 PDT 2023


Here’s my sample code classes for parsing a Python dict as read by standard
Python JSON parsing utilities.   Let me know if you want my assistance to
flesh this out.  I would prefer help on x3djsonld.py, and I’m limited by
CTS.

https://github.com/coderextreme/X3DJSONLD/blob/master/src/main/python/x3dinput.py

My apologies for not discussing on this thread before.  I had assumed it
was a rejected prototype.

What i was envisioning was producing python code to read X3DUOM and
generate x3dinput.py.

Enjoy!

John


On Tue, Jun 27, 2023 at 9:46 PM John Carlson <yottzumm at gmail.com> wrote:

> Here’s the stylesheet for generating x3d.py, AFAIK.  I haven’t used it.
> One could modify it to import many encodings.  It’s probably better to
> create a separate package.
>
> I believe i have tried to write some sample python code to read JSON in
> separate classes as a quick prototype.  I will do some digging.
>
>
> https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/X3duomToX3dPythonPackage.xslt
>
>
> Enjoy!
>
>
> John
>
>
> On Tue, Jun 27, 2023 at 9:39 PM John Carlson <yottzumm at gmail.com> wrote:
>
>> There were two options with JSON to Python, generate python classes to
>> input JSON like x3d.py outputs JSON, or do something like X3DJSONLD
>> normally does.   I decided on the latter.  Someone can take another
>> approach.   Go for it!
>>
>> John
>>
>> On Tue, Jun 27, 2023 at 9:04 PM GPU Group <gpugroup at gmail.com> wrote:
>>
>>> What I found useful about the auto-generated examples scenes like
>>> helloworld.py in python for X3D.py: I could use them as examples for how to
>>> use the X3D.py API.
>>> What does the x3djsonld.py output scene load to? Do you have python
>>> classes for nodes? If so you could substitute the X3D node classes for your
>>> classes and bingo you have a json importer for x3d.py
>>> -Doug
>>>
>>>
>>> On Tue, Jun 27, 2023 at 7:34 PM John Carlson <yottzumm at gmail.com> wrote:
>>>
>>>> On first glance, this repo has not changed for a couple of years…vince?
>>>>
>>>> Also note that x3djsonld.py inputs JSON and outputs Python.
>>>> X3dToPython.xslt would convert from XML to Python.
>>>>
>>>> My Python serializer is working towards near present Mojo capabilities,
>>>> but Mojo does not currently support x3d.py library that i know of; a
>>>> request for support has been entered.  Mojo is primarily suited for AI…that
>>>> means support for compilation to multiple graphics/AI cards.
>>>>
>>>> Ideally, this will all land on a web page sometime.  The current Mojo
>>>> playground is a Jupyter derivation.
>>>>
>>>> John
>>>>
>>>> On Tue, Jun 27, 2023 at 8:17 PM John Carlson <yottzumm at gmail.com>
>>>> wrote:
>>>>
>>>>> I believe there is a repo for blender export/import.  Maybe Vince???
>>>>> set it up and can add you?
>>>>>
>>>>> I can find a link, but it may be a private repo, not sure at this
>>>>> point.
>>>>>
>>>>> https://github.com/Web3DConsortium/BlenderX3DSupport
>>>>>
>>>>> Enjoy, if you can!
>>>>>
>>>>> John
>>>>>
>>>>> On Tue, Jun 27, 2023 at 4:42 PM GPU Group <gpugroup at gmail.com> wrote:
>>>>>
>>>>>> PHASE I complete:
>>>>>> I have a Cube and light exporting via the 2-step with x3d.py
>>>>>> - by hacking the current x3d exporter aka OFFICIAL exporter
>>>>>> x so it doesn't do anything fancy / no gltf animations or hanim yet
>>>>>> x no import
>>>>>> * but has gltf export/import menu, ready for phase ii
>>>>>> - I have the syntax worked out for going from blender to x3d aka b2x
>>>>>> - temporary name: web3d x3dv exporter
>>>>>> Q. should we have it in a community git / github repo, like gltf
>>>>>> exporter? If so how to set it up so multiple parties can git push?
>>>>>> -Doug
>>>>>>
>>>>>>
>>>>>> On Thu, Jun 22, 2023 at 5:13 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
>>>>>>>>>
>>>>>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230627/00ec3754/attachment-0001.html>


More information about the x3d-public mailing list