You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It'd be easier to use these code samples if ref_target_path was optional. This is what it looks like now:
def add_ext_reference(prim: Usd.Prim, ref_asset_path: str, ref_target_path: Sdf.Path) -> None:
references: Usd.References = prim.GetReferences()
references.AddReference(
assetPath=ref_asset_path,
primPath=ref_target_path # OPTIONAL: Reference a specific target prim. Otherwise, uses the referenced layer's defaultPrim.
)
A better interface might be add_ext_reference(prim: Usd.Prim, ref_asset_path: str, ref_target_path: Sdf.Path=None). This way if ref_target_path is None, you can use the alternate AddReference signature that doesn't use a target.
It'd be easier to use these code samples if ref_target_path was optional. This is what it looks like now:
A better interface might be
add_ext_reference(prim: Usd.Prim, ref_asset_path: str, ref_target_path: Sdf.Path=None)
. This way if ref_target_path is None, you can use the alternate AddReference signature that doesn't use a target.FYI @felixmey
The text was updated successfully, but these errors were encountered: