[X3D-Ecosystem] PREF_FLAT True or False?

John Carlson yottzumm at gmail.com
Fri Nov 8 17:21:51 PST 2024


Please try to import Transforms with the existing importer, which, AFAIK,
has PREF_FLAT = True.  Then you will see what I am talking about.

I believe when you get call getFinalMatrix for a Blender object, it goes up
the x3d tree, looking for Transforms.  We need to decide whether HAnim
nodes are used in the computation (I think they should be, maybe not
HAnimSegment or  HAnimDisplacer).  I can add the necessary checks back.
But doing a HAnim hierarchy in Blender is kind of questionable if PREF_FLAT
is True.  If a child is assigned a matrix_world and a parent is assigned a
matrix_world, will everything just work?

I did set the skeleton’s matrix_world to the result of getFinalMatrix, this
might be considered to.


The problem with flattening the hierarchy is, what do we get when
exporting? Does the exporter reconstruct the Transform or HAnim
hierarchy?  I don’t know the answer to this.  My exporter pretty much
relies on a hierarchy being present.

John

On Fri, Nov 8, 2024 at 6:49 PM Joe D Williams <joedwil at earthlink.net> wrote:

> >  PREF_FLAT = True (no Transforms).
>
>
>
> are you sure that means no transforms in the sense of no transforms, or
> just flat so that all is drawn in place without unnecessary transforms. The
> skeleton and related stuff must be in the equivalent of transforms in order
> to operate as expected.
>
> "flatten" is about the first thing a player must do, to get rid of scaling
> and translations to get the hierarchy 'flat' with everything drawn in
> place. Then nothing is there but the hierarchy with the stuff in correct
> space and the thing can run. Also see where the authortime offers to 'zero'
> everything and rescale all to some size you set.
>
>
>
> All Best Regards,
>
> Joe
>
>
>
> -----Original Message-----
> From: John Carlson <yottzumm at gmail.com>
> Sent: Nov 8, 2024 3:25 PM
> To: Katy Schildmeyer KS APPAREL DESIGN <katy at ksappareldesign.com>, X3D
> Ecosystem public discussion <x3d-ecosystem at web3d.org>, Joe D Williams <
> joedwil at earthlink.net>, Carol McDonald <cemd2 at comcast.net>, Michalis
> Kamburelis <michalis.kambi at gmail.com>, <hanim at web3d.org>, Vincent
> Marchetti <vmarchetti at kshell.com>
> Subject: Re: PREF_FLAT True or False?
>
>
> What I’ve noted is that that maleWaving.dae loads as a hierarchy of
> meshes.  This is why it exports as a hierarchy of Transforms, and why
> maleWaving.x3d loads best with PREF_FLAT = True (no Transforms).  I believe
> PREF_FLAT should be a configurable option, if it’s not already.  If we want
> PREF_FLAT to always be True, I will have to revisit HAnim imports, which I
> am doing anyway (see WIP pull request).
>
> FYI,
>
> John
>
> On Wed, Nov 6, 2024 at 6:04 AM John Carlson <yottzumm at gmail.com> wrote:
>
>> Would you like to choose between a hierarchy of Transforms vs. no
>> Transforms when importing X3D files in Blender?  I’ve got some X3D that
>> works one way and others that work the other way.  It’s know it’s
>> confusing.  It’s kind of dependent on whether there’s HAnim nodes or not.
>> I know I should treat some HAnim like Transforms, but now, I’m not sure.
>> I’m working on a pull request.
>>
>> Sometimes maleWaving.x3d breaks into many pieces. It has no HAnim,  so I
>> make PREF_FLAT True, and all is ok.
>>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-ecosystem_web3d.org/attachments/20241108/d7ce9f41/attachment.html>


More information about the X3D-Ecosystem mailing list