Maya to Vray Parser update to show camera layers...

Post Reply
seven11
Posts: 18
Joined: Tue Feb 21, 2017 8:03 pm

Maya to Vray Parser update to show camera layers...

Post by seven11 » Mon Mar 20, 2017 8:04 pm

Hi Timur,
This update is to the mayatovray parser to show the camera layer count as it converts the maya scene file to a vrscene file.
Great to have when you are doing multipass rendering of large sequences.
-Scott

afanasy/python/parsers/mayatovray.py

Code: Select all

# -*- coding: utf-8 -*-

from parsers import parser

FRAME = 'Appending '
RESET_COUNT = 'Render complete'
PERCENT = 'PROGRESS: '
PERCENT_len = len(PERCENT)

class mayatovray(parser.parser):
	"""Simple generic parser (mayatovray)
	"""

	def __init__(self):
		parser.parser.__init__(self)
		self.firstframe = True
		self.layer = 1

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

		:param data:
		:param mode:
		:return:
		"""
		# print(data)
		needcalc = False
		if data.find(FRAME) > -1:
			if self.firstframe:
				self.firstframe = False
			else:
				self.frame += 1
				self.activity = 'Layer ' + str(self.layer) + ':'
				needcalc = True
		if data.find(RESET_COUNT) > -1:
			self.layer += 1
			self.firstframe = True
			self.frame = 0
		percent_pos = data.find(PERCENT)
		if percent_pos > -1:
			ppos = data.find('%')
			if ppos > -1:
				needcalc = True
				self.percentframe = int(data[percent_pos + PERCENT_len:ppos])
		if needcalc:
			self.calculate()

User avatar
timurhai
Site Admin
Posts: 384
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Maya to Vray Parser update to show camera layers...

Post by timurhai » Mon Mar 20, 2017 9:12 pm

Hi.
It will be useful to create a pull request on GutHub for such issues.
https://github.com/CGRU/cgru
Timur Hairulin
CGRU 2.3.0 Debian 9, Ubuntu 18.04LTS, MS Windows 7,10 (client only).

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest