oenvoyage / brender

Brender is a distributed rendering solution for the 3D animation suite blender. A new version is developed here :
https://github.com/fsiddi/brender
38 stars 9 forks source link

[Bug] BENCHMARK RESULT 00:00:00 [Problem Found] #16

Closed stephen304 closed 12 years ago

stephen304 commented 12 years ago

SUMMARY IN COMMENT

I just installed brender and tried to use benchmark. On the control panel it says: BENCHMARK RESULT 00:00:00. The same appears in the client console.

I looked back through all the fclose errors and found this:

Notice: Undefined variable: path in H:\wamp\www\brender\functions.php on line 26 3

Call Stack: 0.0010 397136 1. {main}() H:\wamp\www\brender\brender_client.php:0 827.8889 721120 2. get_blender_path() H:\wamp\www\brender\brender_client .php:120

------------------- benchmark renderquery = -b 'blend/benchmark.blend' -o 'rend er/benchmark/stephen3server' -F PNG -f 110 '-b' is not recognized as an internal or external command, operable program or batch file.

INFO stephen3server status : BENCHMARK RESULT 00:00:00

PHP Warning: fopen(logs/stephen3server.log): failed to open stream: No such fil e or directory in H:\wamp\www\brender\functions.php on line 413 PHP Stack trace: PHP 1. {main}() H:\wamp\www\brender\brender_client.php:0 PHP 2. output() H:\wamp\www\brender\brender_client.php:136 PHP 3. brender_log() H:\wamp\www\brender\functions.php:39 PHP 4. fopen() H:\wamp\www\brender\functions.php:413

I'm thinking this is what's causing the render to "complete" in no time. I looked through the functions file and found the switch statement that sets $path depending on the os. If $path isn't being set, then either $GLOBALS['os'] isn't set or it's set to something different than "windows". I could probably temporarily fix this by substituting in the case for windows before the return line on 263. Something is definitely up with that global though.

It's been a while since I used command line so I couldn't remember how to refer to something relatively. (simply copying down the variable set from the windows case left me with a "couldn't find specified path or whatever" error) I just substituted this instead: $path='"H:\wamp\www\brender\blender_bin\windows\blender.exe"'; return $path; Now render time shows as 1 second :D a non-zero value, that's good!

So I did more digging. I found that my $GLOBAL['os'] equals (for some odd reason) ">windows" instead of "windows". Changing the case to account for this, the path doesn't work (as I figured out above). Here is proof that even after accounting for the greater than symbol, the path still needs tweaking:

become order query UPDATE orders set client=stephen3server WHERE id='48594'

INFO stephen3server status : waiting benchmark results

------------------- benchmark renderquery = blender_bin/windows/blender.exe -b ' blend/benchmark.blend' -o 'render/benchmark/stephen3server' -F PNG -f 110 'blender_bin' is not recognized as an internal or external command, operable program or batch file.

INFO stephen3server status : BENCHMARK RESULT 00:00:00

stephen304 commented 12 years ago

Ohjeez thats a big block of text. To sum it up, When adding a client, the os is set to ">windows" instead of "windows" while the case in functions checks for "windows", causing $path to go unset.

I will continue to locate the exact problem and post where it is when I find it. Relative paths for me seem to all be failing so I have also had to change them to absolute paths. This may be a simple error in the way the relative paths were; I will look into it.

stephen304 commented 12 years ago

Lines 122 and 123 of view_client.php should use <?php instead of <? to open php because there are no real benefits to using the short open tag, and this way, people don't have to fiddle with settings or code to get it working.

P.S. That's where the extra ">" was coming from, the raw php being outputted.

stephen304 commented 12 years ago

There are 2 more issues here:

  1. Windows paths must use backslashes otherwise "'blender_bin' is not recognized as an internal or external command, operable program or batch file."
  2. In order for the relative path to work, the user must have also "cd"-ed into the brender main folder before executing "php brender_client.php"

Out of these 3 problems, 2 can be fixed easily (use normal php open tags, use backslashes in windows path). The third is a little more complex. I would like to suggest using a premade batch file (so that command line will be in the main folder already) with a variable for the user to edit to point to their php executable. Another option would be to include a copy of php with the premade batch file for no extra configuration, though I'm not sure what the licensing deal is on that and if that can be legally done.

stephen304 commented 12 years ago

So 1 problem remains; windows won't find the relative path if the user started brender client when cmd was in another folder other than brender main folder. Simple solution would be a premade batch file with a variable for the php directory. (User would paste in the absolute path to php)

stephen304 commented 12 years ago

There is another solution that I thought of. The user could add php and blender to PATH so they can be called from anywhere.