PDA

View Full Version : Jeremy Hardin bg_render LW11



geo_n
06-09-2012, 01:05 AM
Seems its not working with lw 11 new folder directory.


//-----------------------------------
//Render Current Frame in BG INTEL 0.1
//by Jeremy Hardin
//[email protected]

@warnings
@name "BG Render Frame"
@asyncspawn



platform_var;

generic
{


platform_var = platform();
if(platform_var == 1)
{
pc_render_current_lwsn();
}
if(platform_var == 5)
{
mac_render_current_lwsn();
}


//end generic
}

//-------------------------------------------------
//-------------------------------------------------
//Begin Custom Function portion of the script here




pc_render_current_lwsn
{

install_dir = getdir("Install");
content_dir = getdir("Content");
temp_dir = getdir("Temp");
config_dir = getdir("Settings");
currentscene_path = Scene().filename;
currentscene_patharray = split(currentscene_path);
currentscene_filename = currentscene_patharray[3] + currentscene_patharray[4];
currenttime = Scene().currenttime;
currentframe = Scene().currenttime*Scene().fps;
commandadd = "'''" + install_dir + getsep() + "lwsn.exe''' -3 -c'''" + config_dir + "''' -d'''" + content_dir + "''' '''" + currentscene_path + "''' " + currentframe + " " + currentframe + " 1";
chdir(temp_dir);
output = File("render_current_lwsn_temp.bat","w");
output.writeln(commandadd);
output.close();
input = File("render_current_lwsn_temp.bat","r");
output = File("render_current_lwsn.bat","w");

while(!input.eof())
{
line = input.read();
line ~= r~'''~"~;
output.writeln(line);
}
input.close();
output.close();
result = spawn("render_current_lwsn.bat");
chdir(content_dir);



//end pc_render_current_lwsn
}


mac_render_current_lwsn
{
error("You're trying to use the PC version. Download the Mac version.");

//end mac_render_current_lwsn
}



//-----------------------------------
//Render Sequence in BG INTEL 0.1
//by Jeremy Hardin
//[email protected]

@warnings
@name "BG Render Scene"
@asyncspawn



platform_var;

generic
{
platform_var = platform();
if(platform_var == 1)
{

pc_render_seq_lwsn();
}
if(platform_var == 5)
{
mac_render_seq_lwsn();
}


//end generic
}

//-------------------------------------------------
//-------------------------------------------------
//Begin Custom Function portion of the script here


pc_render_seq_lwsn
{

install_dir = getdir("Install");
content_dir = getdir("Content");
temp_dir = getdir("Temp");
config_dir = getdir("Settings");
currentscene_path = Scene().filename;
currentscene_patharray = split(currentscene_path);
currentscene_filename = currentscene_patharray[3] + currentscene_patharray[4];
currenttime = Scene().currenttime;
currentframe = Scene().currenttime*Scene().fps;
commandadd = "'''" + install_dir + getsep() + "lwsn.exe''' -3 -c'''" + config_dir + "''' -d'''" + content_dir + "''' '''" + currentscene_path + "''' " + Scene().renderstart + " " + Scene().renderend + " " + Scene().renderstep;
chdir(temp_dir);
output = File("render_current_lwsn_temp.bat","w");
output.writeln(commandadd);
output.close();
input = File("render_current_lwsn_temp.bat","r");
output = File("render_current_lwsn.bat","w");

while(!input.eof())
{
line = input.read();
line ~= r~'''~"~;
output.writeln(line);
}
input.close();
output.close();

result = spawn("render_current_lwsn.bat");
chdir(content_dir);



//end pc_render_seq_lwsn
}


mac_render_seq_lwsn
{
error("You're trying to use the PC version. Download the Mac version.");


//end mac_render_seq_lwsn
}

Sensei
06-10-2012, 08:01 PM
If code doesn't work programmer should put code to show e.g. some requester window every line. Then execution is break, you have to accept every line, and you see to which line code is going fine and at which fails. And you can fix wrong one..

Try using
info("1");
2, 3.. etc

geo_n
06-10-2012, 11:07 PM
If code doesn't work programmer should put code to show e.g. some requester window every line. Then execution is break, you have to accept every line, and you see to which line code is going fine and at which fails. And you can fix wrong one..

Try using
info("1");
2, 3.. etc

sorry sensei, don't know anything about code.
info("1") ?

Jim M
06-13-2012, 03:14 AM
I think he suggesting you n++ that mfo and place the cmd info("n"); after every line of code in the script, so when it goes wrong it will stop at at certain number and you will see where on screen. Then you can diagnose from there.