[x3d-public] Blender 4.0 io_scene_x3dv exporter patch

John Carlson yottzumm at gmail.com
Fri Dec 1 12:49:45 PST 2023


I made a change to the io_scene_x3dv exporter for Blender 4.0, and things
seem to be working.  I would like human confirmation that this is the right
thing to do.   There are 4 mentions of distance in the Blender PointLight
API documentation.

I don't know enough about PointLight.radius in X3D to know if it's the same
as PointLight.cutoff_distance in Blender.

If no one else volunteers, I can make a similar change to io_scene_x3d, I
just need confirmation that I'm choosing the right thing to do, below.

This has been updated for Blender 4.0, but I haven't tested much of the GUI:

https://github.com/coderextreme/BlenderX3DSupport/tree/main/io_scene_x3dv

You'll have to make a zip of the folder, then install in Blender GUI.

The focus of the io_scene_x3dv plugin has been 1) porting to x3d.py 2)
incorporating glTF-like file structure 3) HAnim+animation

Bug reports welcome

Thanks!

John

diff --git a/io_scene_x3dv/blender/exp/x3dv_blender_export.py
b/io_scene_x3dv/blender/exp/x3dv_blender_export.py
index 384c8ae0..ce32d41b 100644
--- a/io_scene_x3dv/blender/exp/x3dv_blender_export.py
+++ b/io_scene_x3dv/blender/exp/x3dv_blender_export.py
@@ -650,7 +650,7 @@ def export(context, x3dv_export_settings):
         location = matrix.to_translation()[:]

         lite = PointLight(DEF=light_id)
-        lite.radius = light.distance
+        lite.radius = light.cutoff_distance
         lite.ambientIntensity = amb_intensity
         lite.intensity = intensity
         lite.color = clamp_color(light.color)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://web3d.org/pipermail/x3d-public_web3d.org/attachments/20231201/00cf2f26/attachment-0001.html>


More information about the x3d-public mailing list