[x3d-public] Transforms -> HAnimJoints
John Carlson
yottzumm at gmail.com
Sun Sep 17 18:27:58 PDT 2023
--debug-wm failed. But I guess I already call the X3DV Blender plugin in
one of my scripts!
Wow!
Here's the incantation:
bpy.ops.wm.open_mainfile(filepath="LILY_7_3_BLEND.blend")
bpy.ops.export_scene.x3dv(filepath="fooLilyVRML.x3dv")
But this exports XML as fooLilyVRML.x3d.
I will look into setting options to the export call. Well, looking at glTF
Blender documentation helped, where the code didn't pan out. Use this:
import bpy
# bpy.ops.import_scene.fbx(filepath = "../../Tufani/LILY_7_3_BLEND.fbx")
bpy.ops.wm.open_mainfile(filepath="LILY_7_3_BLEND.blend")
bpy.ops.export_scene.x3dv(filepath="blenderLily.x3dv", export_format="X3DV")
bpy.ops.export_scene.x3dv(filepath="blenderLily.json", export_format="JSON")
bpy.ops.export_scene.x3dv(filepath="blenderLily.html", export_format="HTML")
bpy.ops.export_scene.x3dv(filepath="blenderLily.x3d", export_format="X3D")
A lot less menu clicking! Yay!
Then you run the python like this:
C:\> blender --background --python exportAll.py
Note: the JSON output does not pass jsonlint.
The X3DV does not validate with tovrmlx3d.exe:
$ ~/Downloads/view3dscene-4.3.0-win64-x86_64/view3dscene/tovrmlx3d.exe
--validate blenderLily.x3dv
Exception "EX3DLexerError":
Error at line 1 column 1: VRML signature error : unrecognized signature
Needs:
#X3D V4.0 utf8
Instead of:
#VRML V4.0 utf8
The XML is acceptable to X3DJSAIL's X3DLoaderDOM...but no HAnim.
I will work on converting HAnim JSON to Python.
John
On Sun, Sep 17, 2023 at 7:15 PM GPU Group <gpugroup at gmail.com> wrote:
> Of course I don't know the function calls. I always copy & hack. When I
> did io_scene_x3dv it was a hack of blender's io_scene_x3d exporter, so the
> export functions showed up under file > export without me having to think
> too deeply.
> But if you are adding export options -- for example "Export character as [
> ] IFS [x] Hanim" then copy and hack and existing menu option in the
> exporter or that's how I do it. I don't even know the first line of an x3d
> or vrml scene file because I always copy and hack.
> -Doug
>
> On Sun, Sep 17, 2023 at 5:38 PM John Carlson <yottzumm at gmail.com> wrote:
>
>> I’ve installed it. Can you provide or investigate the python function
>> calls that I can use with a file name that will do an import and export?
>> I know you can’t just export visible stuff.
>>
>> This will help me a lot.
>>
>> Thanks!
>>
>> John
>>
>> On Sat, Sep 16, 2023 at 7:33 PM GPU Group <gpugroup at gmail.com> wrote:
>>
>>> 1. zip the io_scene_x3dv folder so you have io_scene_x3dv.zip
>>> 2. in Blender > Edit > preferences > Install button which will give you
>>> a file picker, pick your zip
>>> 3. still in preferences, make sure the box is checked to activate / turn
>>> it on
>>> Then it shows up in the File > Export list.
>>> If you make changes to it, re-zip, then uninstall from preferences
>>> first, before Install again and check box again
>>> -D
>>>
>>>
>>>
>>> On Sat, Sep 16, 2023 at 3:56 PM John Carlson <yottzumm at gmail.com> wrote:
>>>
>>>> Doug, basic information, like "How to export X3DV in a Blender python
>>>> script" is needed. I am referring to:
>>>> https://github.com/dug9/BlenderX3DSupport Please provide basic
>>>> information like how to run a script external to python would help.
>>>>
>>>> Something like:
>>>>
>>>> import bpy
>>>>
>>>> # bpy.ops.import_scene.fbx(filepath = "../../Tufani/LILY_7_3_BLEND.fbx")
>>>> bpy.ops.wm.open_mainfile(filepath="LILY_7_3_BLEND.blend")
>>>> bpy.ops.export_scene.x3dv(filepath="fooLily.x3dv")
>>>>
>>>>
>>>> I will try from the Blender GUI next.
>>>>
>>>> John
>>>>
>>>> On Fri, Aug 25, 2023 at 2:15 PM GPU Group <gpugroup at gmail.com> wrote:
>>>>
>>>>> i'm currently testing with
>>>>>
>>>>> https://freewrl.sourceforge.io/tests/26_Humanoid_Animation/BoxmanBVH_play.x3d
>>>>>
>>>>> - uses freewrl extra nodes HAnimMotionPlay : HAnimMotion and
>>>>> HAnimMotionDataFile HAnimMotionData
>>>>> https://freewrl.sourceforge.io/tests/26_Humanoid_Animation/play.x3d
>>>>> - a handy heads-up Proto for playing files
>>>>> (run,stop,rewind,end,increment,slidebar)
>>>>>
>>>>> https://freewrl.sourceforge.io/tests/26_Humanoid_Animation/BoxmanBVH_play.png
>>>>> and in combination with script in the above scene file I can compare
>>>>> specific animation frames between blender, bvhacker and freewrl, can be
>>>>> adapted to HAnimMotion (doesn't depend on any HAnim nodes itself).
>>>>> -Doug
>>>>>
>>>>> On Fri, Aug 25, 2023 at 12:44 PM John Carlson <yottzumm at gmail.com>
>>>>> wrote:
>>>>>
>>>>>> Yeah, I was trying to write quaternions on shoulder stuff to get from
>>>>>> A Pose to I Pose.
>>>>>>
>>>>>> If you have a good test suite, please share. One thing that I found
>>>>>> out was you're supposed to multiply on the left of center by the quaternion
>>>>>> and on the right by the inverse quaternion??? Online documentation goes
>>>>>> all over the board. I'm thinking of resorting to THREE.js. Maybe The
>>>>>> C/C++/C# SAI has something?
>>>>>>
>>>>>>
>>>>>> Thanks,
>>>>>>
>>>>>> John
>>>>>>
>>>>>> On Fri, Aug 25, 2023 at 1:36 PM GPU Group <gpugroup at gmail.com> wrote:
>>>>>>
>>>>>>> John, that's great we'll need you.
>>>>>>> I haven't worked on the blender exporter in weeks, you are welcome
>>>>>>> to start that HAnim export part if you like.
>>>>>>> https://github.com/dug9/BlenderX3DSupport
>>>>>>> Right now I'm struggling to load .bvh files at random with bvhacker
>>>>>>> https://github.com/DaveDubUK/bvhacker as a cleaning tool. There
>>>>>>> are lots of recorded bvh motion files to download and use. But even
>>>>>>> bvhacker needs work -- for example ensuring Y-UP (blender exports .bvh
>>>>>>> Z-UP), mapping to HAnim LOA names/selecting the right LOA, ARMS_DOWN
>>>>>>> default pose.
>>>>>>> For example when using a T-pose .bvh file (the T geometry is
>>>>>>> recorded in the OFFSETs field and angles are relative to that pose) on an
>>>>>>> ARMS_DOWN HAnim, the shoulder/arm rotations aren't correct. BVHacker does
>>>>>>> some channel swapping X--Y, but similar technique in freewrl doesn't work
>>>>>>> reliably (yet).
>>>>>>> SUMMARY: I'm in the same zone with the hanim transforms but stuck
>>>>>>> back a few steps in getting freewrl to play a .bvh with good shoulder
>>>>>>> animation. So stuck for a while but open to coordinating with you on HAnim
>>>>>>> and blender exporter.
>>>>>>> -Doug
>>>>>>>
>>>>>>> On Fri, Aug 25, 2023 at 12:21 PM John Carlson <yottzumm at gmail.com>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Doug,
>>>>>>>>
>>>>>>>> I have some code I've been working on that converts VRML Transforms
>>>>>>>> with DEFs to HAnimJoints. Maybe we should collaborate on Hanim Blender
>>>>>>>> export. I'm also looking for something that will apply transforms to joint
>>>>>>>> centers, if you have something tested and separate from FreeWRL.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>>
>>>>>>>> John
>>>>>>>>
>>>>>>> _______________________________________________
>>> 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/20230917/d41a8c80/attachment-0001.html>
More information about the x3d-public
mailing list