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"

Pages: [1] 2 3

Author Topic: I'm working on an XSI export script modifying Raxx's BZII X exporter script.  (Read 45422 times)

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.

This is what I have so far. 3D Exploration shows these errors.
Code: [Select]
/*
* This plugin pieced together from Joe Cooning and Zaidon's
* .X exporters with some independent work.
*
* Written by Raxx, this is compatible with the Battlezone II
* Combat Commander game engine and being modified by BNG for use with BZII as an XSI variant of Raxx's X variant.
*
* Copyright 2012 Randall Bezant.  Permission granted for
* modification and use, including commercial use.  Source
* distribution must include this copyright.
*/

#plugin("object", "export", "BZ II XSI", ".xsi");
#file($output, "text");
#return($result);

file $output;
int $result;

object $curObject;

$curObject = project.curObject;
$output.print("xsi 0101txt 0032\nSI_CoordinateSystem coord\n\n {\n1;\n0;\n1;\n0;\n2;\n5;\n}\n\n");

shape $shape, $shapes[1], $childShapes[1];
tridata $mdata;
int $numPoints, $numFaces, $numMaterials;
int $ii;
point3 $point, $normal, $tr1, $tr2, $tr3, $tr4;
point2 $uv;
float4x4 $transformMat;
string $matName, $texFile;
material $material;
texture $tex;

/* The shapes in $shapes are processed in reverse order so */
/* reverse the array of values that GeetShapes returns:    */

$curObject.GetShapes($childShapes);
$shapes.size = 0;
while ($childShapes.size > 0)
    $shapes.push($childShapes.pop());

while ($shapes.size > 0) {
    $shape = $shapes.pop();

    /* If $shape is a group push child shapes onto stack: */

    if ($shape.GetKind() == SHAPE_KIND_GROUP) {
        $shape.GetShapes($childShapes);
       
        while ($childShapes.size > 0) {
            $shapes.push($childShapes.pop());
        }
    } else if ($shape.GetKind() == SHAPE_KIND_PATH ||
               $shape.GetKind() == SHAPE_KIND_MODIFIER ||
               $shape.GetKind() == SHAPE_KIND_TEXT)
    {
        /* No 3D mesh to output. */
    } else {

  $mdata = $shape.GetTriangleData();

  $output.print("Frame Frm-%s {\nFrameTransformMatrix {\n", $shape.name);
   
        $transformMat = $shape.GetGlobalTransform();
        $tr4=$transformMat.Project((0.0,0.0,0.0));
        $tr1=$transformMat.Project((1.0,0.0,0.0))-$tr4;
        $tr2=$transformMat.Project((0.0,1.0,0.0))-$tr4;
        $tr3=$transformMat.Project((0.0,0.0,1.0))-$tr4;
        $output.print("  %.6f,%.6f,%.6f,0.000000,\n",$tr1);
        $output.print("  %.6f,%.6f,%.6f,0.000000,\n",$tr2);
        $output.print("  %.6f,%.6f,%.6f,0.000000,\n",$tr3);
        $output.print("  %.6f,%.6f,%.6f,1.000000;;\n }\n",$tr4);
       
               
        $output.print("Mesh %s_mesh {\n", $shape.name);

        $numPoints = $mdata.GetNumPoints();
        $output.print("%d;\n", $numPoints);
        for $ii = 0 to $numPoints-1 do {
            $point = $mdata.GetPoint($ii);
$point.z =$point.z * -1;
            $output.print("%.6f; %.6f; %.6f;", $point);
if ($ii<$numPoints-1){
  $output.print(",\n");
} else {
  $output.print(";\n");
}
        }

        $numFaces = $mdata.GetNumTriangles();
        $output.print("%d;\n", $numFaces);
        for $ii = 0 to $numFaces - 1 do {
$output.print("3;%d,%d,%d;", $mdata.GetIndex($ii*3 + 2), $mdata.GetIndex($ii*3 + 1), $mdata.GetIndex($ii*3));
if ($ii<$numFaces-1){
   $output.print(",\n");
} else {
  $output.print(";\n");
}
        }
    $output.print("MeshMaterialList {\n");
        $numMaterials = $mdata.GetNumMaterials();
  $output.print("%d;\n", $numMaterials);
  $output.print("%d;\n", $numFaces);
  for $ii = 0 to $numFaces - 1 do {
$output.print("%d", $mdata.GetMatIndex($ii));
if ($ii<$numFaces - 1) {
  $output.print(",\n");
} else {
  $output.print(";\n");
}
  }
        for $ii = 0 to $numMaterials - 1 do {
            $material = $mdata.GetMaterial($ii);
$tex = $material.GetTexture(TEXTURE_DIFFUSE);
            $matName = $material.name;
            if ($matName == " -- default --") {
                $matName = "___default___";
            }
            $output.print("SI_Material %s {\n", $matName);
            $output.print("%.6f; %.6f; %.6f; %.6f;;\n", $material.diffuse, $material.alpha);
$output.print("%.6f;\n", $material.Ks);
            $output.print("%.6f; %.6f; %.6f;;\n", $material.specular);
            $output.print("%.6f; %.6f; %.6f;;\n", $material.emissive);
$texFile = $tex.GetFileName();
            if ($texFile != ""){
    $output.print("TextureFilename {\n\"%s.%s\";\n}\n", $texFile.GetRoot(), $texFile.GetExt());
}
$output.print("}\n");
  }
        $output.print("}\n");
  $output.print("}\n}\n");
     
        $output.print("SI_MeshNormals {\n%d;\n", $numPoints);
        for $ii = 0 to $numPoints - 1 do {
          $normal = $mdata.GetNormal($ii);
    $normal.z = $normal.z * -1;
          $output.print("%.6f; %.6f; %.6f;", $normal);
    if ($ii<$numPoints-1){
$output.print(",\n");
    } else {
$output.print(";\n");
    }
        }

$output.print("%d;\n", $numFaces);
        for $ii = 0 to $numFaces - 1 do {
$output.print("3; %d,%d,%d;", $mdata.GetIndex($ii*3 + 2), $mdata.GetIndex($ii*3 + 1), $mdata.GetIndex($ii*3));
if ($ii<$numFaces-1){
   $output.print(",\n");
} else {
  $output.print(";\n");
}
        }
        $output.print("}\n\n");
        $output.print("SI_MeshTextureCoords {\n%d;\n", $numPoints);
        for $ii = 0 to $numPoints - 1 do {
            $uv = $mdata.GetTexCoord($ii);
$uv.y = 1.0-$uv.y;
            $output.print("%.5f; %.5f;", $uv);
if ($ii<$numPoints - 1){
  $output.print(",\n");
} else {
  $output.print(";\n");
}
        }
         $output.print("}\n");
         

    }
}

$result = 1;        /* Assume export will succeed. */

Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile

Sorry I haven't been able to get back to this yet, I've been pretty swamped. Can you attached a simple .xsi file that loads 100% error-free in the game? I'll try to get to it, but it probably won't be until Thursday-Friday (again). Until then maybe I can give you some tips.
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.

This sample cube was exported from Truespace as an X model and converted to XSI with 3D Exploration; these models always load correctly in Battlezone II. Thanks Raxx, I could use some pointers on how to rearrange blocks in the X exporter you fixed up for me last week. I've made a backup of the original script and am working on a copy fixed up for use with Anim8or. Leroy. PS: There is no hurry to get it done. I just am working on it in my spare time, so when you have some free time please take a look at what I've done so far.
Code: [Select]
xsi 0101txt 0032

SI_CoordinateSystem coord {
  1;
  0;
  1;
  0;
  2;
  5;
  }

Frame Cube-0 {
     FrameTransformMatrix {
  1.000000,0.000000,0.000000,0.000000,
  0.000000,1.000000,0.000000,0.000000,
  0.000000,0.000000,1.000000,0.000000,
  0.000000,0.000000,0.000000,1.000000;;
   }
  Mesh CubeMesh {
     8;
    1.000000;-1.000000;1.000000;,
    1.000000;1.000000;1.000000;,
    -1.000000;-1.000000;1.000000;,
    -1.000000;1.000000;1.000000;,
    1.000000;-1.000000;-1.000000;,
    -1.000000;-1.000000;-1.000000;,
    -1.000000;1.000000;-1.000000;,
    1.000000;1.000000;-1.000000;;
   
     12;
    3;1,3,2;,
    3;0,1,2;,
    3;2,5,4;,
    3;0,2,4;,
    3;2,3,6;,
    3;5,2,6;,
    3;1,7,6;,
    3;3,1,6;,
    3;4,5,6;,
    3;7,4,6;,
    3;4,7,1;,
    3;0,4,1;;
   
    MeshMaterialList {
      1;
      12;
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0;
      SI_Material {
        0.168627;0.537255;0.549020;1.000000;;
        2.000000;
        0.100000;0.100000;0.100000;;
        0.000000;0.000000;0.000000;;
        1;
        0.000000;0.000000;0.000000;;
        TextureFilename {
          "Gslxtoxsicube_0.bmp";
        }
      }
    }
   
    SI_MeshNormals {
      6;
      0.000000;0.000000;1.000000;,
      0.000000;-1.000000;0.000000;,
      -1.000000;0.000000;0.000000;,
      0.000000;1.000000;0.000000;,
      0.000000;0.000000;-1.000000;,
      1.000000;0.000000;0.000000;;
     
      12;
      0;3;0,0,0;,
      1;3;0,0,0;,
      2;3;1,1,1;,
      3;3;1,1,1;,
      4;3;2,2,2;,
      5;3;2,2,2;,
      6;3;3,3,3;,
      7;3;3,3,3;,
      8;3;4,4,4;,
      9;3;4,4,4;,
      10;3;5,5,5;,
      11;3;5,5,5;;
    }
   
    SI_MeshTextureCoords {
       14;
      0.000000;-0.333333;,
      0.250000;-0.333333;,
      0.250000;-0.666667;,
      0.000000;-0.666667;,
      0.500000;-0.666667;,
      0.500000;-1.000000;,
      0.250000;-1.000000;,
      0.500000;-0.333333;,
      0.500000;-1.333333;,
      0.250000;-1.333333;,
      0.750000;-0.666667;,
      0.750000;-0.333333;,
      1.000000;-0.333333;,
      1.000000;-0.666667;;
     
      12;
      0;3;0,1,2;,
      1;3;3,0,2;,
      2;3;2,4,5;,
      3;3;6,2,5;,
      4;3;2,1,7;,
      5;3;4,2,7;,
      6;3;6,5,8;,
      7;3;9,6,8;,
      8;3;10,4,7;,
      9;3;11,10,7;,
      10;3;10,11,12;,
      11;3;13,10,12;;
    }
   }
}
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile

Ok, this *might* fix it. When you rearrange stuff in code, you have to make sure you have all of the brackets and parenthesis ( { and } ) properly placed.

Also, the XSI file that you included needed the ambient color as well, so I added that to the script.

There is one final discrepancy in that the UV coordinates in the XSI version need an extra set of data. I didn't implement that yet, but go ahead and test it to see if it works without it.

Export script is attached below.
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.

Will do and thank you Raxx for taking the time to make the changes for the XSI format. I'm going to compare the changes so that I might see what I need to do as far as modifying the scripts themselves and writing them out more correctly. I guess the task requires more knowledge then I currently understand.

Are there some general guidelines that I can check for as far as placing brackets and pare thesis? In my modified version I basically changed the header entries and moved the material section to above meshnormals entry thinking this would do the trick, but it only made the geometry disappear when viewed in 3DEX. After that the confusion factor took over. Thanks again and I'll DL the script and test it out. Leroy.
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.

3DEX is showing these errors now and the geometry is still not visible. I'm thinking that this XSI format is so outdated that more modern features are no longer supported by today's standards. Other people have attempted to make XSI version 1 exporters with software like Blender without success. I have one that prehaps you could take a look at. It was a python script written for version 2.4 of Blender. I know your time is limited so if have some spare time to look at the python script for some clues on how to modify the ASL script. Thanks Raxx, Leroy.

PS: Do you think proper indentation may be an issue? On the 3DEX X to XSI write out it has indentation within the file while the version you and I modified are left jusified. I don't know if this would make any difference, but I thought that I would mention it.

Update: I got the geometry to appear in 3DEX by changing the scripts SI_Material back to just Material. All of the other error messages disappeared as well. Now the only issue appears to be that the texture is not appearing; just hows as a grey material color on the cube. What do you make of this Raxx? Leroy.

« Last Edit: March 21, 2012, 03:09:47 pm by lppena »
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile

Ok, I fixed it. I downloaded 3DEX and must have run the xsi and .x files through it a hundred times :P The initial loading errors (including the lack of texture) were mostly caused by the lack of proper UV coord information, but there also turned out to be a ton of transformation problems with both the .xsi and .x exporters, so I fixed it all to where it looks exactly the same in both Anim8or and 3DEX.

However, 3DEX's orientation system is a bit weird, so if you can get an anim8or-exported .xsi model into the game engine to see if the orientation is truly correct, I would appreciate it.

Attached is the updated script. Let me know if it's the final, completely bug-free one so that I can put it in the database (I'm updating the .x one in the database as well).
« Last Edit: March 21, 2012, 11:28:45 pm by Raxx »
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.

Will do Raxx and thank you for your patience and most valuable effort on this project. You are right about 3DEX 1.5.5., but its the closest model converter I have access to in working with antiquate model formats like version 1 XSI. The current XSI format has changed drastically from earlier versions but is totally incompatible as far using it for Battlezone II which was released in 1999. I sincerely appreciate your taking the time to even work on the project. I'll test the changes to the exporter and report back on the results. Thanks again Raxx. Leroy.

PS: I hope you don't mind but I added the DirectX exporter you fixed up for me so that other Anim8or users can add it to their ASL scripts library. I want to learn how to create ASL scripts as I'm pretty much hooked on Anim8or now. I'm beginning to really get off on using A8 as a really cool modeling software. Cheers, Leroy.
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.

Wow! Raxx the model loads in to BZII; usually my models would crash the game, but your version loads without errors. The only issue I notice is the texture is not showing as displayed in this BZII screen grab, but I suspect the issue may lie with the texture itself as I've seen it before in some of my own XSI models created in Truespace using the X exporter and 3DEX to convert them to XSI. I'll try using some different textures and post the results. You truly are a gifted person in terms of understanding how to fix things up in Anim8or. Leroy.
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.

Raxx, I found this XSI model that was originally created for BZII using Softimage XSI|3D. When you have time could you take a look at the file and determine if the XSI exporter script could be modified to write out this format? It contains some extra SI entries that I attempted to add to the existing script but I get some errors when I try to add them to the header area of the script; something to do with a token error reported when I run a syntax check in the ASL Editor. Thanks Leroy.
Code: [Select]
xsi 0101txt 0032

SI_CoordinateSystem coord {
   1;
   0;
   1;
   0;
   2;
   5;
}



SI_Angle {
   0;
}

SI_Camera  Camera1 {
   -1.668501; 1.033439; -3.593543;;
   0.469189; 0.000000; 0.383656;;
   0.000000;
   65.000000;
   0.100000;
   32768.000000;
}

SI_Ambience {
   0.300000; 0.300000; 0.300000;;
}


Frame frm-sphere1 {

   FrameTransformMatrix {
      1.000000,0.000000,0.000000,0.000000,
      0.000000,1.000000,0.000000,0.000000,
      0.000000,0.000000,1.000000,0.000000,
      0.000000,0.000000,0.000000,1.000000;;
   }

   Mesh sphere1 {
      17;
      -0.000000;-0.000000;0.003000;,
      -0.571733;-0.000000;0.290717;,
      -0.404277;-0.404277;0.290717;,
      -0.281138;-0.000000;0.116157;,
      0.281138;-0.000000;0.116157;,
      -0.404277;0.404277;0.290717;,
      -0.198795;-0.198795;0.116157;,
      -0.198795;0.198795;0.116157;,
      0.404277;-0.404277;0.290717;,
      -0.000000;0.571734;0.290717;,
      0.198795;-0.198795;0.116157;,
      -0.000000;0.281138;0.116157;,
      0.571733;-0.000000;0.290717;,
      0.404277;0.404277;0.290717;,
      -0.000000;-0.571734;0.290717;,
      0.198795;0.198795;0.116157;,
      -0.000000;-0.281138;0.116157;;

      16;
      3;6,3,0;,
      4;2,1,3,6;,
      4;1,5,7,3;,
      3;3,7,0;,
      3;16,6,0;,
      4;14,2,6,16;,
      4;5,9,11,7;,
      3;7,11,0;,
      3;10,16,0;,
      4;8,14,16,10;,
      4;9,13,15,11;,
      3;11,15,0;,
      3;4,10,0;,
      4;12,8,10,4;,
      4;13,12,4,15;,
      3;15,4,0;;

      MeshMaterialList {
         1;
         16;
         0,
         0,
         0,
         0,
         0,
         0,
         0,
         0,
         0,
         0,
         0,
         0,
         0,
         0,
         0,
         0;

         SI_Material {
            0.700000;0.700000;0.700000;1.000000;;
            0.000000;
            0.000000;0.000000;0.000000;;
            0.000000;0.000000;0.000000;;
            2;
            0.500000;0.500000;0.500000;;

            SI_Texture2D  {
               "Z:/modelsdirectory/misceffects/effects/PICTURES/flash.pic";
               4;
               256;256;
               0;255;0;255;
               0;
               1;1;
               0;0;
               1.000000;1.000000;
               0.000000;0.000000;
               -1.000000,0.000000,-0.000000,0.000000,
               0.000000,1.000000,0.000000,0.000000,
               0.000000,0.000000,-1.000000,0.000000,
               0.000000,0.000000,0.000000,1.000000;;
               3;
               1.000000;
               0.750000;
               1.000000;
               0.000000;
               0.000000;
               0.000000;
               0.000000;
            }

         }
      }
      SI_MeshNormals {
         56;
         -0.314793;-0.314793;-0.895439;,
         -0.445185;-0.000000;-0.895439;,
         -0.000000;-0.000000;-1.000000;,
         -0.364115;-0.364114;-0.857229;,
         -0.514936;-0.000000;-0.857229;,
         -0.445185;-0.000000;-0.895439;,
         -0.314793;-0.314793;-0.895439;,
         -0.514936;-0.000000;-0.857229;,
         -0.364115;0.364114;-0.857229;,
         -0.314793;0.314793;-0.895439;,
         -0.445185;-0.000000;-0.895439;,
         -0.445185;-0.000000;-0.895439;,
         -0.314793;0.314793;-0.895439;,
         -0.000000;-0.000000;-1.000000;,
         -0.000000;-0.445185;-0.895439;,
         -0.314793;-0.314793;-0.895439;,
         -0.000000;-0.000000;-1.000000;,
         -0.000000;-0.514935;-0.857229;,
         -0.364115;-0.364114;-0.857229;,
         -0.314793;-0.314793;-0.895439;,
         -0.000000;-0.445185;-0.895439;,
         -0.364115;0.364114;-0.857229;,
         -0.000000;0.514935;-0.857229;,
         -0.000000;0.445185;-0.895439;,
         -0.314793;0.314793;-0.895439;,
         -0.314793;0.314793;-0.895439;,
         -0.000000;0.445185;-0.895439;,
         -0.000000;-0.000000;-1.000000;,
         0.314793;-0.314793;-0.895439;,
         -0.000000;-0.445185;-0.895439;,
         -0.000000;-0.000000;-1.000000;,
         0.364114;-0.364114;-0.857229;,
         -0.000000;-0.514935;-0.857229;,
         -0.000000;-0.445185;-0.895439;,
         0.314793;-0.314793;-0.895439;,
         -0.000000;0.514935;-0.857229;,
         0.364114;0.364114;-0.857229;,
         0.314793;0.314793;-0.895439;,
         -0.000000;0.445185;-0.895439;,
         -0.000000;0.445185;-0.895439;,
         0.314793;0.314793;-0.895439;,
         -0.000000;-0.000000;-1.000000;,
         0.445185;-0.000000;-0.895439;,
         0.314793;-0.314793;-0.895439;,
         -0.000000;-0.000000;-1.000000;,
         0.514935;-0.000000;-0.857229;,
         0.364114;-0.364114;-0.857229;,
         0.314793;-0.314793;-0.895439;,
         0.445185;-0.000000;-0.895439;,
         0.364114;0.364114;-0.857229;,
         0.514935;-0.000000;-0.857229;,
         0.445185;-0.000000;-0.895439;,
         0.314793;0.314793;-0.895439;,
         0.314793;0.314793;-0.895439;,
         0.445185;-0.000000;-0.895439;,
         -0.000000;-0.000000;-1.000000;;

         16;
         0;3;0,1,2;,
         1;4;3,4,5,6;,
         2;4;7,8,9,10;,
         3;3;11,12,13;,
         4;3;14,15,16;,
         5;4;17,18,19,20;,
         6;4;21,22,23,24;,
         7;3;25,26,27;,
         8;3;28,29,30;,
         9;4;31,32,33,34;,
         10;4;35,36,37,38;,
         11;3;39,40,41;,
         12;3;42,43,44;,
         13;4;45,46,47,48;,
         14;4;49,50,51,52;,
         15;3;53,54,55;;
      }


      SI_MeshTextureCoords {
         56;
         0.739047;0.260953;,
         0.838064;0.500000;,
         0.500000;0.500000;,
         0.986136;0.013864;,
         1.187500;0.500000;,
         0.838064;0.500000;,
         0.739047;0.260953;,
         1.187500;0.500000;,
         0.986136;0.986136;,
         0.739047;0.739047;,
         0.838064;0.500000;,
         0.838064;0.500000;,
         0.739047;0.739047;,
         0.500000;0.500000;,
         0.500000;0.161936;,
         0.739047;0.260953;,
         0.500000;0.500000;,
         0.500000;-0.187500;,
         0.986136;0.013864;,
         0.739047;0.260953;,
         0.500000;0.161936;,
         0.986136;0.986136;,
         0.500000;1.187500;,
         0.500000;0.838064;,
         0.739047;0.739047;,
         0.739047;0.739047;,
         0.500000;0.838064;,
         0.500000;0.500000;,
         0.260953;0.260953;,
         0.500000;0.161936;,
         0.500000;0.500000;,
         0.013864;0.013864;,
         0.500000;-0.187500;,
         0.500000;0.161936;,
         0.260953;0.260953;,
         0.500000;1.187500;,
         0.013864;0.986136;,
         0.260953;0.739047;,
         0.500000;0.838064;,
         0.500000;0.838064;,
         0.260953;0.739047;,
         0.500000;0.500000;,
         0.161936;0.500000;,
         0.260953;0.260953;,
         0.500000;0.500000;,
         -0.187500;0.500000;,
         0.013864;0.013864;,
         0.260953;0.260953;,
         0.161936;0.500000;,
         0.013864;0.986136;,
         -0.187500;0.500000;,
         0.161936;0.500000;,
         0.260953;0.739047;,
         0.260953;0.739047;,
         0.161936;0.500000;,
         0.500000;0.500000;;

         16;
         0;3;0,1,2;,
         1;4;3,4,5,6;,
         2;4;7,8,9,10;,
         3;3;11,12,13;,
         4;3;14,15,16;,
         5;4;17,18,19,20;,
         6;4;21,22,23,24;,
         7;3;25,26,27;,
         8;3;28,29,30;,
         9;4;31,32,33,34;,
         10;4;35,36,37,38;,
         11;3;39,40,41;,
         12;3;42,43,44;,
         13;4;45,46,47,48;,
         14;4;49,50,51,52;,
         15;3;53,54,55;;
      }
   }
}
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.

Raxx, I've started to modify your revised script by adding the entries shown in the XSI|3D model I attached to the previous post. Mostly, I added a bunch of $output.print (""); entries with the entries present in the XSI model file; apparently you can just stack one on top of the others. Here's what I have so far; it's a renamed copy of your script so I don't screw up all the work you did already. I'll keep going and post updates as I do more modifications. I appreciate your help Raxx. Leroy.
« Last Edit: March 22, 2012, 08:31:48 pm by lppena »
Logged

Raxx

  • Administrator
  • Hero Member
  • *****
  • Posts: 1482
    • View Profile

Is there any particular reason to add those entries? I doubt that SI_Angle (which defaults to degrees if not present, which is what we want), SI_Camera, or SI_Ambience are even utilized by the video game, and is probably ignored completely. At this point, I wouldn't try fixing what's not broken.

If the only thing that's wrong with it is the texture, then it might be because it needs the SI_Texture2D block of information. Unfortunately, the only 2D texture info that can be pulled from Anim8or is the file name, so I changed the block name to SI_Texture2D and added a parameter that indicates that it's wrapped. If this doesn't fix it then perhaps there was a problem with your odf file that links everything together, since I'm assuming you specify the texture there anyways, which makes the SI_Texture2D block redundant and therefore ignored by the game anyways.

There was also a problem with the frame and some of the brackets. Attached is the fixed version. I didn't modify your version of the script where you added all of the extraneous info, for the sake of my sanity ;)
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.

Thanks Raxx, I have a feeling your right about the extra entries in the SI|3D version. The texture however is not referenced in the models ODF. BZII converts the XSI model to a binary MSH format that the game uses. I looked at the few text entries in the binary file and the problem seems to be caused by the lack of the full texture name in the binary file; it should read texture name.bmp but it only shows the texture name minus the bmp extension.

I will test the changes you made and report back with the results. The stuff I did was just an effort to make the file more complete for 3DEX and the BZII game engine. Other, people who have created XSI converted variants have included these extra entries; they are actually fixed dummy entries in the variants that I've worked with in the past.

Most of them are hacks as they lack support for animation or are problematic when folks edit XSI models with cut and paste operations. The version you are working on is the most accurate variant that I have seen. Thanks again Raxx. Leroy.
« Last Edit: March 23, 2012, 05:05:37 am by lppena »
Logged

lppena

  • Sr. Member
  • ****
  • Posts: 299
  • Anim8or, does a body good.
    • View Profile
    • Truespace Anim8or Casual Modeling Forum.

Hi Raxx. I tested the latest XSI exporter, but the textures are still not showing up on the cube model when I load it in to BZII. It does not make any sense as it looks fine in 3DEX including showing the texture and no file errors at all. Do you have any thoughts on what to try next?

I'm going to try using only material colors on several objects grouped together and see is they show up in BZII. I'll report back as soon as I can test another model. Leroy.

Update: Material colors appear okay on my test cube just hope I can figure out why the texture doesn't. I wonder if and SI_Ambience entry would do the trick? Will try a few modifications to a copy of the script and see what happens. I just wanted to thank Raxx again for all of his efforts so far. Leroy.
« Last Edit: May 31, 2012, 11:45:31 am by lppena »
Logged

cooldude234

  • Sr. Member
  • ****
  • Posts: 902
  • You know what I realized, I dont have an avatar :\
    • View Profile

I may be wrong but, from the screenshot, it looks like the texture is being shrunk a lot, giving it that very gridy look to it.
I know when I was using an arb function in opengl (it sucked so its switched now :P) for textures, the texture coordinates had to be the size of the texture.
so the texture coordinates of a square was like...
point 1 (1024,768)
point 2 (1024,0)
point 3 (0,0)
point 4 (0,768)

however when i switched to the opengl's core texture function (which still supported rectangle images!), everything work in normalized coordinates (the only thing that is normalized in my engine :P )
and it looked something like this...
point 1 (0.7401,0.3801)
point 2 (0.7401,0)
point 3 (0,0)
point 4 (0,0.3801)

it may be the same case for this?
Logged
¼
Pages: [1] 2 3