Quantcast
Channel: Scripting - McNeel Forum
Viewing all articles
Browse latest Browse all 4150

How to run and visualize the parallel codes in Rhino environment?

$
0
0

Hi,

After grafting the curves to animate the movement, I computed them into a list. I have achieved it, but the parallel list operations are not visible in the rhino environment. How can I animate all the curves at a time and visualize them? The code and GH file are attached.

def updateComponent(interval):
    
    """ Update this component similar to using a grasshopper timer """
    
    def callBack(e):
        ghenv.Component.ExpireSolution(False)
        
    ghenv.Component.OnPingDocument().ScheduleSolution(interval,
    gh.Kernel.GH_Document.GH_ScheduleDelegate(callBack))

# Instantiate or reset persistent variables
if "count" not in globals() or not Run:
    count = 0
    paths = []
    path = ghcomp.Explode(flowpaths,True)[0]
    if type(path) != list:
        path = [path, path]
        
# Update the variable and component
if Run:
    
    if count < len(path):
        count += 1
        paths.append(path[len(path) - count])
        updateComponent(100)
    elif count == len(path):
        count = 0

# Output variables
Count = count
animate = paths

animate_flow.gh (178.3 KB)

1 post - 1 participant

Read full topic


Viewing all articles
Browse latest Browse all 4150

Trending Articles