[x3d-public] Request for X3D encoding comment output from X3DPSAIL
John Carlson
yottzumm at gmail.com
Sun Jan 4 05:56:59 PST 2026
Blowing off some steam. Apologies, I probably should work out instead.
I am unsure if it’s easier to output straight line code instead of
hierarchical code in Python; multi-line non-persistent comments might
become easier in straight line code. I don’t know about comments() in
XSLT. In straight line code, wrapping a multi or single line comment in
“””…””” is a cinch. Even if newlines need to be added for the Python
interpreter.
AFAIK, I’ve already mentioned that straight line code is easier to debug,
in my mind. I think the Java large file discussion is still open; I know
hierarchical code is more succinct, and less likely to stack overflow. I
think the choices between code structure in Python and Java might be
different.
Persistent multi-line comments are desirable, even if they aren’t present
in the archive. We will probably make different choices between
hierarchical and straight line code when this feature is available.
Short term hacks like single line comments work until features are
introduced. That doesn’t mean tickets should be closed prematurely, or
examples outside the archives are invalid.
John
On Tue, Dec 30, 2025 at 3:42 AM John Carlson <yottzumm at gmail.com> wrote:
> Don, thanks for your comment on this ticket that naively adding Comment to
> a children field might not work. That was one of my intentions on
> expressing myself so vocally. I apologize for using your time to do this,
> but I think it revealed a possible design consideration. I think if I had
> discovered it, it would have gone over like a wet balloon.
>
> Thank you again, I will not put comments arbitrarily in the scenegraph for
> now with my PythonSerializer.js, until you indicate it’s ready! I will
> leave them out of the scenegraph, as they are now. Since I handle
> comments generically, I will have to research the nodes you’ve accomplished.
>
> Now, can we have other multi-line comments, not in the persistent
> scenegraph, in Python translated from .x3d, in the short term, like:
>
> #
> # This is comment line 2
> # This is comment line 3
> #
>
> ?
>
> John
>
> From the ticket:
>
> “
>
> This is not an easy fix for converting files because Comment is not part
> of the content model for all nodes. Solving this will probably require
> extending class _ X3DNode in x3d.py and sorting out possible subclass
> collisions. It will also be difficult to retain the original order of child
> nodes and child comments within a parent node.
>
> This might be fixable someday - after some effort I got it working for
> head, Scene, field, fieldValue.. Deferred as future work.
> ”
>
> On Mon, Dec 29, 2025 at 12:52 PM Don Brutzman <don.brutzman at gmail.com>
> wrote:
>
>>
>> I have posted a new ticket to capture this point. Perhaps a useful
>> exemplar, as well.
>>
>> - X3D SourceForge ticket #82 creating persistent comments in python
>> when converting from XML
>> - https://sourceforge.net/p/x3d/tickets/82/
>>
>> Hope this helps. Again thanks for your many efforts. Have fun improving
>> X3D! 🤔 👍
>>
>>>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20260104/3395d87c/attachment.html>
More information about the x3d-public
mailing list