[x3d-public] HAnim Joints, Segments, Sites DEF substitution algorithm

John Carlson yottzumm at gmail.com
Thu Sep 14 20:21:42 PDT 2023


The answer was to create a big regular expression pattern out of all the
HAnim DEFs with the alternating symbol, |.  It’s way faster than any thing
else I’ve tried.  Biggest regular expression I’ve ever written or
generated.  This has other uses like keeping track of which body parts are
valid, etc.  Perhaps something like this is already in X3DUOM or XML
schema?  I may check.

I’m still working on using weights from Blender and animations.

On Thu, Sep 14, 2023 at 8:10 PM John Carlson <yottzumm at gmail.com> wrote:

> I'm stumped for a while.  I need to talk to a teddy bear.
>
> I'd like to prefix all the DEFs for my HAnimJoints, HAnimSites, and
> HAnimSegments and all references to them with a prefix, say "Senior_"
>
> Right now, I loop through the file, pulling in all HAnim DEF values into a
> HashMap, mapped from old DEF value to new DEF value.  Then I examine each
> line, trying to substitute the  "word" or occurrence of an old DEF value to
> the new DEF value.  I have a little loop that goes through the whole hash
> map for each line.  It is extremely slow.
>
> I have thought of storing patterns in the hash map, but I've not done
> that  before.
>
> Perhaps I should code this up in Rust or C?  Does someone know a good
> native hash map implementation for  Rust/C/C++ or something as fast?
>
> Thanks!
>
> John
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20230914/c9005906/attachment.html>


More information about the x3d-public mailing list