-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #24 from sketchfab/bug/threading-crash_D3D-2521
[#D3D-2521] Fixes crash by using C4DThreading instead of threading pa…
- Loading branch information
Showing
1 changed file
with
9 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,10 @@ | ||
""" | ||
Sketchfab Exporter v1.2.2 | ||
Sketchfab Exporter v1.3.5 | ||
Copyright: Erwin Santacruz 2012 (www.990adjustments.com) | ||
Written for CINEMA 4D R13 - R15 | ||
Name-US: Sketchfab Exporter v1.2.2 | ||
Name-US: Sketchfab Exporter v1.3.5 | ||
Description-US: Model exporter for Sketchfab.com | ||
|
@@ -14,6 +14,7 @@ Modified Date: 03/16/13 | |
|
||
import c4d | ||
from c4d import documents, gui, plugins, bitmaps, storage | ||
from c4d.threading import C4DThread | ||
|
||
import datetime | ||
import os | ||
|
@@ -57,7 +58,7 @@ __sketchfab__ = "http://sketchfab.com" | |
__twitter__ = "@990adjustments" | ||
__email__ = "[email protected]" | ||
__plugin_title__ = "Sketchfab Exporter" | ||
__version__ = "1.3.0" | ||
__version__ = "1.3.5" | ||
__copyright_year__ = datetime.datetime.now().year | ||
__plugin_id__ = 1029390 | ||
|
||
|
@@ -182,18 +183,18 @@ This program comes with ABSOLUTELY NO WARRANTY. For details, please visit\nhttp: | |
zipObject.write(os.path.join(path, 'tex', f)) | ||
|
||
|
||
class PublishModelThread(threading.Thread): | ||
class PublishModelThread(C4DThread): | ||
"""Class that publishes 3D model to Sketchfab.com.""" | ||
|
||
def __init__(self, data, title, activeDoc, activeDocPath, enable_animation): | ||
threading.Thread.__init__(self) | ||
C4DThread.__init__(self) | ||
self.data = data | ||
self.title = title | ||
self.activeDoc = activeDoc | ||
self.activeDocPath = activeDocPath | ||
self.enable_animation = enable_animation | ||
|
||
def run(self): | ||
def Main(self): | ||
global g_uploaded | ||
global g_error | ||
|
||
|
@@ -772,8 +773,8 @@ Your API token can be found in your dashboard at sketchfab.com", c4d.GEMB_OK) | |
data['isPublished'] = auto_publish | ||
|
||
self.publish = PublishModelThread(data, title, activeDoc, activeDocPath, enable_animation) | ||
self.publish.setDaemon(True) | ||
self.publish.start() | ||
self.publish.Start() | ||
self.publish.Wait(True) | ||
|
||
return True | ||
|
||
|