Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Commit

Permalink
Maya: Account and ignore free image planes. (#5993)
Browse files Browse the repository at this point in the history
* Account and ignore for free image planes.

* Incorporating BigRoy changes

---------

Co-authored-by: Petr Kalis <[email protected]>
  • Loading branch information
tokejepsen and kalisp authored Jan 16, 2024
1 parent 97030a9 commit a6cc0b5
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions openpype/hosts/maya/plugins/publish/extract_camera_mayaScene.py
Original file line number Diff line number Diff line change
Expand Up @@ -265,13 +265,16 @@ def transfer_image_planes(source_cameras, target_cameras,
try:
for source_camera, target_camera in zip(source_cameras,
target_cameras):
image_planes = cmds.listConnections(source_camera,
image_plane_plug = "{}.imagePlane".format(source_camera)
image_planes = cmds.listConnections(image_plane_plug,
source=True,
destination=False,
type="imagePlane") or []

# Split of the parent path they are attached - we want
# the image plane node name.
# the image plane node name if attached to a camera.
# TODO: Does this still mean the image plane name is unique?
image_planes = [x.split("->", 1)[1] for x in image_planes]
image_planes = [x.split("->", 1)[-1] for x in image_planes]

if not image_planes:
continue
Expand All @@ -282,7 +285,7 @@ def transfer_image_planes(source_cameras, target_cameras,
if source_camera == target_camera:
continue
_attach_image_plane(target_camera, image_plane)
else: # explicitly dettaching image planes
else: # explicitly detach image planes
cmds.imagePlane(image_plane, edit=True, detach=True)
originals[source_camera].append(image_plane)
yield
Expand Down

0 comments on commit a6cc0b5

Please sign in to comment.