How to do Multiple passes with Behaviour 2005-06-07 - By Aloys Baillet
Back Hi Sandy,
The error you get means that DrvMotion is not properly initialized. You could check if this works: global var motion = new DrvMotion(world, "C:\\mymotions\\"); and be sure that the mymotion dir exists! Hope this helps... and good luck!
Aloys
On 6/7/05, Sandy Sutherland <sandy@(protected)> wrote: > > 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) <sandy@(protected)> > (P) (+27 21) 480 3132 (F) (+27 21) 480 3101 > -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- ----- > >
-- Aloys Baillet - Character TD @ Animal Logic
Hi Sandy,<br> <br> The error you get means that DrvMotion is not properly initialized.<br> You could check if this works:<br> <span class="q"><font color="navy" face="Arial" size="2"><span style="font-size : 10pt; color: navy; font-family: Arial;">global var motion = new DrvMotion(world, "C:\\mymotions\\");</span></font></span><br>and be sure that the mymotion dir exists!<br> Hope this helps... and good luck!<br> <br> Aloys<br> <br><div><span class="gmail_quote">On 6/7/05, <b class="gmail_sendername">Sandy Sutherland</b> <<a href="mailto:sandy@(protected)">sandy@(protected)< /a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<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><span class="q"> <p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color : navy; font-family: Arial;">InitializeRecord(25);//this set the fps. I'm in PAL hence the 25</span></font></p> <p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color : navy; font-family: Arial;">global var world = engine.GetCurrentWorld();</span></font></p> <p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color : navy; font-family: Arial;">global var motion = new DrvMotion(world, "C:\mymotions\\");</span></font></p> <p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color : navy; font-family: Arial;"></span></font> </p></span> <p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color : navy; font-family: Arial;">list = world.GetActorList("happy");</span></font></p> <p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color : navy; font-family: Arial;"></span></font> </p> <p><font color="navy" face="Arial" 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><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color : navy; font-family: Arial;">{ </span></font></p> <p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color : navy; font-family: Arial;"> motion.SubmitActor(actors);</span></font></p> <p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color : navy; font-family: Arial;">}</span></font></p> <p><font color="navy" face="Arial" size="2"><span style="font-size: 10pt; color : navy; font-family: Arial;"></span></font> </p> <p><font color="navy" face="Arial" 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 color="#ff0000" face="Arial" 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 color="#000080" face= "Arial" 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 color="#000080" face="Arial" size="2"></font></em> </div> <div><font color="#000080" face="Arial" 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 color="#000080" face="Arial" size="2"></font></em> </div> <div><font color="#000080" face="Arial" size="2"><em> // reduce the radius to keep them tightly packed<br> // actors.pfd.radius = 0;</em></font></div> <div><em><font color="#000080" face="Arial" size="2"></font></em> </div> <div><font color="#000080" face="Arial" 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 color="#000080" face="Arial" size="2"></font></em> </div> <div><font color="#000080" face="Arial" size="2"><em> }</em></font></div> <div><em><font color="#000080" face="Arial" 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 color="#808080" face="Arial" size="2"><em>use constants "drive_constants";</em></font></div> <div><em><font color="#808080" face="Arial" size="2"></font></em> </div> <div><font color="#808080" face="Arial" size="2"><em>function main()<br>{<br> engine.RunScript("rtk", nil);</em></font>< /div><span class="q"> <div><em><font color="#808080" face="Arial" size="2"></font></em> </div> <div><font color="#808080" face="Arial" size="2"><em> global var world = engine.GetCurrentWorld();</em></font></div> <div><em><font color="#808080" face="Arial" size="2"></font></em> </div>< /span> <div><font color="#808080" face="Arial" size="2"><em> global var flock = new DrvFlock(0.3);</em></font></div> <div><em><font color="#808080" face="Arial" size="2"></font></em> </div> <div><font color="#808080" face="Arial" size="2"><em> DeleteActors(" ;happy"); </em></font></div> <div><em><font color="#808080" face="Arial" size="2"></font></em> </div> <div><font color="#808080" face="Arial" 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 color="#808080" face="Arial" size="2"></font></em> </div> <div><font color="#808080" face="Arial" size="2"><em> var floor = Actor("GRND060").GetNodeByName("Floor");<br> var curves = Actor("GRND060").GetNodeByName("ground");</em></font></div> <div><em><font color="#808080" face="Arial" size="2"></font></em> </div> <div><font color="#808080" face="Arial" 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 color="#808080" face="Arial" size="2"></font></em> </div> <div><font color="#808080" face="Arial" 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 color="#808080" face="Arial" size="2"></font></em> </div> <div><font color="#808080" face="Arial" 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 color="#808080" face="Arial" size="2"></font></em> </div> <div><font color="#808080" face="Arial" size="2"><em> }</em></font></div> <div><em><font color="#808080" face="Arial" size="2"></font></em> </div> <div><font color="#808080" face="Arial" size="2"><em> flock .CreateCurveFunction(0, floor, 400, 400, 0, 20, curves); </em></font></div> <div><em><font color="#808080" face="Arial" size="2"></font></em> </div> <div><font color="#808080" face="Arial" size="2"><em> InitializeRecord(25) ;</em></font></div> <div><em><font color="#808080" face="Arial" size="2"></font></em> </div> <font> </font><div><font><br><em><font color="#808080" face="Arial" size="2">  ;world.AddPiccoloActivityByName("update"); <br> global var tick = 0; </font></em></font></div> <div><font><em><font color="#808080" face="Arial" size="2"></font></em> < /font></div> <div><font><br><em><font color="#808080" face="Arial" size="2">}</font></em>< /font></div> <div><font><em><font color="#808080" face="Arial" size="2"></font></em> < /font></div> <div><font><em><font color="#808080" face="Arial" 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></font></div> <div><font><em><font color="#808080" face="Arial" size="2"></font></em> < /font></div> <div><font><font face="Arial" size="2">Thanks</font></font></div><font><span class="sg"> <div><font face="Arial" size="2"></font> </div> <div><font face="Arial" size="2">S.</font></div></span></font><div><span class= "e" id="q_10455febf09f076c_7"> <div>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----<br>Sandy Sutherland Digital Doodeller - TD<br>The Refinery (Cape) <a href="http://www.refinery.co.za" target="_blank" onclick= "return top.js.OpenExtLink(window,event,this)">http://www.refinery.co.za</a><br> <a href="mailto:sandy@(protected)" target="_blank" onclick="return top.js .OpenExtLink(window,event,this)"> mailto:sandy@(protected)</a><br>(P) (+27 21) 480 3132 (F) (+27 21) 480 3101<br>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----<br></div> <blockquote style="border-left: 2px solid rgb(0, 0, 0); padding-right: 0px; padding-left: 5px; margin-left: 5px; margin-right: 0px;" dir="ltr"><font face= "Arial" size="2"></font> </blockquote>
</span></div></blockquote></div><br><br><br>-- <br>Aloys Baillet - Character TD @ Animal Logic
|
|