I am trying to compile a test component importing PyDev code into the GHPython component. Is it possible at all? I wonder if somebody already tested it.
However, on the quest of trying it out myself, I discovered another problem. The PyDev workflow which has been working so far with Rhino 5 is not working in Rhino WIP. Did someone encounter the same problem?
For Rhino 05, I have recently configured PyDev following this:
In order to update the workflow to Rhino WIP, I used the new RhinoCommon.dll and RhinoCommon.xml files to make PyDev see Rhino. That seems to be working fine. However, on the RhinoPython side, I am not being able to make Rhino see PyDev. I have a — Runtime error (ImportException): No module named ‘my module name’ — returned. I did double check whether my Eclipse module was linked to the Rhino Python Options.
I promise I didn’t re-start Rhino and now the Python component runs without adding the path dynamically! Would love to know why Just as a matter of feedback, bellow is the difference of speed between adding the path dynamically (top) and having it loading normally from the RhinoPython editor:
With that sorted, we are back to the initial question:
How to compile the components utilising that workflow? When I try to compile that component here is the error I would appreciate some help with:
Sorry, we will have to see if this happens again (not finding paths in sys.path). It seems strange.
I am not sure why it would take 240ms to check if a string is in a list and to add it if not. It seems this might be doing something more. Have you tried re-computing the whole definition? If you haven’t restarted Rhino in 5 days, it might be a good time to try that anyways.
About compiling: your setup will not work automatically. It will work automatically only if you have all your code in the component. Also, reload() is definitely a no-go for compiling. To compile this, you will need to set-up a folder where you want everything to compile. Then, copy the “compilable code” from the folder. You will have to save that, too, in the compile folder. Follow the instructions that appear after copying the code to clipboard. I need to make a guide with an example, just not today I think.
Yes, when it started running without the dynamic call, I re-started Rhino straight away to check and both manners are working. I will run some tests and will report if any problems.
– (good idea!)
With regards to reload(). I didn’t know that it is a no-go for compilation, many thanks. Why? I was utilising reload() because if I don’t, the changes that I make to the code in PyDev just take effect if I reload Grasshopper itself.
With regards to the setup. I will follow the instructions, but still did not fully understand. Does that mean I will have to compile the code to this folder and import the directory in PyDev? Pardon, I am a bit confused. l will keep tuned for the guide.