add usd-21-05-win64_py37
This commit is contained in:
1 parent
41d23e71ba
commit
66bc054336
15675 files changed
+3061008
No files matched your search
@@ -0,0 +1,178 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
"""
|
||||
Tf -- Tools Foundation
|
||||
"""
|
||||
|
||||
def PrepareModule(module, result):
|
||||
"""PrepareModule(module, result) -- Prepare an extension module at import
|
||||
time. Generally, this should only be called by the __init__.py script for a
|
||||
module upon loading a boost python module (generally '_LibName.so')."""
|
||||
# inject into result.
|
||||
ignore = frozenset(['__name__', '__builtins__',
|
||||
'__doc__', '__file__', '__path__'])
|
||||
newModuleName = result.get('__name__')
|
||||
|
||||
for key, value in module.__dict__.items():
|
||||
if not key in ignore:
|
||||
result[key] = value
|
||||
|
||||
# Lie about the module from which value came.
|
||||
if newModuleName and hasattr(value, '__module__'):
|
||||
try:
|
||||
setattr(value, '__module__', newModuleName)
|
||||
except AttributeError as e:
|
||||
# The __module__ attribute of Boost.Python.function
|
||||
# objects is not writable, so we get this exception
|
||||
# a lot. Just ignore it. We're really only concerned
|
||||
# about the data objects like enum values and such.
|
||||
#
|
||||
pass
|
||||
|
||||
def GetCodeLocation(framesUp):
|
||||
"""Returns a tuple (moduleName, functionName, fileName, lineNo).
|
||||
|
||||
To trace the current location of python execution, use GetCodeLocation().
|
||||
By default, the information is returned at the current stack-frame; thus
|
||||
|
||||
info = GetCodeLocation()
|
||||
|
||||
will return information about the line that GetCodeLocation() was called
|
||||
from. One can write:
|
||||
|
||||
def genericDebugFacility():
|
||||
info = GetCodeLocation(1)
|
||||
# print out data
|
||||
|
||||
|
||||
def someCode():
|
||||
...
|
||||
if bad:
|
||||
genericDebugFacility()
|
||||
|
||||
and genericDebugFacility() will get information associated with its caller,
|
||||
i.e. the function someCode()."""
|
||||
import sys
|
||||
f_back = sys._getframe(framesUp).f_back
|
||||
return (f_back.f_globals['__name__'], f_back.f_code.co_name,
|
||||
f_back.f_code.co_filename, f_back.f_lineno)
|
||||
|
||||
# for some strange reason, this errors out when we try to reload it,
|
||||
# which is odd since _tf is a DSO and can't be reloaded anyway:
|
||||
import sys
|
||||
if "pxr.Tf._tf" not in sys.modules:
|
||||
from . import _tf
|
||||
PrepareModule(_tf, locals())
|
||||
del _tf
|
||||
del sys
|
||||
|
||||
# Need to provide an exception type that tf errors will show up as.
|
||||
class ErrorException(RuntimeError):
|
||||
def __init__(self, *args):
|
||||
RuntimeError.__init__(self, *args)
|
||||
self.__TfException = True
|
||||
|
||||
def __str__(self):
|
||||
return '\n\t' + '\n\t'.join([str(e) for e in self.args])
|
||||
__SetErrorExceptionClass(ErrorException)
|
||||
|
||||
try:
|
||||
from . import __DOC
|
||||
__DOC.Execute(locals())
|
||||
del __DOC
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def Warn(msg, template=""):
|
||||
"""Issue a warning via the TfDiagnostic system.
|
||||
|
||||
At this time, template is ignored.
|
||||
"""
|
||||
codeInfo = GetCodeLocation(framesUp=1)
|
||||
_Warn(msg, codeInfo[0], codeInfo[1], codeInfo[2], codeInfo[3])
|
||||
|
||||
def Status(msg, verbose=True):
|
||||
"""Issues a status update to the Tf diagnostic system.
|
||||
|
||||
If verbose is True (the default) then information about where in the code
|
||||
the status update was issued from is included.
|
||||
"""
|
||||
if verbose:
|
||||
codeInfo = GetCodeLocation(framesUp=1)
|
||||
_Status(msg, codeInfo[0], codeInfo[1], codeInfo[2], codeInfo[3])
|
||||
else:
|
||||
_Status(msg, "", "", "", 0)
|
||||
|
||||
def RaiseCodingError(msg):
|
||||
"""Raise a coding error to the Tf Diagnostic system."""
|
||||
codeInfo = GetCodeLocation(framesUp=1)
|
||||
_RaiseCodingError(msg, codeInfo[0], codeInfo[1], codeInfo[2], codeInfo[3])
|
||||
|
||||
def RaiseRuntimeError(msg):
|
||||
"""Raise a runtime error to the Tf Diagnostic system."""
|
||||
codeInfo = GetCodeLocation(framesUp=1)
|
||||
_RaiseRuntimeError(msg, codeInfo[0], codeInfo[1], codeInfo[2], codeInfo[3])
|
||||
|
||||
def Fatal(msg):
|
||||
"""Raise a fatal error to the Tf Diagnostic system."""
|
||||
codeInfo = GetCodeLocation(framesUp=1)
|
||||
_Fatal(msg, codeInfo[0], codeInfo[1], codeInfo[2], codeInfo[3])
|
||||
|
||||
|
||||
class NamedTemporaryFile(object):
|
||||
"""A named temporary file which keeps the internal file handle closed.
|
||||
A class which constructs a temporary file(that isn't open) on __enter__,
|
||||
provides its name as an attribute, and deletes it on __exit__.
|
||||
|
||||
Note: The constructor args for this object match those of
|
||||
python's tempfile.mkstemp() function, and will have the same effect on
|
||||
the underlying file created."""
|
||||
|
||||
def __init__(self, suffix='', prefix='', dir=None, text=False):
|
||||
# Note that we defer creation until the enter block to
|
||||
# prevent users from unintentionally creating a bunch of
|
||||
# temp files that don't get cleaned up.
|
||||
self._args = (suffix, prefix, dir, text)
|
||||
|
||||
def __enter__(self):
|
||||
from tempfile import mkstemp
|
||||
from os import close
|
||||
|
||||
fd, path = mkstemp(*self._args)
|
||||
close(fd)
|
||||
|
||||
# XXX: We currently only expose the name attribute
|
||||
# more can be added based on client needs in the future.
|
||||
self._name = path
|
||||
|
||||
return self
|
||||
|
||||
def __exit__(self, *args):
|
||||
import os
|
||||
os.remove(self.name)
|
||||
|
||||
@property
|
||||
def name(self):
|
||||
"""The path for the temporary file created."""
|
||||
return self._name
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,24 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,59 @@
|
||||
#
|
||||
# Copyright 2021 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 pxr import Tf
|
||||
|
||||
def _NoArgs():
|
||||
return "_NoArgs result"
|
||||
|
||||
def _ReturnInt():
|
||||
return 42
|
||||
|
||||
def _RepeatStrings(stringList, numRepeats):
|
||||
return [s * numRepeats for s in stringList]
|
||||
|
||||
def _ConcatWithList(arg1, arg2, *args):
|
||||
return str.join(
|
||||
" ",
|
||||
[str(a) for a in
|
||||
[arg1, arg2]
|
||||
+ list(args)])
|
||||
|
||||
def _ConcatWithKwArgs(arg1, arg2, arg3 = "c", arg4 = "d", **kwargs):
|
||||
return str.join(
|
||||
" ",
|
||||
[str(a) for a in
|
||||
[arg1, arg2, arg3, arg4]
|
||||
+ ["%s=%s" % (k, kwargs[k]) for k in sorted(kwargs.keys())]])
|
||||
|
||||
def _GetTheeToANonery(arg):
|
||||
assert arg is None
|
||||
|
||||
_globalVar = 88
|
||||
|
||||
def _RaiseException():
|
||||
raise Exception("test exception")
|
||||
|
||||
def _RaiseTfError():
|
||||
Tf.RaiseRuntimeError("test error")
|
||||
Binary file not shown.
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# 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 pxr import Tf
|
||||
|
||||
raise RuntimeError('This module should not get loaded!')
|
||||
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,27 @@
|
||||
#
|
||||
# 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 pxr import Tf
|
||||
|
||||
Tf.ScriptModuleLoader()._LoadModulesForLibrary('DepLoadsAll')
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,30 @@
|
||||
#
|
||||
# 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 pxr import Tf
|
||||
|
||||
Tf.ScriptModuleLoader()._LoadModulesForLibrary('LoadsAll')
|
||||
|
||||
# Request to load everything. This will be deferred by the TfScriptModuleLoader
|
||||
# until after the current dependency load is complete.
|
||||
Tf.ScriptModuleLoader()._LoadModulesForLibrary('')
|
||||
Binary file not shown.
@@ -0,0 +1,28 @@
|
||||
#
|
||||
# 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 pxr import Tf
|
||||
|
||||
Tf.ScriptModuleLoader()._LoadModulesForLibrary('LoadsUnknown')
|
||||
|
||||
from . import testTfScriptModuleLoader_Unknown
|
||||
Binary file not shown.
@@ -0,0 +1,26 @@
|
||||
#
|
||||
# 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 pxr import Tf
|
||||
|
||||
Tf.ScriptModuleLoader()._LoadModulesForLibrary('Other')
|
||||
Binary file not shown.
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# 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.
|
||||
#
|
||||
pass
|
||||
|
||||
Binary file not shown.
@@ -0,0 +1,42 @@
|
||||
#
|
||||
# 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 pxr import Tf
|
||||
|
||||
# Register this library with a new, previously unknown dependency. Note, we're
|
||||
# just using 'sys' as the module to load here, which is a lie. It should really
|
||||
# be this module, but it doesn't matter, and it's not trivial to come up with a
|
||||
# robust, correct module name for this module.
|
||||
Tf.ScriptModuleLoader()._RegisterLibrary('Unknown', 'sys',
|
||||
['NewDynamicDependency'])
|
||||
|
||||
# Register the dependency. In this case we use 'sys' just because it saves us
|
||||
# from creating a real module called NewDynamicDependency.
|
||||
Tf.ScriptModuleLoader()._RegisterLibrary('NewDynamicDependency', 'sys', [])
|
||||
|
||||
# Load dependencies for this module, which includes the
|
||||
# NewDynamicDependency. This is a reentrant load that will be handled
|
||||
# immediately by TfScriptModuleLoader.
|
||||
Tf.ScriptModuleLoader()._LoadModulesForLibrary('Unknown')
|
||||
|
||||
|
||||
Binary file not shown.
Reference in new issue
Block a user