AWS Thinkbox Discussion Forums

help with regex

Hi guys, I think I need your help to find what is wrong with this regex I wrote.



I ha writen a pre and post frame script for Maya that is executed everytime a task is rendered by the slave, in this script I print the frame being rendered and when the frame is finished.



In this pre script I also run a procedure that updates the computer when needed, copying files, scripts, etc. I am doing this update using Mel, so the update is done through Deadline Slave.



Everytime this update runs, I get this error: ““SetProgress”:bad lexical cast:”



Here the full log:

0: STDOUT: -Windows DLL-

0: STDOUT: Destination: C:\Autodesk32\Maya8.5\bin<br>
0: STDOUT: \Isilon\alpha\data\shared_maya_folder\shared_scripts\AVscripts\AVonMayaInit_files\8.5\winDLL\msvcp71.dll

0: STDOUT:

0: STDOUT: \Isilon\alpha\data\shared_maya_folder\shared_scripts\AVscripts\AVonMayaInit_files\8.5\winDLL\msvcp80.dll

0: STDOUT:

0: STDOUT: \Isilon\alpha\data\shared_maya_folder\shared_scripts\AVscripts\AVonMayaInit_files\8.5\winDLL\msvcr80.dll

0: STDOUT:

0: STDOUT: \Isilon\alpha\data\shared_maya_folder\shared_scripts\AVscripts\AVonMayaInit_files\8.5\winDLL\msvcp70.dll

0: STDOUT:

0: STDOUT: \Isilon\alpha\data\shared_maya_folder\shared_scripts\AVscripts\AVonMayaInit_files\8.5\winDLL\msvcr70.dll

0: STDOUT:

0: STDOUT: Sharing violation

0: STDOUT:

---- July 13 2007 – 08:09 AM ----

Scheduler Thread - Render Thread 0 threw an error:

Scheduler Thread - Exception during render: Error calling “SetProgress”:bad lexical cast: source type value could not be interpreted as target



I am suspecting that one of the progress handling regex is causing this problem.



I have added to the Progress Handling my own one for mentla ray, Right now I commented it out to figure out if this one is the cause of the problem. Maybe you can look at it and quickly find a problem with it. Here is my regex:



; Progress updates for Mental Ray, works when rendering multiple frames per chunk.

;OutputRegEx15=Rendering Frame ([0-9]+) .

;OutputRule15=LogInfo( “Percentage done " … 100 * ( (GetRegExMatch(1) - 1) - StartFrame() + 1 ) / ( EndFrame() - StartFrame() + 1 ) …”%" ); SetProgress( 100 * ( (GetRegExMatch(1) - 1) - StartFrame() + 1 ) / ( EndFrame() - StartFrame() + 1 ) );

;OutputRegEx16=([0-9]+) .


;OutputRule16=SetProgress( "Percentage done " … GetRegExMatch(1) );



Thanks





Sylvain Berger | Technical Director | Alpha Vision


So since I commented my regex, the problem is gone. So the problem seems to be in my regex :frowning:







Sylvain Berger | Technical Director | Alpha Vision


Hey Sylvain,



I think the problem is with your OutputRule16 line:



OutputRule16=SetProgress( "Percentage done " … GetRegExMatch(1) );





SetProgress is expecting a value that it can convert to a number, but

it’s being passed the string "Percentage done " followed by the number

value. That’would explain why the casting would fail. If you change the

line to the following, I would expect it to work:



OutputRule16=SetProgress( GetRegExMatch(1) );





Give it a try and let us know if you have any luck!



Cheers,

That makes so much sense.



I don’t understand why it is not crashing all the time though… Why would that error just crash when my update script runs is beyond me.



But anyway, thanks a lot for the help.



Sylvain Berger | Technical Director | Alpha Vision


Privacy | Site terms | Cookie preferences