Instead of spreading scripts all over the forum I'll post them in this thread from now on.
1 Script:
ToolManager
On a user's request I repost a message I did at MM's old forum on March 23, 2018, 01:30:51 PM:
Download below
"
Here’s a long raw script meant to run api commands without coding a .py file. Well, you’ll need the api to run (important instructions at post’s bottom) or compile the script to a standalone application (recommended it’s easy and seems to be faster) but after that it’s something I find very useful. I post it as it is without any warranty at your own risk in the hope you find it useful and maybe some better coder polishes this…
Why to use it:
For some tools MM remembers the last used parameter setting. For some tools or special parameters it always loads hard coded default values entering a tool. Now what to do if you want the parameters at a step before „last“ or different to defaults? In MM you always have to set this manually - hopefully your own brain remembers all parameters…..
What this script does:
With this ToolManager you can save current tool parameters and reload them. Means you can save several settings for the same tool and others as well.
As there is no direct function to get the current tool’s name in mmApi and it needs to be known to call this very tool and its parameters again, I use a pretty ugly workaround:
There’s a long list of tools and their parameters (BTW: There are more parameters than listed in the documentation or StoredCommands.h, so see this list as a reference too). As the tools have unique (one exception only: Bridge and Handle use the same parameters!) combinations of parameters one can find the tool itself. So the code iterates through the list of params trying to get that kind of value from MM. If MM responds with an empty list the very parameter isn’t currently available so skip to the next…. This ends in a list of available values and a toollname fitting to this combination which is saved in ToolManager.
Usage:
+Standard Tool features:
- Hitting „Save Tool“ button will save current tool settings to the list at top if MM is in some tool. So do your settings in MM and hit „SaveTool“ before leaving the tool. You may do several saves while being in the same tool too.
- The new entry in the list will be called „setting“ + some number by default. RMB-double click (on MAC), MMB-double click (on WIN) an item in the list opens a dialog where you can set a more meaningful description.
- Hitting „Delete“ will remove an selected item from the list.
- To restore a saved tool setting LMB-double click the item in the list. Note: It will cancel a tool currently open in MM. So if you want to keep the current result hit Accept in MM first.
- To change saved parameters in a saved setting, double click the item to run the tool with saved settings. Now change your settings in MM and hit UpdateTool in ToolManager. New settings are saved to the item now.
+ AutoSet features:
- Clicking AutoSet will perform listed tool actions from top to bottom and automatically accept them. This way you can perform some kind of simple „scripting“ .
- There are tools in MM not owning some parameters (e.g. Duplicate). Therefor they can’t be detected by my approach as described above. You can add such tools at the list’s bottom by hitting AddCom. A dialog will pop up where you can choose such a command to add.
- You can copy a selected item hitting the Copy button it will be copied to the bottom of the list.
- You can move an item up/down LMB-dragging it in the list. This is needed to get the right order of commands running AutoSet
- By default all added items in the list are active while running AutoSet. If you want to exclude an item without deleting it use the +/-Auto button. This toggles between active and inactive which greys-out selected item in the list.
I/O:
- You can save the current set of saved tools to a .csv file hitting SaveSet
- You can load such a set via LoadSet. This will replace the current list
Limitations:
- Using mmApi sends each parameter one by one. So expect some „motion“ in the scene while restoring tool settings of tools using a transformation widget.
- There’s no way I found to get/save the brush-type,-falloff,-color,-stencil in SCULPT so it will still use the last used one. Against that all other brush parameters can be saved (even symmetry plane settings)
- In case of SELECT/Edit/Handle and Bridge his approach can’t decide which was used. It will always think it’s Handle (maybe fixed by a decision dialog in the future)
- Don’t expect advanced mmApi stuff on this level of simply calling tools.
- Maybe bad, inefficient coding for now but working….
################
How to run this script:
- Download and setup mmApi using instructions at: https://github.com/meshmixer/mm-api
- Download, unzip attached file „ToolManager.py“ to mm-api-master/distrib/python (or python_osx on MAC)
- Edit def get_toolparam_mat3f(remote, param_name): in tool.py (mm directory) that way:
def get_toolparam_mat3f(remote, param_name): """Returns the current value of the given Tool parameter, or empty list if the parameter is not found.""" cmd = mmapi.StoredCommands() key = cmd.AppendGetToolParameterCommand(param_name) remote.runCommand(cmd) m = mmapi.mat3f() bFound = cmd.GetToolParameterCommandResult(key, m) if bFound: return tuple(m.m) #MagWeb: added output as tuple else: return ()
tuple(m.m) is needed to return 9 element tuples instead of SWIG objects in case of rotation matrices
##################
enjoy
"
You can do stuff like this:
bf8ff1a3-6198-4d7d-8e47-90d793fed1fb
Gunter Weber
Triangle Artisan
Instead of spreading scripts all over the forum I'll post them in this thread from now on.
1 Script:
ToolManager
On a user's request I repost a message I did at MM's old forum on March 23, 2018, 01:30:51 PM:
Download below
"
Here’s a long raw script meant to run api commands without coding a .py file. Well, you’ll need the api to run (important instructions at post’s bottom) or compile the script to a standalone application (recommended it’s easy and seems to be faster) but after that it’s something I find very useful. I post it as it is without any warranty at your own risk in the hope you find it useful and maybe some better coder polishes this…
Why to use it:
For some tools MM remembers the last used parameter setting. For some tools or special parameters it always loads hard coded default values entering a tool. Now what to do if you want the parameters at a step before „last“ or different to defaults? In MM you always have to set this manually - hopefully your own brain remembers all parameters…..
What this script does:
With this ToolManager you can save current tool parameters and reload them. Means you can save several settings for the same tool and others as well.
As there is no direct function to get the current tool’s name in mmApi and it needs to be known to call this very tool and its parameters again, I use a pretty ugly workaround:
There’s a long list of tools and their parameters (BTW: There are more parameters than listed in the documentation or StoredCommands.h, so see this list as a reference too). As the tools have unique (one exception only: Bridge and Handle use the same parameters!) combinations of parameters one can find the tool itself. So the code iterates through the list of params trying to get that kind of value from MM. If MM responds with an empty list the very parameter isn’t currently available so skip to the next…. This ends in a list of available values and a toollname fitting to this combination which is saved in ToolManager.
Usage:
+Standard Tool features:
- Hitting „Save Tool“ button will save current tool settings to the list at top if MM is in some tool. So do your settings in MM and hit „SaveTool“ before leaving the tool. You may do several saves while being in the same tool too.
- The new entry in the list will be called „setting“ + some number by default. RMB-double click (on MAC), MMB-double click (on WIN) an item in the list opens a dialog where you can set a more meaningful description.
- Hitting „Delete“ will remove an selected item from the list.
- To restore a saved tool setting LMB-double click the item in the list. Note: It will cancel a tool currently open in MM. So if you want to keep the current result hit Accept in MM first.
- To change saved parameters in a saved setting, double click the item to run the tool with saved settings. Now change your settings in MM and hit UpdateTool in ToolManager. New settings are saved to the item now.
+ AutoSet features:
- Clicking AutoSet will perform listed tool actions from top to bottom and automatically accept them. This way you can perform some kind of simple „scripting“ .
- There are tools in MM not owning some parameters (e.g. Duplicate). Therefor they can’t be detected by my approach as described above. You can add such tools at the list’s bottom by hitting AddCom. A dialog will pop up where you can choose such a command to add.
- You can copy a selected item hitting the Copy button it will be copied to the bottom of the list.
- You can move an item up/down LMB-dragging it in the list. This is needed to get the right order of commands running AutoSet
- By default all added items in the list are active while running AutoSet. If you want to exclude an item without deleting it use the +/-Auto button. This toggles between active and inactive which greys-out selected item in the list.
I/O:
- You can save the current set of saved tools to a .csv file hitting SaveSet
- You can load such a set via LoadSet. This will replace the current list
Limitations:
- Using mmApi sends each parameter one by one. So expect some „motion“ in the scene while restoring tool settings of tools using a transformation widget.
- There’s no way I found to get/save the brush-type,-falloff,-color,-stencil in SCULPT so it will still use the last used one. Against that all other brush parameters can be saved (even symmetry plane settings)
- In case of SELECT/Edit/Handle and Bridge his approach can’t decide which was used. It will always think it’s Handle (maybe fixed by a decision dialog in the future)
- Don’t expect advanced mmApi stuff on this level of simply calling tools.
- Maybe bad, inefficient coding for now but working….
################
How to run this script:
- Download and setup mmApi using instructions at: https://github.com/meshmixer/mm-api
- Download, unzip attached file „ToolManager.py“ to mm-api-master/distrib/python (or python_osx on MAC)
- Edit def get_toolparam_mat3f(remote, param_name): in tool.py (mm directory) that way:
def get_toolparam_mat3f(remote, param_name): """Returns the current value of the given Tool parameter, or empty list if the parameter is not found.""" cmd = mmapi.StoredCommands() key = cmd.AppendGetToolParameterCommand(param_name) remote.runCommand(cmd) m = mmapi.mat3f() bFound = cmd.GetToolParameterCommandResult(key, m) if bFound: return tuple(m.m) #MagWeb: added output as tuple else: return ()
tuple(m.m) is needed to return 9 element tuples instead of SWIG objects in case of rotation matrices
##################
enjoy
"
You can do stuff like this:
bf8ff1a3-6198-4d7d-8e47-90d793fed1fb
Gunter Weber
Triangle Artisan
2 Script:
MM Scene Manager
Here's another script I posted on the old forum on August 15, 2017, 07:51:01 PM. Think this is useful too.
Download below
"
I needed some advanced features to control a scene with multiple objects.
Using MM API I made a standalone application to replace MM's ObjectBrowser. This is my very first application so expect some issues and ugly source code but I did my best and found it running fine on several macOS machines here (even machines where MM API never was installed).
ATM it is Mac only, sorry, but pure Python 2.7 seems not to support builds for a different OS so I will have to install Python and MM API on Windows to build from the same code over there (or maybe somebody else does?).
Usage:
No installation procedure. Simply unpack it to somewhere on your HDD.
AFTER you've loaded at least one object to MM's scene launch MMSceneManager.app. Its GUI will show up. This window will be topmost all the time. As it is a separate application you may drag it to anywhere (even to a second monitor). Dragging the lower corners you may resize it to a desired shape.
MMSceneManager talks and listens to MM's scene. Therefore at launch it shows all objects (Meshes and Pivots) existing in MM's current scene. If you add a new object to MM's scene it will be added to the SceneManager highlighted in red. As soon as you click this highlighted item it will loose this "new" flag.
At launch SceneManager does not know about the visibility settings in MM. All items are marked with an "O" (= visible). To synchronise visibility you may click on the "ShowAll" Button which will set all meshes in MM to visible.
Hiding via SceneManager is simple: RMB-click on the item to hide in MM's scene. The item will now show a "X" (= non visible).
You can rename an item via LMB double click. Enter the new name in the pop up dialog.
Now the either sense of this app: It supports sorting in a hierarchical tree structure.
With LMB-drag you can move an item up and down onto existing and open levels. As MM does not know something about such levels at start you can move the item only up and down which is fine but not the kind of usage I wrote this app for.
With Shift+LMB-drag you can move item "A" (and if there already are "children" its children) onto another item "B" into a new depth of the scene-tree. Now "B" became the parent of "A". Again Shift+LMB dragging "B" onto an item "C" will make C the parent of B which is parent of A....aso.... As you may bind several same level children to a parent you can construct complex structures quickly.
As soon as you drop an item A onto another item B you will get a little triangle in front of the B entry. Clicking this triangle will open/close the next down level of children.
Back to LMB-dragging (without holding down Shift): With a parent B open you may drag the item to that level as well.
So if there's D being a child of C being a child of B being a child of A: LMB clicking of A will activate B, C and D in MM's scene as well. Clicking on B will also activate C and D - a quick way to activate and to set visibility (remember RMB click).
Now you may run into a situation where you want to activate a single object (which is a parent of children) only. For this I added the "Single" checkbox. This active will activate the clicked item only.
To organize objects without a direct parent there's the option to add "Boxes" to the tree ( "AddBox" button). A box is just a container object ( similar to a file's folder). It acts the same way (same commands) as an object item, but isn't sent to MM.
"Open All" button will expand all nodes in the tree to show the whole content.
Now when you did all that nice work to construct such a tree it might happen that you want to save this structure. MM can't do this. Therefore the "Save" button will save a .cvs table of the current tree. With the "Load" button you may call a previous saved layout. If the loaded scene in MM almost fits to the layout you'll have a nicer start next time you use SceneManager.
So far. Download below (source included in the .app bundle/Contents/Resources/MMSceneManager_01.py). Use it free but at your own risk, without any warranty.
Thanks to all the guys providing info about used modules (Tkinter and Python) all over the web!
"
Just an example of what you can do organising your scene that way:
Gunter Weber
Triangle Artisan
2 Script:
MM Scene Manager
Here's another script I posted on the old forum on August 15, 2017, 07:51:01 PM. Think this is useful too.
Download below
"
I needed some advanced features to control a scene with multiple objects.
Using MM API I made a standalone application to replace MM's ObjectBrowser. This is my very first application so expect some issues and ugly source code but I did my best and found it running fine on several macOS machines here (even machines where MM API never was installed).
ATM it is Mac only, sorry, but pure Python 2.7 seems not to support builds for a different OS so I will have to install Python and MM API on Windows to build from the same code over there (or maybe somebody else does?).
Usage:
No installation procedure. Simply unpack it to somewhere on your HDD.
AFTER you've loaded at least one object to MM's scene launch MMSceneManager.app. Its GUI will show up. This window will be topmost all the time. As it is a separate application you may drag it to anywhere (even to a second monitor). Dragging the lower corners you may resize it to a desired shape.
MMSceneManager talks and listens to MM's scene. Therefore at launch it shows all objects (Meshes and Pivots) existing in MM's current scene. If you add a new object to MM's scene it will be added to the SceneManager highlighted in red. As soon as you click this highlighted item it will loose this "new" flag.
At launch SceneManager does not know about the visibility settings in MM. All items are marked with an "O" (= visible). To synchronise visibility you may click on the "ShowAll" Button which will set all meshes in MM to visible.
Hiding via SceneManager is simple: RMB-click on the item to hide in MM's scene. The item will now show a "X" (= non visible).
You can rename an item via LMB double click. Enter the new name in the pop up dialog.
Now the either sense of this app: It supports sorting in a hierarchical tree structure.
With LMB-drag you can move an item up and down onto existing and open levels. As MM does not know something about such levels at start you can move the item only up and down which is fine but not the kind of usage I wrote this app for.
With Shift+LMB-drag you can move item "A" (and if there already are "children" its children) onto another item "B" into a new depth of the scene-tree. Now "B" became the parent of "A". Again Shift+LMB dragging "B" onto an item "C" will make C the parent of B which is parent of A....aso.... As you may bind several same level children to a parent you can construct complex structures quickly.
As soon as you drop an item A onto another item B you will get a little triangle in front of the B entry. Clicking this triangle will open/close the next down level of children.
Back to LMB-dragging (without holding down Shift): With a parent B open you may drag the item to that level as well.
So if there's D being a child of C being a child of B being a child of A: LMB clicking of A will activate B, C and D in MM's scene as well. Clicking on B will also activate C and D - a quick way to activate and to set visibility (remember RMB click).
Now you may run into a situation where you want to activate a single object (which is a parent of children) only. For this I added the "Single" checkbox. This active will activate the clicked item only.
To organize objects without a direct parent there's the option to add "Boxes" to the tree ( "AddBox" button). A box is just a container object ( similar to a file's folder). It acts the same way (same commands) as an object item, but isn't sent to MM.
"Open All" button will expand all nodes in the tree to show the whole content.
Now when you did all that nice work to construct such a tree it might happen that you want to save this structure. MM can't do this. Therefore the "Save" button will save a .cvs table of the current tree. With the "Load" button you may call a previous saved layout. If the loaded scene in MM almost fits to the layout you'll have a nicer start next time you use SceneManager.
So far. Download below (source included in the .app bundle/Contents/Resources/MMSceneManager_01.py). Use it free but at your own risk, without any warranty.
Thanks to all the guys providing info about used modules (Tkinter and Python) all over the web!
"
Just an example of what you can do organising your scene that way:
Gunter Weber
Triangle Artisan
Also:
I posted a second script allowing stuff like that:
This post, usage instructions, script + screencast was marked and deleted as SPAM.
Should I add some emoji?
Gunter Weber
Triangle Artisan
Also:
I posted a second script allowing stuff like that:
This post, usage instructions, script + screencast was marked and deleted as SPAM.
Should I add some emoji?
Gunter Weber
Triangle Artisan
OK, the return of the deleted post so a
3. Script:
MM Slicer
Download below
I did this script to automate a workflow I explained here . I post it as it is, without any warranty at your own risk, in the hope you find it useful.
Why to use it:
Older versions had a tool to horizontally cut an object into 3 dimensional slices of the same height. This functionality had to be removed. This script adds the possibility to insert registration dowels for better mounting the machined output later on.
What this script does:
The mmApi Python code will cut activated objects. Visible, but not active objects are used to:
The script sorts the resulting parts and fitting dowels and combines the them to final slices with registration dowels.
Usage:
The script in action:
Gunter Weber
Triangle Artisan
OK, the return of the deleted post so a
3. Script:
MM Slicer
Download below
I did this script to automate a workflow I explained here . I post it as it is, without any warranty at your own risk, in the hope you find it useful.
Why to use it:
Older versions had a tool to horizontally cut an object into 3 dimensional slices of the same height. This functionality had to be removed. This script adds the possibility to insert registration dowels for better mounting the machined output later on.
What this script does:
The mmApi Python code will cut activated objects. Visible, but not active objects are used to:
The script sorts the resulting parts and fitting dowels and combines the them to final slices with registration dowels.
Usage:
The script in action:
Gunter Weber
Triangle Artisan
You never cease to amaze me. You're "Tool Manager" has just saved me about 2 minutes of repetitive clicking multiplied 5-10 times a day. <3!!!
I noticed 'Tool Manager does not allow for several 'selection' based functions such as "Select Visible", "Contract Ring" and "Invert". Also an auto-pause feature for when something needs to selected manually, before moving onto the next tool.
Is there any way to incorporate these functions? This would save me another minute per job... 5-10 times a day.
You never cease to amaze me. You're "Tool Manager" has just saved me about 2 minutes of repetitive clicking multiplied 5-10 times a day. <3!!!
I noticed 'Tool Manager does not allow for several 'selection' based functions such as "Select Visible", "Contract Ring" and "Invert". Also an auto-pause feature for when something needs to selected manually, before moving onto the next tool.
Is there any way to incorporate these functions? This would save me another minute per job... 5-10 times a day.
Things can be improved...
There are some tools needing some "seed selection". One could construct such a seed for SelectVisible (for the actual seed is ignored by SelectVisible if it in not visible) by ray casting. Pretty sure that's doable...
Think a Invert selection can be called via api as well...
Contract/ExpandRing: These one click actions need to count the times you call the commands... let's see...
Break points to perform the cue?: Think there's something here which I can polish and add to the code...
Gunter Weber
Triangle Artisan
Things can be improved...
There are some tools needing some "seed selection". One could construct such a seed for SelectVisible (for the actual seed is ignored by SelectVisible if it in not visible) by ray casting. Pretty sure that's doable...
Think a Invert selection can be called via api as well...
Contract/ExpandRing: These one click actions need to count the times you call the commands... let's see...
Break points to perform the cue?: Think there's something here which I can polish and add to the code...
Gunter Weber
Triangle Artisan
Amazing, because right now for my work flow i need to align and transform the foot, pause to select visible, contract rings a few times, pause to manually select a few patches of triangles by hand as needed, then smooth the boundary, invert selection, delete it. Select the toes, repeat previous steps etc... so currently there is the option to save a 'select' tool but you cannot use it for anything because it does not pause to give you a chance to select what you need.
I eagerly await your 'v2.0' !
Amazing, because right now for my work flow i need to align and transform the foot, pause to select visible, contract rings a few times, pause to manually select a few patches of triangles by hand as needed, then smooth the boundary, invert selection, delete it. Select the toes, repeat previous steps etc... so currently there is the option to save a 'select' tool but you cannot use it for anything because it does not pause to give you a chance to select what you need.
I eagerly await your 'v2.0' !
I found a bug in the 'transform' function, might be as simple as a typo. When you try to save a tool for transform that has an XYX rotation as a parameter of it, it seems to save it as an XYZ scale parameter.
See attached for screen shots and .cvs
I wanted to rotate Y 90 degrees, when i saved the tool and ran it, it did not rotate but instead scaled X 1.787 and Z 0.5596 and left Y as 1.
I found a bug in the 'transform' function, might be as simple as a typo. When you try to save a tool for transform that has an XYX rotation as a parameter of it, it seems to save it as an XYZ scale parameter.
See attached for screen shots and .cvs
I wanted to rotate Y 90 degrees, when i saved the tool and ran it, it did not rotate but instead scaled X 1.787 and Z 0.5596 and left Y as 1.
Instead of writing the rotation matrix to the .csv there's still the SWIG object.
Did you edit def get_toolparam_mat3f(remote, param_name): in tool.py ? This file is in the mm directory. You need to change it the way I described above (see 1. post here and the code snippet in its How to run this script section).
Seems to be a bug in the api....
Gunter Weber
Triangle Artisan
Instead of writing the rotation matrix to the .csv there's still the SWIG object.
Did you edit def get_toolparam_mat3f(remote, param_name): in tool.py ? This file is in the mm directory. You need to change it the way I described above (see 1. post here and the code snippet in its How to run this script section).
Seems to be a bug in the api....
Gunter Weber
Triangle Artisan
Argh... just noticed: I posted a wrong ToolManager script version above. Sorry.
Unfortunately forum soft doesn't allow editing former posts.
As V2 is almost ready I recommend waiting for this...
Gunter Weber
Triangle Artisan
Argh... just noticed: I posted a wrong ToolManager script version above. Sorry.
Unfortunately forum soft doesn't allow editing former posts.
As V2 is almost ready I recommend waiting for this...
Gunter Weber
Triangle Artisan
Oh okay. Good to know, I'm excited! Haha and feel no rush my friend.
I did try editing the code as outlined, but I must have done it wrong, it only partially fixed the rotate, but then made translate not work correctly anymore. I think I misinterpreted your instructions.
Again as a non-coder, I tried a couple different combinations of editing the single line, then tried adding that whole section in, then adding that whole section in but deleting the old one.
Which method is correct? ...or ya, I can easily wait until v2
Thanks again! (ps. Not all heroes wear capes)
Oh okay. Good to know, I'm excited! Haha and feel no rush my friend.
I did try editing the code as outlined, but I must have done it wrong, it only partially fixed the rotate, but then made translate not work correctly anymore. I think I misinterpreted your instructions.
Again as a non-coder, I tried a couple different combinations of editing the single line, then tried adding that whole section in, then adding that whole section in but deleting the old one.
Which method is correct? ...or ya, I can easily wait until v2
Thanks again! (ps. Not all heroes wear capes)
In thew hope it might be useful, at your own risk:
ToolManager V2:
not tested that much ( bunnies were busy last days to hide egges):
Added:
- You can run a cue of commands towards the list’s end from a current item (> PlayDown)
- You can add a break to a cue of commands. (> AddBreak). Use PlayDown to continue the listed commands below a break.
- You can modify a current selection (> AddSel)
- detection of tools needing a selection: Script will pause if a tool needs some selection( use PlayDown to continue).
- You can store a certain aspect (StoreCam). Useful for actions like SelectVisible…
- You can undo a PlayAll cue via UndoAll
- You can undo a PlayDown cue via UndoLast
Changes (compared to ToolManager(V1):
- Label of AutoSet changed to PlayAll
- Label of +/- Autro changed to +/- Skip
- Hacking of mm/tool.py NOT needed any more. So if you did the hack to run ToolManager V1 (see 1. post of this thread) undo it to:
def get_toolparam_mat3f(remote, param_name): """Returns the current value of the given Tool parameter, or empty list if the parameter is not found.""" cmd = mmapi.StoredCommands() key = cmd.AppendGetToolParameterCommand(param_name) remote.runCommand(cmd) m = mmapi.mat3f() bFound = cmd.GetToolParameterCommandResult(key, m) if bFound: return m else: return ()
+ some bugs (as the rotation matrix issue) should be fixed.
Gunter Weber
Triangle Artisan
In thew hope it might be useful, at your own risk:
ToolManager V2:
not tested that much ( bunnies were busy last days to hide egges):
Added:
- You can run a cue of commands towards the list’s end from a current item (> PlayDown)
- You can add a break to a cue of commands. (> AddBreak). Use PlayDown to continue the listed commands below a break.
- You can modify a current selection (> AddSel)
- detection of tools needing a selection: Script will pause if a tool needs some selection( use PlayDown to continue).
- You can store a certain aspect (StoreCam). Useful for actions like SelectVisible…
- You can undo a PlayAll cue via UndoAll
- You can undo a PlayDown cue via UndoLast
Changes (compared to ToolManager(V1):
- Label of AutoSet changed to PlayAll
- Label of +/- Autro changed to +/- Skip
- Hacking of mm/tool.py NOT needed any more. So if you did the hack to run ToolManager V1 (see 1. post of this thread) undo it to:
def get_toolparam_mat3f(remote, param_name): """Returns the current value of the given Tool parameter, or empty list if the parameter is not found.""" cmd = mmapi.StoredCommands() key = cmd.AppendGetToolParameterCommand(param_name) remote.runCommand(cmd) m = mmapi.mat3f() bFound = cmd.GetToolParameterCommandResult(key, m) if bFound: return m else: return ()
+ some bugs (as the rotation matrix issue) should be fixed.
Gunter Weber
Triangle Artisan
I know about a difference of RMB and MMB (on WIN the right mouse button is 3 while it is 2 on a MAC. The middle mouse button is 2 on WIN while it is 3 on MAC). But that should not affect LMB dragging (keeping LMB pressed) in the list. For the RMB action (renaming an item via RMB double click) you need to change the code (there's a comment in the # Tkinter GUI stuff& trigger buttons section in line 699) or use MMB instead.
Did you try the SceneManager code above? Does dragging the items work there for you?
Thanks, I called the wrong column of the table (parameters instead of the tool's name) > fixed for the next release.
SELECT doesn't need a selection and therefor the cue doesn't stop. Only the tools you get in MM after you did a selection pause automatically if there's no selection and call SELECT at pause. So you don't have to store SELECT before a tool needing selection. Store SELECT only if you want to define stuff like the brush size or to get rid of an existing selection.
Can't reproduce that. If you store the tool without having used the transform widget it will be skipped. But if you did a transformation and stored the tool it in this state it should apply the transformation. Doesn't that work on your side?
Yes, instead of undoing the whole cue of commands I write a restore .mix at a Play start. Unfortunately there's no way I know to get the name of the loaded file via mmApi to name that restore file. The only way would be to do loading of the file in MM via the Manager or to implement a entry box to name the restore file manually. Maybe I add an optional real MM Undo/Redo (keeping the current file) step by step in the future.
Hmm, I know that the cam jumps back to the position it had before setting a certain position via mmApi if you navigate in MM again. So this feature is meant mainly for SelectVisible and that works fine here. But what I see on your screenshot seems to be some MM rendering issue.... Or is it a result of a cue? If you play a cue of several (cam positions plus a following appendVisible (from AddSel)): Does that work?
Maybe in the future - if we can solve such issues as above
That may be a focus handling issue: If you set new parameters in MM don't click on the UpdateTool button directly but give the ToolManager window (it's a different application) the focus first (e.g. by clicking on the help text) and then hit the update button.
Here it updates fine. Could you try with explicit focus on the manager window?
Saw that loading your .csv. Seems separation of lines acts different on Win. Gonna look into that...
SelectVisible discards the current selection and selects the currently visible faces. To append faces to the current selection you need to add appendVisible to the list of commands. Is that what you want to get?
Maybe that's a result of not needed SELECT steps in the cue or a switch to a tool not using a selection at all? As in pure MM you will loose selections doing certain tasks.
It might be a good idea if the script does not 'auto accept' each tool, make it an 'AddCom' option that you need to put in after each tool. Maybe that will fix some things.
I had such a auto accept option in my very first code (and it's still in the table). Let's see...
Thanks!
Gunter Weber
Triangle Artisan
I know about a difference of RMB and MMB (on WIN the right mouse button is 3 while it is 2 on a MAC. The middle mouse button is 2 on WIN while it is 3 on MAC). But that should not affect LMB dragging (keeping LMB pressed) in the list. For the RMB action (renaming an item via RMB double click) you need to change the code (there's a comment in the # Tkinter GUI stuff& trigger buttons section in line 699) or use MMB instead.
Did you try the SceneManager code above? Does dragging the items work there for you?
Thanks, I called the wrong column of the table (parameters instead of the tool's name) > fixed for the next release.
SELECT doesn't need a selection and therefor the cue doesn't stop. Only the tools you get in MM after you did a selection pause automatically if there's no selection and call SELECT at pause. So you don't have to store SELECT before a tool needing selection. Store SELECT only if you want to define stuff like the brush size or to get rid of an existing selection.
Can't reproduce that. If you store the tool without having used the transform widget it will be skipped. But if you did a transformation and stored the tool it in this state it should apply the transformation. Doesn't that work on your side?
Yes, instead of undoing the whole cue of commands I write a restore .mix at a Play start. Unfortunately there's no way I know to get the name of the loaded file via mmApi to name that restore file. The only way would be to do loading of the file in MM via the Manager or to implement a entry box to name the restore file manually. Maybe I add an optional real MM Undo/Redo (keeping the current file) step by step in the future.
Hmm, I know that the cam jumps back to the position it had before setting a certain position via mmApi if you navigate in MM again. So this feature is meant mainly for SelectVisible and that works fine here. But what I see on your screenshot seems to be some MM rendering issue.... Or is it a result of a cue? If you play a cue of several (cam positions plus a following appendVisible (from AddSel)): Does that work?
Maybe in the future - if we can solve such issues as above
That may be a focus handling issue: If you set new parameters in MM don't click on the UpdateTool button directly but give the ToolManager window (it's a different application) the focus first (e.g. by clicking on the help text) and then hit the update button.
Here it updates fine. Could you try with explicit focus on the manager window?
Saw that loading your .csv. Seems separation of lines acts different on Win. Gonna look into that...
SelectVisible discards the current selection and selects the currently visible faces. To append faces to the current selection you need to add appendVisible to the list of commands. Is that what you want to get?
Maybe that's a result of not needed SELECT steps in the cue or a switch to a tool not using a selection at all? As in pure MM you will loose selections doing certain tasks.
It might be a good idea if the script does not 'auto accept' each tool, make it an 'AddCom' option that you need to put in after each tool. Maybe that will fix some things.
I had such a auto accept option in my very first code (and it's still in the table). Let's see...
Thanks!
Gunter Weber
Triangle Artisan
I know about a difference of RMB and MMB (on WIN the right mouse button is 3 while it is 2 on a MAC. The middle mouse button is 2 on WIN while it is 3 on MAC). But that should not affect LMB dragging (keeping LMB pressed) in the list. For the RMB action (renaming an item via RMB double click) you need to change the code (there's a comment in the # Tkinter GUI stuff& trigger buttons section in line 699) or use MMB instead.
Did you try the SceneManager code above? Does dragging the items work there for you?
- I have not tried changing TKinter or downloading the SceneManger yet, I will try it later this week
Thanks, I called the wrong column of the table (parameters instead of the tool's name) > fixed for the next release.
- Nice!
SELECT doesn't need a selection and therefor the cue doesn't stop. Only the tools you get in MM after you did a selection pause automatically if there's no selection and call SELECT at pause. So you don't have to store SELECT before a tool needing selection. Store SELECT only if you want to define stuff like the brush size or to get rid of an existing selection.
- Understood. Yes I was using too many.
Can't reproduce that. If you store the tool without having used the transform widget it will be skipped. But if you did a transformation and stored the tool it in this state it should apply the transformation. Doesn't that work on your side?
- Clicking on the toolmanager window first has fixed this, I think was also just doing something wrong with the order of actions
Yes, instead of undoing the whole cue of commands I write a restore .mix at a Play start. Unfortunately there's no way I know to get the name of the loaded file via mmApi to name that restore file. The only way would be to do loading of the file in MM via the Manager or to implement a entry box to name the restore file manually. Maybe I add an optional real MM Undo/Redo (keeping the current file) step by step in the future.
- Okay. Not a big concern of mine.
Hmm, I know that the cam jumps back to the position it had before setting a certain position via mmApi if you navigate in MM again. So this feature is meant mainly for SelectVisible and that works fine here. But what I see on your screenshot seems to be some MM rendering issue.... Or is it a result of a cue? If you play a cue of several (cam positions plus a following appendVisible (from AddSel)): Does that work?
- No is does not work. See screencast.
Maybe in the future - if we can solve such issues as above
- Yep!
That may be a focus handling issue: If you set new parameters in MM don't click on the UpdateTool button directly but give the ToolManager window (it's a different application) the focus first (e.g. by clicking on the help text) and then hit the update button.
- Clicking on the toolmanager window first has fixed this, I think was also just doing something wrong with the order of actions
Here it updates fine. Could you try with explicit focus on the manager window?
- Clicking on the toolmanager window first has fixed this, I think was also just doing something wrong with the order of actions
Saw that loading your .csv. Seems separation of lines acts different on Win. Gonna look into that...
- Thanks
SelectVisible discards the current selection and selects the currently visible faces. To append faces to the current selection you need to add appendVisible to the list of commands. Is that what you want to get?
- Yep. Works fine. User error again
Maybe that's a result of not needed SELECT steps in the cue or a switch to a tool not using a selection at all? As in pure MM you will loose selections doing certain tasks.
- Ya mentioned above already, user error again
I had such as auto accept option in my very first code (and it's still in the table). Let's see...
- Sounds good. It may be a good option for scenarios when needing to pull up a tool up with most the defaults preset but want to change like 1 parameter before accepting and moving on
So see the below screencast of playing around building a work flow and the .stl and .cvs.
Have any thoughts on what I'm doing wrong with the camera?
Also I found another issue, when doing a rotational transform, it saves properly when in World but not Local
I know about a difference of RMB and MMB (on WIN the right mouse button is 3 while it is 2 on a MAC. The middle mouse button is 2 on WIN while it is 3 on MAC). But that should not affect LMB dragging (keeping LMB pressed) in the list. For the RMB action (renaming an item via RMB double click) you need to change the code (there's a comment in the # Tkinter GUI stuff& trigger buttons section in line 699) or use MMB instead.
Did you try the SceneManager code above? Does dragging the items work there for you?
- I have not tried changing TKinter or downloading the SceneManger yet, I will try it later this week
Thanks, I called the wrong column of the table (parameters instead of the tool's name) > fixed for the next release.
- Nice!
SELECT doesn't need a selection and therefor the cue doesn't stop. Only the tools you get in MM after you did a selection pause automatically if there's no selection and call SELECT at pause. So you don't have to store SELECT before a tool needing selection. Store SELECT only if you want to define stuff like the brush size or to get rid of an existing selection.
- Understood. Yes I was using too many.
Can't reproduce that. If you store the tool without having used the transform widget it will be skipped. But if you did a transformation and stored the tool it in this state it should apply the transformation. Doesn't that work on your side?
- Clicking on the toolmanager window first has fixed this, I think was also just doing something wrong with the order of actions
Yes, instead of undoing the whole cue of commands I write a restore .mix at a Play start. Unfortunately there's no way I know to get the name of the loaded file via mmApi to name that restore file. The only way would be to do loading of the file in MM via the Manager or to implement a entry box to name the restore file manually. Maybe I add an optional real MM Undo/Redo (keeping the current file) step by step in the future.
- Okay. Not a big concern of mine.
Hmm, I know that the cam jumps back to the position it had before setting a certain position via mmApi if you navigate in MM again. So this feature is meant mainly for SelectVisible and that works fine here. But what I see on your screenshot seems to be some MM rendering issue.... Or is it a result of a cue? If you play a cue of several (cam positions plus a following appendVisible (from AddSel)): Does that work?
- No is does not work. See screencast.
Maybe in the future - if we can solve such issues as above
- Yep!
That may be a focus handling issue: If you set new parameters in MM don't click on the UpdateTool button directly but give the ToolManager window (it's a different application) the focus first (e.g. by clicking on the help text) and then hit the update button.
- Clicking on the toolmanager window first has fixed this, I think was also just doing something wrong with the order of actions
Here it updates fine. Could you try with explicit focus on the manager window?
- Clicking on the toolmanager window first has fixed this, I think was also just doing something wrong with the order of actions
Saw that loading your .csv. Seems separation of lines acts different on Win. Gonna look into that...
- Thanks
SelectVisible discards the current selection and selects the currently visible faces. To append faces to the current selection you need to add appendVisible to the list of commands. Is that what you want to get?
- Yep. Works fine. User error again
Maybe that's a result of not needed SELECT steps in the cue or a switch to a tool not using a selection at all? As in pure MM you will loose selections doing certain tasks.
- Ya mentioned above already, user error again
I had such as auto accept option in my very first code (and it's still in the table). Let's see...
- Sounds good. It may be a good option for scenarios when needing to pull up a tool up with most the defaults preset but want to change like 1 parameter before accepting and moving on
So see the below screencast of playing around building a work flow and the .stl and .cvs.
Have any thoughts on what I'm doing wrong with the camera?
Also I found another issue, when doing a rotational transform, it saves properly when in World but not Local
Didn't allow two attachments in one post. .stl below
Didn't allow two attachments in one post. .stl below
Screen cast also did not post. I'll try again
Screen cast also did not post. I'll try again
Thanks for the screencast.
Just a hint on your workflow: If you insert a SelectAll above SelectVisible you can run the whole cue without any interaction.
I see the rendering issues on restoring a cam position. But it seems that the following SelectVisible and the cue below does its job as intended. Restoring such a cam position works fine here and there are no such rendering failures (but there's a TitanX GPU built in...). You might try whether it works disabling ShowViewCube and disable EnableAntiAliasedRendering in Preferences or even switch to BasicRendering.
For there are rendering issues MM when no printer is selected maybe you try it with the printer bed being visible
Also compiling the code to a standalone application and running the resulting .exe (or .app on a Mac) should work better (but I'm not sure if it fixes that rendering problem). Compiling also allows to run the app on systems where Python or mmApi isn't installed at all.
Gunter Weber
Triangle Artisan
Thanks for the screencast.
Just a hint on your workflow: If you insert a SelectAll above SelectVisible you can run the whole cue without any interaction.
I see the rendering issues on restoring a cam position. But it seems that the following SelectVisible and the cue below does its job as intended. Restoring such a cam position works fine here and there are no such rendering failures (but there's a TitanX GPU built in...). You might try whether it works disabling ShowViewCube and disable EnableAntiAliasedRendering in Preferences or even switch to BasicRendering.
For there are rendering issues MM when no printer is selected maybe you try it with the printer bed being visible
Also compiling the code to a standalone application and running the resulting .exe (or .app on a Mac) should work better (but I'm not sure if it fixes that rendering problem). Compiling also allows to run the app on systems where Python or mmApi isn't installed at all.
Gunter Weber
Triangle Artisan
Wait, seems I can reproduce the issue now...
Gunter Weber
Triangle Artisan
Wait, seems I can reproduce the issue now...
Gunter Weber
Triangle Artisan
Can't find what you're looking for? Ask the community or share your knowledge.