Add support for IES lights

Add support for tracing `.ies` files referenced by lights.

Reviewed-on: https://projects.blender.org/blender/blender-asset-tracer/pulls/92883
This commit is contained in:
Olivier Charvin 2023-10-16 12:14:07 +02:00 committed by Sybren A. Stüvel
parent 055457ab67
commit 74b3df5f99
2 changed files with 16 additions and 0 deletions

View File

@ -6,6 +6,7 @@ changed functionality, fixed bugs).
# Version 1.16 (in development) # Version 1.16 (in development)
- Add `BlendFileBlock.raw_data()` and `.as_string()` functions. These functions interpret the data in a `BlendFileBlock` as either `bytes` or `string`. This can be used to obtain the contents of a `char*` (instead of the more common embedded `char[N]` array). - Add `BlendFileBlock.raw_data()` and `.as_string()` functions. These functions interpret the data in a `BlendFileBlock` as either `bytes` or `string`. This can be used to obtain the contents of a `char*` (instead of the more common embedded `char[N]` array).
- Add support for IES lights ([#92883](https://projects.blender.org/blender/blender-asset-tracer/pulls/92883)).
# Version 1.15 (2022-12-16) # Version 1.15 (2022-12-16)

View File

@ -213,3 +213,18 @@ def vector_font(block: blendfile.BlendFileBlock) -> typing.Iterator[result.Block
if path == b"<builtin>": # builtin font if path == b"<builtin>": # builtin font
return return
yield result.BlockUsage(block, path, path_full_field=field) yield result.BlockUsage(block, path, path_full_field=field)
@dna_code("LA")
@skip_packed
def lamp(block: blendfile.BlendFileBlock) -> typing.Iterator[result.BlockUsage]:
"""Lamp data blocks."""
block_ntree = block.get_pointer(b"nodetree", 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 not storage:
continue
path, field = storage.get(b"filepath", return_field=True)
yield result.BlockUsage(block, path, path_full_field=field)