It has a selection menu, next and previous buttons and different lighting intensity for different models that I set manually one by one. The web app is a React application that uses the Three.js GLTF loader to render the 3D models.
#Gta sa mp skin ids update
Next, I wrote a Node script to update the database with all the model urls.
I then used the Cloudinary resource API to list all the files. ImportPath = "C:\\path\\to\\SkinConverter\\Models\\" + fileName + ".dff"īpy.ops.import_dff.import_dff(filepath=importPath)ĮxportPath = "C:\\path\\to\\SkinConverter\\Exported\\" + fileName + ".glb"īpy.ops.export_scene.glb(filepath=exportPath) If (fileName in models and fileExtension = "dff"):īpy._all(action='TOGGLE') Models = įileName, fileExtension = file.split(".") Which I was able to automate using python, specifically the bpy package that allows you to control blender using python. So all that was left was to import the character models and export them to. Thankfully, there was a Blender addon that the GTA modding community create that allowed importing TXDs and DFFs. Now that I settled on a file format I needed to find a way to import. glb which is GLTF but in binary format, the advantages were that it was a single file (it didn't need another texture bitmap file to accompany it) and it was exportable from Blender. After a lot of experimentation with the file formats Three.js supported I settled on. Three.js is a popular library for doing 3D on the web. Converting The Models To A Web Friendly Format So I exported everything to a single folder and since I had the model names in a database I was able to filter the files needed. dff, extract it and repeat that 300 times in a buggy tool. It would take forever to get the model name, search for the. I used an img tool to extract all of the. For the images I found a SAMP forum post that had them all compressed for download, so I extracted them, ran a script to rename them based on the skins ids, uploaded them to my cloudinary CDN and then ran an update script to populate the image url column in the database.Įxtracting 3D Models from GTA San Andreas I needed to populate the database with information about every character skin, so, I scraped the SAMP Wiki All Skins page and automated extracting the model name, skin name/type and the gender. Three.js, React.js and Sass were used for the front-end while Node.js and Postgres were used in the back-end. The character models were in a proprietary format, so, to convert them to a web compatible format, Python was used to control Blender and automate more than 300 exports. GTA San Andreas 3D Skins is a web app where users can view all the GTA San Andreas characters in 3D with orbital controls.