How to do Multiple passes with Behaviour 2005-06-07 - By Sandy Sutherland
Back Hi All,
Using this code, I get the following message:
InitializeRecord(25);//this set the fps. I'm in PAL hence the 25
global var world = engine.GetCurrentWorld();
global var motion = new DrvMotion(world, "C:\mymotions\\");
list = world.GetActorList("happy");
for(actors = list.First(); actors != nil; actors = list.Next())
{
motion.SubmitActor(actors);
}
motion.StartCapture(0);
**** VM Exception encountered: VME00000007: Operation on 'nil' operand Attempted to get property 'SubmitActor' on a nil object
Yet This works:
var output = "N:/HUTCH_LENNY/Behaviour_DATA/MentalRay/SCRIPT_OUTPUT"; var input = "N:/HUTCH_LENNY/Behaviour_DATA/MentalRay/Colour_Lennys_RenderSetup /Colour_R_SETUP.bvrn"; global var mental = new MentalRay(world, output, input); mental.MapTarget("MY_CORRECT_LENNY_PosRIG", "happy", 0); mental.MapTarget("MY_CORRECT_LENNY_PosRIG1", "happy", 1); mental.MapTarget("MY_CORRECT_LENNY_PosRIG2", "happy", 2); mental.SynchToCamera(TRUE);
list = world.GetActorList("happy"); for(actors = list.First(); actors != nil; actors = list.Next()) { AddFlockActor(actors, "walk", 40, 0);
// reduce the radius to keep them tightly packed // actors.pfd.radius = 0;
// randomize the gait index so the walk cycles aren't in sync actors.fa.ikla.loco.skilltime = MyRand()%333; mental.SubmitActor(actors, Math.Rand()%3);
}
Anyone know why this is, and how I can fix it! All I want to do is populate a Tarrain with a Weightmap, walk these characters around using curves, and do it in such a way that I can do it again using another pass (shadows)!!
My Whole script to create MIs for rendering is this, and it works OK!
use constants "drive_constants";
function main() { engine.RunScript("rtk", nil);
global var world = engine.GetCurrentWorld();
global var flock = new DrvFlock(0.3);
DeleteActors("happy");
var list = new List(); var actors = new Array(2); actors[0] = "happy"; actors[1] = "happy"; var ground = Actor("GRND060").GetNodeByName("ground"); Populate(ground, 100, actors, 5, 0.2, 0.5, list, FALSE); OrientActors(list, new DrvVector(0,0,1000));
var floor = Actor("GRND060").GetNodeByName("Floor"); var curves = Actor("GRND060").GetNodeByName("ground");
SceneGoalFlock(flock); var output = "N:/HUTCH_LENNY/Behaviour_DATA/MentalRay/SCRIPT_OUTPUT"; var input = "N:/HUTCH_LENNY/Behaviour_DATA/MentalRay/Colour_Lennys_RenderSetup /Colour_R_SETUP.bvrn"; global var mental = new MentalRay(world, output, input); mental.MapTarget("MY_CORRECT_LENNY_PosRIG", "happy", 0); mental.MapTarget("MY_CORRECT_LENNY_PosRIG1", "happy", 1); mental.MapTarget("MY_CORRECT_LENNY_PosRIG2", "happy", 2); mental.SynchToCamera(TRUE);
list = world.GetActorList("happy"); for(actors = list.First(); actors != nil; actors = list.Next()) { AddFlockActor(actors, "walk", 40, 0);
// randomize the gait index so the walk cycles aren't in sync actors.fa.ikla.loco.skilltime = MyRand()%333; mental.SubmitActor(actors, Math.Rand()%3);
}
flock.CreateCurveFunction(0, floor, 400, 400, 0, 20, curves);
InitializeRecord(25);
world.AddPiccoloActivityByName("update"); global var tick = 0;
}
function update(act, time, obj) { Console.PrintNl(tick++); if(tick == 200) mental.StartCapture("out", "image"); else if(tick == 231) { mental.Close("render.bat", "-verbose on"); RuntimeStop(); } }
Thanks
S. -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- Sandy Sutherland Digital Doodeller - TD The Refinery (Cape) http://www.refinery.co.za mailto:sandy@(protected) (P) (+27 21) 480 3132 (F) (+27 21) 480 3101 -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=Content-Type content="text/html; charset=iso-8859 (See http://iso-8859.ora-code.com)-1"> <META content="MSHTML 6.00.2800.1106" name=GENERATOR> <STYLE>@(protected) { font-family: Tahoma; } @(protected) Section1 {size: 612.0pt 792.0pt; margin: 72.0pt 89.85pt 72.0pt 15.05pt; } P.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman" } LI.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman" } DIV.MsoNormal { FONT-SIZE: 12pt; MARGIN: 0cm 0cm 0pt; FONT-FAMILY: "Times New Roman" } A:link { COLOR: blue; TEXT-DECORATION: underline } SPAN.MsoHyperlink { COLOR: blue; TEXT-DECORATION: underline } A:visited { COLOR: blue; TEXT-DECORATION: underline } SPAN.MsoHyperlinkFollowed { COLOR: blue; TEXT-DECORATION: underline } SPAN.emailstyle17 { COLOR: navy; FONT-FAMILY: Arial } SPAN.EmailStyle18 { COLOR: navy; FONT-FAMILY: Arial } DIV.Section1 { page: Section1 } </STYLE> </HEAD> <BODY lang=EN-US vLink=blue link=blue bgColor=white> <DIV><FONT face=Arial size=2>Hi All,</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Using this code, I get the following message:</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">InitializeRecord(25);/ /this set the fps. Im in PAL hence the 25</SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">global var world = engine.GetCurrentWorld();</SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">global var motion = new DrvMotion(world, "C:\mymotions\\");</SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> < /P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">list = world.GetActorList(happy);</SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> < /P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">for(actors = list.First(); actors != nil; actors = list.Next()) </SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">{ </SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> motion.SubmitActor(actors);</SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">}</SPAN></FONT></P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> < /P> <P class=MsoNormal><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">motion.StartCapture(0) ;</SPAN></FONT></P></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial color=#ff0000 size=2>**** VM Exception encountered: VME00000007: Operation on 'nil' operand<BR>Attempted to get property 'SubmitActor' on a nil object</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Yet This works:</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2> </FONT><EM><FONT face=Arial color=#000080 size=2>var output = "N:/HUTCH_LENNY/Behaviour_DATA/MentalRay/SCRIPT_OUTPUT"; <BR> var input = "N:/HUTCH_LENNY/Behaviour_DATA/MentalRay/Colour_Lennys_RenderSetup/Colour_R _SETUP.bvrn"; <BR> global var mental = new MentalRay(world, output, input); <BR> <BR> mental.MapTarget("MY_CORRECT_LENNY_PosRIG", "happy", 0); <BR> mental.MapTarget("MY_CORRECT_LENNY_PosRIG1", "happy", 1) ; <BR> mental.MapTarget("MY_CORRECT_LENNY_PosRIG2", "happy", 2); <BR> mental.SynchToCamera(TRUE); </FONT></EM></DIV> <DIV><EM><FONT face=Arial color=#000080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#000080 size=2><EM> list = world.GetActorList("happy");<BR> for(actors = list.First(); actors != nil; actors = list.Next())<BR> {<BR> AddFlockActor(actors, "walk", 40, 0);</EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#000080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#000080 size=2><EM> // reduce the radius to keep them tightly packed<BR> // actors.pfd.radius = 0;</EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#000080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#000080 size=2><EM> // randomize the gait index so the walk cycles aren't in sync<BR> actors.fa.ikla.loco.skilltime = MyRand()%333;<BR> mental.SubmitActor(actors, Math.Rand()%3);</EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#000080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#000080 size=2><EM> }</EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#000080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial size=2>Anyone know why this is, and how I can fix it! All I want to do is populate a Tarrain with a Weightmap, walk these characters around using curves, and do it in such a way that I can do it again using another pass (shadows)!!</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>My Whole script to create MIs for rendering is this, and it works OK!</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial color=#808080 size=2><EM>use constants "drive_constants";</EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#808080 size=2><EM>function main()<BR>{<BR> engine.RunScript("rtk", nil);</EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#808080 size=2><EM> global var world = engine.GetCurrentWorld();</EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#808080 size=2><EM> global var flock = new DrvFlock(0.3);</EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#808080 size=2><EM> DeleteActors("happy"); </EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#808080 size=2><EM> var list = new List();<BR> var actors = new Array(2);<BR> actors[0] = "happy"; <BR> actors[1] = "happy"; <BR> var ground = Actor("GRND060").GetNodeByName("ground"); <BR> <BR> Populate(ground, 100, actors, 5, 0.2, 0.5, list, FALSE); <BR> OrientActors(list, new DrvVector(0,0,1000)); </EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#808080 size=2><EM> var floor = Actor("GRND060").GetNodeByName("Floor");<BR> var curves = Actor("GRND060").GetNodeByName("ground");</EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#808080 size=2><EM> SceneGoalFlock(flock); <BR> <BR> var output = "N:/HUTCH_LENNY/Behaviour_DATA/MentalRay/SCRIPT_OUTPUT"; <BR> var input = "N:/HUTCH_LENNY/Behaviour_DATA/MentalRay/Colour_Lennys_RenderSetup/Colour_R _SETUP.bvrn"; <BR> global var mental = new MentalRay(world, output, input); <BR> <BR> mental.MapTarget("MY_CORRECT_LENNY_PosRIG", "happy", 0); <BR> mental.MapTarget("MY_CORRECT_LENNY_PosRIG1", "happy", 1); <BR> mental.MapTarget("MY_CORRECT_LENNY_PosRIG2", "happy", 2); <BR> mental.SynchToCamera(TRUE); </EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#808080 size=2><EM> list = world.GetActorList("happy");<BR> for(actors = list.First(); actors != nil; actors = list.Next())<BR> {<BR> AddFlockActor(actors, "walk", 40, 0);</EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#808080 size=2><EM> // randomize the gait index so the walk cycles aren't in sync<BR> actors.fa.ikla.loco.skilltime = MyRand()%333;<BR> mental.SubmitActor(actors, Math.Rand()%3);</EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#808080 size=2><EM> }</EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#808080 size=2><EM> flock.CreateCurveFunction(0, floor, 400, 400, 0, 20, curves); </EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial color=#808080 size=2><EM> InitializeRecord(25);</EM></FONT></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV><FONT> <DIV><BR><EM><FONT face=Arial color=#808080 size=2> world.AddPiccoloActivityByName("update"); <BR> global var tick = 0; </FONT></EM></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><BR><EM><FONT face=Arial color=#808080 size=2>}</FONT></EM></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><EM><FONT face=Arial color=#808080 size=2> function update(act, time , obj) <BR> { <BR> Console.PrintNl(tick++); <BR> <BR> if(tick == 200) <BR> mental.StartCapture("out", "image");<BR> else if(tick == 231) <BR> { <BR> mental.Close("render.bat", "-verbose on");<BR> RuntimeStop(); <BR> } <BR> }</FONT></EM></DIV> <DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM> </DIV> <DIV><FONT face=Arial size=2>Thanks</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>S.</FONT></FONT></DIV> <DIV>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----<BR>Sandy Sutherland Digital Doodeller - TD<BR>The Refinery (Cape) <A href="http://www.refinery.co.za">http://www.refinery.co.za</A><BR><A href="mailto:sandy@(protected)">mailto:sandy@(protected)</A><BR>(P) (+27 21) 480 3132 (F) (+27 21) 480 3101<BR>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----<BR></DIV> <BLOCKQUOTE dir=ltr style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"><FONT face=Arial size=2></FONT> </BLOCKQUOTE></BODY></HTML>
|
|