Hello, I’m looking for any guidance on how I might be able to perform a Python script Plug-in auto run on startup and the most straight forward way to do it. Is there something as easy as Maya, to be able to run startup scripts without going through the clunky script editor and knowing all about the build process in Rhino 8?
I would also like to note that I don’t want to edit anything in the UI to tell Rhino that I want to run this script. Additionally, I would like to edit the UI in Rhino at Runtime, so if this is also possible please let me know.
Thanks @11159 for referencing that topic, it reminded me that I have since found a script to add and delete startup commands purely in python. I’ve added a new reply in that topic, hope it helps @Tye_Riley !
Personally, I feel this would be an anti-feature in a Plug-in. What runs on startup or doesn’t, should be up to the user.
For an admin of user installs though, perhaps this is a hack, but to achieve this for my own install, I would edit the Rhino shortcut, and add in something to run the script on startup before dropping in to interactive mode, in just the same way as /nosplash is commonly added in.
E.g.:
"C:\Program Files\Rhino 8\System\Rhino.exe" /nosplash /runscript="-_grasshopper _editor _load _document _open gh_file"
In all honesty, I’m looking to make a engine for FPT which means that I would like to bootstrap the plugin without any user intervention because they consent by launching it through the flow launcher. Furthermore, I’ve found out that I can run the Python script by appending /runcommand on the rhino.exe launch. But now I’m working through the UI editing. But I’m not sure I can add UI without creating a Plugin
.
Thinking I can work through it the same way Unreal Engine handles the FPT plugin. I will most likely register the Plugin through Yak which simply looks at the environment variable, and launch a python instance in a thread.
Open to any other suggestions or hearing about anyone else’s roadblocks and solutions.
If you can perform the auto-run needed from Rhino commands, you could try adding those Rhino commands to run on startup via Michael’s helper functions? That seems to use a useful looknig settings API, at least.
Okay, this solves my issue! Thank you!