Skip to content

Commit

Permalink
Merge pull request #120 from nxt-dev/dev
Browse files Browse the repository at this point in the history
Release editor-v3.5.0
  • Loading branch information
ImLucasBrown authored Dec 30, 2020
2 parents 6e8ece0 + 3bea362 commit 0a0902a
Show file tree
Hide file tree
Showing 13 changed files with 427 additions and 155 deletions.
70 changes: 35 additions & 35 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,52 +1,52 @@
# Overview
# NXT Editor

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

| Release | Dev |
| :---: | :---: |
| ![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) |

# Links

- [Installation](#installation)
- [Updating](#updating)
- [User Docs](https://sunriseproductions.github.io/nxt/)
- [Contributing](CONTRIBUTING.md)
- [Licensing](LICENSE)
# Installation/Usage
**To Use NXT please use the [NXT Standalone](#nxt-standalone) or [DCC plugin zip.](#maya-plugin)**
Only clone this repo if you're [contributing](CONTRIBUTING.md) to the NXT codebase.

<br>


# Installation

### Requirements
#### Requirements
- Python >= [2.7.*](https://www.python.org/download/releases/2.7) <= [3.7.*](https://www.python.org/download/releases/3.7)
- We strongly recommend using a Python [virtual environment](https://docs.python.org/3.7/tutorial/venv.html)

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

### PIP package
- From [PyPi](https://pypi.org/project/nxt-editor/):
### NXT Standalone
Our releases are hosted on [PyPi](https://pypi.org/project/nxt-editor/).
- Install:
- `pip install nxt-editor`

### Maya plugin:

1. Download the maya module(`nxt_maya.zip`) from the [latest release](https://github.com/SunriseProductions/nxt_editor/releases/latest)

2. Follow the [nxt_maya](integration/maya/README.md) instructions (also included in the download)

# Updating

### PIP package
- From [PyPi](https://pypi.org/project/nxt-editor/):
- Launch:
- `nxt ui`
- Update:
- `pip install -U nxt-editor`

### Maya plugin:

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

2. Extract the zip and replace the existing nxt_maya files with the newly extracted files.
<br>

3. Re-launch Maya
## Special Thanks

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

## Acknowledgements
---

| Release | Dev |
| :---: | :---: |
| ![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) |

[Sunrise Productions](https://sunriseproductions.tv/) | [School of Visual Art and Design](https://www.southern.edu/visualartanddesign/)
25 changes: 0 additions & 25 deletions build/validate_version_numbers.nxt
Original file line number Diff line number Diff line change
Expand Up @@ -106,31 +106,6 @@
},
"nodes": {
"/": {
"child_order": [
"CheckCommits",
"ValidatePushed",
"CreateRelease",
"BeginPR",
"ParseGitReturn",
"ParseGitReturn2",
"GitCmd",
"GitCmd2",
"CheckoutRelease",
"JsonLoad2",
"BeginRelease",
"GitCurBranch2",
"CheckoutWorking",
"make_package",
"GenerateHotkeysMD",
"make_module_folder",
"UpdateReleasePR",
"GenerateChangelog",
"ParseVersionJSON",
"ValidateWorking",
"ParseVersions",
"init",
"ValidateVersion"
],
"attrs": {
"EDITOR": {
"type": "NoneType",
Expand Down
89 changes: 89 additions & 0 deletions examples/make_cube_spin.nxt
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
{
"version": "1.17",
"alias": "make_cube_spin",
"color": "#5285a6",
"mute": false,
"solo": false,
"meta_data": {
"positions": {
"/README": [
340.0,
-120.0
],
"/make_cube": [
0.0,
0.0
],
"/playblast_it": [
620.0,
0.0
],
"/spin_it": [
320.0,
0.0
]
}
},
"nodes": {
"/": {
"child_order": [
"spin_it",
"playblast_it",
"README"
],
"attrs": {
"cube": {
"type": "raw",
"value": "MyAmazingCube"
}
},
"code": [
"from maya import cmds"
]
},
"/README": {
"code": [
"\"\"\"",
"If you have the Maya plugin installed fire up Maya, activate the nxt_maya plugin.",
"",
"To run this graph remotely outside of Maya you'll want to create a context for Maya ",
"Navigate to `nxt > Create Maya Context`",
"Make note of the name you gave your Maya context (I named mine maya2020) and either open your terminal and run:",
" ",
" nxt exec ${file::make_cube_spin.nxt} --context maya2020",
" ",
"or from open a new Python file and use run the following script:",
" ",
" import nxt",
" nxt.execute_graph('${file::make_cube_spin.nxt}', context='maya2020')",
"",
"\"\"\""
]
},
"/make_cube": {
"start_point": true,
"comment": "Create a poly cube and store it's name on the STAGE",
"code": [
"cmds.select(cl=True)",
"STAGE.cube, shape = cmds.polyCube(n='${cube}')"
]
},
"/playblast_it": {
"execute_in": "/spin_it",
"comment": "Playblast the cube and open the viewer to see it",
"code": [
"cmds.select(cl=True)",
"cmds.viewFit(\"persp\")",
"cmds.playblast(st=1, et=59, format=\"image\", viewer=True)"
]
},
"/spin_it": {
"execute_in": "/make_cube",
"comment": "Add some keyframes to the cube",
"code": [
"cmds.setKeyframe('${cube}', at='.ry', v=0.0, t=1)",
"cmds.setKeyframe('${cube}', at='.ry', v=360, t=60)"
]
}
}
}
2 changes: 2 additions & 0 deletions integration/maya/plug-ins/nxt_maya.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import nxt.remote.nxt_socket
from nxt import nxt_log
from nxt_editor.constants import NXT_WEBSITE
from nxt.constants import NXT_DCC_ENV_VAR

logger = logging.getLogger('nxt')
CREATED_UI = []
Expand Down Expand Up @@ -97,6 +98,7 @@ def cmdCreator():

def doIt(self, args):
global __NXT_INSTANCE__
os.environ[NXT_DCC_ENV_VAR] = 'maya'
if args:
string_args = []
for arg in range(len(args)):
Expand Down
66 changes: 47 additions & 19 deletions nxt_editor/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Builtin
import os
import sys
import logging
import sys

Expand Down Expand Up @@ -55,11 +54,24 @@ def make_resources(qrc_path=None, result_path=None):
try:
subprocess.check_call(['pyside2-rcc'] + args)
except:
try:
subprocess.check_call([full_rcc_path] + args)
except:
raise Exception("Cannot find pyside2-rcc to generate UI resources."
" Reinstalling pyside2 may fix the problem.")
pass
else:
return

try:
subprocess.check_call([full_rcc_path] + args)
except:
pass
else:
return

try:
subprocess.check_call(['rcc', '-g', 'python', qrc_path, result_path])
except:
raise Exception("Cannot find pyside2 rcc to generate UI resources."
" Reinstalling pyside2 may fix the problem.")
else:
return


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


def launch_editor(paths=None, start_rpc=True):
"""Creates a new QApplication with editor main window and shows it.
"""Launch an instance of the editor. Will attach to existing QApp if found,
otherwise will create and open one.
"""
# Deferred import since main window relies on us
from nxt_editor.main_window import MainWindow
existing = QtWidgets.QApplication.instance()
if existing:
app = existing
else:
app = QtWidgets.QApplication
os.environ["QT_AUTO_SCREEN_SCALE_FACTOR"] = "1"
app.setAttribute(QtCore.Qt.AA_EnableHighDpiScaling, True)
app.setEffectEnabled(QtCore.Qt.UI_AnimateCombo, False)
app = app(sys.argv)
style_file = QtCore.QFile(':styles/styles/dark/dark.qss')
style_file.open(QtCore.QFile.ReadOnly | QtCore.QFile.Text)
stream = QtCore.QTextStream(style_file)
app.setStyleSheet(stream.readAll())
pixmap = QtGui.QPixmap(':icons/icons/nxt.svg')
app.setWindowIcon(QtGui.QIcon(pixmap))
instance = show_new_editor(paths, start_rpc)
app.setActiveWindow(instance)
if not existing:
app.exec_()
return app


def show_new_editor(paths=None, start_rpc=True):
path = None
if paths is not None:
path = paths[0]
paths.pop(0)
else:
paths = []
app = QtWidgets.QApplication(sys.argv)
app.setEffectEnabled(QtCore.Qt.UI_AnimateCombo, False)
style_file = QtCore.QFile(':styles/styles/dark/dark.qss')
style_file.open(QtCore.QFile.ReadOnly | QtCore.QFile.Text)
stream = QtCore.QTextStream(style_file)
app.setStyleSheet(stream.readAll())
# Deferred import since main window relies on us
from nxt_editor.main_window import MainWindow
instance = MainWindow(filepath=path, start_rpc=start_rpc)
for other_path in paths:
instance.load_file(other_path)
pixmap = QtGui.QPixmap(':icons/icons/nxt.svg')
app.setWindowIcon(QtGui.QIcon(pixmap))
app.setActiveWindow(instance)
instance.show()
return app.exec_()
return instance

Loading

0 comments on commit 0a0902a

Please sign in to comment.