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

Importing spot light fails if outerConeAngle is not present #2349

Closed
PassiveModding opened this issue Sep 11, 2024 · 1 comment · Fixed by #2350
Closed

Importing spot light fails if outerConeAngle is not present #2349

PassiveModding opened this issue Sep 11, 2024 · 1 comment · Fixed by #2350
Labels
bug Something isn't working importer This involves or affects the import process

Comments

@PassiveModding
Copy link

Describe the bug
When importing a spot light that does not contain an outerConeAngle, import fails on the create_spot method.

Assumed issue is

spot.spot_blend = BlenderLight.calc_spot_cone_inner(gltf, pylight['spot']['outerConeAngle'], pylight['spot']['innerConeAngle'])

When calling calc_spot_cone_inner, the value for outerConeAngle may not exist

To Reproduce

  1. Create sample .gltf file with a spot light.
  2. Import file as gltf

Expected behavior
Import should succeed as normal, using the default value of PI/4.0 for outerConeAngle as defined in the KHR_lights_punctual

Sample

{
  "extensions": {
    "KHR_lights_punctual": {
      "lights": [
        {
          "spot": {
            "innerConeAngle": 0.10000000149011612
          },
          "type": "spot"
        }
      ]
    }
  },
  "asset": {
    "copyright": "",
    "generator": "SharpGLTF 1.0.0\u002Bf5cd805711f76596a77a71de9cba4717e0edd159",
    "version": "2.0"
  },
  "extensionsUsed": [
    "KHR_lights_punctual"
  ],
  "nodes": [
    {
      "extensions": {
        "KHR_lights_punctual": {
          "light": 0
        }
      }
    }
  ],
  "scene": 0,
  "scenes": [
    {
      "nodes": [
        0
      ]
    }
  ]
}

Version

  • OS: Windows
  • Blender Version: 4.2.1
@julienduroure
Copy link
Collaborator

Confirmed

@julienduroure julienduroure added bug Something isn't working importer This involves or affects the import process labels Sep 11, 2024
julienduroure added a commit that referenced this issue Sep 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working importer This involves or affects the import process
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants