Jump to content

Drop down and text field in mode bar


Recommended Posts

Hi, I managed to add buttons to the mode bar but I'd like to add a drop down and a text field like this:

 

image.png.5fc0349b2f1f405cbe9649880c9449d3.png

image.png.6fcd772e16ba445a44b391ad4a23d716.png

 

Anybody any idea? I've managed to found the function `vs.vstAddPDMenuMode()` but I think that's not what I am looking for.

 

Thanks!

Sting

Link to comment
  • 4 weeks later...
On 5/18/2024 at 11:32 PM, JBenghiat said:

I think you found it. You would then add items to the menu

 

I however have a 2D path plugin, and not a tool plugin, so I'm pretty sure I cannot use vs.vst functions, right?

 

Using that function does make a drop down menu appear in the mode bar, but it's not usable. I also cannot seem to be able to add more values to it. It also disappears when I place a 2d path.

 

 

 

 

Link to comment

Unfortunately, no, I don't have any experience with these.  There does not seem to be an equivalent option in the VSO (object) section of the function reference.

 

However, since Plugin Objects generate their own basic Tool to allow them to insert from tool palettes, the VST commands might work. Or at least might be worth testing.

 

Alternatively you could write a Tool that uses the VST calls and places your PIO.

  • Like 1
Link to comment

Hi Pat,

 

Thanks!

Could you point me in the right direction for writing a tool that places my PIO? How would I go about creating a tool that uses a 2D path? I'm using python - is this even possible with that language?

 

Also, I am trying to get buttons in the mode bar with `vs.AddRadioMode` but it seems like they disappear after the tool is used for the first time. Are there any examples or documentation about the mode bar options somewhere?

 

Thank you

Link to comment

Tools created with VS/Python have a lot of limitations — most of the complex tools you see require the SDK.

 

The easiest way to have a tool with options is to call RunTempTool from a menu command: https://developer.vectorworks.net/index.php?title=VS:RunTempTool

 

You CAN create an event-enabled tool, though the process requires a byte editor, so not very user-friendly: https://developer.vectorworks.net/index.php?title=VS:vstGetEventInfo. The event loop is almost identical to RunTempTool.

  • Like 1
Link to comment

I've never used an external tool to place a 2D path plug-in, but I imagine that @JBenghiat's suggestion of using RunTempTool is the logical one to get a path.  Then, you could use CreateCustomObjectN to drop in a plug-in instance and send the path made from RunTempTool to the path plug-in with SetCustomObjectPath.  I can't really help much with RunTempTool, as I've never used it and the documentation is fairly dreadful and confusing.  The only other thing that I will mention about using an external tool is that if there are other parameters you want the tool to pass on to the plug-in, add them to the tool.  Then you can pass them forward to the placed plug-in with SetRField.

  • Like 1
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...