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 45421 times)

Raxx

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

Ippena, this is somewhat uncharted territory for me now, since I don't have access to the game and can only act as an observer. There could be any number of things that's causing it. All I can suggest is to take the model and export it with 3DEX so that it loads the texture properly in the game, and then slowly plug in blocks of Anim8or's version into it until it the textures disappear.

cooldude234, not sure if that's actual shrinkage or just noise. I don't know what texture is being tested on it, or the UVs, and I'm not sure if that's the kind of effect that non-normalized coordinates would have. However, the UVs exported seem to already be normalized. That is, between 0 and 1, so I doubt that's the issue.
Logged

Raxx

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

Ippena, perhaps the attached script will work. I only made a minor change to it, but I have no way of testing it.
Logged

lppena

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

You both have good points. I'll try the revised script with and w/o textures. It's odd though as the cube has zero issues in 3DEX. The old XSI format is a strange beast and many variants have evolved from 3rd party efforts to replicate a usable variant that that will work with the older BZII game engine. Raxx's XSI variant is on e of the best versions I've seen to date. As I've mentioned the BZII engine handles the processing of the XSI model and converts that to a binary .MSH model that also must hold true for the processing of the textures as well. BZII, supports BMP, PNG, JPG, TGA, and a Softimage version of PIC. The latest beta of BZII now only uses a modified DXT version called BZ2DXT; however, I use the older BZII version that does not use BZ2DXT. Also, the X to XSI models I normally use that are converted with 3DEX oddly work in BZII even thought the XSI model does not use the SI_Texture2D entry; it reuses the TextureFilename like the X format uses. Also, because Anim8or models are grouped rather then linked in hierchal tree form there may limited usefulness of Anim8or other then creating the geometry itself; don't know for sure though. What I may start doing is creating the model parts in Anim8or grouping the object together and exporting them to Truespace as X models where I can UV map, and link the model parts for BZII in TS and export that as X for converting to XSI with 3DEX. Unless, I can figure out how to get the A8 XSI model exporter to display the texture properly in BZII; the convert A8 XSI to 3DEX XSI will probably work for single objects models only; BZII uses these for simple terrestrial props like trees. Thanks for the XSI revision I'll test it out throughly and repoert back on the results. Leroy.
Logged

lppena

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

The revision seem to make no differences as far as showing the texture, and using 3DEX to reconvert the A8 XSI to 3DEX XSI was no good as BZII just crashed. However, using the BZII X exporter you fixed up for me seems to convert well using 3DEX to convert the X model to XSI. Here's what the converted BZII X to XSI model looks like. I can live with this solution if issues can not be sorted out with the BZII XSI exporter Raxx. Perhaps using this as a reference could help sort out issues with the XSI exporter you are attempting to modify will yield some clues on what to change? If not no biggy Raxx. You've spent quite some valuable time, so I don't want to push anymore then you feel comfortable with. Leroy. PS: I zipped up the X and XSI models for you to examine if you want.
  
Code: [Select]
xsi 0101txt 0032

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

Frame mesh01 {
     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.000001,0.000000,0.000000,1.000000;;
   }
  Mesh mesh01_mesh {
     20;
    -9.166700;15.877000;-20.497000;,
    3.501400;25.690001;-9.166700;,
    20.497000;15.877000;-9.166700;,
    18.333000;0.000000;-20.497000;,
    0.000000;0.000000;-27.500000;,
    -9.166700;-15.877000;-20.497000;,
    -23.999001;-9.812600;-9.166700;,
    -23.999001;9.812500;-9.166700;,
    20.497000;-15.877000;-9.166700;,
    3.501400;-25.690001;-9.166700;,
    23.999001;9.812600;9.166700;,
    23.999001;-9.812600;9.166700;,
    -20.497000;15.877000;9.166700;,
    -3.501400;25.690001;9.166700;,
    -3.501400;-25.690001;9.166700;,
    -20.497000;-15.877000;9.166700;,
    9.166700;15.877000;20.497000;,
    9.166700;-15.877000;20.497000;,
    -18.333000;0.000000;20.497000;,
    0.000000;0.000000;27.500000;;
    
     36;
    3;1,2,0;,
    3;2,3,0;,
    3;3,4,0;,
    3;6,7,5;,
    3;7,0,5;,
    3;0,4,5;,
    3;8,9,3;,
    3;9,5,3;,
    3;5,4,3;,
    3;10,11,2;,
    3;11,8,2;,
    3;8,3,2;,
    3;12,13,7;,
    3;13,1,7;,
    3;1,0,7;,
    3;14,15,9;,
    3;15,6,9;,
    3;6,5,9;,
    3;13,16,1;,
    3;16,10,1;,
    3;10,2,1;,
    3;17,14,11;,
    3;14,9,11;,
    3;9,8,11;,
    3;15,18,6;,
    3;18,12,6;,
    3;12,7,6;,
    3;19,17,16;,
    3;17,11,16;,
    3;11,10,16;,
    3;19,16,18;,
    3;16,13,18;,
    3;13,12,18;,
    3;19,18,17;,
    3;18,15,17;,
    3;15,14,17;;
    
    MeshMaterialList {
      1;
      36;
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0,
      0;
      SI_Material {
        0.878431;0.878431;0.878431;1.000000;;
        0.200000;
        1.000000;1.000000;1.000000;;
        0.000000;0.000000;0.000000;;
        1;
        0.000000;0.000000;0.000000;;
        TextureFilename {
          "Raxsiblob_0.bmp";
        }
      }
    }
    
    SI_MeshNormals {
      57;
      0.303532;0.525702;-0.794673;,
      0.303530;0.525713;-0.794667;,
      0.303534;0.525725;-0.794657;,
      0.303535;0.525737;-0.794649;,
      0.303543;0.525750;-0.794638;,
      -0.607043;0.000000;-0.794669;,
      -0.607054;0.000000;-0.794661;,
      -0.607060;0.000000;-0.794656;,
      -0.607076;0.000000;-0.794643;,
      0.303542;-0.525719;-0.794658;,
      0.303532;-0.525716;-0.794664;,
      0.303535;-0.525727;-0.794655;,
      0.303532;-0.525731;-0.794654;,
      0.303543;-0.525750;-0.794638;,
      0.982241;0.000000;-0.187625;,
      0.982242;0.000000;-0.187617;,
      0.982243;0.000000;-0.187613;,
      0.982245;0.000000;-0.187601;,
      -0.491148;0.850643;-0.187566;,
      -0.491137;0.850646;-0.187581;,
      -0.491133;0.850645;-0.187593;,
      -0.491125;0.850647;-0.187607;,
      -0.491124;0.850645;-0.187618;,
      -0.491145;-0.850636;-0.187602;,
      -0.491136;-0.850645;-0.187586;,
      -0.491131;-0.850645;-0.187598;,
      -0.491124;-0.850650;-0.187595;,
      -0.491122;-0.850646;-0.187622;,
      0.491138;0.850641;0.187600;,
      0.491126;0.850647;0.187604;,
      0.491133;0.850646;0.187590;,
      0.491131;0.850648;0.187585;,
      0.491148;0.850643;0.187561;,
      0.491122;-0.850645;0.187621;,
      0.491123;-0.850648;0.187608;,
      0.491131;-0.850646;0.187592;,
      0.491136;-0.850647;0.187578;,
      0.491148;-0.850643;0.187561;,
      -0.982242;-0.000014;0.187621;,
      -0.982242;-0.000003;0.187617;,
      -0.982242;-0.000002;0.187620;,
      -0.982242;0.000004;0.187619;,
      -0.982241;0.000000;0.187625;,
      0.607076;0.000000;0.794643;,
      0.607060;0.000000;0.794656;,
      0.607054;0.000000;0.794661;,
      0.607043;0.000000;0.794669;,
      -0.303543;0.525750;0.794638;,
      -0.303532;0.525731;0.794654;,
      -0.303535;0.525727;0.794655;,
      -0.303532;0.525716;0.794664;,
      -0.303542;0.525719;0.794658;,
      -0.303543;-0.525750;0.794638;,
      -0.303535;-0.525737;0.794649;,
      -0.303534;-0.525725;0.794657;,
      -0.303530;-0.525713;0.794667;,
      -0.303532;-0.525702;0.794673;;
      
      36;
      0;3;0,1,2;,
      1;3;1,3,2;,
      2;3;3,4,2;,
      3;3;5,5,6;,
      4;3;5,7,6;,
      5;3;7,8,6;,
      6;3;9,10,11;,
      7;3;10,12,11;,
      8;3;12,13,11;,
      9;3;14,14,15;,
      10;3;14,16,15;,
      11;3;16,17,15;,
      12;3;18,19,20;,
      13;3;19,21,20;,
      14;3;21,22,20;,
      15;3;23,24,25;,
      16;3;24,26,25;,
      17;3;26,27,25;,
      18;3;28,29,30;,
      19;3;29,31,30;,
      20;3;31,32,30;,
      21;3;33,34,35;,
      22;3;34,36,35;,
      23;3;36,37,35;,
      24;3;38,39,40;,
      25;3;39,41,40;,
      26;3;41,42,40;,
      27;3;43,44,45;,
      28;3;44,46,45;,
      29;3;46,46,45;,
      30;3;47,48,49;,
      31;3;48,50,49;,
      32;3;50,51,49;,
      33;3;52,53,54;,
      34;3;53,55,54;,
      35;3;55,56,54;;
    }
    
    SI_MeshTextureCoords {
       44;
      0.636290;-0.500000;,
      1.297900;-0.882000;,
      0.143180;-0.882000;,
      1.213600;-1.500000;,
      0.500000;-1.500000;,
      0.565830;-0.881970;,
      0.565830;-0.118040;,
      1.143180;-1.118030;,
      0.565830;-1.118040;,
      1.143180;-0.882000;,
      1.143180;-2.118030;,
      0.143180;-2.118030;,
      1.297900;-1.118030;,
      0.636290;-1.500000;,
      1.213600;-0.500000;,
      0.143180;-1.118030;,
      0.500000;-0.500000;,
      0.434200;-1.118030;,
      0.434200;-1.881970;,
      0.297900;-0.882000;,
      0.297900;-2.118030;,
      0.213600;-1.500000;,
      0.702120;-0.882000;,
      1.363710;-0.500000;,
      1.636290;-0.500000;,
      0.702120;-0.118030;,
      0.702120;-1.118030;,
      1.636290;-1.500000;,
      0.363710;-0.500000;,
      0.856820;-0.882000;,
      1.434200;-1.118030;,
      0.856820;-1.118030;,
      0.363710;-1.500000;,
      1.434200;-0.881970;,
      0.786360;-0.500000;,
      0.786360;-1.500000;,
      0.565830;-1.881970;,
      0.856820;-2.118030;,
      1.434200;-1.881970;,
      1.500000;-1.500000;,
      1.856820;-0.882000;,
      1.500000;-0.500000;,
      1.856820;-1.118030;,
      1.856820;-0.118030;;
      
      36;
      0;3;0,1,2;,
      1;3;1,3,2;,
      2;3;3,4,2;,
      3;3;5,6,7;,
      4;3;8,9,10;,
      5;3;2,4,11;,
      6;3;12,13,14;,
      7;3;13,15,14;,
      8;3;15,16,14;,
      9;3;17,18,19;,
      10;3;18,20,19;,
      11;3;20,21,19;,
      12;3;22,23,8;,
      13;3;23,24,8;,
      14;3;24,9,8;,
      15;3;23,25,24;,
      16;3;26,5,27;,
      17;3;5,7,27;,
      18;3;28,29,0;,
      19;3;29,30,0;,
      20;3;30,1,0;,
      21;3;31,32,33;,
      22;3;32,13,33;,
      23;3;13,12,33;,
      24;3;26,34,5;,
      25;3;35,22,36;,
      26;3;22,8,36;,
      27;3;4,37,29;,
      28;3;37,38,29;,
      29;3;38,30,29;,
      30;3;39,40,35;,
      31;3;40,23,35;,
      32;3;23,22,35;,
      33;3;41,34,42;,
      34;3;34,26,42;,
      35;3;25,23,43;;
    }
   }
}
« Last Edit: March 25, 2012, 07:21:47 am by lppena »
Logged

Raxx

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

The next thing I would test would be to go into Anim8or's exported .xsi file and replace the SI_Texture2D block of code with the TextureFilename one. SI_Texture2D is used in the sample XSI files I found online that supposedly work in the game engine, but since the block output by the script is incomplete, that may be causing the problem.

I went ahead and adjusted it in the script attached.

By the way, there is a way to link everything together. If you can point me to a guide that shows the exact kind of linking for more complex models that use different parts of the mesh for different things, I can go ahead and implement it in the script.
Logged

lppena

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

Thanks Raxx, I'll check out the revised script and report back the results. I've attached a zip file with both an X and XSI animated model group that I know works in BZII for you to take a look at in 3DEX to view the object animation in the models; BZII requires multiple models to do animations in the game. BZII, primarily uses the skel_model and takes the animations from the other models in the group. Leroy
« Last Edit: March 25, 2012, 11:49:02 am by lppena »
Logged

lppena

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

I found one issue with the texture in that BZII only supports sizes that are squared 2x2, i.e., 64x64, 128x128, etc. I'll try using only textures in this size and report back. Question, can Anim8or, adjust the texture size in the material editor? If the answer is yes then the problem may be solved. I also edited the script the a bit and will post a revised script after some testing in BZII. Leroy.
Logged

Raxx

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

Sorry, Anim8or doesn't adjust the actual texture file. It resamples it internally to the nearest squared number, but it doesn't affect the file itself. Most game engines only support those kinds of texture sizes.
Logged

lppena

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

Resizing textures outside of Anim8or is easy enough to do with other utilities, so I just need to keep this in mind when making models using Anim8or. It seems to be another issue though as I tried using a 64x64 bmp texture applied to my sub divided cube. Still no luck seeing the texture in the game. It must have something to do with the numbers in the file itself. I compared my model with one created in TS using the same texture then exported as X then converted to XSI with 3DEX and they seem virtually the same with the exception of numerical values being different from one model to the other. I just don't don't get it Raxx; the A8 XSI model should work fine in BZII? I Modified the script a bit. When you have time could you take a look at the changes? Thanks, Leroy. PS: I renamed it as I have several revised script and I needed a logical way to make them uniquely unidentifiable.

Update: There is an issue with multiple objects grouped together; only one object appears in BZII and the other objects are not present in the resulting BZII created .MSH model file. It looks like part of the problem is the way Anim8or links model parts together; everything is grouped in a single stack rather then in several groups of objects. Raxx, you mentioned that there are several ways to do this in Anim8or. Could you or someone else describe how it's done in A8? Thanks, Leroy.
« Last Edit: March 28, 2012, 10:39:08 am by lppena »
Logged

lppena

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

Is there a way to add a dummy frame to an A8 script and have other objects grouped to it? This is the way that BZII reads objects in grouped models. For example, a typical BZII model has a main body object and under that object are sub groups of the main body and some sub groups have objects linked under other sub groups. Here's a screen grab showing this file structure.
Logged

lppena

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

Raxx, I think the XSI exporter is more work then it's worth. I'm using the X exporter you fixed up for me and it converts the X model to XSI beautifully with 3D Exploration. Here's a screen grab from BZII showing an object complete with the texture on it. What I plan to do is create the geometry in Anim8or, group everything together and import it all into Truespace to properly link all of the parts together for BZII and export that with my TS X exporters and convert that to XSI with 3DEX. It works well as I can do animations and edit the UV map all in TS.

PS: I plan to continue monkeying around with the existing XSI exporter you created and attempt to get it working someday as I learn more about writing ASL scripts. Thank you for all off the time you spent working on the XSI script, just to let you know your work was not just a waste of time. I think the problem itself is with the old version 1 XSI format in general rather then issues with Anim8or.
Logged

Raxx

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

It's possible to automate all of the linking when exporting the file, by making it organize the frames based on the names of each object. However, unless the textures start working then there's not much point in implementing it.

If you ever get the XSI export script working with textures then the linking would be the next step, so then you'd have a one-click solution for everything. Unfortunately I don't have the time to learn the ins and outs of modding this particular game so that I can do it myself, so at this point the progress of the XSI script is all on you now. Good luck!
Logged

lppena

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

Thanks Raxx. Do you think the same thing can be done on the working BZII X exporter you fixed up for me? That would work for me and the textures are working on that script. Also, can the X script be revised to export the animation keys out of Anim8or? I still fiddle with the XSI exporter script but the X script is a better option at this point. I'm sure that other A8 users could use an X script that supports proper object linking and one that can export animation. I looked at all of the existing X export scripts, but none of them support animation in their current form.

I could do most of the work and testing if you could post some code examples for me to paste in the existing BZII X exporter. Are there any existing A8 exporters that currently support exporting animation? I've started making models in Anim8or grouping objects, exporting them to X and importing them into Truespace for linking, texturing, and animation.

I plan to modify an existing script for exporting Caligari COB or SCN model files when I get a hang for modifying existing scripts. If it's okay I mostly want to ask questions as I progress in my knowledge of how to write scripts for Anim8or. The best source of basic script information seems to be the HTML scripting language link, but your feedback has been very valuable in terms of answering questions about what A8 is capable of doing. To date the X format has served me well in terms of Battlezone II model creation. I've tried making plugins for Truespace, but it's even harder then Anim8or because I need a C++ compiler and more programming knowledge then I currently have. Anim8or rocks with it's use of the ASL text based scripting. Leroy.   
Logged

lppena

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

I think I figured out how to link objects together in a hierarchal form that BZII can read properly. I attached a copy of the revised XSI script. All I did was copy a section from under $childshapes to an extra entry under $shapes. Could someone take alook at the script and help me understand what I just did? Thanks, Leroy. I still need to test it out in BZII though.
« Last Edit: April 01, 2012, 05:04:37 pm by lppena »
Logged

lppena

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

The XSI exporter seems to work minus the missing texture issue. Here's a screen grab of my first tank model with working weapons. The tank is rather simple and a bit large, but she works good in game. Special thanks to Raxx for making it happen. Leroy.
Logged
Pages: 1 [2] 3