Skip to content

Commit 469fd1d

Browse files
committed
USD 20.08: Update Swig and third_party headers
1 parent 4fafa4f commit 469fd1d

33 files changed

+3209
-1070
lines changed

src/Swig/Swig.csproj

+1
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,7 @@
122122
<Content Include="pxr\usd\kind\kindTokens.i" />
123123
<Content Include="pxr\usd\ndr\ndr.i" />
124124
<Content Include="pxr\usd\sdf\sdfLayerTree.i" />
125+
<Content Include="pxr\usd\sdf\sdfTimeCode.i" />
125126
<Content Include="pxr\usd\sdf\sdfPropertySpec.i" />
126127
<Content Include="pxr\usd\sdf\sdfAttributeSpec.i" />
127128
<Content Include="pxr\usd\sdf\sdfRelationshipSpec.i" />

src/Swig/pxr/base/vt/vtArray_Types.i

+7-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,11 @@ WRAP_EQUAL(SdfAssetPathArray)
1818
%template (SdfAssetPathArray) VtArray<SdfAssetPath>;
1919
typedef VtArray<SdfAssetPath> SdfAssetPathArray;
2020

21+
CSHARP_ARRAYS(SdfTimeCode, SdfTimeCode);
22+
WRAP_EQUAL(SdfTimeCodeArray)
23+
%template (SdfTimeCodeArray) VtArray<SdfTimeCode>;
24+
typedef VtArray<SdfTimeCode> SdfTimeCodeArray;
25+
2126
CSHARP_ARRAYS(bool, bool);
2227
WRAP_EQUAL(VtBoolArray)
2328
%template (VtBoolArray) VtArray<bool>;
@@ -80,8 +85,8 @@ typedef VtArray<GfQuath> VtQuathArray;
8085

8186
CSHARP_ARRAYS(std::string, string);
8287
WRAP_EQUAL(VtStringArray)
83-
%template (VtStringArray) VtArray<std::string >;
84-
typedef VtArray<std::string > VtStringArray;
88+
%template (VtStringArray) VtArray<std::string>;
89+
typedef VtArray<std::string> VtStringArray;
8590

8691
CSHARP_ARRAYS(TfToken, TfToken);
8792
WRAP_EQUAL(VtTokenArray)

src/Swig/pxr/base/vt/vtValue_Accessors.i

+29-1
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,10 @@
5454
%csattributes VtValueToSdfAssetPath "[Preserve]"
5555
%typemap(csattributes) VtArray<SdfAssetPath> "[Preserve]"
5656
%csattributes VtValueToSdfAssetPathArray "[Preserve]"
57+
%typemap(csattributes) SdfTimeCode "[Preserve]"
58+
%csattributes VtValueToSdfTimeCode "[Preserve]"
59+
%typemap(csattributes) VtArray<SdfTimeCode> "[Preserve]"
60+
%csattributes VtValueToSdfTimeCodeArray "[Preserve]"
5761
%typemap(csattributes) TfToken "[Preserve]"
5862
%csattributes VtValueToTfToken "[Preserve]"
5963
%typemap(csattributes) VtArray<bool> "[Preserve]"
@@ -80,7 +84,7 @@
8084
%csattributes VtValueToVtQuatfArray "[Preserve]"
8185
%typemap(csattributes) VtArray<GfQuath> "[Preserve]"
8286
%csattributes VtValueToVtQuathArray "[Preserve]"
83-
%typemap(csattributes) VtArray<std::string > "[Preserve]"
87+
%typemap(csattributes) VtArray<std::string> "[Preserve]"
8488
%csattributes VtValueToVtStringArray "[Preserve]"
8589
%typemap(csattributes) VtArray<TfToken> "[Preserve]"
8690
%csattributes VtValueToVtTokenArray "[Preserve]"
@@ -389,6 +393,30 @@ extern void VtValueToSdfAssetPathArray(VtValue const& value, SdfAssetPathArray*
389393
}
390394
}
391395

396+
extern SdfTimeCode VtValueToSdfTimeCode(VtValue const& value) {
397+
if (value.IsHolding<SdfTimeCode>()) {
398+
return value.UncheckedGet<SdfTimeCode>();
399+
}
400+
return SdfTimeCode();
401+
}
402+
extern void VtValueToSdfTimeCode(VtValue const& value, SdfTimeCode* output) {
403+
if (value.IsHolding<SdfTimeCode>()) {
404+
*output = value.UncheckedGet<SdfTimeCode>();
405+
}
406+
}
407+
408+
extern SdfTimeCodeArray VtValueToSdfTimeCodeArray(VtValue const& value) {
409+
if (value.IsHolding<SdfTimeCodeArray>()) {
410+
return value.UncheckedGet<SdfTimeCodeArray>();
411+
}
412+
return SdfTimeCodeArray();
413+
}
414+
extern void VtValueToSdfTimeCodeArray(VtValue const& value, SdfTimeCodeArray* output) {
415+
if (value.IsHolding<SdfTimeCodeArray>()) {
416+
*output = value.UncheckedGet<SdfTimeCodeArray>();
417+
}
418+
}
419+
392420
extern TfToken VtValueToTfToken(VtValue const& value) {
393421
if (value.IsHolding<TfToken>()) {
394422
return value.UncheckedGet<TfToken>();

src/Swig/pxr/base/vt/vtValue_Casts.i

+16
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,14 @@
9898
return UsdCs.VtValueToSdfAssetPathArray(value);
9999
}
100100

101+
public static implicit operator SdfTimeCode (VtValue value) {
102+
return UsdCs.VtValueToSdfTimeCode(value);
103+
}
104+
105+
public static implicit operator SdfTimeCodeArray (VtValue value) {
106+
return UsdCs.VtValueToSdfTimeCodeArray(value);
107+
}
108+
101109
public static implicit operator TfToken (VtValue value) {
102110
return UsdCs.VtValueToTfToken(value);
103111
}
@@ -338,6 +346,14 @@
338346
return new VtValue(value);
339347
}
340348

349+
public static implicit operator VtValue (SdfTimeCode value) {
350+
return new VtValue(value);
351+
}
352+
353+
public static implicit operator VtValue (SdfTimeCodeArray value) {
354+
return new VtValue(value);
355+
}
356+
341357
public static implicit operator VtValue (TfToken value) {
342358
return new VtValue(value);
343359
}

src/Swig/pxr/base/vt/vtValue_Types.i

+2
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@
3333
%template(VtValue) VtValue::VtValue<GfVec4i>;
3434
%template(VtValue) VtValue::VtValue<SdfAssetPath>;
3535
%template(VtValue) VtValue::VtValue<SdfAssetPathArray>;
36+
%template(VtValue) VtValue::VtValue<SdfTimeCode>;
37+
%template(VtValue) VtValue::VtValue<SdfTimeCodeArray>;
3638
%template(VtValue) VtValue::VtValue<TfToken>;
3739
%template(VtValue) VtValue::VtValue<VtBoolArray>;
3840
%template(VtValue) VtValue::VtValue<VtDoubleArray>;

src/Swig/pxr/usd/pcp/layerStack.i

+2
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@ typedef std::vector< PcpLayerStackPtr > PcpLayerStackPtrVector;
3939
SdfRelocatesMap *incrementalRelocatesTargetToSource,
4040
SdfPathVector *relocatesPrimPaths);
4141

42+
%ignore Pcp_NeedToRecomputeLayerStackTimeCodesPerSecond;
43+
4244
%ignore Pcp_NeedToRecomputeDueToAssetPathChange(const PcpLayerStackPtr& layerStack);
4345
%include "pxr/usd/pcp/layerStack.h"
4446

src/Swig/pxr/usd/sdf/sdf.i

+1-1
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,4 @@
4545

4646
%include "sdfLayer.i"
4747
%include "sdfLayerTree.i"
48-
48+
%include "sdfTimeCode.i"

src/Swig/pxr/usd/sdf/sdfPath.i

+1-1
Original file line numberDiff line numberDiff line change
@@ -71,4 +71,4 @@ typedef std::vector<SdfPath> SdfPathVector;
7171
}
7272
}
7373

74-
%include "pxr/usd/sdf/path.h"
74+
%include "third_party/include/pxr/usd/sdf/path.h"

src/Swig/pxr/usd/sdf/sdfTimeCode.i

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// Copyright 2019 Unity 3D. All rights reserved.
2+
//
3+
// Licensed under the Apache License, Version 2.0 (the "License");
4+
// you may not use this file except in compliance with the License.
5+
// You may obtain a copy of the License at
6+
//
7+
// http://www.apache.org/licenses/LICENSE-2.0
8+
//
9+
// Unless required by applicable law or agreed to in writing, software
10+
// distributed under the License is distributed on an "AS IS" BASIS,
11+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
// See the License for the specific language governing permissions and
13+
// limitations under the License.
14+
15+
%module sdfTimeCode
16+
17+
%{
18+
#include "pxr/usd/sdf/timeCode.h"
19+
%}
20+
21+
%template(SdfTimeCodeVector) std::vector<SdfTimeCode>;
22+
typedef std::vector<SdfTimeCode> SdfTimeCodeVector;
23+
24+
25+
%include "pxr/usd/sdf/timeCode.h"

0 commit comments

Comments
 (0)