Jump to content

Fixing the dotXSI 3.0 Exporter for 3ds Max...


Recommended Posts

So here's the color scheme on the bone skeleton:

 

v5ce.jpg

 

  • The purple bones are JA unique bones (i.e., the rtail and ltail bones).
  • The yellow bones are the JO unique bones.
  • The cyan bones are common to both JO-JA skeletons.
  • The pink bones are the motion and hang/hand tag bones.

Any other color-scheme suggestions?  ...I also fixed the visual discontinuities in the spine bones.

Link to comment

Looks good but why do you have the effs & the unused facial bones in there? One thing I hated about the JK2 skeleton max file from 10 years ago was all the unused bones made new-to-the-scene modellers (myself included from that time) very confused. We should be making sure such confusion doesn't happen this time around.

Link to comment

The nub_bones (or "_eff" bones), are used potentially for IK chains... they're also useful for position referencing for some control objects. In my opinion they also help show the end of the fingers. But I could easily put them on their own layer so they could be hidden.

 

I'm debating whether to release just the skeleton-- or the skeleton as part of a simple IK rig... until my complex rig is finished.

Link to comment

Raven used the same skeleton from SOF2 in JO, only with less bones in the end. You'll see all those facial bones from a JO root.xsi present in the SOF2 GLA.

 

The skeleton inside a JO root.xsi may have those bones, but the JO GLA doesn't use them.

Link to comment

I'm referring to his broken paths in the files.

The reason I point this out is because ASCII encoding uses 1 byte per character, and Unicode/UTF-16 uses two bytes. So when you have a byte sequence in Unicode:

 

[0x60 0x00] [0x15 0x00] [0x96 0x00]

This might show up as 'abc' (I know for a fact that it doesn't, but just bear with me). But when you convert said stream to ASCII:

[0x60] [0x00] [0x15] [0x00] [0x96] [0x00]

 

Which might show up as 'a b c ' depending on how your text editor interprets the 0x00.

Link to comment

@@Archangel35757

 

Sounds good. You could have two max files, one that is used for rigging JO/JKA (without the unused bones) & the other is your rig.

 

 

@@eezstreet

 

I searched for some conversion code and found it, but it now crashes the plugin when trying to export out an MD3. :P

int main();
{
	LPCWSTR wstr = subname;
	int count = wcslen(wstr);
	char* c = new char[count + 1];
	wchar_t* pwchr = const_cast<wchar_t*> (&wstr[0]);
	for(int j = 0; j < count; ++j)
	{
		c[j] = static_cast<char> (*pwchr);
		pwchr++;
	}
	c[count] = '\0';
	cout<<c<<endl;
	return 0;
}

subname is used to output this kind of string: models/model_directory/model_name.md3

 

P.S I put that code just above where subname gets written with fwrite. I would have thought it would catch subname BEFORE it gets written and alter it, but I so so suck at coding. :P

Link to comment

Here's a way easier to do it, assuming you're using C++ (which it looks like you are)

#include <string>
 
...
 
void tostring(const std::wstring& in, std::string& out) {
     std::string temp(in.begin(), in.end());
     out = temp;
}

And then call it by doing:

 

std::string output;
 
tostring(__YOUR__STRING__VAR__HERE__, output);

and then simply use output.c_str() in the fwrite function

Link to comment

@@Archangel35757

 

Sounds good. You could have two max files, one that is used for rigging JO/JKA (without the unused bones) & the other is your rig.

 

<truncated...>

 

@@DT85 and @@eezstreet -- My thinking regarding the facial bones is this: 

 

All of the bones in the JO root.xsi are (including the unused ones from SOF2) exactly what is needed for a detailed Hi-Def facial rig.  The JO/JA bones (since they use the same eight bones) will be color coded differently from the SOF2 bones.  The additional SOF2 facial bones will also be on a separate layer (so they can be hidden).  The facial rig GUI will have controls for all of the bones-- I can make it where the unique SOF2 bones and controls have an option to be hidden-- for those folks who only want to skin their mesh to the JO/JA bones.  Or you don't have to skin your face to any facial bones... (like most released JKA models today-- it's up to the user).

 

But I plan to generate additional facial animations for the major phonemes/visemes (in addition to the standard JKA "TALK" anims)... My goal is to have some kind of lipsync system setup... that generates the rough first pass on lipsyncing.

Link to comment

@@eezstreet

 

Works like a charm for the filename, but gives out this error when trying to do the texture path:

 

error C2664: 'tostring' : cannot convert parameter 1 from 'WStr' to 'const std::wstring &'

 

It needs to be WStr though. 

if( tex ) // write out a single 'skin'
{
	// Once we have the filename we mangle it. We search for
	// 'models' and if found we remove the filename to that part.
	// Thus if we have "C:/quake3/baseq3/models/mapobjects/texture.tga"
	// It becomes "models/mapobjects/texture.tga"
	// otherwise we just leave it.
	WStr mapname = ((BitmapTex *)tex)->GetMapName();
	subname = _tcsstr( mapname, _T("models"));
	
	//eezstreet UNICODE to ASCII fix
	std::string output_file; 
	tostring(mapname, output_file);

	std::string output_sub; 
	tostring(subname, output_sub);

	if( !g_smart_paths || subname == NULL )
		//fwrite( mapname, 68, 1, file ); // full texture filename
		//eezstreet UNICODE to ASCII fix
		fwrite(output_file.c_str(), 68, 1, file ); // full texture filename
	else
		//fwrite( subname, 68, 1, file ); // full texture filename
		//eezstreet UNICODE to ASCII fix
		fwrite( output_sub.c_str(), 68, 1, file ); // filename from 'models' on.
}
Link to comment

 

@@eezstreet

 

Works like a charm for the filename, but gives out this error when trying to do the texture path:

 

error C2664: 'tostring' : cannot convert parameter 1 from 'WStr' to 'const std::wstring &'

 

It needs to be WStr though. 

if( tex ) // write out a single 'skin'
{
	// Once we have the filename we mangle it. We search for
	// 'models' and if found we remove the filename to that part.
	// Thus if we have "C:/quake3/baseq3/models/mapobjects/texture.tga"
	// It becomes "models/mapobjects/texture.tga"
	// otherwise we just leave it.
	WStr mapname = ((BitmapTex *)tex)->GetMapName();
	subname = _tcsstr( mapname, _T("models"));
	
	//eezstreet UNICODE to ASCII fix
	std::string output_file; 
	tostring(mapname, output_file);

	std::string output_sub; 
	tostring(subname, output_sub);

	if( !g_smart_paths || subname == NULL )
		//fwrite( mapname, 68, 1, file ); // full texture filename
		//eezstreet UNICODE to ASCII fix
		fwrite(output_file.c_str(), 68, 1, file ); // full texture filename
	else
		//fwrite( subname, 68, 1, file ); // full texture filename
		//eezstreet UNICODE to ASCII fix
		fwrite( output_sub.c_str(), 68, 1, file ); // filename from 'models' on.
}

Isn't that error complaining that you're trying to assign the address of a parameter to WStr when I think it's expecting a WStr*  ???

Link to comment

Try and see if there's a way to convert from WStr to wchar_t*. Use that converted string as the argument. C++ will automatically convert wchar_t* to wstring via implicit casting. Is WStr a class? Chances are you could do something like "theParameter.CStr();" or "theParameter.c_str();"

Link to comment

The issue is only with the full filename string (starting from "drive letter"), not the stripped filename (starting from "models"). I've fixed up the object names and I'm going to submit the 2014 MD3 exporter. Thanks a lot eezstreet, you were a great help. :D

Link to comment

@@DT85 -- glad you got it sorted out...

 

@@DT85, @@Psyk0Sith, @@minilogoguy18, @@eezstreet :

 

Concerning Carcass.exe and Assimilate.exe.  So I downloaded your GitHub submission for Assimilate and have it compiling-- I cleaned up the existing warnings.  It appears that the version Raven released was 2.1 used by Jedi Outcast (and ST:Voyager).  The mouseover help still states ST:Voy (Star Trek:Voyager). 

 

The one question I have and would like to know... it seems that Assimilate also supports the 3ds Max native .ASE animation file format.  Has anyone attempted to compile a new animation using the .ASE format?  That would be huge as well, if we could get that to work... as another alternative to dotXSI.  I imagine you'd have to use the version of Carcass from JO as well.

 

I looked at the version of Assimilate released for JKA and it states version 2.5 and setup for JK3.  Not sure what they did differently inside the code-- except compile with the JKA anims.h file.  I have an idea to combine the JO and JA anims.h file into one massive anims.h and recompile and see how it goes-- also adding "ROOT" to the enum list to eliminate the "BAD:ROOT" notification from Assimilate.

 

Comments?

Link to comment

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
×
×
  • Create New...