ibois-epfl / script-sync

Rhino/Grasshopper/VSCode plug-in to run C# and Python (IronPython or CPython) scripts directly from VSCode.
https://www.food4rhino.com/en/app/script-sync
MIT License
40 stars 2 forks source link

Grashhopper canvas and component not clickable after selecting the python file in Grasshopper #19

Closed LeandreSassi closed 3 weeks ago

LeandreSassi commented 1 month ago

Describe the bug It did work at some point so I know it should be able to run, however: When after selecting the python file in GH, the component is red and I can't click on anything. I'm still able to zoom in and out, and add new components on the canvas. But thats all...

Screenshots image

9and3 commented 1 month ago

Hello @LeandreSassi ! Coudl you please post the following so that I have a bit more info to debug (I already have some suspects on the file dialog):

LeandreSassi commented 1 month ago

Hello @9and3, thank you for your quick reply.


#! python3

import rhino3dm
import rhino

a= "dddUTest"

# create a surface in grasshopper
surface = rhino3dm.Brep.CreateFromBox(rhino3dm.Point3d(0, 0, 0), rhino3dm.Vector3d(10, 10, 10))

*And the ghfile is just a blank file with only the VScode script-sync component : Test_ScriptSync.zip

9and3 commented 1 month ago

thanks @LeandreSassi , I'll have a look at it and let you know asap!

9and3 commented 1 month ago

sorry @LeandreSassi one important thing: can you report the error message please?

LeandreSassi commented 1 month ago

@9and3 as the canvas is unclickable it also wont aloow hover functions i suppose. So i can't see the error message. There aro no error messages in rhino nor in VSCode

9and3 commented 4 weeks ago

@LeandreSassi

Hello @9and3, thank you for your quick reply.

* Windows

* Rhino 8.9.24194.18121

* The code:

#! python3

import rhino3dm
import rhino

a= "dddUTest"

# create a surface in grasshopper
surface = rhino3dm.Brep.CreateFromBox(rhino3dm.Point3d(0, 0, 0), rhino3dm.Vector3d(10, 10, 10))

*And the ghfile is just a blank file with only the VScode script-sync component : Test_ScriptSync.zip

Next, in my workspace, the script-sync component is working correctly but raising the errors in your code that import rhino (there's a typo, it should be "Rhino") is not found. Additionally rhino3dm is correctly read and throwing an error but this is the correct behaviour since there is an error in the rhino3dm.Brep constructor you are using, here:

image

The only thing I can think of is an old bug that should have been solved on the dialog window when you select the file.. I am running script-sync v1.2.5 (latest). Which version of script-sync are you running (you can check it from the packageManager in Rhino)?

LeandreSassi commented 3 weeks ago

Hi, I'm running the 1.2.13 version that seems to be the latest now and I did just update rhino 8. It works, however, i sometimes need to click again on the file button (in grasshopper).

The only problem i'm encountering now is tht rhinoscriptsyntax won't import wherease rhinoinside and Rhino do. But I guess its for another ticket.

Thank you for your help!

Kind regards,

Léandre Sassi

LeandreSassi commented 3 weeks ago

@9and3 Do you run the Rhino8 Python interpreter directly from VSCode? If not, how do you use rhinoscriptsyntax in vscode without problems? Do you use Python 3.8?

Thanks

9and3 commented 3 weeks ago

Do you run the Rhino8 Python interpreter directly from VSCode?

Script-sync allows you to drop its component on the canvas, link it to the file and whenever the file is saved it is run automatically in grasshopper.

If not, how do you use rhinoscriptsyntax in vscode without problems? Do you use Python 3.8? The only problem i'm encountering now is tht rhinoscriptsyntax won't import wherease rhinoinside and Rhino do. But I guess its for another ticket.

No need to set interpreters, follow the instructions here and with script-sync you should be able to run also rhinoscriptsyntax without problems. I am taking the liberty to close this one then :)