X3D export fails on exporting a scene with a light #105235
Labels
No Label
Interest
Animation & Rigging
Interest
Blender Cloud
Interest
Collada
Interest
Core
Interest
Documentation
Interest
Eevee & Viewport
Interest
Geometry Nodes
Interest
Grease Pencil
Interest
Import and Export
Interest
Modeling
Interest
Modifiers
Interest
Nodes & Physics
Interest
Pipeline, Assets & IO
Interest
Platforms, Builds, Tests & Devices
Interest
Python API
Interest
Rendering & Cycles
Interest
Sculpt, Paint & Texture
Interest
Translations
Interest
User Interface
Interest
UV Editing
Interest
VFX & Video
Meta
Good First Issue
Meta
Papercut
Module
Add-ons (BF-Blender)
Module
Add-ons (Community)
Platform
Linux
Platform
macOS
Platform
Windows
Priority
High
Priority
Low
Priority
Normal
Priority
Unbreak Now!
Status
Archived
Status
Confirmed
Status
Duplicate
Status
Needs Info from Developers
Status
Needs Information from User
Status
Needs Triage
Status
Resolved
Type
Bug
Type
Design
Type
Known Issue
Type
Patch
Type
Report
Type
To Do
No Milestone
No project
No Assignees
4 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: blender/blender-addons#105235
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
System Information
Operating system: macOS-14.3.1-arm64-arm-64bit 64 Bits
Graphics card: Metal API Apple M1 Pro 1.2
Blender Version
Broken: version: 4.0.2, branch: blender-v4.0-release, commit date: 2023-12-05 07:41, hash:
9be62e85b727
Worked: 3.6
Addon Information
Name: Web3D X3D/VRML2 format (2, 3, 1)
Author: Campbell Barton, Bart, Bastien Montagne, Seva Alekseyev
Short description of error
Exporting to X3D a scene with a light fails, there is an exception thrown in Python script, empty X3D file created on filesystem, Blender application does not quit or crash as a result of failure
Exact steps for others to reproduce the error
From the initial startup screen choose the File > Export > X3D Extensible 3D add-on , file name, orientation immaterial
********. Additional *************
Python exception trace:
Info: starting X3D export to '/Users/vmarchetti/Desktop/untitled.x3d'...
Traceback (most recent call last):
File "/Applications/Blender.app/Contents/Resources/4.0/scripts/addons/io_scene_x3d/init.py", line 224, in execute
return export_x3d.save(context, **keywords)
File "/Applications/Blender.app/Contents/Resources/4.0/scripts/addons/io_scene_x3d/export_x3d.py", line 1575, in save
export(file,
File "/Applications/Blender.app/Contents/Resources/4.0/scripts/addons/io_scene_x3d/export_x3d.py", line 1508, in export
export_main()
File "/Applications/Blender.app/Contents/Resources/4.0/scripts/addons/io_scene_x3d/export_x3d.py", line 1504, in export_main
export_object(ident, None, obj_main, obj_main_children)
File "/Applications/Blender.app/Contents/Resources/4.0/scripts/addons/io_scene_x3d/export_x3d.py", line 1446, in export_object
writePointLight(ident, obj, obj_matrix, data, world)
File "/Applications/Blender.app/Contents/Resources/4.0/scripts/addons/io_scene_x3d/export_x3d.py", line 482, in writePointLight
fw(ident_step + 'radius="%.4f" \n' % light.distance)
AttributeError: 'PointLight' object has no attribute 'distance'
Info: starting X3D export to '/Users/vmarchetti/Desktop/untitled2.x3d'...
Info: finished X3D export to '/Users/vmarchetti/Desktop/untitled2.x3d'
Saved session recovery to "/var/folders/b5/rdxvnr2j6tj69lzzl2q38nl40000gn/T/quit.blend"
Source sleuthing in git repository shows that the parameter 'distance' was removed in the source file blender/source/blender/makesrna/intern/rna_light.cc at c4ddf16 (July 5 2023) :
c4ddf16950
@vmarchetti Can confirm this, the definition for radius should be
shadow_soft_size
instead ofdistance
Fixed with
7717c30fc3
Thanks @NRGSille , closing.
The term 'radius' is used in a different way for X3D lights (PointLight and Spotlight) than it is for Blender lights. In X3D, the lights illuminates objects that are closer to the light than the value of 'radius'. Pertinent X3D specification is https://www.web3d.org/documents/specifications/19775-1/V4.0/Part01/components/lighting.html#PointLight
The parameter cutoff_distance from the bpy light structure seems to be a closer match to the meaning of 'radius' for X3D lights.https://docs.blender.org/api/current/bpy.types.Light.html#bpy.types.Light.cutoff_distance
I'd also propose that the change of the export to X3D to use either shadow_soft_size or cutoff_distance, be matched by the corresponding change in the Import of an X3D Spotlight or PointLight
@vmarchetti thanks for the detailed explanation,
cutoff_distance
seems to be closer to the .x3d definition, will change it to that parameter.Should be fixed now with
487b433e6e
and2a9e718930
Hello, I have the exact same error message using Import > "X3D Extensible 3D (.x3d)" out of the box Blender feature on 4.0.2 (win64).
Is this solved problem with export also have impact on import or is it unrelated?
The file I am trying to open is the attached one.
@Full-Name-38 The error regarding the pointlight import is fixed in 4.2 but your file caused another error regarding texture coordinates
Ok, great, thanks. I was unsure this issue was also concerning import.
I am indeed aware of the texture problem and it doesn't seem to be a Blender issue as Chisel (https://www2.hrp.no/vr/tools/chisel/install.htm) returns the same error when it tries to validate the VRML file. It seems I need to contact Compusoft to understand why their Winner design software produces invalid VRML files (and why it doesn't produce anything newer than VRML) ;)
@NRGSille hi, AFAICS you've pushed fix to main. I think this should also go to 4.1 release branch.
You can
cherry-pick
these commits to 4.1 branch: https://developer.blender.org/docs/handbook/release_process/release_branch_merge_playbook/#fix-committed-to-main-should-have-been-in-release-branch@ThomasDinges ^
@PratikPB2123 done