mirror of
https://github.com/ynput/ayon-core.git
synced 2026-01-02 00:44:52 +01:00
♻️ use sets for member comparsion
This commit is contained in:
parent
18859001b1
commit
0b07036fa8
1 changed files with 13 additions and 8 deletions
|
|
@ -69,14 +69,19 @@ class ExtractCameraAlembic(openpype.api.Extractor):
|
|||
job_str += ' -root {0}'.format(camera_root)
|
||||
|
||||
for member in members:
|
||||
member_content = cmds.listRelatives(
|
||||
member, ad=True, fullPath=True) or []
|
||||
# skip hierarchy if it contains only camera
|
||||
# `member_content` will contain camera + its parents
|
||||
if camera in member_content \
|
||||
and len(member_content) == len(camera.split("|")) - 2: # noqa
|
||||
continue
|
||||
|
||||
descendants = cmds.listRelatives(member,
|
||||
allDescendents=True,
|
||||
fullPath=True) or []
|
||||
shapes = cmds.ls(descendants, shapes=True,
|
||||
noIntermediate=True, long=True)
|
||||
cameras = cmds.ls(shapes, type="camera", long=True)
|
||||
if cameras:
|
||||
if not set(shapes) - set(cameras):
|
||||
continue
|
||||
self.log.warning((
|
||||
"Camera hierarchy contains additional geometry. "
|
||||
"Extraction will fail.")
|
||||
)
|
||||
transform = cmds.listRelatives(
|
||||
member, parent=True, fullPath=True)
|
||||
transform = transform[0] if transform else member
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue