Closed dotRyan closed 4 years ago
could this not be solved simply by not sharing the runconfig and mayacharm settings between machines. then every machine would be pointing at its proper version? Unless i am misunderstanding your issue.
Lets say on
4434
4435
4434
These ports are setup by default.
In the case of having more than one maya there is no constant default port that corresponds to the maya version. The current ports seem to increment from what was added first(this is fine).
The script allows you to not even know what the port is and just run mayacharm.connect()
given that the interpreter was added.
you are able to override the ports that are setup by default with your own values as a way to keep things consistent. that is in the settings panel for MayaCharm just double click a port
Why
I made a script to go between all the computers I work on.
Switching computers that have different versions of maya end up getting different ports; so putting the connection script wasn't working out so well using :
Rather than setting the port manually I usually let the mayacharm plugin choose the ports for me. So the ports changed if there was more than one version of maya. (on my laptop I have 2015 and 2018)
Usage
This is initiated from
userSetup.py
; variables set in there become ingested into maya's globals. Then when Im in maya i can just runmayacharm.connect()
in maya's command line.Limitations
The script assumes:
MAYA_LOCATION
which is usually the bin folderQuestions
I'd like to discuss how we can implement this into this repo. Or possibly create another that stores this script. And if your plugin could point to download it.
Scripts
log = logging.getLogger("MayaCharm")
PLATFORM = sys.platform
PyCharm allows a configuration path to be set.
Add our own environment variable to to override where we look
PYCHARM_CONFIG_PATH = "PYCHARM_CONFIG_PATH"
regex to get find pycharm version from a path
MAYA_VERSION = cmds.about(version=True) MAYA_LOCATION = os.path.abspath(os.environ["MAYA_LOCATION"]) PORT_FORMAT = "mayaCharm:{port}"
class MayaCharm(object): def init(self, auto=False, product="PyCharm"): """Helper class to auto connect to mayaCharm, a plugin for pycharm