How to do Multiple passes with Behaviour 2005-06-07 - By Sandy Sutherland
Back Just found out why - the var output needed a / at the end of the path!!!!
These path variables in piccolo are like Women, different needs for one minute /command to the next!!
Sorry to all those on the list of the fairer sex!!
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 -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
-- -- Original Message -- -- From: Aloys Baillet To: XSI@(protected) Sent: Tuesday, June 07, 2005 11:45 AM Subject: Re: How to do Multiple passes with Behaviour
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) (P) (+27 21) 480 3132 (F) (+27 21) 480 3101 -- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----
-- Aloys Baillet - Character TD @ Animal Logic <!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></STYLE> </HEAD> <BODY bgColor=#ffffff> <DIV><FONT face=Arial size=2>Just found out why - the var output needed a / at the end of the path!!!!</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>These path variables in piccolo are like Women, different needs for one minute/command to the next!!</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>Sorry to all those on the list of the fairer sex!!</FONT></DIV> <DIV><FONT face=Arial size=2></FONT> </DIV> <DIV><FONT face=Arial size=2>S.</FONT></DIV> <DIV> </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 style="PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV style="FONT: 10pt arial">-- -- Original Message -- -- </DIV> <DIV style="BACKGROUND: #e4e4e4; FONT: 10pt arial; font-color: black"><B>From:</B> <A title=aloys.baillet@(protected) href="mailto:aloys.baillet@(protected)">Aloys Baillet</A> </DIV> <DIV style="FONT: 10pt arial"><B>To:</B> <A title=XSI@(protected) href="mailto:XSI@(protected)">XSI@(protected)</A> </DIV> <DIV style="FONT: 10pt arial"><B>Sent:</B> Tuesday, June 07, 2005 11:45 AM</DIV> <DIV style="FONT: 10pt arial"><B>Subject:</B> Re: How to do Multiple passes with Behaviour</DIV> <DIV><BR></DIV>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 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></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="PADDING-LEFT: 1ex; MARGIN: 0pt 0pt 0pt 0.8ex; BORDER-LEFT: rgb(204,204 ,204) 1px solid"> <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 face=Arial color=navy 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 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><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><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P></SPAN> <P><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><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P> <P><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><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">{ </SPAN></FONT></P> <P><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"> motion.SubmitActor(actors);</SPAN></FONT></P> <P><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial">}</SPAN></FONT></P> <P><FONT face=Arial color=navy size=2><SPAN style="FONT-SIZE: 10pt; COLOR: navy; FONT-FAMILY: Arial"></SPAN></FONT> </P> <P><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><SPAN class=q> <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></SPAN> <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 size=+0></FONT> <DIV><FONT size=+0><BR><EM><FONT face=Arial color=#808080 size=2> world.AddPiccoloActivityByName("update"); <BR> global var tick = 0; </FONT></EM></FONT></DIV> <DIV><FONT size=+0><EM><FONT face=Arial color=#808080 size=2></FONT></EM></FONT> </DIV> <DIV><FONT size=+0><BR><EM><FONT face=Arial color=#808080 size=2>}</FONT></EM></FONT></DIV> <DIV><FONT size=+0><EM><FONT face=Arial color=#808080 size=2></FONT></EM></FONT> </DIV> <DIV><FONT size=+0><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></FONT></DIV> <DIV><FONT size=+0><EM><FONT face=Arial color=#808080 size=2></FONT></EM></FONT> </DIV> <DIV><FONT size=+0><FONT face=Arial size=2>Thanks</FONT></FONT></DIV><FONT size=+0><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 onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.refinery.co.za" target=_blank>http://www.refinery.co.za</A><BR><A onclick="return top.js.OpenExtLink(window,event,this)" href="mailto:sandy@(protected)" target=_blank>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 : rgb(0,0,0) 2px solid; MARGIN-RIGHT: 0px"><FONT face=Arial size=2></FONT> </BLOCKQUOTE></SPAN></DIV></BLOCKQUOTE></DIV><BR><BR><BR> -- <BR>Aloys Baillet - Character TD @ Animal Logic </BLOCKQUOTE></BODY></HTML>
|
|