Add support for IES lighting #92883

Closed
Olivier C wants to merge 2 commits from oliverpool:ies_support into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
Showing only changes of commit 90da2be4f9 - Show all commits

View File

@ -220,7 +220,8 @@ def vector_font(block: blendfile.BlendFileBlock) -> typing.Iterator[result.Block
def lamp(block: blendfile.BlendFileBlock) -> typing.Iterator[result.BlockUsage]:
"""Lamp data blocks."""
block_ntree = block.get_pointer(b"nodetree", None)
if block_ntree is not None:
if block_ntree is None:
return
for node in iterators.listbase(block_ntree.get_pointer((b"nodes", b"first"))):
storage = node.get_pointer(b"storage")
if storage:

Flip the condition & continue, so that the bulk of the code is non-conditional:

if not storage:
    continue
path, field = storage.get(b"filepath", return_field=True)
yield result.BlockUsage(block, path, path_full_field=field)
Flip the condition & `continue`, so that the bulk of the code is non-conditional: ```python if not storage: continue path, field = storage.get(b"filepath", return_field=True) yield result.BlockUsage(block, path, path_full_field=field) ```