[x3d-public] x3dom bug related to IS/children PROTOs?
Andreas Plesch
andreasplesch at gmail.com
Sun Nov 22 18:48:07 PST 2020
https://www.web3d.org/documents/specifications/19776-1/V3.3/Part01/concepts.html#DEFAndUSEAttributeSyntax
does state that nodes cannot have other attributes next to USE except for
class and containerField. Perhaps there should be an extra sentence on
ProtoInstance since it is not a node allowing but not requiring the name
attribute.
On Sun, Nov 22, 2020 at 9:38 PM Andreas Plesch <andreasplesch at gmail.com>
wrote:
> Yes, I agree, in most cases USE would be the only attribute. Note that USE
> is not a field, it is an attribute in the XML encoding.
>
> I am not sure how strict the XML encoding is in requiring that there are
> no other attributes next to USE. They may be allowed but without any effect.
>
> I also agree that USE in ProtoInstance is slightly different from USE in
> regular nodes since ProtoInstance is just a verbose XML construct to
> instruct instancing of a declared node.
>
> But I am not sure if that distinction requires additional clarification in
> the spec.
>
> Andreas
>
> On Sun, Nov 22, 2020 at 9:11 PM John Carlson <yottzumm at gmail.com> wrote:
>
>> I'll just pretend we zoomed back from 2020->2015 virtually (in the mind).
>>
>> Can we agree, that in most cases (nodes), USE is the only field allowed
>> when USE appears?
>>
>> If not, I've got to change all my JSON schema generating code.
>>
>> Maybe we'll decide on another JSON schema based on the XML schema, since
>> XML Spy can now generate a JSON schema from an XML schema last I heard.
>>
>> Let's just break all my coding for the last 5 years! Whee!
>>
>> I would need to know all the nodes/statements where additional fields are
>> allowed when USE appears. I think there's only two cases.
>>
>> Or is this a thing in X3D4?
>>
>> It seems like USE has two different semantics, whether you're using it on
>> a node or not?
>>
>> John
>>
>> On Sun, Nov 22, 2020 at 7:51 PM Andreas Plesch <andreasplesch at gmail.com>
>> wrote:
>>
>>> I think the spec. does not have an opinion on this, see x3d-public and
>>> other players. Cheers, -Andreas
>>>
>>> On Sun, Nov 22, 2020 at 8:47 PM John Carlson <yottzumm at gmail.com> wrote:
>>>
>>>> Note that X3DOM should now probably flag ProtoInstances with both name
>>>> and USE with a warning that the code is now non-compliant or deprecated. I
>>>> believe the spec says that USE and name together are only allowed in
>>>> certain nodes (I think Metadata and perhaps one other comes to mind).
>>>>
>>>> That's the best I have right now. See previous discussion on mailing
>>>> list regarding extra fields including name along with USE.
>>>>
>>>> Also, if you use JSON schema, it should catch JSON examples as
>>>> non-compliant if they contain both name and USE. This works in JSON,
>>>> because containerFields are not used in JSON.
>>>>
>>>> And yes, this may have all changed under my nose!
>>>>
>>>> John
>>>>
>>>>
>>>> On Sun, Nov 22, 2020 at 7:19 PM Andreas Plesch <andreasplesch at gmail.com>
>>>> wrote:
>>>>
>>>>> Yes, the Diamond files have the diamond shape in the ProtoDeclaration.
>>>>>
>>>>> I added guards for nonimplemented but expected, standard fields (such
>>>>> as addChildren) to ProtoDeclaration.js, and allowed USE ProtoInstances by
>>>>> looking for DEFs in the dom (before parsing, at the initial step of
>>>>> translation to the concise x3dom syntax).
>>>>>
>>>>> These changes should help with making these older HAnim protos work
>>>>> better.
>>>>>
>>>>> -Andreas
>>>>>
>>>>> On Sun, Nov 22, 2020 at 4:43 PM John Carlson <yottzumm at gmail.com>
>>>>> wrote:
>>>>>
>>>>>>
>>>>>> I see one Shape (in a proto?), but I didn’t look for geometry. I
>>>>>> believe there is satisfactory appearance. I believe I only checked one
>>>>>> LOA4 file. I am not sure about converted files.
>>>>>>
>>>>>> I will look into this in more detail later today. I believe at least
>>>>>> the Diamond files should have shapes.
>>>>>>
>>>>>> John
>>>>>>
>>>>>> On Sun, Nov 22, 2020 at 9:35 AM Andreas Plesch <
>>>>>> andreasplesch at gmail.com> wrote:
>>>>>>
>>>>>>> Yes this is Proto related, due to the "addChildren" and
>>>>>>> "removeChildren" fields not being available in x3dom for grouping nodes.
>>>>>>> And those are not available because x3dom cannot route node type fields.
>>>>>>>
>>>>>>> Although the Protos define the addChildren field it is actually
>>>>>>> never used in the examples, so they are not actually necessary. You could
>>>>>>> just remove them.
>>>>>>>
>>>>>>> The examples use an old Proto implementation of HAnim. The native
>>>>>>> implementation is also available, without Protos.
>>>>>>>
>>>>>>> Perhaps it would make sense to add noop stubs for add/removeChildren
>>>>>>> fields in X3DGroupingNode.js, or add a guard for the Proto field type.
>>>>>>>
>>>>>>> I notice that hanimloa4.html does not have any geometry to render,
>>>>>>> only the joint structure.
>>>>>>>
>>>>>>
>>>>>
>>>>> --
>>>>> Andreas Plesch
>>>>> Waltham, MA 02453
>>>>>
>>>>
>>>
>>> --
>>> Andreas Plesch
>>> Waltham, MA 02453
>>>
>>
>
> --
> Andreas Plesch
> Waltham, MA 02453
>
--
Andreas Plesch
Waltham, MA 02453
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20201122/b8ab3a9f/attachment-0001.html>
More information about the x3d-public
mailing list