Batch/bulk uploading multiple models


(Rbgorham) #1

Hello! I apologize if this is an especially amateur question, but I have been trying everything I can find on the forums, tutorials, and outside sources in order to solve it, to no avail yet!

I have a few hundred models that are already complete (in .psx format, processed through texturing) that I would like to upload to my Sketchfab account, but cannot find any easy way to bulk/batch upload them. I have tried the built-in Upload option, which fails at the 200mb limit (and can't accommodate raw .psx files). I have tried the Sketchfab Uploader app for MacOS, which either never completes (just says "Processing" forever) or doesn't allow me to input my API token (just says "Loading..." forever). I have tried using Postman, HttpRequester, and RESTClient, but cannot pinpoint where API Tokens fit into the header fields/authorization fields/exactly why I am getting 401 and 404 errors. I have one big folder full of .psx files that it looks like I am going to have to manually upload one by one (and wait out the 3-5 minute upload timer between each one before moving on) if I can't nail down a workaround.

I am sorry for being such a complete noob at this, but if anyone could walk me through utilizing one of these options in pursuit of dumping a few hundred models onto my online account, it would be greatly appreciated!

(Mrchlblng) #2

@rbgorham, you have a couple of choices for batch upload:

function skfb_upload_model {
    local filename="$1"
    local title="$2"  # if not provided, the title will be the filename

    local description=""
    local tags="${SKFB_TAGS:-"mytag"}"
    local password=""
    local private="${SKFB_PRIVATE:-false}"
    local log="$( mktemp -t XXXXXXXXX )"

    curl -k -X POST -F "source=bash" \
                    -F "modelFile=@${filename}" \
                    -F "name=${title}" \
                    -F "description=${description}" \
                    -F "tags=${tags}" \
                    -F "private=${private}" \
                    -F "password=${password}" \
                    -F "token=${SKFB_TOKEN}" \
           >${log}  2>${log}_error

    local uid="$( cat "${log}" | cut -d'"' -f4 )"
    echo "* [$( basename "${filename}" )](${uid})"

which you may call like SKFB_TOKEN=<your_sketchfab_token> SKFB_PRIVATE=true SKFB_TAGS="foo1 foo2" skfb_upload_model /path/to/

However, we do not support the PSX file format so you would have to convert this first to one of our supported formats.

(Raould) #3

I would like to encourage work on making a bulk workflow that is good as a core feature of Sketchfab. (1) I should be able to upload multiple models via the web interface, and they should not go into a single scene. (2) i should be able to do bulk operations on the models, like change the background of the scene they are in, all at once e.g. make all my space ships have the same background.

(Decoright) #4

Hi, I have a similar task.

Before plunge deep into the API is it possible to setup the model through it? I mean set up the materials, post processing filter etc? It looks like only the base setup is available in your example.

(Mauricesvay) #5

The Data API allows you to set the shading, the background, and the orientation:!/models/patch_v3_models_uid_options

(Bulkuploader) #6

This post was flagged by the community and is temporarily hidden.