Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.

Recommendations for plugin development

Anonymous

Recommendations for plugin development

Anonymous
Not applicable

Hello everyone,

 

I was wondering if there are any "best practices" or general recommendations on how to create a programming environment that suits all needs for VRED plugin development.

 

For example, this is what I do:

I maintain my plugin code in a local folder (which is also my GIT workspace).

I have a batch script that compiles *.ui and *.py files, copies them to the "plugins\WIN64\Scripts\..." folder of my target VRED installation and starts VRED.

My plugins are located in a custom menu entry and tested from there.

 

What makes development painful is that "Reload Script Plugins" does not work for me.

Does this have something to do with my python imports, which are different modules added by using sys.path.append()?

Any code change requires me to close VRED, copy my files and open up VRED again - which takes some time.

 

Also, is there a way to get intellisense working for VRED modules?

I am using VS Code and it would be awesome to have autocompletion features for VRED classes.

 

Maybe some of you can share valuable tips and tricks on how you develop your VRED plugins.

Thanks in advance!

Reply
511 Views
1 Reply
Reply (1)

chr33z
Advocate
Advocate

Hi,

 

I faced the same problems as you and developed a workflow very similar to yours:

- Visual Studio Code

- Build Script to gather all plugin components and to start VRED

 

The use if VRED modules in a script also makes it almost impossible to unit test your plugin. At least when you don't want to use dependency injection shouldn't belong.

 

Another pain ist to use external modules when you want to provide them with your plugin, or if you want to move functionality in different .py files.

 

Yes, it is possible to load a script from a plaintext file that does not end in ".py". But I had problems importing VRED modules in these externally loaded scripts. So I resorted to provide a modules directory for my plugin that is on the same hierarchy as the Script directory so it does not get loaded by VRED directly. There I can put all my external modules as normal .py files.

 

Any way to directly reload scripts in VRED would save a ton of development time, as the start duration of VRED is the most time consuming process when testing.

 

So, to answer your question:

I did not come up with another way and would also appreciate any suggestions that can improve this process.

 

Cheers!