From 80fd5a4dd4b3192cb5d0126a321964b9509da668 Mon Sep 17 00:00:00 2001 From: Aurelien Chatelain Date: Mon, 26 Feb 2018 14:45:02 +0100 Subject: [PATCH 1/2] [#D3D-2521] Fixes exporter crash Replace python threading package with Cinema4D's own threading fixes crash when exporting into FB --- Sketchfab-Exporter.pyp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Sketchfab-Exporter.pyp b/Sketchfab-Exporter.pyp index e9ea770..f59c4ac 100644 --- a/Sketchfab-Exporter.pyp +++ b/Sketchfab-Exporter.pyp @@ -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 @@ -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 From 0e87fad39e817cdd55ccd2bf537a65bb49daaa4c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Aur=C3=A9lien=20Chatelain?= Date: Mon, 9 Apr 2018 14:58:30 +0200 Subject: [PATCH 2/2] [#D3D-2521] Updates version to 1.3.5 *Fix exporter crash due to threading issues --- Sketchfab-Exporter.pyp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Sketchfab-Exporter.pyp b/Sketchfab-Exporter.pyp index f59c4ac..46030ed 100644 --- a/Sketchfab-Exporter.pyp +++ b/Sketchfab-Exporter.pyp @@ -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 @@ -58,7 +58,7 @@ __sketchfab__ = "http://sketchfab.com" __twitter__ = "@990adjustments" __email__ = "hi@990adjustments.com" __plugin_title__ = "Sketchfab Exporter" -__version__ = "1.3.0" +__version__ = "1.3.5" __copyright_year__ = datetime.datetime.now().year __plugin_id__ = 1029390