Important information: this site is currently scheduled to go offline indefinitely by end of the year.

Star Wars - The Old Republic - Beta - GR2 model

Post questions about game models here, or help out others!
CZW
veteran
Posts: 151
Joined: Thu May 05, 2005 3:15 pm
Has thanked: 117 times
Been thanked: 15 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by CZW »

Privateer wrote:
JakeGreen wrote:so any progress on making it easier to find .GR2 models, i have a beta build from back this September and the last beta build, i happen to install 2 beta builds and i didn't buy the game since i don't have the money to keep paying on it and i've tried both build and can only get the weapons and ships and props and skeletons.gr2s out of the files, can you tell me where i can find the characters like this and the droid on the other pages cause they are more use to me thin the props since i'm converting and animating them to another star wars game for a mod
The GR2 files are extracted but many are listed as .txt files as the MYP extraction stuff is not perfect.
Open the .txt files in a hex editor and look at the file header and rename as needed.
I'd like to get the time to finish a program I have started that finds and renames gr2 files.
You drag and drop a folder on it and hit OK. It searches every file in every subfolder and does the dirty work.

take your time ... it look great !!
Privateer
veteran
Posts: 104
Joined: Fri Oct 21, 2011 1:33 pm
Location: On my Network, unless I'm somewhere else
Has thanked: 9 times
Been thanked: 30 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by Privateer »

take your time ... it look great !!
This is a quick Script for SweetScape's 010 Hex Editor.
It will search all files in a folder and all subfolders for the GAWB used in the new SWTOR GR2 files and list them.
*EDIT------
--- Added a command to save the OutPut to a text file.
--- Edited to better work with the Renameing script.
--- Added a check to only name files with one occurence of the search found at the start of the file.
This is a quick work around for now.

You'll have a list of all files that are actually GR2 files.

Copy the code and save as FindAllGR2.1sc
Edit the C:\\temp to whatever folder you have your extracts saved in.

Code: Select all

//-----------------------------------
//--- 010 Editor v3.2.2 Script File
//
// File:     FindAllGR2.1sc
// Revision: 1.0
// Purpose: Opens all files, looks for GAWB.
//You must have Version 3.1.0 or higher If you have an older version?
// Remove the RequiresVersion line and OutputPaneSave line then you can select all in the output pane and copy.
//Create a new txt file and then paste.
//----------------------------------------------------------------------------------
RequiresVersion(3, 1, 0);

 int i, j;
    TFindInFilesResults r = FindInFiles( "GAWB", "C:\\temp", "*.*" );   
      for( i = 0; i < r.count; i++ )
    {
        for( j = 0; j < r.file[i].count; j++ )
          { 
            if(r.file[i].start[j] == 0 &&  r.file[i].count == 1)
            Printf( "%Ls\n", r.file[i].filename );
           }
    }

    OutputPaneSave("GR2List.txt");

This is a quick working Script until I get the main application finished.



On the plugin for Noesis,
I've sent python code and information to convert the texcoords to nocoli_s
Hopefully he'll have something for us real soon.
Last edited by Privateer on Mon Dec 26, 2011 6:20 pm, edited 5 times in total.
Give a man a fish and he'll eat for a day.
Try to teach a man to fish and he'll gripe at you for not just giving him the Damn Fish!
mazor
advanced
Posts: 44
Joined: Tue Jun 07, 2011 9:22 pm
Has thanked: 157 times
Been thanked: 2 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by mazor »

Will this script work with the old GR2 beta files as well? It would be awesome if you could write something to identify and rename those deadbeef text files. Thanks for your efforts.
Privateer
veteran
Posts: 104
Joined: Fri Oct 21, 2011 1:33 pm
Location: On my Network, unless I'm somewhere else
Has thanked: 9 times
Been thanked: 30 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by Privateer »

mazor wrote:Will this script work with the old GR2 beta files as well? It would be awesome if you could write something to identify and rename those deadbeef text files. Thanks for your efforts.
Just change the GAWB to )ÞlÀ and it should do the job.

I'll get a script out that will read the output list and do the renameing of the extensions soonish.
It will only change the extension, not the first part with all the numbers for now.
So 0AE02A76_325D6DA9AEB4F9A8.txt will become 0AE02A76_325D6DA9AEB4F9A8.gr2 as an example.
If someone finds a list or something that could be cross referenced to do a full rename?
That would be great.
Give a man a fish and he'll eat for a day.
Try to teach a man to fish and he'll gripe at you for not just giving him the Damn Fish!
Privateer
veteran
Posts: 104
Joined: Fri Oct 21, 2011 1:33 pm
Location: On my Network, unless I'm somewhere else
Has thanked: 9 times
Been thanked: 30 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by Privateer »

Here's the renameing script for 010.
Feel free to edit it as you wish as it can be used to rename other file types if you also edit the script I posted above.
I suggest you recopy the above script as I did edit it to work better with this script.
Merry Christmas all!

Code: Select all

//-----------------------------------
//   010 Editor v3.2.2 Script File
//
// File:     SWTORBatchRename.1sc
// Revision: 1.0
// Purpose: Takes as input a text file containing a list of file names, one per line. 
//          Opens each file in the list, performs processing on the file name  
//          (in this case renames the actual files)
//          and then closes the file.
//-----------------------------------
// Define variables
int64 out;
int   len, listfile, i, pos;
char  filename[512], listfilename[512], filerenamed[512], ext[5];
ext = ".gr2";

// Input text file containing a list of files to process
listfilename = InputOpenFileName( "Choose File with list of Files to Rename", 
    "Text Files (*.txt)|*.txt|All Files (*.*)|(*.*)" );
if( Strlen( listfilename ) == 0 )
    return -1;

// Open text file containing a list of files
if( FileOpen( listfilename ) < 0 )
    return -1;
MessageBox(idOk, "DON'T BLINK!", "I'm Going to Rename the files...");

//strip the first line from the file and such

SetCursorPos(0);
out += Replace("202020,h", "");

int Replace(const string sstr,const string dst)
{
   int i=0;
   int out=0;

 do
  {
    i=ReplaceAll( sstr, dst, true, false, false, 0.0, 1, 0, 0, false );
  }
 while (i>0);
 return(out>0?out:0);
}
 filename = ReadLine( FTell() );
    len = Strlen( filename );
    FSkip( len );
    if( len > 0 && filename[len-1] == 0xA && filename[len-2] == 0xD  && filename[len-3] == 0x2E && filename[len-4] == 0x2E && filename[len-5] == 0x2E)
         DeleteBytes( pos, len );
//End of stripping

listfile = GetFileNum();

// Read the list file for a set of file names, each file on a different line

while( !FEof()  )
{
    // Get file name from list - remove end of line characters
    filename = ReadLine( FTell() );
    len = Strlen( filename );
    FSkip( len );
    if( len > 0 && filename[len-1] == 0xA )
         filename[len-1] = 0;
    if( len > 1 && filename[len-2] == 0xD )
         filename[len-2] = 0;
 //change the file extension
    Strcpy(filerenamed, filename );
    filerenamed = StrDel(filerenamed, Strstr( filerenamed, "." ), 4 );
    Strcat(filerenamed, ext );

 // Rename the files
    RenameFile(filename, filerenamed );

   // Close file
    FileSelect( listfile );
}

// Close original list file
FileClose();
    // Print out results
MessageBox(idOk, "POOF!", "Done Renameing files.");
Last edited by Privateer on Wed Dec 28, 2011 4:34 am, edited 2 times in total.
Give a man a fish and he'll eat for a day.
Try to teach a man to fish and he'll gripe at you for not just giving him the Damn Fish!
SWTOR fan
veteran
Posts: 112
Joined: Thu Nov 17, 2011 5:33 pm
Has thanked: 35 times
Been thanked: 132 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by SWTOR fan »

Great job on writing the scripts, Privateer! :)

I do not know the format of the 010 templates but I believe there is a small error in your renaming script:
if( len > 0 && filename[len-1] == 0xA && filename[len-1] == 0xD && filename[len-3] == 0x2E && filename[len-4] == 0x2E && filename[len-5] == 0x2E)
The red letter has to be a "2", otherwise the if condition will never return true.

Also, I believe your first script is searching through the whole content of the files and not just the first four bytes. Because of this there may be some false positives, but if you have it correct in your main application this will do for the moment.
Privateer
veteran
Posts: 104
Joined: Fri Oct 21, 2011 1:33 pm
Location: On my Network, unless I'm somewhere else
Has thanked: 9 times
Been thanked: 30 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by Privateer »

Good spotting Mate!
Error corrected in the second script.
Even with that error it only catches and removes the first line 010 adds to the output txt file.
That's why it slipped by me when I was cutting and pasteing things.

1st script edited to print names of files with the occurrence found ONLY at the beginning of the file.
If further occurrences are found, the file is ignored.
If you find a file that does have more then one occurrence and is a valid file your searching for?
Give me a link to them and I'll adjust the script.
Give a man a fish and he'll eat for a day.
Try to teach a man to fish and he'll gripe at you for not just giving him the Damn Fish!
mazor
advanced
Posts: 44
Joined: Tue Jun 07, 2011 9:22 pm
Has thanked: 157 times
Been thanked: 2 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by mazor »

Excellent work! I'll give these scripts a whirl and see what happens. Thanks.
nicoli_s
advanced
Posts: 77
Joined: Fri Jan 07, 2005 7:47 am
Has thanked: 1 time
Been thanked: 3 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by nicoli_s »

hey so im still working on getting my extractor done, but i can post that Privateer helped me figure out the tex coords, and if you use C#, the XNA class HalfSingle handles them just fine. The main thing im working on now is that some models have different lengths for the vertex block, some are 32 bytes, while others are just 24, theres some flag controlling it that im looking for. Also it looks like some material info is in the files still so im tracking that down, but expect to have a way to see these models online sometime soon :)
Privateer
veteran
Posts: 104
Joined: Fri Oct 21, 2011 1:33 pm
Location: On my Network, unless I'm somewhere else
Has thanked: 9 times
Been thanked: 30 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by Privateer »

nicoli_s wrote:hey so im still working on getting my extractor done, but i can post that Privateer helped me figure out the tex coords, and if you use C#, the XNA class HalfSingle handles them just fine. The main thing im working on now is that some models have different lengths for the vertex block, some are 32 bytes, while others are just 24, theres some flag controlling it that im looking for. Also it looks like some material info is in the files still so im tracking that down, but expect to have a way to see these models online sometime soon :)
Good to hear Mate!
MrAdults also guided me to the correct way to extract those texcoords in Noesis.
noesis.getFloat16 does the job.

I also have a good idea on how the Normals are compressed now thanks to some reading in the
Forza Motorsport Resource Extraction (.carbin) thread.
I'm hopeing for some samples of those files and an extracted mesh from same to examine.

Just so you all know.....
I'll be takeing a few days to do some 3D modeling work for a Mate doing a Mod for Silent Hunter 3 this week.
I've been Modding Silent Hunter Games for a few years and mostly assist others with thier projects now days.
I'll probably be adjusting the scripts above to better aid in searching/renameing the different file types but that will be on the back burner
unless it's an important fix that needs done right away.
Give a man a fish and he'll eat for a day.
Try to teach a man to fish and he'll gripe at you for not just giving him the Damn Fish!
mazor
advanced
Posts: 44
Joined: Tue Jun 07, 2011 9:22 pm
Has thanked: 157 times
Been thanked: 2 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by mazor »

I ran the script and all seems to be running well, but no txt file was generated in the output. I specified the correct path for C:\\temp. Did I do something wrong?

Image
Privateer
veteran
Posts: 104
Joined: Fri Oct 21, 2011 1:33 pm
Location: On my Network, unless I'm somewhere else
Has thanked: 9 times
Been thanked: 30 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by Privateer »

Were the actual extracted files in the folder you searched?
Check the folder the script is in for the output file.
You were searching an older Beta that exported actual GR2's correct?
The easiest way to run the script is to double click it with 010 closed.
Once everything opens, hit the F7 key.
If your path is correct and the files are there it should work properly and show a list in the Output window.
If you changed the search string and are searching the later Beta? You won't find anything.
Give a man a fish and he'll eat for a day.
Try to teach a man to fish and he'll gripe at you for not just giving him the Damn Fish!
JakeGreen
mega-veteran
mega-veteran
Posts: 164
Joined: Sun Aug 22, 2010 10:14 pm
Has thanked: 40 times
Been thanked: 11 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by JakeGreen »

if possible can someone give a way to use this script i'm kinda dumb when it comes to hex editors, i downloaded the program but how do i use it with your script?
Privateer
veteran
Posts: 104
Joined: Fri Oct 21, 2011 1:33 pm
Location: On my Network, unless I'm somewhere else
Has thanked: 9 times
Been thanked: 30 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by Privateer »

The easiest way to run the script is to double click it with 010 closed.
Once everything opens, hit the F7 key.
If your path is correct and the files are there it should work properly and show a list in the Output window
and save the txt file to the same folder the script is in.
(I keep the script on my desktop)
Create a temp folder on the root of C: and copy the extracted SWTOR stuff there if you don't want to edit the search path.

I'll probably add pop up boxes so you can type in the search phrase and path to search.
The output could do that also but 2 boxes is enuff and the output is always saved to the same folder as the script unless you change that in the script.

This is mostly a way to quick test things before I re-code the stand alone app.
It's done in pure C as is most of the scripting.
Last edited by Privateer on Tue Dec 27, 2011 5:46 am, edited 1 time in total.
Give a man a fish and he'll eat for a day.
Try to teach a man to fish and he'll gripe at you for not just giving him the Damn Fish!
mazor
advanced
Posts: 44
Joined: Tue Jun 07, 2011 9:22 pm
Has thanked: 157 times
Been thanked: 2 times

Re: Star Wars - The Old Republic - Beta - GR2 model

Post by mazor »

Privateer wrote:Were the actual extracted files in the folder you searched?
Check the folder the script is in for the output file.
You were searching an older Beta that exported actual GR2's correct?
The easiest way to run the script is to double click it with 010 closed.
Once everything opens, hit the F7 key.
If your path is correct and the files are there it should work properly and show a list in the Output window.
If you changed the search string and are searching the later Beta? You won't find anything.
The extracted text files were in the folder I searched and yes I am searching an older beta. I'll try it again with a different path.
Post Reply