Skip to content

Commit

Permalink
updated NUKE paths
Browse files Browse the repository at this point in the history
maya compatibility
  • Loading branch information
Alexander Richter committed May 8, 2017
1 parent b39ed12 commit ad75993
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 36 deletions.
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
> ### In Development
> A lot of features are still in production. Check out the documentary and **[help us to improve.](https://github.com/richteralexander/plex/wiki/How-to-Contribute)**
> [**PatchDay**](https://github.com/richteralexander/plex/wiki/PatchDay): Every sunday will be new additions and fixes
> [**Releases**](https://github.com/richteralexander/plex/wiki/Releases): Every sunday will be a patch day with new additions and fixes.
>
> [FMX 2017 Talk - Open Source Pipeline](https://livestream.com/accounts/10071884/events/7339552/videos/155507577)
Expand All @@ -18,6 +18,11 @@ The main idea is to have an overall system which lays the **foundation for the m

![structure](https://cloud.githubusercontent.com/assets/9514022/25559030/6c4396a2-2d33-11e7-90a2-add01a986613.png)

## Environment [in development]
- [x] **OS**: Windows (| Linux | Max)
- [x] **Software**: Nuke 10.5+ | Maya 2017+ (| Houdini 16+)
- [x] **Renderer**: Arnold5+ (| RenderMan21+ | Mantra | V-Ray3+)

## Project Features
- [x] vfx, animation & game production management system
- [x] file & folder management (settings | create | save | load | publish)
Expand Down
2 changes: 1 addition & 1 deletion data/exe/win_maya.bat
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@
set "newDir=%~dp0\.."
python %newDir%\pipeline.py %1 --script software --software maya

exit
::exit
1 change: 0 additions & 1 deletion data/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,6 @@ def __missing__(self, key):
from software import Software
soft = Software()
soft.setup(args.software)
soft.add_env()
soft.start()
elif args.script == 'desktop':
import arDesktop
Expand Down
1 change: 0 additions & 1 deletion data/project/.gitkeep

This file was deleted.

26 changes: 13 additions & 13 deletions data/project/default/software.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,35 +15,35 @@
#************************
# MAYA
MAYA:
version: &MAYA_VERSION 2017
path: &PATH !join ["C:/Program Files/Autodesk/Maya", *MAYA_VERSION, /maya.exe]
version: &MAYA_VERSION 2016
path: &PATH !join ["C:/Program Files/Autodesk/Maya", *MAYA_VERSION, /bin/maya.exe]

# place {} to be replaced by open_file
start: !join ['start ', *PATH, ' -file "{}"']
start: !join ['start "', *PATH, '" -file "{}"']

renderer:
renderer_path:

ENV:
PYTHONPATH:
- !env [SOFTWARE_PATH, /scripts]
- !env [SOFTWARE_PATH, /plugins]
- !env [SOFTWARE_PATH, /shelf]
- !env_first [SOFTWARE_PATH, /scripts]
- !env_first [SOFTWARE_PATH, /plugins]
- !env_first [SOFTWARE_PATH, /shelf]

MAYA_SCRIPT_PATH:
MAYA_SCRIPT_PATH: [SOFTWARE_PATH, /scripts]

MAYA_PLUG_IN_PATH:
- !env [SOFTWARE_PATH, /plugins]
- !env_first [SOFTWARE_PATH, /plugins]

MAYA_SHELF_PATH:
- !env [SOFTWARE_PATH, /shelf]
- !env_first [SOFTWARE_PATH, /shelf]

# SPLASHSCREEN
XBMLANGPATH: !env [IMG_PATH, /software/maya]

# DISABLE close reports
MAYA_DISABLE_CIP: 1
MAYA_DISABLE_CER: 1
MAYA_DISABLE_CIP: "1"
MAYA_DISABLE_CER: "1"

MENU:
- Save: menuItem(p={}, l='arSave', c='from util import arSave; reload(arSave); arSave.main()')
Expand Down Expand Up @@ -91,12 +91,12 @@ NUKE:

# - break: "addSeparator()"

- arWrite: "addCommand('arWrite', 'import menu; arWrite()', 'ctrl+alt+w', 'write.ico')"
- arWrite: "addCommand('arWrite', 'arWrite()', 'ctrl+alt+w', 'write.ico')"

- break: "addSeparator()"

# - Report: "addCommand('Report', 'import menu; report()', 'ctrl+alt+r', 'reporter.ico')"
- Help: "addCommand('Help', 'import menu; get_help()', 'ctrl+alt+h', 'help.ico')"
- Help: "addCommand('Help', 'get_help()', 'ctrl+alt+h', 'help.ico')"

- break: "addSeparator()"

Expand Down
11 changes: 7 additions & 4 deletions lib/classes/software.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,14 @@
# CLASS
class Software(Singleton):

def setup(self, software=os.getenv('SOFTWARE')):
self.software = software.lower()
def setup(self, software):
self.software = software.lower()

# GET data
self.software_data = libData.get_data()['software'][self.software.upper()]

self.ver = self.software_data['version']
self.software_path = self.software_data['path']
self.software_path = self.software_data['path']

# RENDERER
self.renderer = self.software_data.get('renderer', '')
Expand Down Expand Up @@ -67,6 +67,7 @@ def add_env(self):
# ADD software ENV
if(self.env):
for env, content in self.env.iteritems():
LOG.debug('{} _ {}'.format(env, content))
if isinstance(content, list):
for each in content:
libData.add_env(env, each)
Expand All @@ -78,8 +79,10 @@ def add_env(self):
#************************
# SOFTWARE
def start(self, open_file=''):
self.add_env()

cmd = self.software_data['start'].format(open_file)
LOG.debug(self.software_data['start'])
LOG.debug(cmd)
subprocess.Popen(cmd, shell=True, env=os.environ)

def __call__(self):
Expand Down
7 changes: 5 additions & 2 deletions lib/libFileFolder.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,11 @@ def get_file_list(path, file_type='*', extension=False, exclude='*', add_path =

##
# @BRIEF GET ALL subfolders in the path
def get_deep_folder_list(path):
getFile = map(lambda x: os.path.basename(x[0]), os.walk(path))
def get_deep_folder_list(path, add_path = False):
if add_path:
getFile = map(lambda x: x[0], os.walk(path))
else:
getFile = map(lambda x: os.path.basename(x[0]), os.walk(path))
getFile.pop(0)
return getFile

Expand Down
Empty file.
6 changes: 3 additions & 3 deletions software/nuke/gizmos/arWrite.gizmo
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Gizmo {
addUserKnob {26 banner l @writeBanner52.png t "<b><font size='4' color='#dc520f'> arWRITE</font></b><font size='2' align='right'><br> pipeline write node</font>" T "<b><font size='4' color='#dc520f'> arWRITE</font></b><font size='2' align='right'><br> pipeline write node</font>"}
addUserKnob {26 ""}
addUserKnob {2 rootPath l INVISIBLE +INVISIBLE}
rootPath M:/LosMariachis/project/episode01/shots/sWin001002003/images/sWin010_COMP_v001_ar/exr/sWin010_COMP_v001_ar.%04d.exr
rootPath P:/project/shots/s0010/comp/s0010_COMP_v001_ar.%04d.exr
addUserKnob {4 status l Status M {" " "plate " preViz postViz preComp postComp comp final "" "" ""}}
addUserKnob {26 space4 l "" -STARTLINE T " | "}
addUserKnob {6 chbPublish l PUBLISH t "Publish for EDIT (overwrite old publish)" -STARTLINE}
Expand All @@ -20,7 +20,7 @@ Gizmo {
addUserKnob {6 chbExr l " " -STARTLINE}
chbExr true
addUserKnob {2 exrPath l "" -STARTLINE}
exrPath M:/LosMariachis/project/episode01/shots/sWin001002003/images/sWin010_COMP_v001_ar/exr/sWin010_COMP_v001_ar.%04d.exr
exrPath P:/project/shots/s0010/comp/s0010_COMP_v001_ar.%04d.exr
addUserKnob {22 exrFolder l @btnFolder48.png t "open render folder" -STARTLINE T "reload(writeNode)\nwriteNode.openFolder(nuke.thisNode()\[\"exrPathComment\"].getValue())"}
addUserKnob {22 exrRv l @rv.png t "open rendering in rv player" -STARTLINE T "reload(writeNode)\nwriteNode.openRV(nuke.thisNode()\[\"exrPathComment\"].getValue())"}
addUserKnob {26 lblJpg l "JPG " T ""}
Expand All @@ -37,7 +37,7 @@ Gizmo {
addUserKnob {22 tifFolder l @btnFolder48.png t "open render folder" -STARTLINE +DISABLED T "reload(writeNode)\nwriteNode.openFolder(nuke.thisNode()\[\"tifPathComment\"].getValue())"}
addUserKnob {22 tifRv l @rv.png t "open rendering in rv player" -STARTLINE +DISABLED T "reload(writeNode)\nwriteNode.openRV(nuke.thisNode()\[\"tifPathComment\"].getValue())"}
addUserKnob {1 exrPathComment l INVISIBLE +INVISIBLE}
exrPathComment M:/LosMariachis/project/episode01/shots/sWin001002003/images/sWin010_COMP_v001_ar/exr/sWin010_COMP_v001_ar.%04d.exr
exrPathComment P:/project/shots/s0010/comp/s0010_COMP_v001_ar.%04d.exr
addUserKnob {1 jpgPathComment l INVISIBLE +INVISIBLE}
jpgPathComment M:/LosMariachis/project/episode01/shots/sWin001002003/images/sWin010_COMP_v001_ar/jpg/sWin010_COMP_v001_ar.%04d.jpg
addUserKnob {1 tifPathComment l INVISIBLE +INVISIBLE}
Expand Down
20 changes: 13 additions & 7 deletions software/nuke/menu.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@
import libLog
import libData
import libFunc
import software
import libFileFolder
from software import Software

TITLE = os.path.splitext(os.path.basename(__file__))[0]
LOG = libLog.init(script=TITLE)
Expand All @@ -39,24 +40,29 @@ def add_write_node():
for currentNode in write:
writeNode.nodeCreate(currentNode)

def add_all_img():
def add_plugin_paths():
# ADD all IMG paths
for img in os.getenv('IMG_PATH').split(';'):
nuke.pluginAddPath('{}/software/nuke'.format(img))
nuke.pluginAddPath('{}/software/nuke/menu'.format(img))
for img_sub in libFileFolder.get_deep_folder_list(path=img, add_path=True):
nuke.pluginAddPath(img_sub)

# ADD sub software paths
for paths in os.getenv('SOFTWARE_SUB_PATH').split(';'):
nuke.pluginAddPath(paths)


#*******************
# TOOLBAR
add_all_img()
add_plugin_paths()

project_data = libData.get_data()
menu_data = project_data['software']['NUKE']['MENU']
menuNode = nuke.menu('Nodes').addMenu(project_data['project']['name'], icon = 'nuke.ico')

nuke.addOnScriptSave(add_write_node)
# nuke.addOnScriptSave(add_write_node)

for menu_item in menu_data:
software.Software.add_menu(menuNode, menu_item)
Software.add_menu(menuNode, menu_item)

menuNode.addSeparator()

Expand Down
6 changes: 3 additions & 3 deletions software/nuke/scripts/write/writeNode.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@
#************************
# INIT
#************************
def nodeCreate(currentNode = ""):
def nodeCreate(currentNode=''):

if currentNode == "":
if currentNode == '':
currentNode = nuke.thisNode()

if currentNode["frameRangeMode"].value() != "custom":
Expand All @@ -57,7 +57,7 @@ def openRV (renderPath):
LOG.warning("FOLDER : NOT EXISTS : " + renderPath)
return "WARNING: path doesnt exist: " + renderPath

os.system('start "" "' + 'RV' + '" ' + renderPath)
os.system('start '' "RV" ' + renderPath)
LOG.info("RV : OPEN : " + renderPath)


Expand Down

0 comments on commit ad75993

Please sign in to comment.