Rhino Script Compiler for Rhino5, first Beta

I’ve been thinking about this all day, and I couldn’t come up with any tangible reason to load at start up. My lame reason posted earlier is hardly worth delaying the start up of Rhino.

Dan

So nice! Thank you!
The first test with rhino 5 sr4,RhinoScript vbs file.
rhinotomidas.rhp(8 KB)

Hello @DavidRutten

I tried the compiler and it has worked well but I have some questions because they do not know is what exactly does the compiler.

The compiler creates a command for each file .py. If I have several files .py with the same functions, is there any way to put these functions into one file? I have the same question with the “objects” created and variables.

I have another question, can only create a single command for each file. py?

Sorry my English is bad

thanks

This is something we are trying to figure out. Currently, the compiler creates a command and associates it with a single .py file. This was done because it was the simplest way we could think of to make it work. We are open to suggestions, so if you have an idea on how to improve this for python please let us know.

Do you have an opinion on what would work best for you with respect to python?

This is FANTASTIC news! Thanks David and all who might have contributed to this :slight_smile:

Great! Thanks for the effort. One feature which I would find very useful is the option to define a script file as a “library”, containing functions which are only loaded once the plugin is initiated. These functions could then be called by all other script files compiled in this plugin. Any chance to integrate this in the future?

Thanks Manuel

Hi @stevebaer,

I have compiled several scripts and, once loaded the plugin, only works when running first Python script editor. Is it normal?
In “plugin Properties”> “Load Time” shows “Load when needed”. Should it be “loaded on startup” to solve the problem? As is done.

I find no difference in speed between the script once compiled. In both, the speed is very slow. I am using “rhinoscriptsyntax”. You should use better “RhinoCommon”?

Thanks Juan

No, that is not normal.

No, you should not have to change the plug-in to be loaded on startup

Would it be possible to share some of your work with me so I can debug what is going wrong with the script compiler and your scripts?


The speed should not be any different, since the compiler is not compiling this down to a “lower lever” language. The script compiler is really more of a “script packager” in that it is packaging your scripts into a single rhp file that you can share.

The first time the script is run, it is expected to be slow since the entire python engine needs to be initialized and all of the rhinoscriptsyntax modules are parsed. The script should be faster after the first run.

Yes, using RhinoCommon will tend to increase the speed of your script, but it is best to try and figure out where your script is slow first before just modifying the calls from rhinoscriptsyntax to RhinoCommon. There may be some part of your algorithm that may be slowing down calculations and could be improved using either rhinoscriptsyntax or RhinoCommon. If you want to work on this, I would recommend starting another thread on this on discourse.

I found a few bugs in the current script compiler code with respect to python scripts. We’ll try to get a new build out soon

Hi Steve
Here the same as JuanExposito
Ciao Vittorio

Manual,

One feature which I would find very useful is the option to define a script file as a “library”, containing functions which are only loaded once the plugin is initiated. These functions could then be called by all other script files compiled in this plugin. Any chance to integrate this in the future?

This is already possible. *.rvb files can be designated as commands or libraries. This feature does not exist for python files yet.

1 Like

Hi @JuanExposito
I have the same problem just like you.Here is my .py file.shange.py(272 Bytes)

I think you should wait for the new compiler construction.

I hope it comes soon

Juan

rcs compiller works. I could compille my.py file,and install in Rhino 5. but my rhp file doesn’t work in rhino.
my offsets script.py(490 Bytes)

Yes, we are working on releasing a new version of the script compiler that fixes a bug with respect to python scripts

Would it be possible to add an option of creating a pull-down menu item for the compiled plugin, as the old version of Monkey Compiler had?

thanks,

Jarek

1 Like

Yes, I agree. We need that functionality back.

Dan

Just putting in my two cents that I’m very much looking forward to making python-based .rhp plugins from multiple python files once that becomes available. This could really help advance the functionality of Rhino.

2 Likes

Same here. Still waiting to able to compile python files with multiple file support.

1 Like

Also i have need this.
Vittorio