-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1424 from AlesBorovicka/physics-schema
UsdPhysics schema (Internal change: 2174307)
- Loading branch information
Showing
77 changed files
with
15,392 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,7 @@ set(DIRS | |
usdSkel | ||
usdUI | ||
usdUtils | ||
usdPhysics | ||
plugin | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
set(PXR_PREFIX pxr/usd) | ||
set(PXR_PACKAGE usdPhysics) | ||
|
||
pxr_library(usdPhysics | ||
LIBRARIES | ||
js | ||
tf | ||
plug | ||
vt | ||
sdf | ||
trace | ||
usd | ||
usdGeom | ||
work | ||
${Boost_PYTHON_LIBRARY} | ||
${TBB_tbb_LIBRARY} | ||
|
||
INCLUDE_DIRS | ||
${Boost_INCLUDE_DIRS} | ||
${TBB_INCLUDE_DIRS} | ||
|
||
PUBLIC_CLASSES | ||
articulationRootAPI | ||
collisionAPI | ||
collisionGroup | ||
distanceJoint | ||
driveAPI | ||
filteredPairsAPI | ||
fixedJoint | ||
joint | ||
limitAPI | ||
massAPI | ||
materialAPI | ||
meshCollisionAPI | ||
metrics | ||
prismaticJoint | ||
revoluteJoint | ||
rigidBodyAPI | ||
scene | ||
sphericalJoint | ||
tokens | ||
|
||
PUBLIC_HEADERS | ||
api.h | ||
|
||
PYTHON_CPPFILES | ||
moduleDeps.cpp | ||
|
||
PYMODULE_CPPFILES | ||
module.cpp | ||
wrapArticulationRootAPI.cpp | ||
wrapCollisionAPI.cpp | ||
wrapCollisionGroup.cpp | ||
wrapDistanceJoint.cpp | ||
wrapDriveAPI.cpp | ||
wrapFilteredPairsAPI.cpp | ||
wrapFixedJoint.cpp | ||
wrapJoint.cpp | ||
wrapLimitAPI.cpp | ||
wrapMassAPI.cpp | ||
wrapMaterialAPI.cpp | ||
wrapMeshCollisionAPI.cpp | ||
wrapMetrics.cpp | ||
wrapPrismaticJoint.cpp | ||
wrapRevoluteJoint.cpp | ||
wrapRigidBodyAPI.cpp | ||
wrapScene.cpp | ||
wrapSphericalJoint.cpp | ||
wrapTokens.cpp | ||
|
||
PYMODULE_FILES | ||
__init__.py | ||
|
||
RESOURCE_FILES | ||
plugInfo.json | ||
generatedSchema.usda | ||
schema.usda:usdPhysics/schema.usda | ||
|
||
DOXYGEN_FILES | ||
overview.dox | ||
examples/usdPhysicsBoxOnBox.usda | ||
examples/usdPhysicsBoxOnQuad.usda | ||
examples/usdPhysicsDistanceJoint.usda | ||
examples/usdPhysicsGroupFiltering.usda | ||
examples/usdPhysicsJoints.usda | ||
examples/usdPhysicsPairFiltering.usda | ||
examples/usdPhysicsSpheresWithMaterial.usda | ||
) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# | ||
#==== | ||
# Copyright (c) 2018, NVIDIA CORPORATION | ||
#====== | ||
# | ||
|
||
# | ||
# Copyright 2016 Pixar | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "Apache License") | ||
# with the following modification; you may not use this file except in | ||
# compliance with the Apache License and the following modification to it: | ||
# Section 6. Trademarks. is deleted and replaced with: | ||
# | ||
# 6. Trademarks. This License does not grant permission to use the trade | ||
# names, trademarks, service marks, or product names of the Licensor | ||
# and its affiliates, except as required to comply with Section 4(c) of | ||
# the License and to reproduce the content of the NOTICE file. | ||
# | ||
# You may obtain a copy of the Apache License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the Apache License with the above modification is | ||
# distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
# KIND, either express or implied. See the Apache License for the specific | ||
# language governing permissions and limitations under the Apache License. | ||
# | ||
from . import _usdPhysics | ||
from pxr import Tf | ||
Tf.PrepareModule(_usdPhysics, locals()) | ||
del Tf | ||
|
||
try: | ||
import __DOC | ||
__DOC.Execute(locals()) | ||
del __DOC | ||
except Exception: | ||
try: | ||
import __tmpDoc | ||
__tmpDoc.Execute(locals()) | ||
del __tmpDoc | ||
except: | ||
pass | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
// | ||
// Copyright 2017 Pixar | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "Apache License") | ||
// with the following modification; you may not use this file except in | ||
// compliance with the Apache License and the following modification to it: | ||
// Section 6. Trademarks. is deleted and replaced with: | ||
// | ||
// 6. Trademarks. This License does not grant permission to use the trade | ||
// names, trademarks, service marks, or product names of the Licensor | ||
// and its affiliates, except as required to comply with Section 4(c) of | ||
// the License and to reproduce the content of the NOTICE file. | ||
// | ||
// You may obtain a copy of the Apache License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the Apache License with the above modification is | ||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the Apache License for the specific | ||
// language governing permissions and limitations under the Apache License. | ||
// | ||
#ifndef USDPHYSICS_API_H | ||
#define USDPHYSICS_API_H | ||
|
||
#include "pxr/base/arch/export.h" | ||
|
||
#if defined(PXR_STATIC) | ||
# define USDPHYSICS_API | ||
# define USDPHYSICS_API_TEMPLATE_CLASS(...) | ||
# define USDPHYSICS_API_TEMPLATE_STRUCT(...) | ||
# define USDPHYSICS_LOCAL | ||
#else | ||
# if defined(USDPHYSICS_EXPORTS) | ||
# define USDPHYSICS_API ARCH_EXPORT | ||
# define USDPHYSICS_API_TEMPLATE_CLASS(...) ARCH_EXPORT_TEMPLATE(class, __VA_ARGS__) | ||
# define USDPHYSICS_API_TEMPLATE_STRUCT(...) ARCH_EXPORT_TEMPLATE(struct, __VA_ARGS__) | ||
# else | ||
# define USDPHYSICS_API ARCH_IMPORT | ||
# define USDPHYSICS_API_TEMPLATE_CLASS(...) ARCH_IMPORT_TEMPLATE(class, __VA_ARGS__) | ||
# define USDPHYSICS_API_TEMPLATE_STRUCT(...) ARCH_IMPORT_TEMPLATE(struct, __VA_ARGS__) | ||
# endif | ||
# define USDPHYSICS_LOCAL ARCH_HIDDEN | ||
#endif | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,134 @@ | ||
// | ||
// Copyright 2016 Pixar | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "Apache License") | ||
// with the following modification; you may not use this file except in | ||
// compliance with the Apache License and the following modification to it: | ||
// Section 6. Trademarks. is deleted and replaced with: | ||
// | ||
// 6. Trademarks. This License does not grant permission to use the trade | ||
// names, trademarks, service marks, or product names of the Licensor | ||
// and its affiliates, except as required to comply with Section 4(c) of | ||
// the License and to reproduce the content of the NOTICE file. | ||
// | ||
// You may obtain a copy of the Apache License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the Apache License with the above modification is | ||
// distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
// KIND, either express or implied. See the Apache License for the specific | ||
// language governing permissions and limitations under the Apache License. | ||
// | ||
#include "pxr/usd/usdPhysics/articulationRootAPI.h" | ||
#include "pxr/usd/usd/schemaRegistry.h" | ||
#include "pxr/usd/usd/typed.h" | ||
#include "pxr/usd/usd/tokens.h" | ||
|
||
#include "pxr/usd/sdf/types.h" | ||
#include "pxr/usd/sdf/assetPath.h" | ||
|
||
PXR_NAMESPACE_OPEN_SCOPE | ||
|
||
// Register the schema with the TfType system. | ||
TF_REGISTRY_FUNCTION(TfType) | ||
{ | ||
TfType::Define<UsdPhysicsArticulationRootAPI, | ||
TfType::Bases< UsdAPISchemaBase > >(); | ||
|
||
} | ||
|
||
TF_DEFINE_PRIVATE_TOKENS( | ||
_schemaTokens, | ||
(PhysicsArticulationRootAPI) | ||
); | ||
|
||
/* virtual */ | ||
UsdPhysicsArticulationRootAPI::~UsdPhysicsArticulationRootAPI() | ||
{ | ||
} | ||
|
||
/* static */ | ||
UsdPhysicsArticulationRootAPI | ||
UsdPhysicsArticulationRootAPI::Get(const UsdStagePtr &stage, const SdfPath &path) | ||
{ | ||
if (!stage) { | ||
TF_CODING_ERROR("Invalid stage"); | ||
return UsdPhysicsArticulationRootAPI(); | ||
} | ||
return UsdPhysicsArticulationRootAPI(stage->GetPrimAtPath(path)); | ||
} | ||
|
||
|
||
/* virtual */ | ||
UsdSchemaKind UsdPhysicsArticulationRootAPI::_GetSchemaKind() const | ||
{ | ||
return UsdPhysicsArticulationRootAPI::schemaKind; | ||
} | ||
|
||
/* static */ | ||
bool | ||
UsdPhysicsArticulationRootAPI::CanApply( | ||
const UsdPrim &prim, std::string *whyNot) | ||
{ | ||
return prim.CanApplyAPI<UsdPhysicsArticulationRootAPI>(whyNot); | ||
} | ||
|
||
/* static */ | ||
UsdPhysicsArticulationRootAPI | ||
UsdPhysicsArticulationRootAPI::Apply(const UsdPrim &prim) | ||
{ | ||
if (prim.ApplyAPI<UsdPhysicsArticulationRootAPI>()) { | ||
return UsdPhysicsArticulationRootAPI(prim); | ||
} | ||
return UsdPhysicsArticulationRootAPI(); | ||
} | ||
|
||
/* static */ | ||
const TfType & | ||
UsdPhysicsArticulationRootAPI::_GetStaticTfType() | ||
{ | ||
static TfType tfType = TfType::Find<UsdPhysicsArticulationRootAPI>(); | ||
return tfType; | ||
} | ||
|
||
/* static */ | ||
bool | ||
UsdPhysicsArticulationRootAPI::_IsTypedSchema() | ||
{ | ||
static bool isTyped = _GetStaticTfType().IsA<UsdTyped>(); | ||
return isTyped; | ||
} | ||
|
||
/* virtual */ | ||
const TfType & | ||
UsdPhysicsArticulationRootAPI::_GetTfType() const | ||
{ | ||
return _GetStaticTfType(); | ||
} | ||
|
||
/*static*/ | ||
const TfTokenVector& | ||
UsdPhysicsArticulationRootAPI::GetSchemaAttributeNames(bool includeInherited) | ||
{ | ||
static TfTokenVector localNames; | ||
static TfTokenVector allNames = | ||
UsdAPISchemaBase::GetSchemaAttributeNames(true); | ||
|
||
if (includeInherited) | ||
return allNames; | ||
else | ||
return localNames; | ||
} | ||
|
||
PXR_NAMESPACE_CLOSE_SCOPE | ||
|
||
// ===================================================================== // | ||
// Feel free to add custom code below this line. It will be preserved by | ||
// the code generator. | ||
// | ||
// Just remember to wrap code in the appropriate delimiters: | ||
// 'PXR_NAMESPACE_OPEN_SCOPE', 'PXR_NAMESPACE_CLOSE_SCOPE'. | ||
// ===================================================================== // | ||
// --(BEGIN CUSTOM CODE)-- |
Oops, something went wrong.