View Full Version : Scipt Help Please
n8vfx 03-22-2007, 08:22 PM Sorry to bother you guys with this but can you tell me what I am doing wrong? I am trying to get what ever geometry I have selected to instance its self every of many frames. Here is the scrpit,
global proc nhGeometryInstancer ()
{
//Declare the variables
string $objSel[];
int $rateOfFire;
int $time;
int $dupFrame;
int $fps;
int $count;
$objSel = `ls -sl`;
$rateOfFire = 5;
$fps = 24;
$time = `currentTime -q`;
$dupFrame = $rateOfFire / $fps;
$count = 1;
if ($time = $dupFrame * $count);
{
instance $objSel;
$count ++;
}
}
As I am sure you can tell I am kinda new to mel so any help would rock.
-nathan
|
|
sparaig
03-22-2007, 10:22 PM
Sorry to bother you guys with this but can you tell me what I am doing wrong? I am trying to get what ever geometry I have selected to instance its self every of many frames. Here is the scrpit,
global proc nhGeometryInstancer ()
{
//Declare the variables
string $objSel[];
int $rateOfFire;
int $time;
int $dupFrame;
int $fps;
int $count;
$objSel = `ls -sl`;
$rateOfFire = 5;
$fps = 24;
$time = `currentTime -q`;
$dupFrame = $rateOfFire / $fps;
$count = 1;
if ($time = $dupFrame * $count);
{
instance $objSel;
$count ++;
}
}
As I am sure you can tell I am kinda new to mel so any help would rock.
-nathan
How is that called?
BPorter
03-22-2007, 10:47 PM
change
if ($time = $dupFrame * $count);
{
instance $objSel;
$count ++;
}
}
-----------------------
to this
if ($time = $dupFrame * $count);
{
for ($eachObjSel in $objSel)
instance $eachObjSel;
}
}
what that does is it takes each node in your array ($objSel) and instances each one, if the conditional is true that is. I hope that helps. I'm not really sure where you are going with the whole rate of fire. Are you just trying to instance geometry every fixed number of frames? I don't understand what you are trying to do so if you give me a better idea, I can help.
kjaft
03-23-2007, 10:46 AM
if ($time = $dupFrame * $count);
{
instance $objSel;
$count ++;
}
First remove the semicolon at the end of the if line.
Second I think you actually meant if ($time == $dupFrame * $count)
Felix
n8vfx
03-24-2007, 07:33 PM
Thanks for the responce guys. First...
"How is this called?"
I was going to use this as a particle to geometry converter on particle collisions.
"The whole rate of fire."
I was trying to make an AK47 fire. As it did it would "kick" shells out of the side of the gun. I was wanting to have the shells hit the ground then interact with each other. So I needed to change them into rigids when they hit the ground. Rate of fire comes in when you want the gun to fire more. I think I was going about this all worng. I talked to apoc519 and he hooked me up with a way to instance rigid bodies. Thanks agian.
-nathan
CGTalk Moderation
03-24-2007, 07:33 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
vBulletin v3.0.5, Copyright ©2000-2012, Jelsoft Enterprises Ltd.