<div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr"><div dir="ltr">Followup, not solved yet.<div><br></div><div>For the base Blender .wrl importer, I made the following changes:</div><div><br></div><div><div>diff --git a/io_scene_x3d/import_x3d.py b/io_scene_x3d/import_x3d.py</div><div>index 4c215516..0d8337a1 100644</div><div>--- a/io_scene_x3d/import_x3d.py</div><div>+++ b/io_scene_x3d/import_x3d.py</div><div>@@ -3347,9 +3347,9 @@ def translateOrientationInterpolator(node, action, ancestry):</div><div><br></div><div> mtx = translateRotation((x, y, z, w))</div><div> eul = mtx.to_euler()</div><div>- rot_x.keyframe_points.insert(time, eul.x)</div><div>- rot_y.keyframe_points.insert(time, eul.y)</div><div>- rot_z.keyframe_points.insert(time, eul.z)</div><div>+ rot_x.keyframe_points.insert(time * 250, eul.x) # end to 250 frames so we can see the motion</div><div>+ rot_y.keyframe_points.insert(time * 250, eul.y)</div><div>+ rot_z.keyframe_points.insert(time * 250, eul.z)</div><div><br></div><div> for fcu in (rot_x, rot_y, rot_z):</div><div> for kf in fcu.keyframe_points:</div><div>@@ -3611,7 +3611,7 @@ def load_with_profiler(</div><div> import cProfile</div><div> import pstats</div><div> pro = cProfile.Profile()</div><div>- pro.runctx("load_web3d(context, filepath, PREF_FLAT=True, "</div><div>+ pro.runctx("load_web3d(context, filepath, PREF_FLAT=False, "</div><div> "PREF_CIRCLE_DIV=16, global_matrix=global_matrix)",</div><div> globals(), locals())</div><div> st = pstats.Stats(pro)</div><div>@@ -3628,7 +3628,7 @@ def load(context,</div><div><br></div><div> # loadWithProfiler(operator, context, filepath, global_matrix)</div><div> load_web3d(context, filepath,</div><div>- PREF_FLAT=True,</div><div>+ PREF_FLAT=False,</div><div> PREF_CIRCLE_DIV=16,</div><div> global_matrix=global_matrix,</div><div> )</div></div><div>===============================================================================</div><div>The latter allows Object EMPTYs to be created (Transforms) so there can be local rotations (looks like a Blender requirement). This also offsets the box on the right too much, and there's an extra bend due to the EMPTY. But looking at the object hierarchy (not the transforms) looks okay. But look closely at the location. Those have not changed, so everything is locally transformed.</div><div><br></div><div>What I am seeing is 2 ninety degree rotations. Two systems treat them differently. One rotates the objects by 90 degrees, and children, but in Blender, Transforms are given an actual location. So one can subtract the offset between the Transform and the box, but then first and third cubes land on top of each other.</div><div><br></div><div>It's still an interesting puzzle to look at. This is by no means solved. I think it's similar to the rotation/revolution problem around the sun:</div><div><br></div><div><a href="https://www.youtube.com/watch?v=FUHkTs-Ipfg">https://www.youtube.com/watch?v=FUHkTs-Ipfg</a> (Veritasium)<br></div><div><br></div><div>Ideally, there would be no offset between the "TransformTargetChild" and the Shape in Blender. Somehow, the shape is inheriting the offset of its parent, and offseting 4 m from the transform. Hmm</div><div><br></div><div><div> <Transform DEF="TransformTargetChild" translation="4 0 0"></div><div> <Shape></div><div> <Box/></div><div> </Shape></div><div> </Transform></div></div><div><br></div><div>I am also attaching my current test files, the major change was to change set_rotation to rotation in two places to match the importer (oops, extend the importer).</div><div><br></div><div>If someone wants to play with my "improved" Blender addon, let me know, otherwise, I'd like to see this fixed in the original Blender plugin. I don't have a solution yet.</div><div><br></div><div>John</div><div><br></div><div><br></div></div></div></div></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 4, 2024 at 9:45 PM John Carlson <<a href="mailto:yottzumm@gmail.com">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="auto">One thing you will notice right away, perhaps, is that the ROUTEs aren’t imported. Perhaps converting to VRML97 will work, I’ve not tried that, I just went full steam ahead at importing XML.</div><div dir="auto"><br></div><div dir="auto">John</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Jun 4, 2024 at 8:37 PM John Carlson <<a href="mailto:yottzumm@gmail.com" target="_blank">yottzumm@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Challenge:<div><br></div><div>Can you get this X3D animation and box translations imported into Blender properly?</div><div><br></div><div>If you can, I'll give you a big fat kiss (kidding!).</div><div><br></div><div>Looks simple, right?</div><div><br></div><div>Please provide any diffs to your favorite X3D Blender importer.</div><div><br></div><div dir="auto">Attached example (run in your favorite X3D browser to see desired results).</div><div><br></div><div>Thanks! This will likely help out my efforts a lot!</div></div><div dir="ltr"><div><br></div><div>John</div></div>
</blockquote></div></div>
</blockquote></div>