[x3d-public] Can you get this X3D animation imported into Blender?

Joe D Williams joedwil at earthlink.net
Mon Jun 10 12:19:57 PDT 2024


that blend file lis just blend form binary that gets processed by some script to reload into blender. 
This is not interned as a transport file, just some data to reload into blender or any other that can decode the thing.
Look at this file with a simple text editor (change file to .txt). We see that this is mostly some binary stuff, maybe slightly encrypted in some way, with some scattering of keywords. 

It is  mostly useless until you can first know the target coordinate system, then the hierarchy of transforms, then any geometry, and finally some animation. 
If you have any x3d browser with SAI, you can ask for the scene in x3d user code ASCII or Binary at any point, and get the current coordinates at any point in the animation. This .blend this is like that only set up for quick native code loading, but you may need extra keys  to be able toactually modify this file, which is what any deeply dedicated blender creator will want to do.  

So, these categories of data are intended to be encoded for easy transport using gltf and other json and blob forms. Forget this thing unless there is a clear way to just go ahead and create gltf assets from this for import into x3d. However, if blender force must be working on this because somebody there must want to honor some industry standards. Same for Unity or any other.
Good Luck to all who wish for easy transport.

Attached here and below is latest for this example.
Red is like HAnim where that geometry is set relative to the center in the Segment or Site nodes.  Green is like you first showed with no geometry transform to position the marker except the offset center.
See short vid for how these play. 

https://youtu.be/BzcV4LWf1Wk

Thanks,   
Joe

<X3D profile="Immersive" version="4.0" xsd:noNamespaceSchemaLocation="" xmlns:xsd="http://www.w3.org/2001/XMLSchema-instance (https://www.web3d.org/specifications/x3d-4.0.xsd)">
      <head>
    <meta name='title' content='localcenters.x3d'></meta>
    <meta name='creator' content='John Carlson'></meta>
    <meta name='modifier' content='Joe D Wiliams'></meta>
     </head>

     <Scene>
        <WorldInfo title='localcenters01b.x3d'/>
        <NavigationInfo type='"ANY" "EXAMINE" "FLY" "LOOKAT"'/>
        <Viewpoint description='Main View' position="2 4 20"/>

  <Transform DEF="CenterRoot1" center="0 0 0">
    <Shape DEF='GreenBox1'>
      <Box size='0.5 0.5 0.5'/>
      <Appearance> 
        <Material diffuseColor='0 1 0' emissiveColor='0 1 0' transparency='0'/>
      </Appearance>
    </Shape>
    <Transform DEF="CenterParent1" center="4 0 0">
      <Shape USE='GreenBox1'/>
      <Transform DEF="CenterChild1" center="8 0 0">
        <Shape USE='GreenBox1'/>
      </Transform>
    </Transform>
  </Transform>

  <Transform DEF="CenterRoot2" center="0 2 0" translation='0 2 0'>
    <Transform DEF="TranslateToCenterRoot2" translation="0 2 0">
      <Shape DEF='RedBox2'>
        <Box size='0.5 0.5 0.5'/>
        <Appearance>
          <Material diffuseColor='1 0 0' emissiveColor='1 0 1' transparency='0'/>
        </Appearance>
      </Shape>
    </Transform>
    <Transform DEF="CenterParent2" center="4 0 0">
      <Transform DEF="TranslateToParent2" translation="4 0 0">
        <Shape USE='RedBox2'/>
      </Transform>
      <Transform DEF="CenterChild2" center="8 0 0">
        <Transform DEF="TranslateToChild2" translation="8 0 0">
          <Shape USE='RedBox2'/>
        </Transform>
      </Transform>
    </Transform>
  </Transform>

    <ProximitySensor DEF="ActivateSensor" size="100 100 100" />
    <TimeSensor DEF="Clock" cycleInterval='2' loop='true'/>
  
    <ROUTE fromNode="ActivateSensor" fromField="enterTime" toNode="Clock" toField="set_startTime" />

    <OrientationInterpolator DEF="Rotater" 
  key="0 0.25 0.5 0.75 1" 
  keyValue="0 0 1 0, 0 0 1 0.785, 0 0 1 1.57, 0 0 1 2.35, 0 0 1 3.14"/>
  
    <ROUTE fromNode="Clock" fromField="fraction_changed" toNode="Rotater" toField="set_fraction"/>

    <ROUTE fromNode="Rotater" fromField="value_changed" toNode="CenterRoot1" toField="rotation"/>
    <ROUTE fromNode="Rotater" fromField="value_changed" toNode="CenterParent1" toField="rotation"/>
    <ROUTE fromNode="Rotater" fromField="value_changed" toNode="CenterChild1" toField="rotation"/>

    <ROUTE fromNode="Rotater" fromField="value_changed" toNode="CenterRoot2" toField="rotation"/>
    <ROUTE fromNode="Rotater" fromField="value_changed" toNode="CenterParent2" toField="rotation"/>
    <ROUTE fromNode="Rotater" fromField="value_changed" toNode="CenterChild2" toField="rotation"/>

      </Scene>
</X3D>

-----Original Message-----
From: John Carlson <yottzumm at gmail.com>
Sent: Jun 10, 2024 1:07 AM
To: Joe D Williams <joedwil at earthlink.net>
Cc: Katy Schildmeyer KS APPAREL DESIGN <katy at ksappareldesign.com>, X3D Graphics public mailing list <x3d-public at web3d.org>
Subject: Re: Can you get this X3D animation imported into Blender?

Joe, 
Here's the .blend file for localcentersjoe.x3d  I remain overwhelmed, not seeing a way forward.
 
I am stuck on:
 
1. Applying the most recent transform
2. Applying a full set of transforms.
 
So far, using 1 works well for Transforms with centers.
 
If we can lay out some use cases, that would be good.
 
I've asked Vince to help.
 
Hopefully, this will get through size filters in case someone else wants to observe the differences between our files.
 
John


On Thu, Jun 6, 2024 at 5:35 AM Joe D Williams <joedwil at earthlink.net (mailto:joedwil at earthlink.net)> wrote:
Hi John, 

You sent this: 

  <Transform DEF="TransformRoot1" center="0 0 0">
    <Shape>
      <Box size='0.5 0.5 0.5'/>
    </Shape>
    <Transform DEF="TransformTargetParent1" center="4 0 0">
      <Shape>
        <Box size='0.5 0.5 0.5'/>
      </Shape>
      <Transform DEF="TransformTargetChild1" center="8 0 0">
        <Shape>
          <Box size='0.5 0.5 0.5'/>
        </Shape>
      </Transform>
    </Transform>
  </Transform>

Not shown here is the interpolator that sends rotations to both Parent and Child Transforms
For this animation code you sent this did exactly what it should have done.
The boxes start at 0 0 0 then are swept along the axis according to the Parent and Child Transform nodes animation input.  
Note that the initial position of all three boxes is 0 0 0, then they move along the radius from where you set the parent centers.

Please have a look at this: 

First, slight change from what you sent. 
Again, a important understanding is that "center" value of the Transform represents the center of rotation of that Transform, and may have nothing much to do with the value for translation, which is 0 0 0 for the parent Transform for each Shape. 

  <Transform DEF="CenterRoot1" center="0 0 0">
    <Shape>
      <Box size='0.5 0.5 0.5'/>
    </Shape>
    <Transform DEF="CenterParent1" center="4 0 0">
      <Shape>
        <Box size='0.5 0.5 0.5'/>
      </Shape>
      <Transform DEF="CenterChild1" center="8 0 0">
        <Shape>
          <Box size='0.5 0.5 0.5'/>
        </Shape>
      </Transform>
    </Transform>
  </Transform>

So again, all Shapes start at 0 0 0 then are swept through the arc defined by each parent Transform center.  

This version operates like the hanim model.
The parent Transform is a "Joint" with center defined, then the Shape has its own Transform to place it at the parent center value.
(The first center="0 2 0" translation='0 2 0' just moves the is example up above the first example.) 

  <Transform DEF="TransformRoot2" center="0 2 0" translation='0 2 0'>
    <Transform DEF="MoveToCenterRoot" translation="0 2 0">
      <Shape>
        <Box size='0.5 0.5 0.5'/>
      </Shape>
    </Transform>
    <Transform DEF="CenterTargetParent2" center="4 0 0">
      <Transform DEF="TranslateTargetParent2" translation="4 0 0">
        <Shape>
          <Box size='0.5 0.5 0.5'/>
        </Shape>
      </Transform>
      <Transform DEF="CenterTargetChild2" center="8 0 0">
        <Transform DEF="TranslateTargetChild2" translation="8 0 0">
          <Shape>
            <Box size='0.5 0.5 0.5'/>
          </Shape>
        </Transform>
      </Transform>
    </Transform>
  </Transform>

In Humanoid space, once the connection between using center to set the Joint center of rotation and then a child Transform to position any associated stuff in Humanoid space just makes it work wonderful for what we need in hanim.

I can recall a day when there were sincere discussions over whether to include the 'center' field in Transform.  

Thanks,
Joe













-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20240610/e7950e68/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: localcentersjoe01b.zip
Type: application/x-zip-compressed
Size: 1143 bytes
Desc: not available
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20240610/e7950e68/attachment-0001.bin>


More information about the x3d-public mailing list