Leire Foguez
2020年10月9日 09:46:46
Hi,
I have a scene with a reference LOP that references an alembic file. While the scene is opened, I cannot overwrite the alembic file, as expected. But even when I close that scene, the alembic file cannot be overwritten. It can only be overwritten once Houdini is closed.
I have tried the same with usdview, having a usd with a reference to an alembic. While the usd file is open I cannot overwrite the alembic, but once I change the usd file to a new one, I can overwrite the alembic file.
Is there any way to unlock the alembic file without closing Houdini?
jsmack
2020年10月9日 13:20:55
Leire Foguez
I have a scene with a reference LOP that references an alembic file. While the scene is opened, I cannot overwrite the alembic file, as expected. But even when I close that scene, the alembic file cannot be overwritten. It can only be overwritten once Houdini is closed.
I don't know about referencing alembic, but I noticed when I reference USD the lock is removed when the referencing node is deleted. Maybe that will work for alembic as well? Loading alembic in sops usually requires closing Houdini to release the lock. Locking alembics when read in sops may be a windows-only thing.
Leire Foguez
2020年10月13日 03:29:03
Even when I remove the reference LOP, the alembic is still locked.
In sops I can close the scene, disable the node or delete the node to release the lock.
mtucker
2020年10月15日 15:03:46
Using low level Sdf Layer muting seems to allow this to work fairly robustly:
n = hou.node("/stage/sublayer1")
# Bypass the node loading the alembic and force it to recook
n.bypass(True)
n.stage()
l = Sdf.Layer.FindOrOpen("/path/to/alembic.abc")
# SetMuted seems to throw an exception, even though it appears to work properly...
try:
l.SetMuted(True)
except:
pass
# Copy the new file over /path/to/alembic.abc using shutil or whatever...
# Unmute the layer (now with new contents), and unbypass the node so it will
# recook again next time it is asked for its stage.
l.SetMuted(False)
n.bypass(False)