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.

Messages - Kubajzz

Pages: 1 2 [3] 4 5 ... 34
31
ASL Scripts / Re: assistant~script reverse normals !
« on: March 22, 2010, 05:44:05 pm »
Interesting script BOB_I_Ts!

If the normals are reversed, you need to reverse the order of vertices in each face. Change the loop where you are calling "VertexN" to make it go the opposite way, that should fix the problem...

I guess you are going to use this script for your generic head script... Good luck with that, I'd love to see it finished.

32
General Anim8or Forum / Re: Old anim8or versions?
« on: March 20, 2010, 04:47:12 pm »
Amazing! I always wanted to see this! Thank you!

33
There was a topic about this recently, you can get v0.6 there:

http://www.anim8or.com/smf/index.php?topic=3208.0

34
Anim8or Challenges / Re: [ COMPLETE ] Challenge #14: Sports equipment
« on: March 19, 2010, 08:11:14 pm »
Oh, I'm sorry for being a little late :)

Thanks to all and congratulations to those who finished this challenge!

35
General Anim8or Forum / Re: Running scripts
« on: March 19, 2010, 08:06:49 pm »
...say it's found problems in line X

If this is all the information you can provide, the only thing I can say is "sorry, I can't help you..."

I'm getting tired of this...

Ok, let's try once more: What exactly was the error message in the output window? What was the line number? What about posting a screenshot?

btw. I bet the problem is an old version of Anim8or (like Bob_I_Ts said...). Try downloading v0.97 preview...

36
General Anim8or Forum / Re: Running scripts
« on: March 18, 2010, 04:34:14 pm »
...it comes up with some code, says its found some errors and the whole program closes...

...There were no error messages

Huh?

Like Bob_I_Ts said, it might be caused by an old version of Anim8or. If that is not the case, you will really have to provide more information (what about a screenshot?)

37
General Anim8or Forum / Re: Running scripts
« on: March 16, 2010, 05:00:19 pm »
I think you will have to provide more information. For example, which script exactly did you try to run? What exactly did you do before Anim8or crashed? What error messages did you get? What kind of project was open at the moment? The more information you provide, the better the chance that you will get help.

38
ASL Scripts / Re: A question...
« on: March 15, 2010, 06:18:38 am »
All the letters and numbers are simply your .an8 project. All your models, morph targets, figures, sequences, scenes, everything is stored in the file.

39
Anim8or Challenges / Re: Challenge #14: Sports equipment
« on: March 15, 2010, 06:13:21 am »
The poll is up!

It's time to choose the winner of this round. Thank you all for the great entries!

40
Anim8or Challenges / Re: Challenge #14: Sports equipment
« on: March 13, 2010, 06:53:55 pm »
Good job guys! Here is my entry. This was originally supposed to be a test render, but I ran out of time...

41
ASL Scripts / Re: !Attributes
« on: March 13, 2010, 06:48:33 pm »
Yes. Check the "attribute" type and the "object.GetAttribute()" and "object.LookUpAttribute()" functions.

Here is a very, very simple example of a script that gets its input from an attribute:
Code: [Select]
#command("object");

attribute $Attr;
string $UserInput;
file $Output;

/* Get value from an attribute */
$Attr = project.curObject.LookupAttribute("AttributeNameHere");
if ($Attr != NULL) {
  $UserInput = $Attr.GetStringValue();
}

/* Print it to the console */
$Output.open("$console", "w");
$Output.print($UserInput);
$Output.close();

42
ASL Scripts / Re: flat planes : generate in rows and column
« on: March 12, 2010, 06:18:33 pm »
Hi, it's really good to see you back!

It looks like you need to practice ASL more often ;)



I looked into your code and I found a few problems:

#1
Code: [Select]
if ($face < $total) {
  for $face = 1 to $total do {
    $grid.OpenFace(0,4);
    $grid.VertexN($face);
    $grid.VertexN($face + 1);
    $grid.VertexN($xd + ($face + 2));
    $grid.VertexN($xd + ($face + 1));
    $grid.CloseFace();
    $face = $face + 1; /* Useless... */
  }
}
The "if ($face < $total)" condition is useless, because it is checked implicitly by the "for" cycle. Also the last line inside the cycle makes no sense to me - you don't have to increment the "$face" variable yourself, the "for" cycle does it for you...

Anyway, I think it would be better to write 2 nested cycles, the inner cycle will build one row and the outer cycle will build the whole plane... The reason is simple - your cycle goes through all points, which also includes for example face {3, 4, 8, 7} (see your picture) and that makes no sense... Maybe the code in your last post solves this issue, but I really can't understand what that script is doing...

So this is what I think this piece of code should look like:
Code: [Select]
int $NumPointsInRow;
$NumPointsInRow = $xd + 1;

/* The outer cycle builds all rows */
for $i = 0 to $NumPointsInRow * ($zd - 1) step $NumPointsInRow do {

  /* The inner cycle builds all faces in one row */
  for $j = 0 to $xd-1 do {

    $grid.OpenFace(0,4);
    $grid.VertexN($i + $j);
    $grid.VertexN($i + $j + 1);
    $grid.VertexN(($i + $NumPointsInRow) + $j + 1);
    $grid.VertexN(($i + $NumPointsInRow) + $j);
    $grid.CloseFace();

  }
}


#2
The piece of code where you build your points was all pretty messy, too complicated and unreadable... The following code does the same and is in my opinion much easier to understand:
Code: [Select]
for $i = 0 to $zd do {
  for $j = 0 to $xd do {
    $p.x = $j * $stepx;
    $p.z = $i * $stepz;
    $grid.AddPoint($p);
  }
}
...compared to your original code...
Code: [Select]
$index[$k] = $grid.AddPoint($p);

for $i = 1 to ($zd + 1) do {

$index[$k] = $grid.AddPoint($p);

for $j = 1 to $xd do {
$p.x = $p.x + $stepx;
$index[$k] = $grid.AddPoint($p);
$i = 1;
}
$p.z = $l * $stepz;
$l = $l + 1;
$p.x = 0;
}



I did a few more minor changes to make the whole thing more readable. I also noticed a few things in your code that might be considered "bad practice" (I hope you don't mind if I point them out...). For example:
  • The "for" cycles should start from 0 in most cases, because most of things in ASL (arrays, points, faces) are indexed from 0
  • It's generally considered "bad" and "dirty" programming style to edit the iteration variable inside a "for" cycle and it's a big source of impossible-to-find bugs
  • As you surely know, it always helps to give your variables meaningful names...
  • I personally like indenting the code inside enclosed blocks (such as "if" and "for") to make it more readable
  • The most important rule: The code should always be readable and easy to understand. This does not necessarily mean "the shorter, the better". For example your script could be made much shorter by combining the point-building and face-building routines into one cycle, which might also increase the performance, but the result would be very difficult to read and debug. However, in most cases "short = simple = easy to read"...

This is what the final product looks like:
Code: [Select]
#plugin("object", "mesh", "gridtest");
#parameter("x division", int, 3, 1, 10);
#parameter("z division", int, 3, 1, 10);
#parameter("X scale", float, 40, 2, 1000.0,scale,scale_x);
#parameter("z scale", float, 40, 2, 1000.0,scale,scale_z);
#return($grid);
#button(24, 24, 2, 0x0000000000, 0x0000000000, 0x0000000000, 0x0000000000, 0x0000001800, 0x0000001800, 0x0000000000, 0x0000000000, 0x0000001800, 0x0000001800, 0x0000001800, 0x0000001800, 0x0000001800, 0x0000001800, 0x0000001800, 0x0000001800, 0x0000001800, 0x0000001800, 0x0000001800, 0x0000001800, 0x0000001800, 0x0000000000, 0x0000000000, 0x0000000000);

shape $grid;
float $xs,$zs,$stepx,$stepz; 
int $xd,$zd,$i,$j,$NumPointsInRow;
point3 $p;

$xd = parameter("x division");
$zd = parameter("z division");
$xs = parameter("X scale");
$zs = parameter("z scale");

$stepx = $xs/$xd;
$stepz = $zs/$zd;

$grid.Open();

/* Build points here */
for $i = 0 to $zd do {
  for $j = 0 to $xd do {
    $p.x = $j * $stepx;
    $p.z = $i * $stepz;
    $grid.AddPoint($p);
  }
}

/* Build faces here */
$NumPointsInRow = $xd + 1;
for $i = 0 to $NumPointsInRow * ($zd - 1) step $NumPointsInRow do {
  for $j = 0 to $xd-1 do {
    $grid.OpenFace(0,4);
    $grid.VertexN($i + $j);
    $grid.VertexN($i + $j + 1);
    $grid.VertexN(($i + $xd + 1) + $j + 1);
    $grid.VertexN(($i + $xd + 1) + $j);
    $grid.CloseFace();
  }
}

$grid.Close();

That's all. I hope I helped you, should you have any questions I'm here for you ;)

44
Anim8or Challenges / Re: Challenge #14: Sports equipment
« on: March 09, 2010, 05:18:21 pm »
Good job Johnar! I agree with Simon, I think you should keep the letter.

Quote from: johnar
Do they wax the bottom of those, like a surfboard?

Haha, I believe they don't, there are steel blades at the bottom... But I'm not sure ::)

Quote from: $imon
Kubajzz.. great shape you have going on! Just a note; you might want to make a seam in the front part, the nose moves seperately from the back of the sleigh in a lot of occasions.
Bobsleighs are usually covered in a nice carpaint-like material.. check the new dotan8 for some tips ;) not that you need it.. just making advertisement here.

Oh, thanks! Honestly, I don't know anything about bobsleighs, I've only seen one standing in the middle of a shopping mall here in the city... Now you told me about the front and back being separated I googled some more information and it looks like I have some more work to do :)

As for the material, I was thinking about reflections like that... I really enjoyed your tutorial by the way ;)

45
Anim8or Challenges / Re: Challenge #14: Sports equipment
« on: March 09, 2010, 04:24:46 am »
Nice models Johnar, the meshes look very clean! I'm really curious to see the rocket strings finished, are you going to model them or use a texture?

$imon, I don't know how you do it, but whatever you create looks awesome, even if it is just a simple test render... I hope to see more soon!

Here is the start of my entry, a 2-man bobsleigh. Still have a long way to go...

Pages: 1 2 [3] 4 5 ... 34