@@ -508,6 +508,19 @@ struct Exec_ComputationBuilderAccessor
508508 ExecProviderResolution::DynamicTraversal::Local});
509509 }
510510
511+ // / See [IncomingConnections()](#exec_registration::IncomingConnections)
512+ template <typename ResultType>
513+ ValueSpecifier
514+ IncomingConnections (const TfToken &computationName)
515+ {
516+ return ValueSpecifier (
517+ computationName,
518+ ExecTypeRegistry::GetInstance ().CheckForRegistration <ResultType>(),
519+ {Exec_ComputationBuilderAccessorBase::_GetLocalTraversal (),
520+ ExecProviderResolution::DynamicTraversal::
521+ IncomingConnectionOwningAttributes});
522+ }
523+
511524 // / See [Metadata()](#exec_registration::Metadata)
512525 template <typename ResultType>
513526 ValueSpecifier
@@ -552,8 +565,7 @@ struct Exec_ComputationBuilderAttributeAccessor
552565 // / \addtogroup group_Exec_ValueSpecifiers
553566 // / @{
554567
555- // / See
556- // / [Connections()](#exec_registration::Connections)
568+ // / See [Connections()](#exec_registration::Connections)
557569 template <typename ResultType>
558570 ValueSpecifier
559571 Connections (const TfToken &computationName)
@@ -569,7 +581,7 @@ struct Exec_ComputationBuilderAttributeAccessor
569581 // / @}
570582
571583 // XXX:TODO
572- // Accessors for AnimSpline, IncomingConnections
584+ // Accessors for AnimSpline, etc.
573585};
574586
575587// / Relationship accessor
@@ -1180,9 +1192,7 @@ AttributeValue(const TfToken &attributeName)
11801192// / it requests the named computation from the objects that are targeted by
11811193// / those connections. The reason we choose "Connections" as the name, rather
11821194// / than "ConnectionTargetedObjects," is to allow for future expansion of USD to
1183- // / allow for value-transforming behaviors on attribute connections. This
1184- // / concept exists in Presto and is extremely useful for rigging, so there's a
1185- // / good chance it will be introduced in the future in USD and OpenExec.
1195+ // / allow for value-transforming behaviors on attribute connections themselves.
11861196// /
11871197// / The default input name is \p computationName; use `InputName` to specify a
11881198// / different input name.
@@ -1223,6 +1233,57 @@ Connections(const TfToken &computationName)
12231233 ConnectionTargetedObjects});
12241234}
12251235
1236+ // / On any provider, requests input values from the computation \p
1237+ // / computationName of type \p ResultType on the attributes that own any
1238+ // / attribute connections that target the provider object.
1239+ // /
1240+ // / When this input parameter produces multiple input values, there is no
1241+ // / deterministic ordering.
1242+ // /
1243+ // / \note
1244+ // / Conceptually, this input registration provides access to the connections
1245+ // / that target the provider, but as outlined in the paragraph above, in
1246+ // / practice it requests the named computation from the attributes that own
1247+ // / those connections. The reason we choose "IncomingConnections" as the name,
1248+ // / rather than "IncomingConnectionOwningAttributes," is to allow for future
1249+ // / expansion of USD to allow for value-transforming behaviors on attribute
1250+ // / connections themselves.
1251+ // /
1252+ // / The default input name is \p computationName; use `InputName` to specify a
1253+ // / different input name.
1254+ // /
1255+ // / # Example
1256+ // /
1257+ // / ```{.cpp}
1258+ // / EXEC_REGISTER_COMPUTATIONS_FOR_SCHEMA(MySchemaType)
1259+ // / {
1260+ // / // Register a prim computation that sums the values of the
1261+ // / // integer-valued attributes that own connections that target the
1262+ // / // provider prim.
1263+ // / self.PrimComputation(_tokens->computeSum)
1264+ // / .Callback<int>(+[](const VdfContext &ctx) {
1265+ // / VdfReadIteratorRange<int> range(
1266+ // / ctx, ExecBuiltinComputations->computeValue);
1267+ // / return std::accumulate(range.begin(), range.end(), 0);
1268+ // / })
1269+ // / .Inputs(
1270+ // / IncomingConnections<int>(ExecBuiltinComputations->computeValue));
1271+ // / }
1272+ // / ```
1273+ // /
1274+ template <typename ResultType>
1275+ auto
1276+ IncomingConnections (const TfToken &computationName)
1277+ {
1278+ return Exec_ComputationBuilderComputationValueSpecifier<
1279+ Exec_ComputationBuilderProviderTypes::Any>(
1280+ computationName,
1281+ ExecTypeRegistry::GetInstance ().CheckForRegistration <ResultType>(),
1282+ {SdfPath::ReflexiveRelativePath (),
1283+ ExecProviderResolution::DynamicTraversal::
1284+ IncomingConnectionOwningAttributes});
1285+ }
1286+
12261287// / @} // Value Specifiers
12271288
12281289} // namespace exec_registration
0 commit comments