Anim8or Community

Please login or register.

Login with username, password and session length
Advanced search  

News:

Ian Ross has just released a book on Anim8or. It's perect for a beginner and a good reference for experienced users. It contains detailed chapters on every aspect, with many examples. Get your own copy here: "Anim8or Tutorial Book"

Author Topic: Exporting in roblox format (.mesh)  (Read 22947 times)

ANormalUsername1

  • Newbie
  • *
  • Posts: 5
    • View Profile
Exporting in roblox format (.mesh)
« on: September 21, 2008, 03:50:47 pm »

I need help with exporting in .mesh format.

I need help with exporting, because when I export it, the points in the mesh don't show up, or it doesn't export it fully.

I got this script strieght from the roblox wiki:

/*
  Description: Add this to your Anim8or scripts directory and start Anim8or. The script MUST have the ".a8s" extension and be in the Anim8or Scripts folder. Make sure that "Preload Scripts" is set to ON (this is NECCESSARY). This script has been tested for 0.95 and 0.97 preview.
*/


#plugin("object", "export", "Roblox Mesh", ".mesh");
#file($output, "text");
#return($result);

file $output;
int $result;
object $obj;
shape $shape, $shapes[1], $childShapes[1];
tridata $data;
material $mat;
int $numFaces;
point3 $point, $normal, $color;
point2 $uv;
int $i;
int $j;
int $index, $mIndex;
int $count;
float $gCol;
string $nm;
string $newName;
float4x4 $tMatrix;

$nm = $output.GetRoot();

$obj = project.curObject;
$output.print("version 1.00\n");
$obj.GetShapes($childShapes);
$shapes.size = 0;
while($childShapes.size > 0)
{
    $shapes.push($childShapes.pop());
}
while($shapes.size > 0)
{
       $shape = $shapes.pop();
       $shape = $shape.ConvertToMesh();
   $data = $shape.GetTriangleData();
          $numFaces = $data.GetNumTriangles();
   $tMatrix = $shape.GetGlobalTransform();
   $output.print("%d\n",$numFaces);
   for $i = 0 to $numFaces - 1 do {
      for $j = 0 to 2 step 1 do {
         $index = $data.GetIndex(($i*3)+$j);
                       $point = $data.GetPoint($index);
                      $point = $tMatrix.Project($point);
                       $normal = $data.GetNormal($index);
                       $uv = $data.GetTexCoord($index);
         $output.print("[%.6g, %.6g, %.6g]", $point.x, $point.y, $point.z);
         $output.print("[%.5f, %.5f, %.5f]", $normal.x, $normal.y, $normal.z);
         $output.print("[%.5f, %.5f, 0]", $uv.x, $uv.y);
                }
   }
}


$result = 1;



I would be grateful If someone could help.
Logged

ANormalUsername1

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Exporting in roblox format (.mesh)
« Reply #1 on: September 21, 2008, 03:56:59 pm »

It would say

version 1.00
144

with 144 being the amount of points in the mesh.
Logged

ANormalUsername1

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Exporting in roblox format (.mesh)
« Reply #2 on: October 05, 2008, 06:26:31 pm »

Anybody???
Logged

NickE

  • Full Member
  • ***
  • Posts: 168
    • View Profile
Re: Exporting in roblox format (.mesh)
« Reply #3 on: October 05, 2008, 07:00:40 pm »

Are you using the latest version?  I had no problem with the script in version 0.97d.  Version 0.97b had a bug that broke export scripts.

I am not familiar with roblox, but the script did write a text file with a .mesh extension containing data in the format specified in the script.
Logged

ANormalUsername1

  • Newbie
  • *
  • Posts: 5
    • View Profile
Re: Exporting in roblox format (.mesh)
« Reply #4 on: October 11, 2008, 02:49:49 pm »

~MOD EDIT: link removed - Floyd86~ I didn't know that. I guess I need to update.
« Last Edit: March 03, 2009, 12:41:41 pm by floyd86 »
Logged

Tay Zonday

  • Newbie
  • *
  • Posts: 10
  • Check me out on Youtube! Youtube.com/TayZonday
    • View Profile
Re: Exporting in roblox format (.mesh)
« Reply #5 on: October 13, 2008, 01:32:32 pm »

It works for me...
Logged
Allow me to introduce myself
My name is Tay
It's T-A-Y, T-A-Y to the Z.

-Credits to Joe-

jabermony

  • Newbie
  • *
  • Posts: 3
    • View Profile
Re: Exporting in roblox format (.mesh)
« Reply #6 on: March 03, 2009, 11:41:05 am »

i get that problem i made a new head and only the sphere showed up
Logged