Skip to content

add a canonical way to recurse up the hierarchy or the history #10

@theodox

Description

@theodox

it's pretty simple do to this upstream -- but not downstream because of possible branching.

Here;s an example for the hierarchy; the history would be similar.

def joint_parent(target):
    # walk up to the first joint parent of <target> or None
    def recurse_up(m):
        upstream = cmds.listRelatives(m, p=True)
        if upstream:
            yield upstream[0]
            for item in recurse_up(upstream[0]):
                yield item   

    return Stream( (i for i in recurse_up(target)) )

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions