Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

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.

Topics - freesailor

Pages: [1]
1
General Anim8or Forum / so what gives???
« on: December 11, 2010, 08:20:27 am »
so I'm trying to create bones for a figure, but every time I try to make the left hip, it adds the bone to the last one ... why???grrrrrrrr


never mind,I found out what I was doing wrong... but its kinda confusing how you add bones in different places... sheesh...

2
so, having finished my first scene, I decided to try something a little more complex... an old style steam locomotive...
attached is an image of as far as I've gotten from a photo I found on the WWW... but I'm hung up on the "Baker Valve Lever"...
so, if any of you guys have pictures or drawings of old locomotives, I'd appreciate it if you would post them or email them to me...
Also need some advice on the materials marked on the render, tried the materials database on anim8or.org... not so good...
messed with them for an hour, bur I can't seem to find the right set of values...grrrrrrrrr
thanks in advance...
freesailor
aloha

3
ASL Scripts / help!!!
« on: November 30, 2010, 08:59:21 am »
can anyone tell me what is going here???(attached image) I'm trying to draw a circle with ASL, but for some(probbly simple) reason, it only draws verti(?) up to 251...the circle is supposed to have 360 points and vertices...
here's the partial code:
Code: [Select]

               $z=0; $inc = ($z*PI)/180; $x = 0; $y = 0;
$circle.OpenFace(0,0);
for $i = 0 to 360 do
{
$x = cos($inc)*$h; $y = sin($inc)*$h;
$circle.VertexN($circle.AddPoint(($x, $y, 0)));
$z = $z+1;
$inc = ($z*PI)/180;
}
$circle.CloseFace();
I can't figure it out, it draws the full circle if I use 2 degree increments, but not with one...grrrrrrr
as you can see, I'm only getting about 70% of the circle... but all the points are there????javascript:void(0);

thanks
and
aloha
freesailor

4
Finished Works and Works in Progress / first scene
« on: November 27, 2010, 09:00:04 pm »
here's my first scene render... its more a study in light and shadow.. i'm a pretty lousy modeler.. but i needed to do SOMETHING with the stairs i wrote a plug-in for... lol


oh, i would really like to have wires for the telephone, but am having no luck myself(lousy modeler)... would appreciate it if someone could show me how to model an electric wire... tnx
aloha...

5
ASL Scripts / setting materials in ASL
« on: September 21, 2010, 10:36:07 pm »
hello all....
I'm a noob to anim8or and ASL... been playing with anim8or for a couple of months and decided i could use some plug-ins for my models of houses, specifically the windows. I have tried ever possible permutation of SetMaterial to try and set the window frame to one material and the glass to another, none of which works... sooooo... is this possible with a script??? the docs say I should be able to do this, but as I said, I'm sure I've tried every combination of instructions with no luck.... the resulting model .an8 file shows only face 4 4 0 -1(trim) (no face 4 4 1 -1(glass)).. could sure use some help with this, as most of my plug-ins will need to have at least two materials.
    I've read most of the posts and find no subjects addressing this problem,(maybe i'm just too stoopid to realize my mistake...lol), but at the same time I saw a lot of requests for a script hat would make an ASL plug-in from a model, so I wrote this little gem which will do just that for most simple! models...its works fine on my windows(some have over a thousand faces!!!). I'm not sure if it is allowed to post  a perl script on this board, but I have no website to post it to.... so here it is:
                                                       Model2script.pl (m2s.pl)

#!/perl/bin/perl
##### Windows perl = http://www.activestate.com/activeperl/downloads ActivePerl-5.8.8.822-MSWin32-x86-280952.msi... free!!!!
##### a little script that extracts the points and faces from an anim8or model.an8 file
##### then uses them to write them to write an .a8s script...
##### command line = c:\>m2s.pl model-name.an8... this program expects the model to be in C:/anim8or/projects
##### output =  c:/anim8or/scripts/model-name.a8s
##### notes: 1. output is formatted for Notepad... arial/regular 12 pt...
#####        2. this will only extract the first mesh of a model... so <join solids> and <convert to mesh> the model first....
#####        3. you will have to apply texcoords to the generated model yourself... it was becoming too much of a chore as it was...
#####        4. the plug-in will show as the default electric plug... you'll have figure out the bit map button yerself... lol
#####        5. the newly generated parametric is NOT editable, even if you convert it to a mesh...if you need to edit the new model,
#####           save it first, reopen he saved model and then you can do any editing.....
#####           I haven't really figured out how the meshes are drawn orignally, so the script creates double points for some faces...
#####           but saving it will remove the extra points and then all is well.... rick... FIXED!!!...sorta... lol
use strict;
use warnings;
our ($s, $ps, $x, $fp, $file, $i, $f, @pts, $p, $l, $fs, $ts, $ii, $pc, $sx);
our $spaces = " "x50;
$file = shift;     
open IN, "<C:/anim8or/projects/$file"; print "Working with $file\n";
while (<IN>)
{
   if ($_ eq "    points {\n")
   {
   while ( <IN> )
      {
      if ( $_ eq "    }\n" ){goto faces;} # can't modify $_ ... and a little lesson in regex ... lol
      $s = $_;                                  # $s = "            (x.xxxxx x.xxxxx x.xxxxx) (x.xxxxx x.xxxxx x.xxxxx) "   ...etc.
      $s =~ s/^\s+//;                         #       ^^^^^^                                                     remove these leading spaces...
      $s =~ s/\s{1}/\,/g;                   #                     ^       ^        ^        ^       ^        ^ substitute "," for " "
      $s =~ s/\),/\)\; /g;                   #                                                                ^ substitute "); " for "),"
      $s =~ s/\s\,$/ /;                      #                                                                ^ substitute " " for trailing " ,"
      $ps .= $s;                               # append the line to a new string      
      }
   }
faces:
if ($_ eq "    faces {\n")
   {
   $i = 0; $ts=""; $ii = 0;
   while ($s = <IN>)
      {
      if ( $s eq "    }\n" ){goto done;} 
      $s =~ s/^\s+//;
      if ( $s !~ /\)\s\)$|\)\s\)\s$/ )
         {
         $sx = <IN>; $sx=~ s/^\s+//;
         $s .= $sx;
         $s =~ s/\)\(/) (/;
         }
      $s =~ s/(\d+)\s(\d+)//;
      $fs .= "\$faces\[$ii\] = ($1, $2); ". substr ($spaces, 0, 20-(17+(length($1)+length($2)-length($ii))));
      $ii++; if ( $ii%6 == 0 ){$fs .= "\n";}
          $s =~ s/(\s\d*\s)(\-\d*\s\(\s)//;
      while ( length($s) > 3 )
         {
         $s =~ s/\((\d*)\s\d*\)\s//;
         $s =~ s/\((\d*)\)\s//;
         $ts .= "\$q[$i] = $1; ". substr ($spaces, 0, 20-(14+length($1)+length($i)));
         $i++; if ( $i%10 == 0 ){$ts .= "\n";}
         }
      }
   }
}
done: close IN;                                     # if you want more then one plug-in generated by this script, you'll need to change         
                                                    # \$basic to something else(\$basic2 comes to mind...lol)all thru this script...
$fp = "/*$spaces m2s.pl generated script for: $file. By: Freesailor Raceware */\n
/* Define Directives */
\#plugin(\"object\", \"mesh\", \"Basic\")\;
\#return(\$basic)\;

/* Declare Variables */
shape \$basic;
int \$i, \$x, \$pc, \$q[$i];\n";                   
@pts = split (" ", $ps);                            # split string into an array...
$x = scalar(@pts)-1; $f = $x+1; $l = 0;             # $x = numer of array elements...
$fp.= "point3 \$p[$f];
point2 \$faces[$ii];\n
/* Make Assignments */\n";
for $i ( 0..$x )                                    # get largest array element length...
   {
   if ( length( $pts[$i] ) > $l )
      {
      $l = length( $pts[$i] )
      }
    }
$l = $l+11; $f = 0;                                 # this works up to array element 999... if array is larger change 11 to 12...
for $i ( 0..$x )
   {
   $p = "\$p\[$i\] = $pts[$i] ";               # here we format the output to print the correct asl assignment instruction...               
                                                    # if you modify for all meshes..
   $p .= substr ($spaces, 0, $l-length($p));   # make it look pretty...
   $fp.= $p;                                   # append to final print line...
   $f++; if ($f == 4) { $fp .= "\n"; $f = 0; } # $f = number of point3 arrays per line...
   }
$fp .= "\n$fs\n\n$ts\n";                                # add our face and face vertex index arrays to the print line...then the code to execute...
$fp .= "
/* Draw Parametric */
\$pc = 0;
\$basic.Open();
for \$i = 0 to \$p.size-1 do
   {
   \$basic.AddPoint(\$p[\$i]);
   }
   for \$i = 0 to \$faces.size-1 do
      {
      \$basic.OpenFace(0,4);
      for \$x = \$pc to \$pc+(\$faces[\$i].x-1) do
          {
         \$basic.VertexN(\$q[\$x]);
         }
      \$basic.CloseFace();
      \$pc = \$pc+\$faces[\$i].x;
      }
\$basic.Close();
\n";
$fp .= "/*$spaces script for $file$spaces */";
print "\n$fp\n";
$file =~ s/.an8/.a8s/;
open OUT, ">C:/anim8or/scripts/$file";
print OUT "$fp\n";
close OUT;
exit;
hmmmm.. comments didn't copy so well, but you get the idea...lol
as the script comments, it does have some flaws, but will create a .a8s script that duplicates your model(simple ones please!!!)
aloha
freesailor



Pages: [1]