Vray Parser update to create thumbnails

Post Reply
seven11
Posts: 18
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: 280
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.3 Ubuntu 14.04LTS (gcc4.8.4)

seven11
Posts: 18
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

Strob
Posts: 24
Joined: Mon Oct 30, 2017 2:42 pm

Re: Vray Parser update to create thumbnails

Post by Strob » Mon Nov 20, 2017 5:29 am

How does it work? Is it for seeing the thumbnails in the tasks window?
like this?:
Image

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

Re: Vray Parser update to create thumbnails

Post by timurhai » Mon Nov 20, 2017 1:16 pm

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

Strob
Posts: 24
Joined: Mon Oct 30, 2017 2:42 pm

Re: Vray Parser update to create thumbnails

Post by Strob » Mon Nov 20, 2017 1:24 pm

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: 280
Joined: Sun Jan 15, 2017 8:40 pm
Location: Russia, Korolev
Contact:

Re: Vray Parser update to create thumbnails

Post by timurhai » Mon Nov 20, 2017 1:31 pm

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

Strob
Posts: 24
Joined: Mon Oct 30, 2017 2:42 pm

Re: Vray Parser update to create thumbnails

Post by Strob » Mon Nov 20, 2017 1:44 pm

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

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest