Sign in to follow this  
makingroulette

alias maya .X file exporter

Recommended Posts

i am currently using alias maya version 6 to create a model of a roulette wheel would you believe. But i am unable to export it in the .X file format so that it can be read into a DirectX application. Does anyone know where I get hold of one? I had heard that one was included in recent updates to the directX software development kit, ive downloaded recent updates from october 2004 onwards and could not find it. I will be very greatful for your help

Share this post


Link to post
Share on other sites

What you are looking for is in the 'extra' part of the SDK;
Specifically: "\Direct3D\Plug-Ins\Maya version 4.0 and 5.0\" (with summer 2003 sdk extras anyway)

Main DL page: http://msdn.microsoft.com/library/default.asp?url=/downloads/list/directx.asp

Extras DL page: http://www.microsoft.com/downloads/details.aspx?FamilyId=8AF0AFA9-1383-44B4-BC8B-7D6315212323&displaylang=en




You may find the following usefull to actually compile:

http://www.gamedev.net/community/forums/topic.asp?topic_id=253944&whichpage=1�


/**
* --------------------------------------------
* DHCBlueBerry Member since: 6/30/2004 From: Japan
* Posted - 6/30/2004 6:11:35 AM
* Maya6.0 xExport.
* here is replacement code for DtMatrixGetTransforms() call that is not
* supported in Maya6.0 any more. you could replace those calls with this and
* remove old DtMatrixGetTransforms(). it'll happily compile with vs2003.
* libMDtAPI.lib does not need to be linked.
*
--------------------------------------------
*/


int MyMatrixGetTransforms( float *pmatrix , float *translate , float *scale , float *quaternion , float *rotation )
{
float matrix[ 4 ][ 4 ];
for ( int i = 0 ; i < 16 ; ++i )
{
*( &matrix[ 0 ][ 0 ] + i ) = *( &pmatrix[ 0 ] + i );
}

MVector t;
double d_scale[ 3 ];
double d_quat[ 4 ];
double euler[ 3 ];
MStatus result;

MMatrix mmatrix( matrix );

MTransformationMatrix mtmatrix( mmatrix );
if ( mtmatrix.getScale( d_scale , MSpace::Space::kTransform) != MS::kSuccess )
{
return 0;
}

t = mtmatrix.translation( MSpace::Space::kTransform , &result );
if ( result != MS::kSuccess )
{
return 0;
}

if ( mtmatrix.getRotationQuaternion( d_quat[ 0 ] , d_quat[ 1 ] , d_quat[ 2 ] , d_quat[ 3 ] , MSpace::Space::kTransform ) != MS::kSuccess )
{
return 0;
}

MTransformationMatrix::RotationOrder rotation_order = MTransformationMatrix::RotationOrder::kLast;
if ( mtmatrix.getRotation( euler , rotation_order ) != MS::kSuccess )
{
return 0;
}

translate[ 0 ] = static_cast< float >( t.x );
translate[ 1 ] = static_cast< float >( t.y );
translate[ 2 ] = static_cast< float >( t.z );
scale[ 0 ] = static_cast< float >( d_scale[ 0 ] );
scale[ 1 ] = static_cast< float >( d_scale[ 1 ] );
scale[ 2 ] = static_cast< float >( d_scale[ 2 ] );
quaternion[ 0 ] = static_cast< float >( d_quat[ 3 ] );
quaternion[ 1 ] = static_cast< float >( d_quat[ 0 ] );
quaternion[ 2 ] = static_cast< float >( d_quat[ 1 ] );
quaternion[ 3 ] = static_cast< float >( d_quat[ 2 ] );
rotation[ 0 ] = static_cast< float >( euler[ 0 ] );
rotation[ 1 ] = static_cast< float >( euler[ 1 ] );
rotation[ 2 ] = static_cast< float >( euler[ 2 ] );

return 1;
}




Worked like a charm for me; with "Microsoft DirectX 9.0 SDK Update (Summer 2003)" and Maya 6 Complete


HTH

Share this post


Link to post
Share on other sites
Correction, with Microsoft DirectX 9.0 SDK (February 2005)

Search the (C++) help for: "Effect File Exporter for Alias Maya"

Default location is: C:\Program Files\Microsoft DirectX 9.0 SDK (February 2005)\Utilities\Source\Maya

Nothing to do with the extras DL this release it seems, which is nice.

I've yet to try it fwiw.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this