-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sketchfab upload node #712
Sketchfab upload node #712
Conversation
Latest Changes
also fix error not returning proper information (chunk.node.inputFiles.value - > [i.value for i in chunk.node.inputFiles.value])
also allow progress bar to be used even while messages are added
value='', | ||
uid=[0], | ||
), | ||
desc.StringParam( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe good to put a Choice with predefined list of possible licenses? Or at least put standard values in the tooltip.
files = self.resolvedPaths(chunk.node.inputFiles.value) | ||
zf = zipfile.ZipFile(uploadFile, 'w') | ||
for file in files: | ||
zf.write(file, os.path.basename(file)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this work when we connect Texture.outputTextures which contains the simplified regex: "texture_*.png"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes because it goes through resolvedPaths
which uses glob, like in the publish node. However, it does not work when Texture.output is connected because only the folder is copied, not the files in the folder. I will fix this
), | ||
desc.BoolParam( | ||
name='isPublished', | ||
label='Publish', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be better to save the model in Draft Mode by default. You likely want to fix the model orientation and lighting before publishing.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The default value is already False.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see, missed this.
description='Description cannot be longer than 1024 characters.', | ||
value='', | ||
uid=[0], | ||
), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about adding Categories (18) and Tags (comma separated)? This way the model Metadata would be complete.
Hi @ChemicalXandco, |
* changed license to a ChoiceParam * added private and password options
also delete temporary zip file when node terminates
desc.ChoiceParam( | ||
name='category', | ||
label='Category', | ||
description='Maximum of 2 categories.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exclusive is set to True, so in all case, we can choose only one category.
So the description or the "exclusive" mode should be adjusted.
chunk.logger.debug('Files added to zip: {}'.format(str(files))) | ||
chunk.logger.debug('Created {}'.format(uploadFile)) | ||
|
||
fileSize = os.path.getsize(uploadFile)/1000000 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fileSize = os.path.getsize(uploadFile)/(1024*1024)
@ChemicalXandco Thank you for this nice contribution! |
Description
Sketchfab is a popular website to share and view 3D files, this provides a node to allow direct upload to Sketchfab from meshroom using the data api
This PR is based off the same branch in my fork as #631 in order to use the logging functions here.
The code here is based on the data api with python.
Features list
Implementation remarks
I have tried using urllib to avoid having to add requests dependency, but in order for this to work it would need other dependencies anyway so requests is the best option here.
Currently, the API key needs to be put in for every new node, but I will look into a solution to overwrite the default node settings so that it can be automatically added when a new node is created. I will create a separate PR for this if I get round to it.