Grasshopper Player in compiled plugin issue

Replying here just because it is related to the Script Compiler: I’ve made a test using Script Compiler, and it seems like the Python script used to launch the definition does not work in that version (the same script works if compiling with Script Editor).

I’ve created the same plugin in two versions:

  • Test_RCP_SC - compiled using the Script Compiler. Available commands: launch_Synapse_SC (the launcher Python script), Test_RCP_SC (the gh definition), helloWorld_SC (a test Python command that creates a HelloWorld text in 0,0,0)

  • Test_RCP_SE - compiled using the Script Editor. Available commands: launch_Synapse_SE (the launcher script, C# version), launch_Synapse_P_SE (the launcher script, Python version), Test_RCP_SE (the gh definition), helloWorld_SE (a test Python command that creates a HelloWorld text in 0,0,0)

The Grasshopper definition (using Synapse) is the same in both versions, the only difference is in the exit logic: the Script Editor version uses a Context Boolean input to “stay alive”.
The Python launcher script is the same in both versions (except for the gh definition they call, of course):

#! python3

import rhinoscriptsyntax as rs

import Grasshopper as gh

# Disable command line echo

# rs.Command("NoEcho")

# Load Grasshopper with no Banner

# Banner: Disable, Window: Show

rs.Command("-Grasshopper B D W S _Enter", echo=False)

# Collapse GH Window to title bar

gh.Instances.DocumentEditor.CollapseForm()

# Window: Hide

rs.Command("-Grasshopper W H _Enter", echo=False)

# Add the RCP to the current GH/Rhino

gh.Instances.ShowRemotePanel()

# Launch the Grasshopper Script Headless with GH Player

rs.Command("Test_RCP_Synapse_SE ")

The weird thing is that if I execute the launch Python script for the Script Compiler version directly from the Script Editor, it works just fine, but when I execute the corresponding command from the compiled version (launch_Synapse_SC), nothing happens. If I execute the Grasshopper definition related command (Test_RCP_SC), it works fine.

Attached are the two yak packages (they can be installed in parallel, dragging them onto an open Rhino instance), and a zip file containing the source files and project files for both versions.

@Japhy maybe you can check this out as well? Thanks in advance and sorry for bugging you, but this is a head-scratcher for me… This is not the first time I used the Script Compiler, but I’ve never encountered this behaviour before.

test_rcp_sc-0.1.0-rh8_0-any.yak (113.6 KB)
test_rcp_se-0.1.1+9343-rh8-any.yak (160.9 KB)
Test_RCP_SC+SE source.zip (847.3 KB)