Vray Parser update to create thumbnails

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

Vray Parser update to create thumbnails

Post 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)
User avatar
timurhai
Site Admin
Posts: 911
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Vray Parser update to create thumbnails

Post by timurhai »

Hi.
It will be useful to create a pull request on GutHub for such issues.
https://github.com/CGRU/cgru
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
seven11
Posts: 20
Joined: Tue Feb 21, 2017 8:03 pm

Re: Vray Parser update to create thumbnails

Post by seven11 »

Will do.
Thanks,
Scott
Strob
Posts: 24
Joined: Mon Oct 30, 2017 2:42 pm

Re: Vray Parser update to create thumbnails

Post by Strob »

How does it work? Is it for seeing the thumbnails in the tasks window?
like this?:
Image
User avatar
timurhai
Site Admin
Posts: 911
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Vray Parser update to create thumbnails

Post 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.
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
Strob
Posts: 24
Joined: Mon Oct 30, 2017 2:42 pm

Re: Vray Parser update to create thumbnails

Post 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.
User avatar
timurhai
Site Admin
Posts: 911
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Vray Parser update to create thumbnails

Post 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.
Timur Hairulin
CGRU 3.3.1, Ubuntu 20.04, 22.04, MS Windows 10 (clients only).
Strob
Posts: 24
Joined: Mon Oct 30, 2017 2:42 pm

Re: Vray Parser update to create thumbnails

Post by Strob »

Ok I will try to play with this script to understand it.
Post Reply