Skip to content

Commit

Permalink
Extend Usd.References, Stage, Prim, Sdf, swift apis.
Browse files Browse the repository at this point in the history
* Use enum classes for UsdListPosition and UsdLoadPolicy for syntactically clean swift cases.
* Also bump darwin platform CI so that visionOS can build.

Signed-off-by: furby™ <[email protected]>
  • Loading branch information
furby-tm committed Dec 1, 2024
1 parent 5dd6c3d commit a445a7b
Show file tree
Hide file tree
Showing 40 changed files with 344 additions and 136 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/swift-debug-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
name: Swift ${{ matrix.swift }} on ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
swift: ["5.10"]
os: [macos-15]
swift: ["6.0.2"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/swift-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
name: Swift ${{ matrix.swift }} on iOS
strategy:
matrix:
os: [macos-latest]
swift: ["5.10"]
os: [macos-15]
swift: ["6.0.2"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/swift-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
name: Swift ${{ matrix.swift }} on ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
swift: ["5.10"]
os: [macos-15]
swift: ["6.0.2"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/swift-visionos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ jobs:
name: Swift ${{ matrix.swift }} on visionOS
strategy:
matrix:
os: [macos-latest]
swift: ["5.10"]
os: [macos-15]
swift: ["6.0.2"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "rust-usd"
version = "24.8.11"
version = "24.8.12"
edition = "2021"
publish = []

Expand Down
2 changes: 1 addition & 1 deletion DeclarativePixarUSD.usda
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#usda 1.0
(
doc = "SwiftUSD v24.08.11 | Declarative API"
doc = "SwiftUSD v24.08.12 | Declarative API"
)

def "DeclarativeScene"
Expand Down
2 changes: 1 addition & 1 deletion HelloPixarUSD.usda
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#usda 1.0
(
doc = "SwiftUSD v24.08.11"
doc = "SwiftUSD v24.08.12"
)

def Xform "Geometry"
Expand Down
2 changes: 1 addition & 1 deletion Python/PyUsd/wrapAttribute.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ void wrapUsdAttribute()

.def("AddConnection",
&UsdAttribute::AddConnection,
(arg("source"), arg("position") = UsdListPositionBackOfPrependList))
(arg("source"), arg("position") = UsdListPosition::UsdListPositionBackOfPrependList))
.def("RemoveConnection", &UsdAttribute::RemoveConnection, arg("source"))
.def("SetConnections", &UsdAttribute::SetConnections, arg("sources"))
.def("ClearConnections", &UsdAttribute::ClearConnections)
Expand Down
2 changes: 1 addition & 1 deletion Python/PyUsd/wrapInherits.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ void wrapUsdInherits()
class_<UsdInherits>("Inherits", no_init)
.def("AddInherit",
&UsdInherits::AddInherit,
(arg("primPath"), arg("position") = UsdListPositionBackOfPrependList))
(arg("primPath"), arg("position") = UsdListPosition::UsdListPositionBackOfPrependList))
.def("RemoveInherit", &UsdInherits::RemoveInherit, arg("primPath"))
.def("ClearInherits", &UsdInherits::ClearInherits)
.def("SetInherits", &UsdInherits::SetInherits)
Expand Down
8 changes: 4 additions & 4 deletions Python/PyUsd/wrapPayloads.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ void wrapUsdPayloads()
class_<UsdPayloads>("Payloads", no_init)
.def("AddPayload",
(bool(UsdPayloads::*)(const SdfPayload &, UsdListPosition)) & UsdPayloads::AddPayload,
(arg("payload"), arg("position") = UsdListPositionBackOfPrependList))
(arg("payload"), arg("position") = UsdListPosition::UsdListPositionBackOfPrependList))
.def("AddPayload",
(bool(UsdPayloads::*)(
const string &, const SdfPath &, const SdfLayerOffset &, UsdListPosition)) &
UsdPayloads::AddPayload,
(arg("assetPath"),
arg("primPath"),
arg("layerOffset") = SdfLayerOffset(),
arg("position") = UsdListPositionBackOfPrependList))
arg("position") = UsdListPosition::UsdListPositionBackOfPrependList))
.def("AddPayload",
(bool(UsdPayloads::*)(const string &, const SdfLayerOffset &, UsdListPosition)) &
UsdPayloads::AddPayload,
(arg("assetPath"),
arg("layerOffset") = SdfLayerOffset(),
arg("position") = UsdListPositionBackOfPrependList))
arg("position") = UsdListPosition::UsdListPositionBackOfPrependList))
.def("AddInternalPayload",
&UsdPayloads::AddInternalPayload,
(arg("primPath"),
arg("layerOffset") = SdfLayerOffset(),
arg("position") = UsdListPositionBackOfPrependList))
arg("position") = UsdListPosition::UsdListPositionBackOfPrependList))

.def("RemovePayload", &UsdPayloads::RemovePayload, arg("payload"))
.def("ClearPayloads", &UsdPayloads::ClearPayloads)
Expand Down
23 changes: 11 additions & 12 deletions Python/PyUsd/wrapPrim.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -492,10 +492,10 @@ void wrapUsdPrim()
.def("ClearChildrenReorder", &UsdPrim::ClearChildrenReorder)

.def("GetParent", &UsdPrim::GetParent)
.def("GetNextSibling", (UsdPrim(UsdPrim::*)() const) & UsdPrim::GetNextSibling)
.def("GetNextSibling", (UsdPrim(UsdPrim::*)() const)&UsdPrim::GetNextSibling)
.def("GetFilteredNextSibling",
(UsdPrim(UsdPrim::*)(const Usd_PrimFlagsPredicate &) const) &
UsdPrim::GetFilteredNextSibling)
(UsdPrim(UsdPrim::*)(const Usd_PrimFlagsPredicate &)
const)&UsdPrim::GetFilteredNextSibling)
.def("IsPseudoRoot", &UsdPrim::IsPseudoRoot)

.def("HasVariantSets", &UsdPrim::HasVariantSets)
Expand All @@ -508,17 +508,17 @@ void wrapUsdPrim()

.def("CreateAttribute",
(UsdAttribute(UsdPrim::*)(
const TfToken &, const SdfValueTypeName &, bool, SdfVariability) const) &
UsdPrim::CreateAttribute,
const TfToken &, const SdfValueTypeName &, bool, SdfVariability)
const)&UsdPrim::CreateAttribute,
(arg("name"),
arg("typeName"),
arg("custom") = true,
arg("variability") = SdfVariabilityVarying))

.def("CreateAttribute",
(UsdAttribute(UsdPrim::*)(
const vector<string> &, const SdfValueTypeName &, bool, SdfVariability) const) &
UsdPrim::CreateAttribute,
const vector<string> &, const SdfValueTypeName &, bool, SdfVariability)
const)&UsdPrim::CreateAttribute,
(arg("nameElts"),
arg("typeName"),
arg("custom") = true,
Expand All @@ -543,13 +543,12 @@ void wrapUsdPrim()
arg("recurseOnSources") = false))

.def("CreateRelationship",
(UsdRelationship(UsdPrim::*)(const TfToken &, bool) const) &
UsdPrim::CreateRelationship,
(UsdRelationship(UsdPrim::*)(const TfToken &, bool) const)&UsdPrim::CreateRelationship,
(arg("name"), arg("custom") = true))

.def("CreateRelationship",
(UsdRelationship(UsdPrim::*)(const vector<string> &, bool) const) &
UsdPrim::CreateRelationship,
(UsdRelationship(UsdPrim::*)(const vector<string> &, bool)
const)&UsdPrim::CreateRelationship,
(arg("nameElts"), arg("custom") = true))

.def("GetRelationships",
Expand Down Expand Up @@ -587,7 +586,7 @@ void wrapUsdPrim()
.def("GetPayloads", &UsdPrim::GetPayloads)
.def("HasAuthoredPayloads", &UsdPrim::HasAuthoredPayloads)

.def("Load", &UsdPrim::Load, (arg("policy") = UsdLoadWithDescendants))
.def("Load", &UsdPrim::Load, (arg("policy") = UsdLoadPolicy::UsdLoadPolicyWithDescendants))
.def("Unload", &UsdPrim::Unload)

.def("GetReferences", &UsdPrim::GetReferences)
Expand Down
8 changes: 4 additions & 4 deletions Python/PyUsd/wrapReferences.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,26 +22,26 @@ void wrapUsdReferences()
.def("AddReference",
(bool(UsdReferences::*)(const SdfReference &, UsdListPosition)) &
UsdReferences::AddReference,
(arg("ref"), arg("position") = UsdListPositionBackOfPrependList))
(arg("ref"), arg("position") = UsdListPosition::UsdListPositionBackOfPrependList))
.def("AddReference",
(bool(UsdReferences::*)(
const string &, const SdfPath &, const SdfLayerOffset &, UsdListPosition)) &
UsdReferences::AddReference,
(arg("assetPath"),
arg("primPath"),
arg("layerOffset") = SdfLayerOffset(),
arg("position") = UsdListPositionBackOfPrependList))
arg("position") = UsdListPosition::UsdListPositionBackOfPrependList))
.def("AddReference",
(bool(UsdReferences::*)(const string &, const SdfLayerOffset &, UsdListPosition)) &
UsdReferences::AddReference,
(arg("assetPath"),
arg("layerOffset") = SdfLayerOffset(),
arg("position") = UsdListPositionBackOfPrependList))
arg("position") = UsdListPosition::UsdListPositionBackOfPrependList))
.def("AddInternalReference",
&UsdReferences::AddInternalReference,
(arg("primPath"),
arg("layerOffset") = SdfLayerOffset(),
arg("position") = UsdListPositionBackOfPrependList))
arg("position") = UsdListPosition::UsdListPositionBackOfPrependList))

.def("RemoveReference", &UsdReferences::RemoveReference, arg("ref"))
.def("ClearReferences", &UsdReferences::ClearReferences)
Expand Down
2 changes: 1 addition & 1 deletion Python/PyUsd/wrapRelationship.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ void wrapUsdRelationship()
.def("__repr__", __repr__)
.def("AddTarget",
&UsdRelationship::AddTarget,
(arg("target"), arg("position") = UsdListPositionBackOfPrependList))
(arg("target"), arg("position") = UsdListPosition::UsdListPositionBackOfPrependList))
.def("RemoveTarget", &UsdRelationship::RemoveTarget, arg("target"))
.def("SetTargets", &UsdRelationship::SetTargets, arg("targets"))
.def("ClearTargets", &UsdRelationship::ClearTargets, arg("removeSpec"))
Expand Down
2 changes: 1 addition & 1 deletion Python/PyUsd/wrapSpecializes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ void wrapUsdSpecializes()
class_<UsdSpecializes>("Specializes", no_init)
.def("AddSpecialize",
&UsdSpecializes::AddSpecialize,
(arg("primPath"), arg("position") = UsdListPositionBackOfPrependList))
(arg("primPath"), arg("position") = UsdListPosition::UsdListPositionBackOfPrependList))
.def("RemoveSpecialize", &UsdSpecializes::RemoveSpecialize, arg("primPath"))
.def("ClearSpecializes", &UsdSpecializes::ClearSpecializes)
.def("SetSpecializes", &UsdSpecializes::SetSpecializes)
Expand Down
Loading

0 comments on commit a445a7b

Please sign in to comment.