Found some time to look into the issues you posted at 11-12-2019
@hfcandrew wrote:
1) Update tool isn't working, I get an error message too. See image attached.
2) Transformations of exactly 180 degree rotations do something really strange.
3) The the data stored for xyz translations only works for that specific scene in which they were created (KOOL.mix in my case), if I were to run them in a different scene they are completely off. (Rotations are fine though)
ad1) There's a little mistake in your modified version of the ToolManager (>V5b: line 390):
if param_list[i][ii] == "origin":
should be:
if param_list[i] == "origin":
without [ii] indexing.
ad2) 180° issue (happens on 90° and -90° too) is caused by a wrong regex formula I did. At those angles either sin or cos are equal zero. Instead of a 0.0 value MM sends a "near to zero" value in exponential form (e.g. 8.742277657347586e-08). The old formula cropped off the exponent (e-08) and returned only the basis (8.742277657347586). That caused these strange distortions. The "bracket" query in def ToolSet(src):
values = re.findall(r"([-+]?\d*\.?\d+[e]?[+-]?\d+?|\d*\.\d+|d+)", bracket)
needs to be:
values = re.findall(r"[+-]?\d+(?:\.\d+)?(?:[eE][+-]?\d+)?", bracket)
Note: In MM rotations can't be set absolute to some world axis. Rotations are relative to the current directions.
ad3): I think I've modified the code to allow to use a stored .csv on another scene with a different scene/world ratio now. I made several changes for the Transform tool.... Try attachment. Hopefully I didn't break other stuff. Let me know when you find some issues.
----------
Your screenshot issue might be some issue related to the graphic card too. Can you get a screenshot via that code ?
You should find the screenshot in the directory you saved the .py code to.
import os
import mmapi
from mmRemote import *
remote = mmRemote()
remote.connect()
cmd2 = mmapi.StoredCommands()
cmd2.AppendSceneCommand_SaveScreenShot(os.path.join( os.getcwd(), "screenshot.png" ))
remote.runCommand(cmd2)
remote.shutdown()
Gunter Weber
Triangle Artisan