tyFlow Forum
Can the "open editor" of tyflow be moved to the toolbar? - Printable Version

+- tyFlow Forum (https://forum.tyflow.com)
+-- Forum: tyFlow Discussion (https://forum.tyflow.com/forum-1.html)
+--- Forum: General Discussion (https://forum.tyflow.com/forum-2.html)
+--- Thread: Can the "open editor" of tyflow be moved to the toolbar? (/thread-2691.html)



Can the "open editor" of tyflow be moved to the toolbar? - cgdvs - 10-07-2021

HI, Tyso!

Can the "open editor" of tyflow be moved to the toolbar? This will open the editor faster and more directly. 


       Thank you


RE: Can the "open editor" of tyflow be moved to the toolbar? - tyFlow - 10-07-2021

Hey cgdvs,

You can open the editor of any tyFlow object using the MAXScript command:

Code:
$.editor_open()

Using that code, you can create a macroscript that allows you to open it from any button or menu item that you wish.


RE: Can the "open editor" of tyflow be moved to the toolbar? - cgdvs - 10-07-2021

Thank you. It's really a good idea.
The only regret may need to select "tyflow" in the case.


If the tyflow object name in the scene is custom. In this case, "select $tyflow 001" is used. There will be a problem. No matter how the tyflow name changes, you can still select the tyflow object in the scene or open editing through code execution. Is this possible?


RE: Can the "open editor" of tyflow be moved to the toolbar? - tyFlow - 10-07-2021

Well, the bigger issue is that if there are more than one tyFlow objects in the scene, how to decide which one to open? The user who implements a macroscript for this would need to decide on their own heuristic.

You can iterate through all tyFlows in the scene - regardless of name - by calling:

Code:
arr = getClassInstances tyFlow
for t in arr do
(
  --do something
)

--or

if (arr.count > 0) then arr[1].editor_open()



RE: Can the "open editor" of tyflow be moved to the toolbar? - cgdvs - 10-07-2021

Wow, I may think this is the perfect solution!
I don't know how to describe my mood. In short, thank you very much.