Autodesk / Autodesk/arnold-usd

Convert disk lights to spot light when cone:angle attribute is present

Open
#1,541 1 comment 0 reactions 0 assignees View on GitHub
bug
Dominant language
Python
Stars
284
Forks
68
Avg merge
2d 19h
Merged PRs (30d)
14

Description

**Describe the bug**
Creating a spotlight via the tab menu (Lights >> Spot Light) will use 'Disk' as the default type:
![image](https://github.com/Autodesk/arnold-usd/assets/5022079/a4cad9aa-6677-41cd-a8f5-d10595cabce8)

When exported to .USD (and converted to .ASS with kick), the type is disk_light
```
disk_light
{
name /lights/spotlight1
matrix
0.967461348 0.0116126118 -0.252752304 0
-0.252959639 0.0227694027 -0.967208862 0
-0.00547680212 0.999673307 0.0249660388 0
0.0243682899 1.84101534 0.2631042 1
color 1 1 1
intensity 10
exposure 0
normalize off
diffuse 1
specular 1
filters 2 1 NODE
NULL "/materials/arnold_materialbuilder1/gobo1"
radius 0.706361651
}
```

This doesn't work with [gobo light linking](https://help.autodesk.com/view/ARNOL/ENU/?guid=arnold_for_houdini_solaris_ah_Light_Filters__html), which only works for spot_light/sphere light types.

### Potential fix
Identify when the 'spotlight specific' attributes are set (i.e. cone:angle)
![image](https://github.com/Autodesk/arnold-usd/assets/5022079/e85077d3-933e-4e63-adb2-530245692f43) and set the light type to spot_light.

**To Reproduce**
Steps to reproduce the behavior:
1. Create a spotlight via the tab menu (Lights >> Spot Light)
2. Change the angle to something reasonable
![image](https://github.com/Autodesk/arnold-usd/assets/5022079/77e2865f-b77a-4aec-a9f7-4ae8a5cd4926)

3. Follow the [light linking](https://help.autodesk.com/view/ARNOL/ENU/?guid=arnold_for_houdini_solaris_ah_Light_Filters__html) docs to attach a Gobo to the spotlight, e.g.
![image](https://github.com/Autodesk/arnold-usd/assets/5022079/efb43f6e-4291-4fbd-9585-7315354ae409)

4. The render will show nothing
![image](https://github.com/Autodesk/arnold-usd/assets/5022079/5fbe58d7-18d6-4d88-b9aa-19dfe7b77b73)

5. Change the spotlight type to 'Sphere' (or 'Point')
![image](https://github.com/Autodesk/arnold-usd/assets/5022079/c278980b-e1fb-44ac-a177-f5e1ea5d2e20)

6. The render will now shot the light filter properly
![image](https://github.com/Autodesk/arnold-usd/assets/5022079/530a64ad-7a87-4a4c-9244-da1b72043bc4)

**Used Software Versions**
- Houdini 19.5.569

Contributor guide

Open the contributing guide

Research direction

Start by reproducing the Houdini 19.5.569 workflow: create a Spot Light, set its angle, export to USD, convert it to ASS with kick, and attach a Gobo light filter. Inspect how the exported light type and cone:angle attribute are handled; done means a light with cone:angle exports as spot_light and renders the Gobo correctly.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.