Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  


An update to Anim8or, v1.00b, is available with a few bug fixes. Get your copy HERE. See the "ReadMe" file for details.

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.

Messages - Trevor

Pages: [1] 2 3 ... 14
ASL Scripts / Fast 3D Export (Beta) 0513
« on: May 10, 2020, 12:13:00 pm »
Here is an export plugin for Fast3D at source level.

My main issues now are sorting (Cant seem to get my head round it)
Sorting works on vertices but will not output triangles (only debug mode will)

Debug mode is enabled

ver 20200513 (Beta)

    Duplicate Vertex removal (Works but disabled for now)
    Triangle Sorting
    Flat Shading
    Smooth Shading (Lighting only, An8 does not support Vertex Shading)
    Fog (Disables Vertex Alpha as N64 places Distance on Vertex Alpha)

    Texture Mapping
    Environment Mapping
    Bounding Box (Nothing output yet)
    Bounding Volume Radius (Nothing output yet)
    Fast3D (16 vertex cache)
    4Tri (GE/PD Fast3D Extension) (Not Yet)
    F3DEx (32 Vertex cache)
  Portals (use mesh name "PortalA-B")
  Animations - TranslateRotate
       Needs flag IsAnimate else Pre-Calc matrix
       using $point = $transformMat.Project($point);
Attributes (Case in-sensitive):
uCode   - Define EITHER a String Attribute with name "uCode" with:
            Define an Attribute of ANY type with name:
                  Fast3D (default)
4 Triangles Extension - Define an Attribute of ANY type with name "TRI4_Ext"
Vertex Cache Override - Define an Integer with name "VtxCacheOvr" (Not Recomended)
Integer Vertices            - Define a Boolean with name "IntVtx" (Default False)
Optimization Level    - Define an Integer with name "Optimize"  (Disabled)
                                   0 None
                                   1 Trim Duplicate Vertices   (Default)
                                   2 Sort Triangles                   (Recomended)
                                   3 Trim Vertices Aggressive (Not Recomended)
                                               Ignore ST and RGBA, Force Integer Vertices

   Lighting              - Define a Boolean with name "G_LIGHTING" (Default false)
   Fog                   - Define a Boolean with name "G_FOG" (Default True)
   Auto Sun (Static      - Define a Point with name "AutoSun" (Default False)
          Vertex Shading)  X = Direction(0-360) (North = 0, East = 90 etc)
                           Y = Azimuth (0-90) where 0 is the Horizon


Result C attached as txt

Code: [Select]
* Export object "object01"
* Do not edit this file. It was automatically generated
* with Anim8or 1.01 Build 1.01.1378+
* from File "test.an8"
* Using uCode Fast3D

/* Define Textures */

 * Texture image format :
 *     G_IM_FMT_RGBA(RGBA format)
 *     G_IM_FMT_YUV (YUV format)
 *     G_IM_FMT_CI  (CI format)
 *     G_IM_FMT_IA  (IA format)
 *     G_IM_FMT_I   (I format)
 * Bit Depth :
 *     G_IM_SIZ_8b  (8 bits / texel)
 *     G_IM_SIZ_16b (16 bits / texel)
 *     G_IM_SIZ_32b (32 bits / texel)
 * S T Flags :
 *     G_TX_MIRROR  (enable mirror operations)
 *     G_TX_NOMIRROR(disable mirror operations)
 *     G_TX_WRAP    (enable wrap operations)
 *     G_TX_CLAMP   (enable clamp operations)

    gsDPSetCombineMode(G_CC_SHADE, G_CC_SHADE),\
    gsDPSetRenderMode(G_RM_PASS, G_RM_AA_ZB_OPA_SURF2),\

/* Assign the corect values for brickdetail4colour Including any Mip-Map Tiles at end. */
#define BRICKDETAIL4COLOUR_Width  32
#define BRICKDETAIL4COLOUR_Height 32
    /* When detail texture not used, Tile0 is empty  */                                                                  \
    gSPTexture(glistp++, 0x8000, 0x8000,                                                                                 \
               5,                     /* Mipmap level  */                                                                \
               G_TX_RENDERTILE + 1,   /* Tile number of highest-resolution mipmap  */                                    \
               G_ON);                                                                                                    \
    gsDPPipeSync(),                                                                                                      \
    gsDPLoadTextureBlock(&brickdetail4colour,                                                                                             \
                         G_IM_FMT_RGBA, G_IM_SIZ_32b, /* Format, BitDepth */                                             \
                         BRICKDETAIL4COLOUR_Width, BRICKDETAIL4COLOUR_Height, 0,                                                                         \
                         S Flags, T Flags,            /* Clamp/Wrap/Mirror */                                            \
                         BRICKDETAIL4COLOUR_MaskS, BRICKDETAIL4COLOUR_MaskT,          /* Pow 2 Bounds for flag, eg  use 5 for a 32x32 texture (5^2=32) */\
                         ShiftS, ShiftT),             /* Use G_TX_NOLOD*/                                                \
  /* (From here, do gsDPSetTile, gsDPSetTileSize for the next tile) */                                                   \


Edit 21:34, Added more draw commands
Edit 02:36, Added Triangle sorting, Auto Sun Baking, some other flags.

Ongoing Anim8or Development / Re: ASL issues
« on: May 06, 2020, 05:41:18 pm »
Yes, all the more confusing as to why tridata only has 1 coloured vertex

Possibly my bad... I missed something from the obj plugin


Ongoing Anim8or Development / Re: ASL issues
« on: May 06, 2020, 01:38:07 pm »
Thanks, I wasn't sure where to post, its ASL but its related to current dev so I chose the later:)

Ive noticed that tridata doesn't seem to keep triangle RGB separate, i.e. I had one triangle which was green, but the tridata only had one of the verticies use that material with the other 2 using other materials.
Is there a pattern here? or is it random?


Ongoing Anim8or Development / ASL issues
« on: May 05, 2020, 09:46:24 pm »
ASL Bugs and Feature requests as of Build 1379

Nested If statements cannot return to caller, an8 hangs, turns white, titlebar states (Not Responding) and console stops output.
Code: [Select]
// Return True if Vertex Exists, Save NewID Mapping to $gVtxIDMap
int $VertexExists(point3 $xyz, string $uv, point3 $rgb, int $a)
int $i, $r;

for ($i = 0; $i < $gXYZs.size; $i++)
$DebugPrint(PrintToString("Compare to %d", $i));
// cant do && "Illegal Type arg"
if (($xyz.x == $gXYZs[$i].x) && ($xyz.y == $gXYZs[$i].y) && ($xyz.z == $gXYZs[$i].z))
if ($uv == $gSTs[$i])
if (($rgb.x == $gRGBs[$i].x) && ($rgb.y == $gRGBs[$i].y) && ($rgb.z == $gRGBs[$i].z))
if ($a == $gAs[$i])
$gVtxIDMap[$gVtxIDMap.size - 1] = $i;
//return true;
$r = 1; //BUG cannot return from here, this makes script wasteful
return $r;

Attributes cannot return NULL...
workaround: Use a global Attribute and use Push/Size = 0
Code: [Select]
//return $gCurObject.GetAttribute($i);
//return NULL;
$gLookupAttributeUcase.size = 0;

As Documented already Recursion is not supported, however it would be good to support for parsing trees.
Code: [Select]
void $ParseChildren(shape $Shape)
$DebugPrint("Parsing Children " + $;

if ($Shape.GetKind() == SHAPE_KIND_GROUP)
//Recursion Not Supported
$ConsolePrint("Groups are not supported\n");

I also put together some functions for people to use but hope for native support for them instead.
Code: [Select]
// Returns Index to start of $Contains if within $Base.
// Returns False if $Base does not contain $Contains
int $StringContains(string $Base, string $Contains)
int $i;
string $Comparitor;
for ($i = 0; $i < ($Base.length - $Contains.length); $i++)
$Comparitor = $Base.SubString($i, ($i + $Contains.length));
if ($Comparitor == $Contains)
return  $i + 1;
return 0;

// Split String $Base anywhere $Split occurs
// Returns Array (via $gSplit) of Strings
int $StringSplit(string $Base, string $Split)
int $r, $Start, $End;
while ($StringContains($Base.SubString($Start, $Base.length), $Split))
$End = $StringContains($Base, $Split);
$gSplit.push($Base.SubString($Start, $End - 1));
$Start = $End + $Split.length;
return $r;

// Returns String as UPPER CASE
string $StringToUpper(string $str)
int $i, $t;
string $r;
for ($i = 0; $i < $str.length; $i++)
$r = $r + "a";
$t = $str.GetChar($i);
if ($t >= 97 && $t <= 122)
$t = $t - 32;
$r.SetChar($i, $t);
return $r;

// Looks up Attribute by Name (Case-insensitive)
void $LookupAttributeUcase(string $str)
int $i;
attribute $temp;
string $ucase;
$ucase = $StringToUpper($str);

for ($i = 0; $i < $gCurObject.GetNumAttributes(); $i++)
$temp = $gCurObject.GetAttribute($i);
if ($temp.GetName() == $ucase)
//return $gCurObject.GetAttribute($i);
//return NULL;
$gLookupAttributeUcase.size = 0;

I also took the documentation and put it in a h file for use in VS.
I shifted the comments round so it works with Intellisense and word completion as you type.

Which reminds me, any chance of ignoring #include "a8s.h" and then including other script files?
Also #if(0) #endif would be good to block certain code blocks from functioning

Many Thanks

Ongoing Anim8or Development / Re: Sound in Anim8or
« on: May 03, 2020, 10:44:46 am »

I also show a flat line on .wav.

You should update the sticky too (its still 1363)


yeah, Ambientoccluder too


Hope you are well Steve.

Just wondering the current state of an8, would adding the basic attributes as simple checkboxes be a quick enough task? I think it was mentioned before.

I just keep forgetting the exact spelling of each attribute and whether or not its an int or string etc.


Any updates for 2020?


Ongoing Anim8or Development / Re: Initial CAD-style feature
« on: December 23, 2019, 06:20:43 am »
I thought of another suggestion that I tried to do manually recently but would be great if it was better supported natively - Cross-Sections

To do this manually you have to move your viewpoint as far "forward" as possible until eventually you start clipping the model.

The problem with this method is that it a) takes a long time, b) has to be re-set if you rotate around the model.

I would imagine the implementation either being across the world 0 point (X Y and Z planes) or a knife-like tool to set your own Cross-Sectional Viewport.


Anim8or v0.98 Discussion Forum / Re: Feature Request Thread
« on: December 23, 2019, 06:14:17 am »
Why is anyone still using An8 0.98?

There are some CAD functions in 1.0.1.x but here I will second that they need some love too.


There are 3 "locations" in an8.
1st is each vertex has a location, which is relative to the mesh location
2nd is mesh location which can but doesn't have to be the center of the mesh. This is relative to world.
3rd is "Pivot" location, which is the Red Green and Blue lines normally at the mesh origin (0,0,0) but doesn't have to be.

the 3rd allows you to rotate a mesh around another location so you are not stuck having to rotate them move the mesh round a joint for example.

Suggestion, Can the pivot point be aloud to snap to grid please. Can it also have a dialogue box for exact placement.


Ongoing Anim8or Development / Re: About this forum
« on: August 03, 2019, 06:42:09 pm »
Whoops, that spambot made me think it was new


Ongoing Anim8or Development / Re: About this forum
« on: August 03, 2019, 05:42:21 am »
Sounds great Steve.

I always wanted the dev build to be more regular even if less stable.

As for restricting posting to topics created only by yourself I don't see a problem so long as there is a topic about each build so people can post about it without resorting to the v1 board.

If you wanted to say close build topics, I would advise a delay in doing so to allow rollback from an unstable feature but still allowing things to be found about the previous build. (again, to stop cross build posting)


Things seem rather quiet on the development front.

What is on the agenda for future releases and are you close to another build?


can you add "fixate" to stereo view so that both sides move when moving either the camera or alt - last time I checked only one side moves which breaks the stereo vision without reselecting the view from menu.
also can you add "swap eyes" to enable cross-eye or vr viewing.

actually, on the subject of vr, you wouldn't be able to add full screen workspace and custom ratio to stereo too? what I mean is, with the Oculus I was able to use a desktop VR app that literally splits the screen down the middle for left and right however it kept the original desktop ratio so the image appears stretched.


Pages: [1] 2 3 ... 14