Forum

Author Topic: Issues uploading models to Sketchfab  (Read 7026 times)

Landy

  • Newbie
  • *
  • Posts: 36
    • View Profile
Issues uploading models to Sketchfab
« on: March 09, 2018, 10:07:37 AM »
I have two issues with uploading models to Sketchfab in more recent versions of Photoscan.  The first I have no answer for and would welcome suggestions, the second I do have a solution for, which I would like to share with others.  This is long, but bear with me. Questions pertain to version 1.4.1

Problem 1.  There appears to be no ‘upload model’ option under the ‘file’ menu despite instructions in the manual to the contrary.  Assuming it is now under the ‘upload data’ option, I have tried that as an alternative and chosen ‘sketchfab’ under the resulting dialogue box and chosen ‘model’ as the source data to upload.  However, this results in a poor quality model on the Sketchfab site which is very dark and contrasty with a black fringe around the margins.  It looks more like the shaded mesh view in photoscan rather than the textured view.  Not sure what I am doing wrong because it worked fine in version 1.2.6.  Any suggestions?

Problem 2.  The other upload option (which I personally prefer) is to export an OBJ model and associated files and then package them to 7zip format and upload manually.  Again, this worked fine in version 1.2.6, but when I use this method in version 1.4.1, the resulting uploaded model is completely white and has no texture (a problem which seems to crop up commonly in this forum).  Having kept exported files from a previous successful upload (from version 1.2.6), I exported the same model from version 1.4.1 only to result in the same blank white model in Sketchfab as other failures.  I then compared the exported outputs from versions 1.2.6 and 1.4.1.  The obj and jpg files were identical in size so I assumed they were essentially identical (jpg images were identical).  I then compared the two mtl files output from the two versions in a text editor and noticed a distinct difference.  The name of the texture file in the last line of the mtl file was written with double inverted commas in the files exported from version 1.4.1, but without the inverted commas 1.2.6.  For example (last line of file in each case):
mtl file output from version 1.4.1:
map_Kd "Melville Point 2018 northeast face 1.jpg"
mtl file output from version 1.2.6:
map_Kd Melville Point 2018 northeast face 1.jpg

After discovering this difference, I edited the mtl file (output from version 1.4.1) and removed the double inverted commas and then uploaded the files (zipped) to Sketchfab, and hey presto, this time it had the intended texture.  Hopefully others will find this useful.
cheers
Bill

 

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15124
    • View Profile
Re: Issues uploading models to Sketchfab
« Reply #1 on: March 09, 2018, 02:05:54 PM »
Hello Bill,

Can you provide some screenshots from the model view and the upload results?

As for the material names, I suggest not to use "spaces" in the OBJ export filenames, as many applications cannot handele them properly.
Best regards,
Alexey Pasumansky,
Agisoft LLC

Landy

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Issues uploading models to Sketchfab
« Reply #2 on: March 10, 2018, 03:08:14 AM »
Thanks Alexey.  I have done some more investigating and figured you were onto something with the ‘space’ characters in the filename (regarding my problem 2 above).  It seems that the newer releases of Photoscan add the quotation marks (double inverted commas) around the jpg file name as quoted in the mtl file - but only if there are space characters in the filename.  I noted it does not add the quotation marks if I change the space characters to underscores for example.  From what you say, Photoscan does this because the space characters can confuse other applications.  However as far as Sketchfab goes, the quotation marks are more confusing and the uploaded models display no texture.  I am happy with either solution here (not using spaces or removing the quotation marks from the mtl file).  It might be worthwhile keeping this in mind if others are having the ‘no texture’ problem with manual uploads to sketchfab (I might post this on the sketchfab forum also).

Back to problem 1 regarding the very dark models resulting from direct upload from Photoscan.  Here are two links to the same model.  The first is uploaded directly from Photoscan to Sketchfab and the second is manually uploaded via obj export:
https://skfb.ly/6x8JE
https://skfb.ly/6x8JF
The second model above looks like it does in Photoscan.  One thing I discovered with the direct upload model under “model information” (on the Sketchfab site) is that Photoscan now uses dae format for upload rather than obj format that earlier versions used.  I tested this, and manually exported and uploaded by dae format - the result was the same very dark model as in the first link above.  Even tweaking the exposure and brightness settings in Sketchfab cannot make these dark models look like they should.

My current solution is to keep manually uploading via obj format, as it produces the desired result and looks like it does in Photoscan - no big deal really.  Is there any way of telling Photoscan to upload the model to Sketchfab using obj rather than dae format?  I couldn’t see anything in the preferences menu about it.
cheers
Bill
« Last Edit: March 10, 2018, 03:17:34 AM by Landy »

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15124
    • View Profile
Re: Issues uploading models to Sketchfab
« Reply #3 on: March 12, 2018, 03:09:51 PM »
Hello Bill,

Have you tried to switch to "Diffuse" option in the Model Inspector menu of Sketchfab for the uploaded model?

As for COLLADA (dae) format, we are using it to allow keeping vertex colors information (OBJ format doesn't support vertex colors).
Best regards,
Alexey Pasumansky,
Agisoft LLC

Landy

  • Newbie
  • *
  • Posts: 36
    • View Profile
Re: Issues uploading models to Sketchfab
« Reply #4 on: March 14, 2018, 01:32:00 PM »
Thanks Alexey,
Yes - the "Diffuse" option seems to be switched on by default.  The sketchfab settings are identical for the two uploads - both are set to 'shadeless' etc.  However, your comment about vertex colours just led me to the solution.  I noticed that in edit mode, the .dae format upload had the option 'vertex colour' - an option that is not available in the .obj uploaded version.  The 'vertex colour' option appears to be switched on by default, but on switching it to 'off', the model magically appeared as it is supposed to!

Apologies for logging this as a 'bug' - obviously it is a change that needed me to adapt to the newer versions!  And thanks for leading me to the solution.
cheers
Bill

Alexey Pasumansky

  • Agisoft Technical Support
  • Hero Member
  • *****
  • Posts: 15124
    • View Profile
Re: Issues uploading models to Sketchfab
« Reply #5 on: March 14, 2018, 02:30:43 PM »
Hello Bill,

We'll check, if there's anything on our side we can do to automatically disable that "vertex colors" flag for textured models.

Actually, we are using COLLADA format for upload to have the possibility to keep the vertex color information for meshes and point clouds.
Best regards,
Alexey Pasumansky,
Agisoft LLC