I may be oversimplifying this but it seems to me all you need are boolean gates at each logic block.
If the condition for the previous block was met, for example block 5 finished and output a non null value, then the condition to activate block 6 would be true, and block 6 would execute.
You could repeat this logic for as many blocks as needed.
All these logic blocks would exist nested within a larger definition, let’s call it “scene handler” for now.
Then for your scene inputs say a list of 50 views or frames or whatever you would loop through these until the frames list length has been met.
for each item in the loop you would be calling your “scene handler” definition that has all the stepped logic blocks in it.
This would mean if you had 50 frames, you would be calling the “scene handler” definition 50 times in total. each logic block step inside the scene handler definition would be called at step 1, then 2, and onward to step 6 or whatever the final step is. outputting the result for that specific frame and appending the result to a list outside of this definition.
EDIT:
It would be helpful to see the input and expected output of each “code block” but within the below code you would be including the logic for each block in the placeholder definitions (B_01 for example would be “Code block 1: Generate Geometry”) This function either would handle this in python or would need to execute an external definition or other script. This would apply to each unique step.
You can also look into the Grasshopper Utilities panel where you will find “Data Input” “Data Output” components. These allow you to pass data between grasshopper definitions external to your current open definition.
Stream Successful Geometry From One Script:
Receive Successful Geometry Into Another Script:
Example of basic logic:
ghenv.Component.Name = "Component Template"
ghenv.Component.NickName = "CT"
ghenv.Component.Description = "Component Template Description"
ghenv.Component.Params.Input[0].Name ="Scenes"
ghenv.Component.Params.Input[0].NickName ="S"
ghenv.Component.Params.Input[0].Description ="Scenes To Process"
ghenv.Component.Params.Input[1].Name ="Process"
ghenv.Component.Params.Input[1].NickName ="P"
ghenv.Component.Params.Input[1].Description ="Set True To Process Scenes"
ghenv.Component.Params.Output[0].Name ="Output"
ghenv.Component.Params.Output[0].NickName ="O"
ghenv.Component.Params.Output[0].Description ="Output Description"
ghenv.Component.Params.Output[1].Name ="Status Message"
ghenv.Component.Params.Output[1].NickName ="M"
ghenv.Component.Params.Output[1].Description ="Scene Handler Status Message"
#Component info showing how many scenes will be processed
ghenv.Component.Message = str(len(S)) + " Scenes"
processed_scenes = []
#Scene Processing Step 01 Function
def B_01(scene):
# >>> Implement B_01 Function Here <<<
B_01_success = True # For demonstration purposes, assuming B_01 always succeeds
return B_01_success
#Scene Processing Step 02 Function
def B_02(scene):
# >>> Implement B_02 Function Here <<<
B_02_success = True # For demonstration purposes, assuming B_02 always succeeds
return B_02_success
#Scene Processing Step 03 Function
def B_03(scene):
# >>> Implement B_03 Function Here <<<
B_03_success = True # For demonstration purposes, assuming B_03 always succeeds
return B_03_success
#Scene Processing Master Function Sequentially Stepping Through Logic Blocks
def scene_handler(S):
for scene in S:
if B_01(scene):
if B_02(scene):
if B_03(scene):
processed_scenes.append(scene)
M = "All Scenes Processed Successfully!"
return M
if P:
M = scene_handler(S) # Assign the return value of scene_handler to M
O = processed_scenes
print(O)
print(M)
20230815_Scene_Processing_Example_01a.gh (7.7 KB)
20230815_Stream_GH_Input.gh (6.1 KB)
20230815_Stream_GH_Output.gh (6.5 KB)