Topic: GMax2MOD plugin  (Read 29302 times)

0 Members and 1 Guest are viewing this topic.

Offline Starfox1701

  • Lt. Commander
  • *
  • Posts: 1052
Re: GMax2MOD plugin
« Reply #40 on: August 24, 2008, 02:27:41 pm »
I thought Activiosion got bought out too though for the life of me I can't remember which?

Offline pepperman

  • Lt. Junior Grade
  • *
  • Posts: 338
  • Gender: Male
Re: GMax2MOD plugin
« Reply #41 on: November 15, 2008, 12:39:52 pm »
Sorry to post in a relatively old thread but I was wondering if Rod had heard anything back from Activiosion regarding the source code for Armada plugins. 

Anyway...don't know if this helps or not but here is the Storm3D Object Definition (SOD) File Format document as well as an extract from the Milkshape plugin creator Chris Graham

Storm3D Object Definition (SOD) File Format
===========================================
Author: Steve Williams
Modified for v1.93 : Chris Graham
Storm3D Graphics Engine Lead.
Copyright © Activision 2000.

Modifications : Updated to SOD v1.93 (as for Armada 2 mods).

Audience
========
This document is intended for use by experienced 3D tools programmers
for the purposes of writing exporters, importers and conversion tools
to/from the .SOD format. A good understanding of real time 3D graphics
principles is assumed. The reader is expected to be familiar with
real time 3D geometry concepts such as lighting, animation & scene
graph hierarchies.


Introduction
============
The SOD file format is a binary file format describing the 3D directed
scene graph hierarchies used by the Storm3D rendering engine.
Each .SOD file describes one such hierarchy.


The SOD file format has evolved through several versions.
This document describes the latest format, 1.93.


Datatypes used in this document
===============================
UINT8 unsigned 8 bit integer
UINT16 unsigned 16 bit integer
UINT32 unsigned 32 bit integer
FLOAT floating point (4 byte) value
VECTOR2 {FLOAT u, FLOAT v}
VECTOR3 {FLOAT x, FLOAT y, FLOAT z}
MATRIX34 { VECTOR3 RIGHT, UP, FRONT, POSITION } MATRICES MUST BE ORTHOGONAL.
COLOUR { FLOAT red, FLOAT green, FLOAT blue } Component range 0.0 - 1.0

Other local datatypes are defined where appropriate.

Additional Syntax
=================
TYPE ARRAY(nentries) - A contiguous array of nentries of type TYPE

Identifiers
===========

IDENTIFIER
{
UINT16 strlen(string), string (8 bit ascii values) including terminating '\0'
OR
UINT16 0 - Indicates null string.
}

File Structure
==============

Section 1 : File Header
Section 2 : Lighting Materials
Section 3 : Nodes - Written recursively from the root.
Section 4 : Animation Channels
Section 5 : Animation References

Section Description
===================


Section 1 : File Header
=======================

HEADER Storm3D_SW File identification header (8 bit ascii values) - no strlen or terminating '\0'.
FLOAT version Current version is 1.93. 1.91 has also been found and is similar.


Section 2 : Lighting Materials
==============================
Defines the characteristics of the vertex lighting materials defined in this .SOD file.

UINT16 count - The number of lighting materials defined in this file.

LIGHTING_MATERIAL ARRAY(count) Array of lighting materials.

LIGHTING_MATERIAL
{
IDENTIFIER identifier Name of the lighting material.
COLOUR ambient Real time lighting ambient component
COLOUR diffuse Real time lighting diffue component
COLOUR specular Real time lighting specular component (only used by the phong illumination model)
FLOAT specular power Specular exponent, used to determine the 'shininess' of material using the phong illumination model.
UINT8 lighting model (constant=0, lambert=1, phong=2)
UINT8 unknown (=0)
}


Section 3 : Nodes
=================

The nodes consist of 5 types NULL, LOD_CONTROL, SPRITE, MESH and EMITTER which together form
a scene graph which describes the object's hierarchy.

UINT16 count - The number of nodes in the hierarchy.

NODE
{
UINT16 node_type (0 - null, 1- mesh, 3 - sprite, 11 - LOD control node, 12 - emitter) DO NOT USE OTHER VALUES.
IDENTIFIER identifier
IDENTIFIER parent (which will be null for root node)
MATRIX34 local transform
TYPE_SPECIFIC_DATA<node_type> Type specific data field as defined below.
}


Null Nodes
==========

TYPE_SPECIFIC_DATA<NULL>
{
No addtional data required.
}

Null nodes are used for two purposes :
1. As 'glue' to stick the rest of the hierarchy together
2. To mark specific locations in the hierachy, for example, hardpoints.


LOD Control Nodes
=================

TYPE_SPECIFIC_DATA<LOD_CONTROL>
{
No addtional data required.
}

Storm3D uses discrete (rather than dynamic) LODs for level of detail control. Each
child of an LOD control node indicates a discrete LOD that the graphics engine may
use when rendering this object. LOD selection is based on visible on-screen area.


Sprite Nodes
============

TYPE_SPECIFIC_DATA<SPRITE_NODE>
{
None: The appropriate sprite node definition to use is determined from the
identifier. The sprite node definition is defined in the .spr files.
}

Examples of sprite node usage include running lights in ST:Armada.

TYPE_SPECIFIC_DATA<PARTICLE_EMITTER>
{
IDENTIFIER Emitter used by this node as defined by an @emitter description in the .spr files.
}

Polygon Mesh Nodes
==================

TYPE_SPECIFIC_DATA<MESH>
{
IDENTIFIER texture material (0 for default) - Defines the TEXTURE_MATERIAL to be used by this mesh.
if (version==1.93)
{
byte unknown[4]
UINT32 textures=1|2
} else textures=1
IDENTIFIER texture
if (version==1.93)
{
UINT32 unknown=0
}
if (textures==2)
{
IDENTIFIER bump
UINT32 unknown
}
if (version==1.93)
{
UINT32 unknown=0
} else UINT16 unknown=0

UINT16 nvertices : Number of vertices
UINT16 number of texture coordinates (ntexcoords)
UINT16 number of vertex lighting groups (ngroups)

VECTOR3 ARRAY vertex positions (nvertices entries)
VECTOR2 ARRAY texture coordinates (ntexcoords entries)

VERTEX_LIGHTING_GROUP ARRAY (ngroups entries)
}


UINT8 cull type (0 - no cull, 1- (backface cull)

UINT16 0 - unused must be 0.
VERTEX_LIGHTING_GROUP
{
UINT16 num_faces (all faces are triangles)
IDENTIFIER lighting_material (0=default)
FACE ARRAY (num_faces entries)
}

FACE_VERTEX
{
UINT16 index into mesh vertex positions array
UINT16 index into mesh texture coordinate array
}

FACE
{
FACE_VERTEX ARRAY(3) 3 entries describing a triangular faces vertex link.
}


Emitter nodes
=============

IDENTIFIER emitter_id

Section 4 : Animation Channels (Defines transform animation)
================================================== ==========

UINT16 count // Number of animation channels

ANIMATION_CHANNEL ARRAY(count) Array of animation channels.

ANIMATION_CHANNEL
{
IDENTIFIER node : The node to which this animation channel refers.
UINT16 nkeyframes : The number of keyframes used by this channel.
FLOAT channel_period : The length of time one loop of this channel lasts.
UINT16 0 : Not currently used. Must be 0.
MATRIX34 ARRAY(nkeyframes) keyframe_data : The actual animation transforms, evenly spaced over time 'channel_period'.
}

Section 5 : Animation References (Defines texture animation)
================================================== ==========

Animation references are a way of linking texture (flipbook) animations defined in the
.spr files to the geometry of a .SOD mesh node. An example of their usage is the
flipbook animation applied to the geometry for the various shield effects in Armada.


UINT16 num_animation_references

ANIMATION_REFERENCE ARRAY(num_animation_references)


ANIMATION_REFERENCE
{
UINT8 type : Must be 4
IDENTIFIER node : The node to which this animation applies.
IDENTIFIER anim : The animation (as defined in .spr files) that is to be applied to this node.
FLOAT playback_offset : Time offset in seconds to be applied to this animation reference.
}

Additional Information
======================

Vertex Lighting Material Sharing
================================

Vertex lighting materials are shared between objects, when parsing a .SOD file,
Storm3D searches for a match in all previously loaded files. If a match is found, that
material is used. This prevents artists from having to ensure the material characteristics
of commonly used materials are correct in each file, and also saves memory.

A 'palette' of commonly used materials can be found in materials.sod
In Armada, this file is loaded prior to most other SOD files & so defines the
characteristics of many common materials.


Hierarchy Structure (Armada Specific)
=====================================
Armada uses various nodes in a Storm3D hierarchy for special purposes.
These include hardpoints, damage nodes, running lights, borgification.
When generating new artwork, the artist must pay careful attention to the
structure of the hierarchy for the new object to function correctly in Armada.
A definition of the hierarchy structure required by Armada is beyond the scope
of this document. For the time being, existing artwork can be used as a reference.


TEXTURE_MATERIAL Definition
===========================
A texture material defines the characteristics of the polygon rasterizer used to
render the polygons in a given mesh. The texture materials are currently fixed
and defined within the executable.

Useful values are :

default - Standard material

additive - Use additive blending

opaque - don't use alpha channel for translucency (use it for glow)

translucent - Semi transparent

alphathreshold - Use for objects using alpha channel 'cut outs' - alpha
channels will have hard edged 'threshold' but objects will be
drawn quickly.

alpha - Uses entire alpha channel. Object will require sorting, so
will have performance implications.

wireframe - Use wireframe graphics.

yochenhsieh

  • Guest
Re: GMax2MOD plugin
« Reply #42 on: March 04, 2009, 07:40:36 am »
The newer version of niftools which can also installed on GMax can be found here:
http://niftools.sourceforge.net/wiki/NifTools

It's been updated frequently for better compatibility and bug fixes.

Offline Rod ONeal

  • D.Net Beta Tester
  • Commander
  • *
  • Posts: 3592
  • Gender: Male
Re: GMax2MOD plugin
« Reply #43 on: March 05, 2009, 01:25:08 am »
The newer version of niftools which can also installed on GMax can be found here:
http://niftools.sourceforge.net/wiki/NifTools

It's been updated frequently for better compatibility and bug fixes.


These plugins, while very cool, aren't for SFC. Just don't want to confuse anyone.
If Romulans aren't cowards, then why do they taste like chicken?

Offline candle_86

  • The Old School
  • Lt.
  • *
  • Posts: 509
  • Gender: Male
  • Position Gamma Hydra sector 10
Re: GMax2MOD plugin
« Reply #44 on: September 06, 2009, 12:43:49 am »
ok noob question tring to conver to SFC1 and cant find the lightmaps, I know there there, I can tell as much in model viewer and the fact the model has the light maps, how do I get rid of these things

Offline FoaS_XC

  • Photorps, Sammiches, woot woot.
  • Global Moderator
  • Commander
  • *
  • Posts: 4571
  • Gender: Male
    • Robinomicon
Re: GMax2MOD plugin
« Reply #45 on: October 18, 2009, 08:34:58 pm »
It occurs to me that it might be possible to write a MOD exporter with maxscript (without the need of the Max SDK) if we know how the MOD file is structured...
Robinomicon
"When I was 5 years old, my mom always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down “happy.” They told me I didn’t understand the assignment and I told them they didn’t understand life."

Offline marstone

  • Because I can
  • Commander
  • *
  • Posts: 3014
  • Gender: Male
  • G.E.C.K. - The best kit to have
    • Ramblings on the Q3, blog
Re: GMax2MOD plugin
« Reply #46 on: October 19, 2009, 06:15:49 am »
It occurs to me that it might be possible to write a MOD exporter with maxscript (without the need of the Max SDK) if we know how the MOD file is structured...

where would I get my hands on maxscript (to see how it is written)?
The smell of printer ink in the morning,
Tis the smell of programming.

Offline FoaS_XC

  • Photorps, Sammiches, woot woot.
  • Global Moderator
  • Commander
  • *
  • Posts: 4571
  • Gender: Male
    • Robinomicon
Re: GMax2MOD plugin
« Reply #47 on: October 19, 2009, 08:32:14 am »
scriptspot.com has a bunch of maxscripts, inluding file import/export stuff.. it's really not that hard a scripting language at all
Robinomicon
"When I was 5 years old, my mom always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down “happy.” They told me I didn’t understand the assignment and I told them they didn’t understand life."

Offline Rod ONeal

  • D.Net Beta Tester
  • Commander
  • *
  • Posts: 3592
  • Gender: Male
Re: GMax2MOD plugin
« Reply #48 on: October 19, 2009, 01:47:50 pm »
FWIU a script isn't version specific. As long as the version of Max you are using has the features to support the script. So, since every version from at least Max3 has the features needed to be able to import or export a .MOD, a script would be version independent. Nobody should have to write a new script every time Autodesk adds a feature and changes the version number.
If Romulans aren't cowards, then why do they taste like chicken?

Offline FoaS_XC

  • Photorps, Sammiches, woot woot.
  • Global Moderator
  • Commander
  • *
  • Posts: 4571
  • Gender: Male
    • Robinomicon
Re: GMax2MOD plugin
« Reply #49 on: October 19, 2009, 03:05:21 pm »
it CAN be version specific, but it usually isn't. Even if a particular script may not work in version 3, a rewrite to MAKE it work in version 3 should be doable.
Robinomicon
"When I was 5 years old, my mom always told me that happiness was the key to life. When I went to school, they asked me what I wanted to be when I grew up. I wrote down “happy.” They told me I didn’t understand the assignment and I told them they didn’t understand life."

Offline atheorhaven

  • Lt. Commander
  • *
  • Posts: 1801
    • Mare Imbrium Shipyards
Re: GMax2MOD plugin
« Reply #50 on: October 19, 2009, 03:09:13 pm »
ok noob question tring to conver to SFC1 and cant find the lightmaps, I know there there, I can tell as much in model viewer and the fact the model has the light maps, how do I get rid of these things

Responding to old question..

You have to go into the Material Map and physically remove them from the materials on the mesh.  Once that's done, the mesh should work in SFC 1.

I had an old tutorial up on it, but don't know if it's still accessible through the various iterations of my site..
..ooOOoo..totally useless information..ooOOoo..

Mare Imbrium Shipyards - http://mareimbrium.webhop.net

Don't bother checking out my website for the most recent updates, because I've
been too lazy to update it!  Check Battleclinic!

Offline KBF_Gow

  • Lt. Junior Grade
  • *
  • Posts: 97
Re: GMax2MOD plugin
« Reply #51 on: December 25, 2009, 03:23:23 am »
Hmm, got gmax 1.2 downloaded, it runs fine, but, if I put the winmm.dll in the gmax folder the application will not start.

If I remove it, it starts fine again.

Offline Rod ONeal

  • D.Net Beta Tester
  • Commander
  • *
  • Posts: 3592
  • Gender: Male
Re: GMax2MOD plugin
« Reply #52 on: December 25, 2009, 05:19:15 pm »
Without it the plugns won't work though. I'm not sure what is causing the problem. An alternative is to DL the niftools plugin and install that. It gives you a new .exe that should run the .mod plugins as well. You then don't need to use the winmm.dll.

http://sourceforge.net/projects/niftools/files/max_plugins/

So, keep the .mod plugins installed and install the niftools as well. Remove the winmm.dll and use the nifgmax.exe to start gmax

I hope it sorts it for you. Let us know if it helps.
If Romulans aren't cowards, then why do they taste like chicken?