Skip to content

Commit

Permalink
New: Added Maya Redshift support.
Browse files Browse the repository at this point in the history
  • Loading branch information
eoyilmaz committed Mar 20, 2017
1 parent 95f4328 commit 6fc2879
Show file tree
Hide file tree
Showing 8 changed files with 91 additions and 3 deletions.
5 changes: 3 additions & 2 deletions README.md
Expand Up @@ -58,8 +58,9 @@ As if you miss one '=' character, it will not be an error, it will be assignment
return true;
}

You can notice, that some parts of the code is not following this rules.
This is mostly because such code was written before this rules or rules were changed.
You will notice, that some parts of the code is not following these rules. This
is mostly because such code has been written before these rules were created or
changed.


### Some names:
Expand Down
1 change: 1 addition & 0 deletions afanasy/farm_example.json
Expand Up @@ -84,6 +84,7 @@
{"name":"maya_delight"},
{"name":"maya_mental"},
{"name":"maya_arnold"},
{"name":"maya_redshift"},
{"name":"mayatoarnold"},
{"name":"mayatomr"},
{"name":"mayatovray"},
Expand Down
2 changes: 2 additions & 0 deletions afanasy/python/afjob.py
Expand Up @@ -576,6 +576,8 @@ def integer(string):
scenetype = 'maya_delight'
elif blocktype == 'maya_arnold':
scenetype = 'maya_arnold'
elif blocktype == 'maya_redshift':
scenetype = 'maya_redshift'
else:
blocktype = 'maya'
scenetype = 'maya'
Expand Down
64 changes: 64 additions & 0 deletions afanasy/python/parsers/maya_redshift.py
@@ -0,0 +1,64 @@
# -*- coding: utf-8 -*-

from parsers import parser

import re

# INFO : [Redshift] Block 32/48 (7,4) rendered by GPU 0 in 2ms
re_percent = re.compile(
r'(Block*)(\s*)(\d*)(\/)(\d*)(\s*)(\S*)(\s*)(rendered by GPU)'
)
re_frame = re.compile(r'Rendering frame [0-9]+')


class maya_redshift(parser.parser):
"""Maya Redshift
"""

def __init__(self):
parser.parser.__init__(self)
self.firstframe = True
self.data_all = ''

def do(self, data, mode):
"""Missing DocString
:param data:
:param mode:
:return:
"""

if len(data) < 1:
return

frame = False
block = 0
blockCount = 0

match = re_frame.search(data)
if match is not None:
frame = True

# print("cur frame " + str(self.frame))


# progress line?
match = re_percent.findall(data)
if len(match):
# get current block
block = float(match[0][2])
# get blockCount
blockCount = float(match[0][4])

# calculate percentage
percentframe = float(100 / (blockCount / block))
self.percent = int(percentframe)
self.percentframe = int(percentframe)

self.calculate()

if frame:
if not self.firstframe:
self.frame += 1

self.firstframe = False
10 changes: 10 additions & 0 deletions afanasy/python/services/maya_redshift.py
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-
from services import service

parser = 'maya_redshift'


class maya_redshift(service.service):
"""Redshift
"""
pass
Binary file added icons/software/maya_redshift.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 6 additions & 1 deletion plugins/maya/afanasy/__init__.py
Expand Up @@ -331,9 +331,14 @@ def launch(self, *args, **kwargs):
cmd_buffer.append('-type maya_mental')
elif render_engine == 'arnold':
cmd_buffer.append('-type maya_arnold')
# set the verbosity level to warnin+info
# set the verbosity level to warning+info
aro = pm.PyNode('defaultArnoldRenderOptions')
aro.setAttr('log_verbosity', 1)
elif render_engine == 'redshift':
cmd_buffer.append('-type maya_redshift')
# set the verbosity level to detailed+info
redshift = pm.PyNode('redshiftOptions')
redshift.logLevel.set(1)

if pause:
cmd_buffer.append('-pause')
Expand Down
5 changes: 5 additions & 0 deletions utilities/afstarter/afstarter.py
Expand Up @@ -68,6 +68,7 @@ def fileTypeList():
fileType_list.append((['mb', 'ma'], 'maya', 'Maya'))
fileType_list.append((['mb', 'ma'], 'maya_mental', 'Mental Ray'))
fileType_list.append((['mb', 'ma'], 'maya_arnold', 'MtoA'))
fileType_list.append((['mb', 'ma'], 'maya_redshift', 'Redshift'))
fileType_list.append((['mb', 'ma'], 'maya_delight', '3Delight'))
fileType_list.append((['scn'], 'xsi', 'Softimage'))
fileType_list.append((['max'], 'max', '3dsmax'))
Expand Down Expand Up @@ -120,6 +121,7 @@ def labelNodeNameDict():
labelNode_name['maya_delight'] = 'Camera:'
labelNode_name['maya_mental'] = 'Camera:'
labelNode_name['maya_arnold'] = 'Camera:'
labelNode_name['maya_redshift'] = 'Camera:'
labelNode_name['3dsmax'] = 'Camera:'
labelNode_name['afterfx'] = 'Composition:'
labelNode_name['clarisse'] = 'Image:'
Expand All @@ -141,6 +143,7 @@ def labelNodeTooltipsDict():
labelNode_tooltip['maya_delight'] = 'Maya camera\nExample: \'persp\''
labelNode_tooltip['maya_mental'] = 'Maya camera\nExample: \'persp\''
labelNode_tooltip['maya_arnold'] = 'Maya camera\nExample: \'persp\''
labelNode_tooltip['maya_redshift'] = 'Maya camera\nExample: \'persp\''
labelNode_tooltip['3dsmax'] = '3DSMAX camera'
labelNode_tooltip['afterfx'] = 'AfterFX composition\nExample: \'Comp 1\''
labelNode_tooltip['clarisse'] = 'Image item path\nExample:\nscene/image'
Expand All @@ -158,6 +161,7 @@ def labelTakeNameDict():
labelTake_name['maya_delight'] = 'Render Pass:'
labelTake_name['maya_mental'] = 'Layer:'
labelTake_name['maya_arnold'] = 'Layer:'
labelTake_name['maya_redshift'] = 'Layer:'
labelTake_name['3dsmax'] = 'Batch:'
labelTake_name['afterfx'] = 'render settings template:'
labelTake_name['clarisse'] = 'Format:'
Expand All @@ -180,6 +184,7 @@ def labelTakeTooltipsDict():
labelTake_tooltip['maya_delight'] = '3Delight for Maya Render Pass'
labelTake_tooltip['maya_mental'] = 'Maya render layer'
labelTake_tooltip['maya_arnold'] = 'Maya render layer'
labelTake_tooltip['maya_redshift'] = 'Maya render layer'
labelTake_tooltip['3dsmax'] = '3DSMAX batch'
labelTake_tooltip['afterfx'] = 'AfterFX render settings template\nExample: \'Best Settings\''
labelTake_tooltip['clarisse'] = 'Ouput images format name\nExample:\njpg, exr16, exr32, ...\nSee available format names in docs.'
Expand Down

0 comments on commit 6fc2879

Please sign in to comment.