Skip to content

Commit 0a0902a

Browse files
authored
Merge pull request #120 from nxt-dev/dev
Release editor-v3.5.0
2 parents 6e8ece0 + 3bea362 commit 0a0902a

File tree

13 files changed

+427
-155
lines changed

13 files changed

+427
-155
lines changed

README.md

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,52 +1,52 @@
1-
# Overview
1+
# NXT Editor
22

3-
**nxt** (**/ɛn·ɛks·ti/**) is a general purpose code compositor designed for rigging, scene assembly, and automation. (node execution tree)
3+
**nxt** (**/ɛn·ɛks·ti/**) is a general purpose code compositor designed for rigging, scene assembly, and automation. (node execution tree)
4+
[Installation/Usage](#installationusage) | [Docs](https://nxt-devs.github.io/) | [Contributing](CONTRIBUTING.md) | [Licensing](LICENSE)
45

5-
| Release | Dev |
6-
| :---: | :---: |
7-
| ![Build Status](https://travis-ci.com/nxt-dev/nxt_editor.svg?token=rBRbAJTv2rq1c8WVEwGs&branch=release) | ![Build Status](https://travis-ci.com/nxt-dev/nxt_editor.svg?token=rBRbAJTv2rq1c8WVEwGs&branch=dev) |
8-
9-
# Links
10-
11-
- [Installation](#installation)
12-
- [Updating](#updating)
13-
- [User Docs](https://sunriseproductions.github.io/nxt/)
14-
- [Contributing](CONTRIBUTING.md)
15-
- [Licensing](LICENSE)
6+
# Installation/Usage
7+
**To Use NXT please use the [NXT Standalone](#nxt-standalone) or [DCC plugin zip.](#maya-plugin)**
8+
Only clone this repo if you're [contributing](CONTRIBUTING.md) to the NXT codebase.
169

10+
<br>
1711

18-
19-
# Installation
20-
21-
### Requirements
12+
#### Requirements
2213
- Python >= [2.7.*](https://www.python.org/download/releases/2.7) <= [3.7.*](https://www.python.org/download/releases/3.7)
14+
- We strongly recommend using a Python [virtual environment](https://docs.python.org/3.7/tutorial/venv.html)
2315

16+
*[Requirements for contributors](CONTRIBUTING.md#python-environment)*
2417

25-
### PIP package
26-
- From [PyPi](https://pypi.org/project/nxt-editor/):
18+
### NXT Standalone
19+
Our releases are hosted on [PyPi](https://pypi.org/project/nxt-editor/).
20+
- Install:
2721
- `pip install nxt-editor`
28-
29-
### Maya plugin:
30-
31-
1. Download the maya module(`nxt_maya.zip`) from the [latest release](https://github.com/SunriseProductions/nxt_editor/releases/latest)
32-
33-
2. Follow the [nxt_maya](integration/maya/README.md) instructions (also included in the download)
34-
35-
# Updating
36-
37-
### PIP package
38-
- From [PyPi](https://pypi.org/project/nxt-editor/):
22+
- Launch:
23+
- `nxt ui`
24+
- Update:
3925
- `pip install -U nxt-editor`
4026

4127
### Maya plugin:
4228

43-
1. Download the `nxt_maya` zip from the [latest release](https://github.com/SunriseProductions/nxt_editor/releases/latest)
29+
- Install:
30+
1. Download the maya module(`nxt_maya.zip`) from the [latest release](https://github.com/nxt-dev/nxt_editor/releases/latest)
31+
2. Follow the [nxt_maya](integration/maya/README.md) instructions (also included in the download)
32+
- Launch:
33+
1. Load `nxt_maya` plugin in Maya
34+
2. Select the `nxt` menu from the menus at the top of Maya
35+
3. Click `Open Editor`
36+
- Update:
37+
1. Download the `nxt_maya` zip from the [latest release](https://github.com/nxt-dev/nxt_editor/releases/latest)
38+
2. Extract the zip and replace the existing `nxt_maya` files with the newly extracted files.
39+
3. Re-launch Maya
4440

45-
2. Extract the zip and replace the existing nxt_maya files with the newly extracted files.
41+
<br>
4642

47-
3. Re-launch Maya
43+
## Special Thanks
4844

45+
[Sunrise Productions](https://sunriseproductions.tv/) | [School of Visual Art and Design](https://www.southern.edu/visualartanddesign/)
4946

50-
## Acknowledgements
47+
---
48+
49+
| Release | Dev |
50+
| :---: | :---: |
51+
| ![Build Status](https://travis-ci.com/nxt-dev/nxt_editor.svg?token=rBRbAJTv2rq1c8WVEwGs&branch=release) | ![Build Status](https://travis-ci.com/nxt-dev/nxt_editor.svg?token=rBRbAJTv2rq1c8WVEwGs&branch=dev) |
5152

52-
[Sunrise Productions](https://sunriseproductions.tv/) | [School of Visual Art and Design](https://www.southern.edu/visualartanddesign/)

build/validate_version_numbers.nxt

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -106,31 +106,6 @@
106106
},
107107
"nodes": {
108108
"/": {
109-
"child_order": [
110-
"CheckCommits",
111-
"ValidatePushed",
112-
"CreateRelease",
113-
"BeginPR",
114-
"ParseGitReturn",
115-
"ParseGitReturn2",
116-
"GitCmd",
117-
"GitCmd2",
118-
"CheckoutRelease",
119-
"JsonLoad2",
120-
"BeginRelease",
121-
"GitCurBranch2",
122-
"CheckoutWorking",
123-
"make_package",
124-
"GenerateHotkeysMD",
125-
"make_module_folder",
126-
"UpdateReleasePR",
127-
"GenerateChangelog",
128-
"ParseVersionJSON",
129-
"ValidateWorking",
130-
"ParseVersions",
131-
"init",
132-
"ValidateVersion"
133-
],
134109
"attrs": {
135110
"EDITOR": {
136111
"type": "NoneType",

examples/make_cube_spin.nxt

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
{
2+
"version": "1.17",
3+
"alias": "make_cube_spin",
4+
"color": "#5285a6",
5+
"mute": false,
6+
"solo": false,
7+
"meta_data": {
8+
"positions": {
9+
"/README": [
10+
340.0,
11+
-120.0
12+
],
13+
"/make_cube": [
14+
0.0,
15+
0.0
16+
],
17+
"/playblast_it": [
18+
620.0,
19+
0.0
20+
],
21+
"/spin_it": [
22+
320.0,
23+
0.0
24+
]
25+
}
26+
},
27+
"nodes": {
28+
"/": {
29+
"child_order": [
30+
"spin_it",
31+
"playblast_it",
32+
"README"
33+
],
34+
"attrs": {
35+
"cube": {
36+
"type": "raw",
37+
"value": "MyAmazingCube"
38+
}
39+
},
40+
"code": [
41+
"from maya import cmds"
42+
]
43+
},
44+
"/README": {
45+
"code": [
46+
"\"\"\"",
47+
"If you have the Maya plugin installed fire up Maya, activate the nxt_maya plugin.",
48+
"",
49+
"To run this graph remotely outside of Maya you'll want to create a context for Maya ",
50+
"Navigate to `nxt > Create Maya Context`",
51+
"Make note of the name you gave your Maya context (I named mine maya2020) and either open your terminal and run:",
52+
" ",
53+
" nxt exec ${file::make_cube_spin.nxt} --context maya2020",
54+
" ",
55+
"or from open a new Python file and use run the following script:",
56+
" ",
57+
" import nxt",
58+
" nxt.execute_graph('${file::make_cube_spin.nxt}', context='maya2020')",
59+
"",
60+
"\"\"\""
61+
]
62+
},
63+
"/make_cube": {
64+
"start_point": true,
65+
"comment": "Create a poly cube and store it's name on the STAGE",
66+
"code": [
67+
"cmds.select(cl=True)",
68+
"STAGE.cube, shape = cmds.polyCube(n='${cube}')"
69+
]
70+
},
71+
"/playblast_it": {
72+
"execute_in": "/spin_it",
73+
"comment": "Playblast the cube and open the viewer to see it",
74+
"code": [
75+
"cmds.select(cl=True)",
76+
"cmds.viewFit(\"persp\")",
77+
"cmds.playblast(st=1, et=59, format=\"image\", viewer=True)"
78+
]
79+
},
80+
"/spin_it": {
81+
"execute_in": "/make_cube",
82+
"comment": "Add some keyframes to the cube",
83+
"code": [
84+
"cmds.setKeyframe('${cube}', at='.ry', v=0.0, t=1)",
85+
"cmds.setKeyframe('${cube}', at='.ry', v=360, t=60)"
86+
]
87+
}
88+
}
89+
}

integration/maya/plug-ins/nxt_maya.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import nxt.remote.nxt_socket
2222
from nxt import nxt_log
2323
from nxt_editor.constants import NXT_WEBSITE
24+
from nxt.constants import NXT_DCC_ENV_VAR
2425

2526
logger = logging.getLogger('nxt')
2627
CREATED_UI = []
@@ -97,6 +98,7 @@ def cmdCreator():
9798

9899
def doIt(self, args):
99100
global __NXT_INSTANCE__
101+
os.environ[NXT_DCC_ENV_VAR] = 'maya'
100102
if args:
101103
string_args = []
102104
for arg in range(len(args)):

nxt_editor/__init__.py

Lines changed: 47 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
# Builtin
22
import os
3-
import sys
43
import logging
54
import sys
65

@@ -55,11 +54,24 @@ def make_resources(qrc_path=None, result_path=None):
5554
try:
5655
subprocess.check_call(['pyside2-rcc'] + args)
5756
except:
58-
try:
59-
subprocess.check_call([full_rcc_path] + args)
60-
except:
61-
raise Exception("Cannot find pyside2-rcc to generate UI resources."
62-
" Reinstalling pyside2 may fix the problem.")
57+
pass
58+
else:
59+
return
60+
61+
try:
62+
subprocess.check_call([full_rcc_path] + args)
63+
except:
64+
pass
65+
else:
66+
return
67+
68+
try:
69+
subprocess.check_call(['rcc', '-g', 'python', qrc_path, result_path])
70+
except:
71+
raise Exception("Cannot find pyside2 rcc to generate UI resources."
72+
" Reinstalling pyside2 may fix the problem.")
73+
else:
74+
return
6375

6476

6577
try:
@@ -69,27 +81,43 @@ def make_resources(qrc_path=None, result_path=None):
6981

7082

7183
def launch_editor(paths=None, start_rpc=True):
72-
"""Creates a new QApplication with editor main window and shows it.
84+
"""Launch an instance of the editor. Will attach to existing QApp if found,
85+
otherwise will create and open one.
7386
"""
74-
# Deferred import since main window relies on us
75-
from nxt_editor.main_window import MainWindow
87+
existing = QtWidgets.QApplication.instance()
88+
if existing:
89+
app = existing
90+
else:
91+
app = QtWidgets.QApplication
92+
os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
93+
app.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)
94+
app.setEffectEnabled(QtCore.Qt.UI_AnimateCombo, False)
95+
app = app(sys.argv)
96+
style_file = QtCore.QFile(':styles/styles/dark/dark.qss')
97+
style_file.open(QtCore.QFile.ReadOnly | QtCore.QFile.Text)
98+
stream = QtCore.QTextStream(style_file)
99+
app.setStyleSheet(stream.readAll())
100+
pixmap = QtGui.QPixmap(':icons/icons/nxt.svg')
101+
app.setWindowIcon(QtGui.QIcon(pixmap))
102+
instance = show_new_editor(paths, start_rpc)
103+
app.setActiveWindow(instance)
104+
if not existing:
105+
app.exec_()
106+
return app
107+
108+
109+
def show_new_editor(paths=None, start_rpc=True):
76110
path = None
77111
if paths is not None:
78112
path = paths[0]
79113
paths.pop(0)
80114
else:
81115
paths = []
82-
app = QtWidgets.QApplication(sys.argv)
83-
app.setEffectEnabled(QtCore.Qt.UI_AnimateCombo, False)
84-
style_file = QtCore.QFile(':styles/styles/dark/dark.qss')
85-
style_file.open(QtCore.QFile.ReadOnly | QtCore.QFile.Text)
86-
stream = QtCore.QTextStream(style_file)
87-
app.setStyleSheet(stream.readAll())
116+
# Deferred import since main window relies on us
117+
from nxt_editor.main_window import MainWindow
88118
instance = MainWindow(filepath=path, start_rpc=start_rpc)
89119
for other_path in paths:
90120
instance.load_file(other_path)
91-
pixmap = QtGui.QPixmap(':icons/icons/nxt.svg')
92-
app.setWindowIcon(QtGui.QIcon(pixmap))
93-
app.setActiveWindow(instance)
94121
instance.show()
95-
return app.exec_()
122+
return instance
123+

0 commit comments

Comments
 (0)