Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash exporting on Blender 4.0.2 #209

Closed
sercero opened this issue Mar 11, 2024 · 1 comment
Closed

Crash exporting on Blender 4.0.2 #209

sercero opened this issue Mar 11, 2024 · 1 comment

Comments

@sercero
Copy link
Collaborator

sercero commented Mar 11, 2024

System Information

  • Blender Version: 4.0.2

blender2ogre.log

RuntimeError: Error: Python: Traceback (most recent call last):
  File "D:\OGRE\blender-4.0.2-windows-x64\4.0\scripts\addons\io_ogre\ui\export.py", line 219, in execute
    scene.dot_scene(target_path, target_file_name_no_ext)
  File "D:\OGRE\blender-4.0.2-windows-x64\4.0\scripts\addons\io_ogre\ogre\scene.py", line 214, in dot_scene
    dot_scene_node_export(root, path = path, doc = doc,
  File "D:\OGRE\blender-4.0.2-windows-x64\4.0\scripts\addons\io_ogre\ogre\scene.py", line 681, in dot_scene_node_export
    a.setAttribute('linear', '%6f' % (1.0 / ob.data.distance))
AttributeError: 'PointLight' object has no attribute 'distance'
Location: D:\OGRE\blender-4.0.2-windows-x64\4.0\scripts\modules\bpy\ops.py:109

Detailed description

It seems at some point this property was deprecated: ob.data.distance for Lights.

The property I see that is common to all Blender 2.8x+ versions is ob.data.cutoff_distance

From https://docs.blender.org/api/2.83/bpy.types.Light.html:

  • distance: Falloff distance - the light is at half the original intensity at this point
  • cutoff_distance: Distance at which the light influence will be set to 0

@paroj do you think that replacing distance with cutoff_distance would be a proper fix?

I'm not sure about the light calculations but I think that cutoff_distance is actually the proper attribute.

@sercero
Copy link
Collaborator Author

sercero commented Mar 12, 2024

Solved by #211

@sercero sercero closed this as completed Mar 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant