@@ -8,9 +8,12 @@ namespace compute.geometry
8
8
{
9
9
public class Startup
10
10
{
11
- // https://github.com/mcneel/rhino/blob/e1192835cbf03f662d0cf857ee9239b84109eeed/src4/rhino4/Plug-ins/RhinoCodePlugins/RhinoCodePlugin/AssemblyInfo.cs
11
+ //https://github.com/mcneel/rhino/blob/e1192835cbf03f662d0cf857ee9239b84109eeed/src4/rhino4/Plug-ins/RhinoCodePlugins/RhinoCodePlugin/AssemblyInfo.cs
12
12
static readonly Guid s_rhinoCodePluginId = new Guid ( "c9cba87a-23ce-4f15-a918-97645c05cde7" ) ;
13
13
14
+ //https://github.com/mcneel/rhino/blob/8.x/src4/rhino4/Plug-ins/Commands/Properties/AssemblyInfo.cs
15
+ static readonly Guid s_rhinoCommandsPluginId = new Guid ( "02bf604d-799c-4cc2-830e-8d72f21b14b7" ) ;
16
+
14
17
public void ConfigureServices ( IServiceCollection services )
15
18
{
16
19
services . AddCors ( options =>
@@ -54,6 +57,20 @@ void RhinoCoreStartup()
54
57
Logging . LogExceptionData ( ex ) ;
55
58
} ;
56
59
60
+ // NOTE:
61
+ // andyopayne 11/19/2024 (RH-84777)
62
+ // The commands.rhp needs to be loaded so that some features suchs as the gltf exporter will work.
63
+ // This is a temporary solution until the gltf exporter is moved into Rhinocommon or Rhino.UI
64
+ Log . Information ( "(1/4) Loading rhino commands plugin" ) ;
65
+ if ( Rhino . PlugIns . PlugIn . LoadPlugIn ( s_rhinoCommandsPluginId ) )
66
+ {
67
+ Log . Information ( "Successfully loaded commands plugin" ) ;
68
+ }
69
+ else
70
+ {
71
+ Log . Error ( "Error loading rhino commands plugin." ) ;
72
+ }
73
+
57
74
// NOTE:
58
75
// eirannejad 10/02/2024 (COMPUTE-268)
59
76
// Ensure RhinoCode plugin (Rhino plugin) is loaded. This plugin registers scripting
@@ -67,7 +84,7 @@ void RhinoCoreStartup()
67
84
// eirannejad 12/3/2024 (COMPUTE-268)
68
85
// This load is placed before Grasshopper in case GH needs to load any plugins published by the
69
86
// new scripting tools in Rhino >= 8
70
- Log . Information ( "(1/3 ) Loading rhino scripting plugin" ) ;
87
+ Log . Information ( "(2/4 ) Loading rhino scripting plugin" ) ;
71
88
if ( Rhino . PlugIns . PlugIn . LoadPlugIn ( s_rhinoCodePluginId ) )
72
89
{
73
90
Log . Information ( "Successfully loaded scripting plugin" ) ;
@@ -88,20 +105,18 @@ void RhinoCoreStartup()
88
105
}
89
106
90
107
// Load GH at startup so it can get initialized on the main thread
91
- Log . Information ( "(2/3 ) Loading grasshopper" ) ;
108
+ Log . Information ( "(3/4 ) Loading grasshopper" ) ;
92
109
var pluginObject = Rhino . RhinoApp . GetPlugInObject ( "Grasshopper" ) ;
93
110
var runheadless = pluginObject ? . GetType ( ) . GetMethod ( "RunHeadless" ) ;
94
111
if ( runheadless != null )
95
112
runheadless . Invoke ( pluginObject , null ) ;
96
113
97
114
98
- Log . Information ( "(3/3 ) Loading compute plug-ins" ) ;
115
+ Log . Information ( "(4/4 ) Loading compute plug-ins" ) ;
99
116
var loadComputePlugins = typeof ( Rhino . PlugIns . PlugIn ) . GetMethod ( "LoadComputeExtensionPlugins" ) ;
100
117
if ( loadComputePlugins != null )
101
118
loadComputePlugins . Invoke ( null , null ) ;
102
119
103
- //ApiKey.Initialize(pipelines);
104
- //Rhino.Runtime.HostUtils.RegisterComputeEndpoint("grasshopper", typeof(Endpoints.GrasshopperEndpoint));
105
120
}
106
121
107
122
}
0 commit comments