External file support


(Claudio Gallego) #1

Hello,

I'd like to let the user to upload his onw jpg file as a texture for a 3D object...
Does Sketchfab permit that ?

simple exemple would be to change the texture of a furniture...
another one would be to change the text / logo on a mug...


(Case3d) #2

We are also interested in the same thing. And/or if it is possible to add few options from which they can choose from?


(Bart) #3

@claudio_gallego Using the viewer API, someone could use a local image as a texture for someone else's model, but he can not save it. So I guess the usefulness would depend on your use case.

@case3d yes, certainly. Take a look at our 'configurator' example:

https://labs.sketchfab.com/experiments/configurator/


(Claudio Gallego) #4

ok, stupid question : where can i find the viewer API ?
any tutorals ?

regards.


(Bart) #5

Not stupid at all! We need to make it easier to find :smile:

Here's the official documentation: https://sketchfab.com/developers

And two tutorials to get you started:

Hope that helps!


(Claudio Gallego) #6

Many thanks, Bart,

So i guess it is possible to let the end user to up and change a jpg / png texture onto a 3D object ?

My project is this one :
A piece of code (html-js) is used to let the end user to put some text, and it gives a jpg as an output...
For now, i have to manually put the jpg on the 3D object (mugs for ex.), then render, then send the final picture...

i'd like to connect the existing code to up the new texture directly onto a 3D mug in sketchfab...

Feel free to give me some help / exemples so i can see how to make that...

Best regards.


(Bart) #7

I think that may be possible, but I'm going to have to call in the help from @mauricesvay and @james for details on that :smile:


(Mauricesvay) #8

The specific API function you are looking for is this one:
https://sketchfab.com/developers/viewer/functions#api-addTexture

This will let you register the image as a texture. You will then have to update the material of your 3D object with this texture.


(Claudio Gallego) #9

Waoh, that are 2 serious pluses, regardless of competition :
API, and fast dev-support guys !!!

Thank you !


(Claudio Gallego) #10

Alors ce qui est amusant, c'est que je viens d'apprendre que Sketchfab est français...
Nous voilà comme Bourvil et DeFunes dans les bains turcs dans "La grande vadrouille"...


(Case3d) #11

Thanks for the answer.
I'm not a java developer so it is little difficult for me to get through it. I cannot find where is the connection between java script and css design of the buttons. I changed the color of the button in css but it is not changed on the model. If it is too much to ask I'll ask someone that is java developer.. Thanks for the great and fast support! :smile: