[X3D-Ecosystem] Don McCurdy gave me the secret to combining animations when exporting glTF

John Carlson yottzumm at gmail.com
Tue Oct 15 17:34:32 PDT 2024


Does anyone know how to load an entire X3D scene into Blender to make a
movie?

Thanks!

John

On Tue, Oct 15, 2024 at 7:26 PM John Carlson <yottzumm at gmail.com> wrote:

> What I mean by *everyone* is everyone who has a production Blender
> X3D/VRML import/export script using this mechanism.  I hope if someone
> complains that the script doesn't work anymore, they come knocking on your
> door, Joe, and not mine!
>
> But first, let's make sure we've got the HAnim loader working with other
> scene items.
>
> John
>
> On Tue, Oct 15, 2024 at 7:19 PM John Carlson <yottzumm at gmail.com> wrote:
>
>> I'm actually changing in two places:
>>
>> global_matrix = axis_conversion(from_forward=self.axis_up,
>>                                         from_up=self.axis_forward,
>>                                         ).to_4x4()
>>
>> Under ImportX3D execute.  And:
>>
>>         global_matrix = axis_conversion(to_forward=self.axis_up,
>>                                         to_up=self.axis_forward,
>>                                         ).to_4x4() @ Matrix.Scale(
>>             1.0 / 0.0254 if self.file_unit == 'IN' else
>> self.global_scale, 4)
>>
>> Under  ExportX3D execute.
>>
>> I don't really know why they aren't identical.
>>
>> So we can have our cake and eat it too, we can replace the axis
>> conversion with what we like.  The issue is, that it affects *everyone* who
>> has used X3D import/export in Blender.
>>
>> Joe, if you agree with this, I will try to get this into the Blender
>> extension release.
>>
>> Thanks!
>>
>> John
>>
>>
>>
>> On Tue, Oct 15, 2024 at 7:12 PM John Carlson <yottzumm at gmail.com> wrote:
>>
>>> Not really wanting to get in a huge discussion about +Yup and +Zforward.
>>> I can make the following suggestion to change the blender X3D importer,
>>> realizing this will affect *everyone" who uses the Blender plugin,
>>> hopefully in a positive way (- means remove these lines, + means add the
>>> lines).  In the initialization:
>>>
>>> @@ -70,8 +70,8 @@ class ImportX3D(bpy.types.Operator, ImportHelper):
>>>                                              "axis_up",
>>>                                              "filter_glob",
>>>                                              ))
>>> -        global_matrix = axis_conversion(from_forward=self.axis_forward,
>>> -                                        from_up=self.axis_up,
>>> +        global_matrix = axis_conversion(from_forward=self.axis_up,
>>> +                                        from_up=self.axis_forward,
>>>                                          ).to_4x4()
>>>          keywords["global_matrix"] = global_matrix
>>>
>>> The axis_conversion method is not part of the importer or exporter.  We
>>> can also change the global_matrix to something else as well.  This affects
>>> *everyone* who uses the blender import/export.
>>>
>>> With external scripts, I have only been able to change the Main view
>>> such that JinLOA4 is not lying flat on his back.  I can erase the floor,
>>> but the floor looks useful  I have been able to look at floor
>>> constraints on objects, but I think we need an object to set the floor
>>> constraint for.  I think that's more about where the floor is for an
>>> object, not changing the "stage."   Maybe that's another thing I can look
>>> up.
>>>
>>> We still need to test humanoids with other objects.
>>>
>>> John
>>>
>>>
>>>
>>> On Tue, Oct 15, 2024 at 5:02 PM Joe D Williams <joedwil at earthlink.net>
>>> wrote:
>>>
>>>> > export_yup=False,
>>>>
>>>> I still think the only reason yup=False is in there because whatever
>>>> was drawn that way in the blender. That is not going to be fun to correct
>>>> in x3d, as we see.
>>>>
>>>> So, this is useless for Humanoid, but probably pass for common geometry
>>>> that needs to be transformed anyway.
>>>>
>>>> So, me still say this is useless operation for HAnim. Get it drawn
>>>> fight in Blender and then export it as we want it, yup=true, +x=model left,
>>>> model faces +z, reference for all measurements are 0 0 0 between feet, and
>>>> to 'human' scale we expect in a standard environment.
>>>>
>>>> Otherwise, the export is useless for hanim because hard to fix, plus
>>>> animations are in danger of getting messed up.
>>>> We would not import joekick with yup=False, right?
>>>>
>>>> Overall, we really don't want the runtime to do a bunch of gyrations
>>>> and transformations to get the thing in "standard' form for operation with
>>>> others in 'standard' form in a 'standard' environment. This is not limiting
>>>> because any authoring tool worth it will give you standard GL coordinate
>>>> system to work in as well as zero functions to present the thing as
>>>> expected.
>>>>
>>>> Thanks for trying but please start where it needs to be started in
>>>> standard GL as the host root coordinate system that is importing skeleton
>>>> drawn in GL coordsys, working in GL coordsys and exporting in GL coordsys.
>>>> Best of Faith in the GL,
>>>> Joe
>>>>
>>>>
>>>>
>>>> -----Original Message-----
>>>> From: John Carlson <yottzumm at gmail.com></yottzumm at gmail.com>
>>>> Sent: Oct 15, 2024 11:54 AM
>>>> To: Joe D Williams <joedwil at earthlink.net>, Katy Schildmeyer KS
>>>> APPAREL DESIGN <katy at ksappareldesign.com>, Michalis Kamburelis <
>>>> michalis.kambi at gmail.com>, X3D Ecosystem public discussion <
>>>> x3d-ecosystem at web3d.org>, Holger Seelig <holger.seelig at yahoo.de></
>>>> holger.seelig at yahoo.de></x3d-ecosystem at web3d.org></
>>>> michalis.kambi at gmail.com></katy at ksappareldesign.com></
>>>> joedwil at earthlink.net>
>>>> Subject: Don McCurdy gave me the secret to combining animations when
>>>> exporting glTF
>>>>
>>>> Blender Python script for exporting glb as a single, combined
>>>> animation: bpy.ops.export_scene.gltf(
>>>> filepath=os.path.join(".",
>>>> f"JoeSkinTexcoordDisplacerKickUpdate2Export.glb"),
>>>> export_yup=False,
>>>> # export_format="GLTF_SEPARATE",
>>>> export_format="GLB",
>>>> export_nla_strips_merged_animation_name='Animation',
>>>> export_animation_mode="ACTIVE_ACTIONS", #"SCENE",
>>>> export_influence_nb=40,
>>>> export_all_influences=True,
>>>> use_active_collection=True
>>>> )
>>>>
>>>>
>>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20241015/5487c77b/attachment.html>


More information about the X3D-Ecosystem mailing list