Mailing List
Home
Forum Home
Softimage
Carrara
trueSpace
Dir3d-l
Maya - a powerful 3D animation and visual effects software
Macromedia Flash Development
Subjects
Cameras
scaleDown command
black out solved
Aircraft Tutorial
Mathematical XYZ ?
Its done This vs That
Its done first week
recommendations for screen video captures?
3DExplorer "Oddity "
New Director
ProTeam renewals
Fuel 's new websites (X post)
Blue peter create a make toy
targeting groups question
XPost: Shockwave 3D game ( sort of )
RES: RES: RES: Fish Modeling
Emitting particles from object intersection
Fuel 's new websites (X post)
Texturing
Big Break Contest Videos
New Plugins
Models and Texture on my updated site
Error Installing Patch tS6 6
Plasma?
Looking for Inspiration
Weird EMail Q
It 's done first week ?
Cherry not cranberry
New game
Camera Animation Problem
Particle plugins?
 
How to do Multiple passes with Behaviour

How to do Multiple passes with Behaviour

2005-06-07       - By Sandy Sutherland

 Back
Reply:     1     2     3     4     5     6     7     8     9  

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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Using this code, I get the following
message:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</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. I’m 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>&nbsp;<
/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>&nbsp;<
/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">&nbsp;&nbsp;&nbsp;
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
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>&nbsp;<
/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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Yet This works:</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>&nbsp;</FONT><EM><FONT face=Arial color=#000080
size=2>var output = "N:/HUTCH_LENNY/Behaviour_DATA/MentalRay/SCRIPT_OUTPUT";
<BR>&nbsp;var input =
"N:/HUTCH_LENNY/Behaviour_DATA/MentalRay/Colour_Lennys_RenderSetup/Colour_R
_SETUP.bvrn";
<BR>&nbsp;global var mental = new MentalRay(world, output,
input);&nbsp;<BR>&nbsp;<BR>&nbsp;mental.MapTarget("MY_CORRECT_LENNY_PosRIG",
"happy", 0); <BR>&nbsp;mental.MapTarget("MY_CORRECT_LENNY_PosRIG1", "happy", 1)
;
<BR>&nbsp;mental.MapTarget("MY_CORRECT_LENNY_PosRIG2", "happy", 2);&nbsp;
<BR>&nbsp;&nbsp;&nbsp; mental.SynchToCamera(TRUE); </FONT></EM></DIV>
<DIV><EM><FONT face=Arial color=#000080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#000080 size=2><EM>&nbsp;list =
world.GetActorList("happy");<BR>&nbsp;for(actors = list.First(); actors != nil;
actors = list.Next())<BR>&nbsp;{<BR>&nbsp;&nbsp;AddFlockActor(actors, "walk",
40, 0);</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#000080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#000080 size=2><EM>&nbsp;&nbsp;// reduce the radius
to keep them tightly packed<BR>&nbsp;&nbsp;//&nbsp;actors.pfd.radius =
0;</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#000080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#000080 size=2><EM>&nbsp;&nbsp;// randomize the
gait
index so the walk cycles aren't in
sync<BR>&nbsp;&nbsp;actors.fa.ikla.loco.skilltime =
MyRand()%333;<BR>&nbsp;&nbsp;mental.SubmitActor(actors,
Math.Rand()%3);</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#000080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#000080 size=2><EM>&nbsp;}</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#000080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Anyone know why this is, and how I can fix
it!&nbsp; 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>&nbsp;</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>&nbsp;</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>&nbsp;</DIV>
<DIV><FONT face=Arial color=#808080 size=2><EM>function
main()<BR>{<BR>&nbsp;&nbsp;engine.RunScript("rtk", nil);</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#808080 size=2><EM>&nbsp;global var world =
engine.GetCurrentWorld();</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#808080 size=2><EM>&nbsp;global var flock = new
DrvFlock(0.3);</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#808080 size=2><EM>&nbsp;DeleteActors("happy");
</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#808080 size=2><EM>&nbsp;&nbsp;&nbsp; var list =
new
List();<BR>&nbsp;var actors = new Array(2);<BR>&nbsp;actors[0] = "happy";
<BR>&nbsp;actors[1] = "happy"; <BR>&nbsp;var ground =
Actor("GRND060").GetNodeByName("ground"); <BR>&nbsp;&nbsp;
<BR>&nbsp;Populate(ground, 100, actors, 5, 0.2, 0.5, list, FALSE);
<BR>&nbsp;OrientActors(list, new DrvVector(0,0,1000)); </EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#808080 size=2><EM>&nbsp;var floor =
Actor("GRND060").GetNodeByName("Floor");<BR>&nbsp;var curves =
Actor("GRND060").GetNodeByName("ground");</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#808080 size=2><EM>&nbsp;SceneGoalFlock(flock);
<BR>&nbsp;<BR>&nbsp;var output =
"N:/HUTCH_LENNY/Behaviour_DATA/MentalRay/SCRIPT_OUTPUT"; <BR>&nbsp;var input =
"N:/HUTCH_LENNY/Behaviour_DATA/MentalRay/Colour_Lennys_RenderSetup/Colour_R
_SETUP.bvrn";
<BR>&nbsp;global var mental = new MentalRay(world, output, input);
<BR>&nbsp;<BR>&nbsp;mental.MapTarget("MY_CORRECT_LENNY_PosRIG", "happy", 0);
<BR>&nbsp;mental.MapTarget("MY_CORRECT_LENNY_PosRIG1", "happy", 1);
<BR>&nbsp;mental.MapTarget("MY_CORRECT_LENNY_PosRIG2", "happy", 2);&nbsp;
<BR>&nbsp;&nbsp;&nbsp; mental.SynchToCamera(TRUE); </EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#808080 size=2><EM>&nbsp;list =
world.GetActorList("happy");<BR>&nbsp;for(actors = list.First(); actors != nil;
actors = list.Next())<BR>&nbsp;{<BR>&nbsp;&nbsp;AddFlockActor(actors, "walk",
40, 0);</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#808080 size=2><EM>&nbsp;&nbsp;// randomize the
gait
index so the walk cycles aren't in
sync<BR>&nbsp;&nbsp;actors.fa.ikla.loco.skilltime =
MyRand()%333;<BR>&nbsp;&nbsp;mental.SubmitActor(actors,
Math.Rand()%3);</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#808080 size=2><EM>&nbsp;}</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#808080
size=2><EM>&nbsp;flock.CreateCurveFunction(0, floor, 400, 400, 0, 20, curves);
</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial color=#808080
size=2><EM>&nbsp;InitializeRecord(25);</EM></FONT></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</DIV><FONT>
<DIV><BR><EM><FONT face=Arial color=#808080
size=2>&nbsp;world.AddPiccoloActivityByName("update"); <BR>&nbsp;global var
tick
= 0; </FONT></EM></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</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>&nbsp;</DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2>&nbsp; function update(act, time
,
obj) <BR>&nbsp;{ <BR>&nbsp;&nbsp;Console.PrintNl(tick++);
<BR>&nbsp;<BR>&nbsp;&nbsp;if(tick == 200)
<BR>&nbsp;&nbsp;&nbsp;mental.StartCapture("out", "image");<BR>&nbsp;&nbsp;else
if(tick == 231) <BR>&nbsp;&nbsp;{
<BR>&nbsp;&nbsp;&nbsp;mental.Close("render.bat", "-verbose
on");<BR>&nbsp;&nbsp;&nbsp;RuntimeStop(); <BR>&nbsp;&nbsp;}
<BR>&nbsp;}</FONT></EM></DIV>
<DIV><EM><FONT face=Arial color=#808080 size=2></FONT></EM>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>Thanks</FONT></DIV>
<DIV><FONT face=Arial size=2></FONT>&nbsp;</DIV>
<DIV><FONT face=Arial size=2>S.</FONT></FONT></DIV>
<DIV>-- ---- ---- ---- ---- ---- ---- ---- ---- ---- ---- -----<BR>Sandy
Sutherland&nbsp;&nbsp;Digital Doodeller - TD<BR>The Refinery
(Cape)&nbsp;&nbsp;<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&nbsp; (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>&nbsp;</BLOCKQUOTE></BODY></HTML>