I’m trying to use Rhino to prepare procedures (succession of both Rhino Commands and / or direct call to the RhinoCommon API via python) that can be replayed in another file.
For example I’d like to create a procedure using an existing curve and sphere that projects the curve on the sphere and cuts it.
I’d like the process of creating the procedure to be accessible eventually for non-programmers, and I’d like it to be updatable (when I change the input curve or sphere the resulting cut surface updates automatically)
Once created this procedure is supposed to be loaded in another rhino project where the input curve and sphere will be present and we want to blindly apply the same procedure and still be able to update the result by changing the curve or sphere.
As of now I cannot achieve both the making process and the loading process at the same time. My progression on the subject so far :
- What I want seem to be close to the record history feature, it gives both the live update and the replayability. But many commands break the history and the direct python calls to the RhinoCommon API are not recorded.
- I tried making an interface with buttons calling python scripts to play the procedure. It fits the replayability and it ensures that everything is done even the calls to the API. But it requires a programmer to make the procedure and it doesn’t have live update (which is one of the key features).
- I looked at the event system to trigger python code calls but it seems a bit complicated and it is restricted to what happens in the rhinodoc. I also found some posts in the forum saying that we shouldn’t modify the RHinoDoc in the callback of a rhinodoc event (which I would be doing in this case).
- I tried to prepare the procedure in grasshopper, it gives the interactivity but not much of a replayability to import in another project, especially for people only using Rhino. We’d like to avoid having to install GH and always having it open for the procedures to function properly, plus I’m not sure how it will go when I load multiple procedures inside one project…
Did I miss some other way to do it ? Did I do something poorly ? What would you advise to achieve what I’m trying to do ?
Thanks for your answers
Grasshopper ships with Rhino, so no need to install it. Have you seen the Grasshopper Player?
Hello Luis and thanks for the quick answer !
GH Player seems to fit the replayability part but not much the interactability part on my side.
I tried basically using the “get” components on GH and baking the geometry. It works as intended but it does not refresh if I change the selected inputs (I need to run the player again and select the objects again …).
I’ve seen some examples of pausing the script before baking (by waiting for user input with Get Boolean) so that we keep the GH interaction going but I fail to be able to modify the inputs even in this state, I cannot grab the geometries. For example I have an input curve and I cannot modify its control points.
I’ve seen an example of a dynamic 3D UI using Kangaroo grab and GH Player, it looks like what I’m trying to do, I have the interactability inside Rhino with the grab feature of kangaroo and the replayability with GH player. But building such interactions is quite time consuming and we don’t want to force the users to download the kangaroo module.
Another thing I tried is already having my curve in the document and selecting it with the curve component of GH, Here I get the interactability, when I modify the curve the script is replaying the parts after, but I don’t have replayability, If I try to play this GH script in another Rhino the script just fails, it doesn’t prompt me to select a curve…
So my question is : did I miss something ? Is there an interactible way to get objects in GH that will automatically replay the script if the input is modified AND be replyable from another rhino instance ?
Thanks for your answers
I also tried using sliders in GH and publishing them to remote panel to add some interactivity from rhino, but these are not loaded in a new project when using GH player so I still cannot control the GH execution interactively AND replayabily.
I managed to do what I wanted in the end, using the Pipeline Geometry component in Grasshopper, I can just load a grasshopper file that creates useful geometries and the pipeline will get the updates from rhino and replay the whole grasshopper file. The grasshopper panels allows me to have some interface to modify specific values and the baked result is updated live. Too bad that this panel isn’t filled up if I use grasshopper player (to avoid having the window opening but it still is sufficient for what I need now. I’m not sure if I can improve the response time and avoid lag by baking only when necessary.