Author Topic: Problem determining Maya version when rendering (and solution)  (Read 10366 times)

arenyart

  • Full Member
  • ***
  • Posts: 23
This is a strange issue that I finally figured out the cause.  It is less of a qube issue and more of a Maya issue.  Maya sometimes places the file info section of a Maya Ascii file below the file referencing instructions.  The result is that Qube can't figure out which version of Maya to use from the file and uses the first line in the path of the farm machines.   This wasn't a huge deal until we moved several files from maya 7 to 8.5.  They retained this bad structure which prevented Qube from rendering with Maya 8.5---which is bad.   I bashed my head against a wall for a while trying to figure this out but now that I know how to fix it I thought I would share.  I just open the Maya files in a text editor and move the "requires maya "... and "fileInfo" section under the initial comments and then it works.  To avoid this problem in the future, maybe Qube could implement some kind of text processing that would search the file for the (requires maya "version") section  instead of assuming that it is the first uncommented line. 

eric

  • Hero Member
  • *****
  • Posts: 229
Re: Problem determining Maya version when rendering (and solution)
« Reply #1 on: August 25, 2007, 12:19:27 AM »
Typically, our routine searches through the first 1K of the file to try to find the "version" string in the requires clause. It gets pretty expensive to try to parse through an entire scenefile for that one string, so that's why we limit it.

Is it possible your requires clause was more than 1024 characters into the file?

arenyart

  • Full Member
  • ***
  • Posts: 23
Re: Problem determining Maya version when rendering (and solution)
« Reply #2 on: September 04, 2007, 06:28:24 PM »
Yes, it was after the file reference section which was more than 1k.  Its good to know how it works, thanks.  Given the expense (in time) of it searching for the maya version versus the expense in time in not rendering correctly, I wouldn't mind the former.  Is there any way you could tell me where it parses that 1k of the maya file so I can change it accordingly.  Maybe it could "search" until it finds the maya version, which in most cases wouldn't take long, and in those aggravating cases where it isn't in the first 1k, it would keep searching.  Thanks for the help.

eric

  • Hero Member
  • *****
  • Posts: 229
Re: Problem determining Maya version when rendering (and solution)
« Reply #3 on: September 04, 2007, 11:14:33 PM »
Look at jobtypes/maya/Utils.pm around line 43:

Code: [Select]
if ($buffer =~ /version.[\" ]*(\d+\.\d+)/) {
$ver = $1;
last;
} elsif (length($buffer) > 1024) {
# terminate at 1K
last;
}

arenyart

  • Full Member
  • ***
  • Posts: 23
Re: Problem determining Maya version when rendering (and solution)
« Reply #4 on: September 11, 2007, 09:21:12 PM »
Thank you.