You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+52-16Lines changed: 52 additions & 16 deletions
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# GHPython Componentizer
2
2
3
-
> A github action to make Grasshopper development 164% <sup><small>[1]</small></sup> version-control friendlier and 82% more pleasant.
3
+
> A github action to make Grasshopper development 165% <sup><small>[1]</small></sup> version-control friendlier and 83% more pleasant.
4
4
5
-
Imagine if you could write your grasshopper components in Python code in an actual text file with a powerful editor?
5
+
Imagine if you could write your grasshopper components in Python code (both IronPython for RhinoV7 and less, or CPython for RhinoV8) in an actual text file with a powerful editor?
6
6
Git wouldn't hate you and life would be so much beautiful. 🐵
7
7
8
8
Well, here's an action for you then! 🦸♀️
@@ -14,25 +14,29 @@ Well, here's an action for you then! 🦸♀️
14
14
### Usage from Github Actions
15
15
16
16
The recommended way to use this tool is as a Github Action.
17
-
It needs to be run on a windows runner and IronPython/NuGet need to be pre-installed.
17
+
It needs to be run on a windows runner and IronPython/NuGet or Python3/pythonnet/Nuget depending of which component you want to build, needs to be pre-installed.
18
18
19
19
Copy the following workflow code into a `.github/workflows/main.yml` file in your repository.
20
20
Make sure you have the components definition (see below for details) stored in a source folder.
21
21
Replace the `source` and `target` to match your folder structure.
22
+
To specify the interpreter to use, you can define the action parameter `interpreter` to either `ironpython` or `python3` (by default it is `ironpython`).
@@ -96,8 +132,7 @@ An alternative is to include them in your packaging steps, e.g. calling `python
96
132
97
133
## Python code
98
134
99
-
* Supports both procedural and GH_Component SDK modes (see `isAdvancedMode` in metadata)
100
-
* Supports a small set of templated variables that can be used in code:
135
+
Supports a small set of templated variables that can be used in code:
101
136
* `{{version}}`: Gets replaced with the version, if specified in the command-line.
102
137
* `{{name}}`: Gets replaced with the name of the component as defined in the metadata file.
103
138
* `{{ghuser_name}}`: Gets replaced with the name of the `.ghuser` file being generated.
@@ -120,10 +155,11 @@ An alternative is to include them in your packaging steps, e.g. calling `python
120
155
* `128`: Expose the object in the seventh section on the toolbar.
121
156
* `instanceGuid`: **(optional)** Statically define a GUID for this instance. Defaults to a new Guid.
122
157
* `ghpython`
123
-
*`hideOutput`: **(optional)** Defines whether to hide or not `out` output parameter. Defaults to `True`.
124
-
*`hideInput`: **(optional)** Defines whether to hide or not the `code` input parameter. Defaults to `True`.
125
-
*`isAdvancedMode`: **(optional)** Defines whether the script is in advanced mode (aka GH_Component SDK mode) or procedural mode. Defaults to `False`.
126
-
*`marshalOutGuids`: **(optional)** Defines whether output Guids will be looked up or not. Defaults to `True`. Change to `False` to preserve output Guids.
158
+
* `hideOutput`: **(optional ⚠️ only IronPython)** Defines whether to hide or not `out` output parameter. Defaults to `True`.
159
+
* `hideInput`: **(optional ⚠️ only IronPython)** Defines whether to hide or not the `code` input parameter. Defaults to `True`.
160
+
* `isAdvancedMode`: **(optional ⚠️ only IronPython)** Defines whether the script is in advanced mode (aka GH_Component SDK mode) or procedural mode. Defaults to `False`.
161
+
* `marshalOutGuids`: **(optional ⚠️ only IronPython)** Defines whether output Guids will be looked up or not. Defaults to `True`. Change to `False` to preserve output Guids.
162
+
* `marshalGuids`: **(optional ⚠️ only CPython)** Defines whether input Guids will be looked up or not. Defaults to `True`. Change to `False` to preserve input Guids.
127
163
* `iconDisplay`: **(optional)** Defines whether to display the icon or not. Defaults to `0`.
0 commit comments