Skip to content

Commit

Permalink
WIP+FIX: the output list is now accepted as outparam
Browse files Browse the repository at this point in the history
  • Loading branch information
9and3 committed Feb 12, 2024
1 parent 5afde90 commit 4fa9d32
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 85 deletions.
2 changes: 1 addition & 1 deletion CsRhino/Properties/launchSettings.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"profiles": {
"ScriptSync": {
"commandName": "Executable",
"executablePath": "C:\\Program Files\\Rhino 7\\System\\Rhino.exe",
"executablePath": "C:\\Program Files\\Rhino 8\\System\\Rhino.exe",
"commandLineArgs": "$(TargetPath)"
}
}
Expand Down
13 changes: 9 additions & 4 deletions GH/PyGH/components/scriptsynccpy/code.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,8 +288,7 @@ def safe_exec(self, path, globals, locals):
try:
with open(path, 'r') as f:
# add the path of the file to use the modules
path_dir = path.split("\\")
path_dir = "\\".join(path_dir[:-1])
path_dir = os.path.dirname(path)
sys.path.insert(0, path_dir)

# parse the code
Expand Down Expand Up @@ -386,9 +385,15 @@ def AfterRunScript(self):
outparam = [p for p in ghenv.Component.Params.Output]
outparam_names = [p.NickName for p in outparam]

# TODO: add the conversion to datatree for nested lists and tuples
for idx, outp in enumerate(outparam):
ghenv.Component.Params.Output[idx].VolatileData.Clear()
ghenv.Component.Params.Output[idx].AddVolatileData(gh.Kernel.Data.GH_Path(0), 0, self._var_output[idx])
# detect if the output is a list
if type(self._var_output[idx]) == list or type(self._var_output[idx]) == tuple:
ghenv.Component.Params.Output[idx].VolatileData.Clear()
ghenv.Component.Params.Output[idx].AddVolatileDataList(gh.Kernel.Data.GH_Path(0), self._var_output[idx])
else:
ghenv.Component.Params.Output[idx].VolatileData.Clear()
ghenv.Component.Params.Output[idx].AddVolatileData(gh.Kernel.Data.GH_Path(0), 0, self._var_output[idx])
self._var_output.clear()

@property
Expand Down
2 changes: 1 addition & 1 deletion VSCode/scriptsync/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"type": "git",
"url": "https://github.com/ibois-epfl/script-sync"
},
"version": "1.1.0",
"version": "1.1.2",
"engines": {
"vscode": "^1.85.0"
},
Expand Down
74 changes: 0 additions & 74 deletions package-lock.json

This file was deleted.

5 changes: 0 additions & 5 deletions package.json

This file was deleted.

14 changes: 14 additions & 0 deletions release.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
:: This batch file is a shortcut to the prepare the release packages of script-sync.
:: It does the following:

:: a) it takes as asrgument the number of the version
:: b) it modifies all the files where the version number is present
:: c) it builds the RhinoProject
:: d) it builds the GHPlugin
:: e) it creates the yak package
:: e) it builds the vscode extension

:: f*) it updates the vscode extension in the marketplace
:: g*) it updates the yak package in the yak manager

:: h) it put in a folder all the files needed for the release (yak+vsce)
Binary file added yaker/DocoptNet.dll
Binary file not shown.
Binary file added yaker/Yak.Core.dll
Binary file not shown.
Binary file added yaker/Yak.exe
Binary file not shown.
Binary file added yaker/YamlDotNet.dll
Binary file not shown.

0 comments on commit 4fa9d32

Please sign in to comment.