Skip to content

Conversation

@marques-bruno
Copy link
Member

@marques-bruno marques-bruno commented Jul 22, 2020

This PR lets you write stuff like that:

import Sofa.Core
import SofaRuntime

SofaRuntime.init()
SofaRuntime.importPlugin("SofaComponentAll")

n = Sofa.Core.Node("root")
n.addObject('MeshTopology', name="topo")
n.addChild("node")

# test link creation on Base
n.node.addLink(name="aName", value=n.topo, help="Some help string describing the link's purpose")

# Test connection of "generic links", i.e. SingleLinks templated over abstract "Base" type, to specialized template links.
n.node.addObject("MechanicalObject", name="mo", topology=n.node.findLink('aName').getLinkedPath())

print(n.node.mo.topology.getName()) # => topo

requires a small change in sofa-framework/sofa (PR #1436 )

@damienmarchal
Copy link
Contributor

ok for me. To merge after the corresponding pr in Sofa.

@marques-bruno marques-bruno merged commit 675191b into master Aug 18, 2020
@marques-bruno marques-bruno deleted the add_addLink branch September 10, 2020 13:41
@guparan guparan added this to the v20.12 milestone Oct 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants