Find texture of displacement modifier

This commit is contained in:
Sybren A. Stüvel 2018-03-26 16:46:13 +02:00
parent c515509b24
commit 0d82dc7fd0
2 changed files with 15 additions and 0 deletions

View File

@ -34,6 +34,7 @@ IMA_SRC_SEQUENCE = 2
IMA_SRC_MOVIE = 3
# DNA_modifier_types.h
eModifierType_Displace = 14
eModifierType_ParticleSystem = 19
eModifierType_Ocean = 39
eModifierType_MeshCache = 46

View File

@ -62,6 +62,20 @@ def modifier_ocean(modifier: blendfile.BlendFileBlock, block_name: bytes) \
block_name=block_name)
@mod_handler(cdefs.eModifierType_Displace)
def modifier_texture(modifier: blendfile.BlendFileBlock, block_name: bytes) \
-> typing.Iterator[result.BlockUsage]:
tx = modifier.get_pointer(b'texture')
if not tx:
return
ima = tx.get_pointer(b'ima')
if not ima:
return
path, field = ima.get(b'name', return_field=True)
yield result.BlockUsage(modifier, path, path_full_field=field, block_name=block_name)
@mod_handler(cdefs.eModifierType_ParticleSystem)
def modifier_particle_system(modifier: blendfile.BlendFileBlock, block_name: bytes) \
-> typing.Iterator[result.BlockUsage]: