- Joined
- Jul 7, 2007
- Messages
- 962
- Reaction score
- 161
hello i'm proud to release this converter i have been working on and off on for the last few 2 days
Programmed in: C++
Features:
Attempts to fix broken .wgt
Generates .wgts files (need to add source below this fix's the armours bug that is if you want to use it for .sco generation)
Convert separate scb files to sco
Convert separate scb files to obj
Convert all scb to obj in the same directory
Convert all scb to sco in the same directory
Download v1.6:
Virus Scan:
Modifications to RsBuild to work with new wgts files
Find (r3dObj.h):
Add this under it:
Find(r3dObj.cpp):
Replace with:
ScreenShots:
Let the leeching begin... lol
Credits:
Me
Warz
GigaToni (for the idea + hints about the weight files)
Programmed in: C++
Features:
Attempts to fix broken .wgt
Generates .wgts files (need to add source below this fix's the armours bug that is if you want to use it for .sco generation)
Convert separate scb files to sco
Convert separate scb files to obj
Convert all scb to obj in the same directory
Convert all scb to sco in the same directory
Download v1.6:
You must be registered to see links
Virus Scan:
You must be registered to see links
Modifications to RsBuild to work with new wgts files
Find (r3dObj.h):
Code:
void TryLoadWeights(const char* baseFileName);
Add this under it:
Code:
void LoadSourceWeights(const char* fname);
Find(r3dObj.cpp):
Code:
void r3dMesh::TryLoadWeights( const char* baseFileName )
{
// first, try .wgt
char weightName[25];
ToSkinFileName( weightName, baseFileName ) ;
if(r3d_access(weightName, 0) == 0)
LoadWeights( weightName );
}
Replace with:
Code:
void r3dMesh::TryLoadWeights( const char* baseFileName )
{
// first, try .wgt
char weightName[256], weightsource[256];
ToSkinFileName( weightName, baseFileName ) ;
sprintf(weightsource, "%ss", weightName);
if(r3d_access(weightsource, 0) == 0)
LoadSourceWeights(weightsource);
else if(r3d_access(weightName, 0) == 0)
LoadWeights( weightName );
}
void r3dMesh::LoadSourceWeights(const char* fname)
{
AllocateWeights();
for(int i=0;i<NumVertices;i++) {
pWeights[i].BoneID[0] = 0;
pWeights[i].Weight[0] = 0;
pWeights[i].BoneID[1] = 0;
pWeights[i].Weight[1] = 0;
pWeights[i].BoneID[2] = 0;
pWeights[i].Weight[2] = 0;
pWeights[i].BoneID[3] = 0;
pWeights[i].Weight[3] = 0;
}
r3dFile *f = r3d_open(fname, "rb");
if(!f) r3dError("can't open %s\n", fname);
char inbuf[256], buf1[128];
int VertNum = 0;
fgets(inbuf, sizeof(inbuf), f);
sscanf(inbuf, "%s %d", buf1, &VertNum);
for(int i=0; i<VertNum ;i++)
{
r3dWeight& w = pWeights[i];
float ws = 0.0f;
for(int k=0; k<4; k++)
{
byte iBoneId = 0;
float fWeight = 0;
fgets(inbuf, sizeof(inbuf), f);
if(sscanf(inbuf, "%d %f", &iBoneId, &fWeight) == 2)
{
if(!(fWeight >= 0.f && fWeight <= 1.f)) r3dOutToLog("Weight Issue: %f", fWeight);
r3d_assert(fWeight >= 0.f && fWeight <= 1.f);
w.Weight[k] = fWeight;
w.BoneID[k] = iBoneId;
ws += w.Weight[k];
}
}
if(ws > 0.0f)
{
// renormalize weights, because some Maya exporter dude screwed it up.
w.Weight[0] /= ws;
w.Weight[1] /= ws;
w.Weight[2] /= ws;
w.Weight[3] /= ws;
}
}
fclose(f);
return;
}
ScreenShots:
Let the leeching begin... lol
Credits:
Me
Warz
GigaToni (for the idea + hints about the weight files)
Attachments
You must be registered for see attachments list
Last edited: