Trying to find plugin : Automatic banking

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

THREAD CLOSED
 
Thread Tools Search this Thread Display Modes
Old 02 February 2003   #1
Question Trying to find plugin : Automatic banking

Hey everybody,

Tried flay and all the usual spots, I am desperately trying to find a plugin I saw floating around ages ago that does automatic banking

ie: if you keyframe the flying motion of a plane, then this plugin will take care of the bank angle for you.

If anyone knows where to find it, or has a copy of it floating around in their plugin directory, please let me know, it will save my butt.


Thanks in advance,

The good Docter.
 
Old 02 February 2003   #2
hi doc.

i think lw5.5 did this once upon a time. wonder why this isnt in lw7.5


anyway, i cooked up something for you (cooked before, that is..)


// begin Banker Motion Modifier script
@warnings
@script motion
maintain;
sensitivityMultiplier;
lookaheadTime;
bankLimitsBool; bankLimitLow; bankLimitHigh;
maintain;
sensitivityMultiplier;

flags
{
	return(AFTERIK);
}
process: ma, frame, time
{
	// get velocity

	nowRot = ma.get(ROTATION,time);

	thenRot = ma.get(ROTATION,time + lookaheadTime);

	fRot = thenRot - nowRot;

	if(!maintain)
		fv = <nowRot.x,nowRot.y,-fRot.x * sensitivityMultiplier>;

	if(maintain)
		fv = <nowRot.x,nowRot.y,(-fRot.x * sensitivityMultiplier) - thenRot.x>;

	if(bankLimitsBool)
	{
		if(fv.z < bankLimitLow)
			fv.z = bankLimitLow;
		if(fv.z > bankLimitHigh)
			fv.z = bankLimitHigh;
	}

	ma.set(ROTATION,fv);
}

create: obj
{
	setdesc("Su-75 Banker");
	lookaheadTime = .03;
	bankLimitsBool = false;
	bankLimitLow = -90.0;
	bankLimitHigh = 90.0;
	sensitivityMultiplier = 4.0;
	maintain = false;
	

}
options
{
	//	bank limit, look ahead, sensitivity multiplier, additive?
	reqbegin("Su-75 Banker");
	c1 = ctlnumber("Look Ahead Time \(Secs\)",lookaheadTime);
	c2 = ctlcheckbox("Enable Banking Limits",bankLimitsBool);
	c3 = ctlangle("Bank Limit Low",bankLimitLow);
	c4 = ctlangle("Bank Limit High",bankLimitHigh);
	c5 = ctlnumber("Heading to Bank Sensitivity Multiplier",sensitivityMultiplier);
	c6 = ctlcheckbox("Maintain Bank Value on Straightaways",maintain);

	ctlactive(c2,"active_bank",c3,c4);

	return if(!reqpost());

	lookaheadTime = getvalue(c1);
	bankLimitsBool = getvalue(c2);
	bankLimitLow = getvalue(c3);
	bankLimitHigh = getvalue(c4);
	sensitivityMultiplier = getvalue(c5);
	maintain = getvalue(c6);

	reqend();

}
active_bank: val
{
	return(val);
}

save: what, io
{
	if(what == SCENEMODE)
	{
		io.writeln(lookaheadTime);
		io.writeln(bankLimitsBool);
		io.writeln(bankLimitLow);
		io.writeln(bankLimitHigh);
		io.writeln(sensitivityMultiplier);
		io.writeln(maintain);
	}
}

load: what, io
{
	if(what == SCENEMODE)
	{
		lookaheadTime = number(io.read());
		bankLimitsBool = integer(io.read());
		bankLimitLow = number(io.read());
		bankLimitHigh = number(io.read());
		sensitivityMultiplier = number(io.read());
		maintain = integer(io.read());
	}
}
// end script


note that there are some options. Look Ahead Time and Banking Limits are explanatory. Sensitivity Multiplier is the 'heading to banking ratio'. this is pretty arbitrary... the default value of four seems to be okay. Maintain Bank along Straightaways will tell the script to keep the bank and not straigten itself to zero if there is no 'rotation velocity', or rotation change. if that's confusing then it will become more apparent when you use the script.

if there are bugs or problems, PM me or email me here (preferred)

faulknermano1@yahoo.com


ps: can i get a free checkup now?
__________________
"If in this life only we have hope in Christ, we are of all men most miserable."

Advert:
Janus - multi-pass rendering for LightWave3D
 
Old 02 February 2003   #3
In most forums that I run into, scripting and expressions are the subjects most avoided. It's a shame too. I've copied your script and I'm going to try it later

Good Job
__________________
The ripples of what we alone do can affect others for generations.
 
Old 02 February 2003   #4
Me to.
Looks real useful like "Follower" but "Banker" instead.
Thx Faulknermano!

BTW,whats "ma.","fv",and ".io" refering to in this instance?(If you dont mind.)
 
Old 02 February 2003   #5
Just checked it ...
Work great except the limits - then i add some limits the banking disappear
__________________
4u4avfx
 
Old 02 February 2003   #6
Quote: Originally posted by wgreenlee1
Me to.
Looks real useful like "Follower" but "Banker" instead.
Thx Faulknermano!

BTW,whats "ma.","fv",and ".io" refering to in this instance?(If you dont mind.)


"ma" is called as a the object agent of the item that is being assigned the lscript. this is done automatically by lscript. if you see the process() function, you will see ma, time, frame. that is pre-defined. the ma contains the object agent.

when i use ma.get(ROTATION,time), i'm telling lscript to access the object agent (which contains stuff) and get it's rotation.

fv, if you look at the rest of the process function() is a vector value that was the result of some simple calculation. using variable messages, i can extract the first number from the vector by typing "fv.x", or if i want the third: "fv.z" and so on.

"io" is almost the same as "ma" but it refers the File Object Agent. whenever you save or load something, and if there is an callback lscript n the scene (just like this script) the script will execute the save() or load() functions. accessing "io" will enable me to access the scene file upon save or load. this is primarily used to save settings.

io.writeln("blah");

that code will write "blah" on the plugin settings in the scene file.

oh yeah, if anyone noticed i named the script Su-75 Banker. if anyone is familiar with the Russian warplane...
__________________
"If in this life only we have hope in Christ, we are of all men most miserable."

Advert:
Janus - multi-pass rendering for LightWave3D
 
Old 02 February 2003   #7
Quote: Originally posted by Eugeny
Just checked it ...
Work great except the limits - then i add some limits the banking disappear


if it's no problem, do you think you can go step by step with what you did so i can determine if it's indeed a problem or pilot error? thanks.
__________________
"If in this life only we have hope in Christ, we are of all men most miserable."

Advert:
Janus - multi-pass rendering for LightWave3D
 
Old 02 February 2003   #8
I have only one day - tomorrow till the next our big project is come in up, so if u want we can make it tomorrow ...
__________________
4u4avfx
 
Old 02 February 2003   #9
Quote: Originally posted by Eugeny
I have only one day - tomorrow till the next our big project is come in up, so if u want we can make it tomorrow ...


whenever you find it convenient. i would just like to know, as precisely as possible, the circumstance in which the banking disappears.

and btw, i forgot to mention in the comments: you have to switch _at least_ your heading controller to Align To Path. the script needs the aligned path info.
__________________
"If in this life only we have hope in Christ, we are of all men most miserable."

Advert:
Janus - multi-pass rendering for LightWave3D
 
Old 02 February 2003   #10
Yes i realized that fact (switching ON)

The banking disappear then u turn ON the "Enable Banking Limits" - there is some strange numbers appears (see attachment) but even with playing with ranges the banking is not working ...
Attached Images
File Type: gif banker.gif (9.1 KB, 60 views)
__________________
4u4avfx
 
Old 02 February 2003   #11
super strange.. first, the 'strange numbers' are not supposed to look like that at all. are you running lw6.5b? actually more importantly, what lscript version are you running?

it works fine over here. i cant think of anything else... could you recheck the lscript to make sure you've included everything above? that's all i can think of.
__________________
"If in this life only we have hope in Christ, we are of all men most miserable."

Advert:
Janus - multi-pass rendering for LightWave3D
 
Old 02 February 2003   #12
the only clue i have is that those numbers in the low and high limits are actually expressed in radians: that's why i asked if you have an earlier version of lscript (it _may_ have been an old bug -not sure - that's must have been rid of in the latest lscript: v.2.5.1).

if, and only if this is the case, then simply replace the lines containing "ctlangle" (in the options function()) with "ctlnumber".

see if that works..
__________________
"If in this life only we have hope in Christ, we are of all men most miserable."

Advert:
Janus - multi-pass rendering for LightWave3D
 
Old 02 February 2003   #13
I'm running 7.5 on Win2k PC ...
Actually i made copy/paste from the html page to text document and then changed the .txt extension to .ls ...
May be i have not updated Lscript ?
How i can check this ?
__________________
4u4avfx
 
Old 02 February 2003   #14
Yes that those the problem , after replacing it's working great
Thanx for the script
__________________
4u4avfx
 
Old 02 February 2003   #15
Quote: Originally posted by Eugeny
Yes that those the problem , after replacing it's working great
Thanx for the script


cool. glad it's working.

i might update certain parts of the script especially in regards to the "maintain bank along straightaway". it doesnt work as i want it to... oh well... this was for the doctor anyway.
__________________
"If in this life only we have hope in Christ, we are of all men most miserable."

Advert:
Janus - multi-pass rendering for LightWave3D
 
Thread Closed share thread



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
CGSociety
Society of Digital Artists
www.cgsociety.org

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump
Miscellaneous

All times are GMT. The time now is 11:12 PM.


Powered by vBulletin
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.