Vray Parser update to create thumbnails

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

Vray Parser update to create thumbnails

Post by seven11 » Mon Mar 20, 2017 7:34 pm

Hi Timur,
We use this all the time for creating the thumbnails for Vray 3.40 renders.
Didn't know how to get it to you.
-Scott


afanasy/python/parsers/vray.py

Code: Select all

from parsers import parser

import re

re_frame = re.compile(
	r'SCEN.*(progr: begin scene preprocessing for frame )([0-9]+)'
)
re_number = re.compile(r'[0-9]+')
re_percent = re.compile(
	r'Rendering image...:([ ]{,})([0-9]{1,2}.*)(%[ ]{,}).*'
)
IMAGE = r'Successfully written image file '


class vray(parser.parser):
	"""VRay Standalone
	"""

	def __init__(self):
		parser.parser.__init__(self)
		self.buffer = ""
		self.numinseq = 0

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

		:param data:
		:param mode:
		:return:
		"""
		# self.buffer += data
		# needcalc = False
		# frame = False

		if len(data) < 1:
			return

		lines = data.split('\n')
		for line in lines:
			pattern = re.compile(IMAGE)
			res = pattern.search(line)
			if res != None:
				quotes = re.split("\"", line)
				if quotes[1] != "":
					self.appendFile(quotes[1].strip())


		match = re_percent.findall(data)
		if len(match):
			percentframe = float(match[-1][1])
			self.percent = int(percentframe)

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

Re: Vray Parser update to create thumbnails

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.2.2 Ubuntu 14.04LTS (gcc4.8.4)

seven11
Posts: 15
Joined: Tue Feb 21, 2017 8:03 pm

Re: Vray Parser update to create thumbnails

Post by seven11 » Mon Mar 20, 2017 9:49 pm

Will do.
Thanks,
Scott

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest