Page 1 of 1

Vray Parser update to create thumbnails

Posted: Mon Mar 20, 2017 7:34 pm
by seven11
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)

Re: Vray Parser update to create thumbnails

Posted: Mon Mar 20, 2017 9:12 pm
by timurhai
Hi.
It will be useful to create a pull request on GutHub for such issues.
https://github.com/CGRU/cgru

Re: Vray Parser update to create thumbnails

Posted: Mon Mar 20, 2017 9:49 pm
by seven11
Will do.
Thanks,
Scott

Re: Vray Parser update to create thumbnails

Posted: Mon Nov 20, 2017 5:29 am
by Strob
How does it work? Is it for seeing the thumbnails in the tasks window?
like this?:
Image

Re: Vray Parser update to create thumbnails

Posted: Mon Nov 20, 2017 1:16 pm
by timurhai
It is just work by default and this is all, no special GUI setup needed.
Of course there should be thumbnails.
So afrender should know about images to generate thumbnails.
There are 2 way for it, both can be used together:
- Submission script set "files" parameter to a job block.
- Python parser class can parse out a correct image path.

Re: Vray Parser update to create thumbnails

Posted: Mon Nov 20, 2017 1:24 pm
by Strob
Ok you mean in my submission script I have to add a "files" parameter that tells what the path of the image out is?

And does it work only with jpg? I see only jpg in the example. I render only EXR.

Re: Vray Parser update to create thumbnails

Posted: Mon Nov 20, 2017 1:31 pm
by timurhai
Afrender make thumbnails with an ImageMagick convert utility:
https://www.imagemagick.org/script/convert.php
On Windows it does not understands EXR 'out-of-the-box'.
You should find out does your convert.exe understands exr files, and what to do if it does not.
You our solve this problem (it is solveable) i can write some info about it for others.
Or we can put "correct" convert.exe to the CGRU windows archive.

Re: Vray Parser update to create thumbnails

Posted: Mon Nov 20, 2017 1:44 pm
by Strob
Ok I will try to play with this script to understand it.