Quote: "the vertex colours were all black"
i don't remember seeing that. was that for ALL FPSC models?
because:
dirty code:
// Project: FPSC Models
// Created: 2019-03-24
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "FPSC Model Viewer" )
SetWindowSize( 1080, 720, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1080, 720 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 60, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
SetPrintSize(18)
SetClearColor(255,0,255)
Last# = Timer()
type AnimData
name as string
first as integer
last as integer
endtype
GLOBAL Animation as AnimData []
AddAnim("Spawn", 190,209)
AddAnim("Idle", 210,234)
AddAnim("Walk", 235, 259)
AddAnim("Strafe Left", 260, 279)
AddAnim("Strafe Right", 280, 299)
AddAnim("Run", 300,318)
AddAnim("Reload/Toss", 319, 355)
AddAnim("New Climb", 160,189)
AddAnim("Impact Front", 0,19)
AddAnim("Bounce Front", 20,39)
AddAnim("Get Up Front", 493,522)
AddAnim("Impact Back", 40,59)
AddAnim("Bounce Back", 60,79)
AddAnim("Get Up Back", 523,552)
AddAnim("Impact Left", 120,139)
AddAnim("Impact Right", 80,99)
AddAnim("Bounce Right", 100,119)
AddAnim("Crouched Idle", 356,380)
AddAnim("Crouched Move Slow (same)", 381,405)
AddAnim("Crouched Strafe Left (same)", 381,405)
AddAnim("Crouched Strafe Right (same)", 381,405)
AddAnim("Crouched Move Fast (same)", 381,405)
AddAnim("Crouched Reload Weapon (or toss)", 406,442)
AddAnim("Freeform Idle", 443,462)
AddAnim("Freeform Move", 463,492)
AddAnim("Weapon Spawn", 553,572)
AddAnim("Weapon Idle", 573,597)
AddAnim("Weapon Move Slow", 598,622)
AddAnim("Weapon Strafe Left", 623,642)
AddAnim("Weapon Strafe Right", 643,662)
AddAnim("Weapon Move Fast", 663,681)
AddAnim("Weapon Reload Weapon (or Toss)", 682,731)
AddAnim("Weapon NEW Climb", 160,189)
AddAnim("Weapon Impact Front", 0,19)
AddAnim("Weapon Bounce Front", 20,39)
AddAnim("Weapon Get Up Front", 882,911)
AddAnim("Weapon Impact Back", 40,59)
AddAnim("Weapon Bounce Back", 60,79)
AddAnim("Weapon Get Up Back", 912,941)
AddAnim("Weapon Impact Left", 120,139)
AddAnim("Weapon Bounce Left", 140,159)
AddAnim("Weapon Impact Right", 80,99)
AddAnim("Weapon Bounce Right", 100,119)
AddAnim("Weapon Crouched Idle", 732,756)
AddAnim("Weapon Crouched Move Slow (same)", 757,781)
AddAnim("Weapon Crouched Strafe Left (same)", 757,781)
AddAnim("Weapon Crouched Strafe Right (same)", 757,781)
AddAnim("Weapon Crouched Move Fast (same)", 757,781)
AddAnim("Weapon Crouched Reload Weapon (or toss)", 782,831)
AddAnim("Weapon Freeform Idle", 832,851)
AddAnim("Weapon Freeform Move", 852,881)
ThisAnim = 0
ThisModel = LoadModel()
TotalAnims = Animation.Length
AnimName$ = GetObjectAnimationName(ThisModel,1)
`PlayObjectAnimation( ThisModel, AnimName$ , Animation[ThisAnim].first, Animation[ThisAnim].Last, 1, 0.0 )
SetObjectAnimationSpeed( ThisModel, 15.0 )
SetObjectImage(ThisModel, LoadTexture(), 0)
`ThisWeapon = LoadModel()
`ThisWeapImg = LoadWeaponImg() : SetObjectImage(ThisWeapon,ThisWeapImg,0)
TheseBones = GetObjectNumBones(ThisModel)
Repeat
For x = 1 to TheseBones
Print(STR(x) + " " + GetObjectBoneName(ThisModel,x))
Next x
Sync()
Until GetPointerPressed()
`FixObjectToBone(ThisWeapon, ThisModel, 29)
`RotateObjectBoneLocalY(ThisModel,1,180.0)
FixObjectPivot(ThisModel)
SetCameraPosition(1,0,GetObjectSizeMaxY(ThisModel),0)
SetCameraRotation(1,0,0,0)
MoveCameraLocalZ(1,-GetObjectSizeMaxY(ThisModel)*3.5 )
SetObjectLightMode(ThisModel,1)
SetSunActive(1)
SetSunDirection(1,-1,1)
SetSkyBoxVisible(1)
do
MX# = GetRawMouseX()
If GetRawKeyState(27) = 1 then Exit
If GetRawKeyPressed(32) = 1 then ShowBone = -ShowBone `[SPACE]
MWheel = GetRawMouseWheelDelta()
If MWheel
ThisAnim = ThisAnim + ABS(MWheel)/MWheel
If ThisAnim < 0 then ThisAnim = TotalAnims
If ThisAnim > TotalAnims then ThisAnim = 0
PlayObjectAnimation( ThisModel, AnimName$ , Animation[ThisAnim].first, Animation[ThisAnim].Last, 0, 0.0 )
Endif
If GetRawMouseLeftState()
If GetObjectIsAnimating(ThisModel) = 0 then PlayObjectAnimation( ThisModel, AnimName$ , Animation[ThisAnim].first, Animation[ThisAnim].Last, 0, 0.0 )
Endif
//If ShowBone = 1
//SetObjectVisible(Sphere,1)
//If Last# + 3 < Timer()
//ThisBone = ThisBone + 1 : If ThisBone > Bones then ThisBone = 1
//FixObjectToBone( Sphere, ThisModel, ThisBone )
//BoneName$ = GetObjectBoneName(ThisModel,ThisBone)
//Last# = Timer()
//Endif
//Else
//SetObjectVisible(Sphere,0)
//endif
If GetRawMouseRightState() = 1
MMX# = MX# - GetRawMouseX()
Rotate = MMX#
EndIf
Rotate = GetRawKeyState(37) - GetRawKeyState(39)
InOut = GetRawKeyState(38) - GetRawKeyState(40)
if Rotate <> 0 or MMX# <> 0 then SetObjectRotation(ThisModel,0,GetObjectAngleY(ThisModel)+Rotate,0)
MoveCameraLocalZ(1,GetCameraX(1)+InOut)
Print(GetRawLastKey())
Print(STR(ThisAnim) + " / " + Animation[ThisAnim].name)
`Print("Frame: " + GetObjectAnimationName
Print(GetObjectNumBones(ThisModel))
Sync()
loop
Function LoadModel()
ThisModel$ = ChooseRawFile("*.x")
ThisModel = LoadObjectWithChildren(ThisModel$)
Endfunction ThisModel
Function LoadTexture()
ThisTexture = LoadImage(ChooseRawFile("*.jpg;*.png"))
EndFunction ThisTexture
Function AddAnim(AnimName$, First, Last)
ThisAnim as AnimData
ThisAnim.name = AnimName$
ThisAnim.first = First
ThisAnim.last = Last
Animation.Insert(ThisAnim)
EndFunction
Function LoadWeapon()
ThisWeap$ = ChooseRawFile("*.x")
ThisWeap = LoadObject(ThisWeap$)
ThisTexture = LoadImage(ChooseRawFile("*.jpg;*.png"))
SetObjectImage(ThisWeap,ThisTexture,0)
EndFunction ThisWeap
Function LoadWeaponImg()
ThisTexture = LoadImage(ChooseRawFile("*.jpg;*.png"))
EndFunction ThisTexture
nothing special in there and dunno if that will help at all but my project folder is a mess/FULL of media that i wouldn't want to zip up :/ i guess throwing your model/texture in the media folder will work, tho
the only thing i remember modifying was converting the textures to jpg.