Shop Mobile More Submit  Join Login
Automated AVSTrans APE (beta) by TomyLobo Automated AVSTrans APE (beta) by TomyLobo
wee! i finally made it!
With some help from Jaak (and some nice ppl in a c++ help channel :)), i translated AVSTrans to C++!
After doing this, it was only a minor step to integrating AVSTrans into my existing eeltrans.ape (which used the VB AVSTrans via COM before).
Now, eeltrans.ape is completely self-contained and can thus be spread along with a preset for example :)
Also, it can now be used without admin rights and should also run fine on wine.

This APE should do the same as the latest VB version. if it doesnt, or if it crashes or outputs strange errors that the VB version doesnt, plz send me the code piece that causes the problems and I'll see what i can do about it.

The APE also has a code logger that writes all your code into various files in c:\avslog

have fun with it :)
manual coming soon :)

The latest VB Version is available here: [link]

[edit]
04.11.05
- major fixup: code saving and displaying works now. crashes less often.

28.06.05
- I fixed and changed the behaviour of global code. You can now have multiple instances of AVSTrans concurrently and even specify global code for each one. The code will simply be concatenated in this case. There should be no more "Instance conflict" dialog boxes or lost code.

30.03.05
- gmegabuf loading should be much faster with this new version and the upcoming version 1.1 of Jheriko's Global Variable Manager

02.02.05
- You can now include external files using "#include filename". Refer to eeltrans.txt for more information and an example.
- log path is now customisable

14.12.04:
- allowed things like a=b=c; (assigns the value of c to a and b)

07.12.04:
- crash bug fixed that would occur if "*)*(*;*)*" was entered, where * is any combination of characters (except brackets) including no characters at all. thx fsk for first reporting this (very vaguely though :))
- some optimisations

06.12.04:
- hopefully everything in the #defines fixed :)
- fixed a bug that prevented loading the settings when switching from one eeltrans preset to another

04.12.04:
- added documentation
- fixed config dialog grabbing focus when loaded
- fixed a (stupid) bug in the #defines that prevented using token identifiers longer than 1 character :)
- fixed another bug in the #defines that prevented some uses of the token insertion operator (##) not to work

03.12.04:
- fixed freezing when entering incomplete #defines
- fixed freezing when having bracket errors while using macros
- fixed a stupid bug in the code logger that caused it to crash when entering code with "%" in it

02.12.04:
- improved preset changing behaviour (will not delete the AVSTrans component anymore)
[/edit]
Add a Comment:
 
:iconspudd86:
Spudd86 Featured By Owner Nov 26, 2006
I've had a thought, ya know what'd be nice? If you could translate the preset then save a translated version, for distribution in packs, since at the moment it's still kinda unstable for me... at least on this computer, I know I could use the VB version and do it by hand, but I've got a preset with rather a lot of separate components that all use AVStrans features... (mostly control stuff)
Reply
:icontomylobo:
TomyLobo Featured By Owner Dec 9, 2006
that's a good idea
all i need for that would be a complete format description for .avs files
Reply
:iconspudd86:
Spudd86 Featured By Owner Feb 14, 2006
hmmm would it be possible for you to have macros expand inside other macros...

#define lin(pos,v1,v2) (pos*v1+v2*(1 - pos))
#define biLin(px,py,v1,v2,v3,v4) (py*(px*v1+(1-px)*v2)+(1-py)*(px*v3+(1-px)*v4))
#define triLin(px,py,pz,v1,v2,v3,v4,v5,v6,v7,v8) ((py*(px*v1+(1-px)*v2)+(1-py)*(px*v3+(1-px)*v4))*pz+(1-pz)*(py*(px*v5+(1-px)*v6)+(1-py)*(px*v7+(1-px)*v8)) )


is what I have right now, and there are things that I'm gonna use those in that it wouldbe nice to be able to one of these macros inside another... not to mention that the above would be nicely simplefied to:

#define lin(pos,v1,v2) (pos*v1+v2*(1 - pos))
#define biLin(px,py,v1,v2,v3,v4) lin(py,lin(px,v1,v2),lin(px,v3,v4))
#define triLin(px,py,pz,v1,v2,v3,v4,v5,v6,v7,v8) lin(pz,biLin(px,py,v1,v2,v3,v4),biLin(px,py,v5,v6,v7,v8))
Reply
:icontomylobo:
TomyLobo Featured By Owner Apr 26, 2006
it is indeed possible, you just have to reverse the order of your #defines
#define triLin(px,py,pz,v1,v2,v3,v4,v5,v6,v7,v8) lin(pz,biLin(px,py,v1,v2,v3,v4),biLin(px,py,v5,v6,v7,v8))
#define biLin(px,py,v1,v2,v3,v4) lin(py,lin(px,v1,v2),lin(px,v3,v4))
#define lin(pos,v1,v2) (pos*v1+v2*(1 - pos))

explanation:
#defines are applied to the code, in their order of appearance in the original code
Reply
:icondrrew:
dRRew Featured By Owner Dec 31, 2005
Automated AVSTrans APE, wait no.
its TWO years old...damn it, i feel stupid.
Reply
:icontomylobo:
TomyLobo Featured By Owner Apr 26, 2006
it's way older than that :)
but before it was like Frankenstein's creature: half VB half C++
Reply
:icondrrew:
dRRew Featured By Owner Apr 26, 2006
god damn, i dont even no what that is.
i dont even no what C++ is.
im guessing its a type of programming thing? ive heard been said a few times.
Reply
:icontomylobo:
TomyLobo Featured By Owner May 1, 2006
C++ is an object-oriented programming language built from the structured language C

its advantages are speed and complete/real OO

Visual Basic (VB) is a pseudo-object-oriented Rapid Application Development language basing on the Syntax of the well-known "BASIC" language

it doesnt have real Object orientation in version 6. the reason i use it anyway is that it makes application development faster by doing all the interface stuff for you.
but if you just want a library and dont need a user interface, you have a problem, since VB is not capable of making a simple DLL and exporting some functions and you must use the component object model (COM) instead. COM is a bitch to use in C++ though, with a hugely complex interface.
Reply
:icondrrew:
dRRew Featured By Owner Dec 31, 2005
Automated AVSTrans APE is one year old today.
Reply
:icontomylobo:
TomyLobo Featured By Owner Jul 8, 2005
well 1.23 beta 4.5 is the latest [u]VB[/u] version
Reply
:iconadasha:
adasha Featured By Owner Apr 13, 2005  Professional General Artist
been using this for a while now and it really speeds things up, and makes your code much more readable. nice work!

something i'd like to see is some way of simplifying nested ifs, like a case statement or something. also, is it possible to write if statements that drop the 'else' argument? I thought I saw it in an example you gave, but it never seems to work when I try it :(
Reply
:icontomylobo:
TomyLobo Featured By Owner Apr 13, 2005
switch statement would be hard to do properly i'm afraid :(
make proposals for the syntax :)

if there is a missing else part, i must've forgotten it, sorry
Reply
:iconfragmer:
fragmer Featured By Owner Jun 26, 2005
switch( * ) {
case *:
*;
break;
case *:
*;
break;
default:
*;
}

By the way, it's version 1.25 already, it's time to update the "latest VB Version" link :)
Reply
:icontomylobo:
TomyLobo Featured By Owner Jun 27, 2005
1.25? did i miss something? :D
Reply
:iconfragmer:
fragmer Featured By Owner Jul 5, 2005
well... my AVS Automation APE says "Using Translator v 1.25.00" so I thought your "latest VB Version" link was outdated - it points to "AVSTrans1.23Beta4.5.zip". Anyway, it works great! :D
Reply
:icontomylobo:
TomyLobo Featured By Owner Jul 8, 2005
see below
[link]
Reply
:iconadasha:
adasha Featured By Owner Apr 13, 2005  Professional General Artist
of course I meant a switch statement. hnnnnngggggghhhh!
Reply
:iconspudd86:
Spudd86 Featured By Owner Apr 3, 2005
it's generating code with syntax errors in it for me...
[code]
//these were in the gloabal code on AVSTrans
#define px(INDEX) gmegabuf(INDEX*3);
#define py(INDEX) gmegabuf(INDEX*3+1);
#define pm(INDEX) gmegabuf(INDEX*3+2);

#define pxt(INDEX) megabuf(INDEX*6);
#define pxv(INDEX) megabuf(INDEX*6+1);
#define pyt(INDEX) megabuf(INDEX*6+2);
#define pyv(INDEX) megabuf(INDEX*6+3);
#define pmt(INDEX) megabuf(INDEX*6+4);
#define pmv(INDEX) megabuf(INDEX*6+5);

//these loops are from a superscope that
//updates global variables

//this is from init
numObs=4;
ind=0;
loop(numObs,
px(ind)=0.5*(rand(200)/100-1);
pxt(ind)=0.5*(rand(200)/100-1);
py(ind)=0.5*(rand(200)/100-1);
pyt(ind)=0.5*(rand(200)/100-1);
pxv(ind)=0;pyv(ind)=0;
pm(ind)=0;
pmt(ind)=25;
pmv(ind)=0.5;
ind=ind+1;
);

//frame
ind=0;
loop(numObs,
xtmp=pxt(ind)-px(ind);
ytmp=pyt(ind)-py(ind);
mag=0.4*invsqrt(xtmp*xtmp+ytmp*ytmp);
pxv(ind)=( pxv(ind)+xtmp*mag*tspt)/(tspt+1);
pyv(ind)=( pyv(ind)+ytmp*mag*tspt)/(tspt+1);
px(ind)=p x(ind)+pxv(ind)*delt;

//beat
ind=0;
loop(numObs,
pxt(ind)=0.5*(rand(200)/100-1);
pyt(ind)=0.5*(rand(200)/100-1);
pxv(ind)=0.5*(rand(200)/100-1);
pyv(ind)=0.5*(rand(200)/100-1);
pmt(ind)=25+3*(rand(200)/100-1);

//this loop is from my DM
ind=0;
loop(4,
xt=x-px(ind);yt=y-py(ind);
tmp=pm(ind)/(sqr(xt)+sqr(yt));
xsum=xsum+xt*tmp;
ysum=ysum+yt*tmp;
ind=ind+1;
);
ind=ind+1;^M
);^M


py(ind)=p y(ind)+pyv(ind)*delt;^M
tmp=sign(pmt(ind)-pm(ind));^M
pmv(ind)=p mv(ind)+(tmp-pmv(ind))*0.02*delt;^M
m=pm(ind)+pmv(ind)*delt;^M
ind=ind+1;^M
);
[/code]
Reply
:iconspudd86:
Spudd86 Featured By Owner Apr 3, 2005
Whoops, I forgot to remove the Carraige Returns (I'm running winamp under wine and I copyed the code out of the .avs file)
Reply
:icontomylobo:
TomyLobo Featured By Owner Apr 3, 2005
btw you should do something like this:
...
#define py(index) megabuf(index+1)
...
#define indexm 3
...
ind=ind+indexm;

saves you one multiplication per megabuf access :)
Reply
:icontomylobo:
TomyLobo Featured By Owner Apr 3, 2005
of course it borks.. just remove those ; after the #defines
they are (in accordance with the C/C++ #define) regarded as a part of the define and not as a command delimiter
Reply
:iconspudd86:
Spudd86 Featured By Owner Apr 4, 2005
Well I'm pretty sure that wine is reading and writing text files with the windows CRLF line endings, because the carraige returns show up in every text file that a wine program writes... the LFs don't show up if I open the file on windows, alos those in my post are not actual linefeeds just what my text editor shows instead...
Reply
:icontomylobo:
TomyLobo Featured By Owner Apr 4, 2005
it's not the line feeds
it's the semicolons (;) at the end of the #defines
they are interpreted as being part of the macro and thus you get syntax errors
Reply
:iconspudd86:
Spudd86 Featured By Owner Apr 4, 2005
hmmm I seem to be having other issues with this now... it's not working but I don't see any compile errors either...
Reply
:icontomylobo:
TomyLobo Featured By Owner Apr 4, 2005
make sure you're not entering your code in texer2, colormod, triangle, globmgr or any other APE, as they dont (cant (yet :))) display compile errors in the debug window
Reply
:iconspudd86:
Spudd86 Featured By Owner Apr 5, 2005
Thank you I did not know that, no the part that's not working is in a DM...

Gimme some time to make sure it's not my own fault...
Reply
:iconzen-x:
zen-x Featured By Owner Mar 27, 2005
Why couldn't I have found this two bloody months ago.

Great idea, thank you!

Peace

zen-x
Reply
:iconyathosho:
yathosho Featured By Owner Feb 16, 2005
does it have a version-resource?
Reply
:iconyathosho:
yathosho Featured By Owner Feb 16, 2005
first check, then ask ;)
Reply
:iconpak-9:
pak-9 Featured By Owner Feb 2, 2005
I just used this for the first time to make a really code heavy preset, and I have to say it made it a LOT simpler. Great stuff.

I only noticed the help text file when I'd finished, now I know exactly what it can do I'll have to experiment with more of the features. How about using the expression help instead of just a text file? (yea I know its a fag to work out, but it would be worth it)

I did notice a bug tho (although my version is one you DCC'd me on #ff so it might be an older version) I typed a line of code into an init box a=if(b,1,2) something simple like that, and it wouldnt compile... when I checked the debug window it was trying to do an exec2 but of course there was no second expression to evaluate, I think I fixed it by unticking 'translate first level'. You might want to check that out, sorry I cant post the exact code but it was in the middle of making the preset so i just fixed it and moved on.
Reply
:icontomylobo:
TomyLobo Featured By Owner Feb 2, 2005
hmm works for me... if you run into that problem with the latest version again, tell me and i'll fix it
Reply
:iconmilkn00b:
Milkn00b Featured By Owner Sep 20, 2006
It doesn't work with winamp 2 and winamp 3.
Can u fix that problem?
Reply
:icontomylobo:
TomyLobo Featured By Owner Dec 9, 2006
short answer: no
long answer: no, because winamp 2/3 dont expose the compiler to APEs
Reply
:iconcatsquared:
CatSquared Featured By Owner Dec 28, 2004
how does it work?
Reply
:icontomylobo:
TomyLobo Featured By Owner Jan 7, 2005
there's a .txt in the zip file
Reply
:iconfsk:
fsk Featured By Owner Dec 3, 2004
uh, forgot somethin.
thanx:)
Reply
:iconfsk:
fsk Featured By Owner Dec 3, 2004
a super usefull thing to help you code your presets.
Reply
Add a Comment:
 
×
Download ZIP download, 111 KB


Details

Submitted on
December 1, 2004
File Size
111 KB
Link
Thumb
Embed

Stats

Views
5,396
Favourites
6 (who?)
Comments
37
Downloads
826
×