Hi thank you for replying.
Yes they run on the same computer.
I execute functions in a javascript plugin i wrote using json encoded commands send from maya to bake inside substance painter. Then send the filenames of the saved baked meshmaps as result string back to maya.
That worked fine in substancePainter 2020.2.1 (and most of the previous versions) but stopped working in 2020.2.2.
One of those strings i would send to painter via the jsonPort would be:
createProject( "c:/proj/chain_plane_1.obj", ['c:/proj/chain_element_1.obj', 'c:/proj/ground.obj'], {'outputSize': 1024});setSettings( "common", {'commonParameters': {'Dilation_Width': 6, 'Output_Size': [10, 10], 'Apply_Diffusion': true}, 'detailParameters': {'Use_Low_Poly_Mesh_as_High_Poly_Mesh':false , 'Antialiasing': 'None', 'High_Definition_Meshes': ['c:/proj/chain_element_1.obj', 'c:/proj/ground.obj'], 'Use_Cage':false , 'Low_poly_mesh_suffix': '_low', 'Ignore_backfaces_suffix': '_ignorebf', 'Match': 'Always', 'Ignore_Backface': true, 'Cage_File': '', 'Max_Rear_Distance': 0.001, 'Relative_to_Bounding_Box': true, 'High_poly_mesh_suffix': '_high', 'Average_Normals':false , 'Max_Frontal_Distance': 0.001}});
I only reduced the folderstructure in the previous line (passed image filepaths) so it would be a bit shorter in my post.
At the end i pass project setup parameters as dicts that made it easy to apply inside painter.
The encoded json string (with long image filepaths) would be:
{"js":"Y3JlYXRlUHJvamVjdCggImM6L19EcmFzYU9ubGluZV9XT1JLLzR6Yi9aQnJ1c2hfZXhwb3J0L2NoYWluX3BsYW5lXzEub2JqIiwgWydjOi9fRHJhc2FPbmxpbmVfV09SSy80emIvWkJydXNoX2V4cG9ydC9jaGFpbl9lbGVtZW50XzEub2JqJywgJ2M6L1VzZXJzL3dvcmtob3JzZS9Eb2N1bWVudHMvbWF5YS8yMDIxL3NjcmlwdHMvZ3JvdW5kLm9iaiddLCB7J291dHB1dFNpemUnOiAxMDI0fSk7c2V0U2V0dGluZ3MoICJjb21tb24iLCB7J2NvbW1vblBhcmFtZXRlcnMnOiB7J0RpbGF0aW9uX1dpZHRoJzogNiwgJ091dHB1dF9TaXplJzogWzEwLCAxMF0sICdBcHBseV9EaWZmdXNpb24nOiB0cnVlfSwgJ2RldGFpbFBhcmFtZXRlcnMnOiB7J1VzZV9Mb3dfUG9seV9NZXNoX2FzX0hpZ2hfUG9seV9NZXNoJzpmYWxzZSAsICdBbnRpYWxpYXNpbmcnOiAnTm9uZScsICdIaWdoX0RlZmluaXRpb25fTWVzaGVzJzogWydjOi9fRHJhc2FPbmxpbmVfV09SSy80emIvWkJydXNoX2V4cG9ydC9jaGFpbl9lbGVtZW50XzEub2JqJywgJ2M6L1VzZXJzL3dvcmtob3JzZS9Eb2N1bWVudHMvbWF5YS8yMDIxL3NjcmlwdHMvZ3JvdW5kLm9iaiddLCAnVXNlX0NhZ2UnOmZhbHNlICwgJ0xvd19wb2x5X21lc2hfc3VmZml4JzogJ19sb3cnLCAnSWdub3JlX2JhY2tmYWNlc19zdWZmaXgnOiAnX2lnbm9yZWJmJywgJ01hdGNoJzogJ0Fsd2F5cycsICdJZ25vcmVfQmFja2ZhY2UnOiB0cnVlLCAnQ2FnZV9GaWxlJzogJycsICdNYXhfUmVhcl9EaXN0YW5jZSc6IDAuMDAxLCAnUmVsYXRpdmVfdG9fQm91bmRpbmdfQm94JzogdHJ1ZSwgJ0hpZ2hfcG9seV9tZXNoX3N1ZmZpeCc6ICdfaGlnaCcsICdBdmVyYWdlX05vcm1hbHMnOmZhbHNlICwgJ01heF9Gcm9udGFsX0Rpc3RhbmNlJzogMC4wMDF9fSk7"}
So i don't know if the payload is the issue here because i pass way longer stuff to pre 2020.2.2 versions and it worked.
The errormessage maya prints out is:
# File "C:\Program Files\Autodesk\Maya2021\Python27\lib\json\decoder.py", line 382, in raw_decode
# raise ValueError("No JSON object could be decoded")
# ValueError: No JSON object could be decoded
I still use python2.7 for my python stuff inside maya.
As nobody else seems to have issues with the non-working (at least for me) jsonPort.
Maybe nobody really uses it ?
I only have minimal experience in network programming.
I am trying to figure out now using WebSockets (in c#) to communicate with substancePainter.
Or what would be the most recommended way to communicate with substancePainter ?
Thanks for your effort and stay healthy.
Ireneus