Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extract camera Alembic: Incorrectly gets cameras #154

Open
2 tasks done
johhnry opened this issue Oct 18, 2024 · 0 comments
Open
2 tasks done

Extract camera Alembic: Incorrectly gets cameras #154

johhnry opened this issue Oct 18, 2024 · 0 comments

Comments

@johhnry
Copy link

johhnry commented Oct 18, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior:

We are trying to publish a MatchMove product from a Maya Scene that has a single camera. It fails at the Extract Camera (Maya Scene) step in the publish.

Here is my scene:
image

This is the relevant output:

  File "C:\Users\joseph.henry\AppData\Local\Ynput\AYON\addons\maya_0.2.14\ayon_maya\plugins\publish\extract_camera_mayaScene.py", line 269, in transfer_image_planes
    image_planes = cmds.listConnections(image_plane_plug,
ValueError: No object matches name: |pCube1|pCubeShape1.imagePlane

After investigating, it seems that it boils down to this line:

cameras = set(cmds.ls(members, leaf=True, shapes=True, long=True,

It tries to get the cameras by filtering objects from the ones you selected. In my case it's a camera and a geo.

If I test this code:

from maya import cmds

members = set(
    cmds.ls(
        ["pCube1", "camera1"],
        leaf=True,
        shapes=True,
        long=True,
        dag=True,
    )
)

print("MEMBERS: ", members)

cameras = set(
    cmds.ls(
        members,
        leaf=True,
        shapes=True,
        long=True,
        dag=True,
        type="camera",
    )
)

print("CAMERAS: ", cameras)
MEMBERS:  {'|camera1|cameraShape1', '|pCube1|pCubeShape1'}
CAMERAS:  {'|camera1|cameraShape1', '|pCube1|pCubeShape1'}

So it tried to filter out the cameras (with type="camera" in cmds.ls) but it didn't work because it tries to get the .imagePlane object on a geo.

I found that using cmds.ls(members, dag=True, type="camera") works and prints {'cameraShape1'}

Expected Behavior:

It should filter the cameras out of the objects in the publish set.

Version

1.0.0

What platform you are running on?

Windows

Steps To Reproduce:

  1. Open Maya
  2. Create a camera and a geo
  3. Select both objects
  4. Go to AYON > Create and create a MatchMove product
  5. Hit Publish

Are there any labels you wish to add?

  • I have added the relevant labels to the bug report.

Relevant log output:

No response

Additional context:

No response

@johhnry johhnry changed the title Extract camera Maya Scene: Incorrectly get cameras Extract camera Alembic: Incorrectly gets cameras Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant