VRML Import Error #105398

Closed
opened 2024-07-17 19:03:18 +02:00 by G-10 · 8 comments

System Information
Operating system: Windows-10-10.0.19045-SP0 64 Bits
Graphics card: NVIDIA GeForce GTX 1650/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 546.09

Blender Version
Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: 9be62e85b727
Worked: (newest version of Blender that worked as expected)

Addon Information
Name: Web3D X3D/VRML2 format (2, 3, 1)
Author: Campbell Barton, Bart, Bastien Montagne, Seva Alekseyev

Short description of error
[Python:Traceback (most recent call last) error occurs when trying to import any .wrl file. This error persists on multiple versions of Blender as well (4.1.1,4.2)]

Exact steps for others to reproduce the error
[FIRST TIME: File> Import > X3D Extensible 3D> Click Operator Presets/Restore Operator Defaults >Select File >Import
SUBSEQUENT TIMES: File> Import > X3D Extensible 3D> Select File > Import ]

**System Information** Operating system: Windows-10-10.0.19045-SP0 64 Bits Graphics card: NVIDIA GeForce GTX 1650/PCIe/SSE2 NVIDIA Corporation 4.6.0 NVIDIA 546.09 **Blender Version** Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash: `9be62e85b727` Worked: (newest version of Blender that worked as expected) **Addon Information** Name: Web3D X3D/VRML2 format (2, 3, 1) Author: Campbell Barton, Bart, Bastien Montagne, Seva Alekseyev **Short description of error** [Python:Traceback (most recent call last) error occurs when trying to import any .wrl file. This error persists on multiple versions of Blender as well (4.1.1,4.2)] **Exact steps for others to reproduce the error** [FIRST TIME: File> Import > X3D Extensible 3D> Click Operator Presets/Restore Operator Defaults >Select File >Import SUBSEQUENT TIMES: File> Import > X3D Extensible 3D> Select File > Import ]
G-10 added the
Status
Needs Triage
Priority
Normal
Type
Report
labels 2024-07-17 19:03:19 +02:00

Could you post the exact error message as well?
I tested the import with the attached file and it works on my end. How about you? If that works then probably your .wrl is corrupted, could you attach it as well?

Btw the X3D Addon got moved to the extension platform for blender 4.2+, you may create a full issue ticket there as well: https://projects.blender.org/extensions/io_scene_x3d/issues

Could you post the exact error message as well? I tested the import with the attached file and it works on my end. How about you? If that works then probably your .wrl is corrupted, could you attach it as well? Btw the X3D Addon got moved to the extension platform for blender 4.2+, you may create a full issue ticket there as well: https://projects.blender.org/extensions/io_scene_x3d/issues
Author

The exact error message is attatched. It's every .wrl file I have, and files that used to work now give that error. No saving conditions got changed on the .wrl files as well.

The exact error message is attatched. It's every .wrl file I have, and files that used to work now give that error. No saving conditions got changed on the .wrl files as well.

Seems essentially the same as #101604.

Could you do following:

  • check if files open correctly in other programs, e.g. 3D Builder
  • check if my file works (attached in the comment above)
  • attach a file that doesn't work to this report
Seems essentially the same as https://projects.blender.org/blender/blender-addons/issues/101604. Could you do following: - check if files open correctly in other programs, e.g. 3D Builder - check if my file works (attached in the comment above) - attach a file that doesn't work to this report
Author
  1. The files open correctly in other programs
  2. The cylinder file does work!
  3. A cube like shape is included here
1) The files open correctly in other programs 2) The cylinder file does work! 3) A cube like shape is included here

A cube like shape is included here

Sorry, what you attached is not a .wrl file. Could you upload a valid file?

How did you create it? Assuming from the current file ending it'*s from soildwork?

> A cube like shape is included here Sorry, what you attached is not a .wrl file. Could you upload a valid file? How did you create it? Assuming from the current file ending it'*s from soildwork?
Author

It was a part created in Solidworks. Here is that correct file.

It was a part created in Solidworks. Here is that correct file.
1.2 KiB

@G-10 The VRML file you provided does not respect the standard, see here http://graphcomp.com/info/specs/sgi/vrml/spec/part1/nodesRef.html#IndexedFaceSet :

If the color field is not NULL then it must contain a Color node, whose colors are applied to the vertices or faces of the IndexedFaceSet as follows:

If colorPerVertex is FALSE, colors are applied to each face, as follows:

  • [...]
  • If the colorIndex field is empty, then the colors are applied to each face of the IndexedFaceSet in order. There must be at least as many colors in the Color node as there are faces .

The color property is probably not necessary since it's the same color for all faces and it's the same value as the one provided in the Material node.

To fix this kind of broken files, we could either ignore that broken attribute, which would be fine in this case, or build a "per face" list by recycling the provided incomplet list, resulting in possibly weird results. I'd prefer the first solution. I removed the color attribute form the IndexedFaceSet and it loaded correctly.

Just for the record, I just patched the x3d/VRML add-on on my side because it couldn't import my TopSolid V6 VRML files correctly, especially keeping vertices normals. I have one strange behavior left but could provide a patch. Since it solve multiple problems, can I post it in a single patch or should I break it into several small ones ?

@G-10 The VRML file you provided does not respect the standard, see here http://graphcomp.com/info/specs/sgi/vrml/spec/part1/nodesRef.html#IndexedFaceSet : >If the color field is not NULL then it must contain a Color node, whose colors are applied to the vertices or faces of the IndexedFaceSet as follows: > >If colorPerVertex is FALSE, colors are applied to each face, as follows: > > - [...] > - If the colorIndex field is empty, then the colors are applied to each face of the IndexedFaceSet in order. _There must be at least as many colors in the Color node as there are faces_ . The color property is probably not necessary since it's the same color for all faces and it's the same value as the one provided in the Material node. To fix this kind of broken files, we could either ignore that broken attribute, which would be fine in this case, or build a "per face" list by recycling the provided incomplet list, resulting in possibly weird results. I'd prefer the first solution. I removed the color attribute form the IndexedFaceSet and it loaded correctly. Just for the record, I just patched the x3d/VRML add-on on my side because it couldn't import my TopSolid V6 VRML files correctly, especially keeping vertices normals. I have one strange behavior left but could provide a patch. Since it solve multiple problems, can I post it in a single patch or should I break it into several small ones ?

@Hombre57

Since it solve multiple problems, can I post it in a single patch or should I break it into several small ones ?

Fork https://projects.blender.org/extensions/io_scene_x3d and create a PR there, it probably would be best to create multiple PRs for each problem (if those are not directly related).

To fix this kind of broken files, we could either ignore that broken attribute, which would be fine in this case, or build a "per face" list by recycling the provided incomplet list, resulting in possibly weird results. I'd prefer the first solution. I removed the color attribute form the IndexedFaceSet and it loaded correctly.

Tbh yes, ignoring would be cleaner according to the standard definition you posted. However those "broken" files exist and i see no harm in processing those values (like in my PR).

@Hombre57 > Since it solve multiple problems, can I post it in a single patch or should I break it into several small ones ? Fork https://projects.blender.org/extensions/io_scene_x3d and create a PR there, it probably would be best to create multiple PRs for each problem (if those are not directly related). > To fix this kind of broken files, we could either ignore that broken attribute, which would be fine in this case, or build a "per face" list by recycling the provided incomplet list, resulting in possibly weird results. I'd prefer the first solution. I removed the color attribute form the IndexedFaceSet and it loaded correctly. Tbh yes, ignoring would be cleaner according to the standard definition you posted. However those "broken" files exist and i see no harm in processing those values (like in my PR).
Blender Bot added
Status
Resolved
and removed
Status
Needs Triage
labels 2024-07-22 04:31:01 +02:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: blender/blender-addons#105398
No description provided.