MCPcopy Create free account
hub / github.com/NatronGitHub/Natron / getCollectionFromGroup

Method getCollectionFromGroup

Engine/PyAppInstance.cpp:68–96  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

66}
67
68NodeCollectionPtr
69App::getCollectionFromGroup(Group* group) const
70{
71 NodeCollectionPtr collection;
72
73 if (group) {
74 App* isApp = dynamic_cast<App*>(group);
75 Effect* isEffect = dynamic_cast<Effect*>(group);
76 if (isApp) {
77 collection = std::dynamic_pointer_cast<NodeCollection>( isApp->getInternalApp()->getProject() );
78 } else if (isEffect) {
79 NodePtr node = isEffect->getInternalNode();
80 assert(node);
81 NodeGroupPtr isGrp = std::dynamic_pointer_cast<NodeGroup>( node->getEffectInstance()->shared_from_this() );
82 if (!isGrp) {
83 qDebug() << "The group passed to createNode() is not a group, defaulting to the project root.";
84 } else {
85 collection = std::dynamic_pointer_cast<NodeCollection>(isGrp);
86 assert(collection);
87 }
88 }
89 }
90
91 if (!collection) {
92 collection = std::dynamic_pointer_cast<NodeCollection>( getInternalApp()->getProject() );
93 }
94
95 return collection;
96}
97
98static void makeCreateNodeArgs(const AppInstancePtr& app,
99 const QString& pluginID,

Callers

nothing calls this directly

Calls 4

getProjectMethod · 0.80
getInternalAppMethod · 0.80
getEffectInstanceMethod · 0.80
getInternalNodeMethod · 0.45

Tested by

no test coverage detected