Welcome to Skylords Reborn

Register now to gain access to all of our features. Once registered and logged in, you will be able to contribute to this site by submitting your own content or replying to existing content. You'll be able to customize your profile, receive reputation points as a reward for submitting content, while also communicating with other members via your own private inbox, plus much more! This message will be removed once you have signed in.

  • Announcements

    • InsaneHawk

      Donations are back   01/17/17

      If you want more information, you can go check this topic : http://forum.skylords.eu/index.php?/topic/2790-donations-are-back/
    • MrXLink

      Future of Skylords Reborn and intro to Ardent Peak   02/10/17

      Dear Skylords, Skyladies, Skythings We have received the awesome news that we have been allowed by EA themselves to continue our project and open up many future possibilities! For all information and stream VODs, please refer to this topic:   
    • MrXLink

      NOTE: Stricter (chat) Rule Enforcement   04/11/17

      Greetings Skylords, Skyladies and Skythings. There has been a lot of commotion going on lately regarding moderation and people calling us out for favouritism and improper judgement. @Kiwi, myself and the rest of the team have had enough of this and we are changing our approach and leniency towards the community drastically, and eliminate this pseudo-favouritism factor. Not that we ever had favourites to begin with, nor in our eyes treated regulars in any way advantageous over others, but we have received several complaints regarding this issue, as well as there have been quite some clashes in chatbox recently. Aside from that, we have decided to act much more strictly about members in the foreseeable future as well.  Considering people have deemed our judgement to be unfair, this will result in us warning the community even for minor infringements, and possibly introducing more temp bans. We feel this is sadly necessary in the current community's state and we're better off having an ordered community in which people see us treat everyone the same way, although in my opinion harshly, and in which members treat staff with respect. As long as the safety and trustworthiness of moderation on the website and discord server is at risk, we will have to make it well-known that we do exert judgement on everyone equally. So from now on, we will be warning people more frequently. This can be for minor insults, misbehaviour, memberating or what we consider as staff disrespect. We're done with the leniency we have once shown here. I'm sad it has to happen this way and of course we will do everything in our power to keep the chatbox a nice, welcoming place. Perhaps this means people will start thinking that we are being sensitive, especially when it comes down to staff disrespect and failure to abide by warnings, but we consider that to be the lesser evil compared to giving members the illusion that we don't consider every member as equal. Equality, understanding, respect and involvement in the community are the cornerstones of community management and moderation, as they also should be within the staff area. So from now on, we are going to monitor this more closely than before. I hope we can treat everyone with understanding and respect here, members and staff alike. We are confident that this approach won't damage the community as much as our currently projected moderation image, valid or not, drags our reliability down. We are all human, and we strive for excellence within community management, moderation and involvement with the community, and aim to execute measures to achieve these goals with respect, passion, and dedication as we did before. We are saddened to have our strictness come to this point. As much as the (chatbox) community has made sure that this became the way it is, we do encourage to take the liberty to speak freely and have a good time here on the forums, as long as said behaviour is in accordance to the forum rules.  Remember, you can find the forum rules over here:  It saddens us to head in this direction, but we feel it will be for the best. We sincerely hope you can all respect this decision, keep the hype up, and have a nice time enjoying the chatbox and its features within a reasonable and orderly manner. Sincerely, and on behalf of @Kiwi and the Skylords Reborn Staff,
      MrXLink, Community Manager
onedaxter

Export 3D Model / 3D Model Format

97 posts in this topic

Here is an updated version, which contains nearly the whole structure of the drs. Though the function of most of them is unknown yet. Dont get confused by all of it, if you are new to 010 editor. 
Start at line 665, it says, that the first 4 Bytes in the file are a magic number. Afterwards the content starts. Bytes 5-8 are the number of models contained in the file. The next 2 x 4 Bytes are a pointers to where in the file are 2 lists. These list then point to eg the Vertices of the 3D model or the effects or sounds or the animations an object can do.

If you are lazy, you can just install pfp (https://github.com/d0c-s4vage/pfp) and convert the .drs files to .obj files with python. No ned to install 010 or understand the template below.

010 Template for the .drs files:

https://pastebin.com/X7BqaaBs

 

pfp example:

https://pastebin.com/9dp8reh0

(note: I used that script to get the vertices of CGeoMesh, but doing this for CDspMeshFile works similar and gives you the correct 3D model. Though to be able to print the values nicely, you have to add the .toStr() functions in fields.py in the pfp library. Also i deleted some stuff from the script, hope i didnt break anything.)

Share this post


Link to post
Share on other sites

Posted (edited)

thanks dude! would love to have bones tho.

23 hours ago, bobfrog said:

Here is an updated version, which contains nearly the whole structure of the drs. Though the function of most of them is unknown yet. Dont get confused by all of it, if you are new to 010 editor. 
Start at line 665, it says, that the first 4 Bytes in the file are a magic number. Afterwards the content starts. Bytes 5-8 are the number of models contained in the file. The next 2 x 4 Bytes are a pointers to where in the file are 2 lists. These list then point to eg the Vertices of the 3D model or the effects or sounds or the animations an object can do.

If you are lazy, you can just install pfp (https://github.com/d0c-s4vage/pfp) and convert the .drs files to .obj files with python. No ned to install 010 or understand the template below.

010 Template for the .drs files:

https://pastebin.com/X7BqaaBs

 

pfp example:

https://pastebin.com/9dp8reh0

(note: I used that script to get the vertices of CGeoMesh, but doing this for CDspMeshFile works similar and gives you the correct 3D model. Though to be able to print the values nicely, you have to add the .toStr() functions in fields.py in the pfp library. Also i deleted some stuff from the script, hope i didnt break anything.)

 

Edited by Kiliangg

Share this post


Link to post
Share on other sites

Posted (edited)

I dont know if some one is this far already but I was able to convert a unit with the source skeleton to a fbx file using blender and source tools for blender. I was able to get the Skeleton and Bones but no luck with animations. For mass converting there is a python console in blender maybe some one can write a script...

Anyways off to sleep
Kilian

Also this is a test thing in Unreal Eninge. (I love UE btw.)

 

EDIT: Maybe there is a more simple way to mass convert .drs to .smd than .drs to whatever else since Lightsong has the feature to export to .smd

64501eaff2afdcbea879c729d033c278.jpg

Edited by Kiliangg

Share this post


Link to post
Share on other sites
3 hours ago, Kiliangg said:

Oh ye I was using .smd file from lightsong

did you read the .drs with blender or did you use lightsong to convert from drs and use the output with blender?

if its the first case then im very interested in what you did exactly

Share this post


Link to post
Share on other sites

Posted (edited)

Well step by step @bobfrog:

1. Import the .drs into Lightsong 0.5

2. Export from LightSong 0.5 to .smd

3. Import the .smd into Blender via "blender_source_tools_2.9.1"

4. Export via Blender to .fbx

 

I think if we ask the creator of Lightsong (I dont know his name anymore...) he might give us useful information about the converting from .drs to .smd

Edited by Kiliangg

Share this post


Link to post
Share on other sites

i allready contacted him and i have info about that. just didnt have the time yet to work through it. but it doesnt look too complicated, i will give it a try later.

what the creator of lightsong did was nothing else than the 010 script that i posted.

Share this post


Link to post
Share on other sites
1 minute ago, bobfrog said:

i allready contacted him and i have info about that. just didnt have the time yet to work through it. but it doesnt look too complicated, i will give it a try later.

what the creator of lightsong did was nothing else than the 010 script that i posted.

alright. gl

In the meantime I'm messing with animations since the exported .smd animation rig seems off to the rig from the object itself.

Share this post


Link to post
Share on other sites

Going to expand the script from pastebin into this thread for my own reference.

//Definitions
struct CString
{
    int Length;
    char Text[Length];
};

struct Point
{
    float X;
    float Y;
    float Z;
};

struct Point4D
{
    float X;
    float Y;
    float Z;
    float W;
};

struct Point2D
{
    float X;
    float Y;
};

struct Face
{
    short Indices[3];
};


struct CGeoMesh //seems to rebuild the MeshFile, but with fewer vertices (meshfile seems to have each triangle twice anyway)
{
    int magic;
    int IndexCount;
    
    if (IndexCount > 0)
        Face Faces[IndexCount/3]; 
    
    int VertexCount;
    
    if (VertexCount > 0)
    {
        Point4D Vertices[VertexCount];
    }
};

struct CSkSkinInfo
{
    int Version;
    int VertexCount;

    struct _VertexWeight
    {
        float Weights[4];
        int BoneIndices[4];
    } VertexWeights[VertexCount];
};

struct CDspMeshFile
{
    int magic;
    local int unknown = -1;
    local int MeshCount = 0;
    if(magic==1314189598){
        int tmp <hidden=true>;
        unknown = tmp;
        int tmp2 <hidden=true>;
        MeshCount = tmp2;

    } else {
        MeshCount = magic;
    }

    Point BoundingBoxLowerLeftCorner1;
    Point BoundingBoxUpperRightCorner1;

    struct sthMesh{
    
        int VertexCount;
        int FaceCount;
    
        Face Faces[FaceCount];
        
    
        byte MeshCount;
    
    
        struct _Mesh
        {
            int FVF;
            int VertexSize; 
    
            if(FVF == 133121){
                struct _Vertex{
                    Point vertex;
                    Point vertexNormal;
                    Point2D vertexTexture;
                } Vertex[VertexCount];
            } else if(FVF==12288){
                struct FVF30{
                    float uk[6];
                } fvf30[VertexCount];


            } else {
                Printf( "unknown FVF: 0x%X \n", FVF); // CDspStaticMesh::LoadVertices for further analysis
                float VertexData[VertexCount * VertexSize/4] <fgcolor=cRed>;
            }
        
         } Meshes[MeshCount] <optimize=false>;
    
    
        Point BoundingBoxLowerLeftCorner2; //seems like same BB as before
        Point BoundingBoxUpperRightCorner2;
        
        short materialID;
        int materialParameters;
        struct TextureParameter {
            int Identifier;
            CString Name;
            int postString;
        };

        struct TextureParameters
        {
            int Length;
            TextureParameter TextureParameters[Length] <optimize=false>;
        };

        struct ColorParameter {
            int Identifier;
            int R;
            int G;
            int B;
        };

        struct ColorParameters {
            int Length;
            ColorParameter colorParameters[Length];
        };

        struct ScalarParameter {
            int Identifier;
            float Value;
        };

        struct ScalarParameters {
            int Length;
            ScalarParameter scalarParameters[Length];
        };

        struct IntegerParameter {
            int Value;
        };

        struct IntegerParameters {
            int Length;
            IntegerParameter integerParameters[Length];
        };

        struct StringParameter {
            CString Name;
        };

        struct StringParameters
        {
            int Length;
            StringParameter stringParameters[Length] <optimize=false>;
        };

        struct VectorParameter {
            int Identifier;
            Point4D Value;
        };

        struct VectorParameters {
            int Length;
            VectorParameter vectorParameters[Length];
        };
        if(materialParameters == -86061050){
			
            int sthOfMaterialCore;
            int boolParamTransfer;

            TextureParameters textureParameters;
            ColorParameters colorParameters;
            ScalarParameters scalarParameters;
            IntegerParameters integerParameters;
            StringParameters stringParameters;
            VectorParameters vectorParameters;
        } else if (materialParameters == -86061051 || materialParameters == -86061052) {
            int sthOfMaterialCore;
            int boolParamTransfer; //<- boolParamTransfer = ((unsigned int)boolParamTransfer | 1); for 0xFACED0004

            TextureParameters textureParameters;
            ColorParameters colorParameters;
            ScalarParameters scalarParameters;
            IntegerParameters integerParameters;
            StringParameters stringParameters;
        } else if (materialParameters == -86061053) {
            int boolParamTransfer;

            TextureParameters textureParameters;
            ColorParameters colorParameters;
            ScalarParameters scalarParameters;
            IntegerParameters integerParameters;
            StringParameters stringParameters;
        } else if (materialParameters == -86061054) {
            int boolParamTransfer;

            TextureParameters textureParameters;
            ColorParameters colorParameters;
            ScalarParameters scalarParameters;
            IntegerParameters integerParameters;
        } else if (materialParameters == -86061055) {
            int boolParamTransfer; ////<- boolParamTransfer = ((unsigned int)boolParamTransfer | 1);

            TextureParameters textureParameters;
            ColorParameters colorParameters;
            ScalarParameters scalarParameters;
        } else {
            Printf( "unknown materialParameter: 0x%X \n", materialParameters); //CDspMaterialCore::ReadParameters for more
            
        }
    } meshes[MeshCount] <optimize=false>;

    //Otherwise, Point0=(0,0,0,1) UPoint=(1,1,0,0) VPoint=(0,0,1,1)
    if(unknown >= 0){
        Point4D Point0;
        Point4D UPoint;
        Point4D VPoint;
    }
};
    

struct CSkSkeleton
{
    int Version;
    int Unknown1;

    int BoneMatrixCount;
    struct BoneMatrix
    {
        struct BoneVertex
        {
            float X;
            float Y;
            float Z;
            int ParentReference; //parentRef[0] = parent index, parentRef[1] = index into CSkSkeleton.dBone array, used in SKA
        } BoneVertices[4];
    } BoneMatrices[BoneMatrixCount];

    int BoneCount;
    struct Bone
    {
        int Version;
        
        int Identifier;
        CString Name;
    
        int ChildCount;
        if (ChildCount > 0)
            int Children[ChildCount];
    } Bones[BoneCount] <optimize=false>;

    float Unknown2[16];
};

struct CDspJointMap
{
    int Version;
    int JointGroupCount;
    
    if (JointGroupCount > 0)
    {
        struct _JointGroup
        {
            int JointCount;
            if (JointCount > 0)
                short JointIndices[JointCount];
        } JointGroups[JointGroupCount] <optimize=false>;
    }
};

struct AnimationSet
{
    CString Magic;
	if (Strcmp(Magic.Text, "Battleforge") != 0) Printf("\nerror bad magic AnimSet\n");
    int Count; //Should be <= 6
    if(Count>6) Printf("\nerror count >6\n");
    
    float Unknown1;
    float Unknown2;
    int Version;

    if (Count >= 6) //> should not happen -> Count == 6
    {
        if (Version >= 2)
        {
            byte Unknown4;
            byte Unknown5;
        }

        if (Version >= 5)
        {
            float Unknown6;
            float Unknown7;
            float Unknown8;
        }
    
        if (Version >= 6)
            byte Unknown9;
    }

    int ModeAnimationKeyCount;

    struct _ModeAnimationKey
    {
        int Type;
        CString Magic2;
        int Unknown11;

        if (Type == 1)
        {
            int Unknown12;
            short Unknown13;
            int Unknown14;
            byte Unknown15;
            int Unknown16;
            int Unknown17;
            int Unknown18;
            byte Unknown19;
        }
        else if (Type == 2 || Type == 3 || Type == 4 || Type == 5)
        {
            int Unknown20;
            short Unknown21;
        }
        else if (Type == 6)
        {
            int Unknown22;
            short Unknown23;
            int Unknown24;
            short Unknown24;
        } else Printf("\n uk modeAnimType %d\n",Type);

        int UnknownLength;

        struct _UnknownStructure
        {
            int Unknown25;
            int Unknown26;
            CString Unknown27;
            
            if (Unknown25 >= 4)
            {
                int Unknown28;
                int Unknown29;
            }

            if (Unknown25 >= 5)
            {
                byte Unknown30;
            }

            if (Unknown25 >= 7)
            {
                byte Unknown31;
            }
        } Unknowns[UnknownLength] <optimize=false>;
    } AnimationKeys[ModeAnimationKeyCount] <optimize=false>;

    
    if (Count >= 3)
    {
        short Unknown32;
        
        if (Unknown32 >= 1)
        {
            int len;

            struct UnknownStruct123{
                int uk123;
                
                short uk124;
                if(uk124>=1){
                    
                    int uk125;
                    int uk126;

                    struct UKStruct1234{
                        short uk1234;
                        if(uk1234==1){
                            int uk1236[5];
                        }
                    } uk1234[3] <optimize=false>;
                }
                if(uk124>=2){
                    short uk127;
                }

            } unknown123[len] <optimize=false>;

            


        }

        if (Unknown32 >= 2)
        {
            int len1;
            struct _UnknownStruct2
            {
                int Unknown36;
                int Unknown37;
                int Unknown38;
            } Unknowns2[len1];
        }
    }


    if (Count >= 4)
    {
        short Unknown39;
        if (Unknown39 == 2)
        {
            int Unknown40;
            
            struct _UnknownStruct3
            {
                int Unknown41;
                CString Unknown42;
                int Unknown43;
                int Unknown44;

                struct _UnknownStruct4
                {
                    int Unknown45;
                    int Unknown46;
                    int Unknown47;
                    int Unknown48;

                    int Unknown49;
                    int Unknown50;
                    int Unknown51;
                    int Unknown52;
                } Unknowns4[Unknown44];
            } Unknowns3[Unknown40] <optimize=false>;
        }
        else if (Unknown39 == 1)
        {
            int Unknown53;

            struct _UnknownStruct5
            {
                int Unknown54;
                CString Unknown55;
                int Unknown56;
                int Unknown57;

                struct _UnknownStruct6
                {
                    int Unknown58;
                    int Unknown59;
                    int Unknown60;
                    int Unknown61;
                    int Unknown62;
                } Unknowns6[Unknown57];
            } Unknowns5[Unknown53] <optimize=false>;
        }
    }
};



struct AnimationTimings{
    int magic;

    if(magic==1650881127){
        short version;

        
        struct Time{
            short len;
            struct Sth8{
                int uk; 
                if(version==4 || version == 2 || version == 3){
                    int uk2;
                    short uk;
                }
                short len2;
        
                struct Sth9{
                    byte uk; 
                    if(version==4) byte uk2;
                    short len3;
                    struct Sth10{
                        int uk[6];
                    } sth10[len3]  <optimize=false>;
                } sth9[len2] <optimize=false>;
            } sth8[len] <optimize=false>;
        } time <optimize=false>;


        if(version==3 || version==4) {
            struct TimeV3{
                int len;
                struct Sth7{
                    int uk[2];
                } sth7[len];
            } time3 <optimize=false>;
        }
    } else Printf("\nbad animTimings magic\n");

};


struct DrwResourceMeta {
    int uk[2];
    CString uk;
};


struct SthSound{
	byte sthSoundFile;
	short uk;
	int uk1[5];
	CString uk2;	
};

struct EffectSet{
    short type;
    CString checksum;
    
    if(type == 10 || type == 11 || type == 12){
        if(type==10) byte uk[20];
        int len;

        struct skelEff{
            CString skelFileName;
            int len1;
            struct WavHolder{
                int uk2[2];
                float one;
                int uk3[7];
				if(type>=12) byte uk4;
                byte FF;
                int len2;
                struct Wav{
                    byte id;
                    CString wavFileName;
                } wav[len2] <optimize=false>;
            } wavHolder[len1] <optimize=false>;
        } skelEffekts[len] <optimize=false>;
		
		short len4;
		struct Uks3{
            short uk1;
            int uk2[5];
            short uk3;
			short len6;
			SthSound sthSound2[len6] <optimize=false>;		
		} uks3[len4] <optimize=false>;
		
		
		
		
		short len3;
		struct Uks1{
			short uk;
			int uk1[5];
			short uk2;
			short len4;
			struct Uks2{
				short uk;
				int uk1[5];
				short uk2;
				short len5;
				SthSound sthSound[len5];
			} uks2[len4] <optimize=false>;
		} uks1[len3] <optimize=false>;
		
			
		
    } else if(type == 7 || type == 8 || type == 9){//needs testing, no file with this type found
		Printf("\nwarning, untested code");
        short len6;
		struct Uks4{
			short uk;
			short len7;
			SthSound sthSound3[len7];	
		} uks4[len6] <optimize=false>;
		
		short len8;
		struct Uks5{
			short uk1;
			short len9;
			SthSound sthSound4[len9];		
		} uks5[len8] <optimize=false>;
		
		
		
	}

};

struct CDrwLocatorList{
    int uk;
    int version;
    if(version==4){
		int len;
		struct UK2{
            int uk1[12];			
			int uk3[2];
			CString str2;
		} uk2[len]  <optimize=false>;
    } else if(version==5){
        int len;
        struct Uk1{
            int uk1[12];
            int uk2[2];
            CString str;
            int uk3;
        } uk1[len] <optimize=false>;

    } else Printf("\nnot implemented locator list version %d\n",version);
};

struct CGeoOBBTree{
	int magic;
	if(magic==1845540702){
		int id;
		if(id==1){
			byte uk[4096];
		} else if(id==2){
			byte uk[4096];
			int len1;
			struct Uks123{
				int64 uk1;
				short uk2[3];
				short uk3;
			} uks123[len1];
		} else if(id==3){
			int len2;
			float asd[len2*64/4];
			int len3;
			short uk6[len3*3];
			
			
		}
		
	} else Printf("\n invalid obb tree file\n");
	
	
};


local string filter = "*";

//Structure
int Magic <fgcolor=cBlue>; //0xC57CF11E
if(Magic==-981667554){
	int NumberOfModels <fgcolor=cBlue>; //Must be 1; confirmed everywhere 1

	int NodeInformationOffset <fgcolor=cBlue>; 
	int NodeHierarchyOffset <fgcolor=cBlue>; 
	uint NodeCount <fgcolor=cBlue>; //Node count

	if (NodeCount != 0)
	{
		FSeek(NodeInformationOffset);

		struct _RootNodeInfo{
			byte zeros[16]; //confirmed zero
			int negOne <format=hex>; //confirmed
			int one;//confirmed
			int uk2;
			int zero;//confirmed zero
		} RootNodeInfo <fgcolor=cBlue>;

		struct _NodeInformation
		{
			int magic;
			int Identifier;
			int Offset;
			int Size;
			byte uk[16]; // set to 0 didnt break anything
		} NodeInformation[NodeCount-1] <fgcolor=cBlue>;


		FSeek(NodeHierarchyOffset);

		struct _RootNode
		{
			int RootIdentifier;
			int Unknown;
			CString rootName;
		} RootNode <fgcolor=cBlue>;

		local int i = 1;
		struct _Node
		{
			local int NodeIndex = i;
			int InfoIndex;
			CString Name;
			int Unknown; //ChildCount?

			local int j;
			local int64 oldPosition;
			for (j = NodeCount-2; j >= 0; j--) 
			{
				if (NodeInformation[j].Identifier != NodeIndex)
					continue;

				oldPosition = FTell();
				FSeek(NodeInformation[j].Offset);
				if (NodeInformation[j].Size > 0)			//CGeoPrimitiveContainer always has size 0
				{
                    if(Strcmp(Name.Text,filter)==0 || Strcmp("*",filter)==0){ 
						if (Strcmp(Name.Text, "CGeoMesh") == 0)
							CGeoMesh Mesh;
						else if (Strcmp(Name.Text, "CDspJointMap") == 0)
							CDspJointMap JointMap;
						else if (Strcmp(Name.Text, "CSkSkinInfo") == 0)
							CSkSkinInfo SkinInfo;
						else if (Strcmp(Name.Text, "CSkSkeleton") == 0)
							CSkSkeleton Skeleton;
						else if (Strcmp(Name.Text, "CDspMeshFile") == 0)
							CDspMeshFile MeshFile;
						else if (Strcmp(Name.Text, "AnimationSet") == 0)
							AnimationSet AnimationsSet;
						else if (Strcmp(Name.Text, "AnimationTimings") == 0)
							AnimationTimings animationTimings;
						else if (Strcmp(Name.Text, "DrwResourceMeta") == 0)
							DrwResourceMeta drwResourceMeta;
						else if (Strcmp(Name.Text, "EffectSet") == 0)
							EffectSet effectSet;
						else if (Strcmp(Name.Text, "CDrwLocatorList") == 0)
							CDrwLocatorList locList;
						else if (Strcmp(Name.Text, "CGeoOBBTree") == 0)
							CGeoOBBTree obbTree;
						else {
							Printf("\nunknown Node Name %s \n",Name.Text);
							byte Data[NodeInformation[j].Size];
						}
					}
				}
				FSeek(oldPosition);
				break;
			}

			i = i + 1;
		} Nodes[NodeCount-1] <optimize=false, fgcolor=cBlue>;
	}
	//Printf("\n");
} else Printf("\n unknown drs magic");

 

Share this post


Link to post
Share on other sites

Okay I run into an issue which causes this weird looking animation glitches and wrongly imported skeletons.

When importing Blender can't use the bone names in the file because they are too long. I think blender automatically renames the bones what causes that animation mutation things because it cannot map them correctly and it would be so much work to rename every bone and map them manually..

Hope someone can use this information.

1b320c52efb78b06606497c655b71538.gif

ce93e36c714f86da37efcd30052d77c1.png

 

Share this post


Link to post
Share on other sites

i wrote you a short skript. every file in the same folder as the exe gets read and a new file with the names replaced by numbers gets output. its pretty slow for ~5mb files (20 seconds) and might give you a virus warning because of the language i chose.

rename.exe

Share this post


Link to post
Share on other sites

Posted (edited)

17 hours ago, bobfrog said:

i wrote you a short skript. every file in the same folder as the exe gets read and a new file with the names replaced by numbers gets output. its pretty slow for ~5mb files (20 seconds) and might give you a virus warning because of the language i chose.

rename.exe

Nice.
One question does it start by it self or do I have to start something? some times it did it some how but no idea how.

EDIT: Well, it just takes a while but works on some fine & on some bones the names are still too long.

3425446937d6ce9c0c02f7bdd46c7f2c.png

Edited by Kiliangg

Share this post


Link to post
Share on other sites

Posted (edited)

31 minutes ago, bobfrog said:

dk what went wrong there, maybe ill write a smd exporter somewhen

Got the blender log from the converted file. Also when I'm running it twice it only shows 3 bones are too long insted of 6 bones :drool:

 

Quote

SMD IMPORTER: now working on antiair_fix
- This is a mesh
 ERROR: Bone name "12|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|building_bandits_air_defense_launcher_pump_A_RT_Jnt" is too long to import. Truncating to "12|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|bui"
 ERROR: Bone name "12|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|building_bandits_air_defense_launcher_pump_A_CE_Jnt" is too long to import. Truncating to "12|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|bui"
 ERROR: Bone name "12|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|building_bandits_air_defense_launcher_pump_A_LF_Jnt" is too long to import. Truncating to "12|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|bui"
 ERROR: Bone name "121|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|building_bandits_air_defense_launcher_pump_A_RT_Jnt" is too long to import. Truncating to "121|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|bu"
 ERROR: Bone name "121|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|building_bandits_air_defense_launcher_pump_A_CE_Jnt" is too long to import. Truncating to "121|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|bu"
 ERROR: Bone name "121|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|building_bandits_air_defense_launcher_pump_A_LF_Jnt" is too long to import. Truncating to "121|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|bu"
- Imported 40 new bones
- Imported 1 frames of animation
DAG zero... not allowed to happen!
- New material: building_bandits_air_defense_launcher_col
Info: Removed 6747 vertices
Info: Removed 0 vertices
- Imported 2731 polys
SMD antiair_fix imported in under 1 second

6 Errors and 0 Warnings
Error: Bone name "12|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|building_bandits_air_defense_launcher_pump_A_RT_Jnt" is too long to import. Truncating to "12|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|bui"
Error: Bone name "12|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|building_bandits_air_defense_launcher_pump_A_CE_Jnt" is too long to import. Truncating to "12|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|bui"
Error: Bone name "12|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|building_bandits_air_defense_launcher_pump_A_LF_Jnt" is too long to import. Truncating to "12|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|bui"
Error: Bone name "121|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|building_bandits_air_defense_launcher_pump_A_RT_Jnt" is too long to import. Truncating to "121|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|bu"
Error: Bone name "121|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|building_bandits_air_defense_launcher_pump_A_CE_Jnt" is too long to import. Truncating to "121|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|bu"
Error: Bone name "121|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|building_bandits_air_defense_launcher_pump_A_LF_Jnt" is too long to import. Truncating to "121|building_bandits_air_defense_launcher_pump_A_hook_02_Jnt|bu"
Imported 1 files in 7.8 seconds with 6 Errors and 0 Warnings

 

 

Edited by Kiliangg

Share this post


Link to post
Share on other sites

my results of loading drs/ska in Unity
just managed to load and play animation properly

2.gif.0de7f9bc39d35ac24b400c99ffd9a246.gif3.gif.364d16e27e939c893d3f794162d4883a.gif

Share this post


Link to post
Share on other sites

never tested in Blender
i think problem is in converter
probably LightSong wrongly exports rotation/position of  skeleton bones

Share this post


Link to post
Share on other sites

for SKA file structure from previous posts

struct _Headers 
{ 
  uint Unknown1; 	//uint tick; //from LightSong 
  uint Unknown2; 	//uint interval; 
  uint Unknown3; 	//uint type; type==0 - position vector, type==1 - rotation quaternion 
  uint Unknown4; 	//uint boneId; same as CSkSkeleton.Bones[].Version (uint Version) 
} Headers[Length]; 
int Length6; 
uint Unknown1[Length6]; //float times[Length6] 
struct _Unknown2 	//animation keyFrames, if type==0 Point(valX,valY,valZ), if type==1 Quaternion(valX,valY,valZ,valW) 
{ 
  uint Unknown1; 	//float valX 
  uint Unknown2;	//float valY 
  uint Unknown3;	//float valZ 
  uint Unknown4;	//float valW //for type==0 valW==1 
  uint Unknown5;	//float tanX //tangents for animation curve 
  uint Unknown6;	//float tanY 
  uint Unknown7;	//float tanZ 
  uint Unknown8;	//float tanW //for type==0 tanW==0 
} Unknown2[Length6];

 

Share this post


Link to post
Share on other sites

Posted (edited)

so there is naitive import in unity? Have tried it without sucess but ggwp @solcrow

8 hours ago, solcrow said:

never tested in Blender
i think problem is in converter
probably LightSong wrongly exports rotation/position of  skeleton bones

Im not sure but the bones looked fine... they were just messed up in rotation: Z: -180° & x: -90° at least in Blender. But that would be a lefthanded / righthanded thing coordination so no real problem. 

Edited by Kiliangg

Share this post


Link to post
Share on other sites
1 hour ago, Kiliangg said:

Im not sure but the bones looked fine... they were just messed up in rotation: Z: -180° & x: -90° at least in Blender. But that would be a lefthanded / righthanded thing coordination so no real problem. 

I'm not so strong in animations. something is wrong with position/rotation in smd/ska
I tried import smd to 3dsmax then make fbx for Unity, didn't work.
Then i tried copy/paste position/rotation from smd file to Unity, didn't work.

there is no native import support in Unity
i wrote my own importer. Thanks to @Blank for sharing file structures
i will make something like model viewer. and maybe try to make drs/ska converter to fbx

 

Share this post


Link to post
Share on other sites

Posted (edited)

4 hours ago, solcrow said:

I'm not so strong in animations. something is wrong with position/rotation in smd/ska
I tried import smd to 3dsmax then make fbx for Unity, didn't work.
Then i tried copy/paste position/rotation from smd file to Unity, didn't work.

there is no native import support in Unity
i wrote my own importer. Thanks to @Blank for sharing file structures
i will make something like model viewer. and maybe try to make drs/ska converter to fbx

 

Ah okay ^^
yeah I know had no luck with 3Ds Maya either. 

Would love to have an converter since Unreals new Sequencer is so good <3

 

Also want to share the importer with us? Would be highly appreciated!

Edited by Kiliangg

Share this post


Link to post
Share on other sites

I allready made a model viewer for the drs file + texture. Can share later, but kinda busy right now.

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