[x3d-public] Thoughts for x3d.py str() calls
John Carlson
yottzumm at gmail.com
Mon Oct 16 23:42:24 PDT 2023
Okay, here's another example, Joe, think of each line from a mathematical
proof or recipe or a good mystery, where you combine things from previous
steps. The "VRML" step is putting everything in the oven and baking it.
The "print" is when you take it out of the oven. See incorrect results
further below. What's wrong with the recipe? How can I fix this for skin
IFS coord and skinCoord? When they aren't in the "correct" order in x3d.py
output? Say someone specifies skinCoord with DEF and skin IFS coord with
USE, and another person specifies skin IFS coord with DEF then specifies
skinCoord with USE. How's the poor programmer supposed to figure that out
when they don't have XML or VRML or even python? How is the IFS code
related to the skinCoord code? I have an idea! They can use the DEF/USE to
look up the node. Terrific! But how do I set a USE field without blowing
the DEF away (see below VRML).? This is what we're asking x3d.py to
handle. We're not asking it to create a cache of DEFs mapped to nodes, and
cleaning up after calling VRML/XML/JSON/HTML methods, but that's the only
thing I can think of right now. Other solutions are welcome. I've tried
ordering fields like skeleton/joints, but then skin/skinCoord IFS cropped
up. I got so annoyed that I just patched x3d.py without patching the
stylesheet. I agree this could be fixed by ordering fields in the
stylesheet, but that's a lousy patch, and may foul up other people besides
the Blender exporter. We want a solution that works for everyone. HTML
has similar problems with id fields, this is nothing new.
from x3d import *
trans = Transform(DEF='C')
grpa = Group(DEF='A', children=[trans])
trans.USE = 'C'
grpb = Group(DEF='B', children=[trans])
scene = Scene(children=[grpa, grpb])
x3d = X3D(Scene=scene)
blob = x3d.VRML()
print(blob)
====================================================================
#X3D V4.0 utf8
#X3D-to-ClassicVRML serialization autogenerated by X3DPSAIL x3d.py
PROFILE Full
DEF A Group {
children [
USE C
]
}
DEF B Group {
children [
USE C
]
}
==============================================================================
I have an idea! We won't even set USE! Let's try that!
from x3d import *
trans = Transform(DEF='C')
grpa = Group(DEF='A', children=[trans])
grpb = Group(DEF='B', children=[trans])
scene = Scene(children=[grpa, grpb])
x3d = X3D(Scene=scene)
blob = x3d.VRML()
print(blob)
==============================================================================
Output:
#X3D V4.0 utf8
#X3D-to-ClassicVRML serialization autogenerated by X3DPSAIL x3d.py
PROFILE Full
DEF A Group {
children [
DEF C Transform {
}
]
}
DEF B Group {
children [
DEF C Transform {
}
]
}
Foul words emitted!
===============================================================================
What we would like have happened is:
#X3D V4.0 utf8
#X3D-to-ClassicVRML serialization autogenerated by X3DPSAIL x3d.py
PROFILE Full
DEF A Group {
children [
DEF C Transform {
}
]
}
DEF B Group {
children [
USE C
]
}
Or something close to that (I may be missing "Transform' IDK). I believe
everyone would be happy with this, but AFAIK, it requires patching x3d.py,
which I think Don has admitted. The issue is, we want someone excited
about XSLT, or has the tools to make it less painful.
How do we get someone the right tools to maintain the XSLT? What if we
translated from XSLT to VRML and back to XSLT (just kidding!).
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20231017/e89f0d48/attachment.html>
More information about the x3d-public
mailing list