colt Posted September 21, 2015 Report Posted September 21, 2015 Hi, there seems to be a problem between Max and the new api. I'm using Max 2015. While the old api does work, the new one freezes Max as soon as I call "ftrack_api.Session()".In logging debug this is as far as it gets:DEBUG:ftrack_api.session.Session:Calling server http://zz-str-ftrk001/api with '[{"action": "query_server_information"}]'INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): zz-str-ftrk001DEBUG:requests.packages.urllib3.connectionpool:"POST /api HTTP/1.1" 200 NoneDEBUG:ftrack_api.session.Session:Call took: 0.156DEBUG:ftrack_api.session.Session:Response: u'[{"version": "3.2.0.4335"}]'INFO:requests.packages.urllib3.connectionpool:Starting new HTTP connection (1): zz-str-ftrk001DEBUG:requests.packages.urllib3.connectionpool:"GET /socket.io/1/?api_user=xxxxx&api_key=xxxxxx HTTP/1.1" 200 NoneAnd then Max freezes. I'm using api 0.7.0 and the server is on 3.2.0.4335. From commandline or maya everything works fine. And since I'd prefer to base all upcoming stuff on the new api I'd love to get it to work in Max too. Cheers, Nico
colt Posted September 22, 2015 Author Report Posted September 22, 2015 Ok, I found the reason for this.It seems the it was the Debug output that froze Max and not the new Api. After setting logging back to Info it now works. Strange nevertheless. Nico
colt Posted September 26, 2015 Author Report Posted September 26, 2015 Just in case somebody else stumbles across this: The main reason for these (and other freezes I kept getting with the ftrack api) was that Max is not able to handle threads in Python that well. Especially printing to the maxscript listener from different threads make it freeze in no time. From the Help section of Maxplus: NOTE: Python scripts run in MAXScript are not thread-safe. Python commands are always executed in the main 3ds Max thread. You should not attempt to spawn separate threads in your scripts (for example, by using the Python threading module). You can circumvent this by either disconnecting the sys.stdout: http://help.autodesk.com/view/3DSMAX/2016/ENU/?guid=__files_GUID_B3FF3632_F177_4A90_AE3D_D36603B7A2F3_htm or using some other hackery to filter the output before it reaches the listener. Nico
Recommended Posts
Archived
This topic is now archived and is closed to further replies.