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

Maya: Add MayaPy application. #5705

Merged
merged 5 commits into from
Oct 10, 2023
Merged

Conversation

tokejepsen
Copy link
Member

@tokejepsen tokejepsen commented Oct 5, 2023

Changelog Description

This adds mayapy to the application to be launched from a task.

Testing notes:

  1. Setup project with MayaPy as application
  2. Launch MayaPy
  3. In console window execute:
import maya.standalone
maya.standalone.initialize()

@tokejepsen tokejepsen added the sponsored Client endorsed or requested label Oct 5, 2023
@tokejepsen
Copy link
Member Author

Split from #5644

@ynbot ynbot added host: Maya size/S Denotes a PR changes 100-499 lines, ignoring general files type: feature Larger, user affecting changes and completely new things labels Oct 5, 2023
@BigRoy
Copy link
Collaborator

BigRoy commented Oct 5, 2023

Having the duplicated environment in settings for these does seem a bit unfortunate because you might rarely want to differentiate that with your Maya envs themselves, so now you'd need to manage both?

I know these are for testing but we've always used this "Debug Shell" launcher action which creates a command line shell with the os.environ similar to how you'd usually launch the application. This then works for any of the hosts, and then due to how it sets things up you can just type mayapy to launch e.g. MayaPy in the maya environment. Different use case maybe - but maybe it can help testing too in a way.

@BigRoy
Copy link
Collaborator

BigRoy commented Oct 5, 2023

Is this PR missing AYON settings?

@BigRoy
Copy link
Collaborator

BigRoy commented Oct 5, 2023

In console window execute from maya import cmds.

If I'm not mistaken that actually doesn't do much - the cmds module will be empty as far as I know until you run:

import maya.standalone
maya.standalone.initialize()

That'd also actually start the OpenPype Maya host install process so might be good to test with too to see if any errors occur with mayapy.

Copy link
Member

@moonyuet moonyuet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good for me except for the small mistake on the setting for 2023
Is it also gonna be added into the AYON setting?

@moonyuet
Copy link
Member

moonyuet commented Oct 9, 2023

In console window execute from maya import cmds.

If I'm not mistaken that actually doesn't do much - the cmds module will be empty as far as I know until you run:

import maya.standalone
maya.standalone.initialize()

That'd also actually start the OpenPype Maya host install process so might be good to test with too to see if any errors occur with mayapy.

I think it might work without maya.standalone.initialize() but I agree that we need to check if any errors occurred when mayapy started.
The screenscapture below is the mayapy executed from the OP launcher.
image

@BigRoy
Copy link
Collaborator

BigRoy commented Oct 9, 2023

Without initialize the maya.cmds module exists, but is empty, e.g. the file command maya.cmds.file I believe does not exist until initialized. I might be wrong though. 🗡️

@moonyuet
Copy link
Member

moonyuet commented Oct 9, 2023

Without initialize the maya.cmds module exists, but is empty, e.g. the file command maya.cmds.file I believe does not exist until initialized. I might be wrong though. 🗡️

image
maybe you are right.......

cmds.ls() works after initialization
image

Co-authored-by: Kayla Man <64118225+moonyuet@users.noreply.github.com>
@tokejepsen tokejepsen removed the request for review from LiborBatek October 9, 2023 16:38
@tokejepsen tokejepsen assigned moonyuet and unassigned LiborBatek Oct 9, 2023
Copy link
Member

@moonyuet moonyuet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
Looks good for me

@tokejepsen tokejepsen assigned antirotor and unassigned moonyuet Oct 10, 2023
@moonyuet moonyuet merged commit 36c25e9 into ynput:develop Oct 10, 2023
1 check passed
@ynbot ynbot added this to the next-patch milestone Oct 10, 2023
@tokejepsen tokejepsen deleted the feature/mayapy branch October 10, 2023 08:15
@@ -109,6 +109,55 @@
}
]
},
"maya": {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is wrong, it should be mayapy - now it is breaking AYON default settings

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
host: Maya size/S Denotes a PR changes 100-499 lines, ignoring general files sponsored Client endorsed or requested type: feature Larger, user affecting changes and completely new things
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

None yet

6 participants