Skip to content

Commit d20441e

Browse files
committed
add support for maya 2022
1 parent 5da7807 commit d20441e

File tree

7 files changed

+28
-12
lines changed

7 files changed

+28
-12
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# Changelog
22

3+
## Version 1.5.0 (October 30, 2021)
4+
* Enhancement: Add support for Maya 2022 with Python 3.7. (@artbycrunk in [issues/25](https://github.com/artbycrunk/vscode-maya/issues/25))
5+
36
## Version 1.4.0 (May 01, 2020)
47
* Enhancement: ctrl+shift+o go to symbol support. (@artbycrunk in [issues/11](https://github.com/artbycrunk/vscode-maya/issues/11))
58
* Enhancement: Outline support for functions and variables (@artbycrunk in [issues/11](https://github.com/artbycrunk/vscode-maya/issues/12))

LICENSE

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
MIT License
22

3-
Copyright (c) 2018 Savio Fernandes
3+
Copyright (c) 2018-2021 Savio Fernandes
44

55
Permission is hereby granted, free of charge, to any person obtaining a copy
66
of this software and associated documentation files (the "Software"), to deal

README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ Command | Description
4949
You can also select a block of code in the editor
5050
and ```Right-click -> Send Code to Maya```, this is based on the current working language (Mel or Python).
5151

52+
## Update for Maya 2022 and above.
53+
54+
> ![Option for Maya 2022 and above](./images/runner_option.png "Option for Maya 2022 and above")
5255
5356
## Opening the correct ports for Send to Maya Commands.
5457

images/runner_option.png

4.64 KB
Loading

package-lock.json

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "mayacode",
33
"displayName": "MayaCode",
44
"description": "A Visual Studio Code extension with support for coding for Maya.",
5-
"version": "1.4.0",
5+
"version": "1.5.0",
66
"publisher": "saviof",
77
"author": {
88
"name": "Savio Fernandes"
@@ -51,7 +51,7 @@
5151
"vscode-test": "^1.3.0"
5252
},
5353
"dependencies": {
54-
"vscode-extension-telemetry": "^0.1.3"
54+
"vscode-extension-telemetry": "^0.1.7"
5555
},
5656
"contributes": {
5757
"languages": [
@@ -114,6 +114,11 @@
114114
"default": "localhost",
115115
"description": "The hostname of the machine which has a maya instance running."
116116
},
117+
"mayacode.runner.latest": {
118+
"type": "boolean",
119+
"default": true,
120+
"description": "Run for Maya 2022 and above"
121+
},
117122
"mayacode.telemetry": {
118123
"type": "boolean",
119124
"default": true
@@ -159,4 +164,4 @@
159164
]
160165
}
161166
}
162-
}
167+
}

src/extension.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,11 @@ export function activate(context: vscode.ExtensionContext) {
289289
text = "# -*- coding: utf-8 -*-\n" + text;
290290
nativePath = path.join(os.tmpdir(), "MayaCode.py");
291291
posixPath = nativePath.replace(/\\/g, "/");
292-
cmd = `python("execfile('${posixPath}')")`;
292+
if(config.get('runner.latest')){
293+
cmd = `python("exec(open('${posixPath}').read())")`;
294+
}else{
295+
cmd = `python("execfile('${posixPath}')")`;
296+
}
293297
}
294298

295299
if (type == 'mel') {
@@ -315,6 +319,7 @@ export function activate(context: vscode.ExtensionContext) {
315319

316320
function send(text: string, type: string) {
317321
let success: boolean = socket_mel.write(text + '\n');
322+
// let success: boolean = socket_mel.write(text + '\n', "utf8");
318323
Logger.info(text);
319324
if (success){
320325
let successMsg = `Sent ${type} code to Maya...`;

0 commit comments

Comments
 (0)