diff --git a/CHANGELOG.md b/CHANGELOG.md index f0489ef..27a8ef5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,31 @@ All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/). + +## [1.3.0] - 2024-08-15 + +### Added +- support for Maya 2024 +- support for Python 3.11 +- added source code comments to python wrappers + +### Fixed +- `CalculateMeshLowerLODsCommand` was rewritten to address edge cases discovered with eyelashes and to handle some common cases of invalid UV data. +- `RotateCommand` to rotate blend shape target deltas as well. +- `SetBlendShapeTargetDeltasCommand` to allow setting vertex indices as well. +- Swig generated classes are now wrapped instead of being monkey-patched to invoke constructors and destructors (which allows building with newer Swig versions - 4.0.x and 4.1.x). + +### Changed +- CMake files to add test cases that execute the example scripts and allow generating bundled archives with CPack. +- Binaries for embeddedRL4 plugin to be .so files. + + +## [1.2.0] - 2023-06-30 + +### Added +- assets (gui.ma, Ada.dna, additional_assemble_script.py) which support MHC 2.x.x releases (UE 5.2 and 5.3) + + ## [1.1.0] - 2023-04-20 ### Added @@ -26,4 +51,4 @@ All notable changes to this project will be documented in this file. This projec - option to pass list of indices to remove in remove commands. ### Removed -- removed method `assemble_rig` from DNAViewer API. \ No newline at end of file +- removed method `assemble_rig` from DNAViewer API. diff --git a/dnacalib/CMakeLists.txt b/dnacalib/CMakeLists.txt index 8af5dd6..4ae91f0 100644 --- a/dnacalib/CMakeLists.txt +++ b/dnacalib/CMakeLists.txt @@ -3,7 +3,25 @@ project(dnacalib) list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/CMakeModulesExtra") +enable_testing() + add_subdirectory(DNACalib) add_subdirectory(SPyUS) add_subdirectory(PyDNA) add_subdirectory(PyDNACalib) + +################################################ +# Package build artifacts +set(CPACK_GENERATOR "ZIP") +set(CPACK_ARCHIVE_COMPONENT_INSTALL ON) +set(CPACK_COMPONENT_INCLUDE_TOPLEVEL_DIRECTORY OFF) +set(CPACK_COMPONENTS_GROUPING ALL_COMPONENTS_IN_ONE) +string(CONCAT CPACK_PACKAGE_FILE_NAME "${CMAKE_PROJECT_NAME}" + "-${CMAKE_PROJECT_VERSION}" + "-${CMAKE_SYSTEM_NAME}" + "-${CMAKE_SYSTEM_PROCESSOR}" + "-${CMAKE_CXX_COMPILER_ID}${CMAKE_CXX_COMPILER_VERSION}" + "-${CMAKE_BUILD_TYPE}" + "-${PYTHON3_EXACT_VERSION}" + "-SHARED") +include(CPack) diff --git a/dnacalib/CMakeModulesExtra/install/InstallLibrary.cmake b/dnacalib/CMakeModulesExtra/install/InstallLibrary.cmake index 4aa4816..d0659f8 100644 --- a/dnacalib/CMakeModulesExtra/install/InstallLibrary.cmake +++ b/dnacalib/CMakeModulesExtra/install/InstallLibrary.cmake @@ -14,6 +14,14 @@ set(INSTALL_LIBRARY_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}") macro(install_library target_name) + # component_name is an optional argument, and will default to the given target_name + set(COMPONENT_NAME ${target_name}) + set(extra_args ${ARGN}) + list(LENGTH extra_args num_extra_args) + if(${num_extra_args} GREATER 0) + list(GET extra_args 0 COMPONENT_NAME) + endif() + include(GNUInstallDirs) set(REPRESENTATIVE_TARGET_NAME ${target_name}) set(INSTALL_CONFIGDIR ${CMAKE_INSTALL_LIBDIR}/cmake/${PROJECT_NAME}) @@ -21,9 +29,20 @@ macro(install_library target_name) # Set install destinations and associate installed target files with an export install(TARGETS ${REPRESENTATIVE_TARGET_NAME} EXPORT ${PROJECT_NAME}-targets - RUNTIME DESTINATION ${CMAKE_INSTALL_LIBDIR} - LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR} - ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT ${COMPONENT_NAME} + RUNTIME + DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT ${COMPONENT_NAME} + LIBRARY + DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT ${COMPONENT_NAME} + NAMELINK_COMPONENT ${COMPONENT_NAME} + ARCHIVE + DESTINATION ${CMAKE_INSTALL_LIBDIR} + COMPONENT ${COMPONENT_NAME} + PUBLIC_HEADER + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT ${COMPONENT_NAME} INCLUDES DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) # Write build-tree targets @@ -37,7 +56,8 @@ macro(install_library target_name) install(EXPORT ${PROJECT_NAME}-targets FILE ${PROJECT_NAME}Targets.cmake NAMESPACE ${PROJECT_NAME}:: - DESTINATION ${INSTALL_CONFIGDIR}) + DESTINATION ${INSTALL_CONFIGDIR} + COMPONENT ${COMPONENT_NAME}) include(CMakePackageConfigHelpers) @@ -68,13 +88,17 @@ macro(install_library target_name) install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}Config.install.cmake" DESTINATION ${INSTALL_CONFIGDIR} - RENAME "${PROJECT_NAME}Config.cmake") + RENAME "${PROJECT_NAME}Config.cmake" + COMPONENT ${COMPONENT_NAME}) # Install package version file install(FILES "${CMAKE_CURRENT_BINARY_DIR}/${PROJECT_NAME}ConfigVersion.cmake" - DESTINATION ${INSTALL_CONFIGDIR}) + DESTINATION ${INSTALL_CONFIGDIR} + COMPONENT ${COMPONENT_NAME}) # Install include files - install(DIRECTORY include/ DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) + install(DIRECTORY include/ + DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} + COMPONENT ${COMPONENT_NAME}) endmacro() diff --git a/dnacalib/DNACalib/CMakeLists.txt b/dnacalib/DNACalib/CMakeLists.txt index e23730e..f76450e 100644 --- a/dnacalib/DNACalib/CMakeLists.txt +++ b/dnacalib/DNACalib/CMakeLists.txt @@ -100,6 +100,8 @@ set(SOURCES src/dnacalib/TypeDefs.h src/dnacalib/commands/CalculateMeshLowerLODsCommand.cpp + src/dnacalib/commands/CalculateMeshLowerLODsCommandImpl.cpp + src/dnacalib/commands/CalculateMeshLowerLODsCommandImpl.h src/dnacalib/commands/ClearBlendShapesCommand.cpp src/dnacalib/commands/CommandSequence.cpp src/dnacalib/commands/PruneBlendShapeTargetsCommand.cpp diff --git a/dnacalib/DNACalib/cmake/DNACDependencies.cmake b/dnacalib/DNACalib/cmake/DNACDependencies.cmake index e7d11a3..123e46d 100644 --- a/dnacalib/DNACalib/cmake/DNACDependencies.cmake +++ b/dnacalib/DNACalib/cmake/DNACDependencies.cmake @@ -123,6 +123,8 @@ set(SOURCES src/dnacalib/CommandImplBase.h src/dnacalib/TypeDefs.h src/dnacalib/commands/CalculateMeshLowerLODsCommand.cpp + src/dnacalib/commands/CalculateMeshLowerLODsCommandImpl.cpp + src/dnacalib/commands/CalculateMeshLowerLODsCommandImpl.h src/dnacalib/commands/ClearBlendShapesCommand.cpp src/dnacalib/commands/CommandSequence.cpp src/dnacalib/commands/PruneBlendShapeTargetsCommand.cpp diff --git a/dnacalib/DNACalib/include/dna/types/ArrayView.h b/dnacalib/DNACalib/include/dna/types/ArrayView.h index a6e8748..4d163e6 100644 --- a/dnacalib/DNACalib/include/dna/types/ArrayView.h +++ b/dnacalib/DNACalib/include/dna/types/ArrayView.h @@ -41,12 +41,19 @@ struct ArrayViewTraits { using difference_type = std::ptrdiff_t; }; +template +struct IsCompatible { + static constexpr bool value = std::is_same::type, typename std::remove_cv::type>::value && + (std::is_const::type>::value || + !std::is_const::type>::value); +}; + /** @brief A view over a continuous sequence of objects. @tparam T element type Provides a view over a continuous sequence of objects owned by some other object. Contains a count of elements and a pointer to a location where they are stored. - ArrayView does not own the mmemory it points to - it does not perform any allocation + ArrayView does not own the memory it points to - it does not perform any allocation and deallocation. It can be constructed given a pointer and element count, or a container type argument. The class provides helper methods for creating subviews over the objects, and methods for by-value comparison with containers. ConstArrayView represents an immutable view. @@ -76,23 +83,23 @@ class ArrayView { sz{size} { } - ArrayView(std::nullptr_t /*unused*/, size_type /*unused*/) : ArrayView{nullptr, {}} { - } - - template + template::value, int>::type = 0> ArrayView(ArrayView& src) : ArrayView{src.data(), src.size()} { } - template + template::value, int>::type = 0> ArrayView(const ArrayView& src) : ArrayView{src.data(), src.size()} { } - template + template::value, int>::type = 0> ArrayView(ArrayView&& src) : ArrayView{src.data(), src.size()} { } - template::value, int>::type = 0> - explicit ArrayView(U&& src) : ArrayView{src.data(), src.size()} { + template::value && + IsCompatible::type::value_type>::value, + int>::type = 0> + ArrayView(U&& src) : ArrayView{src.data(), static_cast(src.size())} { } size_type size() const { @@ -193,7 +200,8 @@ bool operator!=(const ArrayView& lhs, const ArrayView& rhs) { } template -bool operator==(const ArrayView& lhs, const TContainer& rhs) { +typename std::enable_if, TContainer>::value, bool>::type operator==(const ArrayView& lhs, + const TContainer& rhs) { if (lhs.size() != rhs.size()) { return false; } @@ -207,17 +215,20 @@ bool operator==(const ArrayView& lhs, const TContainer& rhs) { } template -bool operator!=(const ArrayView& lhs, const TContainer& rhs) { +typename std::enable_if, TContainer>::value, bool>::type operator!=(const ArrayView& lhs, + const TContainer& rhs) { return !(lhs == rhs); } template -bool operator==(const TContainer& lhs, const ArrayView& rhs) { +typename std::enable_if, TContainer>::value, bool>::type operator==(const TContainer& lhs, + const ArrayView& rhs) { return (rhs == lhs); } template -bool operator!=(const TContainer& lhs, const ArrayView& rhs) { +typename std::enable_if, TContainer>::value, bool>::type operator!=(const TContainer& lhs, + const ArrayView& rhs) { return !(lhs == rhs); } diff --git a/dnacalib/DNACalib/include/dna/types/StringView.h b/dnacalib/DNACalib/include/dna/types/StringView.h index 653a0e6..c573dc5 100644 --- a/dnacalib/DNACalib/include/dna/types/StringView.h +++ b/dnacalib/DNACalib/include/dna/types/StringView.h @@ -32,12 +32,4 @@ class StringView : public trust::ConstArrayView { }; -inline bool operator==(const StringView& lhs, const StringView& rhs) { - return (static_cast(lhs) == static_cast(rhs)); -} - -inline bool operator!=(const StringView& lhs, const StringView& rhs) { - return !(lhs == rhs); -} - } // namespace dna diff --git a/dnacalib/DNACalib/src/dna/filters/JointFilter.cpp b/dnacalib/DNACalib/src/dna/filters/JointFilter.cpp index 8316acd..f2a2bcc 100644 --- a/dnacalib/DNACalib/src/dna/filters/JointFilter.cpp +++ b/dnacalib/DNACalib/src/dna/filters/JointFilter.cpp @@ -70,7 +70,7 @@ void JointFilter::apply(RawBehavior& dest) { } } // Collect row indices of removed output indices to be used for joint delta removal - Set rowsToDelete{memRes}; + UnorderedSet rowsToDelete{memRes}; // Remove output indices belonging to the deletable joint extd::filter(jointGroup.outputIndices, [this, &rowsToDelete](std::uint16_t outputIndex, std::size_t rowIndex) { const auto jointIndex = static_cast(outputIndex / jointAttributeCount); diff --git a/dnacalib/DNACalib/src/dnacalib/commands/CalculateMeshLowerLODsCommand.cpp b/dnacalib/DNACalib/src/dnacalib/commands/CalculateMeshLowerLODsCommand.cpp index 1c81585..52b7ef4 100644 --- a/dnacalib/DNACalib/src/dnacalib/commands/CalculateMeshLowerLODsCommand.cpp +++ b/dnacalib/DNACalib/src/dnacalib/commands/CalculateMeshLowerLODsCommand.cpp @@ -3,11 +3,26 @@ #include "dnacalib/commands/CalculateMeshLowerLODsCommand.h" #include "dnacalib/CommandImplBase.h" +#include "dnacalib/commands/CalculateMeshLowerLODsCommandImpl.h" #include "dnacalib/dna/DNA.h" #include "dnacalib/dna/DNACalibDNAReaderImpl.h" #include "dnacalib/types/Aliases.h" #include "dnacalib/types/UVBarycentricMapping.h" +#ifdef _MSC_VER + #pragma warning(push) + #pragma warning(disable : 4365 4987) +#endif +#include +#include +#include +#include +#include +#ifdef _MSC_VER + #pragma warning(pop) +#endif + + namespace dnac { class CalculateMeshLowerLODsCommand::Impl : public CommandImplBase { @@ -25,7 +40,16 @@ class CalculateMeshLowerLODsCommand::Impl : public CommandImplBase { } void run(DNACalibDNAReaderImpl* output) { - UVBarycentricMapping mapping{output, meshIndex, getMemoryResource()}; + auto faceGetter = std::bind(&dna::Reader::getFaceVertexLayoutIndices, output, meshIndex, std::placeholders::_1); + const auto layoutPositions = output->getVertexLayoutPositionIndices(meshIndex); + const auto layoutTexCoords = output->getVertexLayoutTextureCoordinateIndices(meshIndex); + const auto origMappingUs = output->getVertexTextureCoordinateUs(meshIndex); + const auto mappingVs = output->getVertexTextureCoordinateVs(meshIndex); + const auto mappingUs = deduplicateTextureCoordinates(origMappingUs, mappingVs); + const auto faceCount = output->getFaceCount(meshIndex); + + UVBarycentricMapping mapping{faceGetter, layoutPositions, layoutTexCoords, mappingUs, mappingVs, faceCount, + getMemoryResource()}; auto srcMeshXs = output->getVertexPositionXs(meshIndex); auto srcMeshYs = output->getVertexPositionYs(meshIndex); @@ -36,51 +60,83 @@ class CalculateMeshLowerLODsCommand::Impl : public CommandImplBase { }; for (std::uint16_t mi : findIndicesOfMeshLowerLODs(output)) { - auto vertexLayoutPositionIndices = output->getVertexLayoutPositionIndices(mi); - auto vertexLayoutTextureCoordinateIndices = output->getVertexLayoutTextureCoordinateIndices(mi); - auto us = output->getVertexTextureCoordinateUs(mi); - auto vs = output->getVertexTextureCoordinateVs(mi); + const auto vertexLayoutPositionIndices = output->getVertexLayoutPositionIndices(mi); + const auto vertexLayoutTextureCoordinateIndices = output->getVertexLayoutTextureCoordinateIndices(mi); + const auto vs = output->getVertexTextureCoordinateVs(mi); + const auto us = deduplicateTextureCoordinates(output->getVertexTextureCoordinateUs(mi), vs); const std::uint32_t positionCount = output->getVertexPositionCount(mi); RawVector3Vector destVertexPositions {positionCount, {}, getMemoryResource()}; // As there can be multiple VertexLayout per each VertexPosition we will use arithmetic mean value. - Vector vertexLayoutsPerPosition{positionCount, {}, getMemoryResource()}; + Vector vertexLayoutsPerPosition{positionCount, {}, getMemoryResource()}; - for (std::size_t i = 0u; i < vertexLayoutPositionIndices.size(); ++i) { - const std::uint32_t uvIndex = vertexLayoutTextureCoordinateIndices[i]; + for (std::uint32_t vli = 0u; vli < vertexLayoutPositionIndices.size(); ++vli) { + std::uint32_t uvIndex = vertexLayoutTextureCoordinateIndices[vli]; const fvec2 uvs = {us[uvIndex], vs[uvIndex]}; const auto weightsIndicesPair = mapping.getBarycentric(uvs); - const fvec3& barycentric = std::get<0>(weightsIndicesPair); + fvec3 barycentric = std::get<0>(weightsIndicesPair); auto srcVtxIndices = std::get<1>(weightsIndicesPair); if (srcVtxIndices.size() == 0) { - // We'll need to handle this case in the future? - assert(false && "Could not map a vertex, did not hit any triangle's bounding box."); - continue; + // We didn't hit any triangle. We aim to identify the nearest face to this UV, ensuring + // that the selected face has an intersection with at least one of the adjacent faces of the vertex we are + // projecting. + float minDistance = std::numeric_limits::max(); + std::uint32_t sourceTriangleIndex = std::numeric_limits::max(); + // First we find all of the faces that are adjacent to this vertex + for (std::uint32_t fi = 0u; fi < output->getFaceCount(mi); fi++) { + const auto face = output->getFaceVertexLayoutIndices(mi, fi); + if (std::find(face.begin(), face.end(), vli) == face.end()) { + continue; + } + + // Gather all vertex UVs from this face and create a bounding box from it + Vector UVs{getMemoryResource()}; + for (const auto vertexLayoutIndex : face) { + uvIndex = vertexLayoutTextureCoordinateIndices[vertexLayoutIndex]; + UVs.emplace_back(us[uvIndex], vs[uvIndex]); + } + const BoundingBox faceBoundingBox{UVs}; + + // Find the closest triangle that has intersection with this face + auto bBoxes = mapping.getBoundingBoxes(); + for (std::uint32_t bi = 0u; bi < bBoxes.size(); bi++) { + const auto& bBox = bBoxes[bi]; + if (bBox.overlaps(faceBoundingBox)) { + const float distance = bBox.distance(uvs); + if (distance < minDistance) { + minDistance = distance; + sourceTriangleIndex = bi; + } + } + } + } + + if (sourceTriangleIndex != std::numeric_limits::max()) { + barycentric = mapping.getTriangle(sourceTriangleIndex).getBarycentricCoords(uvs); + srcVtxIndices = mapping.getTrianglePositionIndices(sourceTriangleIndex); + } else { + assert(false && "Could not map a vertex. It is not within a face of higher lod."); + continue; + } } const fvec3 src = getSrcVertex(srcVtxIndices[0]) * barycentric[0] + getSrcVertex(srcVtxIndices[1]) * barycentric[1] + getSrcVertex(srcVtxIndices[2]) * barycentric[2]; - const uint32_t positionIndex = vertexLayoutPositionIndices[i]; + const uint32_t positionIndex = vertexLayoutPositionIndices[vli]; float& destX = destVertexPositions.xs[positionIndex]; float& destY = destVertexPositions.ys[positionIndex]; float& destZ = destVertexPositions.zs[positionIndex]; const auto vtxLayoutCount = ++vertexLayoutsPerPosition[positionIndex]; + // We require mean average, more than one vertexLayout for this vertex position + const auto lastDenominator = static_cast(vtxLayoutCount - 1u); + const auto newDenominator = static_cast(vtxLayoutCount); + destX = (destX * lastDenominator + src[0]) / newDenominator; + destY = (destY * lastDenominator + src[1]) / newDenominator; + destZ = (destZ * lastDenominator + src[2]) / newDenominator; - if (vtxLayoutCount == 1) { - destX = src[0]; - destY = src[1]; - destZ = src[2]; - } else { - // We require mean average, more than one vertexLayout for this vertex position - const auto lastDenominator = static_cast(vtxLayoutCount - 1u); - const auto newDenominator = static_cast(vtxLayoutCount); - destX = (destX * lastDenominator + src[0]) / newDenominator; - destY = (destY * lastDenominator + src[1]) / newDenominator; - destZ = (destZ * lastDenominator + src[2]) / newDenominator; - } } output->setVertexPositions(mi, std::move(destVertexPositions)); } @@ -113,12 +169,23 @@ class CalculateMeshLowerLODsCommand::Impl : public CommandImplBase { } } } else { - isLowerLOD = std::find(lodMeshIndices.begin(), lodMeshIndices.end(), meshIndex) != lodMeshIndices.end(); + isLowerLOD = + std::find(lodMeshIndices.begin(), lodMeshIndices.end(), meshIndex) != lodMeshIndices.end(); } } return lowerLODIndices; } + Vector deduplicateTextureCoordinates(ConstArrayView us, ConstArrayView vs) { + Vector usCopy{us.begin(), us.end(), getMemoryResource()}; + if (isUVMapOverlapping(us, vs)) { + // The offset function will not modify those given arrays for which the specified offset is 0.0 + // So const_cast-ing here is just to satisfy the compiler, not for modifying the data sneakily. + offsetOverlappingUVMapRegion(usCopy, {const_cast(vs.data()), vs.size()}, 1.0f, 0.0f); + } + return usCopy; + } + private: std::uint16_t meshIndex; }; diff --git a/dnacalib/DNACalib/src/dnacalib/commands/CalculateMeshLowerLODsCommandImpl.cpp b/dnacalib/DNACalib/src/dnacalib/commands/CalculateMeshLowerLODsCommandImpl.cpp new file mode 100644 index 0000000..8b3c359 --- /dev/null +++ b/dnacalib/DNACalib/src/dnacalib/commands/CalculateMeshLowerLODsCommandImpl.cpp @@ -0,0 +1,62 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#include "dnacalib/commands/CalculateMeshLowerLODsCommandImpl.h" + +#include +#include +#include + +namespace dnac { + +inline bool near(float a, float b, float threshold) { + return std::fabs(a - b) < threshold; +} + +bool isUVMapOverlapping(ConstArrayView us, + ConstArrayView vs, + std::size_t overlapCountThreshold, + float uvCompareThreshold) { + // Quick heuristic to check if the UV is really mirrored into the upper half of the array, + // if first N matches, it will be considered a total match and deduplication should proceed + assert(us.size() == vs.size()); + + if ((us.size() % 2ul) != 0ul) { + return false; + } + + const std::size_t half = (us.size() / 2ul); + for (std::size_t i = {}; i < std::min(half, overlapCountThreshold); ++i) { + bool found = false; + for (std::size_t j = half; j < us.size(); ++j) { + if (near(us[i], us[j], uvCompareThreshold) && near(vs[i], vs[j], uvCompareThreshold)) { + found = true; + break; + } + } + if (!found) { + return false; + } + } + return true; +} + +void offsetOverlappingUVMapRegion(ArrayView us, ArrayView vs, float uOffset, float vOffset, + float uvCompareThreshold) { + assert(us.size() == vs.size()); + const std::size_t half = (us.size() / 2ul); + for (std::size_t i = {}; i < half; ++i) { + for (std::size_t j = half; j < us.size(); ++j) { + if (near(us[i], us[j], uvCompareThreshold) && near(vs[i], vs[j], uvCompareThreshold)) { + if (uOffset != 0.0f) { + us[i] += uOffset; + } + if (vOffset != 0.0f) { + vs[i] += vOffset; + } + break; + } + } + } +} + +} // namespace dnac diff --git a/dnacalib/DNACalib/src/dnacalib/commands/CalculateMeshLowerLODsCommandImpl.h b/dnacalib/DNACalib/src/dnacalib/commands/CalculateMeshLowerLODsCommandImpl.h new file mode 100644 index 0000000..a0ecec0 --- /dev/null +++ b/dnacalib/DNACalib/src/dnacalib/commands/CalculateMeshLowerLODsCommandImpl.h @@ -0,0 +1,19 @@ +// Copyright Epic Games, Inc. All Rights Reserved. + +#pragma once + +#include "dnacalib/types/Aliases.h" + +namespace dnac { + +bool isUVMapOverlapping(ConstArrayView us, + ConstArrayView vs, + std::size_t overlapCountThreshold = 10ul, + float uvCompareThreshold = 0.0002f); +void offsetOverlappingUVMapRegion(ArrayView us, + ArrayView vs, + float uOffset = 1.0f, + float vOffset = 0.0f, + float uvCompareThreshold = 0.0002f); + +} // namespace dnac diff --git a/dnacalib/DNACalib/src/dnacalib/dna/filters/JointFilter.cpp b/dnacalib/DNACalib/src/dnacalib/dna/filters/JointFilter.cpp index ea34afd..e9f7cd8 100644 --- a/dnacalib/DNACalib/src/dnacalib/dna/filters/JointFilter.cpp +++ b/dnacalib/DNACalib/src/dnacalib/dna/filters/JointFilter.cpp @@ -70,7 +70,7 @@ void JointFilter::apply(RawBehavior& dest) { } } // Collect row indices of removed output indices to be used for joint delta removal - Set rowsToDelete{memRes}; + UnorderedSet rowsToDelete{memRes}; // Remove output indices belonging to the deletable joint extd::filter(jointGroup.outputIndices, [this, &rowsToDelete](std::uint16_t outputIndex, std::size_t rowIndex) { const auto jointIndex = static_cast(outputIndex / jointAttributeCount); diff --git a/dnacalib/DNACalib/src/dnacalib/types/BoundingBox.h b/dnacalib/DNACalib/src/dnacalib/types/BoundingBox.h index e816f20..051524a 100644 --- a/dnacalib/DNACalib/src/dnacalib/types/BoundingBox.h +++ b/dnacalib/DNACalib/src/dnacalib/types/BoundingBox.h @@ -53,6 +53,11 @@ class BoundingBox { return std::sqrt(dx * dx + dy * dy); } + bool overlaps(const BoundingBox& other) const { + return (max[0] >= other.min[0] && other.max[0] >= min[0]) && + (max[1] >= other.min[1] && other.max[1] >= min[1]); + } + fvec2 getMin() const { return min; } diff --git a/dnacalib/DNACalib/src/dnacalib/types/UVBarycentricMapping.cpp b/dnacalib/DNACalib/src/dnacalib/types/UVBarycentricMapping.cpp index feb5822..ceb2518 100644 --- a/dnacalib/DNACalib/src/dnacalib/types/UVBarycentricMapping.cpp +++ b/dnacalib/DNACalib/src/dnacalib/types/UVBarycentricMapping.cpp @@ -4,42 +4,6 @@ namespace dnac { -namespace { - -tdm::vec3 findTriangleWithLargestArea(ConstArrayView face, - ConstArrayView textureCoordinateUVIndices, - ConstArrayView Us, - ConstArrayView Vs) { - float maxArea = 0.0f; - tdm::vec3 maxTriangle = {0u, 1u, static_cast(face.size() - 1u)}; - for (std::size_t ai = {}; ai < face.size(); ++ai) { - const std::uint32_t avli = face[ai]; - const std::uint32_t auvi = textureCoordinateUVIndices[avli]; - const float au = Us[auvi]; - const float av = Vs[auvi]; - for (std::size_t bi = (ai + 1ul); bi < face.size(); ++bi) { - const std::uint32_t bvli = face[bi]; - const std::uint32_t buvi = textureCoordinateUVIndices[bvli]; - const float bu = Us[buvi]; - const float bv = Vs[buvi]; - for (std::size_t ci = (bi + 1ul); ci < face.size(); ++ci) { - const std::uint32_t cvli = face[ci]; - const std::uint32_t cuvi = textureCoordinateUVIndices[cvli]; - const float cu = Us[cuvi]; - const float cv = Vs[cuvi]; - const float area = std::fabs(0.5f * (au * (bv - cv) + bu * (cv - av) + cu * (av - bv))); - if (area > maxArea) { - maxArea = area; - maxTriangle = {avli, bvli, cvli}; - } - } - } - } - return maxTriangle; -} - -} // namespace - UVBarycentricMapping::UVBarycentricMapping(const std::function(std::uint32_t)>& faceGetter, ConstArrayView vertexPositionIndices, ConstArrayView textureCoordinateUVIndices, @@ -48,76 +12,74 @@ UVBarycentricMapping::UVBarycentricMapping(const std::function(static_cast(faceCount) * 2.5f); triangles.reserve(estimatedTriangleCount); - bBoxes.reserve(estimatedTriangleCount); - for (std::uint32_t i = 0u; i < faceCount; i++) { - auto face = faceGetter(i); - while (face.size() > 2) { - const auto maxTriangle = findTriangleWithLargestArea(face, textureCoordinateUVIndices, Us, Vs); - const auto vertexLayoutIndex0 = maxTriangle[0]; - const auto vertexLayoutIndex1 = maxTriangle[1]; - const auto vertexLayoutIndex2 = maxTriangle[2]; + boundingBoxes.reserve(estimatedTriangleCount); + trianglePositionIndices.reserve(estimatedTriangleCount); - const std::array positionIndices {vertexPositionIndices[vertexLayoutIndex0], - vertexPositionIndices[vertexLayoutIndex1], - vertexPositionIndices[vertexLayoutIndex2]}; + for (std::uint32_t fi = 0u; fi < faceCount; fi++) { + auto face = faceGetter(fi); + if (face.size() > 2) { + const auto n = face.size(); + for (std::uint32_t i = 0; i < n - 2; ++i) { + for (std::uint32_t j = i + 1; j < n - 1; ++j) { + for (std::uint32_t k = j + 1; k < n; ++k) { + const auto vli0 = face[i]; + const auto vli1 = face[j]; + const auto vli2 = face[k]; + const std::array positionIndices {vertexPositionIndices[vli0], + vertexPositionIndices[vli1], + vertexPositionIndices[vli2]}; + const auto uvIndex0 = textureCoordinateUVIndices[vli0]; + const auto uvIndex1 = textureCoordinateUVIndices[vli1]; + const auto uvIndex2 = textureCoordinateUVIndices[vli2]; - const auto uvIndex0 = textureCoordinateUVIndices[vertexLayoutIndex0]; - const auto uvIndex1 = textureCoordinateUVIndices[vertexLayoutIndex1]; - const auto uvIndex2 = textureCoordinateUVIndices[vertexLayoutIndex2]; - - const std::array UVs = {fvec2{Us[uvIndex0], Vs[uvIndex0]}, - fvec2{Us[uvIndex1], Vs[uvIndex1]}, - fvec2{Us[uvIndex2], Vs[uvIndex2]}}; - - triangles.emplace_back(Triangle{UVs}, positionIndices); - bBoxes.emplace_back(BoundingBox{UVs}); - face = face.last(face.size() - 1u); + const std::array UVs = {fvec2{Us[uvIndex0], Vs[uvIndex0]}, + fvec2{Us[uvIndex1], Vs[uvIndex1]}, + fvec2{Us[uvIndex2], Vs[uvIndex2]}}; + triangles.emplace_back(UVs); + boundingBoxes.emplace_back(UVs); + trianglePositionIndices.emplace_back(positionIndices); + } + } + } } } triangles.shrink_to_fit(); - bBoxes.shrink_to_fit(); -} - -UVBarycentricMapping::UVBarycentricMapping(const dna::Reader* reader, std::uint16_t meshIndex, MemoryResource* memRes) : - UVBarycentricMapping(std::bind(&dna::Reader::getFaceVertexLayoutIndices, reader, meshIndex, std::placeholders::_1), - reader->getVertexLayoutPositionIndices(meshIndex), - reader->getVertexLayoutTextureCoordinateIndices(meshIndex), - reader->getVertexTextureCoordinateUs(meshIndex), - reader->getVertexTextureCoordinateVs(meshIndex), - reader->getFaceCount(meshIndex), - memRes) { - -} - -ConstArrayView UVBarycentricMapping::getTriangles() const { - return {triangles.data(), triangles.size()}; -} - -ConstArrayView UVBarycentricMapping::getBoundingBoxes() const { - return {bBoxes.data(), bBoxes.size()}; + boundingBoxes.shrink_to_fit(); + trianglePositionIndices.shrink_to_fit(); } UVBarycentricMapping::BarycentricPositionIndicesPair UVBarycentricMapping::getBarycentric(fvec2 uv) const { - BarycentricPositionIndicesPair barycentricPositionsPair; - auto it = std::min_element(bBoxes.begin(), bBoxes.end(), [uv](const BoundingBox& a, const BoundingBox& b) { - return a.distance(uv) < b.distance(uv); - }); - if (it != bBoxes.end()) { - const auto i = static_cast(std::distance(bBoxes.begin(), it)); - const auto barycentricWeights = std::get<0>(triangles[i]).getBarycentricCoords(uv); - // If we don't hit any triangle, we will use one whose bounding box we hit - barycentricPositionsPair = BarycentricPositionIndicesPair(barycentricWeights, ConstArrayView{std::get<1>(triangles[i])}); - if ((barycentricWeights[0] >= 0.0f) && (barycentricWeights[0] <= 1.0f) && - (barycentricWeights[1] >= 0.0f) && (barycentricWeights[1] <= 1.0f) && - (barycentricWeights[2] >= 0.0f) && (barycentricWeights[2] <= 1.0f)) { - return barycentricPositionsPair; + const auto isPointInsideTriangle = [](const fvec3& barycentricPoint) { + return barycentricPoint[0] > 0.0f && barycentricPoint[1] > 0.0f && barycentricPoint[2] > 0.0f; + }; + for (std::uint32_t i = 0; i < triangles.size(); i++) { + const auto& triangle = triangles[i]; + // we check if point is inside triangle (all barycentric coordinates are positive) + if (boundingBoxes[i].contains(uv)) { + const auto barycentricPoint = triangle.getBarycentricCoords(uv); + if (isPointInsideTriangle(barycentricPoint)) { + return BarycentricPositionIndicesPair{barycentricPoint, + ConstArrayView{trianglePositionIndices[i]}}; + } } } - return barycentricPositionsPair; + return {}; +} + +const Triangle& UVBarycentricMapping::getTriangle(std::uint32_t index) const { + return triangles[index]; +} + +ConstArrayView UVBarycentricMapping::getTrianglePositionIndices(std::uint32_t index) const { + return trianglePositionIndices[index]; +} + +ConstArrayView UVBarycentricMapping::getBoundingBoxes() const { + return boundingBoxes; } } // namespace dnac diff --git a/dnacalib/DNACalib/src/dnacalib/types/UVBarycentricMapping.h b/dnacalib/DNACalib/src/dnacalib/types/UVBarycentricMapping.h index 9d886eb..71b3fda 100644 --- a/dnacalib/DNACalib/src/dnacalib/types/UVBarycentricMapping.h +++ b/dnacalib/DNACalib/src/dnacalib/types/UVBarycentricMapping.h @@ -3,12 +3,11 @@ #pragma once #include "dnacalib/types/Aliases.h" -#include "dnacalib/types/Triangle.h" #include "dnacalib/types/BoundingBox.h" +#include "dnacalib/types/Triangle.h" namespace dnac { - class UVBarycentricMapping { public: using TrianglePositionIndicesPair = std::tuple >; @@ -23,16 +22,15 @@ class UVBarycentricMapping { std::uint32_t faceCount, MemoryResource* memRes); - explicit UVBarycentricMapping(const dna::Reader* reader, std::uint16_t meshIndex, MemoryResource* memRes); - - ConstArrayView getTriangles() const; + BarycentricPositionIndicesPair getBarycentric(fvec2 uv) const; + const Triangle& getTriangle(std::uint32_t index) const; + ConstArrayView getTrianglePositionIndices(std::uint32_t index) const; ConstArrayView getBoundingBoxes() const; - BarycentricPositionIndicesPair getBarycentric(fvec2 uv) const; - private: - Vector triangles; - Vector bBoxes; + Vector triangles; + Vector boundingBoxes; + Vector > trianglePositionIndices; }; } // namespace dnac diff --git a/dnacalib/PyDNA/python3/CMakeLists.txt b/dnacalib/PyDNA/python3/CMakeLists.txt index 589fee4..3736e0f 100644 --- a/dnacalib/PyDNA/python3/CMakeLists.txt +++ b/dnacalib/PyDNA/python3/CMakeLists.txt @@ -2,13 +2,15 @@ set(PYTHON3_EXACT_VERSION "" CACHE STRING "Specify exact python3 version against if(PYTHON3_EXACT_VERSION) set(find_python3_extra_args ${PYTHON3_EXACT_VERSION} EXACT) endif() -find_package(Python3 ${find_python3_extra_args} COMPONENTS Development) +find_package(Python3 ${find_python3_extra_args} COMPONENTS Development Interpreter) +set(py_version "py${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}") +set(output_dir "${py_version}") set_property(SOURCE DNA.i PROPERTY CPLUSPLUS ON) set_property(SOURCE DNA.i PROPERTY SWIG_MODULE_NAME dna) +set_property(SOURCE DNA.i PROPERTY SWIG_FLAGS "-doxygen") option(TYPEMAP_DEBUG "Debug deducing of typemaps" OFF) - if(TYPEMAP_DEBUG) set_property(SOURCE DNA.i PROPERTY SWIG_FLAGS "-debug-tmsearch") endif() @@ -19,12 +21,17 @@ swig_add_library(py3dna LANGUAGE python OUTPUT_DIR - ${CMAKE_BINARY_DIR}/py3bin + ${CMAKE_BINARY_DIR}/${output_dir} + OUTFILE_DIR + ${CMAKE_BINARY_DIR}/python3 SOURCES DNA.i) +add_library(PyDNA::py3dna ALIAS py3dna) -set_property(TARGET py3dna PROPERTY SWIG_USE_TARGET_INCLUDE_DIRECTORIES ON) - +set_target_properties(py3dna PROPERTIES + SWIG_USE_TARGET_INCLUDE_DIRECTORIES ON + SWIG_COMPILE_DEFINITIONS DNA_BUILD_WITH_JSON_SUPPORT=ON) +target_compile_definitions(py3dna PRIVATE DNA_BUILD_WITH_JSON_SUPPORT=ON) target_include_directories(py3dna PUBLIC ${CMAKE_CURRENT_LIST_DIR}) target_link_libraries(py3dna PUBLIC @@ -33,14 +40,31 @@ target_link_libraries(py3dna PRIVATE Python3::Python) -add_custom_target(py3dna-distribution ALL - DEPENDS - py3dna - COMMAND - ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/py3bin - COMMAND - ${CMAKE_COMMAND} -E copy $ ${CMAKE_BINARY_DIR}/py3bin - COMMAND - ${CMAKE_COMMAND} -E copy $ ${CMAKE_BINARY_DIR}/py3bin - COMMAND - ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/examples/demo.py ${CMAKE_BINARY_DIR}/py3bin/dna_demo.py) +set(component_name "${PROJECT_NAME}-${py_version}") +get_property(wrapper_files TARGET py3dna PROPERTY SWIG_SUPPORT_FILES) +install(FILES ${wrapper_files} DESTINATION ${output_dir} COMPONENT ${component_name}) +install(TARGETS py3dna + RUNTIME + DESTINATION ${output_dir} + COMPONENT ${component_name} + LIBRARY + DESTINATION ${output_dir} + COMPONENT ${component_name} + NAMELINK_COMPONENT ${component_name} + ARCHIVE + DESTINATION ${output_dir} + COMPONENT ${component_name}) +install(FILES ${CMAKE_CURRENT_LIST_DIR}/examples/demo.py DESTINATION ${output_dir} RENAME dna_demo.py COMPONENT ${component_name}) + +set(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL};${component_name}" PARENT_SCOPE) + +if(WIN32) + set(extra_env "PATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") +endif() +set(DNA_TEST_NAMES dna_binary_to_json_demo dna_demo) +foreach(test_name ${DNA_TEST_NAMES}) + add_test(NAME ${test_name} + COMMAND ${CMAKE_COMMAND} -E env ${extra_env} LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} PYTHONPATH=. ${Python3_EXECUTABLE} "${CMAKE_CURRENT_LIST_DIR}/../../../examples/${test_name}.py" + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${output_dir}) + set_property(TEST ${test_name} PROPERTY PASS_REGULAR_EXPRESSION "Done\.") +endforeach() diff --git a/dnacalib/PyDNA/python3/DNA.i b/dnacalib/PyDNA/python3/DNA.i index 633d949..8842ae1 100644 --- a/dnacalib/PyDNA/python3/DNA.i +++ b/dnacalib/PyDNA/python3/DNA.i @@ -1,5 +1,17 @@ %module dna +%pythonbegin +%{ +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass +%} + %{ #include #include diff --git a/dnacalib/PyDNACalib/python3/CMakeLists.txt b/dnacalib/PyDNACalib/python3/CMakeLists.txt index f68618a..da41b3b 100644 --- a/dnacalib/PyDNACalib/python3/CMakeLists.txt +++ b/dnacalib/PyDNACalib/python3/CMakeLists.txt @@ -2,13 +2,15 @@ set(PYTHON3_EXACT_VERSION "" CACHE STRING "Specify exact python3 version against if(PYTHON3_EXACT_VERSION) set(find_python3_extra_args ${PYTHON3_EXACT_VERSION} EXACT) endif() -find_package(Python3 ${find_python3_extra_args} COMPONENTS Development) +find_package(Python3 ${find_python3_extra_args} COMPONENTS Development Interpreter) +set(py_version "py${Python3_VERSION_MAJOR}.${Python3_VERSION_MINOR}") +set(output_dir "${py_version}") set_property(SOURCE DNACalib.i PROPERTY CPLUSPLUS ON) set_property(SOURCE DNACalib.i PROPERTY SWIG_MODULE_NAME dnacalib) +set_property(SOURCE DNACalib.i PROPERTY SWIG_FLAGS "-doxygen") option(TYPEMAP_DEBUG "Debug deducing of typemaps" OFF) - if(TYPEMAP_DEBUG) set_property(SOURCE DNACalib.i PROPERTY SWIG_FLAGS "-debug-tmsearch") endif() @@ -19,32 +21,53 @@ swig_add_library(py3dnacalib LANGUAGE python OUTPUT_DIR - ${CMAKE_BINARY_DIR}/py3bin + ${CMAKE_BINARY_DIR}/${output_dir} + OUTFILE_DIR + ${CMAKE_BINARY_DIR}/python3 SOURCES DNACalib.i) +add_library(PyDNACalib::py3dnacalib ALIAS py3dnacalib) -set_property(TARGET py3dnacalib PROPERTY SWIG_USE_TARGET_INCLUDE_DIRECTORIES ON) - +set_target_properties(py3dnacalib PROPERTIES SWIG_USE_TARGET_INCLUDE_DIRECTORIES ON) target_link_libraries(py3dnacalib PUBLIC - py3dna + PyDNA::py3dna PRIVATE Spyus::spyus DNACalib::dnacalib Python3::Python) -add_custom_target(py3dnacalib-distribution ALL - DEPENDS - py3dnacalib - COMMAND - ${CMAKE_COMMAND} -E make_directory ${CMAKE_BINARY_DIR}/py3bin - COMMAND - ${CMAKE_COMMAND} -E copy $ ${CMAKE_BINARY_DIR}/py3bin - COMMAND - ${CMAKE_COMMAND} -E copy $ ${CMAKE_BINARY_DIR}/py3bin - COMMAND - ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/examples/demo.py ${CMAKE_BINARY_DIR}/py3bin/dnacalib_demo.py - COMMAND - ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/examples/remove_joint.py ${CMAKE_BINARY_DIR}/py3bin/dnacalib_remove_joint.py - COMMAND - ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_LIST_DIR}/examples/clear_blend_shapes.py ${CMAKE_BINARY_DIR}/py3bin/dnacalib_clear_blend_shapes.py) +set(component_name "${PROJECT_NAME}-${py_version}") +get_property(wrapper_files TARGET py3dnacalib PROPERTY SWIG_SUPPORT_FILES) +install(FILES ${wrapper_files} DESTINATION ${output_dir} COMPONENT ${component_name}) +install(TARGETS py3dnacalib + RUNTIME + DESTINATION ${output_dir} + COMPONENT ${component_name} + LIBRARY + DESTINATION ${output_dir} + COMPONENT ${component_name} + NAMELINK_COMPONENT ${component_name} + ARCHIVE + DESTINATION ${output_dir} + COMPONENT ${component_name}) +install(FILES ${CMAKE_CURRENT_LIST_DIR}/examples/clear_blend_shapes.py DESTINATION ${output_dir}/examples RENAME dnacalib_clear_blend_shapes.py COMPONENT ${component_name}) +install(FILES ${CMAKE_CURRENT_LIST_DIR}/examples/demo.py DESTINATION ${output_dir}/examples RENAME dnacalib_demo.py COMPONENT ${component_name}) +install(FILES ${CMAKE_CURRENT_LIST_DIR}/examples/remove_joint.py DESTINATION ${output_dir}/examples RENAME dnacalib_remove_joint.py COMPONENT ${component_name}) +set(CPACK_COMPONENTS_ALL "${CPACK_COMPONENTS_ALL};${component_name}" PARENT_SCOPE) + +if(WIN32) + set(extra_env "PATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR}") +endif() +set(DNACALIB_TEST_NAMES dnacalib_clear_blend_shapes + dnacalib_demo + dnacalib_lod_demo + dnacalib_neutral_mesh_subtract + dnacalib_remove_joint + dnacalib_rename_joint_demo) +foreach(test_name ${DNACALIB_TEST_NAMES}) + add_test(NAME ${test_name} + COMMAND ${CMAKE_COMMAND} -E env ${extra_env} LD_LIBRARY_PATH=${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR} PYTHONPATH=. ${Python3_EXECUTABLE} "${CMAKE_CURRENT_LIST_DIR}/../../../examples/${test_name}.py" + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/${output_dir}) + set_property(TEST ${test_name} PROPERTY PASS_REGULAR_EXPRESSION "Done\.") +endforeach() diff --git a/dnacalib/PyDNACalib/python3/DNACalib.i b/dnacalib/PyDNACalib/python3/DNACalib.i index 705f404..9151989 100644 --- a/dnacalib/PyDNACalib/python3/DNACalib.i +++ b/dnacalib/PyDNACalib/python3/DNACalib.i @@ -1,5 +1,17 @@ %module dnacalib +%pythonbegin +%{ +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass +%} + %include %include diff --git a/dnacalib/SPyUS/include/spyus/Caster.i b/dnacalib/SPyUS/include/spyus/Caster.i index adc3cbe..6c80ad2 100644 --- a/dnacalib/SPyUS/include/spyus/Caster.i +++ b/dnacalib/SPyUS/include/spyus/Caster.i @@ -171,28 +171,59 @@ class name(object): %enddef %pythoncode %{ -def __new_decorator(factory_func, original_new): - @staticmethod - def __new(cls, *args, **kwargs): - # FIXME: while this workaround solves the immediate issue with the set of classes we currently have, - # it will fail for classes that use a factory function but need no parameters at all, in which case - # the factory function will never be invoked, only the original __new__ function. - if args or kwargs: - return factory_func(*args, **kwargs) - return original_new(cls) - return __new +def with_metaclass(meta, *bases): + class metaclass(type): -def __managed_init(self, *args, **kwargs): - self._args = args - self._kwargs = kwargs + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) %} -%define pythonize_unmanaged_type(type, creator, destroyer) +%define pythonize_unmanaged_type(typename, creator, destroyer) %pythoncode %{ -type ## .__new__ = __new_decorator(type ## _ ## creator, type ## .__new__) -type ## .__del__ = lambda instance: type ## _ ## destroyer ## (instance) -type ## .__init__ = __managed_init -del type ## .creator -del type ## .destroyer +typename ## Impl = typename + +class typename ## ImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(typename ## Impl, name) + + def __dir__(cls): + return [name for name in dir(typename ## Impl) if name not in (#creator, #destroyer)] + +class typename(with_metaclass(typename ## ImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = typename ## Impl. ## creator(*args, **kwargs) + + def __del__(self): + typename ## Impl. ## destroyer(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in (#creator, #destroyer)] %} %enddef diff --git a/examples/dna_binary_to_json_demo.py b/examples/dna_binary_to_json_demo.py index f8652ca..d843364 100644 --- a/examples/dna_binary_to_json_demo.py +++ b/examples/dna_binary_to_json_demo.py @@ -75,6 +75,7 @@ def save_dna(reader, path): def create_json_dna(input_path, output_path): dna_reader = load_dna(input_path) save_dna(dna_reader, output_path) + print('Done.') if __name__ == "__main__": diff --git a/examples/dna_demo.py b/examples/dna_demo.py index 3aee21e..3ad4b5f 100644 --- a/examples/dna_demo.py +++ b/examples/dna_demo.py @@ -93,6 +93,7 @@ def create_new_dna(dna_path): create_dna(dna_path) dna_reader = load_dna(dna_path) print_dna_summary(dna_reader) + print('Done.') if __name__ == "__main__": diff --git a/examples/dnacalib_lod_demo.py b/examples/dnacalib_lod_demo.py index 74d4cdc..9001ecc 100644 --- a/examples/dnacalib_lod_demo.py +++ b/examples/dnacalib_lod_demo.py @@ -15,7 +15,7 @@ IMPORTANT: You have to setup the environment before running this example. Please - change CHARACTER_NAME to Taro, or the name of a custom DNA file placed in /data/dna_files - change value of LODS to list of lods needed to be extracted -Expected: Script will generate Ada_with_lods_1_and_3.dna in OUTPUT_DIR, from original Ada.dna. +Expected: Script will generate Ada_with_lods_1_and_3.dna in OUTPUT_DIR, from original Ada. NOTE: If OUTPUT_DIR does not exist, it will be created. """ @@ -27,8 +27,11 @@ from os import path as ospath ROOT_DIR = f"{ospath.dirname(ospath.abspath(__file__))}/..".replace("\\", "/") OUTPUT_DIR = f"{ROOT_DIR}/output" -import dnacalib as dnacalib -import dna +from dna import DataLayer_All, FileStream, Status, BinaryStreamReader, BinaryStreamWriter +from dnacalib import ( + DNACalibDNAReader, + SetLODsCommand, +) # Sets DNA file path DNA = f"{ROOT_DIR}/data/dna_files/Ada.dna" @@ -38,17 +41,21 @@ DNA_NEW = f"{OUTPUT_DIR}/Ada_with_lods_1_and_3.dna" LODS = [1, 3] -def save_dna(reader: dnacalib.DNACalibDNAReader, created_dna_path: str): +def save_dna(reader: DNACalibDNAReader, created_dna_path: str): # Saves the dna - stream = dna.FileStream(created_dna_path, dna.FileStream.AccessMode_Write, dna.FileStream.OpenMode_Binary) - writer = dna.BinaryStreamWriter(stream) + stream = FileStream(created_dna_path, FileStream.AccessMode_Write, FileStream.OpenMode_Binary) + writer = BinaryStreamWriter(stream) writer.setFrom(reader) writer.write() + if not Status.isOk(): + status = Status.get() + raise RuntimeError(f"Error saving DNA: {status.message}") + def run_SetLODsCommand(reader): - calibrated = dnacalib.DNACalibDNAReader(reader) - command = dnacalib.SetLODsCommand() + calibrated = DNACalibDNAReader(reader) + command = SetLODsCommand() # Set a list of LODs that will be exported to the new file command.setLODs(LODS) # Runs the command that reduces LODs of the DNA @@ -58,8 +65,8 @@ def run_SetLODsCommand(reader): if calibrated.getLODCount() != 2: raise RuntimeError("Setting new number of LODs in DNA was unsuccessful!") - print("\nSuccessfully changed number of LODs in DNA.") - print("Saving DNA...") + print("\nSuccessfully changed number of LODs in ") + print("Saving ..") # Save the newly created DNA save_dna(calibrated, DNA_NEW) print("Done.") @@ -67,8 +74,8 @@ def run_SetLODsCommand(reader): def load_dna_calib(dna_path: str): # Load the DNA - stream = dna.FileStream(dna_path, dna.FileStream.AccessMode_Read, dna.FileStream.OpenMode_Binary) - reader = dna.BinaryStreamReader(stream, dna.DataLayer_All) + stream = FileStream(dna_path, FileStream.AccessMode_Read, FileStream.OpenMode_Binary) + reader = BinaryStreamReader(stream, DataLayer_All) reader.read() return reader diff --git a/examples/dnacalib_rename_joint_demo.py b/examples/dnacalib_rename_joint_demo.py index 2469437..6fd6d3c 100644 --- a/examples/dnacalib_rename_joint_demo.py +++ b/examples/dnacalib_rename_joint_demo.py @@ -71,3 +71,4 @@ if __name__ == "__main__": # Prints the new joint name print(calibrated.getJointName(10)) save_dna(calibrated, OUTPUT_DNA) + print('Done.') diff --git a/lib/Maya2022/linux/_py3dna.so b/lib/Maya2022/linux/_py3dna.so index 4ac114a..f259f85 100644 Binary files a/lib/Maya2022/linux/_py3dna.so and b/lib/Maya2022/linux/_py3dna.so differ diff --git a/lib/Maya2022/linux/_py3dnacalib.so b/lib/Maya2022/linux/_py3dnacalib.so index e322e7b..f86b04b 100644 Binary files a/lib/Maya2022/linux/_py3dnacalib.so and b/lib/Maya2022/linux/_py3dnacalib.so differ diff --git a/lib/Maya2022/linux/dna.py b/lib/Maya2022/linux/dna.py index 10915cd..ed8fbaa 100644 --- a/lib/Maya2022/linux/dna.py +++ b/lib/Maya2022/linux/dna.py @@ -4,6 +4,18 @@ # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. + +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass + + + from sys import version_info as _swig_python_version_info if _swig_python_version_info < (2, 7, 0): raise RuntimeError("Python 2.7 or later required") @@ -62,22 +74,25 @@ class _SwigNonDynamicMeta(type): -def __new_decorator(factory_func, original_new): - @staticmethod - def __new(cls, *args, **kwargs): -# FIXME: while this workaround solves the immediate issue with the set of classes we currently have, -# it will fail for classes that use a factory function but need no parameters at all, in which case -# the factory function will never be invoked, only the original __new__ function. - if args or kwargs: - return factory_func(*args, **kwargs) - return original_new(cls) - return __new +def with_metaclass(meta, *bases): + class metaclass(type): -def __managed_init(self, *args, **kwargs): - self._args = args - self._kwargs = kwargs + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) class MemoryResource(object): + r""" + MemoryResource is an abstract class that allows the implementation of polymorphic allocators. + Notes: + It's purpose is to allow passing arbitrary allocators through API boundaries, without requiring changes in the + signatures and types involved. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -95,6 +110,11 @@ class MemoryResource(object): _py3dna.MemoryResource_swigregister(MemoryResource) class AlignedMemoryResource(MemoryResource): + r""" + A MemoryResource that honors alignment requirements. + See also: MemoryResource + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -112,6 +132,11 @@ class AlignedMemoryResource(MemoryResource): _py3dna.AlignedMemoryResource_swigregister(AlignedMemoryResource) class ArenaMemoryResource(MemoryResource): + r""" + Serves allocations from a preallocated memory region. + See also: MemoryResource + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dna.delete_ArenaMemoryResource @@ -120,18 +145,26 @@ class ArenaMemoryResource(MemoryResource): _py3dna.ArenaMemoryResource_swiginit(self, _py3dna.new_ArenaMemoryResource(*args)) def allocate(self, size, alignment): + r""" All allocations will be served from the currently active memory region.""" return _py3dna.ArenaMemoryResource_allocate(self, size, alignment) def deallocate(self, ptr, size, alignment): + r""" This is a no-op, and the regions are only freed when the arena itself is destroyed.""" return _py3dna.ArenaMemoryResource_deallocate(self, ptr, size, alignment) def getUpstreamMemoryResource(self): + r""" The upstream memory resource was passed through the constructor and is backing all arena allocations.""" return _py3dna.ArenaMemoryResource_getUpstreamMemoryResource(self) # Register ArenaMemoryResource in _py3dna: _py3dna.ArenaMemoryResource_swigregister(ArenaMemoryResource) class DefaultMemoryResource(MemoryResource): + r""" + A MemoryResource that delegates to malloc / free. + See also: MemoryResource + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -194,6 +227,35 @@ class Readable(object): __repr__ = _swig_repr def read(self, *args): + r""" + *Overload 1:* + + Read bytes from stream into the given buffer. + :type destination: string + :param destination: + Destination buffer into which the data is going to be read from the stream. + :type size: std::size_t + :param size: + Number of bytes to read from stream. + :rtype: std::size_t + :return: + Number of bytes read. + + | + + *Overload 2:* + + Read bytes from this stream into the given stream. + :type destination: :py:class:`Writable` + :param destination: + Destination stream into which the data is going to be read from this stream. + :type size: std::size_t + :param size: + Number of bytes to read from stream. + :rtype: std::size_t + :return: + Number of bytes read. + """ return _py3dna.Readable_read(self, *args) # Register Readable in _py3dna: @@ -207,6 +269,35 @@ class Writable(object): __repr__ = _swig_repr def write(self, *args): + r""" + *Overload 1:* + + Writes bytes from the given buffer to the stream. + :type source: string + :param source: + Source buffer from which the data is going to be written to the stream. + :type size: std::size_t + :param size: + Number of bytes to write to the stream. + :rtype: std::size_t + :return: + Number of bytes written. + + | + + *Overload 2:* + + Writes bytes from the given stream to this stream. + :type source: :py:class:`Readable` + :param source: + Source stream from which the data is going to be written into this stream. + :type size: std::size_t + :param size: + Number of bytes to write to the stream. + :rtype: std::size_t + :return: + Number of bytes written. + """ return _py3dna.Writable_write(self, *args) # Register Writable in _py3dna: @@ -220,9 +311,21 @@ class Seekable(object): __repr__ = _swig_repr def tell(self): + r""" + Get the current position in the stream. + :rtype: int + :return: + Position in the stream relative to it's start, with 0 denoting the start position. + """ return _py3dna.Seekable_tell(self) def seek(self, position): + r""" + Set the current position in the stream. + :type position: int + :param position: + Position in the stream relative to it's start, with 0 denoting the start position. + """ return _py3dna.Seekable_seek(self, position) # Register Seekable in _py3dna: @@ -236,6 +339,7 @@ class Openable(object): __repr__ = _swig_repr def open(self): + r""" Open access to the stream.""" return _py3dna.Openable_open(self) # Register Openable in _py3dna: @@ -249,6 +353,7 @@ class Closeable(object): __repr__ = _swig_repr def close(self): + r""" Close access to the stream.""" return _py3dna.Closeable_close(self) # Register Closeable in _py3dna: @@ -272,6 +377,12 @@ class Bounded(object): __repr__ = _swig_repr def size(self): + r""" + Obtain size of stream in bytes. + :rtype: int + :return: + Size in bytes. + """ return _py3dna.Bounded_size(self) # Register Bounded in _py3dna: @@ -285,6 +396,7 @@ class Buffered(object): __repr__ = _swig_repr def flush(self): + r""" Flush the changes to filesystem.""" return _py3dna.Buffered_flush(self) # Register Buffered in _py3dna: @@ -298,6 +410,7 @@ class Resizable(object): __repr__ = _swig_repr def resize(self, size): + r""" Resize file to the requested size.""" return _py3dna.Resizable_resize(self, size) # Register Resizable in _py3dna: @@ -326,6 +439,8 @@ AccessMode_ReadWrite = _py3dna.AccessMode_ReadWrite OpenMode_Binary = _py3dna.OpenMode_Binary OpenMode_Text = _py3dna.OpenMode_Text class FileStream(BoundedIOStream): + r""" Standard file stream.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -334,10 +449,37 @@ class FileStream(BoundedIOStream): @staticmethod def create(path, accessMode, openMode, memRes=None): + r""" + Factory method for creation of a FileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type openMode: int + :param openMode: + Control whether the file is opened in binary or textual mode. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the FileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.FileStream_create(path, accessMode, openMode, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a FileStream instance. + :type instance: :py:class:`FileStream` + :param instance: + Instance of FileStream to be freed. + See also: create + """ return _py3dna.FileStream_destroy(instance) __swig_destroy__ = _py3dna.delete_FileStream @@ -345,12 +487,41 @@ class FileStream(BoundedIOStream): _py3dna.FileStream_swigregister(FileStream) def FileStream_create(path, accessMode, openMode, memRes=None): + r""" + Factory method for creation of a FileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type openMode: int + :param openMode: + Control whether the file is opened in binary or textual mode. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the FileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.FileStream_create(path, accessMode, openMode, memRes) def FileStream_destroy(instance): + r""" + Method for freeing a FileStream instance. + :type instance: :py:class:`FileStream` + :param instance: + Instance of FileStream to be freed. + See also: create + """ return _py3dna.FileStream_destroy(instance) class MemoryMappedFileStream(BoundedIOStream, Buffered, Resizable): + r""" Memory mapped file stream.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -359,10 +530,34 @@ class MemoryMappedFileStream(BoundedIOStream, Buffered, Resizable): @staticmethod def create(path, accessMode, memRes=None): + r""" + Factory method for creation of a MemoryMappedFileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryMappedFileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.MemoryMappedFileStream_create(path, accessMode, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a MemoryMappedFileStream instance. + :type instance: :py:class:`MemoryMappedFileStream` + :param instance: + Instance of MemoryMappedFileStream to be freed. + See also: create + """ return _py3dna.MemoryMappedFileStream_destroy(instance) __swig_destroy__ = _py3dna.delete_MemoryMappedFileStream @@ -370,12 +565,38 @@ class MemoryMappedFileStream(BoundedIOStream, Buffered, Resizable): _py3dna.MemoryMappedFileStream_swigregister(MemoryMappedFileStream) def MemoryMappedFileStream_create(path, accessMode, memRes=None): + r""" + Factory method for creation of a MemoryMappedFileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryMappedFileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.MemoryMappedFileStream_create(path, accessMode, memRes) def MemoryMappedFileStream_destroy(instance): + r""" + Method for freeing a MemoryMappedFileStream instance. + :type instance: :py:class:`MemoryMappedFileStream` + :param instance: + Instance of MemoryMappedFileStream to be freed. + See also: create + """ return _py3dna.MemoryMappedFileStream_destroy(instance) class MemoryStream(BoundedIOStream): + r""" In-memory stream.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -384,10 +605,63 @@ class MemoryStream(BoundedIOStream): @staticmethod def create(*args): + r""" + *Overload 1:* + + Factory method for creation of a MemoryStream instance. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.MemoryStream_create(*args) @staticmethod def destroy(instance): + r""" + Method for freeing a MemoryStream instance. + :type instance: :py:class:`MemoryStream` + :param instance: + Instance of MemoryStream to be freed. + See also: create + """ return _py3dna.MemoryStream_destroy(instance) __swig_destroy__ = _py3dna.delete_MemoryStream @@ -395,31 +669,189 @@ class MemoryStream(BoundedIOStream): _py3dna.MemoryStream_swigregister(MemoryStream) def MemoryStream_create(*args): + r""" + *Overload 1:* + + Factory method for creation of a MemoryStream instance. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.MemoryStream_create(*args) def MemoryStream_destroy(instance): + r""" + Method for freeing a MemoryStream instance. + :type instance: :py:class:`MemoryStream` + :param instance: + Instance of MemoryStream to be freed. + See also: create + """ return _py3dna.MemoryStream_destroy(instance) -FileStream.__new__ = __new_decorator(FileStream_create, FileStream.__new__) -FileStream.__del__ = lambda instance: FileStream_destroy(instance) -FileStream.__init__ = __managed_init -del FileStream.create -del FileStream.destroy +FileStreamImpl = FileStream + +class FileStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(FileStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(FileStreamImpl) if name not in ("create","destroy")] + +class FileStream(with_metaclass(FileStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = FileStreamImpl.create(*args, **kwargs) + + def __del__(self): + FileStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -MemoryMappedFileStream.__new__ = __new_decorator(MemoryMappedFileStream_create, MemoryMappedFileStream.__new__) -MemoryMappedFileStream.__del__ = lambda instance: MemoryMappedFileStream_destroy(instance) -MemoryMappedFileStream.__init__ = __managed_init -del MemoryMappedFileStream.create -del MemoryMappedFileStream.destroy +MemoryMappedFileStreamImpl = MemoryMappedFileStream + +class MemoryMappedFileStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(MemoryMappedFileStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(MemoryMappedFileStreamImpl) if name not in ("create","destroy")] + +class MemoryMappedFileStream(with_metaclass(MemoryMappedFileStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = MemoryMappedFileStreamImpl.create(*args, **kwargs) + + def __del__(self): + MemoryMappedFileStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -MemoryStream.__new__ = __new_decorator(MemoryStream_create, MemoryStream.__new__) -MemoryStream.__del__ = lambda instance: MemoryStream_destroy(instance) -MemoryStream.__init__ = __managed_init -del MemoryStream.create -del MemoryStream.destroy +MemoryStreamImpl = MemoryStream + +class MemoryStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(MemoryStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(MemoryStreamImpl) if name not in ("create","destroy")] + +class MemoryStream(with_metaclass(MemoryStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = MemoryStreamImpl.create(*args, **kwargs) + + def __del__(self): + MemoryStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] FileStream.AccessMode_Read = AccessMode_Read @@ -463,11 +895,11 @@ def __mul__(*args): def __truediv__(*args): return _py3dna.__truediv__(*args) -def __eq__(*args): - return _py3dna.__eq__(*args) +def __eq__(lhs, rhs): + return _py3dna.__eq__(lhs, rhs) -def __ne__(*args): - return _py3dna.__ne__(*args) +def __ne__(lhs, rhs): + return _py3dna.__ne__(lhs, rhs) DataLayer_Descriptor = _py3dna.DataLayer_Descriptor DataLayer_Definition = _py3dna.DataLayer_Definition DataLayer_Behavior = _py3dna.DataLayer_Behavior @@ -509,6 +941,13 @@ class CoordinateSystem(object): _py3dna.CoordinateSystem_swigregister(CoordinateSystem) class DescriptorReader(object): + r""" + Read-only accessors for various metadata about the character and the rig. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -531,9 +970,31 @@ class DescriptorReader(object): return _py3dna.DescriptorReader_getMetaDataCount(self) def getMetaDataKey(self, index): + r""" + :type index: int + :param index: + A position in the zero-indexed array of key-value pairs. + Warning: + The index must be less than the value returned by getMetaDataCount. + :rtype: :py:class:`StringView` + :return: View over the key name string. + """ return _py3dna.DescriptorReader_getMetaDataKey(self, index) def getMetaDataValue(self, key): + r""" + Stored metadata value associated with the given key. + Notes: + If no value is associated with the given key, the returned view + will contain nullptr and will have a size of 0. + :type key: string + :param key: + A unique-known key that has a value associated to it. + Warning: + The key must be null-terminated. + :rtype: :py:class:`StringView` + :return: View over the metadata value string. + """ return _py3dna.DescriptorReader_getMetaDataValue(self, key) def getTranslationUnit(self): @@ -546,21 +1007,44 @@ class DescriptorReader(object): return _py3dna.DescriptorReader_getCoordinateSystem(self) def getLODCount(self): + r""" + Available levels of detail (e.g. 6 which means the following levels are available: + [0,1,2,3,4,5], where 0 is the LOD with the highest details, and 5 is the LOD with + lowest details). + """ return _py3dna.DescriptorReader_getLODCount(self) def getDBMaxLOD(self): + r""" + The maximum level of detail stored in the DNA data for this character. + Notes: + The value is relative to LOD-0 from the database. + """ return _py3dna.DescriptorReader_getDBMaxLOD(self) def getDBComplexity(self): + r""" + Name of the input control interface used to drive this character rig. + Notes: + This parameter denotes the character's input control complexity. + """ return _py3dna.DescriptorReader_getDBComplexity(self) def getDBName(self): + r""" + Name of the database from which the character originates. + Notes: + All characters from the same database must have the same Definition, but may + have different complexity or LOD. + """ return _py3dna.DescriptorReader_getDBName(self) # Register DescriptorReader in _py3dna: _py3dna.DescriptorReader_swigregister(DescriptorReader) class MeshBlendShapeChannelMapping(object): + r""" Mapping that associates a blend shape channel to it's mesh.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr meshIndex = property(_py3dna.MeshBlendShapeChannelMapping_meshIndex_get, _py3dna.MeshBlendShapeChannelMapping_meshIndex_set) @@ -574,6 +1058,13 @@ class MeshBlendShapeChannelMapping(object): _py3dna.MeshBlendShapeChannelMapping_swigregister(MeshBlendShapeChannelMapping) class DefinitionReader(DescriptorReader): + r""" + Read-only accessors for DNA attributes that represent the rig's static data. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -584,102 +1075,354 @@ class DefinitionReader(DescriptorReader): return _py3dna.DefinitionReader_getGUIControlCount(self) def getGUIControlName(self, index): + r""" + Name of the requested GUI control. + :type index: int + :param index: + A name's position in the zero-indexed array of GUI control names. + Warning: + The index must be less than the value returned by getGUIControlCount. + :rtype: :py:class:`StringView` + :return: View over the GUI control name string. + """ return _py3dna.DefinitionReader_getGUIControlName(self, index) def getRawControlCount(self): return _py3dna.DefinitionReader_getRawControlCount(self) def getRawControlName(self, index): + r""" + Name of the requested raw control. + :type index: int + :param index: + A name's position in the zero-indexed array of raw control names. + Warning: + The index must be less than the value returned by getRawControlCount. + :rtype: :py:class:`StringView` + :return: View over the control name string. + """ return _py3dna.DefinitionReader_getRawControlName(self, index) def getJointCount(self): return _py3dna.DefinitionReader_getJointCount(self) def getJointName(self, index): + r""" + Name of the requested joint. + :type index: int + :param index: + A name's position in the zero-indexed array of joint names. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: :py:class:`StringView` + :return: View over the joint name string. + """ return _py3dna.DefinitionReader_getJointName(self, index) def getJointIndexListCount(self): + r""" + Number of joint index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getJointIndexListCount(self) def getJointIndicesForLOD(self, lod): + r""" + List of joint indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which joints are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the joint indices. + See also: getLODCount + See also: getJointName + """ return _py3dna.DefinitionReader_getJointIndicesForLOD(self, lod) def getJointParentIndex(self, index): + r""" + Index of the requested joint's parent. + Notes: + The joint hierarchy may be traversed and reconstructed using this function. Example: + Joint names: [A, B, C, D, E, F, G, H, I] + Hierarchy: [0, 0, 0, 1, 1, 4, 2, 6, 2] + Describes the following hierarchy: + A + + B + | + D + | + E + | + F + + C + + G + | + H + + I + + Requesting the parent index of joint 5 (joint name: F) would return 4 (joint name: E). + Requesting the parent index of the root joint: 0 (joint name: A) would return the same index 0. + An out of bounds request (an index greater than the number of joints returns UINT16_MAX). + :type index: int + :param index: + The joint index which parent is being requested. + """ return _py3dna.DefinitionReader_getJointParentIndex(self, index) def getBlendShapeChannelCount(self): return _py3dna.DefinitionReader_getBlendShapeChannelCount(self) def getBlendShapeChannelName(self, index): + r""" + Name of the requested blend shape channel. + :type index: int + :param index: + A name's position in the zero-indexed array of blend shape channel names. + Warning: + The index must be less than the value returned by BlendShapeChannelExtentReader::getBlendShapeChannelCount. + :rtype: :py:class:`StringView` + :return: View over the blend shape channel name string. + """ return _py3dna.DefinitionReader_getBlendShapeChannelName(self, index) def getBlendShapeChannelIndexListCount(self): + r""" + Number of blend shape channel index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getBlendShapeChannelIndexListCount(self) def getBlendShapeChannelIndicesForLOD(self, lod): + r""" + List of blend shape channel indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which blend shape channels are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the blend shape channel indices. + + These LOD indices are not interchangeable with the LOD values from BehaviorReader::getBlendShapeChannelLODs. + See also: getLODCount + See also: getBlendShapeChannelName + """ return _py3dna.DefinitionReader_getBlendShapeChannelIndicesForLOD(self, lod) def getAnimatedMapCount(self): return _py3dna.DefinitionReader_getAnimatedMapCount(self) def getAnimatedMapName(self, index): + r""" + Name of the requested animated map. + :type index: int + :param index: + A name's position in the zero-indexed array of animated map names. + Warning: + The index must be less than the value returned by getAnimatedMapCount. + :rtype: :py:class:`StringView` + :return: View over the animated map name string. + """ return _py3dna.DefinitionReader_getAnimatedMapName(self, index) def getAnimatedMapIndexListCount(self): + r""" + Number of animated map index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getAnimatedMapIndexListCount(self) def getAnimatedMapIndicesForLOD(self, lod): + r""" + List of animated map indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which animated maps are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the animated map indices. + See also: getLODCount + See also: getAnimatedMapName + """ return _py3dna.DefinitionReader_getAnimatedMapIndicesForLOD(self, lod) def getMeshCount(self): return _py3dna.DefinitionReader_getMeshCount(self) def getMeshName(self, index): + r""" + Name of the requested mesh. + :type index: int + :param index: + A name's position in the zero-indexed array of mesh names. + Warning: + The index must be less than the value returned by getMeshCount. + :rtype: :py:class:`StringView` + :return: View over the mesh name string. + """ return _py3dna.DefinitionReader_getMeshName(self, index) def getMeshIndexListCount(self): + r""" + Number of mesh index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getMeshIndexListCount(self) def getMeshIndicesForLOD(self, lod): + r""" + List of mesh indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which meshes are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the mesh indices. + See also: getLODCount + See also: getMeshName + """ return _py3dna.DefinitionReader_getMeshIndicesForLOD(self, lod) def getMeshBlendShapeChannelMappingCount(self): + r""" Number of mesh-blend shape channel mapping items.""" return _py3dna.DefinitionReader_getMeshBlendShapeChannelMappingCount(self) def getMeshBlendShapeChannelMapping(self, index): + r""" + :type index: int + :param index: + A mapping's position in the zero-indexed array of mesh-blend shape channel mappings. + Warning: + The index must be less than the value returned by getMeshBlendShapeChannelMappingCount. + :rtype: :py:class:`MeshBlendShapeChannelMapping` + :return: A structure holding the mesh index and the associated blend shape channel index. + """ return _py3dna.DefinitionReader_getMeshBlendShapeChannelMapping(self, index) def getMeshBlendShapeChannelMappingIndicesForLOD(self, lod): + r""" + List of mesh-blend shape channel mapping indices for the specified LOD. + Notes: + The indices from this list can be used with the getMeshBlendShapeChannelMapping API + to retrieve individual mapping items. + :type lod: int + :param lod: + The level of detail which meshes are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the mesh blend shape channel mapping indices. + See also: getLODCount + See also: getMeshBlendShapeChannelMapping + """ return _py3dna.DefinitionReader_getMeshBlendShapeChannelMappingIndicesForLOD(self, lod) def getNeutralJointTranslation(self, index): + r""" + :type index: int + :param index: + A joint's position in the zero-indexed array of joint translations. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: dna::Vector3 + :return: The joint's translation (x, y, z). + """ return _py3dna.DefinitionReader_getNeutralJointTranslation(self, index) def getNeutralJointTranslationXs(self): + r""" + List of all translation X values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getNeutralJointTranslation + """ return _py3dna.DefinitionReader_getNeutralJointTranslationXs(self) def getNeutralJointTranslationYs(self): + r""" + List of all translation Y values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getNeutralJointTranslation + """ return _py3dna.DefinitionReader_getNeutralJointTranslationYs(self) def getNeutralJointTranslationZs(self): + r""" + List of all translation Z values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getNeutralJointTranslation + """ return _py3dna.DefinitionReader_getNeutralJointTranslationZs(self) def getNeutralJointRotation(self, index): + r""" + :type index: int + :param index: + A joint's position in the zero-indexed array of joint rotations. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: dna::Vector3 + :return: The joint's rotation (x, y, z). + """ return _py3dna.DefinitionReader_getNeutralJointRotation(self, index) def getNeutralJointRotationXs(self): + r""" + List of all rotation X values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getNeutralJointRotation + """ return _py3dna.DefinitionReader_getNeutralJointRotationXs(self) def getNeutralJointRotationYs(self): + r""" + List of all rotation Y values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getNeutralJointRotation + """ return _py3dna.DefinitionReader_getNeutralJointRotationYs(self) def getNeutralJointRotationZs(self): + r""" + List of all rotation Z values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getNeutralJointRotation + """ return _py3dna.DefinitionReader_getNeutralJointRotationZs(self) # Register DefinitionReader in _py3dna: _py3dna.DefinitionReader_swigregister(DefinitionReader) class BehaviorReader(DefinitionReader): + r""" + Read-only accessors for DNA attributes that define the rig's evaluation. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -687,96 +1430,285 @@ class BehaviorReader(DefinitionReader): __repr__ = _swig_repr def getGUIToRawInputIndices(self): + r""" + Input indices used for mapping gui to raw controls. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ return _py3dna.BehaviorReader_getGUIToRawInputIndices(self) def getGUIToRawOutputIndices(self): + r""" + Output indices used for mapping gui to raw controls. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ return _py3dna.BehaviorReader_getGUIToRawOutputIndices(self) def getGUIToRawFromValues(self): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getGUIToRawFromValues(self) def getGUIToRawToValues(self): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getGUIToRawToValues(self) def getGUIToRawSlopeValues(self): + r""" + Computational values(slope/gradient) used for calculating the + output value during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getGUIToRawSlopeValues(self) def getGUIToRawCutValues(self): + r""" + Computational values(vertical intercept) used for calculating the + output value during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getGUIToRawCutValues(self) def getPSDCount(self): + r""" The number of distinct PSD expressions.""" return _py3dna.BehaviorReader_getPSDCount(self) def getPSDRowIndices(self): + r""" + PSD(input) indices. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of PSD indices. + """ return _py3dna.BehaviorReader_getPSDRowIndices(self) def getPSDColumnIndices(self): + r""" + Control(input) indices. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of control indices. + """ return _py3dna.BehaviorReader_getPSDColumnIndices(self) def getPSDValues(self): + r""" + Weights associated with each PSD row and column pair. + :rtype: dna::ConstArrayView< float > + :return: View over the array of weights. + """ return _py3dna.BehaviorReader_getPSDValues(self) def getJointRowCount(self): + r""" Number of rows in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorReader_getJointRowCount(self) def getJointColumnCount(self): + r""" Number of columns in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorReader_getJointColumnCount(self) def getJointVariableAttributeIndices(self, lod): + r""" + Joint attribute indices (output indices) for the requested LOD. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of joint indices. + """ return _py3dna.BehaviorReader_getJointVariableAttributeIndices(self, lod) def getJointGroupCount(self): + r""" Number of joint groups present in the entire joint matrix.""" return _py3dna.BehaviorReader_getJointGroupCount(self) def getJointGroupLODs(self, jointGroupIndex): + r""" + Number of rows per each level of detail for the requested joint group. + Notes: + Each element's position represents the level itself, while the value denotes + the number of rows within the joint group belonging to that level. e.g.: + [12, 9, 3] + | | + LOD-2 contains first 3 rows + | + LOD-1 contains first 9 rows + + LOD-0 contains first 12 rows + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ return _py3dna.BehaviorReader_getJointGroupLODs(self, jointGroupIndex) def getJointGroupInputIndices(self, jointGroupIndex): + r""" + Column indices that the requested joint group contains. + Notes: + The column indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of column indices. + """ return _py3dna.BehaviorReader_getJointGroupInputIndices(self, jointGroupIndex) def getJointGroupOutputIndices(self, jointGroupIndex): + r""" + Row indices that the requested joint group contains. + Notes: + The row indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of row indices. + """ return _py3dna.BehaviorReader_getJointGroupOutputIndices(self, jointGroupIndex) def getJointGroupValues(self, jointGroupIndex): + r""" + Values that the requested joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< float > + :return: View over the array of values. + """ return _py3dna.BehaviorReader_getJointGroupValues(self, jointGroupIndex) def getJointGroupJointIndices(self, jointGroupIndex): + r""" + Joint indices that the requested joint group contains. + Notes: + These joint indices can be used to get the joint names through DefinitionReader::getJointName. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of joint indices. + See also: DefinitionReader + """ return _py3dna.BehaviorReader_getJointGroupJointIndices(self, jointGroupIndex) def getBlendShapeChannelLODs(self): + r""" + Input index count per each level of detail for blend shape channels. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of input indices belonging to that level. + Warning: + These LOD values are not interchangeable with the LOD indices from DefinitionReader::getBlendShapeChannelIndicesForLOD. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ return _py3dna.BehaviorReader_getBlendShapeChannelLODs(self) def getBlendShapeChannelInputIndices(self): + r""" + Input indices used to index into the input vector. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ return _py3dna.BehaviorReader_getBlendShapeChannelInputIndices(self) def getBlendShapeChannelOutputIndices(self): + r""" + Output indices specify the positions of blend shape channel output values. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ return _py3dna.BehaviorReader_getBlendShapeChannelOutputIndices(self) def getAnimatedMapLODs(self): + r""" + Row count per each level of detail for animated maps. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of rows (within the conditional table), + belonging to that level. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ return _py3dna.BehaviorReader_getAnimatedMapLODs(self) def getAnimatedMapInputIndices(self): + r""" + Input indices used to index into the array of input values. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ return _py3dna.BehaviorReader_getAnimatedMapInputIndices(self) def getAnimatedMapOutputIndices(self): + r""" + Output indices that specify the computed output value's position. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ return _py3dna.BehaviorReader_getAnimatedMapOutputIndices(self) def getAnimatedMapFromValues(self): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getAnimatedMapFromValues(self) def getAnimatedMapToValues(self): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getAnimatedMapToValues(self) def getAnimatedMapSlopeValues(self): + r""" + Computational values(slope/gradient) used for calculating the output value. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getAnimatedMapSlopeValues(self) def getAnimatedMapCutValues(self): + r""" + Computational values(vertical intercept) used for calculating the output value. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getAnimatedMapCutValues(self) # Register BehaviorReader in _py3dna: _py3dna.BehaviorReader_swigregister(BehaviorReader) class GeometryReader(DefinitionReader): + r""" + Read-only accessors to the geometry data associated with a rig. + Warning: + Implementors should inherit from Reader itself and not this class. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -784,108 +1716,560 @@ class GeometryReader(DefinitionReader): __repr__ = _swig_repr def getVertexPositionCount(self, meshIndex): + r""" + Number of vertex positions in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexPositionCount(self, meshIndex) def getVertexPosition(self, meshIndex, vertexIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + The index of the vertex position in the zero-indexed array of vertex positions. + + vertexIndex must be less than the value returned by getVertexPositionCount. + Notes: + The vertices are sorted by the vertex ID. + :rtype: dna::Position + :return: The vertex position. + """ return _py3dna.GeometryReader_getVertexPosition(self, meshIndex, vertexIndex) def getVertexPositionXs(self, meshIndex): + r""" + List of all vertex position X values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getVertexPosition + """ return _py3dna.GeometryReader_getVertexPositionXs(self, meshIndex) def getVertexPositionYs(self, meshIndex): + r""" + List of all vertex position Y values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getVertexPosition + """ return _py3dna.GeometryReader_getVertexPositionYs(self, meshIndex) def getVertexPositionZs(self, meshIndex): + r""" + List of all vertex position Z values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getVertexPosition + """ return _py3dna.GeometryReader_getVertexPositionZs(self, meshIndex) def getVertexTextureCoordinateCount(self, meshIndex): + r""" + Number of texture coordinates in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexTextureCoordinateCount(self, meshIndex) def getVertexTextureCoordinate(self, meshIndex, textureCoordinateIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type textureCoordinateIndex: int + :param textureCoordinateIndex: + The index of the texture coordinate in the zero-indexed array of texture coordinates. + + textureCoordinateIndex must be less than the value returned by getVertexTextureCoordinateCount. + :rtype: dna::TextureCoordinate + :return: The texture coordinate. + """ return _py3dna.GeometryReader_getVertexTextureCoordinate(self, meshIndex, textureCoordinateIndex) def getVertexTextureCoordinateUs(self, meshIndex): + r""" + List of all texture coordinate U values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexTextureCoordinate. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all U values. + See also: getVertexTextureCoordinate + """ return _py3dna.GeometryReader_getVertexTextureCoordinateUs(self, meshIndex) def getVertexTextureCoordinateVs(self, meshIndex): + r""" + List of all texture coordinate V values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexTextureCoordinate. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all V values. + See also: getVertexTextureCoordinate + """ return _py3dna.GeometryReader_getVertexTextureCoordinateVs(self, meshIndex) def getVertexNormalCount(self, meshIndex): + r""" + Number of vertex normals in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexNormalCount(self, meshIndex) def getVertexNormal(self, meshIndex, normalIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type normalIndex: int + :param normalIndex: + The index of the vertex normal in the zero-indexed array of vertex normals. + + normalIndex must be less than the value returned by getVertexNormalCount. + :rtype: dna::Normal + :return: The vertex normal. + """ return _py3dna.GeometryReader_getVertexNormal(self, meshIndex, normalIndex) def getVertexNormalXs(self, meshIndex): + r""" + List of all normal X values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexNormalXs(self, meshIndex) def getVertexNormalYs(self, meshIndex): + r""" + List of all normal Y value for the referenced meshs. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexNormalYs(self, meshIndex) def getVertexNormalZs(self, meshIndex): + r""" + List of all normal Z values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexNormalZs(self, meshIndex) def getVertexLayoutCount(self, meshIndex): + r""" + Number of vertex layouts in the entire mesh. + Notes: + A vertex layout is a collection of vertex attributes. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexLayoutCount(self, meshIndex) def getVertexLayout(self, meshIndex, layoutIndex): + r""" + Vertex layouts contain only attribute indices which can be used to query + the actual attributes, such as positions, texture coordinates and normals, + which are associated with the vertex. + Notes: + The indices from a layout are usable with the above defined APIs. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type layoutIndex: int + :param layoutIndex: + The index of the layout in the zero-indexed array of vertex layouts. + + layoutIndex must be less than the value returned by getVertexLayoutCount. + See also: getVertexPosition + See also: getVertexTextureCoordinate + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexLayout(self, meshIndex, layoutIndex) def getVertexLayoutPositionIndices(self, meshIndex): + r""" + Position indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex position indices values. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getVertexLayoutPositionIndices(self, meshIndex) def getVertexLayoutTextureCoordinateIndices(self, meshIndex): + r""" + Texture coordinate indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex texture coordinate indices. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getVertexLayoutTextureCoordinateIndices(self, meshIndex) def getVertexLayoutNormalIndices(self, meshIndex): + r""" + Normal indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex normal indices. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getVertexLayoutNormalIndices(self, meshIndex) def getFaceCount(self, meshIndex): + r""" + Number of faces that belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getFaceCount(self, meshIndex) def getFaceVertexLayoutIndices(self, meshIndex, faceIndex): + r""" + List of vertex layout indices the belong to a face on the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type faceIndex: int + :param faceIndex: + A face's position in the zero-indexed array of faces that belong to + the above referenced mesh. + + faceIndex must be less than the value returned by getFaceCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over the list of vertex layout indices. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getFaceVertexLayoutIndices(self, meshIndex, faceIndex) def getMaximumInfluencePerVertex(self, meshIndex): + r""" + The maximum number of joints that may influence any single vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getMaximumInfluencePerVertex(self, meshIndex) def getSkinWeightsCount(self, meshIndex): + r""" + Number of skin weights associated with the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getSkinWeightsCount(self, meshIndex) def getSkinWeightsValues(self, meshIndex, vertexIndex): + r""" + List of skin weights influencing the requested vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertices. + + vertexIndex must be less than the value returned by getVertexPositionCount. + :rtype: dna::ConstArrayView< float > + :return: View over the list of skin weights. + """ return _py3dna.GeometryReader_getSkinWeightsValues(self, meshIndex, vertexIndex) def getSkinWeightsJointIndices(self, meshIndex, vertexIndex): + r""" + List of joint indices associated with each skin weight for the specified vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertices. + + vertexIndex must be less than the value returned by getVertexPositionCount. + Notes: + The joint indices are stored in the same order as the weights they + are associated with. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the list of joint indices. + """ return _py3dna.GeometryReader_getSkinWeightsJointIndices(self, meshIndex, vertexIndex) def getBlendShapeTargetCount(self, meshIndex): + r""" + Number of blend shapes that belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getBlendShapeTargetCount(self, meshIndex) def getBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex): + r""" + The matching blend shape channel index of the requested blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + See also: DefinitionReader::getBlendShapeChannelName + """ return _py3dna.GeometryReader_getBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDeltaCount(self, meshIndex, blendShapeTargetIndex): + r""" + Number of deltas that belong to the specified blend shape. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaCount(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDelta(self, meshIndex, blendShapeTargetIndex, deltaIndex): + r""" + List of deltas for each affected vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :type deltaIndex: int + :param deltaIndex: + A position in the zero-indexed array of blend shapes deltas. + + deltaIndex must be less than the value returned by getBlendShapeTargetDeltaCount. + """ return _py3dna.GeometryReader_getBlendShapeTargetDelta(self, meshIndex, blendShapeTargetIndex, deltaIndex) def getBlendShapeTargetDeltaXs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta X values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getBlendShapeTargetDelta + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaXs(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDeltaYs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta Y values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getBlendShapeTargetDelta + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaYs(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDeltaZs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta Z values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getBlendShapeTargetDelta + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaZs(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex): + r""" + Vertex position indices affected by the referenced blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + Notes: + The vertex position indices are stored in the same order as the deltas they + are associated with. + These indices can be used to query the associated vertices themselves through getVertexPosition. + See also: getVertexPosition + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over the list of vertex position indices. + """ return _py3dna.GeometryReader_getBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex) # Register GeometryReader in _py3dna: _py3dna.GeometryReader_swigregister(GeometryReader) class Reader(BehaviorReader, GeometryReader): + r""" + The abstract Reader which its implementations are expected to inherit. + Notes: + This class combines the various different reader interfaces into a single interface. + The artificial separation into multiple interfaces mirrors the DNA file structure that + is separated into matching layers under the same names. As these layers can be + selectively loaded, it might be convenient to slice-off interfaces which layers were + not loaded. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -894,6 +2278,12 @@ class Reader(BehaviorReader, GeometryReader): __swig_destroy__ = _py3dna.delete_Reader def unload(self, layer): + r""" + Unload all data of the specified layer and all layers dependent on it. + :type layer: int + :param layer: + Layer which data should be unloaded. + """ return _py3dna.Reader_unload(self, layer) # Register Reader in _py3dna: @@ -908,6 +2298,7 @@ class StreamReader(Reader): __swig_destroy__ = _py3dna.delete_StreamReader def read(self): + r""" read data from stream into internal structures.""" return _py3dna.StreamReader_read(self) # Register StreamReader in _py3dna: @@ -925,10 +2316,188 @@ class BinaryStreamReader(StreamReader): @staticmethod def create(*args): + r""" + *Overload 1:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int, optional + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int, optional + :param maxLOD: + The maximum level of details to be loaded. + + A value of zero indicates to load all LODs. + Warning: + The maxLOD value must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 4:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 5:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.BinaryStreamReader_create(*args) @staticmethod def destroy(instance): + r""" + Method for freeing a BinaryStreamReader instance. + :type instance: :py:class:`BinaryStreamReader` + :param instance: + Instance of BinaryStreamReader to be freed. + See also: create + """ return _py3dna.BinaryStreamReader_destroy(instance) __swig_destroy__ = _py3dna.delete_BinaryStreamReader @@ -936,9 +2505,187 @@ class BinaryStreamReader(StreamReader): _py3dna.BinaryStreamReader_swigregister(BinaryStreamReader) def BinaryStreamReader_create(*args): + r""" + *Overload 1:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int, optional + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int, optional + :param maxLOD: + The maximum level of details to be loaded. + + A value of zero indicates to load all LODs. + Warning: + The maxLOD value must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 4:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 5:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.BinaryStreamReader_create(*args) def BinaryStreamReader_destroy(instance): + r""" + Method for freeing a BinaryStreamReader instance. + :type instance: :py:class:`BinaryStreamReader` + :param instance: + Instance of BinaryStreamReader to be freed. + See also: create + """ return _py3dna.BinaryStreamReader_destroy(instance) class JSONStreamReader(StreamReader): @@ -950,10 +2697,31 @@ class JSONStreamReader(StreamReader): @staticmethod def create(stream, memRes=None): + r""" + Factory method for creation of JSONStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.JSONStreamReader_create(stream, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a JSONStreamReader instance. + :type instance: :py:class:`JSONStreamReader` + :param instance: + Instance of JSONStreamReader to be freed. + See also: create + """ return _py3dna.JSONStreamReader_destroy(instance) __swig_destroy__ = _py3dna.delete_JSONStreamReader @@ -961,26 +2729,124 @@ class JSONStreamReader(StreamReader): _py3dna.JSONStreamReader_swigregister(JSONStreamReader) def JSONStreamReader_create(stream, memRes=None): + r""" + Factory method for creation of JSONStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.JSONStreamReader_create(stream, memRes) def JSONStreamReader_destroy(instance): + r""" + Method for freeing a JSONStreamReader instance. + :type instance: :py:class:`JSONStreamReader` + :param instance: + Instance of JSONStreamReader to be freed. + See also: create + """ return _py3dna.JSONStreamReader_destroy(instance) -BinaryStreamReader.__new__ = __new_decorator(BinaryStreamReader_create, BinaryStreamReader.__new__) -BinaryStreamReader.__del__ = lambda instance: BinaryStreamReader_destroy(instance) -BinaryStreamReader.__init__ = __managed_init -del BinaryStreamReader.create -del BinaryStreamReader.destroy +BinaryStreamReaderImpl = BinaryStreamReader + +class BinaryStreamReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(BinaryStreamReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(BinaryStreamReaderImpl) if name not in ("create","destroy")] + +class BinaryStreamReader(with_metaclass(BinaryStreamReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = BinaryStreamReaderImpl.create(*args, **kwargs) + + def __del__(self): + BinaryStreamReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -JSONStreamReader.__new__ = __new_decorator(JSONStreamReader_create, JSONStreamReader.__new__) -JSONStreamReader.__del__ = lambda instance: JSONStreamReader_destroy(instance) -JSONStreamReader.__init__ = __managed_init -del JSONStreamReader.create -del JSONStreamReader.destroy +JSONStreamReaderImpl = JSONStreamReader + +class JSONStreamReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(JSONStreamReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(JSONStreamReaderImpl) if name not in ("create","destroy")] + +class JSONStreamReader(with_metaclass(JSONStreamReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = JSONStreamReaderImpl.create(*args, **kwargs) + + def __del__(self): + JSONStreamReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] class DescriptorWriter(object): + r""" + Write-only accessors to various metadata about the character and the rig. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -988,6 +2854,13 @@ class DescriptorWriter(object): __repr__ = _swig_repr def setName(self, name): + r""" + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an allocation. + """ return _py3dna.DescriptorWriter_setName(self, name) def setArchetype(self, archetype): @@ -1000,9 +2873,23 @@ class DescriptorWriter(object): return _py3dna.DescriptorWriter_setAge(self, age) def clearMetaData(self): + r""" Empties the metadata storage, delete all key-value pairs.""" return _py3dna.DescriptorWriter_clearMetaData(self) def setMetaData(self, key, value): + r""" + Associate the metadata value with the given key. + :type key: string + :param key: + A unique, null-terminated key, to which the given value will be assigned. + :type value: string + :param value: + A null-terminated, metadata value, which is to be assigned to the given key. + Notes: + Consecutive calls using the same key will overwrite any existing data. + + Passing nullptr as the value argument will cause the associated key to be deleted. + """ return _py3dna.DescriptorWriter_setMetaData(self, key, value) def setTranslationUnit(self, unit): @@ -1015,21 +2902,53 @@ class DescriptorWriter(object): return _py3dna.DescriptorWriter_setCoordinateSystem(self, system) def setLODCount(self, lodCount): + r""" + Available levels of detail (e.g. 6 which means the following levels are available: + [0,1,2,3,4,5], where 0 is the LOD with the highest details, and 5 is the LOD with + lowest details). + :type lodCount: int + :param lodCount: + The number of levels available. + """ return _py3dna.DescriptorWriter_setLODCount(self, lodCount) def setDBMaxLOD(self, lod): + r""" The maximum level of detail stored in the DNA data for this character.""" return _py3dna.DescriptorWriter_setDBMaxLOD(self, lod) def setDBComplexity(self, name): + r""" + Name of the input control interface used to drive this character rig. + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DescriptorWriter_setDBComplexity(self, name) def setDBName(self, name): + r""" + Name of the database from which the character originates. + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DescriptorWriter_setDBName(self, name) # Register DescriptorWriter in _py3dna: _py3dna.DescriptorWriter_swigregister(DescriptorWriter) class DefinitionWriter(DescriptorWriter): + r""" + Write-only accessors for DNA attributes that represent the rig's static data. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1037,108 +2956,392 @@ class DefinitionWriter(DescriptorWriter): __repr__ = _swig_repr def clearGUIControlNames(self): + r""" Delete all stored GUI control names.""" return _py3dna.DefinitionWriter_clearGUIControlNames(self) def setGUIControlName(self, index, name): + r""" + Name of the specified GUI control. + :type index: int + :param index: + A name's position in the zero-indexed array of GUI control names. + Notes: + The control name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setGUIControlName(self, index, name) def clearRawControlNames(self): + r""" Delete all stored raw control names.""" return _py3dna.DefinitionWriter_clearRawControlNames(self) def setRawControlName(self, index, name): + r""" + Name of the specified raw control. + :type index: int + :param index: + A name's position in the zero-indexed array of raw control names. + Notes: + The control name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setRawControlName(self, index, name) def clearJointNames(self): + r""" Delete all stored joint names.""" return _py3dna.DefinitionWriter_clearJointNames(self) def setJointName(self, index, name): + r""" + Name of the specified joint. + :type index: int + :param index: + A name's position in the zero-indexed array of joint names. + Notes: + The joint name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setJointName(self, index, name) def clearJointIndices(self): + r""" Delete all stored joint indices.""" return _py3dna.DefinitionWriter_clearJointIndices(self) def setJointIndices(self, index, jointIndices): + r""" + Store a list of joint indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where joint indices are stored. + Notes: + The index denotes the position of an entire joint index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of joint indices. + + The joint index storage will be implicitly resized (if needed) to provide + storage for the number of joint indices that is inferred from the specified index. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + + These indices can be used to access joint names through DefinitionReader::getJointName. + :type count: int + :param count: + The number of joint indices to copy. + """ return _py3dna.DefinitionWriter_setJointIndices(self, index, jointIndices) def clearLODJointMappings(self): + r""" Delete all stored LOD to joint list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODJointMappings(self) def setLODJointMapping(self, lod, index): + r""" + Set which joints belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the joints are being associated. + :type index: int + :param index: + The index onto which joints indices were assigned using setJointIndices. + See also: setJointIndices + """ return _py3dna.DefinitionWriter_setLODJointMapping(self, lod, index) def clearBlendShapeChannelNames(self): + r""" Delete all stored blend shape channel names.""" return _py3dna.DefinitionWriter_clearBlendShapeChannelNames(self) def setBlendShapeChannelName(self, index, name): + r""" + Name of the specified blend shape channel. + :type index: int + :param index: + A name's position in the zero-indexed array of blend shape channel names. + Notes: + The blend shape channel name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setBlendShapeChannelName(self, index, name) def clearBlendShapeChannelIndices(self): + r""" Delete all stored blend shape channel indices.""" return _py3dna.DefinitionWriter_clearBlendShapeChannelIndices(self) def setBlendShapeChannelIndices(self, index, blendShapeChannelIndices): + r""" + Store a list of blend shape channel name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where blend shape channel name indices are stored. + Notes: + The index denotes the position of an entire blend shape channel index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of blend shape channel indices. + + The blend shape channel index storage will be implicitly resized (if needed) to provide storage + for the number of blend shape channel name indices that is inferred from the specified index. + :type blendShapeChannelIndices: int + :param blendShapeChannelIndices: + The source address from which the blend shape channel name indices are to be copied. + + These indices can be used to access blend shape channel names through DefinitionReader::getBlendShapeChannelName. + :type count: int + :param count: + The number of blend shape channel name indices to copy. + """ return _py3dna.DefinitionWriter_setBlendShapeChannelIndices(self, index, blendShapeChannelIndices) def clearLODBlendShapeChannelMappings(self): + r""" Delete all stored LOD to blend shape channel list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODBlendShapeChannelMappings(self) def setLODBlendShapeChannelMapping(self, lod, index): + r""" + Set which blend shape channels belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the blend shape channels are being associated. + :type index: int + :param index: + The index onto which blend shape channel name indices were assigned using setBlendShapeChannelIndices. + Warning: + The LOD indices set here are not interchangeable with the LOD values set in BehaviorWriter::setBlendShapeChannelLODs. + See also: setBlendShapeChannelIndices + """ return _py3dna.DefinitionWriter_setLODBlendShapeChannelMapping(self, lod, index) def clearAnimatedMapNames(self): + r""" Delete all stored animated map names.""" return _py3dna.DefinitionWriter_clearAnimatedMapNames(self) def setAnimatedMapName(self, index, name): + r""" + Name of the specified animated map. + :type index: int + :param index: + A name's position in the zero-indexed array of animated map names. + Notes: + The animated map name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setAnimatedMapName(self, index, name) def clearAnimatedMapIndices(self): + r""" Delete all stored animated map indices.""" return _py3dna.DefinitionWriter_clearAnimatedMapIndices(self) def setAnimatedMapIndices(self, index, animatedMapIndices): + r""" + Store a list of animated map name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where animated map name indices are stored. + Notes: + The index denotes the position of an entire animated map index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of animated map indices. + + The animated map index storage will be implicitly resized (if needed) to provide storage + for the number of animated map name indices that is inferred from the specified index. + :type animatedMapIndices: int + :param animatedMapIndices: + The source address from which the animated map name indices are to be copied. + + These indices can be used to access animated map names through DefinitionReader::getAnimatedMapName. + :type count: int + :param count: + The number of animated map name indices to copy. + """ return _py3dna.DefinitionWriter_setAnimatedMapIndices(self, index, animatedMapIndices) def clearLODAnimatedMapMappings(self): + r""" Delete all stored LOD to animated map list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODAnimatedMapMappings(self) def setLODAnimatedMapMapping(self, lod, index): + r""" + Set which animated maps belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the animated maps are being associated. + :type index: int + :param index: + The index onto which animated map indices were assigned using setAnimatedMapIndices. + See also: setAnimatedMapIndices + """ return _py3dna.DefinitionWriter_setLODAnimatedMapMapping(self, lod, index) def clearMeshNames(self): + r""" Delete all stored mesh names.""" return _py3dna.DefinitionWriter_clearMeshNames(self) def setMeshName(self, index, name): + r""" + Name of the specified mesh. + :type index: int + :param index: + A name's position in the zero-indexed array of mesh names. + Notes: + The mesh name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setMeshName(self, index, name) def clearMeshIndices(self): + r""" Delete all stored mesh indices.""" return _py3dna.DefinitionWriter_clearMeshIndices(self) def setMeshIndices(self, index, meshIndices): + r""" + Store a list of mesh name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where mesh name indices are stored. + Notes: + The index denotes the position of an entire mesh index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of mesh indices. + + The mesh index storage will be implicitly resized (if needed) to provide storage + for the number of mesh name indices that is inferred from the specified index. + :type meshIndices: int + :param meshIndices: + The source address from which the mesh name indices are to be copied. + + These indices can be used to access mesh names through DefinitionReader::getMeshName. + :type count: int + :param count: + The number of mesh name indices to copy. + """ return _py3dna.DefinitionWriter_setMeshIndices(self, index, meshIndices) def clearLODMeshMappings(self): + r""" Delete all stored LOD to mesh list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODMeshMappings(self) def setLODMeshMapping(self, lod, index): + r""" + Set which meshes belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the meshes are being associated. + :type index: int + :param index: + The index onto which mesh indices were assigned using setMeshIndices. + See also: setMeshIndices + """ return _py3dna.DefinitionWriter_setLODMeshMapping(self, lod, index) def clearMeshBlendShapeChannelMappings(self): + r""" Delete all stored mesh to blend shape channel mapping entries.""" return _py3dna.DefinitionWriter_clearMeshBlendShapeChannelMappings(self) def setMeshBlendShapeChannelMapping(self, index, meshIndex, blendShapeChannelIndex): + r""" + Associate a blend shape channel with it's mesh. + :type index: int + :param index: + A mapping's position in the zero-indexed array of mesh-blend shape channel mappings. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of mesh names. + :type blendShapeChannelIndex: int + :param blendShapeChannelIndex: + A blend shape channel's position in the zero-indexed array of blend shape channel names. + """ return _py3dna.DefinitionWriter_setMeshBlendShapeChannelMapping(self, index, meshIndex, blendShapeChannelIndex) def setJointHierarchy(self, jointIndices): + r""" + A simple array describing the parent-child relationships between joints. + Notes: + Example: + Joint names: [A, B, C, D, E, F, G, H] + Hierarchy: [0, 0, 0, 1, 1, 4, 2, 2] + Describes the following hierarchy: + A + + B + | + D + | + E + | + F + + C + + G + + H + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + + These indices can be used to access joint names through DefinitionReader::getJointName. + :type count: int + :param count: + The number of joint indices to copy. + """ return _py3dna.DefinitionWriter_setJointHierarchy(self, jointIndices) def setNeutralJointTranslations(self, translations): + r""" + :type translations: dna::Vector3 + :param translations: + The source address from which the translations are to be copied. + :type count: int + :param count: + The number of translation values to copy. + """ return _py3dna.DefinitionWriter_setNeutralJointTranslations(self, translations) def setNeutralJointRotations(self, rotations): + r""" + :type rotations: dna::Vector3 + :param rotations: + The source address from which the rotations are to be copied. + :type count: int + :param count: + The number of rotation values to copy. + """ return _py3dna.DefinitionWriter_setNeutralJointRotations(self, rotations) # Register DefinitionWriter in _py3dna: _py3dna.DefinitionWriter_swigregister(DefinitionWriter) class BehaviorWriter(DefinitionWriter): + r""" + Write-only accessors for DNA attributes that define the rig's evaluation. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1146,96 +3349,388 @@ class BehaviorWriter(DefinitionWriter): __repr__ = _swig_repr def setGUIToRawInputIndices(self, inputIndices): + r""" + Input indices used for mapping gui to raw controls. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawInputIndices(self, inputIndices) def setGUIToRawOutputIndices(self, outputIndices): + r""" + Output indices used for mapping gui to raw controls. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawOutputIndices(self, outputIndices) def setGUIToRawFromValues(self, fromValues): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :type fromValues: float + :param fromValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawFromValues(self, fromValues) def setGUIToRawToValues(self, toValues): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :type toValues: float + :param toValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawToValues(self, toValues) def setGUIToRawSlopeValues(self, slopeValues): + r""" + Computational values(slope/gradient) used for calculating the + output value during gui to raw control mapping. + :type slopeValues: float + :param slopeValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawSlopeValues(self, slopeValues) def setGUIToRawCutValues(self, cutValues): + r""" + Computational values(vertical intercept) used for calculating the + output value during gui to raw control mapping. + :type cutValues: float + :param cutValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawCutValues(self, cutValues) def setPSDCount(self, count): + r""" The number of distinct PSD expressions.""" return _py3dna.BehaviorWriter_setPSDCount(self, count) def setPSDRowIndices(self, rowIndices): + r""" + PSD(input) indices which will become the rows of the PSD matrix. + :type rowIndices: int + :param rowIndices: + The source address from which the PSD indices are to be copied. + :type count: int + :param count: + The number of PSD indices to copy. + """ return _py3dna.BehaviorWriter_setPSDRowIndices(self, rowIndices) def setPSDColumnIndices(self, columnIndices): + r""" + Control(input) indices which will become the columns of the PSD matrix. + :type columnIndices: int + :param columnIndices: + The source address from which the control indices are to be copied. + :type count: int + :param count: + The number of control indices to copy. + """ return _py3dna.BehaviorWriter_setPSDColumnIndices(self, columnIndices) def setPSDValues(self, weights): + r""" + Weights associated with each PSD row and column pair. + :type weights: float + :param weights: + The source address from which the weight values are to be copied. + :type count: int + :param count: + The number of weight values to copy. + """ return _py3dna.BehaviorWriter_setPSDValues(self, weights) def setJointRowCount(self, rowCount): + r""" Number of rows in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorWriter_setJointRowCount(self, rowCount) def setJointColumnCount(self, columnCount): + r""" Number of columns in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorWriter_setJointColumnCount(self, columnCount) def clearJointGroups(self): + r""" Delete all joint groups.""" return _py3dna.BehaviorWriter_clearJointGroups(self) def deleteJointGroup(self, jointGroupIndex): + r""" + Delete the specified joint group. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + """ return _py3dna.BehaviorWriter_deleteJointGroup(self, jointGroupIndex) def setJointGroupLODs(self, jointGroupIndex, lods): + r""" + Number of rows per each level of detail for the specified joint group. + Notes: + Each element's position represents the level itself, while the value denotes + the number of rows within the joint group belonging to that level. e.g.: + [12, 9, 3] + | | + LOD-2 contains first 3 rows + | + LOD-1 contains first 9 rows + + LOD-0 contains first 12 rows + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + """ return _py3dna.BehaviorWriter_setJointGroupLODs(self, jointGroupIndex, lods) def setJointGroupInputIndices(self, jointGroupIndex, inputIndices): + r""" + Column indices that the specified joint group contains. + Notes: + The column indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type inputIndices: int + :param inputIndices: + The source address from which the column indices are to be copied. + :type count: int + :param count: + The number of column indices to copy. + """ return _py3dna.BehaviorWriter_setJointGroupInputIndices(self, jointGroupIndex, inputIndices) def setJointGroupOutputIndices(self, jointGroupIndex, outputIndices): + r""" + Row indices that the specified joint group contains. + Notes: + The row indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type outputIndices: int + :param outputIndices: + The source address from which the row indices are to be copied. + :type count: int + :param count: + The number of row indices to copy. + """ return _py3dna.BehaviorWriter_setJointGroupOutputIndices(self, jointGroupIndex, outputIndices) def setJointGroupValues(self, jointGroupIndex, values): + r""" + Values that the specified joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Notes: + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type values: float + :param values: + The source address from which the values are to be copied. + :type count: int + :param count: + The number of values to copy. + """ return _py3dna.BehaviorWriter_setJointGroupValues(self, jointGroupIndex, values) def setJointGroupJointIndices(self, jointGroupIndex, jointIndices): + r""" + Joint indices that the specified joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Notes: + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + :type count: int + :param count: + The number of joint indices to copy. + """ return _py3dna.BehaviorWriter_setJointGroupJointIndices(self, jointGroupIndex, jointIndices) def setBlendShapeChannelLODs(self, lods): + r""" + Input index count per each level of detail for blend shapes. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of input indices belonging to that level. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + Warning: + The LOD values set here are not interchangeable with the LOD indices set in DefinitionWriter::setBlendShapeNameIndices + and DefinitionWriter::setLODBlendShapeMapping + """ return _py3dna.BehaviorWriter_setBlendShapeChannelLODs(self, lods) def setBlendShapeChannelInputIndices(self, inputIndices): + r""" + Input indices used to index into the input vector. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ return _py3dna.BehaviorWriter_setBlendShapeChannelInputIndices(self, inputIndices) def setBlendShapeChannelOutputIndices(self, outputIndices): + r""" + Output indices specify the positions of blend shape output values. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ return _py3dna.BehaviorWriter_setBlendShapeChannelOutputIndices(self, outputIndices) def setAnimatedMapLODs(self, lods): + r""" + Row count per each level of detail for animated maps. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of rows (within the conditional table), + belonging to that level. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapLODs(self, lods) def setAnimatedMapInputIndices(self, inputIndices): + r""" + Input indices used to index into the array of input values. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapInputIndices(self, inputIndices) def setAnimatedMapOutputIndices(self, outputIndices): + r""" + Output indices that specify the computed output value's position. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapOutputIndices(self, outputIndices) def setAnimatedMapFromValues(self, fromValues): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not. + :type fromValues: float + :param fromValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapFromValues(self, fromValues) def setAnimatedMapToValues(self, toValues): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not. + :type toValues: float + :param toValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapToValues(self, toValues) def setAnimatedMapSlopeValues(self, slopeValues): + r""" + Computational values(slope/gradient) used for calculating the output value. + :type slopeValues: float + :param slopeValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapSlopeValues(self, slopeValues) def setAnimatedMapCutValues(self, cutValues): + r""" + Computational values(vertical intercept) used for calculating the output value. + :type cutValues: float + :param cutValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapCutValues(self, cutValues) # Register BehaviorWriter in _py3dna: _py3dna.BehaviorWriter_swigregister(BehaviorWriter) class GeometryWriter(DefinitionWriter): + r""" + Write-only accessors for the geometry data associated with a rig. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1243,57 +3738,292 @@ class GeometryWriter(DefinitionWriter): __repr__ = _swig_repr def clearMeshes(self): + r""" Delete all meshes.""" return _py3dna.GeometryWriter_clearMeshes(self) def deleteMesh(self, meshIndex): + r""" + Delete the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_deleteMesh(self, meshIndex) def setVertexPositions(self, meshIndex, positions): + r""" + List of vertex positions. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type positions: dna::Position + :param positions: + The source address from which the vertex positions are to be copied. + :type count: int + :param count: + The number of vertex positions to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexPositions(self, meshIndex, positions) def setVertexTextureCoordinates(self, meshIndex, textureCoordinates): + r""" + List of vertex texture coordinates. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type textureCoordinates: dna::TextureCoordinate + :param textureCoordinates: + The source address from which the texture coordinates are to be copied. + :type count: int + :param count: + The number of texture coordinates to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexTextureCoordinates(self, meshIndex, textureCoordinates) def setVertexNormals(self, meshIndex, normals): + r""" + List of vertex normals. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type normals: dna::Normal + :param normals: + The source address from which the normals are to be copied. + :type count: int + :param count: + The number of normals to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexNormals(self, meshIndex, normals) def setVertexLayouts(self, meshIndex, layouts): + r""" + List of vertex layouts the belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type layouts: dna::VertexLayout + :param layouts: + The source address from which the layouts are to be copied. + :type count: int + :param count: + The number of layouts to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexLayouts(self, meshIndex, layouts) def clearFaceVertexLayoutIndices(self, meshIndex): + r""" + Delete all lists of vertex layout indices for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_clearFaceVertexLayoutIndices(self, meshIndex) def setFaceVertexLayoutIndices(self, meshIndex, faceIndex, layoutIndices): + r""" + Vertex layout indices that belong to the specified face. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type faceIndex: int + :param faceIndex: + A face's position in the zero-indexed array of faces that belong to + the above referenced mesh. + :type layoutIndices: int + :param layoutIndices: + The source address from which the layout indices are to be copied. + Notes: + The layout indices point into the array that is set through setVertexLayouts + :type count: int + :param count: + The number of vertices to copy. + + Both the mesh storage itself and it's face storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + faces that are inferred from the specified indexes. + """ return _py3dna.GeometryWriter_setFaceVertexLayoutIndices(self, meshIndex, faceIndex, layoutIndices) def setMaximumInfluencePerVertex(self, meshIndex, maxInfluenceCount): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type maxInfluenceCount: int + :param maxInfluenceCount: + The maximum number of joints that may influence any single vertex. + """ return _py3dna.GeometryWriter_setMaximumInfluencePerVertex(self, meshIndex, maxInfluenceCount) def clearSkinWeights(self, meshIndex): + r""" + Delete all skin weights for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_clearSkinWeights(self, meshIndex) def setSkinWeightsValues(self, meshIndex, vertexIndex, weights): + r""" + List of skin weights influencing the referenced vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertex positions. + :type weights: float + :param weights: + The source address from which the weights are to be copied. + :type count: int + :param count: + The number of weights to copy. + Notes: + Both the mesh storage itself and it's skin weight storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + skin-weight lists that are inferred from the specified indexes. + Warning: + The sum of weights must add up to 1. + """ return _py3dna.GeometryWriter_setSkinWeightsValues(self, meshIndex, vertexIndex, weights) def setSkinWeightsJointIndices(self, meshIndex, vertexIndex, jointIndices): + r""" + List of joint indices associated with each skin weight for the specified vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertex positions. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + :type count: int + :param count: + The number of joint indices to copy. + Notes: + Both the mesh storage itself and it's joint index list storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + joint index lists that are inferred from the specified indexes. + Warning: + The joint indices must be stored in the same order as the weights they + are associated with. + """ return _py3dna.GeometryWriter_setSkinWeightsJointIndices(self, meshIndex, vertexIndex, jointIndices) def clearBlendShapeTargets(self, meshIndex): + r""" + Delete all blend shape targets for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_clearBlendShapeTargets(self, meshIndex) def setBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex, blendShapeChannelIndex): + r""" + The matching blend shape channel index of the specified blend shape target. + Notes: + Associate the mesh-local blend shape target index with the absolute blend shape channel + index as found in the Definition layer. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type blendShapeChannelIndex: int + :param blendShapeChannelIndex: + The index of the specified blend shape channel in the Definition layer. + + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + """ return _py3dna.GeometryWriter_setBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex, blendShapeChannelIndex) def setBlendShapeTargetDeltas(self, meshIndex, blendShapeTargetIndex, deltas): + r""" + List of deltas for each affected vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type deltas: dna::Delta + :param deltas: + The source address from which the blend shape target deltas are to be copied. + :type count: int + :param count: + The number of blend shape target deltas to copy. + Notes: + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + """ return _py3dna.GeometryWriter_setBlendShapeTargetDeltas(self, meshIndex, blendShapeTargetIndex, deltas) def setBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex, vertexIndices): + r""" + Vertex position indices affected by the specified blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type vertexIndices: int + :param vertexIndices: + The source address from which the vertex position indices are to be copied. + :type count: int + :param count: + The number of vertex position indices to copy. + Notes: + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + Warning: + The vertex position indices must be stored in the same order as the deltas + they are associated with. + """ return _py3dna.GeometryWriter_setBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex, vertexIndices) # Register GeometryWriter in _py3dna: _py3dna.GeometryWriter_swigregister(GeometryWriter) class Writer(BehaviorWriter, GeometryWriter): + r""" + The abstract Writer which its implementations are expected to inherit. + Notes: + This class combines the various different writer interfaces into a single interface. + The artificial separation into multiple interfaces in this case just mirrors the + structure of the Reader hierarchy, as it's not possible to selectively write only + specific layers. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1302,6 +4032,24 @@ class Writer(BehaviorWriter, GeometryWriter): __swig_destroy__ = _py3dna.delete_Writer def setFrom(self, *args): + r""" + Initialize the Writer from the given Reader. + Notes: + This function copies all the data from the given Reader into the Writer instance, + by calling each getter function of the Reader, and passing the return values to + the matching setter functions in the Writer. + It is implemented in the abstract class itself to provide the functionality for + all DNA Writers. + :type source: :py:class:`Reader` + :param source: + The source DNA Reader from which the data needs to be copied. + :type layer: int, optional + :param layer: + Limit which layers should be taken over from the given source reader. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Optional memory resource to use for temporary allocations during copying. + """ return _py3dna.Writer_setFrom(self, *args) # Register Writer in _py3dna: @@ -1316,6 +4064,7 @@ class StreamWriter(Writer): __swig_destroy__ = _py3dna.delete_StreamWriter def write(self): + r""" Write data to stream from internal structures.""" return _py3dna.StreamWriter_write(self) # Register StreamWriter in _py3dna: @@ -1330,10 +4079,31 @@ class BinaryStreamWriter(StreamWriter): @staticmethod def create(stream, memRes=None): + r""" + Factory method for creation of BinaryStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.BinaryStreamWriter_create(stream, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a BinaryStreamWriter instance. + :type instance: :py:class:`BinaryStreamWriter` + :param instance: + Instance of BinaryStreamWriter to be freed. + See also: create + """ return _py3dna.BinaryStreamWriter_destroy(instance) __swig_destroy__ = _py3dna.delete_BinaryStreamWriter @@ -1341,9 +4111,30 @@ class BinaryStreamWriter(StreamWriter): _py3dna.BinaryStreamWriter_swigregister(BinaryStreamWriter) def BinaryStreamWriter_create(stream, memRes=None): + r""" + Factory method for creation of BinaryStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.BinaryStreamWriter_create(stream, memRes) def BinaryStreamWriter_destroy(instance): + r""" + Method for freeing a BinaryStreamWriter instance. + :type instance: :py:class:`BinaryStreamWriter` + :param instance: + Instance of BinaryStreamWriter to be freed. + See also: create + """ return _py3dna.BinaryStreamWriter_destroy(instance) class JSONStreamWriter(StreamWriter): @@ -1355,10 +4146,34 @@ class JSONStreamWriter(StreamWriter): @staticmethod def create(stream, indentWidth=4, memRes=None): + r""" + Factory method for creation of JSONStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type indentWidth: int, optional + :param indentWidth: + Number of spaces to use for indentation. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.JSONStreamWriter_create(stream, indentWidth, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a JSONStreamWriter instance. + :type instance: :py:class:`JSONStreamWriter` + :param instance: + Instance of JSONStreamWriter to be freed. + See also: create + """ return _py3dna.JSONStreamWriter_destroy(instance) __swig_destroy__ = _py3dna.delete_JSONStreamWriter @@ -1366,24 +4181,118 @@ class JSONStreamWriter(StreamWriter): _py3dna.JSONStreamWriter_swigregister(JSONStreamWriter) def JSONStreamWriter_create(stream, indentWidth=4, memRes=None): + r""" + Factory method for creation of JSONStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type indentWidth: int, optional + :param indentWidth: + Number of spaces to use for indentation. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.JSONStreamWriter_create(stream, indentWidth, memRes) def JSONStreamWriter_destroy(instance): + r""" + Method for freeing a JSONStreamWriter instance. + :type instance: :py:class:`JSONStreamWriter` + :param instance: + Instance of JSONStreamWriter to be freed. + See also: create + """ return _py3dna.JSONStreamWriter_destroy(instance) -BinaryStreamWriter.__new__ = __new_decorator(BinaryStreamWriter_create, BinaryStreamWriter.__new__) -BinaryStreamWriter.__del__ = lambda instance: BinaryStreamWriter_destroy(instance) -BinaryStreamWriter.__init__ = __managed_init -del BinaryStreamWriter.create -del BinaryStreamWriter.destroy +BinaryStreamWriterImpl = BinaryStreamWriter + +class BinaryStreamWriterImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(BinaryStreamWriterImpl, name) + + def __dir__(cls): + return [name for name in dir(BinaryStreamWriterImpl) if name not in ("create","destroy")] + +class BinaryStreamWriter(with_metaclass(BinaryStreamWriterImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = BinaryStreamWriterImpl.create(*args, **kwargs) + + def __del__(self): + BinaryStreamWriterImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -JSONStreamWriter.__new__ = __new_decorator(JSONStreamWriter_create, JSONStreamWriter.__new__) -JSONStreamWriter.__del__ = lambda instance: JSONStreamWriter_destroy(instance) -JSONStreamWriter.__init__ = __managed_init -del JSONStreamWriter.create -del JSONStreamWriter.destroy +JSONStreamWriterImpl = JSONStreamWriter + +class JSONStreamWriterImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(JSONStreamWriterImpl, name) + + def __dir__(cls): + return [name for name in dir(JSONStreamWriterImpl) if name not in ("create","destroy")] + +class JSONStreamWriter(with_metaclass(JSONStreamWriterImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = JSONStreamWriterImpl.create(*args, **kwargs) + + def __del__(self): + JSONStreamWriterImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] diff --git a/lib/Maya2022/linux/dnacalib.py b/lib/Maya2022/linux/dnacalib.py index 1cff0fe..ae9d31b 100644 --- a/lib/Maya2022/linux/dnacalib.py +++ b/lib/Maya2022/linux/dnacalib.py @@ -4,6 +4,18 @@ # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. + +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass + + + from sys import version_info as _swig_python_version_info if _swig_python_version_info < (2, 7, 0): raise RuntimeError("Python 2.7 or later required") @@ -62,20 +74,16 @@ class _SwigNonDynamicMeta(type): -def __new_decorator(factory_func, original_new): - @staticmethod - def __new(cls, *args, **kwargs): -# FIXME: while this workaround solves the immediate issue with the set of classes we currently have, -# it will fail for classes that use a factory function but need no parameters at all, in which case -# the factory function will never be invoked, only the original __new__ function. - if args or kwargs: - return factory_func(*args, **kwargs) - return original_new(cls) - return __new +def with_metaclass(meta, *bases): + class metaclass(type): -def __managed_init(self, *args, **kwargs): - self._args = args - self._kwargs = kwargs + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) import dna class VersionInfo(object): @@ -142,13 +150,50 @@ def DNACalibDNAReader_destroy(instance): return _py3dnacalib.DNACalibDNAReader_destroy(instance) -DNACalibDNAReader.__new__ = __new_decorator(DNACalibDNAReader_create, DNACalibDNAReader.__new__) -DNACalibDNAReader.__del__ = lambda instance: DNACalibDNAReader_destroy(instance) -DNACalibDNAReader.__init__ = __managed_init -del DNACalibDNAReader.create -del DNACalibDNAReader.destroy +DNACalibDNAReaderImpl = DNACalibDNAReader + +class DNACalibDNAReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(DNACalibDNAReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(DNACalibDNAReaderImpl) if name not in ("create","destroy")] + +class DNACalibDNAReader(with_metaclass(DNACalibDNAReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = DNACalibDNAReaderImpl.create(*args, **kwargs) + + def __del__(self): + DNACalibDNAReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] class Command(object): + r""" Command is an abstract class whose implementations are expected to modify the DNA provided in the run() method in some way.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -167,6 +212,14 @@ VectorOperation_Add = _py3dnacalib.VectorOperation_Add VectorOperation_Subtract = _py3dnacalib.VectorOperation_Subtract VectorOperation_Multiply = _py3dnacalib.VectorOperation_Multiply class CommandSequence(Command): + r""" + CommandSequence is used to run a sequence of commands on the same DNA. + Notes: + Commands will be run in the order in which they were added to the sequence. + + CommandSequence holds pointers to commands, but does not own them. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_CommandSequence @@ -178,15 +231,34 @@ class CommandSequence(Command): return _py3dnacalib.CommandSequence_run(self, output) def add(self, command): + r""" + Method for adding a command to a sequence of commands to run. + :type command: :py:class:`Command` + :param command: + The command to add. + """ return _py3dnacalib.CommandSequence_add(self, command) def remove(self, command): + r""" + Method for removing a command from the sequence of commands to run. + :type command: :py:class:`Command` + :param command: + The command to remove. + """ return _py3dnacalib.CommandSequence_remove(self, command) def contains(self, command): + r""" + Method for checking if the provided command is part of the command sequence. + :type command: :py:class:`Command` + :param command: + The command to check. + """ return _py3dnacalib.CommandSequence_contains(self, command) def size(self): + r""" Number of commands in command sequence.""" return _py3dnacalib.CommandSequence_size(self) # Register CommandSequence in _py3dnacalib: @@ -216,6 +288,12 @@ CommandSequence.add = command_sequence_add(CommandSequence.add) CommandSequence.remove = command_sequence_remove(CommandSequence.remove) class CalculateMeshLowerLODsCommand(Command): + r""" + CalculateMeshLowerLODsCommand is used to recalculate vertex positions for lower LOD meshes of the specified mesh. + Notes: + The calculation is done based on vertex positions of the specified mesh and vertex texture coordinates of its lower LOD meshes. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_CalculateMeshLowerLODsCommand @@ -224,6 +302,12 @@ class CalculateMeshLowerLODsCommand(Command): _py3dnacalib.CalculateMeshLowerLODsCommand_swiginit(self, _py3dnacalib.new_CalculateMeshLowerLODsCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to calculate lower LOD meshes from. + :type meshIndex: int + :param meshIndex: + The index of the mesh. + """ return _py3dnacalib.CalculateMeshLowerLODsCommand_setMeshIndex(self, meshIndex) def run(self, output): @@ -233,6 +317,11 @@ class CalculateMeshLowerLODsCommand(Command): _py3dnacalib.CalculateMeshLowerLODsCommand_swigregister(CalculateMeshLowerLODsCommand) class ClearBlendShapesCommand(Command): + r""" + ClearBlendShapesCommand is used to clear all blend shapes data from a DNA. + Notes: This command clears blend shape target deltas and blend shape animation data. By doing so, it transforms the DNA to be "joints only". + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_ClearBlendShapesCommand @@ -247,6 +336,8 @@ class ClearBlendShapesCommand(Command): _py3dnacalib.ClearBlendShapesCommand_swigregister(ClearBlendShapesCommand) class PruneBlendShapeTargetsCommand(Command): + r""" PruneBlendShapeTargetsCommand is used to prune blend shape target deltas whose absolute magnitude is less than or equal to the specified threshold.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_PruneBlendShapeTargetsCommand @@ -255,6 +346,12 @@ class PruneBlendShapeTargetsCommand(Command): _py3dnacalib.PruneBlendShapeTargetsCommand_swiginit(self, _py3dnacalib.new_PruneBlendShapeTargetsCommand(*args)) def setThreshold(self, threshold): + r""" + Method for setting the threshold for pruning blend shape target deltas. + :type threshold: float + :param threshold: + The threshold to use. + """ return _py3dnacalib.PruneBlendShapeTargetsCommand_setThreshold(self, threshold) def run(self, output): @@ -264,6 +361,8 @@ class PruneBlendShapeTargetsCommand(Command): _py3dnacalib.PruneBlendShapeTargetsCommand_swigregister(PruneBlendShapeTargetsCommand) class RemoveAnimatedMapCommand(Command): + r""" RemoveAnimatedMapCommand is used to remove animated maps.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveAnimatedMapCommand @@ -272,9 +371,23 @@ class RemoveAnimatedMapCommand(Command): _py3dnacalib.RemoveAnimatedMapCommand_swiginit(self, _py3dnacalib.new_RemoveAnimatedMapCommand(*args)) def setAnimatedMapIndex(self, animatedMapIndex): + r""" + Method for setting the index of the animated map to remove. + :type animatedMapIndex: int + :param animatedMapIndex: + The index of the animated map. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set animated map(s) will be removed. + """ return _py3dnacalib.RemoveAnimatedMapCommand_setAnimatedMapIndex(self, animatedMapIndex) def setAnimatedMapIndices(self, animatedMapIndices): + r""" + Method for setting the indices of animated maps to remove. + :type animatedMapIndices: dnac::ConstArrayView< std::uint16_t > + :param animatedMapIndices: + The animated map indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set animated map(s) will be removed. + """ return _py3dnacalib.RemoveAnimatedMapCommand_setAnimatedMapIndices(self, animatedMapIndices) def run(self, output): @@ -284,6 +397,8 @@ class RemoveAnimatedMapCommand(Command): _py3dnacalib.RemoveAnimatedMapCommand_swigregister(RemoveAnimatedMapCommand) class RemoveBlendShapeCommand(Command): + r""" RemoveBlendShapeCommand is used to remove blend shapes.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveBlendShapeCommand @@ -292,9 +407,23 @@ class RemoveBlendShapeCommand(Command): _py3dnacalib.RemoveBlendShapeCommand_swiginit(self, _py3dnacalib.new_RemoveBlendShapeCommand(*args)) def setBlendShapeIndex(self, blendShapeIndex): + r""" + Method for setting the index of the blend shape to remove. + :type blendShapeIndex: int + :param blendShapeIndex: + The index of the blend shape. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set blend shape(s) will be removed. + """ return _py3dnacalib.RemoveBlendShapeCommand_setBlendShapeIndex(self, blendShapeIndex) def setBlendShapeIndices(self, blendShapeIndices): + r""" + Method for setting the indices of blend shapes to remove. + :type blendShapeIndices: dnac::ConstArrayView< std::uint16_t > + :param blendShapeIndices: + The blend shape indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set blend shape(s) will be removed. + """ return _py3dnacalib.RemoveBlendShapeCommand_setBlendShapeIndices(self, blendShapeIndices) def run(self, output): @@ -304,6 +433,8 @@ class RemoveBlendShapeCommand(Command): _py3dnacalib.RemoveBlendShapeCommand_swigregister(RemoveBlendShapeCommand) class RemoveJointAnimationCommand(Command): + r""" RemoveJointAnimationCommand is used to remove joint animation data.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveJointAnimationCommand @@ -312,9 +443,23 @@ class RemoveJointAnimationCommand(Command): _py3dnacalib.RemoveJointAnimationCommand_swiginit(self, _py3dnacalib.new_RemoveJointAnimationCommand(*args)) def setJointIndex(self, jointIndex): + r""" + Method for setting the index of a joint whose animation data to remove. + :type jointIndex: int + :param jointIndex: + The index of the joint. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint animation(s) will be removed. + """ return _py3dnacalib.RemoveJointAnimationCommand_setJointIndex(self, jointIndex) def setJointIndices(self, jointIndices): + r""" + Method for setting the indices of joints whose animation data to remove. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + The joint indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint animation(s) will be removed. + """ return _py3dnacalib.RemoveJointAnimationCommand_setJointIndices(self, jointIndices) def run(self, output): @@ -324,6 +469,8 @@ class RemoveJointAnimationCommand(Command): _py3dnacalib.RemoveJointAnimationCommand_swigregister(RemoveJointAnimationCommand) class RemoveJointCommand(Command): + r""" RemoveJointCommand is used to remove joints.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveJointCommand @@ -332,9 +479,23 @@ class RemoveJointCommand(Command): _py3dnacalib.RemoveJointCommand_swiginit(self, _py3dnacalib.new_RemoveJointCommand(*args)) def setJointIndex(self, jointIndex): + r""" + Method for setting the index of the joint to remove. + :type jointIndex: int + :param jointIndex: + The index of the joint. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint(s) will be removed. + """ return _py3dnacalib.RemoveJointCommand_setJointIndex(self, jointIndex) def setJointIndices(self, jointIndices): + r""" + Method for setting the indices of joints to remove. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + The joint indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint(s) will be removed. + """ return _py3dnacalib.RemoveJointCommand_setJointIndices(self, jointIndices) def run(self, output): @@ -344,6 +505,8 @@ class RemoveJointCommand(Command): _py3dnacalib.RemoveJointCommand_swigregister(RemoveJointCommand) class RemoveMeshCommand(Command): + r""" RemoveMeshCommand is used to remove meshes.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveMeshCommand @@ -352,9 +515,22 @@ class RemoveMeshCommand(Command): _py3dnacalib.RemoveMeshCommand_swiginit(self, _py3dnacalib.new_RemoveMeshCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to remove. + :type meshIndex: int + :param meshIndex: + The index of the mesh. + """ return _py3dnacalib.RemoveMeshCommand_setMeshIndex(self, meshIndex) def setMeshIndices(self, meshIndices): + r""" + Method for setting the indices of meshes to remove. + :type meshIndices: dnac::ConstArrayView< std::uint16_t > + :param meshIndices: + The mesh indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set mesh(es) will be removed. + """ return _py3dnacalib.RemoveMeshCommand_setMeshIndices(self, meshIndices) def run(self, output): @@ -364,6 +540,8 @@ class RemoveMeshCommand(Command): _py3dnacalib.RemoveMeshCommand_swigregister(RemoveMeshCommand) class RenameAnimatedMapCommand(Command): + r""" RenameAnimatedMapCommand is used to rename an animated map.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameAnimatedMapCommand @@ -372,6 +550,31 @@ class RenameAnimatedMapCommand(Command): _py3dnacalib.RenameAnimatedMapCommand_swiginit(self, _py3dnacalib.new_RenameAnimatedMapCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for animated map with given index. + :type animatedMapIndex: int + :param animatedMapIndex: + The index of the animated map whose name to change. + :type newName: string + :param newName: + The new name for the animated map. + + | + + *Overload 2:* + + Method for setting a new name for animated map with given name. + Notes: + The renaming will not happen if there is no animated map with given current name. + :type oldName: string + :param oldName: + The current name of the animated map whose name to change. + :type newName: string + :param newName: + The new name for the animated map. + """ return _py3dnacalib.RenameAnimatedMapCommand_setName(self, *args) def run(self, output): @@ -381,6 +584,8 @@ class RenameAnimatedMapCommand(Command): _py3dnacalib.RenameAnimatedMapCommand_swigregister(RenameAnimatedMapCommand) class RenameBlendShapeCommand(Command): + r""" RenameBlendShapeCommand is used to rename a blend shape channel.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameBlendShapeCommand @@ -389,6 +594,31 @@ class RenameBlendShapeCommand(Command): _py3dnacalib.RenameBlendShapeCommand_swiginit(self, _py3dnacalib.new_RenameBlendShapeCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for blend shape channel with given index. + :type blendShapeIndex: int + :param blendShapeIndex: + The index of the blend shape channel whose name to change. + :type newName: string + :param newName: + The new name for the blend shape channel. + + | + + *Overload 2:* + + Method for setting a new name for blend shape channel with given name. + Notes: + The renaming will not happen if there is no blend shape channel with given current name. + :type oldName: string + :param oldName: + The current name of the blend shape channel whose name to change. + :type newName: string + :param newName: + The new name for the blend shape channel. + """ return _py3dnacalib.RenameBlendShapeCommand_setName(self, *args) def run(self, output): @@ -398,6 +628,8 @@ class RenameBlendShapeCommand(Command): _py3dnacalib.RenameBlendShapeCommand_swigregister(RenameBlendShapeCommand) class RenameJointCommand(Command): + r""" RenameJointCommand is used to rename a joint.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameJointCommand @@ -406,6 +638,31 @@ class RenameJointCommand(Command): _py3dnacalib.RenameJointCommand_swiginit(self, _py3dnacalib.new_RenameJointCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for joint with given index. + :type jointIndex: int + :param jointIndex: + The index of the joint whose name to change. + :type newName: string + :param newName: + The new name for the joint. + + | + + *Overload 2:* + + Method for setting a new name for joint with given name. + Notes: + The renaming will not happen if there is no joint with given current name. + :type oldName: string + :param oldName: + The current name of the joint whose name to change. + :type newName: string + :param newName: + The new name for the joint. + """ return _py3dnacalib.RenameJointCommand_setName(self, *args) def run(self, output): @@ -415,6 +672,8 @@ class RenameJointCommand(Command): _py3dnacalib.RenameJointCommand_swigregister(RenameJointCommand) class RenameMeshCommand(Command): + r""" RenameMeshCommand is used to rename a mesh.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameMeshCommand @@ -423,6 +682,31 @@ class RenameMeshCommand(Command): _py3dnacalib.RenameMeshCommand_swiginit(self, _py3dnacalib.new_RenameMeshCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for mesh with given index. + :type meshIndex: int + :param meshIndex: + The index of the mesh whose name to change. + :type newName: string + :param newName: + The new name for the mesh. + + | + + *Overload 2:* + + Method for setting a new name for mesh with given name. + Notes: + The renaming will not happen if there is no mesh with given current name. + :type oldName: string + :param oldName: + The current name of the mesh whose name to change. + :type newName: string + :param newName: + The new name for the mesh. + """ return _py3dnacalib.RenameMeshCommand_setName(self, *args) def run(self, output): @@ -432,6 +716,14 @@ class RenameMeshCommand(Command): _py3dnacalib.RenameMeshCommand_swigregister(RenameMeshCommand) class RotateCommand(Command): + r""" + RotateCommand is used to rotate neutral joints and vertex positions around given origin. + Notes: + Joint rotations are represented in parent space, so it is enough to rotate only root joints, as that rotation will be propagated to the rest of the joints. + + If the origin is not set, the assumed origin is (0, 0, 0). + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RotateCommand @@ -440,9 +732,21 @@ class RotateCommand(Command): _py3dnacalib.RotateCommand_swiginit(self, _py3dnacalib.new_RotateCommand(*args)) def setRotation(self, degrees): + r""" + Method for setting the rotation angles. + :type degrees: dnac::Vector3 + :param degrees: + Rotation angles in degrees. + """ return _py3dnacalib.RotateCommand_setRotation(self, degrees) def setOrigin(self, origin): + r""" + Method for setting the rotation origin. + :type origin: dnac::Vector3 + :param origin: + Origin coordinates. + """ return _py3dnacalib.RotateCommand_setOrigin(self, origin) def run(self, output): @@ -452,6 +756,12 @@ class RotateCommand(Command): _py3dnacalib.RotateCommand_swigregister(RotateCommand) class ScaleCommand(Command): + r""" + ScaleCommand is used to scale neutral joints, vertex positions and joint and blendshape deltas by a factor. + Notes: + Only translation attributes of neutral joints and joint deltas are scaled. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_ScaleCommand @@ -460,9 +770,22 @@ class ScaleCommand(Command): _py3dnacalib.ScaleCommand_swiginit(self, _py3dnacalib.new_ScaleCommand(*args)) def setScale(self, scale): + r""" + Method for setting the scale factor to multiply with. + :type scale: float + :param scale: + Scale factor. + """ return _py3dnacalib.ScaleCommand_setScale(self, scale) def setOrigin(self, origin): + r""" + Method for setting the origin. + Notes: The origin is used to properly scale position values (vertex positions and neutral joint translations). + :type origin: dnac::Vector3 + :param origin: + Origin coordinates. + """ return _py3dnacalib.ScaleCommand_setOrigin(self, origin) def run(self, output): @@ -472,6 +795,8 @@ class ScaleCommand(Command): _py3dnacalib.ScaleCommand_swigregister(ScaleCommand) class SetBlendShapeTargetDeltasCommand(Command): + r""" SetBlendShapeTargetDeltasCommand is used to change blend shape target deltas.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetBlendShapeTargetDeltasCommand @@ -480,21 +805,85 @@ class SetBlendShapeTargetDeltasCommand(Command): _py3dnacalib.SetBlendShapeTargetDeltasCommand_swiginit(self, _py3dnacalib.new_SetBlendShapeTargetDeltasCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh whose blend shape target to change. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setMeshIndex(self, meshIndex) def setBlendShapeTargetIndex(self, blendShapeTargetIndex): + r""" + Method for setting the index of the blend shape target to change. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + The blend shape target index. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setBlendShapeTargetIndex(self, blendShapeTargetIndex) def setDeltas(self, *args): + r""" + *Overload 1:* + + Method for setting the values used to calculate new deltas for blend shape target. + :type deltas: dnac::ConstArrayView< dnac::Vector3 > + :param deltas: + The values used in calculation. + + | + + *Overload 2:* + + Method for setting the values used to calculate new deltas for blend shape target. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X values for each delta. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y values for each delta. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z values for each delta. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setDeltas(self, *args) def setVertexIndices(self, vertexIndices): + r""" + Method for setting the vertex indices that correspond to new deltas. + :type vertexIndices: dnac::ConstArrayView< std::uint32_t > + :param vertexIndices: + The vertexIndices. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setVertexIndices(self, vertexIndices) def setMasks(self, masks): + r""" + Method for setting masks used to calculate new deltas for blend shape target. + Notes: + If no masks are set, default weight value of 1 is used for each delta. + :type masks: dnac::ConstArrayView< float > + :param masks: + The weights for each delta. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setMasks(self, masks) def setOperation(self, operation): + r""" + Method for setting the type of operation used to calculate new deltas for blend shape target. + Notes: + Available operations are: Interpolate, Add, Subtract and Multiply. Each delta is calculated based on the provided operation type in the following way: + + Interpolate: = previousValue * (1 - weight) + setValue * weight:math:`\n Add: \f$newValue = previousValue + (setValue * weight)` + + Subtract: = previousValue - (setValue * weight):math:`\n Multiply: \f$newValue = previousValue * (setValue * weight)` + + + setValue is the value from new deltas that were set, and weight is the value from masks array. + :type operation: int + :param operation: + The operation to use. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setOperation(self, operation) def run(self, output): @@ -509,6 +898,8 @@ SetBlendShapeTargetDeltasCommand.DeltasVertexIndicesCountMismatch = _py3dnacalib SetBlendShapeTargetDeltasCommand.DeltasMasksCountMismatch = _py3dnacalib.cvar.SetBlendShapeTargetDeltasCommand_DeltasMasksCountMismatch class SetLODsCommand(Command): + r""" SetLODsCommand is used to specify LODs to use. Joints, blend shapes, animated maps and meshes that are not in specified LODs are removed from the DNA.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetLODsCommand @@ -517,6 +908,12 @@ class SetLODsCommand(Command): _py3dnacalib.SetLODsCommand_swiginit(self, _py3dnacalib.new_SetLODsCommand(*args)) def setLODs(self, lods): + r""" + Method for setting the LODs to keep. + :type lods: dnac::ConstArrayView< std::uint16_t > + :param lods: + New LODs to be used. + """ return _py3dnacalib.SetLODsCommand_setLODs(self, lods) def run(self, output): @@ -526,6 +923,8 @@ class SetLODsCommand(Command): _py3dnacalib.SetLODsCommand_swigregister(SetLODsCommand) class SetNeutralJointRotationsCommand(Command): + r""" SetNeutralJointRotationsCommand is used to set new rotation values to neutral joints.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetNeutralJointRotationsCommand @@ -534,6 +933,29 @@ class SetNeutralJointRotationsCommand(Command): _py3dnacalib.SetNeutralJointRotationsCommand_swiginit(self, _py3dnacalib.new_SetNeutralJointRotationsCommand(*args)) def setRotations(self, *args): + r""" + *Overload 1:* + + Method for setting the neutral joint rotations. + :type rotations: dnac::ConstArrayView< dnac::Vector3 > + :param rotations: + Rotation values for each joint. + + | + + *Overload 2:* + + Method for setting the neutral joint rotations. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X rotation value for each joint. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y rotation value for each joint. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z rotation value for each joint. + """ return _py3dnacalib.SetNeutralJointRotationsCommand_setRotations(self, *args) def run(self, output): @@ -543,6 +965,8 @@ class SetNeutralJointRotationsCommand(Command): _py3dnacalib.SetNeutralJointRotationsCommand_swigregister(SetNeutralJointRotationsCommand) class SetNeutralJointTranslationsCommand(Command): + r""" SetNeutralJointTranslationsCommand is used to set new translation values to neutral joints.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetNeutralJointTranslationsCommand @@ -551,6 +975,29 @@ class SetNeutralJointTranslationsCommand(Command): _py3dnacalib.SetNeutralJointTranslationsCommand_swiginit(self, _py3dnacalib.new_SetNeutralJointTranslationsCommand(*args)) def setTranslations(self, *args): + r""" + *Overload 1:* + + Method for setting the neutral joint translations. + :type translations: dnac::ConstArrayView< dnac::Vector3 > + :param translations: + Translation values for each joint. + + | + + *Overload 2:* + + Method for setting the neutral joint translations. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X translation value for each joint. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y translation value for each joint. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z translation value for each joint. + """ return _py3dnacalib.SetNeutralJointTranslationsCommand_setTranslations(self, *args) def run(self, output): @@ -560,6 +1007,8 @@ class SetNeutralJointTranslationsCommand(Command): _py3dnacalib.SetNeutralJointTranslationsCommand_swigregister(SetNeutralJointTranslationsCommand) class SetSkinWeightsCommand(Command): + r""" SetSkinWeightsCommand is used to set new skin weights for a vertex in a mesh.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetSkinWeightsCommand @@ -568,15 +1017,39 @@ class SetSkinWeightsCommand(Command): _py3dnacalib.SetSkinWeightsCommand_swiginit(self, _py3dnacalib.new_SetSkinWeightsCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the targeted mesh. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ return _py3dnacalib.SetSkinWeightsCommand_setMeshIndex(self, meshIndex) def setVertexIndex(self, vertexIndex): + r""" + Method for setting the index of the vertex to change. + :type vertexIndex: int + :param vertexIndex: + The vertex index. + """ return _py3dnacalib.SetSkinWeightsCommand_setVertexIndex(self, vertexIndex) def setWeights(self, weights): + r""" + Method for setting the weights with which joints influence the vertex in question. + :type weights: dnac::ConstArrayView< float > + :param weights: + Weights for each joint that has an influence on the vertex. + """ return _py3dnacalib.SetSkinWeightsCommand_setWeights(self, weights) def setJointIndices(self, jointIndices): + r""" + Method for setting the joint indices of joints that influence the vertex in question. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + Joint indices of joints that have an influence on the vertex. + """ return _py3dnacalib.SetSkinWeightsCommand_setJointIndices(self, jointIndices) def run(self, output): @@ -586,6 +1059,8 @@ class SetSkinWeightsCommand(Command): _py3dnacalib.SetSkinWeightsCommand_swigregister(SetSkinWeightsCommand) class SetVertexPositionsCommand(Command): + r""" SetVertexPositionsCommand is used to change vertex positions values.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetVertexPositionsCommand @@ -594,15 +1069,67 @@ class SetVertexPositionsCommand(Command): _py3dnacalib.SetVertexPositionsCommand_swiginit(self, _py3dnacalib.new_SetVertexPositionsCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to change. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ return _py3dnacalib.SetVertexPositionsCommand_setMeshIndex(self, meshIndex) def setPositions(self, *args): + r""" + *Overload 1:* + + Method for setting the vertex positions used to calculate new values. + :type positions: dnac::ConstArrayView< dnac::Vector3 > + :param positions: + The vertex positions. + + | + + *Overload 2:* + + Method for setting the vertex positions used to calculate new values. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X coordinates for each vertex. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y coordinates for each vertex. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z coordinates for each vertex. + """ return _py3dnacalib.SetVertexPositionsCommand_setPositions(self, *args) def setMasks(self, masks): + r""" + Method for setting vertex masks used to calculate new vertex position values. + Notes: + If no masks are set, default weight value of 1 is used for each vertex. + :type masks: dnac::ConstArrayView< float > + :param masks: + The weights for each vertex. + """ return _py3dnacalib.SetVertexPositionsCommand_setMasks(self, masks) def setOperation(self, operation): + r""" + Method for setting the type of operation used to calculate new vertex position values. + Notes: + Available operations are: Interpolate, Add, Subtract and Multiply. Each position is calculated based on the provided operation type in the following way: + + Interpolate: = previousValue * (1 - weight) + setValue * weight:math:`\n Add: \f$newValue = previousValue + (setValue * weight)` + + Subtract: = previousValue - (setValue * weight):math:`\n Multiply: \f$newValue = previousValue * (setValue * weight)` + + + setValue is the value from new positions that were set, and weight is the value from masks array. + :type operation: int + :param operation: + The operation to use. + """ return _py3dnacalib.SetVertexPositionsCommand_setOperation(self, operation) def run(self, output): @@ -613,6 +1140,12 @@ _py3dnacalib.SetVertexPositionsCommand_swigregister(SetVertexPositionsCommand) SetVertexPositionsCommand.PositionsMasksCountMismatch = _py3dnacalib.cvar.SetVertexPositionsCommand_PositionsMasksCountMismatch class TranslateCommand(Command): + r""" + TranslateCommand is used to translate neutral joints and vertex positions. + Notes: + Joint translations are represented in parent space, so it is enough to translate only root joints, as that translation will be propagated to the rest of the joints. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_TranslateCommand @@ -621,6 +1154,12 @@ class TranslateCommand(Command): _py3dnacalib.TranslateCommand_swiginit(self, _py3dnacalib.new_TranslateCommand(*args)) def setTranslation(self, translation): + r""" + Method for setting the translation vector. + :type translation: dnac::Vector3 + :param translation: + The translation vector. + """ return _py3dnacalib.TranslateCommand_setTranslation(self, translation) def run(self, output): diff --git a/lib/Maya2022/linux/libdnacalib.so.6 b/lib/Maya2022/linux/libdnacalib.so.6 index c805e91..4c8d877 100644 Binary files a/lib/Maya2022/linux/libdnacalib.so.6 and b/lib/Maya2022/linux/libdnacalib.so.6 differ diff --git a/lib/Maya2022/linux/embeddedRL4.mll b/lib/Maya2022/linux/libembeddedRL4.so similarity index 100% rename from lib/Maya2022/linux/embeddedRL4.mll rename to lib/Maya2022/linux/libembeddedRL4.so diff --git a/lib/Maya2022/windows/_py3dna.pyd b/lib/Maya2022/windows/_py3dna.pyd index 5992b5b..8b61322 100644 Binary files a/lib/Maya2022/windows/_py3dna.pyd and b/lib/Maya2022/windows/_py3dna.pyd differ diff --git a/lib/Maya2022/windows/_py3dnacalib.pyd b/lib/Maya2022/windows/_py3dnacalib.pyd index b3776c8..daf8f57 100644 Binary files a/lib/Maya2022/windows/_py3dnacalib.pyd and b/lib/Maya2022/windows/_py3dnacalib.pyd differ diff --git a/lib/Maya2022/windows/dna.py b/lib/Maya2022/windows/dna.py index c2f0e9c..a25f827 100644 --- a/lib/Maya2022/windows/dna.py +++ b/lib/Maya2022/windows/dna.py @@ -1,13 +1,22 @@ -# This file was automatically generated by SWIG (http://www.swig.org). -# Version 4.0.1 +# This file was automatically generated by SWIG (https://www.swig.org). +# Version 4.1.1 # -# Do not make changes to this file unless you know what you are doing--modify +# Do not make changes to this file unless you know what you are doing - modify # the SWIG interface file instead. -from sys import version_info as _swig_python_version_info -if _swig_python_version_info < (2, 7, 0): - raise RuntimeError("Python 2.7 or later required") +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass + + + +from sys import version_info as _swig_python_version_info # Import the low-level C/C++ module if __package__ or "." in __name__: from . import _py3dna @@ -29,10 +38,10 @@ def _swig_repr(self): def _swig_setattr_nondynamic_instance_variable(set): def set_instance_attr(self, name, value): - if name == "thisown": - self.this.own(value) - elif name == "this": + if name == "this": set(self, name, value) + elif name == "thisown": + self.this.own(value) elif hasattr(self, name) and isinstance(getattr(type(self), name), property): set(self, name, value) else: @@ -62,22 +71,25 @@ class _SwigNonDynamicMeta(type): -def __new_decorator(factory_func, original_new): - @staticmethod - def __new(cls, *args, **kwargs): -# FIXME: while this workaround solves the immediate issue with the set of classes we currently have, -# it will fail for classes that use a factory function but need no parameters at all, in which case -# the factory function will never be invoked, only the original __new__ function. - if args or kwargs: - return factory_func(*args, **kwargs) - return original_new(cls) - return __new +def with_metaclass(meta, *bases): + class metaclass(type): -def __managed_init(self, *args, **kwargs): - self._args = args - self._kwargs = kwargs + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) class MemoryResource(object): + r""" + MemoryResource is an abstract class that allows the implementation of polymorphic allocators. + Notes: + It's purpose is to allow passing arbitrary allocators through API boundaries, without requiring changes in the + signatures and types involved. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -93,8 +105,12 @@ class MemoryResource(object): # Register MemoryResource in _py3dna: _py3dna.MemoryResource_swigregister(MemoryResource) - class AlignedMemoryResource(MemoryResource): + r""" + A MemoryResource that honors alignment requirements. + See also: MemoryResource + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -110,8 +126,12 @@ class AlignedMemoryResource(MemoryResource): # Register AlignedMemoryResource in _py3dna: _py3dna.AlignedMemoryResource_swigregister(AlignedMemoryResource) - class ArenaMemoryResource(MemoryResource): + r""" + Serves allocations from a preallocated memory region. + See also: MemoryResource + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dna.delete_ArenaMemoryResource @@ -120,18 +140,25 @@ class ArenaMemoryResource(MemoryResource): _py3dna.ArenaMemoryResource_swiginit(self, _py3dna.new_ArenaMemoryResource(*args)) def allocate(self, size, alignment): + r""" All allocations will be served from the currently active memory region.""" return _py3dna.ArenaMemoryResource_allocate(self, size, alignment) def deallocate(self, ptr, size, alignment): + r""" This is a no-op, and the regions are only freed when the arena itself is destroyed.""" return _py3dna.ArenaMemoryResource_deallocate(self, ptr, size, alignment) def getUpstreamMemoryResource(self): + r""" The upstream memory resource was passed through the constructor and is backing all arena allocations.""" return _py3dna.ArenaMemoryResource_getUpstreamMemoryResource(self) # Register ArenaMemoryResource in _py3dna: _py3dna.ArenaMemoryResource_swigregister(ArenaMemoryResource) - class DefaultMemoryResource(MemoryResource): + r""" + A MemoryResource that delegates to malloc / free. + See also: MemoryResource + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -147,7 +174,6 @@ class DefaultMemoryResource(MemoryResource): # Register DefaultMemoryResource in _py3dna: _py3dna.DefaultMemoryResource_swigregister(DefaultMemoryResource) - class StatusCode(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -160,7 +186,6 @@ class StatusCode(object): # Register StatusCode in _py3dna: _py3dna.StatusCode_swigregister(StatusCode) - class Status(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -179,13 +204,6 @@ class Status(object): # Register Status in _py3dna: _py3dna.Status_swigregister(Status) - -def Status_isOk(): - return _py3dna.Status_isOk() - -def Status_get(): - return _py3dna.Status_get() - class Readable(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -194,11 +212,39 @@ class Readable(object): __repr__ = _swig_repr def read(self, *args): + r""" + *Overload 1:* + + Read bytes from stream into the given buffer. + :type destination: string + :param destination: + Destination buffer into which the data is going to be read from the stream. + :type size: std::size_t + :param size: + Number of bytes to read from stream. + :rtype: std::size_t + :return: + Number of bytes read. + + | + + *Overload 2:* + + Read bytes from this stream into the given stream. + :type destination: :py:class:`Writable` + :param destination: + Destination stream into which the data is going to be read from this stream. + :type size: std::size_t + :param size: + Number of bytes to read from stream. + :rtype: std::size_t + :return: + Number of bytes read. + """ return _py3dna.Readable_read(self, *args) # Register Readable in _py3dna: _py3dna.Readable_swigregister(Readable) - class Writable(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -207,11 +253,39 @@ class Writable(object): __repr__ = _swig_repr def write(self, *args): + r""" + *Overload 1:* + + Writes bytes from the given buffer to the stream. + :type source: string + :param source: + Source buffer from which the data is going to be written to the stream. + :type size: std::size_t + :param size: + Number of bytes to write to the stream. + :rtype: std::size_t + :return: + Number of bytes written. + + | + + *Overload 2:* + + Writes bytes from the given stream to this stream. + :type source: :py:class:`Readable` + :param source: + Source stream from which the data is going to be written into this stream. + :type size: std::size_t + :param size: + Number of bytes to write to the stream. + :rtype: std::size_t + :return: + Number of bytes written. + """ return _py3dna.Writable_write(self, *args) # Register Writable in _py3dna: _py3dna.Writable_swigregister(Writable) - class Seekable(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -220,14 +294,25 @@ class Seekable(object): __repr__ = _swig_repr def tell(self): + r""" + Get the current position in the stream. + :rtype: int + :return: + Position in the stream relative to it's start, with 0 denoting the start position. + """ return _py3dna.Seekable_tell(self) def seek(self, position): + r""" + Set the current position in the stream. + :type position: int + :param position: + Position in the stream relative to it's start, with 0 denoting the start position. + """ return _py3dna.Seekable_seek(self, position) # Register Seekable in _py3dna: _py3dna.Seekable_swigregister(Seekable) - class Openable(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -236,11 +321,11 @@ class Openable(object): __repr__ = _swig_repr def open(self): + r""" Open access to the stream.""" return _py3dna.Openable_open(self) # Register Openable in _py3dna: _py3dna.Openable_swigregister(Openable) - class Closeable(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -249,11 +334,11 @@ class Closeable(object): __repr__ = _swig_repr def close(self): + r""" Close access to the stream.""" return _py3dna.Closeable_close(self) # Register Closeable in _py3dna: _py3dna.Closeable_swigregister(Closeable) - class Controllable(Openable, Closeable): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -263,7 +348,6 @@ class Controllable(Openable, Closeable): # Register Controllable in _py3dna: _py3dna.Controllable_swigregister(Controllable) - class Bounded(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -272,11 +356,16 @@ class Bounded(object): __repr__ = _swig_repr def size(self): + r""" + Obtain size of stream in bytes. + :rtype: int + :return: + Size in bytes. + """ return _py3dna.Bounded_size(self) # Register Bounded in _py3dna: _py3dna.Bounded_swigregister(Bounded) - class Buffered(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -285,11 +374,11 @@ class Buffered(object): __repr__ = _swig_repr def flush(self): + r""" Flush the changes to filesystem.""" return _py3dna.Buffered_flush(self) # Register Buffered in _py3dna: _py3dna.Buffered_swigregister(Buffered) - class Resizable(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -298,11 +387,11 @@ class Resizable(object): __repr__ = _swig_repr def resize(self, size): + r""" Resize file to the requested size.""" return _py3dna.Resizable_resize(self, size) # Register Resizable in _py3dna: _py3dna.Resizable_swigregister(Resizable) - class BoundedIOStream(Controllable, Readable, Writable, Seekable, Bounded): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -326,6 +415,8 @@ AccessMode_ReadWrite = _py3dna.AccessMode_ReadWrite OpenMode_Binary = _py3dna.OpenMode_Binary OpenMode_Text = _py3dna.OpenMode_Text class FileStream(BoundedIOStream): + r""" Standard file stream.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -334,23 +425,45 @@ class FileStream(BoundedIOStream): @staticmethod def create(path, accessMode, openMode, memRes=None): + r""" + Factory method for creation of a FileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type openMode: int + :param openMode: + Control whether the file is opened in binary or textual mode. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the FileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.FileStream_create(path, accessMode, openMode, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a FileStream instance. + :type instance: :py:class:`FileStream` + :param instance: + Instance of FileStream to be freed. + See also: create + """ return _py3dna.FileStream_destroy(instance) __swig_destroy__ = _py3dna.delete_FileStream # Register FileStream in _py3dna: _py3dna.FileStream_swigregister(FileStream) - -def FileStream_create(path, accessMode, openMode, memRes=None): - return _py3dna.FileStream_create(path, accessMode, openMode, memRes) - -def FileStream_destroy(instance): - return _py3dna.FileStream_destroy(instance) - class MemoryMappedFileStream(BoundedIOStream, Buffered, Resizable): + r""" Memory mapped file stream.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -359,23 +472,42 @@ class MemoryMappedFileStream(BoundedIOStream, Buffered, Resizable): @staticmethod def create(path, accessMode, memRes=None): + r""" + Factory method for creation of a MemoryMappedFileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryMappedFileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.MemoryMappedFileStream_create(path, accessMode, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a MemoryMappedFileStream instance. + :type instance: :py:class:`MemoryMappedFileStream` + :param instance: + Instance of MemoryMappedFileStream to be freed. + See also: create + """ return _py3dna.MemoryMappedFileStream_destroy(instance) __swig_destroy__ = _py3dna.delete_MemoryMappedFileStream # Register MemoryMappedFileStream in _py3dna: _py3dna.MemoryMappedFileStream_swigregister(MemoryMappedFileStream) - -def MemoryMappedFileStream_create(path, accessMode, memRes=None): - return _py3dna.MemoryMappedFileStream_create(path, accessMode, memRes) - -def MemoryMappedFileStream_destroy(instance): - return _py3dna.MemoryMappedFileStream_destroy(instance) - class MemoryStream(BoundedIOStream): + r""" In-memory stream.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -384,42 +516,193 @@ class MemoryStream(BoundedIOStream): @staticmethod def create(*args): + r""" + *Overload 1:* + + Factory method for creation of a MemoryStream instance. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.MemoryStream_create(*args) @staticmethod def destroy(instance): + r""" + Method for freeing a MemoryStream instance. + :type instance: :py:class:`MemoryStream` + :param instance: + Instance of MemoryStream to be freed. + See also: create + """ return _py3dna.MemoryStream_destroy(instance) __swig_destroy__ = _py3dna.delete_MemoryStream # Register MemoryStream in _py3dna: _py3dna.MemoryStream_swigregister(MemoryStream) -def MemoryStream_create(*args): - return _py3dna.MemoryStream_create(*args) +FileStreamImpl = FileStream -def MemoryStream_destroy(instance): - return _py3dna.MemoryStream_destroy(instance) +class FileStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(FileStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(FileStreamImpl) if name not in ("create","destroy")] + +class FileStream(with_metaclass(FileStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = FileStreamImpl.create(*args, **kwargs) + + def __del__(self): + FileStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -FileStream.__new__ = __new_decorator(FileStream_create, FileStream.__new__) -FileStream.__del__ = lambda instance: FileStream_destroy(instance) -FileStream.__init__ = __managed_init -del FileStream.create -del FileStream.destroy +MemoryMappedFileStreamImpl = MemoryMappedFileStream + +class MemoryMappedFileStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(MemoryMappedFileStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(MemoryMappedFileStreamImpl) if name not in ("create","destroy")] + +class MemoryMappedFileStream(with_metaclass(MemoryMappedFileStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = MemoryMappedFileStreamImpl.create(*args, **kwargs) + + def __del__(self): + MemoryMappedFileStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -MemoryMappedFileStream.__new__ = __new_decorator(MemoryMappedFileStream_create, MemoryMappedFileStream.__new__) -MemoryMappedFileStream.__del__ = lambda instance: MemoryMappedFileStream_destroy(instance) -MemoryMappedFileStream.__init__ = __managed_init -del MemoryMappedFileStream.create -del MemoryMappedFileStream.destroy +MemoryStreamImpl = MemoryStream +class MemoryStreamImplReflectionMixin(type): -MemoryStream.__new__ = __new_decorator(MemoryStream_create, MemoryStream.__new__) -MemoryStream.__del__ = lambda instance: MemoryStream_destroy(instance) -MemoryStream.__init__ = __managed_init -del MemoryStream.create -del MemoryStream.destroy + def __getattr__(cls, name): + return getattr(MemoryStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(MemoryStreamImpl) if name not in ("create","destroy")] + +class MemoryStream(with_metaclass(MemoryStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = MemoryStreamImpl.create(*args, **kwargs) + + def __del__(self): + MemoryStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] FileStream.AccessMode_Read = AccessMode_Read @@ -450,7 +733,6 @@ class StringView(object): # Register StringView in _py3dna: _py3dna.StringView_swigregister(StringView) - def __add__(*args): return _py3dna.__add__(*args) @@ -463,11 +745,11 @@ def __mul__(*args): def __truediv__(*args): return _py3dna.__truediv__(*args) -def __eq__(*args): - return _py3dna.__eq__(*args) +def __eq__(lhs, rhs): + return _py3dna.__eq__(lhs, rhs) -def __ne__(*args): - return _py3dna.__ne__(*args) +def __ne__(lhs, rhs): + return _py3dna.__ne__(lhs, rhs) DataLayer_Descriptor = _py3dna.DataLayer_Descriptor DataLayer_Definition = _py3dna.DataLayer_Definition DataLayer_Behavior = _py3dna.DataLayer_Behavior @@ -507,8 +789,14 @@ class CoordinateSystem(object): # Register CoordinateSystem in _py3dna: _py3dna.CoordinateSystem_swigregister(CoordinateSystem) - class DescriptorReader(object): + r""" + Read-only accessors for various metadata about the character and the rig. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -531,9 +819,31 @@ class DescriptorReader(object): return _py3dna.DescriptorReader_getMetaDataCount(self) def getMetaDataKey(self, index): + r""" + :type index: int + :param index: + A position in the zero-indexed array of key-value pairs. + Warning: + The index must be less than the value returned by getMetaDataCount. + :rtype: :py:class:`StringView` + :return: View over the key name string. + """ return _py3dna.DescriptorReader_getMetaDataKey(self, index) def getMetaDataValue(self, key): + r""" + Stored metadata value associated with the given key. + Notes: + If no value is associated with the given key, the returned view + will contain nullptr and will have a size of 0. + :type key: string + :param key: + A unique-known key that has a value associated to it. + Warning: + The key must be null-terminated. + :rtype: :py:class:`StringView` + :return: View over the metadata value string. + """ return _py3dna.DescriptorReader_getMetaDataValue(self, key) def getTranslationUnit(self): @@ -546,21 +856,43 @@ class DescriptorReader(object): return _py3dna.DescriptorReader_getCoordinateSystem(self) def getLODCount(self): + r""" + Available levels of detail (e.g. 6 which means the following levels are available: + [0,1,2,3,4,5], where 0 is the LOD with the highest details, and 5 is the LOD with + lowest details). + """ return _py3dna.DescriptorReader_getLODCount(self) def getDBMaxLOD(self): + r""" + The maximum level of detail stored in the DNA data for this character. + Notes: + The value is relative to LOD-0 from the database. + """ return _py3dna.DescriptorReader_getDBMaxLOD(self) def getDBComplexity(self): + r""" + Name of the input control interface used to drive this character rig. + Notes: + This parameter denotes the character's input control complexity. + """ return _py3dna.DescriptorReader_getDBComplexity(self) def getDBName(self): + r""" + Name of the database from which the character originates. + Notes: + All characters from the same database must have the same Definition, but may + have different complexity or LOD. + """ return _py3dna.DescriptorReader_getDBName(self) # Register DescriptorReader in _py3dna: _py3dna.DescriptorReader_swigregister(DescriptorReader) - class MeshBlendShapeChannelMapping(object): + r""" Mapping that associates a blend shape channel to it's mesh.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr meshIndex = property(_py3dna.MeshBlendShapeChannelMapping_meshIndex_get, _py3dna.MeshBlendShapeChannelMapping_meshIndex_set) @@ -572,8 +904,14 @@ class MeshBlendShapeChannelMapping(object): # Register MeshBlendShapeChannelMapping in _py3dna: _py3dna.MeshBlendShapeChannelMapping_swigregister(MeshBlendShapeChannelMapping) - class DefinitionReader(DescriptorReader): + r""" + Read-only accessors for DNA attributes that represent the rig's static data. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -584,102 +922,353 @@ class DefinitionReader(DescriptorReader): return _py3dna.DefinitionReader_getGUIControlCount(self) def getGUIControlName(self, index): + r""" + Name of the requested GUI control. + :type index: int + :param index: + A name's position in the zero-indexed array of GUI control names. + Warning: + The index must be less than the value returned by getGUIControlCount. + :rtype: :py:class:`StringView` + :return: View over the GUI control name string. + """ return _py3dna.DefinitionReader_getGUIControlName(self, index) def getRawControlCount(self): return _py3dna.DefinitionReader_getRawControlCount(self) def getRawControlName(self, index): + r""" + Name of the requested raw control. + :type index: int + :param index: + A name's position in the zero-indexed array of raw control names. + Warning: + The index must be less than the value returned by getRawControlCount. + :rtype: :py:class:`StringView` + :return: View over the control name string. + """ return _py3dna.DefinitionReader_getRawControlName(self, index) def getJointCount(self): return _py3dna.DefinitionReader_getJointCount(self) def getJointName(self, index): + r""" + Name of the requested joint. + :type index: int + :param index: + A name's position in the zero-indexed array of joint names. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: :py:class:`StringView` + :return: View over the joint name string. + """ return _py3dna.DefinitionReader_getJointName(self, index) def getJointIndexListCount(self): + r""" + Number of joint index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getJointIndexListCount(self) def getJointIndicesForLOD(self, lod): + r""" + List of joint indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which joints are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the joint indices. + See also: getLODCount + See also: getJointName + """ return _py3dna.DefinitionReader_getJointIndicesForLOD(self, lod) def getJointParentIndex(self, index): + r""" + Index of the requested joint's parent. + Notes: + The joint hierarchy may be traversed and reconstructed using this function. Example: + Joint names: [A, B, C, D, E, F, G, H, I] + Hierarchy: [0, 0, 0, 1, 1, 4, 2, 6, 2] + Describes the following hierarchy: + A + + B + | + D + | + E + | + F + + C + + G + | + H + + I + + Requesting the parent index of joint 5 (joint name: F) would return 4 (joint name: E). + Requesting the parent index of the root joint: 0 (joint name: A) would return the same index 0. + An out of bounds request (an index greater than the number of joints returns UINT16_MAX). + :type index: int + :param index: + The joint index which parent is being requested. + """ return _py3dna.DefinitionReader_getJointParentIndex(self, index) def getBlendShapeChannelCount(self): return _py3dna.DefinitionReader_getBlendShapeChannelCount(self) def getBlendShapeChannelName(self, index): + r""" + Name of the requested blend shape channel. + :type index: int + :param index: + A name's position in the zero-indexed array of blend shape channel names. + Warning: + The index must be less than the value returned by BlendShapeChannelExtentReader::getBlendShapeChannelCount. + :rtype: :py:class:`StringView` + :return: View over the blend shape channel name string. + """ return _py3dna.DefinitionReader_getBlendShapeChannelName(self, index) def getBlendShapeChannelIndexListCount(self): + r""" + Number of blend shape channel index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getBlendShapeChannelIndexListCount(self) def getBlendShapeChannelIndicesForLOD(self, lod): + r""" + List of blend shape channel indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which blend shape channels are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the blend shape channel indices. + + These LOD indices are not interchangeable with the LOD values from BehaviorReader::getBlendShapeChannelLODs. + See also: getLODCount + See also: getBlendShapeChannelName + """ return _py3dna.DefinitionReader_getBlendShapeChannelIndicesForLOD(self, lod) def getAnimatedMapCount(self): return _py3dna.DefinitionReader_getAnimatedMapCount(self) def getAnimatedMapName(self, index): + r""" + Name of the requested animated map. + :type index: int + :param index: + A name's position in the zero-indexed array of animated map names. + Warning: + The index must be less than the value returned by getAnimatedMapCount. + :rtype: :py:class:`StringView` + :return: View over the animated map name string. + """ return _py3dna.DefinitionReader_getAnimatedMapName(self, index) def getAnimatedMapIndexListCount(self): + r""" + Number of animated map index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getAnimatedMapIndexListCount(self) def getAnimatedMapIndicesForLOD(self, lod): + r""" + List of animated map indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which animated maps are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the animated map indices. + See also: getLODCount + See also: getAnimatedMapName + """ return _py3dna.DefinitionReader_getAnimatedMapIndicesForLOD(self, lod) def getMeshCount(self): return _py3dna.DefinitionReader_getMeshCount(self) def getMeshName(self, index): + r""" + Name of the requested mesh. + :type index: int + :param index: + A name's position in the zero-indexed array of mesh names. + Warning: + The index must be less than the value returned by getMeshCount. + :rtype: :py:class:`StringView` + :return: View over the mesh name string. + """ return _py3dna.DefinitionReader_getMeshName(self, index) def getMeshIndexListCount(self): + r""" + Number of mesh index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getMeshIndexListCount(self) def getMeshIndicesForLOD(self, lod): + r""" + List of mesh indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which meshes are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the mesh indices. + See also: getLODCount + See also: getMeshName + """ return _py3dna.DefinitionReader_getMeshIndicesForLOD(self, lod) def getMeshBlendShapeChannelMappingCount(self): + r""" Number of mesh-blend shape channel mapping items.""" return _py3dna.DefinitionReader_getMeshBlendShapeChannelMappingCount(self) def getMeshBlendShapeChannelMapping(self, index): + r""" + :type index: int + :param index: + A mapping's position in the zero-indexed array of mesh-blend shape channel mappings. + Warning: + The index must be less than the value returned by getMeshBlendShapeChannelMappingCount. + :rtype: :py:class:`MeshBlendShapeChannelMapping` + :return: A structure holding the mesh index and the associated blend shape channel index. + """ return _py3dna.DefinitionReader_getMeshBlendShapeChannelMapping(self, index) def getMeshBlendShapeChannelMappingIndicesForLOD(self, lod): + r""" + List of mesh-blend shape channel mapping indices for the specified LOD. + Notes: + The indices from this list can be used with the getMeshBlendShapeChannelMapping API + to retrieve individual mapping items. + :type lod: int + :param lod: + The level of detail which meshes are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the mesh blend shape channel mapping indices. + See also: getLODCount + See also: getMeshBlendShapeChannelMapping + """ return _py3dna.DefinitionReader_getMeshBlendShapeChannelMappingIndicesForLOD(self, lod) def getNeutralJointTranslation(self, index): + r""" + :type index: int + :param index: + A joint's position in the zero-indexed array of joint translations. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: dna::Vector3 + :return: The joint's translation (x, y, z). + """ return _py3dna.DefinitionReader_getNeutralJointTranslation(self, index) def getNeutralJointTranslationXs(self): + r""" + List of all translation X values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getNeutralJointTranslation + """ return _py3dna.DefinitionReader_getNeutralJointTranslationXs(self) def getNeutralJointTranslationYs(self): + r""" + List of all translation Y values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getNeutralJointTranslation + """ return _py3dna.DefinitionReader_getNeutralJointTranslationYs(self) def getNeutralJointTranslationZs(self): + r""" + List of all translation Z values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getNeutralJointTranslation + """ return _py3dna.DefinitionReader_getNeutralJointTranslationZs(self) def getNeutralJointRotation(self, index): + r""" + :type index: int + :param index: + A joint's position in the zero-indexed array of joint rotations. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: dna::Vector3 + :return: The joint's rotation (x, y, z). + """ return _py3dna.DefinitionReader_getNeutralJointRotation(self, index) def getNeutralJointRotationXs(self): + r""" + List of all rotation X values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getNeutralJointRotation + """ return _py3dna.DefinitionReader_getNeutralJointRotationXs(self) def getNeutralJointRotationYs(self): + r""" + List of all rotation Y values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getNeutralJointRotation + """ return _py3dna.DefinitionReader_getNeutralJointRotationYs(self) def getNeutralJointRotationZs(self): + r""" + List of all rotation Z values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getNeutralJointRotation + """ return _py3dna.DefinitionReader_getNeutralJointRotationZs(self) # Register DefinitionReader in _py3dna: _py3dna.DefinitionReader_swigregister(DefinitionReader) - class BehaviorReader(DefinitionReader): + r""" + Read-only accessors for DNA attributes that define the rig's evaluation. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -687,96 +1276,284 @@ class BehaviorReader(DefinitionReader): __repr__ = _swig_repr def getGUIToRawInputIndices(self): + r""" + Input indices used for mapping gui to raw controls. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ return _py3dna.BehaviorReader_getGUIToRawInputIndices(self) def getGUIToRawOutputIndices(self): + r""" + Output indices used for mapping gui to raw controls. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ return _py3dna.BehaviorReader_getGUIToRawOutputIndices(self) def getGUIToRawFromValues(self): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getGUIToRawFromValues(self) def getGUIToRawToValues(self): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getGUIToRawToValues(self) def getGUIToRawSlopeValues(self): + r""" + Computational values(slope/gradient) used for calculating the + output value during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getGUIToRawSlopeValues(self) def getGUIToRawCutValues(self): + r""" + Computational values(vertical intercept) used for calculating the + output value during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getGUIToRawCutValues(self) def getPSDCount(self): + r""" The number of distinct PSD expressions.""" return _py3dna.BehaviorReader_getPSDCount(self) def getPSDRowIndices(self): + r""" + PSD(input) indices. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of PSD indices. + """ return _py3dna.BehaviorReader_getPSDRowIndices(self) def getPSDColumnIndices(self): + r""" + Control(input) indices. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of control indices. + """ return _py3dna.BehaviorReader_getPSDColumnIndices(self) def getPSDValues(self): + r""" + Weights associated with each PSD row and column pair. + :rtype: dna::ConstArrayView< float > + :return: View over the array of weights. + """ return _py3dna.BehaviorReader_getPSDValues(self) def getJointRowCount(self): + r""" Number of rows in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorReader_getJointRowCount(self) def getJointColumnCount(self): + r""" Number of columns in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorReader_getJointColumnCount(self) def getJointVariableAttributeIndices(self, lod): + r""" + Joint attribute indices (output indices) for the requested LOD. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of joint indices. + """ return _py3dna.BehaviorReader_getJointVariableAttributeIndices(self, lod) def getJointGroupCount(self): + r""" Number of joint groups present in the entire joint matrix.""" return _py3dna.BehaviorReader_getJointGroupCount(self) def getJointGroupLODs(self, jointGroupIndex): + r""" + Number of rows per each level of detail for the requested joint group. + Notes: + Each element's position represents the level itself, while the value denotes + the number of rows within the joint group belonging to that level. e.g.: + [12, 9, 3] + | | + LOD-2 contains first 3 rows + | + LOD-1 contains first 9 rows + + LOD-0 contains first 12 rows + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ return _py3dna.BehaviorReader_getJointGroupLODs(self, jointGroupIndex) def getJointGroupInputIndices(self, jointGroupIndex): + r""" + Column indices that the requested joint group contains. + Notes: + The column indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of column indices. + """ return _py3dna.BehaviorReader_getJointGroupInputIndices(self, jointGroupIndex) def getJointGroupOutputIndices(self, jointGroupIndex): + r""" + Row indices that the requested joint group contains. + Notes: + The row indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of row indices. + """ return _py3dna.BehaviorReader_getJointGroupOutputIndices(self, jointGroupIndex) def getJointGroupValues(self, jointGroupIndex): + r""" + Values that the requested joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< float > + :return: View over the array of values. + """ return _py3dna.BehaviorReader_getJointGroupValues(self, jointGroupIndex) def getJointGroupJointIndices(self, jointGroupIndex): + r""" + Joint indices that the requested joint group contains. + Notes: + These joint indices can be used to get the joint names through DefinitionReader::getJointName. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of joint indices. + See also: DefinitionReader + """ return _py3dna.BehaviorReader_getJointGroupJointIndices(self, jointGroupIndex) def getBlendShapeChannelLODs(self): + r""" + Input index count per each level of detail for blend shape channels. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of input indices belonging to that level. + Warning: + These LOD values are not interchangeable with the LOD indices from DefinitionReader::getBlendShapeChannelIndicesForLOD. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ return _py3dna.BehaviorReader_getBlendShapeChannelLODs(self) def getBlendShapeChannelInputIndices(self): + r""" + Input indices used to index into the input vector. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ return _py3dna.BehaviorReader_getBlendShapeChannelInputIndices(self) def getBlendShapeChannelOutputIndices(self): + r""" + Output indices specify the positions of blend shape channel output values. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ return _py3dna.BehaviorReader_getBlendShapeChannelOutputIndices(self) def getAnimatedMapLODs(self): + r""" + Row count per each level of detail for animated maps. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of rows (within the conditional table), + belonging to that level. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ return _py3dna.BehaviorReader_getAnimatedMapLODs(self) def getAnimatedMapInputIndices(self): + r""" + Input indices used to index into the array of input values. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ return _py3dna.BehaviorReader_getAnimatedMapInputIndices(self) def getAnimatedMapOutputIndices(self): + r""" + Output indices that specify the computed output value's position. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ return _py3dna.BehaviorReader_getAnimatedMapOutputIndices(self) def getAnimatedMapFromValues(self): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getAnimatedMapFromValues(self) def getAnimatedMapToValues(self): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getAnimatedMapToValues(self) def getAnimatedMapSlopeValues(self): + r""" + Computational values(slope/gradient) used for calculating the output value. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getAnimatedMapSlopeValues(self) def getAnimatedMapCutValues(self): + r""" + Computational values(vertical intercept) used for calculating the output value. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getAnimatedMapCutValues(self) # Register BehaviorReader in _py3dna: _py3dna.BehaviorReader_swigregister(BehaviorReader) - class GeometryReader(DefinitionReader): + r""" + Read-only accessors to the geometry data associated with a rig. + Warning: + Implementors should inherit from Reader itself and not this class. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -784,108 +1561,559 @@ class GeometryReader(DefinitionReader): __repr__ = _swig_repr def getVertexPositionCount(self, meshIndex): + r""" + Number of vertex positions in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexPositionCount(self, meshIndex) def getVertexPosition(self, meshIndex, vertexIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + The index of the vertex position in the zero-indexed array of vertex positions. + + vertexIndex must be less than the value returned by getVertexPositionCount. + Notes: + The vertices are sorted by the vertex ID. + :rtype: dna::Position + :return: The vertex position. + """ return _py3dna.GeometryReader_getVertexPosition(self, meshIndex, vertexIndex) def getVertexPositionXs(self, meshIndex): + r""" + List of all vertex position X values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getVertexPosition + """ return _py3dna.GeometryReader_getVertexPositionXs(self, meshIndex) def getVertexPositionYs(self, meshIndex): + r""" + List of all vertex position Y values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getVertexPosition + """ return _py3dna.GeometryReader_getVertexPositionYs(self, meshIndex) def getVertexPositionZs(self, meshIndex): + r""" + List of all vertex position Z values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getVertexPosition + """ return _py3dna.GeometryReader_getVertexPositionZs(self, meshIndex) def getVertexTextureCoordinateCount(self, meshIndex): + r""" + Number of texture coordinates in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexTextureCoordinateCount(self, meshIndex) def getVertexTextureCoordinate(self, meshIndex, textureCoordinateIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type textureCoordinateIndex: int + :param textureCoordinateIndex: + The index of the texture coordinate in the zero-indexed array of texture coordinates. + + textureCoordinateIndex must be less than the value returned by getVertexTextureCoordinateCount. + :rtype: dna::TextureCoordinate + :return: The texture coordinate. + """ return _py3dna.GeometryReader_getVertexTextureCoordinate(self, meshIndex, textureCoordinateIndex) def getVertexTextureCoordinateUs(self, meshIndex): + r""" + List of all texture coordinate U values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexTextureCoordinate. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all U values. + See also: getVertexTextureCoordinate + """ return _py3dna.GeometryReader_getVertexTextureCoordinateUs(self, meshIndex) def getVertexTextureCoordinateVs(self, meshIndex): + r""" + List of all texture coordinate V values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexTextureCoordinate. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all V values. + See also: getVertexTextureCoordinate + """ return _py3dna.GeometryReader_getVertexTextureCoordinateVs(self, meshIndex) def getVertexNormalCount(self, meshIndex): + r""" + Number of vertex normals in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexNormalCount(self, meshIndex) def getVertexNormal(self, meshIndex, normalIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type normalIndex: int + :param normalIndex: + The index of the vertex normal in the zero-indexed array of vertex normals. + + normalIndex must be less than the value returned by getVertexNormalCount. + :rtype: dna::Normal + :return: The vertex normal. + """ return _py3dna.GeometryReader_getVertexNormal(self, meshIndex, normalIndex) def getVertexNormalXs(self, meshIndex): + r""" + List of all normal X values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexNormalXs(self, meshIndex) def getVertexNormalYs(self, meshIndex): + r""" + List of all normal Y value for the referenced meshs. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexNormalYs(self, meshIndex) def getVertexNormalZs(self, meshIndex): + r""" + List of all normal Z values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexNormalZs(self, meshIndex) def getVertexLayoutCount(self, meshIndex): + r""" + Number of vertex layouts in the entire mesh. + Notes: + A vertex layout is a collection of vertex attributes. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexLayoutCount(self, meshIndex) def getVertexLayout(self, meshIndex, layoutIndex): + r""" + Vertex layouts contain only attribute indices which can be used to query + the actual attributes, such as positions, texture coordinates and normals, + which are associated with the vertex. + Notes: + The indices from a layout are usable with the above defined APIs. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type layoutIndex: int + :param layoutIndex: + The index of the layout in the zero-indexed array of vertex layouts. + + layoutIndex must be less than the value returned by getVertexLayoutCount. + See also: getVertexPosition + See also: getVertexTextureCoordinate + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexLayout(self, meshIndex, layoutIndex) def getVertexLayoutPositionIndices(self, meshIndex): + r""" + Position indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex position indices values. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getVertexLayoutPositionIndices(self, meshIndex) def getVertexLayoutTextureCoordinateIndices(self, meshIndex): + r""" + Texture coordinate indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex texture coordinate indices. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getVertexLayoutTextureCoordinateIndices(self, meshIndex) def getVertexLayoutNormalIndices(self, meshIndex): + r""" + Normal indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex normal indices. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getVertexLayoutNormalIndices(self, meshIndex) def getFaceCount(self, meshIndex): + r""" + Number of faces that belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getFaceCount(self, meshIndex) def getFaceVertexLayoutIndices(self, meshIndex, faceIndex): + r""" + List of vertex layout indices the belong to a face on the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type faceIndex: int + :param faceIndex: + A face's position in the zero-indexed array of faces that belong to + the above referenced mesh. + + faceIndex must be less than the value returned by getFaceCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over the list of vertex layout indices. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getFaceVertexLayoutIndices(self, meshIndex, faceIndex) def getMaximumInfluencePerVertex(self, meshIndex): + r""" + The maximum number of joints that may influence any single vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getMaximumInfluencePerVertex(self, meshIndex) def getSkinWeightsCount(self, meshIndex): + r""" + Number of skin weights associated with the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getSkinWeightsCount(self, meshIndex) def getSkinWeightsValues(self, meshIndex, vertexIndex): + r""" + List of skin weights influencing the requested vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertices. + + vertexIndex must be less than the value returned by getVertexPositionCount. + :rtype: dna::ConstArrayView< float > + :return: View over the list of skin weights. + """ return _py3dna.GeometryReader_getSkinWeightsValues(self, meshIndex, vertexIndex) def getSkinWeightsJointIndices(self, meshIndex, vertexIndex): + r""" + List of joint indices associated with each skin weight for the specified vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertices. + + vertexIndex must be less than the value returned by getVertexPositionCount. + Notes: + The joint indices are stored in the same order as the weights they + are associated with. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the list of joint indices. + """ return _py3dna.GeometryReader_getSkinWeightsJointIndices(self, meshIndex, vertexIndex) def getBlendShapeTargetCount(self, meshIndex): + r""" + Number of blend shapes that belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getBlendShapeTargetCount(self, meshIndex) def getBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex): + r""" + The matching blend shape channel index of the requested blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + See also: DefinitionReader::getBlendShapeChannelName + """ return _py3dna.GeometryReader_getBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDeltaCount(self, meshIndex, blendShapeTargetIndex): + r""" + Number of deltas that belong to the specified blend shape. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaCount(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDelta(self, meshIndex, blendShapeTargetIndex, deltaIndex): + r""" + List of deltas for each affected vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :type deltaIndex: int + :param deltaIndex: + A position in the zero-indexed array of blend shapes deltas. + + deltaIndex must be less than the value returned by getBlendShapeTargetDeltaCount. + """ return _py3dna.GeometryReader_getBlendShapeTargetDelta(self, meshIndex, blendShapeTargetIndex, deltaIndex) def getBlendShapeTargetDeltaXs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta X values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getBlendShapeTargetDelta + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaXs(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDeltaYs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta Y values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getBlendShapeTargetDelta + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaYs(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDeltaZs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta Z values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getBlendShapeTargetDelta + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaZs(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex): + r""" + Vertex position indices affected by the referenced blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + Notes: + The vertex position indices are stored in the same order as the deltas they + are associated with. + These indices can be used to query the associated vertices themselves through getVertexPosition. + See also: getVertexPosition + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over the list of vertex position indices. + """ return _py3dna.GeometryReader_getBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex) # Register GeometryReader in _py3dna: _py3dna.GeometryReader_swigregister(GeometryReader) - class Reader(BehaviorReader, GeometryReader): + r""" + The abstract Reader which its implementations are expected to inherit. + Notes: + This class combines the various different reader interfaces into a single interface. + The artificial separation into multiple interfaces mirrors the DNA file structure that + is separated into matching layers under the same names. As these layers can be + selectively loaded, it might be convenient to slice-off interfaces which layers were + not loaded. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -894,11 +2122,16 @@ class Reader(BehaviorReader, GeometryReader): __swig_destroy__ = _py3dna.delete_Reader def unload(self, layer): + r""" + Unload all data of the specified layer and all layers dependent on it. + :type layer: int + :param layer: + Layer which data should be unloaded. + """ return _py3dna.Reader_unload(self, layer) # Register Reader in _py3dna: _py3dna.Reader_swigregister(Reader) - class StreamReader(Reader): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -908,6 +2141,7 @@ class StreamReader(Reader): __swig_destroy__ = _py3dna.delete_StreamReader def read(self): + r""" read data from stream into internal structures.""" return _py3dna.StreamReader_read(self) # Register StreamReader in _py3dna: @@ -925,22 +2159,193 @@ class BinaryStreamReader(StreamReader): @staticmethod def create(*args): + r""" + *Overload 1:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int, optional + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int, optional + :param maxLOD: + The maximum level of details to be loaded. + + A value of zero indicates to load all LODs. + Warning: + The maxLOD value must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 4:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 5:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.BinaryStreamReader_create(*args) @staticmethod def destroy(instance): + r""" + Method for freeing a BinaryStreamReader instance. + :type instance: :py:class:`BinaryStreamReader` + :param instance: + Instance of BinaryStreamReader to be freed. + See also: create + """ return _py3dna.BinaryStreamReader_destroy(instance) __swig_destroy__ = _py3dna.delete_BinaryStreamReader # Register BinaryStreamReader in _py3dna: _py3dna.BinaryStreamReader_swigregister(BinaryStreamReader) - -def BinaryStreamReader_create(*args): - return _py3dna.BinaryStreamReader_create(*args) - -def BinaryStreamReader_destroy(instance): - return _py3dna.BinaryStreamReader_destroy(instance) - class JSONStreamReader(StreamReader): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -950,37 +2355,128 @@ class JSONStreamReader(StreamReader): @staticmethod def create(stream, memRes=None): + r""" + Factory method for creation of JSONStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.JSONStreamReader_create(stream, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a JSONStreamReader instance. + :type instance: :py:class:`JSONStreamReader` + :param instance: + Instance of JSONStreamReader to be freed. + See also: create + """ return _py3dna.JSONStreamReader_destroy(instance) __swig_destroy__ = _py3dna.delete_JSONStreamReader # Register JSONStreamReader in _py3dna: _py3dna.JSONStreamReader_swigregister(JSONStreamReader) -def JSONStreamReader_create(stream, memRes=None): - return _py3dna.JSONStreamReader_create(stream, memRes) +BinaryStreamReaderImpl = BinaryStreamReader -def JSONStreamReader_destroy(instance): - return _py3dna.JSONStreamReader_destroy(instance) +class BinaryStreamReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(BinaryStreamReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(BinaryStreamReaderImpl) if name not in ("create","destroy")] + +class BinaryStreamReader(with_metaclass(BinaryStreamReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = BinaryStreamReaderImpl.create(*args, **kwargs) + + def __del__(self): + BinaryStreamReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -BinaryStreamReader.__new__ = __new_decorator(BinaryStreamReader_create, BinaryStreamReader.__new__) -BinaryStreamReader.__del__ = lambda instance: BinaryStreamReader_destroy(instance) -BinaryStreamReader.__init__ = __managed_init -del BinaryStreamReader.create -del BinaryStreamReader.destroy +JSONStreamReaderImpl = JSONStreamReader +class JSONStreamReaderImplReflectionMixin(type): -JSONStreamReader.__new__ = __new_decorator(JSONStreamReader_create, JSONStreamReader.__new__) -JSONStreamReader.__del__ = lambda instance: JSONStreamReader_destroy(instance) -JSONStreamReader.__init__ = __managed_init -del JSONStreamReader.create -del JSONStreamReader.destroy + def __getattr__(cls, name): + return getattr(JSONStreamReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(JSONStreamReaderImpl) if name not in ("create","destroy")] + +class JSONStreamReader(with_metaclass(JSONStreamReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = JSONStreamReaderImpl.create(*args, **kwargs) + + def __del__(self): + JSONStreamReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] class DescriptorWriter(object): + r""" + Write-only accessors to various metadata about the character and the rig. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -988,6 +2484,13 @@ class DescriptorWriter(object): __repr__ = _swig_repr def setName(self, name): + r""" + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an allocation. + """ return _py3dna.DescriptorWriter_setName(self, name) def setArchetype(self, archetype): @@ -1000,9 +2503,23 @@ class DescriptorWriter(object): return _py3dna.DescriptorWriter_setAge(self, age) def clearMetaData(self): + r""" Empties the metadata storage, delete all key-value pairs.""" return _py3dna.DescriptorWriter_clearMetaData(self) def setMetaData(self, key, value): + r""" + Associate the metadata value with the given key. + :type key: string + :param key: + A unique, null-terminated key, to which the given value will be assigned. + :type value: string + :param value: + A null-terminated, metadata value, which is to be assigned to the given key. + Notes: + Consecutive calls using the same key will overwrite any existing data. + + Passing nullptr as the value argument will cause the associated key to be deleted. + """ return _py3dna.DescriptorWriter_setMetaData(self, key, value) def setTranslationUnit(self, unit): @@ -1015,21 +2532,52 @@ class DescriptorWriter(object): return _py3dna.DescriptorWriter_setCoordinateSystem(self, system) def setLODCount(self, lodCount): + r""" + Available levels of detail (e.g. 6 which means the following levels are available: + [0,1,2,3,4,5], where 0 is the LOD with the highest details, and 5 is the LOD with + lowest details). + :type lodCount: int + :param lodCount: + The number of levels available. + """ return _py3dna.DescriptorWriter_setLODCount(self, lodCount) def setDBMaxLOD(self, lod): + r""" The maximum level of detail stored in the DNA data for this character.""" return _py3dna.DescriptorWriter_setDBMaxLOD(self, lod) def setDBComplexity(self, name): + r""" + Name of the input control interface used to drive this character rig. + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DescriptorWriter_setDBComplexity(self, name) def setDBName(self, name): + r""" + Name of the database from which the character originates. + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DescriptorWriter_setDBName(self, name) # Register DescriptorWriter in _py3dna: _py3dna.DescriptorWriter_swigregister(DescriptorWriter) - class DefinitionWriter(DescriptorWriter): + r""" + Write-only accessors for DNA attributes that represent the rig's static data. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1037,108 +2585,391 @@ class DefinitionWriter(DescriptorWriter): __repr__ = _swig_repr def clearGUIControlNames(self): + r""" Delete all stored GUI control names.""" return _py3dna.DefinitionWriter_clearGUIControlNames(self) def setGUIControlName(self, index, name): + r""" + Name of the specified GUI control. + :type index: int + :param index: + A name's position in the zero-indexed array of GUI control names. + Notes: + The control name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setGUIControlName(self, index, name) def clearRawControlNames(self): + r""" Delete all stored raw control names.""" return _py3dna.DefinitionWriter_clearRawControlNames(self) def setRawControlName(self, index, name): + r""" + Name of the specified raw control. + :type index: int + :param index: + A name's position in the zero-indexed array of raw control names. + Notes: + The control name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setRawControlName(self, index, name) def clearJointNames(self): + r""" Delete all stored joint names.""" return _py3dna.DefinitionWriter_clearJointNames(self) def setJointName(self, index, name): + r""" + Name of the specified joint. + :type index: int + :param index: + A name's position in the zero-indexed array of joint names. + Notes: + The joint name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setJointName(self, index, name) def clearJointIndices(self): + r""" Delete all stored joint indices.""" return _py3dna.DefinitionWriter_clearJointIndices(self) def setJointIndices(self, index, jointIndices): + r""" + Store a list of joint indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where joint indices are stored. + Notes: + The index denotes the position of an entire joint index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of joint indices. + + The joint index storage will be implicitly resized (if needed) to provide + storage for the number of joint indices that is inferred from the specified index. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + + These indices can be used to access joint names through DefinitionReader::getJointName. + :type count: int + :param count: + The number of joint indices to copy. + """ return _py3dna.DefinitionWriter_setJointIndices(self, index, jointIndices) def clearLODJointMappings(self): + r""" Delete all stored LOD to joint list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODJointMappings(self) def setLODJointMapping(self, lod, index): + r""" + Set which joints belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the joints are being associated. + :type index: int + :param index: + The index onto which joints indices were assigned using setJointIndices. + See also: setJointIndices + """ return _py3dna.DefinitionWriter_setLODJointMapping(self, lod, index) def clearBlendShapeChannelNames(self): + r""" Delete all stored blend shape channel names.""" return _py3dna.DefinitionWriter_clearBlendShapeChannelNames(self) def setBlendShapeChannelName(self, index, name): + r""" + Name of the specified blend shape channel. + :type index: int + :param index: + A name's position in the zero-indexed array of blend shape channel names. + Notes: + The blend shape channel name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setBlendShapeChannelName(self, index, name) def clearBlendShapeChannelIndices(self): + r""" Delete all stored blend shape channel indices.""" return _py3dna.DefinitionWriter_clearBlendShapeChannelIndices(self) def setBlendShapeChannelIndices(self, index, blendShapeChannelIndices): + r""" + Store a list of blend shape channel name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where blend shape channel name indices are stored. + Notes: + The index denotes the position of an entire blend shape channel index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of blend shape channel indices. + + The blend shape channel index storage will be implicitly resized (if needed) to provide storage + for the number of blend shape channel name indices that is inferred from the specified index. + :type blendShapeChannelIndices: int + :param blendShapeChannelIndices: + The source address from which the blend shape channel name indices are to be copied. + + These indices can be used to access blend shape channel names through DefinitionReader::getBlendShapeChannelName. + :type count: int + :param count: + The number of blend shape channel name indices to copy. + """ return _py3dna.DefinitionWriter_setBlendShapeChannelIndices(self, index, blendShapeChannelIndices) def clearLODBlendShapeChannelMappings(self): + r""" Delete all stored LOD to blend shape channel list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODBlendShapeChannelMappings(self) def setLODBlendShapeChannelMapping(self, lod, index): + r""" + Set which blend shape channels belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the blend shape channels are being associated. + :type index: int + :param index: + The index onto which blend shape channel name indices were assigned using setBlendShapeChannelIndices. + Warning: + The LOD indices set here are not interchangeable with the LOD values set in BehaviorWriter::setBlendShapeChannelLODs. + See also: setBlendShapeChannelIndices + """ return _py3dna.DefinitionWriter_setLODBlendShapeChannelMapping(self, lod, index) def clearAnimatedMapNames(self): + r""" Delete all stored animated map names.""" return _py3dna.DefinitionWriter_clearAnimatedMapNames(self) def setAnimatedMapName(self, index, name): + r""" + Name of the specified animated map. + :type index: int + :param index: + A name's position in the zero-indexed array of animated map names. + Notes: + The animated map name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setAnimatedMapName(self, index, name) def clearAnimatedMapIndices(self): + r""" Delete all stored animated map indices.""" return _py3dna.DefinitionWriter_clearAnimatedMapIndices(self) def setAnimatedMapIndices(self, index, animatedMapIndices): + r""" + Store a list of animated map name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where animated map name indices are stored. + Notes: + The index denotes the position of an entire animated map index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of animated map indices. + + The animated map index storage will be implicitly resized (if needed) to provide storage + for the number of animated map name indices that is inferred from the specified index. + :type animatedMapIndices: int + :param animatedMapIndices: + The source address from which the animated map name indices are to be copied. + + These indices can be used to access animated map names through DefinitionReader::getAnimatedMapName. + :type count: int + :param count: + The number of animated map name indices to copy. + """ return _py3dna.DefinitionWriter_setAnimatedMapIndices(self, index, animatedMapIndices) def clearLODAnimatedMapMappings(self): + r""" Delete all stored LOD to animated map list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODAnimatedMapMappings(self) def setLODAnimatedMapMapping(self, lod, index): + r""" + Set which animated maps belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the animated maps are being associated. + :type index: int + :param index: + The index onto which animated map indices were assigned using setAnimatedMapIndices. + See also: setAnimatedMapIndices + """ return _py3dna.DefinitionWriter_setLODAnimatedMapMapping(self, lod, index) def clearMeshNames(self): + r""" Delete all stored mesh names.""" return _py3dna.DefinitionWriter_clearMeshNames(self) def setMeshName(self, index, name): + r""" + Name of the specified mesh. + :type index: int + :param index: + A name's position in the zero-indexed array of mesh names. + Notes: + The mesh name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setMeshName(self, index, name) def clearMeshIndices(self): + r""" Delete all stored mesh indices.""" return _py3dna.DefinitionWriter_clearMeshIndices(self) def setMeshIndices(self, index, meshIndices): + r""" + Store a list of mesh name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where mesh name indices are stored. + Notes: + The index denotes the position of an entire mesh index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of mesh indices. + + The mesh index storage will be implicitly resized (if needed) to provide storage + for the number of mesh name indices that is inferred from the specified index. + :type meshIndices: int + :param meshIndices: + The source address from which the mesh name indices are to be copied. + + These indices can be used to access mesh names through DefinitionReader::getMeshName. + :type count: int + :param count: + The number of mesh name indices to copy. + """ return _py3dna.DefinitionWriter_setMeshIndices(self, index, meshIndices) def clearLODMeshMappings(self): + r""" Delete all stored LOD to mesh list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODMeshMappings(self) def setLODMeshMapping(self, lod, index): + r""" + Set which meshes belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the meshes are being associated. + :type index: int + :param index: + The index onto which mesh indices were assigned using setMeshIndices. + See also: setMeshIndices + """ return _py3dna.DefinitionWriter_setLODMeshMapping(self, lod, index) def clearMeshBlendShapeChannelMappings(self): + r""" Delete all stored mesh to blend shape channel mapping entries.""" return _py3dna.DefinitionWriter_clearMeshBlendShapeChannelMappings(self) def setMeshBlendShapeChannelMapping(self, index, meshIndex, blendShapeChannelIndex): + r""" + Associate a blend shape channel with it's mesh. + :type index: int + :param index: + A mapping's position in the zero-indexed array of mesh-blend shape channel mappings. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of mesh names. + :type blendShapeChannelIndex: int + :param blendShapeChannelIndex: + A blend shape channel's position in the zero-indexed array of blend shape channel names. + """ return _py3dna.DefinitionWriter_setMeshBlendShapeChannelMapping(self, index, meshIndex, blendShapeChannelIndex) def setJointHierarchy(self, jointIndices): + r""" + A simple array describing the parent-child relationships between joints. + Notes: + Example: + Joint names: [A, B, C, D, E, F, G, H] + Hierarchy: [0, 0, 0, 1, 1, 4, 2, 2] + Describes the following hierarchy: + A + + B + | + D + | + E + | + F + + C + + G + + H + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + + These indices can be used to access joint names through DefinitionReader::getJointName. + :type count: int + :param count: + The number of joint indices to copy. + """ return _py3dna.DefinitionWriter_setJointHierarchy(self, jointIndices) def setNeutralJointTranslations(self, translations): + r""" + :type translations: dna::Vector3 + :param translations: + The source address from which the translations are to be copied. + :type count: int + :param count: + The number of translation values to copy. + """ return _py3dna.DefinitionWriter_setNeutralJointTranslations(self, translations) def setNeutralJointRotations(self, rotations): + r""" + :type rotations: dna::Vector3 + :param rotations: + The source address from which the rotations are to be copied. + :type count: int + :param count: + The number of rotation values to copy. + """ return _py3dna.DefinitionWriter_setNeutralJointRotations(self, rotations) # Register DefinitionWriter in _py3dna: _py3dna.DefinitionWriter_swigregister(DefinitionWriter) - class BehaviorWriter(DefinitionWriter): + r""" + Write-only accessors for DNA attributes that define the rig's evaluation. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1146,96 +2977,387 @@ class BehaviorWriter(DefinitionWriter): __repr__ = _swig_repr def setGUIToRawInputIndices(self, inputIndices): + r""" + Input indices used for mapping gui to raw controls. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawInputIndices(self, inputIndices) def setGUIToRawOutputIndices(self, outputIndices): + r""" + Output indices used for mapping gui to raw controls. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawOutputIndices(self, outputIndices) def setGUIToRawFromValues(self, fromValues): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :type fromValues: float + :param fromValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawFromValues(self, fromValues) def setGUIToRawToValues(self, toValues): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :type toValues: float + :param toValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawToValues(self, toValues) def setGUIToRawSlopeValues(self, slopeValues): + r""" + Computational values(slope/gradient) used for calculating the + output value during gui to raw control mapping. + :type slopeValues: float + :param slopeValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawSlopeValues(self, slopeValues) def setGUIToRawCutValues(self, cutValues): + r""" + Computational values(vertical intercept) used for calculating the + output value during gui to raw control mapping. + :type cutValues: float + :param cutValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawCutValues(self, cutValues) def setPSDCount(self, count): + r""" The number of distinct PSD expressions.""" return _py3dna.BehaviorWriter_setPSDCount(self, count) def setPSDRowIndices(self, rowIndices): + r""" + PSD(input) indices which will become the rows of the PSD matrix. + :type rowIndices: int + :param rowIndices: + The source address from which the PSD indices are to be copied. + :type count: int + :param count: + The number of PSD indices to copy. + """ return _py3dna.BehaviorWriter_setPSDRowIndices(self, rowIndices) def setPSDColumnIndices(self, columnIndices): + r""" + Control(input) indices which will become the columns of the PSD matrix. + :type columnIndices: int + :param columnIndices: + The source address from which the control indices are to be copied. + :type count: int + :param count: + The number of control indices to copy. + """ return _py3dna.BehaviorWriter_setPSDColumnIndices(self, columnIndices) def setPSDValues(self, weights): + r""" + Weights associated with each PSD row and column pair. + :type weights: float + :param weights: + The source address from which the weight values are to be copied. + :type count: int + :param count: + The number of weight values to copy. + """ return _py3dna.BehaviorWriter_setPSDValues(self, weights) def setJointRowCount(self, rowCount): + r""" Number of rows in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorWriter_setJointRowCount(self, rowCount) def setJointColumnCount(self, columnCount): + r""" Number of columns in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorWriter_setJointColumnCount(self, columnCount) def clearJointGroups(self): + r""" Delete all joint groups.""" return _py3dna.BehaviorWriter_clearJointGroups(self) def deleteJointGroup(self, jointGroupIndex): + r""" + Delete the specified joint group. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + """ return _py3dna.BehaviorWriter_deleteJointGroup(self, jointGroupIndex) def setJointGroupLODs(self, jointGroupIndex, lods): + r""" + Number of rows per each level of detail for the specified joint group. + Notes: + Each element's position represents the level itself, while the value denotes + the number of rows within the joint group belonging to that level. e.g.: + [12, 9, 3] + | | + LOD-2 contains first 3 rows + | + LOD-1 contains first 9 rows + + LOD-0 contains first 12 rows + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + """ return _py3dna.BehaviorWriter_setJointGroupLODs(self, jointGroupIndex, lods) def setJointGroupInputIndices(self, jointGroupIndex, inputIndices): + r""" + Column indices that the specified joint group contains. + Notes: + The column indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type inputIndices: int + :param inputIndices: + The source address from which the column indices are to be copied. + :type count: int + :param count: + The number of column indices to copy. + """ return _py3dna.BehaviorWriter_setJointGroupInputIndices(self, jointGroupIndex, inputIndices) def setJointGroupOutputIndices(self, jointGroupIndex, outputIndices): + r""" + Row indices that the specified joint group contains. + Notes: + The row indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type outputIndices: int + :param outputIndices: + The source address from which the row indices are to be copied. + :type count: int + :param count: + The number of row indices to copy. + """ return _py3dna.BehaviorWriter_setJointGroupOutputIndices(self, jointGroupIndex, outputIndices) def setJointGroupValues(self, jointGroupIndex, values): + r""" + Values that the specified joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Notes: + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type values: float + :param values: + The source address from which the values are to be copied. + :type count: int + :param count: + The number of values to copy. + """ return _py3dna.BehaviorWriter_setJointGroupValues(self, jointGroupIndex, values) def setJointGroupJointIndices(self, jointGroupIndex, jointIndices): + r""" + Joint indices that the specified joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Notes: + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + :type count: int + :param count: + The number of joint indices to copy. + """ return _py3dna.BehaviorWriter_setJointGroupJointIndices(self, jointGroupIndex, jointIndices) def setBlendShapeChannelLODs(self, lods): + r""" + Input index count per each level of detail for blend shapes. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of input indices belonging to that level. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + Warning: + The LOD values set here are not interchangeable with the LOD indices set in DefinitionWriter::setBlendShapeNameIndices + and DefinitionWriter::setLODBlendShapeMapping + """ return _py3dna.BehaviorWriter_setBlendShapeChannelLODs(self, lods) def setBlendShapeChannelInputIndices(self, inputIndices): + r""" + Input indices used to index into the input vector. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ return _py3dna.BehaviorWriter_setBlendShapeChannelInputIndices(self, inputIndices) def setBlendShapeChannelOutputIndices(self, outputIndices): + r""" + Output indices specify the positions of blend shape output values. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ return _py3dna.BehaviorWriter_setBlendShapeChannelOutputIndices(self, outputIndices) def setAnimatedMapLODs(self, lods): + r""" + Row count per each level of detail for animated maps. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of rows (within the conditional table), + belonging to that level. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapLODs(self, lods) def setAnimatedMapInputIndices(self, inputIndices): + r""" + Input indices used to index into the array of input values. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapInputIndices(self, inputIndices) def setAnimatedMapOutputIndices(self, outputIndices): + r""" + Output indices that specify the computed output value's position. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapOutputIndices(self, outputIndices) def setAnimatedMapFromValues(self, fromValues): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not. + :type fromValues: float + :param fromValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapFromValues(self, fromValues) def setAnimatedMapToValues(self, toValues): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not. + :type toValues: float + :param toValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapToValues(self, toValues) def setAnimatedMapSlopeValues(self, slopeValues): + r""" + Computational values(slope/gradient) used for calculating the output value. + :type slopeValues: float + :param slopeValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapSlopeValues(self, slopeValues) def setAnimatedMapCutValues(self, cutValues): + r""" + Computational values(vertical intercept) used for calculating the output value. + :type cutValues: float + :param cutValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapCutValues(self, cutValues) # Register BehaviorWriter in _py3dna: _py3dna.BehaviorWriter_swigregister(BehaviorWriter) - class GeometryWriter(DefinitionWriter): + r""" + Write-only accessors for the geometry data associated with a rig. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1243,57 +3365,291 @@ class GeometryWriter(DefinitionWriter): __repr__ = _swig_repr def clearMeshes(self): + r""" Delete all meshes.""" return _py3dna.GeometryWriter_clearMeshes(self) def deleteMesh(self, meshIndex): + r""" + Delete the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_deleteMesh(self, meshIndex) def setVertexPositions(self, meshIndex, positions): + r""" + List of vertex positions. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type positions: dna::Position + :param positions: + The source address from which the vertex positions are to be copied. + :type count: int + :param count: + The number of vertex positions to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexPositions(self, meshIndex, positions) def setVertexTextureCoordinates(self, meshIndex, textureCoordinates): + r""" + List of vertex texture coordinates. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type textureCoordinates: dna::TextureCoordinate + :param textureCoordinates: + The source address from which the texture coordinates are to be copied. + :type count: int + :param count: + The number of texture coordinates to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexTextureCoordinates(self, meshIndex, textureCoordinates) def setVertexNormals(self, meshIndex, normals): + r""" + List of vertex normals. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type normals: dna::Normal + :param normals: + The source address from which the normals are to be copied. + :type count: int + :param count: + The number of normals to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexNormals(self, meshIndex, normals) def setVertexLayouts(self, meshIndex, layouts): + r""" + List of vertex layouts the belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type layouts: dna::VertexLayout + :param layouts: + The source address from which the layouts are to be copied. + :type count: int + :param count: + The number of layouts to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexLayouts(self, meshIndex, layouts) def clearFaceVertexLayoutIndices(self, meshIndex): + r""" + Delete all lists of vertex layout indices for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_clearFaceVertexLayoutIndices(self, meshIndex) def setFaceVertexLayoutIndices(self, meshIndex, faceIndex, layoutIndices): + r""" + Vertex layout indices that belong to the specified face. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type faceIndex: int + :param faceIndex: + A face's position in the zero-indexed array of faces that belong to + the above referenced mesh. + :type layoutIndices: int + :param layoutIndices: + The source address from which the layout indices are to be copied. + Notes: + The layout indices point into the array that is set through setVertexLayouts + :type count: int + :param count: + The number of vertices to copy. + + Both the mesh storage itself and it's face storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + faces that are inferred from the specified indexes. + """ return _py3dna.GeometryWriter_setFaceVertexLayoutIndices(self, meshIndex, faceIndex, layoutIndices) def setMaximumInfluencePerVertex(self, meshIndex, maxInfluenceCount): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type maxInfluenceCount: int + :param maxInfluenceCount: + The maximum number of joints that may influence any single vertex. + """ return _py3dna.GeometryWriter_setMaximumInfluencePerVertex(self, meshIndex, maxInfluenceCount) def clearSkinWeights(self, meshIndex): + r""" + Delete all skin weights for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_clearSkinWeights(self, meshIndex) def setSkinWeightsValues(self, meshIndex, vertexIndex, weights): + r""" + List of skin weights influencing the referenced vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertex positions. + :type weights: float + :param weights: + The source address from which the weights are to be copied. + :type count: int + :param count: + The number of weights to copy. + Notes: + Both the mesh storage itself and it's skin weight storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + skin-weight lists that are inferred from the specified indexes. + Warning: + The sum of weights must add up to 1. + """ return _py3dna.GeometryWriter_setSkinWeightsValues(self, meshIndex, vertexIndex, weights) def setSkinWeightsJointIndices(self, meshIndex, vertexIndex, jointIndices): + r""" + List of joint indices associated with each skin weight for the specified vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertex positions. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + :type count: int + :param count: + The number of joint indices to copy. + Notes: + Both the mesh storage itself and it's joint index list storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + joint index lists that are inferred from the specified indexes. + Warning: + The joint indices must be stored in the same order as the weights they + are associated with. + """ return _py3dna.GeometryWriter_setSkinWeightsJointIndices(self, meshIndex, vertexIndex, jointIndices) def clearBlendShapeTargets(self, meshIndex): + r""" + Delete all blend shape targets for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_clearBlendShapeTargets(self, meshIndex) def setBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex, blendShapeChannelIndex): + r""" + The matching blend shape channel index of the specified blend shape target. + Notes: + Associate the mesh-local blend shape target index with the absolute blend shape channel + index as found in the Definition layer. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type blendShapeChannelIndex: int + :param blendShapeChannelIndex: + The index of the specified blend shape channel in the Definition layer. + + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + """ return _py3dna.GeometryWriter_setBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex, blendShapeChannelIndex) def setBlendShapeTargetDeltas(self, meshIndex, blendShapeTargetIndex, deltas): + r""" + List of deltas for each affected vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type deltas: dna::Delta + :param deltas: + The source address from which the blend shape target deltas are to be copied. + :type count: int + :param count: + The number of blend shape target deltas to copy. + Notes: + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + """ return _py3dna.GeometryWriter_setBlendShapeTargetDeltas(self, meshIndex, blendShapeTargetIndex, deltas) def setBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex, vertexIndices): + r""" + Vertex position indices affected by the specified blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type vertexIndices: int + :param vertexIndices: + The source address from which the vertex position indices are to be copied. + :type count: int + :param count: + The number of vertex position indices to copy. + Notes: + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + Warning: + The vertex position indices must be stored in the same order as the deltas + they are associated with. + """ return _py3dna.GeometryWriter_setBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex, vertexIndices) # Register GeometryWriter in _py3dna: _py3dna.GeometryWriter_swigregister(GeometryWriter) - class Writer(BehaviorWriter, GeometryWriter): + r""" + The abstract Writer which its implementations are expected to inherit. + Notes: + This class combines the various different writer interfaces into a single interface. + The artificial separation into multiple interfaces in this case just mirrors the + structure of the Reader hierarchy, as it's not possible to selectively write only + specific layers. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1302,11 +3658,28 @@ class Writer(BehaviorWriter, GeometryWriter): __swig_destroy__ = _py3dna.delete_Writer def setFrom(self, *args): + r""" + Initialize the Writer from the given Reader. + Notes: + This function copies all the data from the given Reader into the Writer instance, + by calling each getter function of the Reader, and passing the return values to + the matching setter functions in the Writer. + It is implemented in the abstract class itself to provide the functionality for + all DNA Writers. + :type source: :py:class:`Reader` + :param source: + The source DNA Reader from which the data needs to be copied. + :type layer: int, optional + :param layer: + Limit which layers should be taken over from the given source reader. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Optional memory resource to use for temporary allocations during copying. + """ return _py3dna.Writer_setFrom(self, *args) # Register Writer in _py3dna: _py3dna.Writer_swigregister(Writer) - class StreamWriter(Writer): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -1316,11 +3689,11 @@ class StreamWriter(Writer): __swig_destroy__ = _py3dna.delete_StreamWriter def write(self): + r""" Write data to stream from internal structures.""" return _py3dna.StreamWriter_write(self) # Register StreamWriter in _py3dna: _py3dna.StreamWriter_swigregister(StreamWriter) - class BinaryStreamWriter(StreamWriter): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -1330,22 +3703,36 @@ class BinaryStreamWriter(StreamWriter): @staticmethod def create(stream, memRes=None): + r""" + Factory method for creation of BinaryStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.BinaryStreamWriter_create(stream, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a BinaryStreamWriter instance. + :type instance: :py:class:`BinaryStreamWriter` + :param instance: + Instance of BinaryStreamWriter to be freed. + See also: create + """ return _py3dna.BinaryStreamWriter_destroy(instance) __swig_destroy__ = _py3dna.delete_BinaryStreamWriter # Register BinaryStreamWriter in _py3dna: _py3dna.BinaryStreamWriter_swigregister(BinaryStreamWriter) - -def BinaryStreamWriter_create(stream, memRes=None): - return _py3dna.BinaryStreamWriter_create(stream, memRes) - -def BinaryStreamWriter_destroy(instance): - return _py3dna.BinaryStreamWriter_destroy(instance) - class JSONStreamWriter(StreamWriter): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -1355,35 +3742,121 @@ class JSONStreamWriter(StreamWriter): @staticmethod def create(stream, indentWidth=4, memRes=None): + r""" + Factory method for creation of JSONStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type indentWidth: int, optional + :param indentWidth: + Number of spaces to use for indentation. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.JSONStreamWriter_create(stream, indentWidth, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a JSONStreamWriter instance. + :type instance: :py:class:`JSONStreamWriter` + :param instance: + Instance of JSONStreamWriter to be freed. + See also: create + """ return _py3dna.JSONStreamWriter_destroy(instance) __swig_destroy__ = _py3dna.delete_JSONStreamWriter # Register JSONStreamWriter in _py3dna: _py3dna.JSONStreamWriter_swigregister(JSONStreamWriter) -def JSONStreamWriter_create(stream, indentWidth=4, memRes=None): - return _py3dna.JSONStreamWriter_create(stream, indentWidth, memRes) +BinaryStreamWriterImpl = BinaryStreamWriter -def JSONStreamWriter_destroy(instance): - return _py3dna.JSONStreamWriter_destroy(instance) +class BinaryStreamWriterImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(BinaryStreamWriterImpl, name) + + def __dir__(cls): + return [name for name in dir(BinaryStreamWriterImpl) if name not in ("create","destroy")] + +class BinaryStreamWriter(with_metaclass(BinaryStreamWriterImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = BinaryStreamWriterImpl.create(*args, **kwargs) + + def __del__(self): + BinaryStreamWriterImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -BinaryStreamWriter.__new__ = __new_decorator(BinaryStreamWriter_create, BinaryStreamWriter.__new__) -BinaryStreamWriter.__del__ = lambda instance: BinaryStreamWriter_destroy(instance) -BinaryStreamWriter.__init__ = __managed_init -del BinaryStreamWriter.create -del BinaryStreamWriter.destroy - - -JSONStreamWriter.__new__ = __new_decorator(JSONStreamWriter_create, JSONStreamWriter.__new__) -JSONStreamWriter.__del__ = lambda instance: JSONStreamWriter_destroy(instance) -JSONStreamWriter.__init__ = __managed_init -del JSONStreamWriter.create -del JSONStreamWriter.destroy - +JSONStreamWriterImpl = JSONStreamWriter + +class JSONStreamWriterImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(JSONStreamWriterImpl, name) + + def __dir__(cls): + return [name for name in dir(JSONStreamWriterImpl) if name not in ("create","destroy")] + +class JSONStreamWriter(with_metaclass(JSONStreamWriterImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = JSONStreamWriterImpl.create(*args, **kwargs) + + def __del__(self): + JSONStreamWriterImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] diff --git a/lib/Maya2022/windows/dnacalib.dll b/lib/Maya2022/windows/dnacalib.dll index f1d566c..d85a926 100644 Binary files a/lib/Maya2022/windows/dnacalib.dll and b/lib/Maya2022/windows/dnacalib.dll differ diff --git a/lib/Maya2022/windows/dnacalib.py b/lib/Maya2022/windows/dnacalib.py index 8e4eca3..49cf7ee 100644 --- a/lib/Maya2022/windows/dnacalib.py +++ b/lib/Maya2022/windows/dnacalib.py @@ -1,13 +1,22 @@ -# This file was automatically generated by SWIG (http://www.swig.org). -# Version 4.0.1 +# This file was automatically generated by SWIG (https://www.swig.org). +# Version 4.1.1 # -# Do not make changes to this file unless you know what you are doing--modify +# Do not make changes to this file unless you know what you are doing - modify # the SWIG interface file instead. -from sys import version_info as _swig_python_version_info -if _swig_python_version_info < (2, 7, 0): - raise RuntimeError("Python 2.7 or later required") +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass + + + +from sys import version_info as _swig_python_version_info # Import the low-level C/C++ module if __package__ or "." in __name__: from . import _py3dnacalib @@ -29,10 +38,10 @@ def _swig_repr(self): def _swig_setattr_nondynamic_instance_variable(set): def set_instance_attr(self, name, value): - if name == "thisown": - self.this.own(value) - elif name == "this": + if name == "this": set(self, name, value) + elif name == "thisown": + self.this.own(value) elif hasattr(self, name) and isinstance(getattr(type(self), name), property): set(self, name, value) else: @@ -62,20 +71,16 @@ class _SwigNonDynamicMeta(type): -def __new_decorator(factory_func, original_new): - @staticmethod - def __new(cls, *args, **kwargs): -# FIXME: while this workaround solves the immediate issue with the set of classes we currently have, -# it will fail for classes that use a factory function but need no parameters at all, in which case -# the factory function will never be invoked, only the original __new__ function. - if args or kwargs: - return factory_func(*args, **kwargs) - return original_new(cls) - return __new +def with_metaclass(meta, *bases): + class metaclass(type): -def __managed_init(self, *args, **kwargs): - self._args = args - self._kwargs = kwargs + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) import dna class VersionInfo(object): @@ -104,19 +109,6 @@ class VersionInfo(object): # Register VersionInfo in _py3dnacalib: _py3dnacalib.VersionInfo_swigregister(VersionInfo) - -def VersionInfo_getMajorVersion(): - return _py3dnacalib.VersionInfo_getMajorVersion() - -def VersionInfo_getMinorVersion(): - return _py3dnacalib.VersionInfo_getMinorVersion() - -def VersionInfo_getPatchVersion(): - return _py3dnacalib.VersionInfo_getPatchVersion() - -def VersionInfo_getVersionString(): - return _py3dnacalib.VersionInfo_getVersionString() - class DNACalibDNAReader(dna.Reader): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -135,20 +127,50 @@ class DNACalibDNAReader(dna.Reader): # Register DNACalibDNAReader in _py3dnacalib: _py3dnacalib.DNACalibDNAReader_swigregister(DNACalibDNAReader) -def DNACalibDNAReader_create(*args): - return _py3dnacalib.DNACalibDNAReader_create(*args) +DNACalibDNAReaderImpl = DNACalibDNAReader -def DNACalibDNAReader_destroy(instance): - return _py3dnacalib.DNACalibDNAReader_destroy(instance) +class DNACalibDNAReaderImplReflectionMixin(type): + def __getattr__(cls, name): + return getattr(DNACalibDNAReaderImpl, name) -DNACalibDNAReader.__new__ = __new_decorator(DNACalibDNAReader_create, DNACalibDNAReader.__new__) -DNACalibDNAReader.__del__ = lambda instance: DNACalibDNAReader_destroy(instance) -DNACalibDNAReader.__init__ = __managed_init -del DNACalibDNAReader.create -del DNACalibDNAReader.destroy + def __dir__(cls): + return [name for name in dir(DNACalibDNAReaderImpl) if name not in ("create","destroy")] + +class DNACalibDNAReader(with_metaclass(DNACalibDNAReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = DNACalibDNAReaderImpl.create(*args, **kwargs) + + def __del__(self): + DNACalibDNAReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] class Command(object): + r""" Command is an abstract class whose implementations are expected to modify the DNA provided in the run() method in some way.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -161,12 +183,19 @@ class Command(object): # Register Command in _py3dnacalib: _py3dnacalib.Command_swigregister(Command) - VectorOperation_Interpolate = _py3dnacalib.VectorOperation_Interpolate VectorOperation_Add = _py3dnacalib.VectorOperation_Add VectorOperation_Subtract = _py3dnacalib.VectorOperation_Subtract VectorOperation_Multiply = _py3dnacalib.VectorOperation_Multiply class CommandSequence(Command): + r""" + CommandSequence is used to run a sequence of commands on the same DNA. + Notes: + Commands will be run in the order in which they were added to the sequence. + + CommandSequence holds pointers to commands, but does not own them. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_CommandSequence @@ -178,21 +207,39 @@ class CommandSequence(Command): return _py3dnacalib.CommandSequence_run(self, output) def add(self, command): + r""" + Method for adding a command to a sequence of commands to run. + :type command: :py:class:`Command` + :param command: + The command to add. + """ return _py3dnacalib.CommandSequence_add(self, command) def remove(self, command): + r""" + Method for removing a command from the sequence of commands to run. + :type command: :py:class:`Command` + :param command: + The command to remove. + """ return _py3dnacalib.CommandSequence_remove(self, command) def contains(self, command): + r""" + Method for checking if the provided command is part of the command sequence. + :type command: :py:class:`Command` + :param command: + The command to check. + """ return _py3dnacalib.CommandSequence_contains(self, command) def size(self): + r""" Number of commands in command sequence.""" return _py3dnacalib.CommandSequence_size(self) # Register CommandSequence in _py3dnacalib: _py3dnacalib.CommandSequence_swigregister(CommandSequence) - def command_sequence_init(_init): def wrapper(self, *args, **kwargs): self._commands = [] @@ -216,6 +263,12 @@ CommandSequence.add = command_sequence_add(CommandSequence.add) CommandSequence.remove = command_sequence_remove(CommandSequence.remove) class CalculateMeshLowerLODsCommand(Command): + r""" + CalculateMeshLowerLODsCommand is used to recalculate vertex positions for lower LOD meshes of the specified mesh. + Notes: + The calculation is done based on vertex positions of the specified mesh and vertex texture coordinates of its lower LOD meshes. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_CalculateMeshLowerLODsCommand @@ -224,6 +277,12 @@ class CalculateMeshLowerLODsCommand(Command): _py3dnacalib.CalculateMeshLowerLODsCommand_swiginit(self, _py3dnacalib.new_CalculateMeshLowerLODsCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to calculate lower LOD meshes from. + :type meshIndex: int + :param meshIndex: + The index of the mesh. + """ return _py3dnacalib.CalculateMeshLowerLODsCommand_setMeshIndex(self, meshIndex) def run(self, output): @@ -231,8 +290,12 @@ class CalculateMeshLowerLODsCommand(Command): # Register CalculateMeshLowerLODsCommand in _py3dnacalib: _py3dnacalib.CalculateMeshLowerLODsCommand_swigregister(CalculateMeshLowerLODsCommand) - class ClearBlendShapesCommand(Command): + r""" + ClearBlendShapesCommand is used to clear all blend shapes data from a DNA. + Notes: This command clears blend shape target deltas and blend shape animation data. By doing so, it transforms the DNA to be "joints only". + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_ClearBlendShapesCommand @@ -245,8 +308,9 @@ class ClearBlendShapesCommand(Command): # Register ClearBlendShapesCommand in _py3dnacalib: _py3dnacalib.ClearBlendShapesCommand_swigregister(ClearBlendShapesCommand) - class PruneBlendShapeTargetsCommand(Command): + r""" PruneBlendShapeTargetsCommand is used to prune blend shape target deltas whose absolute magnitude is less than or equal to the specified threshold.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_PruneBlendShapeTargetsCommand @@ -255,6 +319,12 @@ class PruneBlendShapeTargetsCommand(Command): _py3dnacalib.PruneBlendShapeTargetsCommand_swiginit(self, _py3dnacalib.new_PruneBlendShapeTargetsCommand(*args)) def setThreshold(self, threshold): + r""" + Method for setting the threshold for pruning blend shape target deltas. + :type threshold: float + :param threshold: + The threshold to use. + """ return _py3dnacalib.PruneBlendShapeTargetsCommand_setThreshold(self, threshold) def run(self, output): @@ -262,8 +332,9 @@ class PruneBlendShapeTargetsCommand(Command): # Register PruneBlendShapeTargetsCommand in _py3dnacalib: _py3dnacalib.PruneBlendShapeTargetsCommand_swigregister(PruneBlendShapeTargetsCommand) - class RemoveAnimatedMapCommand(Command): + r""" RemoveAnimatedMapCommand is used to remove animated maps.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveAnimatedMapCommand @@ -272,9 +343,23 @@ class RemoveAnimatedMapCommand(Command): _py3dnacalib.RemoveAnimatedMapCommand_swiginit(self, _py3dnacalib.new_RemoveAnimatedMapCommand(*args)) def setAnimatedMapIndex(self, animatedMapIndex): + r""" + Method for setting the index of the animated map to remove. + :type animatedMapIndex: int + :param animatedMapIndex: + The index of the animated map. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set animated map(s) will be removed. + """ return _py3dnacalib.RemoveAnimatedMapCommand_setAnimatedMapIndex(self, animatedMapIndex) def setAnimatedMapIndices(self, animatedMapIndices): + r""" + Method for setting the indices of animated maps to remove. + :type animatedMapIndices: dnac::ConstArrayView< std::uint16_t > + :param animatedMapIndices: + The animated map indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set animated map(s) will be removed. + """ return _py3dnacalib.RemoveAnimatedMapCommand_setAnimatedMapIndices(self, animatedMapIndices) def run(self, output): @@ -282,8 +367,9 @@ class RemoveAnimatedMapCommand(Command): # Register RemoveAnimatedMapCommand in _py3dnacalib: _py3dnacalib.RemoveAnimatedMapCommand_swigregister(RemoveAnimatedMapCommand) - class RemoveBlendShapeCommand(Command): + r""" RemoveBlendShapeCommand is used to remove blend shapes.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveBlendShapeCommand @@ -292,9 +378,23 @@ class RemoveBlendShapeCommand(Command): _py3dnacalib.RemoveBlendShapeCommand_swiginit(self, _py3dnacalib.new_RemoveBlendShapeCommand(*args)) def setBlendShapeIndex(self, blendShapeIndex): + r""" + Method for setting the index of the blend shape to remove. + :type blendShapeIndex: int + :param blendShapeIndex: + The index of the blend shape. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set blend shape(s) will be removed. + """ return _py3dnacalib.RemoveBlendShapeCommand_setBlendShapeIndex(self, blendShapeIndex) def setBlendShapeIndices(self, blendShapeIndices): + r""" + Method for setting the indices of blend shapes to remove. + :type blendShapeIndices: dnac::ConstArrayView< std::uint16_t > + :param blendShapeIndices: + The blend shape indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set blend shape(s) will be removed. + """ return _py3dnacalib.RemoveBlendShapeCommand_setBlendShapeIndices(self, blendShapeIndices) def run(self, output): @@ -302,8 +402,9 @@ class RemoveBlendShapeCommand(Command): # Register RemoveBlendShapeCommand in _py3dnacalib: _py3dnacalib.RemoveBlendShapeCommand_swigregister(RemoveBlendShapeCommand) - class RemoveJointAnimationCommand(Command): + r""" RemoveJointAnimationCommand is used to remove joint animation data.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveJointAnimationCommand @@ -312,9 +413,23 @@ class RemoveJointAnimationCommand(Command): _py3dnacalib.RemoveJointAnimationCommand_swiginit(self, _py3dnacalib.new_RemoveJointAnimationCommand(*args)) def setJointIndex(self, jointIndex): + r""" + Method for setting the index of a joint whose animation data to remove. + :type jointIndex: int + :param jointIndex: + The index of the joint. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint animation(s) will be removed. + """ return _py3dnacalib.RemoveJointAnimationCommand_setJointIndex(self, jointIndex) def setJointIndices(self, jointIndices): + r""" + Method for setting the indices of joints whose animation data to remove. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + The joint indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint animation(s) will be removed. + """ return _py3dnacalib.RemoveJointAnimationCommand_setJointIndices(self, jointIndices) def run(self, output): @@ -322,8 +437,9 @@ class RemoveJointAnimationCommand(Command): # Register RemoveJointAnimationCommand in _py3dnacalib: _py3dnacalib.RemoveJointAnimationCommand_swigregister(RemoveJointAnimationCommand) - class RemoveJointCommand(Command): + r""" RemoveJointCommand is used to remove joints.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveJointCommand @@ -332,9 +448,23 @@ class RemoveJointCommand(Command): _py3dnacalib.RemoveJointCommand_swiginit(self, _py3dnacalib.new_RemoveJointCommand(*args)) def setJointIndex(self, jointIndex): + r""" + Method for setting the index of the joint to remove. + :type jointIndex: int + :param jointIndex: + The index of the joint. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint(s) will be removed. + """ return _py3dnacalib.RemoveJointCommand_setJointIndex(self, jointIndex) def setJointIndices(self, jointIndices): + r""" + Method for setting the indices of joints to remove. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + The joint indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint(s) will be removed. + """ return _py3dnacalib.RemoveJointCommand_setJointIndices(self, jointIndices) def run(self, output): @@ -342,8 +472,9 @@ class RemoveJointCommand(Command): # Register RemoveJointCommand in _py3dnacalib: _py3dnacalib.RemoveJointCommand_swigregister(RemoveJointCommand) - class RemoveMeshCommand(Command): + r""" RemoveMeshCommand is used to remove meshes.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveMeshCommand @@ -352,9 +483,22 @@ class RemoveMeshCommand(Command): _py3dnacalib.RemoveMeshCommand_swiginit(self, _py3dnacalib.new_RemoveMeshCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to remove. + :type meshIndex: int + :param meshIndex: + The index of the mesh. + """ return _py3dnacalib.RemoveMeshCommand_setMeshIndex(self, meshIndex) def setMeshIndices(self, meshIndices): + r""" + Method for setting the indices of meshes to remove. + :type meshIndices: dnac::ConstArrayView< std::uint16_t > + :param meshIndices: + The mesh indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set mesh(es) will be removed. + """ return _py3dnacalib.RemoveMeshCommand_setMeshIndices(self, meshIndices) def run(self, output): @@ -362,8 +506,9 @@ class RemoveMeshCommand(Command): # Register RemoveMeshCommand in _py3dnacalib: _py3dnacalib.RemoveMeshCommand_swigregister(RemoveMeshCommand) - class RenameAnimatedMapCommand(Command): + r""" RenameAnimatedMapCommand is used to rename an animated map.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameAnimatedMapCommand @@ -372,6 +517,31 @@ class RenameAnimatedMapCommand(Command): _py3dnacalib.RenameAnimatedMapCommand_swiginit(self, _py3dnacalib.new_RenameAnimatedMapCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for animated map with given index. + :type animatedMapIndex: int + :param animatedMapIndex: + The index of the animated map whose name to change. + :type newName: string + :param newName: + The new name for the animated map. + + | + + *Overload 2:* + + Method for setting a new name for animated map with given name. + Notes: + The renaming will not happen if there is no animated map with given current name. + :type oldName: string + :param oldName: + The current name of the animated map whose name to change. + :type newName: string + :param newName: + The new name for the animated map. + """ return _py3dnacalib.RenameAnimatedMapCommand_setName(self, *args) def run(self, output): @@ -379,8 +549,9 @@ class RenameAnimatedMapCommand(Command): # Register RenameAnimatedMapCommand in _py3dnacalib: _py3dnacalib.RenameAnimatedMapCommand_swigregister(RenameAnimatedMapCommand) - class RenameBlendShapeCommand(Command): + r""" RenameBlendShapeCommand is used to rename a blend shape channel.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameBlendShapeCommand @@ -389,6 +560,31 @@ class RenameBlendShapeCommand(Command): _py3dnacalib.RenameBlendShapeCommand_swiginit(self, _py3dnacalib.new_RenameBlendShapeCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for blend shape channel with given index. + :type blendShapeIndex: int + :param blendShapeIndex: + The index of the blend shape channel whose name to change. + :type newName: string + :param newName: + The new name for the blend shape channel. + + | + + *Overload 2:* + + Method for setting a new name for blend shape channel with given name. + Notes: + The renaming will not happen if there is no blend shape channel with given current name. + :type oldName: string + :param oldName: + The current name of the blend shape channel whose name to change. + :type newName: string + :param newName: + The new name for the blend shape channel. + """ return _py3dnacalib.RenameBlendShapeCommand_setName(self, *args) def run(self, output): @@ -396,8 +592,9 @@ class RenameBlendShapeCommand(Command): # Register RenameBlendShapeCommand in _py3dnacalib: _py3dnacalib.RenameBlendShapeCommand_swigregister(RenameBlendShapeCommand) - class RenameJointCommand(Command): + r""" RenameJointCommand is used to rename a joint.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameJointCommand @@ -406,6 +603,31 @@ class RenameJointCommand(Command): _py3dnacalib.RenameJointCommand_swiginit(self, _py3dnacalib.new_RenameJointCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for joint with given index. + :type jointIndex: int + :param jointIndex: + The index of the joint whose name to change. + :type newName: string + :param newName: + The new name for the joint. + + | + + *Overload 2:* + + Method for setting a new name for joint with given name. + Notes: + The renaming will not happen if there is no joint with given current name. + :type oldName: string + :param oldName: + The current name of the joint whose name to change. + :type newName: string + :param newName: + The new name for the joint. + """ return _py3dnacalib.RenameJointCommand_setName(self, *args) def run(self, output): @@ -413,8 +635,9 @@ class RenameJointCommand(Command): # Register RenameJointCommand in _py3dnacalib: _py3dnacalib.RenameJointCommand_swigregister(RenameJointCommand) - class RenameMeshCommand(Command): + r""" RenameMeshCommand is used to rename a mesh.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameMeshCommand @@ -423,6 +646,31 @@ class RenameMeshCommand(Command): _py3dnacalib.RenameMeshCommand_swiginit(self, _py3dnacalib.new_RenameMeshCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for mesh with given index. + :type meshIndex: int + :param meshIndex: + The index of the mesh whose name to change. + :type newName: string + :param newName: + The new name for the mesh. + + | + + *Overload 2:* + + Method for setting a new name for mesh with given name. + Notes: + The renaming will not happen if there is no mesh with given current name. + :type oldName: string + :param oldName: + The current name of the mesh whose name to change. + :type newName: string + :param newName: + The new name for the mesh. + """ return _py3dnacalib.RenameMeshCommand_setName(self, *args) def run(self, output): @@ -430,8 +678,15 @@ class RenameMeshCommand(Command): # Register RenameMeshCommand in _py3dnacalib: _py3dnacalib.RenameMeshCommand_swigregister(RenameMeshCommand) - class RotateCommand(Command): + r""" + RotateCommand is used to rotate neutral joints and vertex positions around given origin. + Notes: + Joint rotations are represented in parent space, so it is enough to rotate only root joints, as that rotation will be propagated to the rest of the joints. + + If the origin is not set, the assumed origin is (0, 0, 0). + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RotateCommand @@ -440,9 +695,21 @@ class RotateCommand(Command): _py3dnacalib.RotateCommand_swiginit(self, _py3dnacalib.new_RotateCommand(*args)) def setRotation(self, degrees): + r""" + Method for setting the rotation angles. + :type degrees: dnac::Vector3 + :param degrees: + Rotation angles in degrees. + """ return _py3dnacalib.RotateCommand_setRotation(self, degrees) def setOrigin(self, origin): + r""" + Method for setting the rotation origin. + :type origin: dnac::Vector3 + :param origin: + Origin coordinates. + """ return _py3dnacalib.RotateCommand_setOrigin(self, origin) def run(self, output): @@ -450,8 +717,13 @@ class RotateCommand(Command): # Register RotateCommand in _py3dnacalib: _py3dnacalib.RotateCommand_swigregister(RotateCommand) - class ScaleCommand(Command): + r""" + ScaleCommand is used to scale neutral joints, vertex positions and joint and blendshape deltas by a factor. + Notes: + Only translation attributes of neutral joints and joint deltas are scaled. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_ScaleCommand @@ -460,9 +732,22 @@ class ScaleCommand(Command): _py3dnacalib.ScaleCommand_swiginit(self, _py3dnacalib.new_ScaleCommand(*args)) def setScale(self, scale): + r""" + Method for setting the scale factor to multiply with. + :type scale: float + :param scale: + Scale factor. + """ return _py3dnacalib.ScaleCommand_setScale(self, scale) def setOrigin(self, origin): + r""" + Method for setting the origin. + Notes: The origin is used to properly scale position values (vertex positions and neutral joint translations). + :type origin: dnac::Vector3 + :param origin: + Origin coordinates. + """ return _py3dnacalib.ScaleCommand_setOrigin(self, origin) def run(self, output): @@ -470,8 +755,9 @@ class ScaleCommand(Command): # Register ScaleCommand in _py3dnacalib: _py3dnacalib.ScaleCommand_swigregister(ScaleCommand) - class SetBlendShapeTargetDeltasCommand(Command): + r""" SetBlendShapeTargetDeltasCommand is used to change blend shape target deltas.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetBlendShapeTargetDeltasCommand @@ -480,21 +766,85 @@ class SetBlendShapeTargetDeltasCommand(Command): _py3dnacalib.SetBlendShapeTargetDeltasCommand_swiginit(self, _py3dnacalib.new_SetBlendShapeTargetDeltasCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh whose blend shape target to change. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setMeshIndex(self, meshIndex) def setBlendShapeTargetIndex(self, blendShapeTargetIndex): + r""" + Method for setting the index of the blend shape target to change. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + The blend shape target index. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setBlendShapeTargetIndex(self, blendShapeTargetIndex) def setDeltas(self, *args): + r""" + *Overload 1:* + + Method for setting the values used to calculate new deltas for blend shape target. + :type deltas: dnac::ConstArrayView< dnac::Vector3 > + :param deltas: + The values used in calculation. + + | + + *Overload 2:* + + Method for setting the values used to calculate new deltas for blend shape target. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X values for each delta. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y values for each delta. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z values for each delta. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setDeltas(self, *args) def setVertexIndices(self, vertexIndices): + r""" + Method for setting the vertex indices that correspond to new deltas. + :type vertexIndices: dnac::ConstArrayView< std::uint32_t > + :param vertexIndices: + The vertexIndices. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setVertexIndices(self, vertexIndices) def setMasks(self, masks): + r""" + Method for setting masks used to calculate new deltas for blend shape target. + Notes: + If no masks are set, default weight value of 1 is used for each delta. + :type masks: dnac::ConstArrayView< float > + :param masks: + The weights for each delta. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setMasks(self, masks) def setOperation(self, operation): + r""" + Method for setting the type of operation used to calculate new deltas for blend shape target. + Notes: + Available operations are: Interpolate, Add, Subtract and Multiply. Each delta is calculated based on the provided operation type in the following way: + + Interpolate: = previousValue * (1 - weight) + setValue * weight:math:`\n Add: \f$newValue = previousValue + (setValue * weight)` + + Subtract: = previousValue - (setValue * weight):math:`\n Multiply: \f$newValue = previousValue * (setValue * weight)` + + + setValue is the value from new deltas that were set, and weight is the value from masks array. + :type operation: int + :param operation: + The operation to use. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setOperation(self, operation) def run(self, output): @@ -509,6 +859,8 @@ SetBlendShapeTargetDeltasCommand.DeltasVertexIndicesCountMismatch = _py3dnacalib SetBlendShapeTargetDeltasCommand.DeltasMasksCountMismatch = _py3dnacalib.cvar.SetBlendShapeTargetDeltasCommand_DeltasMasksCountMismatch class SetLODsCommand(Command): + r""" SetLODsCommand is used to specify LODs to use. Joints, blend shapes, animated maps and meshes that are not in specified LODs are removed from the DNA.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetLODsCommand @@ -517,6 +869,12 @@ class SetLODsCommand(Command): _py3dnacalib.SetLODsCommand_swiginit(self, _py3dnacalib.new_SetLODsCommand(*args)) def setLODs(self, lods): + r""" + Method for setting the LODs to keep. + :type lods: dnac::ConstArrayView< std::uint16_t > + :param lods: + New LODs to be used. + """ return _py3dnacalib.SetLODsCommand_setLODs(self, lods) def run(self, output): @@ -524,8 +882,9 @@ class SetLODsCommand(Command): # Register SetLODsCommand in _py3dnacalib: _py3dnacalib.SetLODsCommand_swigregister(SetLODsCommand) - class SetNeutralJointRotationsCommand(Command): + r""" SetNeutralJointRotationsCommand is used to set new rotation values to neutral joints.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetNeutralJointRotationsCommand @@ -534,6 +893,29 @@ class SetNeutralJointRotationsCommand(Command): _py3dnacalib.SetNeutralJointRotationsCommand_swiginit(self, _py3dnacalib.new_SetNeutralJointRotationsCommand(*args)) def setRotations(self, *args): + r""" + *Overload 1:* + + Method for setting the neutral joint rotations. + :type rotations: dnac::ConstArrayView< dnac::Vector3 > + :param rotations: + Rotation values for each joint. + + | + + *Overload 2:* + + Method for setting the neutral joint rotations. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X rotation value for each joint. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y rotation value for each joint. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z rotation value for each joint. + """ return _py3dnacalib.SetNeutralJointRotationsCommand_setRotations(self, *args) def run(self, output): @@ -541,8 +923,9 @@ class SetNeutralJointRotationsCommand(Command): # Register SetNeutralJointRotationsCommand in _py3dnacalib: _py3dnacalib.SetNeutralJointRotationsCommand_swigregister(SetNeutralJointRotationsCommand) - class SetNeutralJointTranslationsCommand(Command): + r""" SetNeutralJointTranslationsCommand is used to set new translation values to neutral joints.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetNeutralJointTranslationsCommand @@ -551,6 +934,29 @@ class SetNeutralJointTranslationsCommand(Command): _py3dnacalib.SetNeutralJointTranslationsCommand_swiginit(self, _py3dnacalib.new_SetNeutralJointTranslationsCommand(*args)) def setTranslations(self, *args): + r""" + *Overload 1:* + + Method for setting the neutral joint translations. + :type translations: dnac::ConstArrayView< dnac::Vector3 > + :param translations: + Translation values for each joint. + + | + + *Overload 2:* + + Method for setting the neutral joint translations. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X translation value for each joint. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y translation value for each joint. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z translation value for each joint. + """ return _py3dnacalib.SetNeutralJointTranslationsCommand_setTranslations(self, *args) def run(self, output): @@ -558,8 +964,9 @@ class SetNeutralJointTranslationsCommand(Command): # Register SetNeutralJointTranslationsCommand in _py3dnacalib: _py3dnacalib.SetNeutralJointTranslationsCommand_swigregister(SetNeutralJointTranslationsCommand) - class SetSkinWeightsCommand(Command): + r""" SetSkinWeightsCommand is used to set new skin weights for a vertex in a mesh.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetSkinWeightsCommand @@ -568,15 +975,39 @@ class SetSkinWeightsCommand(Command): _py3dnacalib.SetSkinWeightsCommand_swiginit(self, _py3dnacalib.new_SetSkinWeightsCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the targeted mesh. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ return _py3dnacalib.SetSkinWeightsCommand_setMeshIndex(self, meshIndex) def setVertexIndex(self, vertexIndex): + r""" + Method for setting the index of the vertex to change. + :type vertexIndex: int + :param vertexIndex: + The vertex index. + """ return _py3dnacalib.SetSkinWeightsCommand_setVertexIndex(self, vertexIndex) def setWeights(self, weights): + r""" + Method for setting the weights with which joints influence the vertex in question. + :type weights: dnac::ConstArrayView< float > + :param weights: + Weights for each joint that has an influence on the vertex. + """ return _py3dnacalib.SetSkinWeightsCommand_setWeights(self, weights) def setJointIndices(self, jointIndices): + r""" + Method for setting the joint indices of joints that influence the vertex in question. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + Joint indices of joints that have an influence on the vertex. + """ return _py3dnacalib.SetSkinWeightsCommand_setJointIndices(self, jointIndices) def run(self, output): @@ -584,8 +1015,9 @@ class SetSkinWeightsCommand(Command): # Register SetSkinWeightsCommand in _py3dnacalib: _py3dnacalib.SetSkinWeightsCommand_swigregister(SetSkinWeightsCommand) - class SetVertexPositionsCommand(Command): + r""" SetVertexPositionsCommand is used to change vertex positions values.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetVertexPositionsCommand @@ -594,15 +1026,67 @@ class SetVertexPositionsCommand(Command): _py3dnacalib.SetVertexPositionsCommand_swiginit(self, _py3dnacalib.new_SetVertexPositionsCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to change. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ return _py3dnacalib.SetVertexPositionsCommand_setMeshIndex(self, meshIndex) def setPositions(self, *args): + r""" + *Overload 1:* + + Method for setting the vertex positions used to calculate new values. + :type positions: dnac::ConstArrayView< dnac::Vector3 > + :param positions: + The vertex positions. + + | + + *Overload 2:* + + Method for setting the vertex positions used to calculate new values. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X coordinates for each vertex. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y coordinates for each vertex. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z coordinates for each vertex. + """ return _py3dnacalib.SetVertexPositionsCommand_setPositions(self, *args) def setMasks(self, masks): + r""" + Method for setting vertex masks used to calculate new vertex position values. + Notes: + If no masks are set, default weight value of 1 is used for each vertex. + :type masks: dnac::ConstArrayView< float > + :param masks: + The weights for each vertex. + """ return _py3dnacalib.SetVertexPositionsCommand_setMasks(self, masks) def setOperation(self, operation): + r""" + Method for setting the type of operation used to calculate new vertex position values. + Notes: + Available operations are: Interpolate, Add, Subtract and Multiply. Each position is calculated based on the provided operation type in the following way: + + Interpolate: = previousValue * (1 - weight) + setValue * weight:math:`\n Add: \f$newValue = previousValue + (setValue * weight)` + + Subtract: = previousValue - (setValue * weight):math:`\n Multiply: \f$newValue = previousValue * (setValue * weight)` + + + setValue is the value from new positions that were set, and weight is the value from masks array. + :type operation: int + :param operation: + The operation to use. + """ return _py3dnacalib.SetVertexPositionsCommand_setOperation(self, operation) def run(self, output): @@ -613,6 +1097,12 @@ _py3dnacalib.SetVertexPositionsCommand_swigregister(SetVertexPositionsCommand) SetVertexPositionsCommand.PositionsMasksCountMismatch = _py3dnacalib.cvar.SetVertexPositionsCommand_PositionsMasksCountMismatch class TranslateCommand(Command): + r""" + TranslateCommand is used to translate neutral joints and vertex positions. + Notes: + Joint translations are represented in parent space, so it is enough to translate only root joints, as that translation will be propagated to the rest of the joints. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_TranslateCommand @@ -621,6 +1111,12 @@ class TranslateCommand(Command): _py3dnacalib.TranslateCommand_swiginit(self, _py3dnacalib.new_TranslateCommand(*args)) def setTranslation(self, translation): + r""" + Method for setting the translation vector. + :type translation: dnac::Vector3 + :param translation: + The translation vector. + """ return _py3dnacalib.TranslateCommand_setTranslation(self, translation) def run(self, output): @@ -629,5 +1125,3 @@ class TranslateCommand(Command): # Register TranslateCommand in _py3dnacalib: _py3dnacalib.TranslateCommand_swigregister(TranslateCommand) - - diff --git a/lib/Maya2023/linux/_py3dna.so b/lib/Maya2023/linux/_py3dna.so index 264a13f..1b5943d 100644 Binary files a/lib/Maya2023/linux/_py3dna.so and b/lib/Maya2023/linux/_py3dna.so differ diff --git a/lib/Maya2023/linux/_py3dnacalib.so b/lib/Maya2023/linux/_py3dnacalib.so index 3cede27..90ea1da 100644 Binary files a/lib/Maya2023/linux/_py3dnacalib.so and b/lib/Maya2023/linux/_py3dnacalib.so differ diff --git a/lib/Maya2023/linux/dna.py b/lib/Maya2023/linux/dna.py index 10915cd..ed8fbaa 100644 --- a/lib/Maya2023/linux/dna.py +++ b/lib/Maya2023/linux/dna.py @@ -4,6 +4,18 @@ # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. + +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass + + + from sys import version_info as _swig_python_version_info if _swig_python_version_info < (2, 7, 0): raise RuntimeError("Python 2.7 or later required") @@ -62,22 +74,25 @@ class _SwigNonDynamicMeta(type): -def __new_decorator(factory_func, original_new): - @staticmethod - def __new(cls, *args, **kwargs): -# FIXME: while this workaround solves the immediate issue with the set of classes we currently have, -# it will fail for classes that use a factory function but need no parameters at all, in which case -# the factory function will never be invoked, only the original __new__ function. - if args or kwargs: - return factory_func(*args, **kwargs) - return original_new(cls) - return __new +def with_metaclass(meta, *bases): + class metaclass(type): -def __managed_init(self, *args, **kwargs): - self._args = args - self._kwargs = kwargs + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) class MemoryResource(object): + r""" + MemoryResource is an abstract class that allows the implementation of polymorphic allocators. + Notes: + It's purpose is to allow passing arbitrary allocators through API boundaries, without requiring changes in the + signatures and types involved. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -95,6 +110,11 @@ class MemoryResource(object): _py3dna.MemoryResource_swigregister(MemoryResource) class AlignedMemoryResource(MemoryResource): + r""" + A MemoryResource that honors alignment requirements. + See also: MemoryResource + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -112,6 +132,11 @@ class AlignedMemoryResource(MemoryResource): _py3dna.AlignedMemoryResource_swigregister(AlignedMemoryResource) class ArenaMemoryResource(MemoryResource): + r""" + Serves allocations from a preallocated memory region. + See also: MemoryResource + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dna.delete_ArenaMemoryResource @@ -120,18 +145,26 @@ class ArenaMemoryResource(MemoryResource): _py3dna.ArenaMemoryResource_swiginit(self, _py3dna.new_ArenaMemoryResource(*args)) def allocate(self, size, alignment): + r""" All allocations will be served from the currently active memory region.""" return _py3dna.ArenaMemoryResource_allocate(self, size, alignment) def deallocate(self, ptr, size, alignment): + r""" This is a no-op, and the regions are only freed when the arena itself is destroyed.""" return _py3dna.ArenaMemoryResource_deallocate(self, ptr, size, alignment) def getUpstreamMemoryResource(self): + r""" The upstream memory resource was passed through the constructor and is backing all arena allocations.""" return _py3dna.ArenaMemoryResource_getUpstreamMemoryResource(self) # Register ArenaMemoryResource in _py3dna: _py3dna.ArenaMemoryResource_swigregister(ArenaMemoryResource) class DefaultMemoryResource(MemoryResource): + r""" + A MemoryResource that delegates to malloc / free. + See also: MemoryResource + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -194,6 +227,35 @@ class Readable(object): __repr__ = _swig_repr def read(self, *args): + r""" + *Overload 1:* + + Read bytes from stream into the given buffer. + :type destination: string + :param destination: + Destination buffer into which the data is going to be read from the stream. + :type size: std::size_t + :param size: + Number of bytes to read from stream. + :rtype: std::size_t + :return: + Number of bytes read. + + | + + *Overload 2:* + + Read bytes from this stream into the given stream. + :type destination: :py:class:`Writable` + :param destination: + Destination stream into which the data is going to be read from this stream. + :type size: std::size_t + :param size: + Number of bytes to read from stream. + :rtype: std::size_t + :return: + Number of bytes read. + """ return _py3dna.Readable_read(self, *args) # Register Readable in _py3dna: @@ -207,6 +269,35 @@ class Writable(object): __repr__ = _swig_repr def write(self, *args): + r""" + *Overload 1:* + + Writes bytes from the given buffer to the stream. + :type source: string + :param source: + Source buffer from which the data is going to be written to the stream. + :type size: std::size_t + :param size: + Number of bytes to write to the stream. + :rtype: std::size_t + :return: + Number of bytes written. + + | + + *Overload 2:* + + Writes bytes from the given stream to this stream. + :type source: :py:class:`Readable` + :param source: + Source stream from which the data is going to be written into this stream. + :type size: std::size_t + :param size: + Number of bytes to write to the stream. + :rtype: std::size_t + :return: + Number of bytes written. + """ return _py3dna.Writable_write(self, *args) # Register Writable in _py3dna: @@ -220,9 +311,21 @@ class Seekable(object): __repr__ = _swig_repr def tell(self): + r""" + Get the current position in the stream. + :rtype: int + :return: + Position in the stream relative to it's start, with 0 denoting the start position. + """ return _py3dna.Seekable_tell(self) def seek(self, position): + r""" + Set the current position in the stream. + :type position: int + :param position: + Position in the stream relative to it's start, with 0 denoting the start position. + """ return _py3dna.Seekable_seek(self, position) # Register Seekable in _py3dna: @@ -236,6 +339,7 @@ class Openable(object): __repr__ = _swig_repr def open(self): + r""" Open access to the stream.""" return _py3dna.Openable_open(self) # Register Openable in _py3dna: @@ -249,6 +353,7 @@ class Closeable(object): __repr__ = _swig_repr def close(self): + r""" Close access to the stream.""" return _py3dna.Closeable_close(self) # Register Closeable in _py3dna: @@ -272,6 +377,12 @@ class Bounded(object): __repr__ = _swig_repr def size(self): + r""" + Obtain size of stream in bytes. + :rtype: int + :return: + Size in bytes. + """ return _py3dna.Bounded_size(self) # Register Bounded in _py3dna: @@ -285,6 +396,7 @@ class Buffered(object): __repr__ = _swig_repr def flush(self): + r""" Flush the changes to filesystem.""" return _py3dna.Buffered_flush(self) # Register Buffered in _py3dna: @@ -298,6 +410,7 @@ class Resizable(object): __repr__ = _swig_repr def resize(self, size): + r""" Resize file to the requested size.""" return _py3dna.Resizable_resize(self, size) # Register Resizable in _py3dna: @@ -326,6 +439,8 @@ AccessMode_ReadWrite = _py3dna.AccessMode_ReadWrite OpenMode_Binary = _py3dna.OpenMode_Binary OpenMode_Text = _py3dna.OpenMode_Text class FileStream(BoundedIOStream): + r""" Standard file stream.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -334,10 +449,37 @@ class FileStream(BoundedIOStream): @staticmethod def create(path, accessMode, openMode, memRes=None): + r""" + Factory method for creation of a FileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type openMode: int + :param openMode: + Control whether the file is opened in binary or textual mode. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the FileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.FileStream_create(path, accessMode, openMode, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a FileStream instance. + :type instance: :py:class:`FileStream` + :param instance: + Instance of FileStream to be freed. + See also: create + """ return _py3dna.FileStream_destroy(instance) __swig_destroy__ = _py3dna.delete_FileStream @@ -345,12 +487,41 @@ class FileStream(BoundedIOStream): _py3dna.FileStream_swigregister(FileStream) def FileStream_create(path, accessMode, openMode, memRes=None): + r""" + Factory method for creation of a FileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type openMode: int + :param openMode: + Control whether the file is opened in binary or textual mode. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the FileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.FileStream_create(path, accessMode, openMode, memRes) def FileStream_destroy(instance): + r""" + Method for freeing a FileStream instance. + :type instance: :py:class:`FileStream` + :param instance: + Instance of FileStream to be freed. + See also: create + """ return _py3dna.FileStream_destroy(instance) class MemoryMappedFileStream(BoundedIOStream, Buffered, Resizable): + r""" Memory mapped file stream.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -359,10 +530,34 @@ class MemoryMappedFileStream(BoundedIOStream, Buffered, Resizable): @staticmethod def create(path, accessMode, memRes=None): + r""" + Factory method for creation of a MemoryMappedFileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryMappedFileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.MemoryMappedFileStream_create(path, accessMode, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a MemoryMappedFileStream instance. + :type instance: :py:class:`MemoryMappedFileStream` + :param instance: + Instance of MemoryMappedFileStream to be freed. + See also: create + """ return _py3dna.MemoryMappedFileStream_destroy(instance) __swig_destroy__ = _py3dna.delete_MemoryMappedFileStream @@ -370,12 +565,38 @@ class MemoryMappedFileStream(BoundedIOStream, Buffered, Resizable): _py3dna.MemoryMappedFileStream_swigregister(MemoryMappedFileStream) def MemoryMappedFileStream_create(path, accessMode, memRes=None): + r""" + Factory method for creation of a MemoryMappedFileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryMappedFileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.MemoryMappedFileStream_create(path, accessMode, memRes) def MemoryMappedFileStream_destroy(instance): + r""" + Method for freeing a MemoryMappedFileStream instance. + :type instance: :py:class:`MemoryMappedFileStream` + :param instance: + Instance of MemoryMappedFileStream to be freed. + See also: create + """ return _py3dna.MemoryMappedFileStream_destroy(instance) class MemoryStream(BoundedIOStream): + r""" In-memory stream.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -384,10 +605,63 @@ class MemoryStream(BoundedIOStream): @staticmethod def create(*args): + r""" + *Overload 1:* + + Factory method for creation of a MemoryStream instance. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.MemoryStream_create(*args) @staticmethod def destroy(instance): + r""" + Method for freeing a MemoryStream instance. + :type instance: :py:class:`MemoryStream` + :param instance: + Instance of MemoryStream to be freed. + See also: create + """ return _py3dna.MemoryStream_destroy(instance) __swig_destroy__ = _py3dna.delete_MemoryStream @@ -395,31 +669,189 @@ class MemoryStream(BoundedIOStream): _py3dna.MemoryStream_swigregister(MemoryStream) def MemoryStream_create(*args): + r""" + *Overload 1:* + + Factory method for creation of a MemoryStream instance. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.MemoryStream_create(*args) def MemoryStream_destroy(instance): + r""" + Method for freeing a MemoryStream instance. + :type instance: :py:class:`MemoryStream` + :param instance: + Instance of MemoryStream to be freed. + See also: create + """ return _py3dna.MemoryStream_destroy(instance) -FileStream.__new__ = __new_decorator(FileStream_create, FileStream.__new__) -FileStream.__del__ = lambda instance: FileStream_destroy(instance) -FileStream.__init__ = __managed_init -del FileStream.create -del FileStream.destroy +FileStreamImpl = FileStream + +class FileStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(FileStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(FileStreamImpl) if name not in ("create","destroy")] + +class FileStream(with_metaclass(FileStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = FileStreamImpl.create(*args, **kwargs) + + def __del__(self): + FileStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -MemoryMappedFileStream.__new__ = __new_decorator(MemoryMappedFileStream_create, MemoryMappedFileStream.__new__) -MemoryMappedFileStream.__del__ = lambda instance: MemoryMappedFileStream_destroy(instance) -MemoryMappedFileStream.__init__ = __managed_init -del MemoryMappedFileStream.create -del MemoryMappedFileStream.destroy +MemoryMappedFileStreamImpl = MemoryMappedFileStream + +class MemoryMappedFileStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(MemoryMappedFileStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(MemoryMappedFileStreamImpl) if name not in ("create","destroy")] + +class MemoryMappedFileStream(with_metaclass(MemoryMappedFileStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = MemoryMappedFileStreamImpl.create(*args, **kwargs) + + def __del__(self): + MemoryMappedFileStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -MemoryStream.__new__ = __new_decorator(MemoryStream_create, MemoryStream.__new__) -MemoryStream.__del__ = lambda instance: MemoryStream_destroy(instance) -MemoryStream.__init__ = __managed_init -del MemoryStream.create -del MemoryStream.destroy +MemoryStreamImpl = MemoryStream + +class MemoryStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(MemoryStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(MemoryStreamImpl) if name not in ("create","destroy")] + +class MemoryStream(with_metaclass(MemoryStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = MemoryStreamImpl.create(*args, **kwargs) + + def __del__(self): + MemoryStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] FileStream.AccessMode_Read = AccessMode_Read @@ -463,11 +895,11 @@ def __mul__(*args): def __truediv__(*args): return _py3dna.__truediv__(*args) -def __eq__(*args): - return _py3dna.__eq__(*args) +def __eq__(lhs, rhs): + return _py3dna.__eq__(lhs, rhs) -def __ne__(*args): - return _py3dna.__ne__(*args) +def __ne__(lhs, rhs): + return _py3dna.__ne__(lhs, rhs) DataLayer_Descriptor = _py3dna.DataLayer_Descriptor DataLayer_Definition = _py3dna.DataLayer_Definition DataLayer_Behavior = _py3dna.DataLayer_Behavior @@ -509,6 +941,13 @@ class CoordinateSystem(object): _py3dna.CoordinateSystem_swigregister(CoordinateSystem) class DescriptorReader(object): + r""" + Read-only accessors for various metadata about the character and the rig. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -531,9 +970,31 @@ class DescriptorReader(object): return _py3dna.DescriptorReader_getMetaDataCount(self) def getMetaDataKey(self, index): + r""" + :type index: int + :param index: + A position in the zero-indexed array of key-value pairs. + Warning: + The index must be less than the value returned by getMetaDataCount. + :rtype: :py:class:`StringView` + :return: View over the key name string. + """ return _py3dna.DescriptorReader_getMetaDataKey(self, index) def getMetaDataValue(self, key): + r""" + Stored metadata value associated with the given key. + Notes: + If no value is associated with the given key, the returned view + will contain nullptr and will have a size of 0. + :type key: string + :param key: + A unique-known key that has a value associated to it. + Warning: + The key must be null-terminated. + :rtype: :py:class:`StringView` + :return: View over the metadata value string. + """ return _py3dna.DescriptorReader_getMetaDataValue(self, key) def getTranslationUnit(self): @@ -546,21 +1007,44 @@ class DescriptorReader(object): return _py3dna.DescriptorReader_getCoordinateSystem(self) def getLODCount(self): + r""" + Available levels of detail (e.g. 6 which means the following levels are available: + [0,1,2,3,4,5], where 0 is the LOD with the highest details, and 5 is the LOD with + lowest details). + """ return _py3dna.DescriptorReader_getLODCount(self) def getDBMaxLOD(self): + r""" + The maximum level of detail stored in the DNA data for this character. + Notes: + The value is relative to LOD-0 from the database. + """ return _py3dna.DescriptorReader_getDBMaxLOD(self) def getDBComplexity(self): + r""" + Name of the input control interface used to drive this character rig. + Notes: + This parameter denotes the character's input control complexity. + """ return _py3dna.DescriptorReader_getDBComplexity(self) def getDBName(self): + r""" + Name of the database from which the character originates. + Notes: + All characters from the same database must have the same Definition, but may + have different complexity or LOD. + """ return _py3dna.DescriptorReader_getDBName(self) # Register DescriptorReader in _py3dna: _py3dna.DescriptorReader_swigregister(DescriptorReader) class MeshBlendShapeChannelMapping(object): + r""" Mapping that associates a blend shape channel to it's mesh.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr meshIndex = property(_py3dna.MeshBlendShapeChannelMapping_meshIndex_get, _py3dna.MeshBlendShapeChannelMapping_meshIndex_set) @@ -574,6 +1058,13 @@ class MeshBlendShapeChannelMapping(object): _py3dna.MeshBlendShapeChannelMapping_swigregister(MeshBlendShapeChannelMapping) class DefinitionReader(DescriptorReader): + r""" + Read-only accessors for DNA attributes that represent the rig's static data. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -584,102 +1075,354 @@ class DefinitionReader(DescriptorReader): return _py3dna.DefinitionReader_getGUIControlCount(self) def getGUIControlName(self, index): + r""" + Name of the requested GUI control. + :type index: int + :param index: + A name's position in the zero-indexed array of GUI control names. + Warning: + The index must be less than the value returned by getGUIControlCount. + :rtype: :py:class:`StringView` + :return: View over the GUI control name string. + """ return _py3dna.DefinitionReader_getGUIControlName(self, index) def getRawControlCount(self): return _py3dna.DefinitionReader_getRawControlCount(self) def getRawControlName(self, index): + r""" + Name of the requested raw control. + :type index: int + :param index: + A name's position in the zero-indexed array of raw control names. + Warning: + The index must be less than the value returned by getRawControlCount. + :rtype: :py:class:`StringView` + :return: View over the control name string. + """ return _py3dna.DefinitionReader_getRawControlName(self, index) def getJointCount(self): return _py3dna.DefinitionReader_getJointCount(self) def getJointName(self, index): + r""" + Name of the requested joint. + :type index: int + :param index: + A name's position in the zero-indexed array of joint names. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: :py:class:`StringView` + :return: View over the joint name string. + """ return _py3dna.DefinitionReader_getJointName(self, index) def getJointIndexListCount(self): + r""" + Number of joint index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getJointIndexListCount(self) def getJointIndicesForLOD(self, lod): + r""" + List of joint indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which joints are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the joint indices. + See also: getLODCount + See also: getJointName + """ return _py3dna.DefinitionReader_getJointIndicesForLOD(self, lod) def getJointParentIndex(self, index): + r""" + Index of the requested joint's parent. + Notes: + The joint hierarchy may be traversed and reconstructed using this function. Example: + Joint names: [A, B, C, D, E, F, G, H, I] + Hierarchy: [0, 0, 0, 1, 1, 4, 2, 6, 2] + Describes the following hierarchy: + A + + B + | + D + | + E + | + F + + C + + G + | + H + + I + + Requesting the parent index of joint 5 (joint name: F) would return 4 (joint name: E). + Requesting the parent index of the root joint: 0 (joint name: A) would return the same index 0. + An out of bounds request (an index greater than the number of joints returns UINT16_MAX). + :type index: int + :param index: + The joint index which parent is being requested. + """ return _py3dna.DefinitionReader_getJointParentIndex(self, index) def getBlendShapeChannelCount(self): return _py3dna.DefinitionReader_getBlendShapeChannelCount(self) def getBlendShapeChannelName(self, index): + r""" + Name of the requested blend shape channel. + :type index: int + :param index: + A name's position in the zero-indexed array of blend shape channel names. + Warning: + The index must be less than the value returned by BlendShapeChannelExtentReader::getBlendShapeChannelCount. + :rtype: :py:class:`StringView` + :return: View over the blend shape channel name string. + """ return _py3dna.DefinitionReader_getBlendShapeChannelName(self, index) def getBlendShapeChannelIndexListCount(self): + r""" + Number of blend shape channel index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getBlendShapeChannelIndexListCount(self) def getBlendShapeChannelIndicesForLOD(self, lod): + r""" + List of blend shape channel indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which blend shape channels are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the blend shape channel indices. + + These LOD indices are not interchangeable with the LOD values from BehaviorReader::getBlendShapeChannelLODs. + See also: getLODCount + See also: getBlendShapeChannelName + """ return _py3dna.DefinitionReader_getBlendShapeChannelIndicesForLOD(self, lod) def getAnimatedMapCount(self): return _py3dna.DefinitionReader_getAnimatedMapCount(self) def getAnimatedMapName(self, index): + r""" + Name of the requested animated map. + :type index: int + :param index: + A name's position in the zero-indexed array of animated map names. + Warning: + The index must be less than the value returned by getAnimatedMapCount. + :rtype: :py:class:`StringView` + :return: View over the animated map name string. + """ return _py3dna.DefinitionReader_getAnimatedMapName(self, index) def getAnimatedMapIndexListCount(self): + r""" + Number of animated map index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getAnimatedMapIndexListCount(self) def getAnimatedMapIndicesForLOD(self, lod): + r""" + List of animated map indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which animated maps are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the animated map indices. + See also: getLODCount + See also: getAnimatedMapName + """ return _py3dna.DefinitionReader_getAnimatedMapIndicesForLOD(self, lod) def getMeshCount(self): return _py3dna.DefinitionReader_getMeshCount(self) def getMeshName(self, index): + r""" + Name of the requested mesh. + :type index: int + :param index: + A name's position in the zero-indexed array of mesh names. + Warning: + The index must be less than the value returned by getMeshCount. + :rtype: :py:class:`StringView` + :return: View over the mesh name string. + """ return _py3dna.DefinitionReader_getMeshName(self, index) def getMeshIndexListCount(self): + r""" + Number of mesh index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getMeshIndexListCount(self) def getMeshIndicesForLOD(self, lod): + r""" + List of mesh indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which meshes are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the mesh indices. + See also: getLODCount + See also: getMeshName + """ return _py3dna.DefinitionReader_getMeshIndicesForLOD(self, lod) def getMeshBlendShapeChannelMappingCount(self): + r""" Number of mesh-blend shape channel mapping items.""" return _py3dna.DefinitionReader_getMeshBlendShapeChannelMappingCount(self) def getMeshBlendShapeChannelMapping(self, index): + r""" + :type index: int + :param index: + A mapping's position in the zero-indexed array of mesh-blend shape channel mappings. + Warning: + The index must be less than the value returned by getMeshBlendShapeChannelMappingCount. + :rtype: :py:class:`MeshBlendShapeChannelMapping` + :return: A structure holding the mesh index and the associated blend shape channel index. + """ return _py3dna.DefinitionReader_getMeshBlendShapeChannelMapping(self, index) def getMeshBlendShapeChannelMappingIndicesForLOD(self, lod): + r""" + List of mesh-blend shape channel mapping indices for the specified LOD. + Notes: + The indices from this list can be used with the getMeshBlendShapeChannelMapping API + to retrieve individual mapping items. + :type lod: int + :param lod: + The level of detail which meshes are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the mesh blend shape channel mapping indices. + See also: getLODCount + See also: getMeshBlendShapeChannelMapping + """ return _py3dna.DefinitionReader_getMeshBlendShapeChannelMappingIndicesForLOD(self, lod) def getNeutralJointTranslation(self, index): + r""" + :type index: int + :param index: + A joint's position in the zero-indexed array of joint translations. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: dna::Vector3 + :return: The joint's translation (x, y, z). + """ return _py3dna.DefinitionReader_getNeutralJointTranslation(self, index) def getNeutralJointTranslationXs(self): + r""" + List of all translation X values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getNeutralJointTranslation + """ return _py3dna.DefinitionReader_getNeutralJointTranslationXs(self) def getNeutralJointTranslationYs(self): + r""" + List of all translation Y values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getNeutralJointTranslation + """ return _py3dna.DefinitionReader_getNeutralJointTranslationYs(self) def getNeutralJointTranslationZs(self): + r""" + List of all translation Z values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getNeutralJointTranslation + """ return _py3dna.DefinitionReader_getNeutralJointTranslationZs(self) def getNeutralJointRotation(self, index): + r""" + :type index: int + :param index: + A joint's position in the zero-indexed array of joint rotations. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: dna::Vector3 + :return: The joint's rotation (x, y, z). + """ return _py3dna.DefinitionReader_getNeutralJointRotation(self, index) def getNeutralJointRotationXs(self): + r""" + List of all rotation X values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getNeutralJointRotation + """ return _py3dna.DefinitionReader_getNeutralJointRotationXs(self) def getNeutralJointRotationYs(self): + r""" + List of all rotation Y values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getNeutralJointRotation + """ return _py3dna.DefinitionReader_getNeutralJointRotationYs(self) def getNeutralJointRotationZs(self): + r""" + List of all rotation Z values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getNeutralJointRotation + """ return _py3dna.DefinitionReader_getNeutralJointRotationZs(self) # Register DefinitionReader in _py3dna: _py3dna.DefinitionReader_swigregister(DefinitionReader) class BehaviorReader(DefinitionReader): + r""" + Read-only accessors for DNA attributes that define the rig's evaluation. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -687,96 +1430,285 @@ class BehaviorReader(DefinitionReader): __repr__ = _swig_repr def getGUIToRawInputIndices(self): + r""" + Input indices used for mapping gui to raw controls. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ return _py3dna.BehaviorReader_getGUIToRawInputIndices(self) def getGUIToRawOutputIndices(self): + r""" + Output indices used for mapping gui to raw controls. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ return _py3dna.BehaviorReader_getGUIToRawOutputIndices(self) def getGUIToRawFromValues(self): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getGUIToRawFromValues(self) def getGUIToRawToValues(self): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getGUIToRawToValues(self) def getGUIToRawSlopeValues(self): + r""" + Computational values(slope/gradient) used for calculating the + output value during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getGUIToRawSlopeValues(self) def getGUIToRawCutValues(self): + r""" + Computational values(vertical intercept) used for calculating the + output value during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getGUIToRawCutValues(self) def getPSDCount(self): + r""" The number of distinct PSD expressions.""" return _py3dna.BehaviorReader_getPSDCount(self) def getPSDRowIndices(self): + r""" + PSD(input) indices. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of PSD indices. + """ return _py3dna.BehaviorReader_getPSDRowIndices(self) def getPSDColumnIndices(self): + r""" + Control(input) indices. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of control indices. + """ return _py3dna.BehaviorReader_getPSDColumnIndices(self) def getPSDValues(self): + r""" + Weights associated with each PSD row and column pair. + :rtype: dna::ConstArrayView< float > + :return: View over the array of weights. + """ return _py3dna.BehaviorReader_getPSDValues(self) def getJointRowCount(self): + r""" Number of rows in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorReader_getJointRowCount(self) def getJointColumnCount(self): + r""" Number of columns in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorReader_getJointColumnCount(self) def getJointVariableAttributeIndices(self, lod): + r""" + Joint attribute indices (output indices) for the requested LOD. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of joint indices. + """ return _py3dna.BehaviorReader_getJointVariableAttributeIndices(self, lod) def getJointGroupCount(self): + r""" Number of joint groups present in the entire joint matrix.""" return _py3dna.BehaviorReader_getJointGroupCount(self) def getJointGroupLODs(self, jointGroupIndex): + r""" + Number of rows per each level of detail for the requested joint group. + Notes: + Each element's position represents the level itself, while the value denotes + the number of rows within the joint group belonging to that level. e.g.: + [12, 9, 3] + | | + LOD-2 contains first 3 rows + | + LOD-1 contains first 9 rows + + LOD-0 contains first 12 rows + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ return _py3dna.BehaviorReader_getJointGroupLODs(self, jointGroupIndex) def getJointGroupInputIndices(self, jointGroupIndex): + r""" + Column indices that the requested joint group contains. + Notes: + The column indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of column indices. + """ return _py3dna.BehaviorReader_getJointGroupInputIndices(self, jointGroupIndex) def getJointGroupOutputIndices(self, jointGroupIndex): + r""" + Row indices that the requested joint group contains. + Notes: + The row indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of row indices. + """ return _py3dna.BehaviorReader_getJointGroupOutputIndices(self, jointGroupIndex) def getJointGroupValues(self, jointGroupIndex): + r""" + Values that the requested joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< float > + :return: View over the array of values. + """ return _py3dna.BehaviorReader_getJointGroupValues(self, jointGroupIndex) def getJointGroupJointIndices(self, jointGroupIndex): + r""" + Joint indices that the requested joint group contains. + Notes: + These joint indices can be used to get the joint names through DefinitionReader::getJointName. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of joint indices. + See also: DefinitionReader + """ return _py3dna.BehaviorReader_getJointGroupJointIndices(self, jointGroupIndex) def getBlendShapeChannelLODs(self): + r""" + Input index count per each level of detail for blend shape channels. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of input indices belonging to that level. + Warning: + These LOD values are not interchangeable with the LOD indices from DefinitionReader::getBlendShapeChannelIndicesForLOD. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ return _py3dna.BehaviorReader_getBlendShapeChannelLODs(self) def getBlendShapeChannelInputIndices(self): + r""" + Input indices used to index into the input vector. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ return _py3dna.BehaviorReader_getBlendShapeChannelInputIndices(self) def getBlendShapeChannelOutputIndices(self): + r""" + Output indices specify the positions of blend shape channel output values. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ return _py3dna.BehaviorReader_getBlendShapeChannelOutputIndices(self) def getAnimatedMapLODs(self): + r""" + Row count per each level of detail for animated maps. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of rows (within the conditional table), + belonging to that level. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ return _py3dna.BehaviorReader_getAnimatedMapLODs(self) def getAnimatedMapInputIndices(self): + r""" + Input indices used to index into the array of input values. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ return _py3dna.BehaviorReader_getAnimatedMapInputIndices(self) def getAnimatedMapOutputIndices(self): + r""" + Output indices that specify the computed output value's position. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ return _py3dna.BehaviorReader_getAnimatedMapOutputIndices(self) def getAnimatedMapFromValues(self): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getAnimatedMapFromValues(self) def getAnimatedMapToValues(self): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getAnimatedMapToValues(self) def getAnimatedMapSlopeValues(self): + r""" + Computational values(slope/gradient) used for calculating the output value. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getAnimatedMapSlopeValues(self) def getAnimatedMapCutValues(self): + r""" + Computational values(vertical intercept) used for calculating the output value. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getAnimatedMapCutValues(self) # Register BehaviorReader in _py3dna: _py3dna.BehaviorReader_swigregister(BehaviorReader) class GeometryReader(DefinitionReader): + r""" + Read-only accessors to the geometry data associated with a rig. + Warning: + Implementors should inherit from Reader itself and not this class. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -784,108 +1716,560 @@ class GeometryReader(DefinitionReader): __repr__ = _swig_repr def getVertexPositionCount(self, meshIndex): + r""" + Number of vertex positions in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexPositionCount(self, meshIndex) def getVertexPosition(self, meshIndex, vertexIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + The index of the vertex position in the zero-indexed array of vertex positions. + + vertexIndex must be less than the value returned by getVertexPositionCount. + Notes: + The vertices are sorted by the vertex ID. + :rtype: dna::Position + :return: The vertex position. + """ return _py3dna.GeometryReader_getVertexPosition(self, meshIndex, vertexIndex) def getVertexPositionXs(self, meshIndex): + r""" + List of all vertex position X values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getVertexPosition + """ return _py3dna.GeometryReader_getVertexPositionXs(self, meshIndex) def getVertexPositionYs(self, meshIndex): + r""" + List of all vertex position Y values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getVertexPosition + """ return _py3dna.GeometryReader_getVertexPositionYs(self, meshIndex) def getVertexPositionZs(self, meshIndex): + r""" + List of all vertex position Z values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getVertexPosition + """ return _py3dna.GeometryReader_getVertexPositionZs(self, meshIndex) def getVertexTextureCoordinateCount(self, meshIndex): + r""" + Number of texture coordinates in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexTextureCoordinateCount(self, meshIndex) def getVertexTextureCoordinate(self, meshIndex, textureCoordinateIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type textureCoordinateIndex: int + :param textureCoordinateIndex: + The index of the texture coordinate in the zero-indexed array of texture coordinates. + + textureCoordinateIndex must be less than the value returned by getVertexTextureCoordinateCount. + :rtype: dna::TextureCoordinate + :return: The texture coordinate. + """ return _py3dna.GeometryReader_getVertexTextureCoordinate(self, meshIndex, textureCoordinateIndex) def getVertexTextureCoordinateUs(self, meshIndex): + r""" + List of all texture coordinate U values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexTextureCoordinate. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all U values. + See also: getVertexTextureCoordinate + """ return _py3dna.GeometryReader_getVertexTextureCoordinateUs(self, meshIndex) def getVertexTextureCoordinateVs(self, meshIndex): + r""" + List of all texture coordinate V values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexTextureCoordinate. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all V values. + See also: getVertexTextureCoordinate + """ return _py3dna.GeometryReader_getVertexTextureCoordinateVs(self, meshIndex) def getVertexNormalCount(self, meshIndex): + r""" + Number of vertex normals in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexNormalCount(self, meshIndex) def getVertexNormal(self, meshIndex, normalIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type normalIndex: int + :param normalIndex: + The index of the vertex normal in the zero-indexed array of vertex normals. + + normalIndex must be less than the value returned by getVertexNormalCount. + :rtype: dna::Normal + :return: The vertex normal. + """ return _py3dna.GeometryReader_getVertexNormal(self, meshIndex, normalIndex) def getVertexNormalXs(self, meshIndex): + r""" + List of all normal X values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexNormalXs(self, meshIndex) def getVertexNormalYs(self, meshIndex): + r""" + List of all normal Y value for the referenced meshs. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexNormalYs(self, meshIndex) def getVertexNormalZs(self, meshIndex): + r""" + List of all normal Z values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexNormalZs(self, meshIndex) def getVertexLayoutCount(self, meshIndex): + r""" + Number of vertex layouts in the entire mesh. + Notes: + A vertex layout is a collection of vertex attributes. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexLayoutCount(self, meshIndex) def getVertexLayout(self, meshIndex, layoutIndex): + r""" + Vertex layouts contain only attribute indices which can be used to query + the actual attributes, such as positions, texture coordinates and normals, + which are associated with the vertex. + Notes: + The indices from a layout are usable with the above defined APIs. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type layoutIndex: int + :param layoutIndex: + The index of the layout in the zero-indexed array of vertex layouts. + + layoutIndex must be less than the value returned by getVertexLayoutCount. + See also: getVertexPosition + See also: getVertexTextureCoordinate + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexLayout(self, meshIndex, layoutIndex) def getVertexLayoutPositionIndices(self, meshIndex): + r""" + Position indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex position indices values. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getVertexLayoutPositionIndices(self, meshIndex) def getVertexLayoutTextureCoordinateIndices(self, meshIndex): + r""" + Texture coordinate indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex texture coordinate indices. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getVertexLayoutTextureCoordinateIndices(self, meshIndex) def getVertexLayoutNormalIndices(self, meshIndex): + r""" + Normal indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex normal indices. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getVertexLayoutNormalIndices(self, meshIndex) def getFaceCount(self, meshIndex): + r""" + Number of faces that belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getFaceCount(self, meshIndex) def getFaceVertexLayoutIndices(self, meshIndex, faceIndex): + r""" + List of vertex layout indices the belong to a face on the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type faceIndex: int + :param faceIndex: + A face's position in the zero-indexed array of faces that belong to + the above referenced mesh. + + faceIndex must be less than the value returned by getFaceCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over the list of vertex layout indices. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getFaceVertexLayoutIndices(self, meshIndex, faceIndex) def getMaximumInfluencePerVertex(self, meshIndex): + r""" + The maximum number of joints that may influence any single vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getMaximumInfluencePerVertex(self, meshIndex) def getSkinWeightsCount(self, meshIndex): + r""" + Number of skin weights associated with the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getSkinWeightsCount(self, meshIndex) def getSkinWeightsValues(self, meshIndex, vertexIndex): + r""" + List of skin weights influencing the requested vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertices. + + vertexIndex must be less than the value returned by getVertexPositionCount. + :rtype: dna::ConstArrayView< float > + :return: View over the list of skin weights. + """ return _py3dna.GeometryReader_getSkinWeightsValues(self, meshIndex, vertexIndex) def getSkinWeightsJointIndices(self, meshIndex, vertexIndex): + r""" + List of joint indices associated with each skin weight for the specified vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertices. + + vertexIndex must be less than the value returned by getVertexPositionCount. + Notes: + The joint indices are stored in the same order as the weights they + are associated with. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the list of joint indices. + """ return _py3dna.GeometryReader_getSkinWeightsJointIndices(self, meshIndex, vertexIndex) def getBlendShapeTargetCount(self, meshIndex): + r""" + Number of blend shapes that belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getBlendShapeTargetCount(self, meshIndex) def getBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex): + r""" + The matching blend shape channel index of the requested blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + See also: DefinitionReader::getBlendShapeChannelName + """ return _py3dna.GeometryReader_getBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDeltaCount(self, meshIndex, blendShapeTargetIndex): + r""" + Number of deltas that belong to the specified blend shape. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaCount(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDelta(self, meshIndex, blendShapeTargetIndex, deltaIndex): + r""" + List of deltas for each affected vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :type deltaIndex: int + :param deltaIndex: + A position in the zero-indexed array of blend shapes deltas. + + deltaIndex must be less than the value returned by getBlendShapeTargetDeltaCount. + """ return _py3dna.GeometryReader_getBlendShapeTargetDelta(self, meshIndex, blendShapeTargetIndex, deltaIndex) def getBlendShapeTargetDeltaXs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta X values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getBlendShapeTargetDelta + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaXs(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDeltaYs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta Y values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getBlendShapeTargetDelta + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaYs(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDeltaZs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta Z values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getBlendShapeTargetDelta + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaZs(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex): + r""" + Vertex position indices affected by the referenced blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + Notes: + The vertex position indices are stored in the same order as the deltas they + are associated with. + These indices can be used to query the associated vertices themselves through getVertexPosition. + See also: getVertexPosition + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over the list of vertex position indices. + """ return _py3dna.GeometryReader_getBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex) # Register GeometryReader in _py3dna: _py3dna.GeometryReader_swigregister(GeometryReader) class Reader(BehaviorReader, GeometryReader): + r""" + The abstract Reader which its implementations are expected to inherit. + Notes: + This class combines the various different reader interfaces into a single interface. + The artificial separation into multiple interfaces mirrors the DNA file structure that + is separated into matching layers under the same names. As these layers can be + selectively loaded, it might be convenient to slice-off interfaces which layers were + not loaded. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -894,6 +2278,12 @@ class Reader(BehaviorReader, GeometryReader): __swig_destroy__ = _py3dna.delete_Reader def unload(self, layer): + r""" + Unload all data of the specified layer and all layers dependent on it. + :type layer: int + :param layer: + Layer which data should be unloaded. + """ return _py3dna.Reader_unload(self, layer) # Register Reader in _py3dna: @@ -908,6 +2298,7 @@ class StreamReader(Reader): __swig_destroy__ = _py3dna.delete_StreamReader def read(self): + r""" read data from stream into internal structures.""" return _py3dna.StreamReader_read(self) # Register StreamReader in _py3dna: @@ -925,10 +2316,188 @@ class BinaryStreamReader(StreamReader): @staticmethod def create(*args): + r""" + *Overload 1:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int, optional + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int, optional + :param maxLOD: + The maximum level of details to be loaded. + + A value of zero indicates to load all LODs. + Warning: + The maxLOD value must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 4:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 5:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.BinaryStreamReader_create(*args) @staticmethod def destroy(instance): + r""" + Method for freeing a BinaryStreamReader instance. + :type instance: :py:class:`BinaryStreamReader` + :param instance: + Instance of BinaryStreamReader to be freed. + See also: create + """ return _py3dna.BinaryStreamReader_destroy(instance) __swig_destroy__ = _py3dna.delete_BinaryStreamReader @@ -936,9 +2505,187 @@ class BinaryStreamReader(StreamReader): _py3dna.BinaryStreamReader_swigregister(BinaryStreamReader) def BinaryStreamReader_create(*args): + r""" + *Overload 1:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int, optional + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int, optional + :param maxLOD: + The maximum level of details to be loaded. + + A value of zero indicates to load all LODs. + Warning: + The maxLOD value must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 4:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 5:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.BinaryStreamReader_create(*args) def BinaryStreamReader_destroy(instance): + r""" + Method for freeing a BinaryStreamReader instance. + :type instance: :py:class:`BinaryStreamReader` + :param instance: + Instance of BinaryStreamReader to be freed. + See also: create + """ return _py3dna.BinaryStreamReader_destroy(instance) class JSONStreamReader(StreamReader): @@ -950,10 +2697,31 @@ class JSONStreamReader(StreamReader): @staticmethod def create(stream, memRes=None): + r""" + Factory method for creation of JSONStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.JSONStreamReader_create(stream, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a JSONStreamReader instance. + :type instance: :py:class:`JSONStreamReader` + :param instance: + Instance of JSONStreamReader to be freed. + See also: create + """ return _py3dna.JSONStreamReader_destroy(instance) __swig_destroy__ = _py3dna.delete_JSONStreamReader @@ -961,26 +2729,124 @@ class JSONStreamReader(StreamReader): _py3dna.JSONStreamReader_swigregister(JSONStreamReader) def JSONStreamReader_create(stream, memRes=None): + r""" + Factory method for creation of JSONStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.JSONStreamReader_create(stream, memRes) def JSONStreamReader_destroy(instance): + r""" + Method for freeing a JSONStreamReader instance. + :type instance: :py:class:`JSONStreamReader` + :param instance: + Instance of JSONStreamReader to be freed. + See also: create + """ return _py3dna.JSONStreamReader_destroy(instance) -BinaryStreamReader.__new__ = __new_decorator(BinaryStreamReader_create, BinaryStreamReader.__new__) -BinaryStreamReader.__del__ = lambda instance: BinaryStreamReader_destroy(instance) -BinaryStreamReader.__init__ = __managed_init -del BinaryStreamReader.create -del BinaryStreamReader.destroy +BinaryStreamReaderImpl = BinaryStreamReader + +class BinaryStreamReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(BinaryStreamReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(BinaryStreamReaderImpl) if name not in ("create","destroy")] + +class BinaryStreamReader(with_metaclass(BinaryStreamReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = BinaryStreamReaderImpl.create(*args, **kwargs) + + def __del__(self): + BinaryStreamReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -JSONStreamReader.__new__ = __new_decorator(JSONStreamReader_create, JSONStreamReader.__new__) -JSONStreamReader.__del__ = lambda instance: JSONStreamReader_destroy(instance) -JSONStreamReader.__init__ = __managed_init -del JSONStreamReader.create -del JSONStreamReader.destroy +JSONStreamReaderImpl = JSONStreamReader + +class JSONStreamReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(JSONStreamReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(JSONStreamReaderImpl) if name not in ("create","destroy")] + +class JSONStreamReader(with_metaclass(JSONStreamReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = JSONStreamReaderImpl.create(*args, **kwargs) + + def __del__(self): + JSONStreamReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] class DescriptorWriter(object): + r""" + Write-only accessors to various metadata about the character and the rig. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -988,6 +2854,13 @@ class DescriptorWriter(object): __repr__ = _swig_repr def setName(self, name): + r""" + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an allocation. + """ return _py3dna.DescriptorWriter_setName(self, name) def setArchetype(self, archetype): @@ -1000,9 +2873,23 @@ class DescriptorWriter(object): return _py3dna.DescriptorWriter_setAge(self, age) def clearMetaData(self): + r""" Empties the metadata storage, delete all key-value pairs.""" return _py3dna.DescriptorWriter_clearMetaData(self) def setMetaData(self, key, value): + r""" + Associate the metadata value with the given key. + :type key: string + :param key: + A unique, null-terminated key, to which the given value will be assigned. + :type value: string + :param value: + A null-terminated, metadata value, which is to be assigned to the given key. + Notes: + Consecutive calls using the same key will overwrite any existing data. + + Passing nullptr as the value argument will cause the associated key to be deleted. + """ return _py3dna.DescriptorWriter_setMetaData(self, key, value) def setTranslationUnit(self, unit): @@ -1015,21 +2902,53 @@ class DescriptorWriter(object): return _py3dna.DescriptorWriter_setCoordinateSystem(self, system) def setLODCount(self, lodCount): + r""" + Available levels of detail (e.g. 6 which means the following levels are available: + [0,1,2,3,4,5], where 0 is the LOD with the highest details, and 5 is the LOD with + lowest details). + :type lodCount: int + :param lodCount: + The number of levels available. + """ return _py3dna.DescriptorWriter_setLODCount(self, lodCount) def setDBMaxLOD(self, lod): + r""" The maximum level of detail stored in the DNA data for this character.""" return _py3dna.DescriptorWriter_setDBMaxLOD(self, lod) def setDBComplexity(self, name): + r""" + Name of the input control interface used to drive this character rig. + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DescriptorWriter_setDBComplexity(self, name) def setDBName(self, name): + r""" + Name of the database from which the character originates. + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DescriptorWriter_setDBName(self, name) # Register DescriptorWriter in _py3dna: _py3dna.DescriptorWriter_swigregister(DescriptorWriter) class DefinitionWriter(DescriptorWriter): + r""" + Write-only accessors for DNA attributes that represent the rig's static data. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1037,108 +2956,392 @@ class DefinitionWriter(DescriptorWriter): __repr__ = _swig_repr def clearGUIControlNames(self): + r""" Delete all stored GUI control names.""" return _py3dna.DefinitionWriter_clearGUIControlNames(self) def setGUIControlName(self, index, name): + r""" + Name of the specified GUI control. + :type index: int + :param index: + A name's position in the zero-indexed array of GUI control names. + Notes: + The control name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setGUIControlName(self, index, name) def clearRawControlNames(self): + r""" Delete all stored raw control names.""" return _py3dna.DefinitionWriter_clearRawControlNames(self) def setRawControlName(self, index, name): + r""" + Name of the specified raw control. + :type index: int + :param index: + A name's position in the zero-indexed array of raw control names. + Notes: + The control name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setRawControlName(self, index, name) def clearJointNames(self): + r""" Delete all stored joint names.""" return _py3dna.DefinitionWriter_clearJointNames(self) def setJointName(self, index, name): + r""" + Name of the specified joint. + :type index: int + :param index: + A name's position in the zero-indexed array of joint names. + Notes: + The joint name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setJointName(self, index, name) def clearJointIndices(self): + r""" Delete all stored joint indices.""" return _py3dna.DefinitionWriter_clearJointIndices(self) def setJointIndices(self, index, jointIndices): + r""" + Store a list of joint indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where joint indices are stored. + Notes: + The index denotes the position of an entire joint index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of joint indices. + + The joint index storage will be implicitly resized (if needed) to provide + storage for the number of joint indices that is inferred from the specified index. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + + These indices can be used to access joint names through DefinitionReader::getJointName. + :type count: int + :param count: + The number of joint indices to copy. + """ return _py3dna.DefinitionWriter_setJointIndices(self, index, jointIndices) def clearLODJointMappings(self): + r""" Delete all stored LOD to joint list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODJointMappings(self) def setLODJointMapping(self, lod, index): + r""" + Set which joints belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the joints are being associated. + :type index: int + :param index: + The index onto which joints indices were assigned using setJointIndices. + See also: setJointIndices + """ return _py3dna.DefinitionWriter_setLODJointMapping(self, lod, index) def clearBlendShapeChannelNames(self): + r""" Delete all stored blend shape channel names.""" return _py3dna.DefinitionWriter_clearBlendShapeChannelNames(self) def setBlendShapeChannelName(self, index, name): + r""" + Name of the specified blend shape channel. + :type index: int + :param index: + A name's position in the zero-indexed array of blend shape channel names. + Notes: + The blend shape channel name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setBlendShapeChannelName(self, index, name) def clearBlendShapeChannelIndices(self): + r""" Delete all stored blend shape channel indices.""" return _py3dna.DefinitionWriter_clearBlendShapeChannelIndices(self) def setBlendShapeChannelIndices(self, index, blendShapeChannelIndices): + r""" + Store a list of blend shape channel name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where blend shape channel name indices are stored. + Notes: + The index denotes the position of an entire blend shape channel index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of blend shape channel indices. + + The blend shape channel index storage will be implicitly resized (if needed) to provide storage + for the number of blend shape channel name indices that is inferred from the specified index. + :type blendShapeChannelIndices: int + :param blendShapeChannelIndices: + The source address from which the blend shape channel name indices are to be copied. + + These indices can be used to access blend shape channel names through DefinitionReader::getBlendShapeChannelName. + :type count: int + :param count: + The number of blend shape channel name indices to copy. + """ return _py3dna.DefinitionWriter_setBlendShapeChannelIndices(self, index, blendShapeChannelIndices) def clearLODBlendShapeChannelMappings(self): + r""" Delete all stored LOD to blend shape channel list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODBlendShapeChannelMappings(self) def setLODBlendShapeChannelMapping(self, lod, index): + r""" + Set which blend shape channels belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the blend shape channels are being associated. + :type index: int + :param index: + The index onto which blend shape channel name indices were assigned using setBlendShapeChannelIndices. + Warning: + The LOD indices set here are not interchangeable with the LOD values set in BehaviorWriter::setBlendShapeChannelLODs. + See also: setBlendShapeChannelIndices + """ return _py3dna.DefinitionWriter_setLODBlendShapeChannelMapping(self, lod, index) def clearAnimatedMapNames(self): + r""" Delete all stored animated map names.""" return _py3dna.DefinitionWriter_clearAnimatedMapNames(self) def setAnimatedMapName(self, index, name): + r""" + Name of the specified animated map. + :type index: int + :param index: + A name's position in the zero-indexed array of animated map names. + Notes: + The animated map name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setAnimatedMapName(self, index, name) def clearAnimatedMapIndices(self): + r""" Delete all stored animated map indices.""" return _py3dna.DefinitionWriter_clearAnimatedMapIndices(self) def setAnimatedMapIndices(self, index, animatedMapIndices): + r""" + Store a list of animated map name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where animated map name indices are stored. + Notes: + The index denotes the position of an entire animated map index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of animated map indices. + + The animated map index storage will be implicitly resized (if needed) to provide storage + for the number of animated map name indices that is inferred from the specified index. + :type animatedMapIndices: int + :param animatedMapIndices: + The source address from which the animated map name indices are to be copied. + + These indices can be used to access animated map names through DefinitionReader::getAnimatedMapName. + :type count: int + :param count: + The number of animated map name indices to copy. + """ return _py3dna.DefinitionWriter_setAnimatedMapIndices(self, index, animatedMapIndices) def clearLODAnimatedMapMappings(self): + r""" Delete all stored LOD to animated map list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODAnimatedMapMappings(self) def setLODAnimatedMapMapping(self, lod, index): + r""" + Set which animated maps belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the animated maps are being associated. + :type index: int + :param index: + The index onto which animated map indices were assigned using setAnimatedMapIndices. + See also: setAnimatedMapIndices + """ return _py3dna.DefinitionWriter_setLODAnimatedMapMapping(self, lod, index) def clearMeshNames(self): + r""" Delete all stored mesh names.""" return _py3dna.DefinitionWriter_clearMeshNames(self) def setMeshName(self, index, name): + r""" + Name of the specified mesh. + :type index: int + :param index: + A name's position in the zero-indexed array of mesh names. + Notes: + The mesh name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setMeshName(self, index, name) def clearMeshIndices(self): + r""" Delete all stored mesh indices.""" return _py3dna.DefinitionWriter_clearMeshIndices(self) def setMeshIndices(self, index, meshIndices): + r""" + Store a list of mesh name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where mesh name indices are stored. + Notes: + The index denotes the position of an entire mesh index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of mesh indices. + + The mesh index storage will be implicitly resized (if needed) to provide storage + for the number of mesh name indices that is inferred from the specified index. + :type meshIndices: int + :param meshIndices: + The source address from which the mesh name indices are to be copied. + + These indices can be used to access mesh names through DefinitionReader::getMeshName. + :type count: int + :param count: + The number of mesh name indices to copy. + """ return _py3dna.DefinitionWriter_setMeshIndices(self, index, meshIndices) def clearLODMeshMappings(self): + r""" Delete all stored LOD to mesh list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODMeshMappings(self) def setLODMeshMapping(self, lod, index): + r""" + Set which meshes belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the meshes are being associated. + :type index: int + :param index: + The index onto which mesh indices were assigned using setMeshIndices. + See also: setMeshIndices + """ return _py3dna.DefinitionWriter_setLODMeshMapping(self, lod, index) def clearMeshBlendShapeChannelMappings(self): + r""" Delete all stored mesh to blend shape channel mapping entries.""" return _py3dna.DefinitionWriter_clearMeshBlendShapeChannelMappings(self) def setMeshBlendShapeChannelMapping(self, index, meshIndex, blendShapeChannelIndex): + r""" + Associate a blend shape channel with it's mesh. + :type index: int + :param index: + A mapping's position in the zero-indexed array of mesh-blend shape channel mappings. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of mesh names. + :type blendShapeChannelIndex: int + :param blendShapeChannelIndex: + A blend shape channel's position in the zero-indexed array of blend shape channel names. + """ return _py3dna.DefinitionWriter_setMeshBlendShapeChannelMapping(self, index, meshIndex, blendShapeChannelIndex) def setJointHierarchy(self, jointIndices): + r""" + A simple array describing the parent-child relationships between joints. + Notes: + Example: + Joint names: [A, B, C, D, E, F, G, H] + Hierarchy: [0, 0, 0, 1, 1, 4, 2, 2] + Describes the following hierarchy: + A + + B + | + D + | + E + | + F + + C + + G + + H + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + + These indices can be used to access joint names through DefinitionReader::getJointName. + :type count: int + :param count: + The number of joint indices to copy. + """ return _py3dna.DefinitionWriter_setJointHierarchy(self, jointIndices) def setNeutralJointTranslations(self, translations): + r""" + :type translations: dna::Vector3 + :param translations: + The source address from which the translations are to be copied. + :type count: int + :param count: + The number of translation values to copy. + """ return _py3dna.DefinitionWriter_setNeutralJointTranslations(self, translations) def setNeutralJointRotations(self, rotations): + r""" + :type rotations: dna::Vector3 + :param rotations: + The source address from which the rotations are to be copied. + :type count: int + :param count: + The number of rotation values to copy. + """ return _py3dna.DefinitionWriter_setNeutralJointRotations(self, rotations) # Register DefinitionWriter in _py3dna: _py3dna.DefinitionWriter_swigregister(DefinitionWriter) class BehaviorWriter(DefinitionWriter): + r""" + Write-only accessors for DNA attributes that define the rig's evaluation. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1146,96 +3349,388 @@ class BehaviorWriter(DefinitionWriter): __repr__ = _swig_repr def setGUIToRawInputIndices(self, inputIndices): + r""" + Input indices used for mapping gui to raw controls. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawInputIndices(self, inputIndices) def setGUIToRawOutputIndices(self, outputIndices): + r""" + Output indices used for mapping gui to raw controls. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawOutputIndices(self, outputIndices) def setGUIToRawFromValues(self, fromValues): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :type fromValues: float + :param fromValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawFromValues(self, fromValues) def setGUIToRawToValues(self, toValues): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :type toValues: float + :param toValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawToValues(self, toValues) def setGUIToRawSlopeValues(self, slopeValues): + r""" + Computational values(slope/gradient) used for calculating the + output value during gui to raw control mapping. + :type slopeValues: float + :param slopeValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawSlopeValues(self, slopeValues) def setGUIToRawCutValues(self, cutValues): + r""" + Computational values(vertical intercept) used for calculating the + output value during gui to raw control mapping. + :type cutValues: float + :param cutValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawCutValues(self, cutValues) def setPSDCount(self, count): + r""" The number of distinct PSD expressions.""" return _py3dna.BehaviorWriter_setPSDCount(self, count) def setPSDRowIndices(self, rowIndices): + r""" + PSD(input) indices which will become the rows of the PSD matrix. + :type rowIndices: int + :param rowIndices: + The source address from which the PSD indices are to be copied. + :type count: int + :param count: + The number of PSD indices to copy. + """ return _py3dna.BehaviorWriter_setPSDRowIndices(self, rowIndices) def setPSDColumnIndices(self, columnIndices): + r""" + Control(input) indices which will become the columns of the PSD matrix. + :type columnIndices: int + :param columnIndices: + The source address from which the control indices are to be copied. + :type count: int + :param count: + The number of control indices to copy. + """ return _py3dna.BehaviorWriter_setPSDColumnIndices(self, columnIndices) def setPSDValues(self, weights): + r""" + Weights associated with each PSD row and column pair. + :type weights: float + :param weights: + The source address from which the weight values are to be copied. + :type count: int + :param count: + The number of weight values to copy. + """ return _py3dna.BehaviorWriter_setPSDValues(self, weights) def setJointRowCount(self, rowCount): + r""" Number of rows in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorWriter_setJointRowCount(self, rowCount) def setJointColumnCount(self, columnCount): + r""" Number of columns in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorWriter_setJointColumnCount(self, columnCount) def clearJointGroups(self): + r""" Delete all joint groups.""" return _py3dna.BehaviorWriter_clearJointGroups(self) def deleteJointGroup(self, jointGroupIndex): + r""" + Delete the specified joint group. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + """ return _py3dna.BehaviorWriter_deleteJointGroup(self, jointGroupIndex) def setJointGroupLODs(self, jointGroupIndex, lods): + r""" + Number of rows per each level of detail for the specified joint group. + Notes: + Each element's position represents the level itself, while the value denotes + the number of rows within the joint group belonging to that level. e.g.: + [12, 9, 3] + | | + LOD-2 contains first 3 rows + | + LOD-1 contains first 9 rows + + LOD-0 contains first 12 rows + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + """ return _py3dna.BehaviorWriter_setJointGroupLODs(self, jointGroupIndex, lods) def setJointGroupInputIndices(self, jointGroupIndex, inputIndices): + r""" + Column indices that the specified joint group contains. + Notes: + The column indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type inputIndices: int + :param inputIndices: + The source address from which the column indices are to be copied. + :type count: int + :param count: + The number of column indices to copy. + """ return _py3dna.BehaviorWriter_setJointGroupInputIndices(self, jointGroupIndex, inputIndices) def setJointGroupOutputIndices(self, jointGroupIndex, outputIndices): + r""" + Row indices that the specified joint group contains. + Notes: + The row indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type outputIndices: int + :param outputIndices: + The source address from which the row indices are to be copied. + :type count: int + :param count: + The number of row indices to copy. + """ return _py3dna.BehaviorWriter_setJointGroupOutputIndices(self, jointGroupIndex, outputIndices) def setJointGroupValues(self, jointGroupIndex, values): + r""" + Values that the specified joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Notes: + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type values: float + :param values: + The source address from which the values are to be copied. + :type count: int + :param count: + The number of values to copy. + """ return _py3dna.BehaviorWriter_setJointGroupValues(self, jointGroupIndex, values) def setJointGroupJointIndices(self, jointGroupIndex, jointIndices): + r""" + Joint indices that the specified joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Notes: + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + :type count: int + :param count: + The number of joint indices to copy. + """ return _py3dna.BehaviorWriter_setJointGroupJointIndices(self, jointGroupIndex, jointIndices) def setBlendShapeChannelLODs(self, lods): + r""" + Input index count per each level of detail for blend shapes. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of input indices belonging to that level. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + Warning: + The LOD values set here are not interchangeable with the LOD indices set in DefinitionWriter::setBlendShapeNameIndices + and DefinitionWriter::setLODBlendShapeMapping + """ return _py3dna.BehaviorWriter_setBlendShapeChannelLODs(self, lods) def setBlendShapeChannelInputIndices(self, inputIndices): + r""" + Input indices used to index into the input vector. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ return _py3dna.BehaviorWriter_setBlendShapeChannelInputIndices(self, inputIndices) def setBlendShapeChannelOutputIndices(self, outputIndices): + r""" + Output indices specify the positions of blend shape output values. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ return _py3dna.BehaviorWriter_setBlendShapeChannelOutputIndices(self, outputIndices) def setAnimatedMapLODs(self, lods): + r""" + Row count per each level of detail for animated maps. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of rows (within the conditional table), + belonging to that level. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapLODs(self, lods) def setAnimatedMapInputIndices(self, inputIndices): + r""" + Input indices used to index into the array of input values. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapInputIndices(self, inputIndices) def setAnimatedMapOutputIndices(self, outputIndices): + r""" + Output indices that specify the computed output value's position. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapOutputIndices(self, outputIndices) def setAnimatedMapFromValues(self, fromValues): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not. + :type fromValues: float + :param fromValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapFromValues(self, fromValues) def setAnimatedMapToValues(self, toValues): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not. + :type toValues: float + :param toValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapToValues(self, toValues) def setAnimatedMapSlopeValues(self, slopeValues): + r""" + Computational values(slope/gradient) used for calculating the output value. + :type slopeValues: float + :param slopeValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapSlopeValues(self, slopeValues) def setAnimatedMapCutValues(self, cutValues): + r""" + Computational values(vertical intercept) used for calculating the output value. + :type cutValues: float + :param cutValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapCutValues(self, cutValues) # Register BehaviorWriter in _py3dna: _py3dna.BehaviorWriter_swigregister(BehaviorWriter) class GeometryWriter(DefinitionWriter): + r""" + Write-only accessors for the geometry data associated with a rig. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1243,57 +3738,292 @@ class GeometryWriter(DefinitionWriter): __repr__ = _swig_repr def clearMeshes(self): + r""" Delete all meshes.""" return _py3dna.GeometryWriter_clearMeshes(self) def deleteMesh(self, meshIndex): + r""" + Delete the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_deleteMesh(self, meshIndex) def setVertexPositions(self, meshIndex, positions): + r""" + List of vertex positions. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type positions: dna::Position + :param positions: + The source address from which the vertex positions are to be copied. + :type count: int + :param count: + The number of vertex positions to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexPositions(self, meshIndex, positions) def setVertexTextureCoordinates(self, meshIndex, textureCoordinates): + r""" + List of vertex texture coordinates. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type textureCoordinates: dna::TextureCoordinate + :param textureCoordinates: + The source address from which the texture coordinates are to be copied. + :type count: int + :param count: + The number of texture coordinates to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexTextureCoordinates(self, meshIndex, textureCoordinates) def setVertexNormals(self, meshIndex, normals): + r""" + List of vertex normals. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type normals: dna::Normal + :param normals: + The source address from which the normals are to be copied. + :type count: int + :param count: + The number of normals to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexNormals(self, meshIndex, normals) def setVertexLayouts(self, meshIndex, layouts): + r""" + List of vertex layouts the belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type layouts: dna::VertexLayout + :param layouts: + The source address from which the layouts are to be copied. + :type count: int + :param count: + The number of layouts to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexLayouts(self, meshIndex, layouts) def clearFaceVertexLayoutIndices(self, meshIndex): + r""" + Delete all lists of vertex layout indices for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_clearFaceVertexLayoutIndices(self, meshIndex) def setFaceVertexLayoutIndices(self, meshIndex, faceIndex, layoutIndices): + r""" + Vertex layout indices that belong to the specified face. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type faceIndex: int + :param faceIndex: + A face's position in the zero-indexed array of faces that belong to + the above referenced mesh. + :type layoutIndices: int + :param layoutIndices: + The source address from which the layout indices are to be copied. + Notes: + The layout indices point into the array that is set through setVertexLayouts + :type count: int + :param count: + The number of vertices to copy. + + Both the mesh storage itself and it's face storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + faces that are inferred from the specified indexes. + """ return _py3dna.GeometryWriter_setFaceVertexLayoutIndices(self, meshIndex, faceIndex, layoutIndices) def setMaximumInfluencePerVertex(self, meshIndex, maxInfluenceCount): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type maxInfluenceCount: int + :param maxInfluenceCount: + The maximum number of joints that may influence any single vertex. + """ return _py3dna.GeometryWriter_setMaximumInfluencePerVertex(self, meshIndex, maxInfluenceCount) def clearSkinWeights(self, meshIndex): + r""" + Delete all skin weights for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_clearSkinWeights(self, meshIndex) def setSkinWeightsValues(self, meshIndex, vertexIndex, weights): + r""" + List of skin weights influencing the referenced vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertex positions. + :type weights: float + :param weights: + The source address from which the weights are to be copied. + :type count: int + :param count: + The number of weights to copy. + Notes: + Both the mesh storage itself and it's skin weight storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + skin-weight lists that are inferred from the specified indexes. + Warning: + The sum of weights must add up to 1. + """ return _py3dna.GeometryWriter_setSkinWeightsValues(self, meshIndex, vertexIndex, weights) def setSkinWeightsJointIndices(self, meshIndex, vertexIndex, jointIndices): + r""" + List of joint indices associated with each skin weight for the specified vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertex positions. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + :type count: int + :param count: + The number of joint indices to copy. + Notes: + Both the mesh storage itself and it's joint index list storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + joint index lists that are inferred from the specified indexes. + Warning: + The joint indices must be stored in the same order as the weights they + are associated with. + """ return _py3dna.GeometryWriter_setSkinWeightsJointIndices(self, meshIndex, vertexIndex, jointIndices) def clearBlendShapeTargets(self, meshIndex): + r""" + Delete all blend shape targets for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_clearBlendShapeTargets(self, meshIndex) def setBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex, blendShapeChannelIndex): + r""" + The matching blend shape channel index of the specified blend shape target. + Notes: + Associate the mesh-local blend shape target index with the absolute blend shape channel + index as found in the Definition layer. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type blendShapeChannelIndex: int + :param blendShapeChannelIndex: + The index of the specified blend shape channel in the Definition layer. + + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + """ return _py3dna.GeometryWriter_setBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex, blendShapeChannelIndex) def setBlendShapeTargetDeltas(self, meshIndex, blendShapeTargetIndex, deltas): + r""" + List of deltas for each affected vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type deltas: dna::Delta + :param deltas: + The source address from which the blend shape target deltas are to be copied. + :type count: int + :param count: + The number of blend shape target deltas to copy. + Notes: + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + """ return _py3dna.GeometryWriter_setBlendShapeTargetDeltas(self, meshIndex, blendShapeTargetIndex, deltas) def setBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex, vertexIndices): + r""" + Vertex position indices affected by the specified blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type vertexIndices: int + :param vertexIndices: + The source address from which the vertex position indices are to be copied. + :type count: int + :param count: + The number of vertex position indices to copy. + Notes: + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + Warning: + The vertex position indices must be stored in the same order as the deltas + they are associated with. + """ return _py3dna.GeometryWriter_setBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex, vertexIndices) # Register GeometryWriter in _py3dna: _py3dna.GeometryWriter_swigregister(GeometryWriter) class Writer(BehaviorWriter, GeometryWriter): + r""" + The abstract Writer which its implementations are expected to inherit. + Notes: + This class combines the various different writer interfaces into a single interface. + The artificial separation into multiple interfaces in this case just mirrors the + structure of the Reader hierarchy, as it's not possible to selectively write only + specific layers. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1302,6 +4032,24 @@ class Writer(BehaviorWriter, GeometryWriter): __swig_destroy__ = _py3dna.delete_Writer def setFrom(self, *args): + r""" + Initialize the Writer from the given Reader. + Notes: + This function copies all the data from the given Reader into the Writer instance, + by calling each getter function of the Reader, and passing the return values to + the matching setter functions in the Writer. + It is implemented in the abstract class itself to provide the functionality for + all DNA Writers. + :type source: :py:class:`Reader` + :param source: + The source DNA Reader from which the data needs to be copied. + :type layer: int, optional + :param layer: + Limit which layers should be taken over from the given source reader. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Optional memory resource to use for temporary allocations during copying. + """ return _py3dna.Writer_setFrom(self, *args) # Register Writer in _py3dna: @@ -1316,6 +4064,7 @@ class StreamWriter(Writer): __swig_destroy__ = _py3dna.delete_StreamWriter def write(self): + r""" Write data to stream from internal structures.""" return _py3dna.StreamWriter_write(self) # Register StreamWriter in _py3dna: @@ -1330,10 +4079,31 @@ class BinaryStreamWriter(StreamWriter): @staticmethod def create(stream, memRes=None): + r""" + Factory method for creation of BinaryStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.BinaryStreamWriter_create(stream, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a BinaryStreamWriter instance. + :type instance: :py:class:`BinaryStreamWriter` + :param instance: + Instance of BinaryStreamWriter to be freed. + See also: create + """ return _py3dna.BinaryStreamWriter_destroy(instance) __swig_destroy__ = _py3dna.delete_BinaryStreamWriter @@ -1341,9 +4111,30 @@ class BinaryStreamWriter(StreamWriter): _py3dna.BinaryStreamWriter_swigregister(BinaryStreamWriter) def BinaryStreamWriter_create(stream, memRes=None): + r""" + Factory method for creation of BinaryStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.BinaryStreamWriter_create(stream, memRes) def BinaryStreamWriter_destroy(instance): + r""" + Method for freeing a BinaryStreamWriter instance. + :type instance: :py:class:`BinaryStreamWriter` + :param instance: + Instance of BinaryStreamWriter to be freed. + See also: create + """ return _py3dna.BinaryStreamWriter_destroy(instance) class JSONStreamWriter(StreamWriter): @@ -1355,10 +4146,34 @@ class JSONStreamWriter(StreamWriter): @staticmethod def create(stream, indentWidth=4, memRes=None): + r""" + Factory method for creation of JSONStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type indentWidth: int, optional + :param indentWidth: + Number of spaces to use for indentation. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.JSONStreamWriter_create(stream, indentWidth, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a JSONStreamWriter instance. + :type instance: :py:class:`JSONStreamWriter` + :param instance: + Instance of JSONStreamWriter to be freed. + See also: create + """ return _py3dna.JSONStreamWriter_destroy(instance) __swig_destroy__ = _py3dna.delete_JSONStreamWriter @@ -1366,24 +4181,118 @@ class JSONStreamWriter(StreamWriter): _py3dna.JSONStreamWriter_swigregister(JSONStreamWriter) def JSONStreamWriter_create(stream, indentWidth=4, memRes=None): + r""" + Factory method for creation of JSONStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type indentWidth: int, optional + :param indentWidth: + Number of spaces to use for indentation. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.JSONStreamWriter_create(stream, indentWidth, memRes) def JSONStreamWriter_destroy(instance): + r""" + Method for freeing a JSONStreamWriter instance. + :type instance: :py:class:`JSONStreamWriter` + :param instance: + Instance of JSONStreamWriter to be freed. + See also: create + """ return _py3dna.JSONStreamWriter_destroy(instance) -BinaryStreamWriter.__new__ = __new_decorator(BinaryStreamWriter_create, BinaryStreamWriter.__new__) -BinaryStreamWriter.__del__ = lambda instance: BinaryStreamWriter_destroy(instance) -BinaryStreamWriter.__init__ = __managed_init -del BinaryStreamWriter.create -del BinaryStreamWriter.destroy +BinaryStreamWriterImpl = BinaryStreamWriter + +class BinaryStreamWriterImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(BinaryStreamWriterImpl, name) + + def __dir__(cls): + return [name for name in dir(BinaryStreamWriterImpl) if name not in ("create","destroy")] + +class BinaryStreamWriter(with_metaclass(BinaryStreamWriterImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = BinaryStreamWriterImpl.create(*args, **kwargs) + + def __del__(self): + BinaryStreamWriterImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -JSONStreamWriter.__new__ = __new_decorator(JSONStreamWriter_create, JSONStreamWriter.__new__) -JSONStreamWriter.__del__ = lambda instance: JSONStreamWriter_destroy(instance) -JSONStreamWriter.__init__ = __managed_init -del JSONStreamWriter.create -del JSONStreamWriter.destroy +JSONStreamWriterImpl = JSONStreamWriter + +class JSONStreamWriterImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(JSONStreamWriterImpl, name) + + def __dir__(cls): + return [name for name in dir(JSONStreamWriterImpl) if name not in ("create","destroy")] + +class JSONStreamWriter(with_metaclass(JSONStreamWriterImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = JSONStreamWriterImpl.create(*args, **kwargs) + + def __del__(self): + JSONStreamWriterImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] diff --git a/lib/Maya2023/linux/dnacalib.py b/lib/Maya2023/linux/dnacalib.py index 1cff0fe..ae9d31b 100644 --- a/lib/Maya2023/linux/dnacalib.py +++ b/lib/Maya2023/linux/dnacalib.py @@ -4,6 +4,18 @@ # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. + +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass + + + from sys import version_info as _swig_python_version_info if _swig_python_version_info < (2, 7, 0): raise RuntimeError("Python 2.7 or later required") @@ -62,20 +74,16 @@ class _SwigNonDynamicMeta(type): -def __new_decorator(factory_func, original_new): - @staticmethod - def __new(cls, *args, **kwargs): -# FIXME: while this workaround solves the immediate issue with the set of classes we currently have, -# it will fail for classes that use a factory function but need no parameters at all, in which case -# the factory function will never be invoked, only the original __new__ function. - if args or kwargs: - return factory_func(*args, **kwargs) - return original_new(cls) - return __new +def with_metaclass(meta, *bases): + class metaclass(type): -def __managed_init(self, *args, **kwargs): - self._args = args - self._kwargs = kwargs + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) import dna class VersionInfo(object): @@ -142,13 +150,50 @@ def DNACalibDNAReader_destroy(instance): return _py3dnacalib.DNACalibDNAReader_destroy(instance) -DNACalibDNAReader.__new__ = __new_decorator(DNACalibDNAReader_create, DNACalibDNAReader.__new__) -DNACalibDNAReader.__del__ = lambda instance: DNACalibDNAReader_destroy(instance) -DNACalibDNAReader.__init__ = __managed_init -del DNACalibDNAReader.create -del DNACalibDNAReader.destroy +DNACalibDNAReaderImpl = DNACalibDNAReader + +class DNACalibDNAReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(DNACalibDNAReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(DNACalibDNAReaderImpl) if name not in ("create","destroy")] + +class DNACalibDNAReader(with_metaclass(DNACalibDNAReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = DNACalibDNAReaderImpl.create(*args, **kwargs) + + def __del__(self): + DNACalibDNAReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] class Command(object): + r""" Command is an abstract class whose implementations are expected to modify the DNA provided in the run() method in some way.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -167,6 +212,14 @@ VectorOperation_Add = _py3dnacalib.VectorOperation_Add VectorOperation_Subtract = _py3dnacalib.VectorOperation_Subtract VectorOperation_Multiply = _py3dnacalib.VectorOperation_Multiply class CommandSequence(Command): + r""" + CommandSequence is used to run a sequence of commands on the same DNA. + Notes: + Commands will be run in the order in which they were added to the sequence. + + CommandSequence holds pointers to commands, but does not own them. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_CommandSequence @@ -178,15 +231,34 @@ class CommandSequence(Command): return _py3dnacalib.CommandSequence_run(self, output) def add(self, command): + r""" + Method for adding a command to a sequence of commands to run. + :type command: :py:class:`Command` + :param command: + The command to add. + """ return _py3dnacalib.CommandSequence_add(self, command) def remove(self, command): + r""" + Method for removing a command from the sequence of commands to run. + :type command: :py:class:`Command` + :param command: + The command to remove. + """ return _py3dnacalib.CommandSequence_remove(self, command) def contains(self, command): + r""" + Method for checking if the provided command is part of the command sequence. + :type command: :py:class:`Command` + :param command: + The command to check. + """ return _py3dnacalib.CommandSequence_contains(self, command) def size(self): + r""" Number of commands in command sequence.""" return _py3dnacalib.CommandSequence_size(self) # Register CommandSequence in _py3dnacalib: @@ -216,6 +288,12 @@ CommandSequence.add = command_sequence_add(CommandSequence.add) CommandSequence.remove = command_sequence_remove(CommandSequence.remove) class CalculateMeshLowerLODsCommand(Command): + r""" + CalculateMeshLowerLODsCommand is used to recalculate vertex positions for lower LOD meshes of the specified mesh. + Notes: + The calculation is done based on vertex positions of the specified mesh and vertex texture coordinates of its lower LOD meshes. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_CalculateMeshLowerLODsCommand @@ -224,6 +302,12 @@ class CalculateMeshLowerLODsCommand(Command): _py3dnacalib.CalculateMeshLowerLODsCommand_swiginit(self, _py3dnacalib.new_CalculateMeshLowerLODsCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to calculate lower LOD meshes from. + :type meshIndex: int + :param meshIndex: + The index of the mesh. + """ return _py3dnacalib.CalculateMeshLowerLODsCommand_setMeshIndex(self, meshIndex) def run(self, output): @@ -233,6 +317,11 @@ class CalculateMeshLowerLODsCommand(Command): _py3dnacalib.CalculateMeshLowerLODsCommand_swigregister(CalculateMeshLowerLODsCommand) class ClearBlendShapesCommand(Command): + r""" + ClearBlendShapesCommand is used to clear all blend shapes data from a DNA. + Notes: This command clears blend shape target deltas and blend shape animation data. By doing so, it transforms the DNA to be "joints only". + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_ClearBlendShapesCommand @@ -247,6 +336,8 @@ class ClearBlendShapesCommand(Command): _py3dnacalib.ClearBlendShapesCommand_swigregister(ClearBlendShapesCommand) class PruneBlendShapeTargetsCommand(Command): + r""" PruneBlendShapeTargetsCommand is used to prune blend shape target deltas whose absolute magnitude is less than or equal to the specified threshold.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_PruneBlendShapeTargetsCommand @@ -255,6 +346,12 @@ class PruneBlendShapeTargetsCommand(Command): _py3dnacalib.PruneBlendShapeTargetsCommand_swiginit(self, _py3dnacalib.new_PruneBlendShapeTargetsCommand(*args)) def setThreshold(self, threshold): + r""" + Method for setting the threshold for pruning blend shape target deltas. + :type threshold: float + :param threshold: + The threshold to use. + """ return _py3dnacalib.PruneBlendShapeTargetsCommand_setThreshold(self, threshold) def run(self, output): @@ -264,6 +361,8 @@ class PruneBlendShapeTargetsCommand(Command): _py3dnacalib.PruneBlendShapeTargetsCommand_swigregister(PruneBlendShapeTargetsCommand) class RemoveAnimatedMapCommand(Command): + r""" RemoveAnimatedMapCommand is used to remove animated maps.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveAnimatedMapCommand @@ -272,9 +371,23 @@ class RemoveAnimatedMapCommand(Command): _py3dnacalib.RemoveAnimatedMapCommand_swiginit(self, _py3dnacalib.new_RemoveAnimatedMapCommand(*args)) def setAnimatedMapIndex(self, animatedMapIndex): + r""" + Method for setting the index of the animated map to remove. + :type animatedMapIndex: int + :param animatedMapIndex: + The index of the animated map. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set animated map(s) will be removed. + """ return _py3dnacalib.RemoveAnimatedMapCommand_setAnimatedMapIndex(self, animatedMapIndex) def setAnimatedMapIndices(self, animatedMapIndices): + r""" + Method for setting the indices of animated maps to remove. + :type animatedMapIndices: dnac::ConstArrayView< std::uint16_t > + :param animatedMapIndices: + The animated map indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set animated map(s) will be removed. + """ return _py3dnacalib.RemoveAnimatedMapCommand_setAnimatedMapIndices(self, animatedMapIndices) def run(self, output): @@ -284,6 +397,8 @@ class RemoveAnimatedMapCommand(Command): _py3dnacalib.RemoveAnimatedMapCommand_swigregister(RemoveAnimatedMapCommand) class RemoveBlendShapeCommand(Command): + r""" RemoveBlendShapeCommand is used to remove blend shapes.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveBlendShapeCommand @@ -292,9 +407,23 @@ class RemoveBlendShapeCommand(Command): _py3dnacalib.RemoveBlendShapeCommand_swiginit(self, _py3dnacalib.new_RemoveBlendShapeCommand(*args)) def setBlendShapeIndex(self, blendShapeIndex): + r""" + Method for setting the index of the blend shape to remove. + :type blendShapeIndex: int + :param blendShapeIndex: + The index of the blend shape. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set blend shape(s) will be removed. + """ return _py3dnacalib.RemoveBlendShapeCommand_setBlendShapeIndex(self, blendShapeIndex) def setBlendShapeIndices(self, blendShapeIndices): + r""" + Method for setting the indices of blend shapes to remove. + :type blendShapeIndices: dnac::ConstArrayView< std::uint16_t > + :param blendShapeIndices: + The blend shape indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set blend shape(s) will be removed. + """ return _py3dnacalib.RemoveBlendShapeCommand_setBlendShapeIndices(self, blendShapeIndices) def run(self, output): @@ -304,6 +433,8 @@ class RemoveBlendShapeCommand(Command): _py3dnacalib.RemoveBlendShapeCommand_swigregister(RemoveBlendShapeCommand) class RemoveJointAnimationCommand(Command): + r""" RemoveJointAnimationCommand is used to remove joint animation data.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveJointAnimationCommand @@ -312,9 +443,23 @@ class RemoveJointAnimationCommand(Command): _py3dnacalib.RemoveJointAnimationCommand_swiginit(self, _py3dnacalib.new_RemoveJointAnimationCommand(*args)) def setJointIndex(self, jointIndex): + r""" + Method for setting the index of a joint whose animation data to remove. + :type jointIndex: int + :param jointIndex: + The index of the joint. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint animation(s) will be removed. + """ return _py3dnacalib.RemoveJointAnimationCommand_setJointIndex(self, jointIndex) def setJointIndices(self, jointIndices): + r""" + Method for setting the indices of joints whose animation data to remove. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + The joint indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint animation(s) will be removed. + """ return _py3dnacalib.RemoveJointAnimationCommand_setJointIndices(self, jointIndices) def run(self, output): @@ -324,6 +469,8 @@ class RemoveJointAnimationCommand(Command): _py3dnacalib.RemoveJointAnimationCommand_swigregister(RemoveJointAnimationCommand) class RemoveJointCommand(Command): + r""" RemoveJointCommand is used to remove joints.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveJointCommand @@ -332,9 +479,23 @@ class RemoveJointCommand(Command): _py3dnacalib.RemoveJointCommand_swiginit(self, _py3dnacalib.new_RemoveJointCommand(*args)) def setJointIndex(self, jointIndex): + r""" + Method for setting the index of the joint to remove. + :type jointIndex: int + :param jointIndex: + The index of the joint. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint(s) will be removed. + """ return _py3dnacalib.RemoveJointCommand_setJointIndex(self, jointIndex) def setJointIndices(self, jointIndices): + r""" + Method for setting the indices of joints to remove. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + The joint indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint(s) will be removed. + """ return _py3dnacalib.RemoveJointCommand_setJointIndices(self, jointIndices) def run(self, output): @@ -344,6 +505,8 @@ class RemoveJointCommand(Command): _py3dnacalib.RemoveJointCommand_swigregister(RemoveJointCommand) class RemoveMeshCommand(Command): + r""" RemoveMeshCommand is used to remove meshes.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveMeshCommand @@ -352,9 +515,22 @@ class RemoveMeshCommand(Command): _py3dnacalib.RemoveMeshCommand_swiginit(self, _py3dnacalib.new_RemoveMeshCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to remove. + :type meshIndex: int + :param meshIndex: + The index of the mesh. + """ return _py3dnacalib.RemoveMeshCommand_setMeshIndex(self, meshIndex) def setMeshIndices(self, meshIndices): + r""" + Method for setting the indices of meshes to remove. + :type meshIndices: dnac::ConstArrayView< std::uint16_t > + :param meshIndices: + The mesh indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set mesh(es) will be removed. + """ return _py3dnacalib.RemoveMeshCommand_setMeshIndices(self, meshIndices) def run(self, output): @@ -364,6 +540,8 @@ class RemoveMeshCommand(Command): _py3dnacalib.RemoveMeshCommand_swigregister(RemoveMeshCommand) class RenameAnimatedMapCommand(Command): + r""" RenameAnimatedMapCommand is used to rename an animated map.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameAnimatedMapCommand @@ -372,6 +550,31 @@ class RenameAnimatedMapCommand(Command): _py3dnacalib.RenameAnimatedMapCommand_swiginit(self, _py3dnacalib.new_RenameAnimatedMapCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for animated map with given index. + :type animatedMapIndex: int + :param animatedMapIndex: + The index of the animated map whose name to change. + :type newName: string + :param newName: + The new name for the animated map. + + | + + *Overload 2:* + + Method for setting a new name for animated map with given name. + Notes: + The renaming will not happen if there is no animated map with given current name. + :type oldName: string + :param oldName: + The current name of the animated map whose name to change. + :type newName: string + :param newName: + The new name for the animated map. + """ return _py3dnacalib.RenameAnimatedMapCommand_setName(self, *args) def run(self, output): @@ -381,6 +584,8 @@ class RenameAnimatedMapCommand(Command): _py3dnacalib.RenameAnimatedMapCommand_swigregister(RenameAnimatedMapCommand) class RenameBlendShapeCommand(Command): + r""" RenameBlendShapeCommand is used to rename a blend shape channel.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameBlendShapeCommand @@ -389,6 +594,31 @@ class RenameBlendShapeCommand(Command): _py3dnacalib.RenameBlendShapeCommand_swiginit(self, _py3dnacalib.new_RenameBlendShapeCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for blend shape channel with given index. + :type blendShapeIndex: int + :param blendShapeIndex: + The index of the blend shape channel whose name to change. + :type newName: string + :param newName: + The new name for the blend shape channel. + + | + + *Overload 2:* + + Method for setting a new name for blend shape channel with given name. + Notes: + The renaming will not happen if there is no blend shape channel with given current name. + :type oldName: string + :param oldName: + The current name of the blend shape channel whose name to change. + :type newName: string + :param newName: + The new name for the blend shape channel. + """ return _py3dnacalib.RenameBlendShapeCommand_setName(self, *args) def run(self, output): @@ -398,6 +628,8 @@ class RenameBlendShapeCommand(Command): _py3dnacalib.RenameBlendShapeCommand_swigregister(RenameBlendShapeCommand) class RenameJointCommand(Command): + r""" RenameJointCommand is used to rename a joint.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameJointCommand @@ -406,6 +638,31 @@ class RenameJointCommand(Command): _py3dnacalib.RenameJointCommand_swiginit(self, _py3dnacalib.new_RenameJointCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for joint with given index. + :type jointIndex: int + :param jointIndex: + The index of the joint whose name to change. + :type newName: string + :param newName: + The new name for the joint. + + | + + *Overload 2:* + + Method for setting a new name for joint with given name. + Notes: + The renaming will not happen if there is no joint with given current name. + :type oldName: string + :param oldName: + The current name of the joint whose name to change. + :type newName: string + :param newName: + The new name for the joint. + """ return _py3dnacalib.RenameJointCommand_setName(self, *args) def run(self, output): @@ -415,6 +672,8 @@ class RenameJointCommand(Command): _py3dnacalib.RenameJointCommand_swigregister(RenameJointCommand) class RenameMeshCommand(Command): + r""" RenameMeshCommand is used to rename a mesh.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameMeshCommand @@ -423,6 +682,31 @@ class RenameMeshCommand(Command): _py3dnacalib.RenameMeshCommand_swiginit(self, _py3dnacalib.new_RenameMeshCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for mesh with given index. + :type meshIndex: int + :param meshIndex: + The index of the mesh whose name to change. + :type newName: string + :param newName: + The new name for the mesh. + + | + + *Overload 2:* + + Method for setting a new name for mesh with given name. + Notes: + The renaming will not happen if there is no mesh with given current name. + :type oldName: string + :param oldName: + The current name of the mesh whose name to change. + :type newName: string + :param newName: + The new name for the mesh. + """ return _py3dnacalib.RenameMeshCommand_setName(self, *args) def run(self, output): @@ -432,6 +716,14 @@ class RenameMeshCommand(Command): _py3dnacalib.RenameMeshCommand_swigregister(RenameMeshCommand) class RotateCommand(Command): + r""" + RotateCommand is used to rotate neutral joints and vertex positions around given origin. + Notes: + Joint rotations are represented in parent space, so it is enough to rotate only root joints, as that rotation will be propagated to the rest of the joints. + + If the origin is not set, the assumed origin is (0, 0, 0). + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RotateCommand @@ -440,9 +732,21 @@ class RotateCommand(Command): _py3dnacalib.RotateCommand_swiginit(self, _py3dnacalib.new_RotateCommand(*args)) def setRotation(self, degrees): + r""" + Method for setting the rotation angles. + :type degrees: dnac::Vector3 + :param degrees: + Rotation angles in degrees. + """ return _py3dnacalib.RotateCommand_setRotation(self, degrees) def setOrigin(self, origin): + r""" + Method for setting the rotation origin. + :type origin: dnac::Vector3 + :param origin: + Origin coordinates. + """ return _py3dnacalib.RotateCommand_setOrigin(self, origin) def run(self, output): @@ -452,6 +756,12 @@ class RotateCommand(Command): _py3dnacalib.RotateCommand_swigregister(RotateCommand) class ScaleCommand(Command): + r""" + ScaleCommand is used to scale neutral joints, vertex positions and joint and blendshape deltas by a factor. + Notes: + Only translation attributes of neutral joints and joint deltas are scaled. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_ScaleCommand @@ -460,9 +770,22 @@ class ScaleCommand(Command): _py3dnacalib.ScaleCommand_swiginit(self, _py3dnacalib.new_ScaleCommand(*args)) def setScale(self, scale): + r""" + Method for setting the scale factor to multiply with. + :type scale: float + :param scale: + Scale factor. + """ return _py3dnacalib.ScaleCommand_setScale(self, scale) def setOrigin(self, origin): + r""" + Method for setting the origin. + Notes: The origin is used to properly scale position values (vertex positions and neutral joint translations). + :type origin: dnac::Vector3 + :param origin: + Origin coordinates. + """ return _py3dnacalib.ScaleCommand_setOrigin(self, origin) def run(self, output): @@ -472,6 +795,8 @@ class ScaleCommand(Command): _py3dnacalib.ScaleCommand_swigregister(ScaleCommand) class SetBlendShapeTargetDeltasCommand(Command): + r""" SetBlendShapeTargetDeltasCommand is used to change blend shape target deltas.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetBlendShapeTargetDeltasCommand @@ -480,21 +805,85 @@ class SetBlendShapeTargetDeltasCommand(Command): _py3dnacalib.SetBlendShapeTargetDeltasCommand_swiginit(self, _py3dnacalib.new_SetBlendShapeTargetDeltasCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh whose blend shape target to change. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setMeshIndex(self, meshIndex) def setBlendShapeTargetIndex(self, blendShapeTargetIndex): + r""" + Method for setting the index of the blend shape target to change. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + The blend shape target index. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setBlendShapeTargetIndex(self, blendShapeTargetIndex) def setDeltas(self, *args): + r""" + *Overload 1:* + + Method for setting the values used to calculate new deltas for blend shape target. + :type deltas: dnac::ConstArrayView< dnac::Vector3 > + :param deltas: + The values used in calculation. + + | + + *Overload 2:* + + Method for setting the values used to calculate new deltas for blend shape target. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X values for each delta. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y values for each delta. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z values for each delta. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setDeltas(self, *args) def setVertexIndices(self, vertexIndices): + r""" + Method for setting the vertex indices that correspond to new deltas. + :type vertexIndices: dnac::ConstArrayView< std::uint32_t > + :param vertexIndices: + The vertexIndices. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setVertexIndices(self, vertexIndices) def setMasks(self, masks): + r""" + Method for setting masks used to calculate new deltas for blend shape target. + Notes: + If no masks are set, default weight value of 1 is used for each delta. + :type masks: dnac::ConstArrayView< float > + :param masks: + The weights for each delta. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setMasks(self, masks) def setOperation(self, operation): + r""" + Method for setting the type of operation used to calculate new deltas for blend shape target. + Notes: + Available operations are: Interpolate, Add, Subtract and Multiply. Each delta is calculated based on the provided operation type in the following way: + + Interpolate: = previousValue * (1 - weight) + setValue * weight:math:`\n Add: \f$newValue = previousValue + (setValue * weight)` + + Subtract: = previousValue - (setValue * weight):math:`\n Multiply: \f$newValue = previousValue * (setValue * weight)` + + + setValue is the value from new deltas that were set, and weight is the value from masks array. + :type operation: int + :param operation: + The operation to use. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setOperation(self, operation) def run(self, output): @@ -509,6 +898,8 @@ SetBlendShapeTargetDeltasCommand.DeltasVertexIndicesCountMismatch = _py3dnacalib SetBlendShapeTargetDeltasCommand.DeltasMasksCountMismatch = _py3dnacalib.cvar.SetBlendShapeTargetDeltasCommand_DeltasMasksCountMismatch class SetLODsCommand(Command): + r""" SetLODsCommand is used to specify LODs to use. Joints, blend shapes, animated maps and meshes that are not in specified LODs are removed from the DNA.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetLODsCommand @@ -517,6 +908,12 @@ class SetLODsCommand(Command): _py3dnacalib.SetLODsCommand_swiginit(self, _py3dnacalib.new_SetLODsCommand(*args)) def setLODs(self, lods): + r""" + Method for setting the LODs to keep. + :type lods: dnac::ConstArrayView< std::uint16_t > + :param lods: + New LODs to be used. + """ return _py3dnacalib.SetLODsCommand_setLODs(self, lods) def run(self, output): @@ -526,6 +923,8 @@ class SetLODsCommand(Command): _py3dnacalib.SetLODsCommand_swigregister(SetLODsCommand) class SetNeutralJointRotationsCommand(Command): + r""" SetNeutralJointRotationsCommand is used to set new rotation values to neutral joints.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetNeutralJointRotationsCommand @@ -534,6 +933,29 @@ class SetNeutralJointRotationsCommand(Command): _py3dnacalib.SetNeutralJointRotationsCommand_swiginit(self, _py3dnacalib.new_SetNeutralJointRotationsCommand(*args)) def setRotations(self, *args): + r""" + *Overload 1:* + + Method for setting the neutral joint rotations. + :type rotations: dnac::ConstArrayView< dnac::Vector3 > + :param rotations: + Rotation values for each joint. + + | + + *Overload 2:* + + Method for setting the neutral joint rotations. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X rotation value for each joint. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y rotation value for each joint. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z rotation value for each joint. + """ return _py3dnacalib.SetNeutralJointRotationsCommand_setRotations(self, *args) def run(self, output): @@ -543,6 +965,8 @@ class SetNeutralJointRotationsCommand(Command): _py3dnacalib.SetNeutralJointRotationsCommand_swigregister(SetNeutralJointRotationsCommand) class SetNeutralJointTranslationsCommand(Command): + r""" SetNeutralJointTranslationsCommand is used to set new translation values to neutral joints.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetNeutralJointTranslationsCommand @@ -551,6 +975,29 @@ class SetNeutralJointTranslationsCommand(Command): _py3dnacalib.SetNeutralJointTranslationsCommand_swiginit(self, _py3dnacalib.new_SetNeutralJointTranslationsCommand(*args)) def setTranslations(self, *args): + r""" + *Overload 1:* + + Method for setting the neutral joint translations. + :type translations: dnac::ConstArrayView< dnac::Vector3 > + :param translations: + Translation values for each joint. + + | + + *Overload 2:* + + Method for setting the neutral joint translations. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X translation value for each joint. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y translation value for each joint. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z translation value for each joint. + """ return _py3dnacalib.SetNeutralJointTranslationsCommand_setTranslations(self, *args) def run(self, output): @@ -560,6 +1007,8 @@ class SetNeutralJointTranslationsCommand(Command): _py3dnacalib.SetNeutralJointTranslationsCommand_swigregister(SetNeutralJointTranslationsCommand) class SetSkinWeightsCommand(Command): + r""" SetSkinWeightsCommand is used to set new skin weights for a vertex in a mesh.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetSkinWeightsCommand @@ -568,15 +1017,39 @@ class SetSkinWeightsCommand(Command): _py3dnacalib.SetSkinWeightsCommand_swiginit(self, _py3dnacalib.new_SetSkinWeightsCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the targeted mesh. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ return _py3dnacalib.SetSkinWeightsCommand_setMeshIndex(self, meshIndex) def setVertexIndex(self, vertexIndex): + r""" + Method for setting the index of the vertex to change. + :type vertexIndex: int + :param vertexIndex: + The vertex index. + """ return _py3dnacalib.SetSkinWeightsCommand_setVertexIndex(self, vertexIndex) def setWeights(self, weights): + r""" + Method for setting the weights with which joints influence the vertex in question. + :type weights: dnac::ConstArrayView< float > + :param weights: + Weights for each joint that has an influence on the vertex. + """ return _py3dnacalib.SetSkinWeightsCommand_setWeights(self, weights) def setJointIndices(self, jointIndices): + r""" + Method for setting the joint indices of joints that influence the vertex in question. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + Joint indices of joints that have an influence on the vertex. + """ return _py3dnacalib.SetSkinWeightsCommand_setJointIndices(self, jointIndices) def run(self, output): @@ -586,6 +1059,8 @@ class SetSkinWeightsCommand(Command): _py3dnacalib.SetSkinWeightsCommand_swigregister(SetSkinWeightsCommand) class SetVertexPositionsCommand(Command): + r""" SetVertexPositionsCommand is used to change vertex positions values.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetVertexPositionsCommand @@ -594,15 +1069,67 @@ class SetVertexPositionsCommand(Command): _py3dnacalib.SetVertexPositionsCommand_swiginit(self, _py3dnacalib.new_SetVertexPositionsCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to change. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ return _py3dnacalib.SetVertexPositionsCommand_setMeshIndex(self, meshIndex) def setPositions(self, *args): + r""" + *Overload 1:* + + Method for setting the vertex positions used to calculate new values. + :type positions: dnac::ConstArrayView< dnac::Vector3 > + :param positions: + The vertex positions. + + | + + *Overload 2:* + + Method for setting the vertex positions used to calculate new values. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X coordinates for each vertex. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y coordinates for each vertex. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z coordinates for each vertex. + """ return _py3dnacalib.SetVertexPositionsCommand_setPositions(self, *args) def setMasks(self, masks): + r""" + Method for setting vertex masks used to calculate new vertex position values. + Notes: + If no masks are set, default weight value of 1 is used for each vertex. + :type masks: dnac::ConstArrayView< float > + :param masks: + The weights for each vertex. + """ return _py3dnacalib.SetVertexPositionsCommand_setMasks(self, masks) def setOperation(self, operation): + r""" + Method for setting the type of operation used to calculate new vertex position values. + Notes: + Available operations are: Interpolate, Add, Subtract and Multiply. Each position is calculated based on the provided operation type in the following way: + + Interpolate: = previousValue * (1 - weight) + setValue * weight:math:`\n Add: \f$newValue = previousValue + (setValue * weight)` + + Subtract: = previousValue - (setValue * weight):math:`\n Multiply: \f$newValue = previousValue * (setValue * weight)` + + + setValue is the value from new positions that were set, and weight is the value from masks array. + :type operation: int + :param operation: + The operation to use. + """ return _py3dnacalib.SetVertexPositionsCommand_setOperation(self, operation) def run(self, output): @@ -613,6 +1140,12 @@ _py3dnacalib.SetVertexPositionsCommand_swigregister(SetVertexPositionsCommand) SetVertexPositionsCommand.PositionsMasksCountMismatch = _py3dnacalib.cvar.SetVertexPositionsCommand_PositionsMasksCountMismatch class TranslateCommand(Command): + r""" + TranslateCommand is used to translate neutral joints and vertex positions. + Notes: + Joint translations are represented in parent space, so it is enough to translate only root joints, as that translation will be propagated to the rest of the joints. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_TranslateCommand @@ -621,6 +1154,12 @@ class TranslateCommand(Command): _py3dnacalib.TranslateCommand_swiginit(self, _py3dnacalib.new_TranslateCommand(*args)) def setTranslation(self, translation): + r""" + Method for setting the translation vector. + :type translation: dnac::Vector3 + :param translation: + The translation vector. + """ return _py3dnacalib.TranslateCommand_setTranslation(self, translation) def run(self, output): diff --git a/lib/Maya2023/linux/libdnacalib.so.6 b/lib/Maya2023/linux/libdnacalib.so.6 index c805e91..4c8d877 100644 Binary files a/lib/Maya2023/linux/libdnacalib.so.6 and b/lib/Maya2023/linux/libdnacalib.so.6 differ diff --git a/lib/Maya2023/linux/embeddedRL4.mll b/lib/Maya2023/linux/libembeddedRL4.so similarity index 100% rename from lib/Maya2023/linux/embeddedRL4.mll rename to lib/Maya2023/linux/libembeddedRL4.so diff --git a/lib/Maya2023/windows/_py3dna.pyd b/lib/Maya2023/windows/_py3dna.pyd index d9232c6..114e1e6 100644 Binary files a/lib/Maya2023/windows/_py3dna.pyd and b/lib/Maya2023/windows/_py3dna.pyd differ diff --git a/lib/Maya2023/windows/_py3dnacalib.pyd b/lib/Maya2023/windows/_py3dnacalib.pyd index 14d0d78..9cc29b1 100644 Binary files a/lib/Maya2023/windows/_py3dnacalib.pyd and b/lib/Maya2023/windows/_py3dnacalib.pyd differ diff --git a/lib/Maya2023/windows/dna.py b/lib/Maya2023/windows/dna.py index c2f0e9c..a25f827 100644 --- a/lib/Maya2023/windows/dna.py +++ b/lib/Maya2023/windows/dna.py @@ -1,13 +1,22 @@ -# This file was automatically generated by SWIG (http://www.swig.org). -# Version 4.0.1 +# This file was automatically generated by SWIG (https://www.swig.org). +# Version 4.1.1 # -# Do not make changes to this file unless you know what you are doing--modify +# Do not make changes to this file unless you know what you are doing - modify # the SWIG interface file instead. -from sys import version_info as _swig_python_version_info -if _swig_python_version_info < (2, 7, 0): - raise RuntimeError("Python 2.7 or later required") +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass + + + +from sys import version_info as _swig_python_version_info # Import the low-level C/C++ module if __package__ or "." in __name__: from . import _py3dna @@ -29,10 +38,10 @@ def _swig_repr(self): def _swig_setattr_nondynamic_instance_variable(set): def set_instance_attr(self, name, value): - if name == "thisown": - self.this.own(value) - elif name == "this": + if name == "this": set(self, name, value) + elif name == "thisown": + self.this.own(value) elif hasattr(self, name) and isinstance(getattr(type(self), name), property): set(self, name, value) else: @@ -62,22 +71,25 @@ class _SwigNonDynamicMeta(type): -def __new_decorator(factory_func, original_new): - @staticmethod - def __new(cls, *args, **kwargs): -# FIXME: while this workaround solves the immediate issue with the set of classes we currently have, -# it will fail for classes that use a factory function but need no parameters at all, in which case -# the factory function will never be invoked, only the original __new__ function. - if args or kwargs: - return factory_func(*args, **kwargs) - return original_new(cls) - return __new +def with_metaclass(meta, *bases): + class metaclass(type): -def __managed_init(self, *args, **kwargs): - self._args = args - self._kwargs = kwargs + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) class MemoryResource(object): + r""" + MemoryResource is an abstract class that allows the implementation of polymorphic allocators. + Notes: + It's purpose is to allow passing arbitrary allocators through API boundaries, without requiring changes in the + signatures and types involved. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -93,8 +105,12 @@ class MemoryResource(object): # Register MemoryResource in _py3dna: _py3dna.MemoryResource_swigregister(MemoryResource) - class AlignedMemoryResource(MemoryResource): + r""" + A MemoryResource that honors alignment requirements. + See also: MemoryResource + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -110,8 +126,12 @@ class AlignedMemoryResource(MemoryResource): # Register AlignedMemoryResource in _py3dna: _py3dna.AlignedMemoryResource_swigregister(AlignedMemoryResource) - class ArenaMemoryResource(MemoryResource): + r""" + Serves allocations from a preallocated memory region. + See also: MemoryResource + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dna.delete_ArenaMemoryResource @@ -120,18 +140,25 @@ class ArenaMemoryResource(MemoryResource): _py3dna.ArenaMemoryResource_swiginit(self, _py3dna.new_ArenaMemoryResource(*args)) def allocate(self, size, alignment): + r""" All allocations will be served from the currently active memory region.""" return _py3dna.ArenaMemoryResource_allocate(self, size, alignment) def deallocate(self, ptr, size, alignment): + r""" This is a no-op, and the regions are only freed when the arena itself is destroyed.""" return _py3dna.ArenaMemoryResource_deallocate(self, ptr, size, alignment) def getUpstreamMemoryResource(self): + r""" The upstream memory resource was passed through the constructor and is backing all arena allocations.""" return _py3dna.ArenaMemoryResource_getUpstreamMemoryResource(self) # Register ArenaMemoryResource in _py3dna: _py3dna.ArenaMemoryResource_swigregister(ArenaMemoryResource) - class DefaultMemoryResource(MemoryResource): + r""" + A MemoryResource that delegates to malloc / free. + See also: MemoryResource + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -147,7 +174,6 @@ class DefaultMemoryResource(MemoryResource): # Register DefaultMemoryResource in _py3dna: _py3dna.DefaultMemoryResource_swigregister(DefaultMemoryResource) - class StatusCode(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -160,7 +186,6 @@ class StatusCode(object): # Register StatusCode in _py3dna: _py3dna.StatusCode_swigregister(StatusCode) - class Status(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr @@ -179,13 +204,6 @@ class Status(object): # Register Status in _py3dna: _py3dna.Status_swigregister(Status) - -def Status_isOk(): - return _py3dna.Status_isOk() - -def Status_get(): - return _py3dna.Status_get() - class Readable(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -194,11 +212,39 @@ class Readable(object): __repr__ = _swig_repr def read(self, *args): + r""" + *Overload 1:* + + Read bytes from stream into the given buffer. + :type destination: string + :param destination: + Destination buffer into which the data is going to be read from the stream. + :type size: std::size_t + :param size: + Number of bytes to read from stream. + :rtype: std::size_t + :return: + Number of bytes read. + + | + + *Overload 2:* + + Read bytes from this stream into the given stream. + :type destination: :py:class:`Writable` + :param destination: + Destination stream into which the data is going to be read from this stream. + :type size: std::size_t + :param size: + Number of bytes to read from stream. + :rtype: std::size_t + :return: + Number of bytes read. + """ return _py3dna.Readable_read(self, *args) # Register Readable in _py3dna: _py3dna.Readable_swigregister(Readable) - class Writable(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -207,11 +253,39 @@ class Writable(object): __repr__ = _swig_repr def write(self, *args): + r""" + *Overload 1:* + + Writes bytes from the given buffer to the stream. + :type source: string + :param source: + Source buffer from which the data is going to be written to the stream. + :type size: std::size_t + :param size: + Number of bytes to write to the stream. + :rtype: std::size_t + :return: + Number of bytes written. + + | + + *Overload 2:* + + Writes bytes from the given stream to this stream. + :type source: :py:class:`Readable` + :param source: + Source stream from which the data is going to be written into this stream. + :type size: std::size_t + :param size: + Number of bytes to write to the stream. + :rtype: std::size_t + :return: + Number of bytes written. + """ return _py3dna.Writable_write(self, *args) # Register Writable in _py3dna: _py3dna.Writable_swigregister(Writable) - class Seekable(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -220,14 +294,25 @@ class Seekable(object): __repr__ = _swig_repr def tell(self): + r""" + Get the current position in the stream. + :rtype: int + :return: + Position in the stream relative to it's start, with 0 denoting the start position. + """ return _py3dna.Seekable_tell(self) def seek(self, position): + r""" + Set the current position in the stream. + :type position: int + :param position: + Position in the stream relative to it's start, with 0 denoting the start position. + """ return _py3dna.Seekable_seek(self, position) # Register Seekable in _py3dna: _py3dna.Seekable_swigregister(Seekable) - class Openable(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -236,11 +321,11 @@ class Openable(object): __repr__ = _swig_repr def open(self): + r""" Open access to the stream.""" return _py3dna.Openable_open(self) # Register Openable in _py3dna: _py3dna.Openable_swigregister(Openable) - class Closeable(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -249,11 +334,11 @@ class Closeable(object): __repr__ = _swig_repr def close(self): + r""" Close access to the stream.""" return _py3dna.Closeable_close(self) # Register Closeable in _py3dna: _py3dna.Closeable_swigregister(Closeable) - class Controllable(Openable, Closeable): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -263,7 +348,6 @@ class Controllable(Openable, Closeable): # Register Controllable in _py3dna: _py3dna.Controllable_swigregister(Controllable) - class Bounded(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -272,11 +356,16 @@ class Bounded(object): __repr__ = _swig_repr def size(self): + r""" + Obtain size of stream in bytes. + :rtype: int + :return: + Size in bytes. + """ return _py3dna.Bounded_size(self) # Register Bounded in _py3dna: _py3dna.Bounded_swigregister(Bounded) - class Buffered(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -285,11 +374,11 @@ class Buffered(object): __repr__ = _swig_repr def flush(self): + r""" Flush the changes to filesystem.""" return _py3dna.Buffered_flush(self) # Register Buffered in _py3dna: _py3dna.Buffered_swigregister(Buffered) - class Resizable(object): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -298,11 +387,11 @@ class Resizable(object): __repr__ = _swig_repr def resize(self, size): + r""" Resize file to the requested size.""" return _py3dna.Resizable_resize(self, size) # Register Resizable in _py3dna: _py3dna.Resizable_swigregister(Resizable) - class BoundedIOStream(Controllable, Readable, Writable, Seekable, Bounded): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -326,6 +415,8 @@ AccessMode_ReadWrite = _py3dna.AccessMode_ReadWrite OpenMode_Binary = _py3dna.OpenMode_Binary OpenMode_Text = _py3dna.OpenMode_Text class FileStream(BoundedIOStream): + r""" Standard file stream.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -334,23 +425,45 @@ class FileStream(BoundedIOStream): @staticmethod def create(path, accessMode, openMode, memRes=None): + r""" + Factory method for creation of a FileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type openMode: int + :param openMode: + Control whether the file is opened in binary or textual mode. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the FileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.FileStream_create(path, accessMode, openMode, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a FileStream instance. + :type instance: :py:class:`FileStream` + :param instance: + Instance of FileStream to be freed. + See also: create + """ return _py3dna.FileStream_destroy(instance) __swig_destroy__ = _py3dna.delete_FileStream # Register FileStream in _py3dna: _py3dna.FileStream_swigregister(FileStream) - -def FileStream_create(path, accessMode, openMode, memRes=None): - return _py3dna.FileStream_create(path, accessMode, openMode, memRes) - -def FileStream_destroy(instance): - return _py3dna.FileStream_destroy(instance) - class MemoryMappedFileStream(BoundedIOStream, Buffered, Resizable): + r""" Memory mapped file stream.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -359,23 +472,42 @@ class MemoryMappedFileStream(BoundedIOStream, Buffered, Resizable): @staticmethod def create(path, accessMode, memRes=None): + r""" + Factory method for creation of a MemoryMappedFileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryMappedFileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.MemoryMappedFileStream_create(path, accessMode, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a MemoryMappedFileStream instance. + :type instance: :py:class:`MemoryMappedFileStream` + :param instance: + Instance of MemoryMappedFileStream to be freed. + See also: create + """ return _py3dna.MemoryMappedFileStream_destroy(instance) __swig_destroy__ = _py3dna.delete_MemoryMappedFileStream # Register MemoryMappedFileStream in _py3dna: _py3dna.MemoryMappedFileStream_swigregister(MemoryMappedFileStream) - -def MemoryMappedFileStream_create(path, accessMode, memRes=None): - return _py3dna.MemoryMappedFileStream_create(path, accessMode, memRes) - -def MemoryMappedFileStream_destroy(instance): - return _py3dna.MemoryMappedFileStream_destroy(instance) - class MemoryStream(BoundedIOStream): + r""" In-memory stream.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -384,42 +516,193 @@ class MemoryStream(BoundedIOStream): @staticmethod def create(*args): + r""" + *Overload 1:* + + Factory method for creation of a MemoryStream instance. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.MemoryStream_create(*args) @staticmethod def destroy(instance): + r""" + Method for freeing a MemoryStream instance. + :type instance: :py:class:`MemoryStream` + :param instance: + Instance of MemoryStream to be freed. + See also: create + """ return _py3dna.MemoryStream_destroy(instance) __swig_destroy__ = _py3dna.delete_MemoryStream # Register MemoryStream in _py3dna: _py3dna.MemoryStream_swigregister(MemoryStream) -def MemoryStream_create(*args): - return _py3dna.MemoryStream_create(*args) +FileStreamImpl = FileStream -def MemoryStream_destroy(instance): - return _py3dna.MemoryStream_destroy(instance) +class FileStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(FileStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(FileStreamImpl) if name not in ("create","destroy")] + +class FileStream(with_metaclass(FileStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = FileStreamImpl.create(*args, **kwargs) + + def __del__(self): + FileStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -FileStream.__new__ = __new_decorator(FileStream_create, FileStream.__new__) -FileStream.__del__ = lambda instance: FileStream_destroy(instance) -FileStream.__init__ = __managed_init -del FileStream.create -del FileStream.destroy +MemoryMappedFileStreamImpl = MemoryMappedFileStream + +class MemoryMappedFileStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(MemoryMappedFileStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(MemoryMappedFileStreamImpl) if name not in ("create","destroy")] + +class MemoryMappedFileStream(with_metaclass(MemoryMappedFileStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = MemoryMappedFileStreamImpl.create(*args, **kwargs) + + def __del__(self): + MemoryMappedFileStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -MemoryMappedFileStream.__new__ = __new_decorator(MemoryMappedFileStream_create, MemoryMappedFileStream.__new__) -MemoryMappedFileStream.__del__ = lambda instance: MemoryMappedFileStream_destroy(instance) -MemoryMappedFileStream.__init__ = __managed_init -del MemoryMappedFileStream.create -del MemoryMappedFileStream.destroy +MemoryStreamImpl = MemoryStream +class MemoryStreamImplReflectionMixin(type): -MemoryStream.__new__ = __new_decorator(MemoryStream_create, MemoryStream.__new__) -MemoryStream.__del__ = lambda instance: MemoryStream_destroy(instance) -MemoryStream.__init__ = __managed_init -del MemoryStream.create -del MemoryStream.destroy + def __getattr__(cls, name): + return getattr(MemoryStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(MemoryStreamImpl) if name not in ("create","destroy")] + +class MemoryStream(with_metaclass(MemoryStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = MemoryStreamImpl.create(*args, **kwargs) + + def __del__(self): + MemoryStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] FileStream.AccessMode_Read = AccessMode_Read @@ -450,7 +733,6 @@ class StringView(object): # Register StringView in _py3dna: _py3dna.StringView_swigregister(StringView) - def __add__(*args): return _py3dna.__add__(*args) @@ -463,11 +745,11 @@ def __mul__(*args): def __truediv__(*args): return _py3dna.__truediv__(*args) -def __eq__(*args): - return _py3dna.__eq__(*args) +def __eq__(lhs, rhs): + return _py3dna.__eq__(lhs, rhs) -def __ne__(*args): - return _py3dna.__ne__(*args) +def __ne__(lhs, rhs): + return _py3dna.__ne__(lhs, rhs) DataLayer_Descriptor = _py3dna.DataLayer_Descriptor DataLayer_Definition = _py3dna.DataLayer_Definition DataLayer_Behavior = _py3dna.DataLayer_Behavior @@ -507,8 +789,14 @@ class CoordinateSystem(object): # Register CoordinateSystem in _py3dna: _py3dna.CoordinateSystem_swigregister(CoordinateSystem) - class DescriptorReader(object): + r""" + Read-only accessors for various metadata about the character and the rig. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -531,9 +819,31 @@ class DescriptorReader(object): return _py3dna.DescriptorReader_getMetaDataCount(self) def getMetaDataKey(self, index): + r""" + :type index: int + :param index: + A position in the zero-indexed array of key-value pairs. + Warning: + The index must be less than the value returned by getMetaDataCount. + :rtype: :py:class:`StringView` + :return: View over the key name string. + """ return _py3dna.DescriptorReader_getMetaDataKey(self, index) def getMetaDataValue(self, key): + r""" + Stored metadata value associated with the given key. + Notes: + If no value is associated with the given key, the returned view + will contain nullptr and will have a size of 0. + :type key: string + :param key: + A unique-known key that has a value associated to it. + Warning: + The key must be null-terminated. + :rtype: :py:class:`StringView` + :return: View over the metadata value string. + """ return _py3dna.DescriptorReader_getMetaDataValue(self, key) def getTranslationUnit(self): @@ -546,21 +856,43 @@ class DescriptorReader(object): return _py3dna.DescriptorReader_getCoordinateSystem(self) def getLODCount(self): + r""" + Available levels of detail (e.g. 6 which means the following levels are available: + [0,1,2,3,4,5], where 0 is the LOD with the highest details, and 5 is the LOD with + lowest details). + """ return _py3dna.DescriptorReader_getLODCount(self) def getDBMaxLOD(self): + r""" + The maximum level of detail stored in the DNA data for this character. + Notes: + The value is relative to LOD-0 from the database. + """ return _py3dna.DescriptorReader_getDBMaxLOD(self) def getDBComplexity(self): + r""" + Name of the input control interface used to drive this character rig. + Notes: + This parameter denotes the character's input control complexity. + """ return _py3dna.DescriptorReader_getDBComplexity(self) def getDBName(self): + r""" + Name of the database from which the character originates. + Notes: + All characters from the same database must have the same Definition, but may + have different complexity or LOD. + """ return _py3dna.DescriptorReader_getDBName(self) # Register DescriptorReader in _py3dna: _py3dna.DescriptorReader_swigregister(DescriptorReader) - class MeshBlendShapeChannelMapping(object): + r""" Mapping that associates a blend shape channel to it's mesh.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr meshIndex = property(_py3dna.MeshBlendShapeChannelMapping_meshIndex_get, _py3dna.MeshBlendShapeChannelMapping_meshIndex_set) @@ -572,8 +904,14 @@ class MeshBlendShapeChannelMapping(object): # Register MeshBlendShapeChannelMapping in _py3dna: _py3dna.MeshBlendShapeChannelMapping_swigregister(MeshBlendShapeChannelMapping) - class DefinitionReader(DescriptorReader): + r""" + Read-only accessors for DNA attributes that represent the rig's static data. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -584,102 +922,353 @@ class DefinitionReader(DescriptorReader): return _py3dna.DefinitionReader_getGUIControlCount(self) def getGUIControlName(self, index): + r""" + Name of the requested GUI control. + :type index: int + :param index: + A name's position in the zero-indexed array of GUI control names. + Warning: + The index must be less than the value returned by getGUIControlCount. + :rtype: :py:class:`StringView` + :return: View over the GUI control name string. + """ return _py3dna.DefinitionReader_getGUIControlName(self, index) def getRawControlCount(self): return _py3dna.DefinitionReader_getRawControlCount(self) def getRawControlName(self, index): + r""" + Name of the requested raw control. + :type index: int + :param index: + A name's position in the zero-indexed array of raw control names. + Warning: + The index must be less than the value returned by getRawControlCount. + :rtype: :py:class:`StringView` + :return: View over the control name string. + """ return _py3dna.DefinitionReader_getRawControlName(self, index) def getJointCount(self): return _py3dna.DefinitionReader_getJointCount(self) def getJointName(self, index): + r""" + Name of the requested joint. + :type index: int + :param index: + A name's position in the zero-indexed array of joint names. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: :py:class:`StringView` + :return: View over the joint name string. + """ return _py3dna.DefinitionReader_getJointName(self, index) def getJointIndexListCount(self): + r""" + Number of joint index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getJointIndexListCount(self) def getJointIndicesForLOD(self, lod): + r""" + List of joint indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which joints are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the joint indices. + See also: getLODCount + See also: getJointName + """ return _py3dna.DefinitionReader_getJointIndicesForLOD(self, lod) def getJointParentIndex(self, index): + r""" + Index of the requested joint's parent. + Notes: + The joint hierarchy may be traversed and reconstructed using this function. Example: + Joint names: [A, B, C, D, E, F, G, H, I] + Hierarchy: [0, 0, 0, 1, 1, 4, 2, 6, 2] + Describes the following hierarchy: + A + + B + | + D + | + E + | + F + + C + + G + | + H + + I + + Requesting the parent index of joint 5 (joint name: F) would return 4 (joint name: E). + Requesting the parent index of the root joint: 0 (joint name: A) would return the same index 0. + An out of bounds request (an index greater than the number of joints returns UINT16_MAX). + :type index: int + :param index: + The joint index which parent is being requested. + """ return _py3dna.DefinitionReader_getJointParentIndex(self, index) def getBlendShapeChannelCount(self): return _py3dna.DefinitionReader_getBlendShapeChannelCount(self) def getBlendShapeChannelName(self, index): + r""" + Name of the requested blend shape channel. + :type index: int + :param index: + A name's position in the zero-indexed array of blend shape channel names. + Warning: + The index must be less than the value returned by BlendShapeChannelExtentReader::getBlendShapeChannelCount. + :rtype: :py:class:`StringView` + :return: View over the blend shape channel name string. + """ return _py3dna.DefinitionReader_getBlendShapeChannelName(self, index) def getBlendShapeChannelIndexListCount(self): + r""" + Number of blend shape channel index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getBlendShapeChannelIndexListCount(self) def getBlendShapeChannelIndicesForLOD(self, lod): + r""" + List of blend shape channel indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which blend shape channels are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the blend shape channel indices. + + These LOD indices are not interchangeable with the LOD values from BehaviorReader::getBlendShapeChannelLODs. + See also: getLODCount + See also: getBlendShapeChannelName + """ return _py3dna.DefinitionReader_getBlendShapeChannelIndicesForLOD(self, lod) def getAnimatedMapCount(self): return _py3dna.DefinitionReader_getAnimatedMapCount(self) def getAnimatedMapName(self, index): + r""" + Name of the requested animated map. + :type index: int + :param index: + A name's position in the zero-indexed array of animated map names. + Warning: + The index must be less than the value returned by getAnimatedMapCount. + :rtype: :py:class:`StringView` + :return: View over the animated map name string. + """ return _py3dna.DefinitionReader_getAnimatedMapName(self, index) def getAnimatedMapIndexListCount(self): + r""" + Number of animated map index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getAnimatedMapIndexListCount(self) def getAnimatedMapIndicesForLOD(self, lod): + r""" + List of animated map indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which animated maps are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the animated map indices. + See also: getLODCount + See also: getAnimatedMapName + """ return _py3dna.DefinitionReader_getAnimatedMapIndicesForLOD(self, lod) def getMeshCount(self): return _py3dna.DefinitionReader_getMeshCount(self) def getMeshName(self, index): + r""" + Name of the requested mesh. + :type index: int + :param index: + A name's position in the zero-indexed array of mesh names. + Warning: + The index must be less than the value returned by getMeshCount. + :rtype: :py:class:`StringView` + :return: View over the mesh name string. + """ return _py3dna.DefinitionReader_getMeshName(self, index) def getMeshIndexListCount(self): + r""" + Number of mesh index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ return _py3dna.DefinitionReader_getMeshIndexListCount(self) def getMeshIndicesForLOD(self, lod): + r""" + List of mesh indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which meshes are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the mesh indices. + See also: getLODCount + See also: getMeshName + """ return _py3dna.DefinitionReader_getMeshIndicesForLOD(self, lod) def getMeshBlendShapeChannelMappingCount(self): + r""" Number of mesh-blend shape channel mapping items.""" return _py3dna.DefinitionReader_getMeshBlendShapeChannelMappingCount(self) def getMeshBlendShapeChannelMapping(self, index): + r""" + :type index: int + :param index: + A mapping's position in the zero-indexed array of mesh-blend shape channel mappings. + Warning: + The index must be less than the value returned by getMeshBlendShapeChannelMappingCount. + :rtype: :py:class:`MeshBlendShapeChannelMapping` + :return: A structure holding the mesh index and the associated blend shape channel index. + """ return _py3dna.DefinitionReader_getMeshBlendShapeChannelMapping(self, index) def getMeshBlendShapeChannelMappingIndicesForLOD(self, lod): + r""" + List of mesh-blend shape channel mapping indices for the specified LOD. + Notes: + The indices from this list can be used with the getMeshBlendShapeChannelMapping API + to retrieve individual mapping items. + :type lod: int + :param lod: + The level of detail which meshes are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the mesh blend shape channel mapping indices. + See also: getLODCount + See also: getMeshBlendShapeChannelMapping + """ return _py3dna.DefinitionReader_getMeshBlendShapeChannelMappingIndicesForLOD(self, lod) def getNeutralJointTranslation(self, index): + r""" + :type index: int + :param index: + A joint's position in the zero-indexed array of joint translations. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: dna::Vector3 + :return: The joint's translation (x, y, z). + """ return _py3dna.DefinitionReader_getNeutralJointTranslation(self, index) def getNeutralJointTranslationXs(self): + r""" + List of all translation X values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getNeutralJointTranslation + """ return _py3dna.DefinitionReader_getNeutralJointTranslationXs(self) def getNeutralJointTranslationYs(self): + r""" + List of all translation Y values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getNeutralJointTranslation + """ return _py3dna.DefinitionReader_getNeutralJointTranslationYs(self) def getNeutralJointTranslationZs(self): + r""" + List of all translation Z values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getNeutralJointTranslation + """ return _py3dna.DefinitionReader_getNeutralJointTranslationZs(self) def getNeutralJointRotation(self, index): + r""" + :type index: int + :param index: + A joint's position in the zero-indexed array of joint rotations. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: dna::Vector3 + :return: The joint's rotation (x, y, z). + """ return _py3dna.DefinitionReader_getNeutralJointRotation(self, index) def getNeutralJointRotationXs(self): + r""" + List of all rotation X values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getNeutralJointRotation + """ return _py3dna.DefinitionReader_getNeutralJointRotationXs(self) def getNeutralJointRotationYs(self): + r""" + List of all rotation Y values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getNeutralJointRotation + """ return _py3dna.DefinitionReader_getNeutralJointRotationYs(self) def getNeutralJointRotationZs(self): + r""" + List of all rotation Z values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getNeutralJointRotation + """ return _py3dna.DefinitionReader_getNeutralJointRotationZs(self) # Register DefinitionReader in _py3dna: _py3dna.DefinitionReader_swigregister(DefinitionReader) - class BehaviorReader(DefinitionReader): + r""" + Read-only accessors for DNA attributes that define the rig's evaluation. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -687,96 +1276,284 @@ class BehaviorReader(DefinitionReader): __repr__ = _swig_repr def getGUIToRawInputIndices(self): + r""" + Input indices used for mapping gui to raw controls. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ return _py3dna.BehaviorReader_getGUIToRawInputIndices(self) def getGUIToRawOutputIndices(self): + r""" + Output indices used for mapping gui to raw controls. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ return _py3dna.BehaviorReader_getGUIToRawOutputIndices(self) def getGUIToRawFromValues(self): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getGUIToRawFromValues(self) def getGUIToRawToValues(self): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getGUIToRawToValues(self) def getGUIToRawSlopeValues(self): + r""" + Computational values(slope/gradient) used for calculating the + output value during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getGUIToRawSlopeValues(self) def getGUIToRawCutValues(self): + r""" + Computational values(vertical intercept) used for calculating the + output value during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getGUIToRawCutValues(self) def getPSDCount(self): + r""" The number of distinct PSD expressions.""" return _py3dna.BehaviorReader_getPSDCount(self) def getPSDRowIndices(self): + r""" + PSD(input) indices. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of PSD indices. + """ return _py3dna.BehaviorReader_getPSDRowIndices(self) def getPSDColumnIndices(self): + r""" + Control(input) indices. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of control indices. + """ return _py3dna.BehaviorReader_getPSDColumnIndices(self) def getPSDValues(self): + r""" + Weights associated with each PSD row and column pair. + :rtype: dna::ConstArrayView< float > + :return: View over the array of weights. + """ return _py3dna.BehaviorReader_getPSDValues(self) def getJointRowCount(self): + r""" Number of rows in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorReader_getJointRowCount(self) def getJointColumnCount(self): + r""" Number of columns in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorReader_getJointColumnCount(self) def getJointVariableAttributeIndices(self, lod): + r""" + Joint attribute indices (output indices) for the requested LOD. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of joint indices. + """ return _py3dna.BehaviorReader_getJointVariableAttributeIndices(self, lod) def getJointGroupCount(self): + r""" Number of joint groups present in the entire joint matrix.""" return _py3dna.BehaviorReader_getJointGroupCount(self) def getJointGroupLODs(self, jointGroupIndex): + r""" + Number of rows per each level of detail for the requested joint group. + Notes: + Each element's position represents the level itself, while the value denotes + the number of rows within the joint group belonging to that level. e.g.: + [12, 9, 3] + | | + LOD-2 contains first 3 rows + | + LOD-1 contains first 9 rows + + LOD-0 contains first 12 rows + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ return _py3dna.BehaviorReader_getJointGroupLODs(self, jointGroupIndex) def getJointGroupInputIndices(self, jointGroupIndex): + r""" + Column indices that the requested joint group contains. + Notes: + The column indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of column indices. + """ return _py3dna.BehaviorReader_getJointGroupInputIndices(self, jointGroupIndex) def getJointGroupOutputIndices(self, jointGroupIndex): + r""" + Row indices that the requested joint group contains. + Notes: + The row indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of row indices. + """ return _py3dna.BehaviorReader_getJointGroupOutputIndices(self, jointGroupIndex) def getJointGroupValues(self, jointGroupIndex): + r""" + Values that the requested joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< float > + :return: View over the array of values. + """ return _py3dna.BehaviorReader_getJointGroupValues(self, jointGroupIndex) def getJointGroupJointIndices(self, jointGroupIndex): + r""" + Joint indices that the requested joint group contains. + Notes: + These joint indices can be used to get the joint names through DefinitionReader::getJointName. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of joint indices. + See also: DefinitionReader + """ return _py3dna.BehaviorReader_getJointGroupJointIndices(self, jointGroupIndex) def getBlendShapeChannelLODs(self): + r""" + Input index count per each level of detail for blend shape channels. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of input indices belonging to that level. + Warning: + These LOD values are not interchangeable with the LOD indices from DefinitionReader::getBlendShapeChannelIndicesForLOD. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ return _py3dna.BehaviorReader_getBlendShapeChannelLODs(self) def getBlendShapeChannelInputIndices(self): + r""" + Input indices used to index into the input vector. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ return _py3dna.BehaviorReader_getBlendShapeChannelInputIndices(self) def getBlendShapeChannelOutputIndices(self): + r""" + Output indices specify the positions of blend shape channel output values. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ return _py3dna.BehaviorReader_getBlendShapeChannelOutputIndices(self) def getAnimatedMapLODs(self): + r""" + Row count per each level of detail for animated maps. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of rows (within the conditional table), + belonging to that level. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ return _py3dna.BehaviorReader_getAnimatedMapLODs(self) def getAnimatedMapInputIndices(self): + r""" + Input indices used to index into the array of input values. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ return _py3dna.BehaviorReader_getAnimatedMapInputIndices(self) def getAnimatedMapOutputIndices(self): + r""" + Output indices that specify the computed output value's position. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ return _py3dna.BehaviorReader_getAnimatedMapOutputIndices(self) def getAnimatedMapFromValues(self): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getAnimatedMapFromValues(self) def getAnimatedMapToValues(self): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ return _py3dna.BehaviorReader_getAnimatedMapToValues(self) def getAnimatedMapSlopeValues(self): + r""" + Computational values(slope/gradient) used for calculating the output value. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getAnimatedMapSlopeValues(self) def getAnimatedMapCutValues(self): + r""" + Computational values(vertical intercept) used for calculating the output value. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ return _py3dna.BehaviorReader_getAnimatedMapCutValues(self) # Register BehaviorReader in _py3dna: _py3dna.BehaviorReader_swigregister(BehaviorReader) - class GeometryReader(DefinitionReader): + r""" + Read-only accessors to the geometry data associated with a rig. + Warning: + Implementors should inherit from Reader itself and not this class. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -784,108 +1561,559 @@ class GeometryReader(DefinitionReader): __repr__ = _swig_repr def getVertexPositionCount(self, meshIndex): + r""" + Number of vertex positions in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexPositionCount(self, meshIndex) def getVertexPosition(self, meshIndex, vertexIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + The index of the vertex position in the zero-indexed array of vertex positions. + + vertexIndex must be less than the value returned by getVertexPositionCount. + Notes: + The vertices are sorted by the vertex ID. + :rtype: dna::Position + :return: The vertex position. + """ return _py3dna.GeometryReader_getVertexPosition(self, meshIndex, vertexIndex) def getVertexPositionXs(self, meshIndex): + r""" + List of all vertex position X values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getVertexPosition + """ return _py3dna.GeometryReader_getVertexPositionXs(self, meshIndex) def getVertexPositionYs(self, meshIndex): + r""" + List of all vertex position Y values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getVertexPosition + """ return _py3dna.GeometryReader_getVertexPositionYs(self, meshIndex) def getVertexPositionZs(self, meshIndex): + r""" + List of all vertex position Z values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getVertexPosition + """ return _py3dna.GeometryReader_getVertexPositionZs(self, meshIndex) def getVertexTextureCoordinateCount(self, meshIndex): + r""" + Number of texture coordinates in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexTextureCoordinateCount(self, meshIndex) def getVertexTextureCoordinate(self, meshIndex, textureCoordinateIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type textureCoordinateIndex: int + :param textureCoordinateIndex: + The index of the texture coordinate in the zero-indexed array of texture coordinates. + + textureCoordinateIndex must be less than the value returned by getVertexTextureCoordinateCount. + :rtype: dna::TextureCoordinate + :return: The texture coordinate. + """ return _py3dna.GeometryReader_getVertexTextureCoordinate(self, meshIndex, textureCoordinateIndex) def getVertexTextureCoordinateUs(self, meshIndex): + r""" + List of all texture coordinate U values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexTextureCoordinate. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all U values. + See also: getVertexTextureCoordinate + """ return _py3dna.GeometryReader_getVertexTextureCoordinateUs(self, meshIndex) def getVertexTextureCoordinateVs(self, meshIndex): + r""" + List of all texture coordinate V values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexTextureCoordinate. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all V values. + See also: getVertexTextureCoordinate + """ return _py3dna.GeometryReader_getVertexTextureCoordinateVs(self, meshIndex) def getVertexNormalCount(self, meshIndex): + r""" + Number of vertex normals in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexNormalCount(self, meshIndex) def getVertexNormal(self, meshIndex, normalIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type normalIndex: int + :param normalIndex: + The index of the vertex normal in the zero-indexed array of vertex normals. + + normalIndex must be less than the value returned by getVertexNormalCount. + :rtype: dna::Normal + :return: The vertex normal. + """ return _py3dna.GeometryReader_getVertexNormal(self, meshIndex, normalIndex) def getVertexNormalXs(self, meshIndex): + r""" + List of all normal X values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexNormalXs(self, meshIndex) def getVertexNormalYs(self, meshIndex): + r""" + List of all normal Y value for the referenced meshs. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexNormalYs(self, meshIndex) def getVertexNormalZs(self, meshIndex): + r""" + List of all normal Z values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexNormalZs(self, meshIndex) def getVertexLayoutCount(self, meshIndex): + r""" + Number of vertex layouts in the entire mesh. + Notes: + A vertex layout is a collection of vertex attributes. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getVertexLayoutCount(self, meshIndex) def getVertexLayout(self, meshIndex, layoutIndex): + r""" + Vertex layouts contain only attribute indices which can be used to query + the actual attributes, such as positions, texture coordinates and normals, + which are associated with the vertex. + Notes: + The indices from a layout are usable with the above defined APIs. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type layoutIndex: int + :param layoutIndex: + The index of the layout in the zero-indexed array of vertex layouts. + + layoutIndex must be less than the value returned by getVertexLayoutCount. + See also: getVertexPosition + See also: getVertexTextureCoordinate + See also: getVertexNormal + """ return _py3dna.GeometryReader_getVertexLayout(self, meshIndex, layoutIndex) def getVertexLayoutPositionIndices(self, meshIndex): + r""" + Position indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex position indices values. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getVertexLayoutPositionIndices(self, meshIndex) def getVertexLayoutTextureCoordinateIndices(self, meshIndex): + r""" + Texture coordinate indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex texture coordinate indices. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getVertexLayoutTextureCoordinateIndices(self, meshIndex) def getVertexLayoutNormalIndices(self, meshIndex): + r""" + Normal indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex normal indices. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getVertexLayoutNormalIndices(self, meshIndex) def getFaceCount(self, meshIndex): + r""" + Number of faces that belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getFaceCount(self, meshIndex) def getFaceVertexLayoutIndices(self, meshIndex, faceIndex): + r""" + List of vertex layout indices the belong to a face on the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type faceIndex: int + :param faceIndex: + A face's position in the zero-indexed array of faces that belong to + the above referenced mesh. + + faceIndex must be less than the value returned by getFaceCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over the list of vertex layout indices. + See also: getVertexLayout + """ return _py3dna.GeometryReader_getFaceVertexLayoutIndices(self, meshIndex, faceIndex) def getMaximumInfluencePerVertex(self, meshIndex): + r""" + The maximum number of joints that may influence any single vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getMaximumInfluencePerVertex(self, meshIndex) def getSkinWeightsCount(self, meshIndex): + r""" + Number of skin weights associated with the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getSkinWeightsCount(self, meshIndex) def getSkinWeightsValues(self, meshIndex, vertexIndex): + r""" + List of skin weights influencing the requested vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertices. + + vertexIndex must be less than the value returned by getVertexPositionCount. + :rtype: dna::ConstArrayView< float > + :return: View over the list of skin weights. + """ return _py3dna.GeometryReader_getSkinWeightsValues(self, meshIndex, vertexIndex) def getSkinWeightsJointIndices(self, meshIndex, vertexIndex): + r""" + List of joint indices associated with each skin weight for the specified vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertices. + + vertexIndex must be less than the value returned by getVertexPositionCount. + Notes: + The joint indices are stored in the same order as the weights they + are associated with. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the list of joint indices. + """ return _py3dna.GeometryReader_getSkinWeightsJointIndices(self, meshIndex, vertexIndex) def getBlendShapeTargetCount(self, meshIndex): + r""" + Number of blend shapes that belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryReader_getBlendShapeTargetCount(self, meshIndex) def getBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex): + r""" + The matching blend shape channel index of the requested blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + See also: DefinitionReader::getBlendShapeChannelName + """ return _py3dna.GeometryReader_getBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDeltaCount(self, meshIndex, blendShapeTargetIndex): + r""" + Number of deltas that belong to the specified blend shape. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaCount(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDelta(self, meshIndex, blendShapeTargetIndex, deltaIndex): + r""" + List of deltas for each affected vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :type deltaIndex: int + :param deltaIndex: + A position in the zero-indexed array of blend shapes deltas. + + deltaIndex must be less than the value returned by getBlendShapeTargetDeltaCount. + """ return _py3dna.GeometryReader_getBlendShapeTargetDelta(self, meshIndex, blendShapeTargetIndex, deltaIndex) def getBlendShapeTargetDeltaXs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta X values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getBlendShapeTargetDelta + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaXs(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDeltaYs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta Y values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getBlendShapeTargetDelta + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaYs(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetDeltaZs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta Z values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getBlendShapeTargetDelta + """ return _py3dna.GeometryReader_getBlendShapeTargetDeltaZs(self, meshIndex, blendShapeTargetIndex) def getBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex): + r""" + Vertex position indices affected by the referenced blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + Notes: + The vertex position indices are stored in the same order as the deltas they + are associated with. + These indices can be used to query the associated vertices themselves through getVertexPosition. + See also: getVertexPosition + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over the list of vertex position indices. + """ return _py3dna.GeometryReader_getBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex) # Register GeometryReader in _py3dna: _py3dna.GeometryReader_swigregister(GeometryReader) - class Reader(BehaviorReader, GeometryReader): + r""" + The abstract Reader which its implementations are expected to inherit. + Notes: + This class combines the various different reader interfaces into a single interface. + The artificial separation into multiple interfaces mirrors the DNA file structure that + is separated into matching layers under the same names. As these layers can be + selectively loaded, it might be convenient to slice-off interfaces which layers were + not loaded. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -894,11 +2122,16 @@ class Reader(BehaviorReader, GeometryReader): __swig_destroy__ = _py3dna.delete_Reader def unload(self, layer): + r""" + Unload all data of the specified layer and all layers dependent on it. + :type layer: int + :param layer: + Layer which data should be unloaded. + """ return _py3dna.Reader_unload(self, layer) # Register Reader in _py3dna: _py3dna.Reader_swigregister(Reader) - class StreamReader(Reader): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -908,6 +2141,7 @@ class StreamReader(Reader): __swig_destroy__ = _py3dna.delete_StreamReader def read(self): + r""" read data from stream into internal structures.""" return _py3dna.StreamReader_read(self) # Register StreamReader in _py3dna: @@ -925,22 +2159,193 @@ class BinaryStreamReader(StreamReader): @staticmethod def create(*args): + r""" + *Overload 1:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int, optional + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int, optional + :param maxLOD: + The maximum level of details to be loaded. + + A value of zero indicates to load all LODs. + Warning: + The maxLOD value must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 4:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 5:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.BinaryStreamReader_create(*args) @staticmethod def destroy(instance): + r""" + Method for freeing a BinaryStreamReader instance. + :type instance: :py:class:`BinaryStreamReader` + :param instance: + Instance of BinaryStreamReader to be freed. + See also: create + """ return _py3dna.BinaryStreamReader_destroy(instance) __swig_destroy__ = _py3dna.delete_BinaryStreamReader # Register BinaryStreamReader in _py3dna: _py3dna.BinaryStreamReader_swigregister(BinaryStreamReader) - -def BinaryStreamReader_create(*args): - return _py3dna.BinaryStreamReader_create(*args) - -def BinaryStreamReader_destroy(instance): - return _py3dna.BinaryStreamReader_destroy(instance) - class JSONStreamReader(StreamReader): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -950,37 +2355,128 @@ class JSONStreamReader(StreamReader): @staticmethod def create(stream, memRes=None): + r""" + Factory method for creation of JSONStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.JSONStreamReader_create(stream, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a JSONStreamReader instance. + :type instance: :py:class:`JSONStreamReader` + :param instance: + Instance of JSONStreamReader to be freed. + See also: create + """ return _py3dna.JSONStreamReader_destroy(instance) __swig_destroy__ = _py3dna.delete_JSONStreamReader # Register JSONStreamReader in _py3dna: _py3dna.JSONStreamReader_swigregister(JSONStreamReader) -def JSONStreamReader_create(stream, memRes=None): - return _py3dna.JSONStreamReader_create(stream, memRes) +BinaryStreamReaderImpl = BinaryStreamReader -def JSONStreamReader_destroy(instance): - return _py3dna.JSONStreamReader_destroy(instance) +class BinaryStreamReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(BinaryStreamReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(BinaryStreamReaderImpl) if name not in ("create","destroy")] + +class BinaryStreamReader(with_metaclass(BinaryStreamReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = BinaryStreamReaderImpl.create(*args, **kwargs) + + def __del__(self): + BinaryStreamReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -BinaryStreamReader.__new__ = __new_decorator(BinaryStreamReader_create, BinaryStreamReader.__new__) -BinaryStreamReader.__del__ = lambda instance: BinaryStreamReader_destroy(instance) -BinaryStreamReader.__init__ = __managed_init -del BinaryStreamReader.create -del BinaryStreamReader.destroy +JSONStreamReaderImpl = JSONStreamReader +class JSONStreamReaderImplReflectionMixin(type): -JSONStreamReader.__new__ = __new_decorator(JSONStreamReader_create, JSONStreamReader.__new__) -JSONStreamReader.__del__ = lambda instance: JSONStreamReader_destroy(instance) -JSONStreamReader.__init__ = __managed_init -del JSONStreamReader.create -del JSONStreamReader.destroy + def __getattr__(cls, name): + return getattr(JSONStreamReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(JSONStreamReaderImpl) if name not in ("create","destroy")] + +class JSONStreamReader(with_metaclass(JSONStreamReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = JSONStreamReaderImpl.create(*args, **kwargs) + + def __del__(self): + JSONStreamReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] class DescriptorWriter(object): + r""" + Write-only accessors to various metadata about the character and the rig. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -988,6 +2484,13 @@ class DescriptorWriter(object): __repr__ = _swig_repr def setName(self, name): + r""" + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an allocation. + """ return _py3dna.DescriptorWriter_setName(self, name) def setArchetype(self, archetype): @@ -1000,9 +2503,23 @@ class DescriptorWriter(object): return _py3dna.DescriptorWriter_setAge(self, age) def clearMetaData(self): + r""" Empties the metadata storage, delete all key-value pairs.""" return _py3dna.DescriptorWriter_clearMetaData(self) def setMetaData(self, key, value): + r""" + Associate the metadata value with the given key. + :type key: string + :param key: + A unique, null-terminated key, to which the given value will be assigned. + :type value: string + :param value: + A null-terminated, metadata value, which is to be assigned to the given key. + Notes: + Consecutive calls using the same key will overwrite any existing data. + + Passing nullptr as the value argument will cause the associated key to be deleted. + """ return _py3dna.DescriptorWriter_setMetaData(self, key, value) def setTranslationUnit(self, unit): @@ -1015,21 +2532,52 @@ class DescriptorWriter(object): return _py3dna.DescriptorWriter_setCoordinateSystem(self, system) def setLODCount(self, lodCount): + r""" + Available levels of detail (e.g. 6 which means the following levels are available: + [0,1,2,3,4,5], where 0 is the LOD with the highest details, and 5 is the LOD with + lowest details). + :type lodCount: int + :param lodCount: + The number of levels available. + """ return _py3dna.DescriptorWriter_setLODCount(self, lodCount) def setDBMaxLOD(self, lod): + r""" The maximum level of detail stored in the DNA data for this character.""" return _py3dna.DescriptorWriter_setDBMaxLOD(self, lod) def setDBComplexity(self, name): + r""" + Name of the input control interface used to drive this character rig. + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DescriptorWriter_setDBComplexity(self, name) def setDBName(self, name): + r""" + Name of the database from which the character originates. + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DescriptorWriter_setDBName(self, name) # Register DescriptorWriter in _py3dna: _py3dna.DescriptorWriter_swigregister(DescriptorWriter) - class DefinitionWriter(DescriptorWriter): + r""" + Write-only accessors for DNA attributes that represent the rig's static data. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1037,108 +2585,391 @@ class DefinitionWriter(DescriptorWriter): __repr__ = _swig_repr def clearGUIControlNames(self): + r""" Delete all stored GUI control names.""" return _py3dna.DefinitionWriter_clearGUIControlNames(self) def setGUIControlName(self, index, name): + r""" + Name of the specified GUI control. + :type index: int + :param index: + A name's position in the zero-indexed array of GUI control names. + Notes: + The control name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setGUIControlName(self, index, name) def clearRawControlNames(self): + r""" Delete all stored raw control names.""" return _py3dna.DefinitionWriter_clearRawControlNames(self) def setRawControlName(self, index, name): + r""" + Name of the specified raw control. + :type index: int + :param index: + A name's position in the zero-indexed array of raw control names. + Notes: + The control name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setRawControlName(self, index, name) def clearJointNames(self): + r""" Delete all stored joint names.""" return _py3dna.DefinitionWriter_clearJointNames(self) def setJointName(self, index, name): + r""" + Name of the specified joint. + :type index: int + :param index: + A name's position in the zero-indexed array of joint names. + Notes: + The joint name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setJointName(self, index, name) def clearJointIndices(self): + r""" Delete all stored joint indices.""" return _py3dna.DefinitionWriter_clearJointIndices(self) def setJointIndices(self, index, jointIndices): + r""" + Store a list of joint indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where joint indices are stored. + Notes: + The index denotes the position of an entire joint index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of joint indices. + + The joint index storage will be implicitly resized (if needed) to provide + storage for the number of joint indices that is inferred from the specified index. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + + These indices can be used to access joint names through DefinitionReader::getJointName. + :type count: int + :param count: + The number of joint indices to copy. + """ return _py3dna.DefinitionWriter_setJointIndices(self, index, jointIndices) def clearLODJointMappings(self): + r""" Delete all stored LOD to joint list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODJointMappings(self) def setLODJointMapping(self, lod, index): + r""" + Set which joints belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the joints are being associated. + :type index: int + :param index: + The index onto which joints indices were assigned using setJointIndices. + See also: setJointIndices + """ return _py3dna.DefinitionWriter_setLODJointMapping(self, lod, index) def clearBlendShapeChannelNames(self): + r""" Delete all stored blend shape channel names.""" return _py3dna.DefinitionWriter_clearBlendShapeChannelNames(self) def setBlendShapeChannelName(self, index, name): + r""" + Name of the specified blend shape channel. + :type index: int + :param index: + A name's position in the zero-indexed array of blend shape channel names. + Notes: + The blend shape channel name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setBlendShapeChannelName(self, index, name) def clearBlendShapeChannelIndices(self): + r""" Delete all stored blend shape channel indices.""" return _py3dna.DefinitionWriter_clearBlendShapeChannelIndices(self) def setBlendShapeChannelIndices(self, index, blendShapeChannelIndices): + r""" + Store a list of blend shape channel name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where blend shape channel name indices are stored. + Notes: + The index denotes the position of an entire blend shape channel index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of blend shape channel indices. + + The blend shape channel index storage will be implicitly resized (if needed) to provide storage + for the number of blend shape channel name indices that is inferred from the specified index. + :type blendShapeChannelIndices: int + :param blendShapeChannelIndices: + The source address from which the blend shape channel name indices are to be copied. + + These indices can be used to access blend shape channel names through DefinitionReader::getBlendShapeChannelName. + :type count: int + :param count: + The number of blend shape channel name indices to copy. + """ return _py3dna.DefinitionWriter_setBlendShapeChannelIndices(self, index, blendShapeChannelIndices) def clearLODBlendShapeChannelMappings(self): + r""" Delete all stored LOD to blend shape channel list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODBlendShapeChannelMappings(self) def setLODBlendShapeChannelMapping(self, lod, index): + r""" + Set which blend shape channels belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the blend shape channels are being associated. + :type index: int + :param index: + The index onto which blend shape channel name indices were assigned using setBlendShapeChannelIndices. + Warning: + The LOD indices set here are not interchangeable with the LOD values set in BehaviorWriter::setBlendShapeChannelLODs. + See also: setBlendShapeChannelIndices + """ return _py3dna.DefinitionWriter_setLODBlendShapeChannelMapping(self, lod, index) def clearAnimatedMapNames(self): + r""" Delete all stored animated map names.""" return _py3dna.DefinitionWriter_clearAnimatedMapNames(self) def setAnimatedMapName(self, index, name): + r""" + Name of the specified animated map. + :type index: int + :param index: + A name's position in the zero-indexed array of animated map names. + Notes: + The animated map name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setAnimatedMapName(self, index, name) def clearAnimatedMapIndices(self): + r""" Delete all stored animated map indices.""" return _py3dna.DefinitionWriter_clearAnimatedMapIndices(self) def setAnimatedMapIndices(self, index, animatedMapIndices): + r""" + Store a list of animated map name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where animated map name indices are stored. + Notes: + The index denotes the position of an entire animated map index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of animated map indices. + + The animated map index storage will be implicitly resized (if needed) to provide storage + for the number of animated map name indices that is inferred from the specified index. + :type animatedMapIndices: int + :param animatedMapIndices: + The source address from which the animated map name indices are to be copied. + + These indices can be used to access animated map names through DefinitionReader::getAnimatedMapName. + :type count: int + :param count: + The number of animated map name indices to copy. + """ return _py3dna.DefinitionWriter_setAnimatedMapIndices(self, index, animatedMapIndices) def clearLODAnimatedMapMappings(self): + r""" Delete all stored LOD to animated map list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODAnimatedMapMappings(self) def setLODAnimatedMapMapping(self, lod, index): + r""" + Set which animated maps belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the animated maps are being associated. + :type index: int + :param index: + The index onto which animated map indices were assigned using setAnimatedMapIndices. + See also: setAnimatedMapIndices + """ return _py3dna.DefinitionWriter_setLODAnimatedMapMapping(self, lod, index) def clearMeshNames(self): + r""" Delete all stored mesh names.""" return _py3dna.DefinitionWriter_clearMeshNames(self) def setMeshName(self, index, name): + r""" + Name of the specified mesh. + :type index: int + :param index: + A name's position in the zero-indexed array of mesh names. + Notes: + The mesh name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ return _py3dna.DefinitionWriter_setMeshName(self, index, name) def clearMeshIndices(self): + r""" Delete all stored mesh indices.""" return _py3dna.DefinitionWriter_clearMeshIndices(self) def setMeshIndices(self, index, meshIndices): + r""" + Store a list of mesh name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where mesh name indices are stored. + Notes: + The index denotes the position of an entire mesh index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of mesh indices. + + The mesh index storage will be implicitly resized (if needed) to provide storage + for the number of mesh name indices that is inferred from the specified index. + :type meshIndices: int + :param meshIndices: + The source address from which the mesh name indices are to be copied. + + These indices can be used to access mesh names through DefinitionReader::getMeshName. + :type count: int + :param count: + The number of mesh name indices to copy. + """ return _py3dna.DefinitionWriter_setMeshIndices(self, index, meshIndices) def clearLODMeshMappings(self): + r""" Delete all stored LOD to mesh list index mapping entries.""" return _py3dna.DefinitionWriter_clearLODMeshMappings(self) def setLODMeshMapping(self, lod, index): + r""" + Set which meshes belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the meshes are being associated. + :type index: int + :param index: + The index onto which mesh indices were assigned using setMeshIndices. + See also: setMeshIndices + """ return _py3dna.DefinitionWriter_setLODMeshMapping(self, lod, index) def clearMeshBlendShapeChannelMappings(self): + r""" Delete all stored mesh to blend shape channel mapping entries.""" return _py3dna.DefinitionWriter_clearMeshBlendShapeChannelMappings(self) def setMeshBlendShapeChannelMapping(self, index, meshIndex, blendShapeChannelIndex): + r""" + Associate a blend shape channel with it's mesh. + :type index: int + :param index: + A mapping's position in the zero-indexed array of mesh-blend shape channel mappings. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of mesh names. + :type blendShapeChannelIndex: int + :param blendShapeChannelIndex: + A blend shape channel's position in the zero-indexed array of blend shape channel names. + """ return _py3dna.DefinitionWriter_setMeshBlendShapeChannelMapping(self, index, meshIndex, blendShapeChannelIndex) def setJointHierarchy(self, jointIndices): + r""" + A simple array describing the parent-child relationships between joints. + Notes: + Example: + Joint names: [A, B, C, D, E, F, G, H] + Hierarchy: [0, 0, 0, 1, 1, 4, 2, 2] + Describes the following hierarchy: + A + + B + | + D + | + E + | + F + + C + + G + + H + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + + These indices can be used to access joint names through DefinitionReader::getJointName. + :type count: int + :param count: + The number of joint indices to copy. + """ return _py3dna.DefinitionWriter_setJointHierarchy(self, jointIndices) def setNeutralJointTranslations(self, translations): + r""" + :type translations: dna::Vector3 + :param translations: + The source address from which the translations are to be copied. + :type count: int + :param count: + The number of translation values to copy. + """ return _py3dna.DefinitionWriter_setNeutralJointTranslations(self, translations) def setNeutralJointRotations(self, rotations): + r""" + :type rotations: dna::Vector3 + :param rotations: + The source address from which the rotations are to be copied. + :type count: int + :param count: + The number of rotation values to copy. + """ return _py3dna.DefinitionWriter_setNeutralJointRotations(self, rotations) # Register DefinitionWriter in _py3dna: _py3dna.DefinitionWriter_swigregister(DefinitionWriter) - class BehaviorWriter(DefinitionWriter): + r""" + Write-only accessors for DNA attributes that define the rig's evaluation. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1146,96 +2977,387 @@ class BehaviorWriter(DefinitionWriter): __repr__ = _swig_repr def setGUIToRawInputIndices(self, inputIndices): + r""" + Input indices used for mapping gui to raw controls. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawInputIndices(self, inputIndices) def setGUIToRawOutputIndices(self, outputIndices): + r""" + Output indices used for mapping gui to raw controls. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawOutputIndices(self, outputIndices) def setGUIToRawFromValues(self, fromValues): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :type fromValues: float + :param fromValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawFromValues(self, fromValues) def setGUIToRawToValues(self, toValues): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :type toValues: float + :param toValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawToValues(self, toValues) def setGUIToRawSlopeValues(self, slopeValues): + r""" + Computational values(slope/gradient) used for calculating the + output value during gui to raw control mapping. + :type slopeValues: float + :param slopeValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawSlopeValues(self, slopeValues) def setGUIToRawCutValues(self, cutValues): + r""" + Computational values(vertical intercept) used for calculating the + output value during gui to raw control mapping. + :type cutValues: float + :param cutValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setGUIToRawCutValues(self, cutValues) def setPSDCount(self, count): + r""" The number of distinct PSD expressions.""" return _py3dna.BehaviorWriter_setPSDCount(self, count) def setPSDRowIndices(self, rowIndices): + r""" + PSD(input) indices which will become the rows of the PSD matrix. + :type rowIndices: int + :param rowIndices: + The source address from which the PSD indices are to be copied. + :type count: int + :param count: + The number of PSD indices to copy. + """ return _py3dna.BehaviorWriter_setPSDRowIndices(self, rowIndices) def setPSDColumnIndices(self, columnIndices): + r""" + Control(input) indices which will become the columns of the PSD matrix. + :type columnIndices: int + :param columnIndices: + The source address from which the control indices are to be copied. + :type count: int + :param count: + The number of control indices to copy. + """ return _py3dna.BehaviorWriter_setPSDColumnIndices(self, columnIndices) def setPSDValues(self, weights): + r""" + Weights associated with each PSD row and column pair. + :type weights: float + :param weights: + The source address from which the weight values are to be copied. + :type count: int + :param count: + The number of weight values to copy. + """ return _py3dna.BehaviorWriter_setPSDValues(self, weights) def setJointRowCount(self, rowCount): + r""" Number of rows in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorWriter_setJointRowCount(self, rowCount) def setJointColumnCount(self, columnCount): + r""" Number of columns in the entire, uncompressed joint matrix.""" return _py3dna.BehaviorWriter_setJointColumnCount(self, columnCount) def clearJointGroups(self): + r""" Delete all joint groups.""" return _py3dna.BehaviorWriter_clearJointGroups(self) def deleteJointGroup(self, jointGroupIndex): + r""" + Delete the specified joint group. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + """ return _py3dna.BehaviorWriter_deleteJointGroup(self, jointGroupIndex) def setJointGroupLODs(self, jointGroupIndex, lods): + r""" + Number of rows per each level of detail for the specified joint group. + Notes: + Each element's position represents the level itself, while the value denotes + the number of rows within the joint group belonging to that level. e.g.: + [12, 9, 3] + | | + LOD-2 contains first 3 rows + | + LOD-1 contains first 9 rows + + LOD-0 contains first 12 rows + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + """ return _py3dna.BehaviorWriter_setJointGroupLODs(self, jointGroupIndex, lods) def setJointGroupInputIndices(self, jointGroupIndex, inputIndices): + r""" + Column indices that the specified joint group contains. + Notes: + The column indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type inputIndices: int + :param inputIndices: + The source address from which the column indices are to be copied. + :type count: int + :param count: + The number of column indices to copy. + """ return _py3dna.BehaviorWriter_setJointGroupInputIndices(self, jointGroupIndex, inputIndices) def setJointGroupOutputIndices(self, jointGroupIndex, outputIndices): + r""" + Row indices that the specified joint group contains. + Notes: + The row indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type outputIndices: int + :param outputIndices: + The source address from which the row indices are to be copied. + :type count: int + :param count: + The number of row indices to copy. + """ return _py3dna.BehaviorWriter_setJointGroupOutputIndices(self, jointGroupIndex, outputIndices) def setJointGroupValues(self, jointGroupIndex, values): + r""" + Values that the specified joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Notes: + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type values: float + :param values: + The source address from which the values are to be copied. + :type count: int + :param count: + The number of values to copy. + """ return _py3dna.BehaviorWriter_setJointGroupValues(self, jointGroupIndex, values) def setJointGroupJointIndices(self, jointGroupIndex, jointIndices): + r""" + Joint indices that the specified joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Notes: + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + :type count: int + :param count: + The number of joint indices to copy. + """ return _py3dna.BehaviorWriter_setJointGroupJointIndices(self, jointGroupIndex, jointIndices) def setBlendShapeChannelLODs(self, lods): + r""" + Input index count per each level of detail for blend shapes. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of input indices belonging to that level. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + Warning: + The LOD values set here are not interchangeable with the LOD indices set in DefinitionWriter::setBlendShapeNameIndices + and DefinitionWriter::setLODBlendShapeMapping + """ return _py3dna.BehaviorWriter_setBlendShapeChannelLODs(self, lods) def setBlendShapeChannelInputIndices(self, inputIndices): + r""" + Input indices used to index into the input vector. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ return _py3dna.BehaviorWriter_setBlendShapeChannelInputIndices(self, inputIndices) def setBlendShapeChannelOutputIndices(self, outputIndices): + r""" + Output indices specify the positions of blend shape output values. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ return _py3dna.BehaviorWriter_setBlendShapeChannelOutputIndices(self, outputIndices) def setAnimatedMapLODs(self, lods): + r""" + Row count per each level of detail for animated maps. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of rows (within the conditional table), + belonging to that level. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapLODs(self, lods) def setAnimatedMapInputIndices(self, inputIndices): + r""" + Input indices used to index into the array of input values. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapInputIndices(self, inputIndices) def setAnimatedMapOutputIndices(self, outputIndices): + r""" + Output indices that specify the computed output value's position. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapOutputIndices(self, outputIndices) def setAnimatedMapFromValues(self, fromValues): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not. + :type fromValues: float + :param fromValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapFromValues(self, fromValues) def setAnimatedMapToValues(self, toValues): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not. + :type toValues: float + :param toValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapToValues(self, toValues) def setAnimatedMapSlopeValues(self, slopeValues): + r""" + Computational values(slope/gradient) used for calculating the output value. + :type slopeValues: float + :param slopeValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapSlopeValues(self, slopeValues) def setAnimatedMapCutValues(self, cutValues): + r""" + Computational values(vertical intercept) used for calculating the output value. + :type cutValues: float + :param cutValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ return _py3dna.BehaviorWriter_setAnimatedMapCutValues(self, cutValues) # Register BehaviorWriter in _py3dna: _py3dna.BehaviorWriter_swigregister(BehaviorWriter) - class GeometryWriter(DefinitionWriter): + r""" + Write-only accessors for the geometry data associated with a rig. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1243,57 +3365,291 @@ class GeometryWriter(DefinitionWriter): __repr__ = _swig_repr def clearMeshes(self): + r""" Delete all meshes.""" return _py3dna.GeometryWriter_clearMeshes(self) def deleteMesh(self, meshIndex): + r""" + Delete the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_deleteMesh(self, meshIndex) def setVertexPositions(self, meshIndex, positions): + r""" + List of vertex positions. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type positions: dna::Position + :param positions: + The source address from which the vertex positions are to be copied. + :type count: int + :param count: + The number of vertex positions to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexPositions(self, meshIndex, positions) def setVertexTextureCoordinates(self, meshIndex, textureCoordinates): + r""" + List of vertex texture coordinates. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type textureCoordinates: dna::TextureCoordinate + :param textureCoordinates: + The source address from which the texture coordinates are to be copied. + :type count: int + :param count: + The number of texture coordinates to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexTextureCoordinates(self, meshIndex, textureCoordinates) def setVertexNormals(self, meshIndex, normals): + r""" + List of vertex normals. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type normals: dna::Normal + :param normals: + The source address from which the normals are to be copied. + :type count: int + :param count: + The number of normals to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexNormals(self, meshIndex, normals) def setVertexLayouts(self, meshIndex, layouts): + r""" + List of vertex layouts the belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type layouts: dna::VertexLayout + :param layouts: + The source address from which the layouts are to be copied. + :type count: int + :param count: + The number of layouts to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ return _py3dna.GeometryWriter_setVertexLayouts(self, meshIndex, layouts) def clearFaceVertexLayoutIndices(self, meshIndex): + r""" + Delete all lists of vertex layout indices for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_clearFaceVertexLayoutIndices(self, meshIndex) def setFaceVertexLayoutIndices(self, meshIndex, faceIndex, layoutIndices): + r""" + Vertex layout indices that belong to the specified face. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type faceIndex: int + :param faceIndex: + A face's position in the zero-indexed array of faces that belong to + the above referenced mesh. + :type layoutIndices: int + :param layoutIndices: + The source address from which the layout indices are to be copied. + Notes: + The layout indices point into the array that is set through setVertexLayouts + :type count: int + :param count: + The number of vertices to copy. + + Both the mesh storage itself and it's face storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + faces that are inferred from the specified indexes. + """ return _py3dna.GeometryWriter_setFaceVertexLayoutIndices(self, meshIndex, faceIndex, layoutIndices) def setMaximumInfluencePerVertex(self, meshIndex, maxInfluenceCount): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type maxInfluenceCount: int + :param maxInfluenceCount: + The maximum number of joints that may influence any single vertex. + """ return _py3dna.GeometryWriter_setMaximumInfluencePerVertex(self, meshIndex, maxInfluenceCount) def clearSkinWeights(self, meshIndex): + r""" + Delete all skin weights for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_clearSkinWeights(self, meshIndex) def setSkinWeightsValues(self, meshIndex, vertexIndex, weights): + r""" + List of skin weights influencing the referenced vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertex positions. + :type weights: float + :param weights: + The source address from which the weights are to be copied. + :type count: int + :param count: + The number of weights to copy. + Notes: + Both the mesh storage itself and it's skin weight storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + skin-weight lists that are inferred from the specified indexes. + Warning: + The sum of weights must add up to 1. + """ return _py3dna.GeometryWriter_setSkinWeightsValues(self, meshIndex, vertexIndex, weights) def setSkinWeightsJointIndices(self, meshIndex, vertexIndex, jointIndices): + r""" + List of joint indices associated with each skin weight for the specified vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertex positions. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + :type count: int + :param count: + The number of joint indices to copy. + Notes: + Both the mesh storage itself and it's joint index list storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + joint index lists that are inferred from the specified indexes. + Warning: + The joint indices must be stored in the same order as the weights they + are associated with. + """ return _py3dna.GeometryWriter_setSkinWeightsJointIndices(self, meshIndex, vertexIndex, jointIndices) def clearBlendShapeTargets(self, meshIndex): + r""" + Delete all blend shape targets for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ return _py3dna.GeometryWriter_clearBlendShapeTargets(self, meshIndex) def setBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex, blendShapeChannelIndex): + r""" + The matching blend shape channel index of the specified blend shape target. + Notes: + Associate the mesh-local blend shape target index with the absolute blend shape channel + index as found in the Definition layer. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type blendShapeChannelIndex: int + :param blendShapeChannelIndex: + The index of the specified blend shape channel in the Definition layer. + + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + """ return _py3dna.GeometryWriter_setBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex, blendShapeChannelIndex) def setBlendShapeTargetDeltas(self, meshIndex, blendShapeTargetIndex, deltas): + r""" + List of deltas for each affected vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type deltas: dna::Delta + :param deltas: + The source address from which the blend shape target deltas are to be copied. + :type count: int + :param count: + The number of blend shape target deltas to copy. + Notes: + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + """ return _py3dna.GeometryWriter_setBlendShapeTargetDeltas(self, meshIndex, blendShapeTargetIndex, deltas) def setBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex, vertexIndices): + r""" + Vertex position indices affected by the specified blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type vertexIndices: int + :param vertexIndices: + The source address from which the vertex position indices are to be copied. + :type count: int + :param count: + The number of vertex position indices to copy. + Notes: + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + Warning: + The vertex position indices must be stored in the same order as the deltas + they are associated with. + """ return _py3dna.GeometryWriter_setBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex, vertexIndices) # Register GeometryWriter in _py3dna: _py3dna.GeometryWriter_swigregister(GeometryWriter) - class Writer(BehaviorWriter, GeometryWriter): + r""" + The abstract Writer which its implementations are expected to inherit. + Notes: + This class combines the various different writer interfaces into a single interface. + The artificial separation into multiple interfaces in this case just mirrors the + structure of the Reader hierarchy, as it's not possible to selectively write only + specific layers. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -1302,11 +3658,28 @@ class Writer(BehaviorWriter, GeometryWriter): __swig_destroy__ = _py3dna.delete_Writer def setFrom(self, *args): + r""" + Initialize the Writer from the given Reader. + Notes: + This function copies all the data from the given Reader into the Writer instance, + by calling each getter function of the Reader, and passing the return values to + the matching setter functions in the Writer. + It is implemented in the abstract class itself to provide the functionality for + all DNA Writers. + :type source: :py:class:`Reader` + :param source: + The source DNA Reader from which the data needs to be copied. + :type layer: int, optional + :param layer: + Limit which layers should be taken over from the given source reader. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Optional memory resource to use for temporary allocations during copying. + """ return _py3dna.Writer_setFrom(self, *args) # Register Writer in _py3dna: _py3dna.Writer_swigregister(Writer) - class StreamWriter(Writer): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -1316,11 +3689,11 @@ class StreamWriter(Writer): __swig_destroy__ = _py3dna.delete_StreamWriter def write(self): + r""" Write data to stream from internal structures.""" return _py3dna.StreamWriter_write(self) # Register StreamWriter in _py3dna: _py3dna.StreamWriter_swigregister(StreamWriter) - class BinaryStreamWriter(StreamWriter): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -1330,22 +3703,36 @@ class BinaryStreamWriter(StreamWriter): @staticmethod def create(stream, memRes=None): + r""" + Factory method for creation of BinaryStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.BinaryStreamWriter_create(stream, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a BinaryStreamWriter instance. + :type instance: :py:class:`BinaryStreamWriter` + :param instance: + Instance of BinaryStreamWriter to be freed. + See also: create + """ return _py3dna.BinaryStreamWriter_destroy(instance) __swig_destroy__ = _py3dna.delete_BinaryStreamWriter # Register BinaryStreamWriter in _py3dna: _py3dna.BinaryStreamWriter_swigregister(BinaryStreamWriter) - -def BinaryStreamWriter_create(stream, memRes=None): - return _py3dna.BinaryStreamWriter_create(stream, memRes) - -def BinaryStreamWriter_destroy(instance): - return _py3dna.BinaryStreamWriter_destroy(instance) - class JSONStreamWriter(StreamWriter): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -1355,35 +3742,121 @@ class JSONStreamWriter(StreamWriter): @staticmethod def create(stream, indentWidth=4, memRes=None): + r""" + Factory method for creation of JSONStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type indentWidth: int, optional + :param indentWidth: + Number of spaces to use for indentation. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ return _py3dna.JSONStreamWriter_create(stream, indentWidth, memRes) @staticmethod def destroy(instance): + r""" + Method for freeing a JSONStreamWriter instance. + :type instance: :py:class:`JSONStreamWriter` + :param instance: + Instance of JSONStreamWriter to be freed. + See also: create + """ return _py3dna.JSONStreamWriter_destroy(instance) __swig_destroy__ = _py3dna.delete_JSONStreamWriter # Register JSONStreamWriter in _py3dna: _py3dna.JSONStreamWriter_swigregister(JSONStreamWriter) -def JSONStreamWriter_create(stream, indentWidth=4, memRes=None): - return _py3dna.JSONStreamWriter_create(stream, indentWidth, memRes) +BinaryStreamWriterImpl = BinaryStreamWriter -def JSONStreamWriter_destroy(instance): - return _py3dna.JSONStreamWriter_destroy(instance) +class BinaryStreamWriterImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(BinaryStreamWriterImpl, name) + + def __dir__(cls): + return [name for name in dir(BinaryStreamWriterImpl) if name not in ("create","destroy")] + +class BinaryStreamWriter(with_metaclass(BinaryStreamWriterImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = BinaryStreamWriterImpl.create(*args, **kwargs) + + def __del__(self): + BinaryStreamWriterImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] -BinaryStreamWriter.__new__ = __new_decorator(BinaryStreamWriter_create, BinaryStreamWriter.__new__) -BinaryStreamWriter.__del__ = lambda instance: BinaryStreamWriter_destroy(instance) -BinaryStreamWriter.__init__ = __managed_init -del BinaryStreamWriter.create -del BinaryStreamWriter.destroy - - -JSONStreamWriter.__new__ = __new_decorator(JSONStreamWriter_create, JSONStreamWriter.__new__) -JSONStreamWriter.__del__ = lambda instance: JSONStreamWriter_destroy(instance) -JSONStreamWriter.__init__ = __managed_init -del JSONStreamWriter.create -del JSONStreamWriter.destroy - +JSONStreamWriterImpl = JSONStreamWriter + +class JSONStreamWriterImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(JSONStreamWriterImpl, name) + + def __dir__(cls): + return [name for name in dir(JSONStreamWriterImpl) if name not in ("create","destroy")] + +class JSONStreamWriter(with_metaclass(JSONStreamWriterImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = JSONStreamWriterImpl.create(*args, **kwargs) + + def __del__(self): + JSONStreamWriterImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] diff --git a/lib/Maya2023/windows/dnacalib.dll b/lib/Maya2023/windows/dnacalib.dll index 899230e..ce8a943 100644 Binary files a/lib/Maya2023/windows/dnacalib.dll and b/lib/Maya2023/windows/dnacalib.dll differ diff --git a/lib/Maya2023/windows/dnacalib.py b/lib/Maya2023/windows/dnacalib.py index 8e4eca3..49cf7ee 100644 --- a/lib/Maya2023/windows/dnacalib.py +++ b/lib/Maya2023/windows/dnacalib.py @@ -1,13 +1,22 @@ -# This file was automatically generated by SWIG (http://www.swig.org). -# Version 4.0.1 +# This file was automatically generated by SWIG (https://www.swig.org). +# Version 4.1.1 # -# Do not make changes to this file unless you know what you are doing--modify +# Do not make changes to this file unless you know what you are doing - modify # the SWIG interface file instead. -from sys import version_info as _swig_python_version_info -if _swig_python_version_info < (2, 7, 0): - raise RuntimeError("Python 2.7 or later required") +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass + + + +from sys import version_info as _swig_python_version_info # Import the low-level C/C++ module if __package__ or "." in __name__: from . import _py3dnacalib @@ -29,10 +38,10 @@ def _swig_repr(self): def _swig_setattr_nondynamic_instance_variable(set): def set_instance_attr(self, name, value): - if name == "thisown": - self.this.own(value) - elif name == "this": + if name == "this": set(self, name, value) + elif name == "thisown": + self.this.own(value) elif hasattr(self, name) and isinstance(getattr(type(self), name), property): set(self, name, value) else: @@ -62,20 +71,16 @@ class _SwigNonDynamicMeta(type): -def __new_decorator(factory_func, original_new): - @staticmethod - def __new(cls, *args, **kwargs): -# FIXME: while this workaround solves the immediate issue with the set of classes we currently have, -# it will fail for classes that use a factory function but need no parameters at all, in which case -# the factory function will never be invoked, only the original __new__ function. - if args or kwargs: - return factory_func(*args, **kwargs) - return original_new(cls) - return __new +def with_metaclass(meta, *bases): + class metaclass(type): -def __managed_init(self, *args, **kwargs): - self._args = args - self._kwargs = kwargs + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) import dna class VersionInfo(object): @@ -104,19 +109,6 @@ class VersionInfo(object): # Register VersionInfo in _py3dnacalib: _py3dnacalib.VersionInfo_swigregister(VersionInfo) - -def VersionInfo_getMajorVersion(): - return _py3dnacalib.VersionInfo_getMajorVersion() - -def VersionInfo_getMinorVersion(): - return _py3dnacalib.VersionInfo_getMinorVersion() - -def VersionInfo_getPatchVersion(): - return _py3dnacalib.VersionInfo_getPatchVersion() - -def VersionInfo_getVersionString(): - return _py3dnacalib.VersionInfo_getVersionString() - class DNACalibDNAReader(dna.Reader): thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") @@ -135,20 +127,50 @@ class DNACalibDNAReader(dna.Reader): # Register DNACalibDNAReader in _py3dnacalib: _py3dnacalib.DNACalibDNAReader_swigregister(DNACalibDNAReader) -def DNACalibDNAReader_create(*args): - return _py3dnacalib.DNACalibDNAReader_create(*args) +DNACalibDNAReaderImpl = DNACalibDNAReader -def DNACalibDNAReader_destroy(instance): - return _py3dnacalib.DNACalibDNAReader_destroy(instance) +class DNACalibDNAReaderImplReflectionMixin(type): + def __getattr__(cls, name): + return getattr(DNACalibDNAReaderImpl, name) -DNACalibDNAReader.__new__ = __new_decorator(DNACalibDNAReader_create, DNACalibDNAReader.__new__) -DNACalibDNAReader.__del__ = lambda instance: DNACalibDNAReader_destroy(instance) -DNACalibDNAReader.__init__ = __managed_init -del DNACalibDNAReader.create -del DNACalibDNAReader.destroy + def __dir__(cls): + return [name for name in dir(DNACalibDNAReaderImpl) if name not in ("create","destroy")] + +class DNACalibDNAReader(with_metaclass(DNACalibDNAReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = DNACalibDNAReaderImpl.create(*args, **kwargs) + + def __del__(self): + DNACalibDNAReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] class Command(object): + r""" Command is an abstract class whose implementations are expected to modify the DNA provided in the run() method in some way.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") def __init__(self, *args, **kwargs): @@ -161,12 +183,19 @@ class Command(object): # Register Command in _py3dnacalib: _py3dnacalib.Command_swigregister(Command) - VectorOperation_Interpolate = _py3dnacalib.VectorOperation_Interpolate VectorOperation_Add = _py3dnacalib.VectorOperation_Add VectorOperation_Subtract = _py3dnacalib.VectorOperation_Subtract VectorOperation_Multiply = _py3dnacalib.VectorOperation_Multiply class CommandSequence(Command): + r""" + CommandSequence is used to run a sequence of commands on the same DNA. + Notes: + Commands will be run in the order in which they were added to the sequence. + + CommandSequence holds pointers to commands, but does not own them. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_CommandSequence @@ -178,21 +207,39 @@ class CommandSequence(Command): return _py3dnacalib.CommandSequence_run(self, output) def add(self, command): + r""" + Method for adding a command to a sequence of commands to run. + :type command: :py:class:`Command` + :param command: + The command to add. + """ return _py3dnacalib.CommandSequence_add(self, command) def remove(self, command): + r""" + Method for removing a command from the sequence of commands to run. + :type command: :py:class:`Command` + :param command: + The command to remove. + """ return _py3dnacalib.CommandSequence_remove(self, command) def contains(self, command): + r""" + Method for checking if the provided command is part of the command sequence. + :type command: :py:class:`Command` + :param command: + The command to check. + """ return _py3dnacalib.CommandSequence_contains(self, command) def size(self): + r""" Number of commands in command sequence.""" return _py3dnacalib.CommandSequence_size(self) # Register CommandSequence in _py3dnacalib: _py3dnacalib.CommandSequence_swigregister(CommandSequence) - def command_sequence_init(_init): def wrapper(self, *args, **kwargs): self._commands = [] @@ -216,6 +263,12 @@ CommandSequence.add = command_sequence_add(CommandSequence.add) CommandSequence.remove = command_sequence_remove(CommandSequence.remove) class CalculateMeshLowerLODsCommand(Command): + r""" + CalculateMeshLowerLODsCommand is used to recalculate vertex positions for lower LOD meshes of the specified mesh. + Notes: + The calculation is done based on vertex positions of the specified mesh and vertex texture coordinates of its lower LOD meshes. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_CalculateMeshLowerLODsCommand @@ -224,6 +277,12 @@ class CalculateMeshLowerLODsCommand(Command): _py3dnacalib.CalculateMeshLowerLODsCommand_swiginit(self, _py3dnacalib.new_CalculateMeshLowerLODsCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to calculate lower LOD meshes from. + :type meshIndex: int + :param meshIndex: + The index of the mesh. + """ return _py3dnacalib.CalculateMeshLowerLODsCommand_setMeshIndex(self, meshIndex) def run(self, output): @@ -231,8 +290,12 @@ class CalculateMeshLowerLODsCommand(Command): # Register CalculateMeshLowerLODsCommand in _py3dnacalib: _py3dnacalib.CalculateMeshLowerLODsCommand_swigregister(CalculateMeshLowerLODsCommand) - class ClearBlendShapesCommand(Command): + r""" + ClearBlendShapesCommand is used to clear all blend shapes data from a DNA. + Notes: This command clears blend shape target deltas and blend shape animation data. By doing so, it transforms the DNA to be "joints only". + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_ClearBlendShapesCommand @@ -245,8 +308,9 @@ class ClearBlendShapesCommand(Command): # Register ClearBlendShapesCommand in _py3dnacalib: _py3dnacalib.ClearBlendShapesCommand_swigregister(ClearBlendShapesCommand) - class PruneBlendShapeTargetsCommand(Command): + r""" PruneBlendShapeTargetsCommand is used to prune blend shape target deltas whose absolute magnitude is less than or equal to the specified threshold.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_PruneBlendShapeTargetsCommand @@ -255,6 +319,12 @@ class PruneBlendShapeTargetsCommand(Command): _py3dnacalib.PruneBlendShapeTargetsCommand_swiginit(self, _py3dnacalib.new_PruneBlendShapeTargetsCommand(*args)) def setThreshold(self, threshold): + r""" + Method for setting the threshold for pruning blend shape target deltas. + :type threshold: float + :param threshold: + The threshold to use. + """ return _py3dnacalib.PruneBlendShapeTargetsCommand_setThreshold(self, threshold) def run(self, output): @@ -262,8 +332,9 @@ class PruneBlendShapeTargetsCommand(Command): # Register PruneBlendShapeTargetsCommand in _py3dnacalib: _py3dnacalib.PruneBlendShapeTargetsCommand_swigregister(PruneBlendShapeTargetsCommand) - class RemoveAnimatedMapCommand(Command): + r""" RemoveAnimatedMapCommand is used to remove animated maps.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveAnimatedMapCommand @@ -272,9 +343,23 @@ class RemoveAnimatedMapCommand(Command): _py3dnacalib.RemoveAnimatedMapCommand_swiginit(self, _py3dnacalib.new_RemoveAnimatedMapCommand(*args)) def setAnimatedMapIndex(self, animatedMapIndex): + r""" + Method for setting the index of the animated map to remove. + :type animatedMapIndex: int + :param animatedMapIndex: + The index of the animated map. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set animated map(s) will be removed. + """ return _py3dnacalib.RemoveAnimatedMapCommand_setAnimatedMapIndex(self, animatedMapIndex) def setAnimatedMapIndices(self, animatedMapIndices): + r""" + Method for setting the indices of animated maps to remove. + :type animatedMapIndices: dnac::ConstArrayView< std::uint16_t > + :param animatedMapIndices: + The animated map indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set animated map(s) will be removed. + """ return _py3dnacalib.RemoveAnimatedMapCommand_setAnimatedMapIndices(self, animatedMapIndices) def run(self, output): @@ -282,8 +367,9 @@ class RemoveAnimatedMapCommand(Command): # Register RemoveAnimatedMapCommand in _py3dnacalib: _py3dnacalib.RemoveAnimatedMapCommand_swigregister(RemoveAnimatedMapCommand) - class RemoveBlendShapeCommand(Command): + r""" RemoveBlendShapeCommand is used to remove blend shapes.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveBlendShapeCommand @@ -292,9 +378,23 @@ class RemoveBlendShapeCommand(Command): _py3dnacalib.RemoveBlendShapeCommand_swiginit(self, _py3dnacalib.new_RemoveBlendShapeCommand(*args)) def setBlendShapeIndex(self, blendShapeIndex): + r""" + Method for setting the index of the blend shape to remove. + :type blendShapeIndex: int + :param blendShapeIndex: + The index of the blend shape. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set blend shape(s) will be removed. + """ return _py3dnacalib.RemoveBlendShapeCommand_setBlendShapeIndex(self, blendShapeIndex) def setBlendShapeIndices(self, blendShapeIndices): + r""" + Method for setting the indices of blend shapes to remove. + :type blendShapeIndices: dnac::ConstArrayView< std::uint16_t > + :param blendShapeIndices: + The blend shape indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set blend shape(s) will be removed. + """ return _py3dnacalib.RemoveBlendShapeCommand_setBlendShapeIndices(self, blendShapeIndices) def run(self, output): @@ -302,8 +402,9 @@ class RemoveBlendShapeCommand(Command): # Register RemoveBlendShapeCommand in _py3dnacalib: _py3dnacalib.RemoveBlendShapeCommand_swigregister(RemoveBlendShapeCommand) - class RemoveJointAnimationCommand(Command): + r""" RemoveJointAnimationCommand is used to remove joint animation data.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveJointAnimationCommand @@ -312,9 +413,23 @@ class RemoveJointAnimationCommand(Command): _py3dnacalib.RemoveJointAnimationCommand_swiginit(self, _py3dnacalib.new_RemoveJointAnimationCommand(*args)) def setJointIndex(self, jointIndex): + r""" + Method for setting the index of a joint whose animation data to remove. + :type jointIndex: int + :param jointIndex: + The index of the joint. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint animation(s) will be removed. + """ return _py3dnacalib.RemoveJointAnimationCommand_setJointIndex(self, jointIndex) def setJointIndices(self, jointIndices): + r""" + Method for setting the indices of joints whose animation data to remove. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + The joint indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint animation(s) will be removed. + """ return _py3dnacalib.RemoveJointAnimationCommand_setJointIndices(self, jointIndices) def run(self, output): @@ -322,8 +437,9 @@ class RemoveJointAnimationCommand(Command): # Register RemoveJointAnimationCommand in _py3dnacalib: _py3dnacalib.RemoveJointAnimationCommand_swigregister(RemoveJointAnimationCommand) - class RemoveJointCommand(Command): + r""" RemoveJointCommand is used to remove joints.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveJointCommand @@ -332,9 +448,23 @@ class RemoveJointCommand(Command): _py3dnacalib.RemoveJointCommand_swiginit(self, _py3dnacalib.new_RemoveJointCommand(*args)) def setJointIndex(self, jointIndex): + r""" + Method for setting the index of the joint to remove. + :type jointIndex: int + :param jointIndex: + The index of the joint. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint(s) will be removed. + """ return _py3dnacalib.RemoveJointCommand_setJointIndex(self, jointIndex) def setJointIndices(self, jointIndices): + r""" + Method for setting the indices of joints to remove. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + The joint indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint(s) will be removed. + """ return _py3dnacalib.RemoveJointCommand_setJointIndices(self, jointIndices) def run(self, output): @@ -342,8 +472,9 @@ class RemoveJointCommand(Command): # Register RemoveJointCommand in _py3dnacalib: _py3dnacalib.RemoveJointCommand_swigregister(RemoveJointCommand) - class RemoveMeshCommand(Command): + r""" RemoveMeshCommand is used to remove meshes.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RemoveMeshCommand @@ -352,9 +483,22 @@ class RemoveMeshCommand(Command): _py3dnacalib.RemoveMeshCommand_swiginit(self, _py3dnacalib.new_RemoveMeshCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to remove. + :type meshIndex: int + :param meshIndex: + The index of the mesh. + """ return _py3dnacalib.RemoveMeshCommand_setMeshIndex(self, meshIndex) def setMeshIndices(self, meshIndices): + r""" + Method for setting the indices of meshes to remove. + :type meshIndices: dnac::ConstArrayView< std::uint16_t > + :param meshIndices: + The mesh indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set mesh(es) will be removed. + """ return _py3dnacalib.RemoveMeshCommand_setMeshIndices(self, meshIndices) def run(self, output): @@ -362,8 +506,9 @@ class RemoveMeshCommand(Command): # Register RemoveMeshCommand in _py3dnacalib: _py3dnacalib.RemoveMeshCommand_swigregister(RemoveMeshCommand) - class RenameAnimatedMapCommand(Command): + r""" RenameAnimatedMapCommand is used to rename an animated map.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameAnimatedMapCommand @@ -372,6 +517,31 @@ class RenameAnimatedMapCommand(Command): _py3dnacalib.RenameAnimatedMapCommand_swiginit(self, _py3dnacalib.new_RenameAnimatedMapCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for animated map with given index. + :type animatedMapIndex: int + :param animatedMapIndex: + The index of the animated map whose name to change. + :type newName: string + :param newName: + The new name for the animated map. + + | + + *Overload 2:* + + Method for setting a new name for animated map with given name. + Notes: + The renaming will not happen if there is no animated map with given current name. + :type oldName: string + :param oldName: + The current name of the animated map whose name to change. + :type newName: string + :param newName: + The new name for the animated map. + """ return _py3dnacalib.RenameAnimatedMapCommand_setName(self, *args) def run(self, output): @@ -379,8 +549,9 @@ class RenameAnimatedMapCommand(Command): # Register RenameAnimatedMapCommand in _py3dnacalib: _py3dnacalib.RenameAnimatedMapCommand_swigregister(RenameAnimatedMapCommand) - class RenameBlendShapeCommand(Command): + r""" RenameBlendShapeCommand is used to rename a blend shape channel.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameBlendShapeCommand @@ -389,6 +560,31 @@ class RenameBlendShapeCommand(Command): _py3dnacalib.RenameBlendShapeCommand_swiginit(self, _py3dnacalib.new_RenameBlendShapeCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for blend shape channel with given index. + :type blendShapeIndex: int + :param blendShapeIndex: + The index of the blend shape channel whose name to change. + :type newName: string + :param newName: + The new name for the blend shape channel. + + | + + *Overload 2:* + + Method for setting a new name for blend shape channel with given name. + Notes: + The renaming will not happen if there is no blend shape channel with given current name. + :type oldName: string + :param oldName: + The current name of the blend shape channel whose name to change. + :type newName: string + :param newName: + The new name for the blend shape channel. + """ return _py3dnacalib.RenameBlendShapeCommand_setName(self, *args) def run(self, output): @@ -396,8 +592,9 @@ class RenameBlendShapeCommand(Command): # Register RenameBlendShapeCommand in _py3dnacalib: _py3dnacalib.RenameBlendShapeCommand_swigregister(RenameBlendShapeCommand) - class RenameJointCommand(Command): + r""" RenameJointCommand is used to rename a joint.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameJointCommand @@ -406,6 +603,31 @@ class RenameJointCommand(Command): _py3dnacalib.RenameJointCommand_swiginit(self, _py3dnacalib.new_RenameJointCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for joint with given index. + :type jointIndex: int + :param jointIndex: + The index of the joint whose name to change. + :type newName: string + :param newName: + The new name for the joint. + + | + + *Overload 2:* + + Method for setting a new name for joint with given name. + Notes: + The renaming will not happen if there is no joint with given current name. + :type oldName: string + :param oldName: + The current name of the joint whose name to change. + :type newName: string + :param newName: + The new name for the joint. + """ return _py3dnacalib.RenameJointCommand_setName(self, *args) def run(self, output): @@ -413,8 +635,9 @@ class RenameJointCommand(Command): # Register RenameJointCommand in _py3dnacalib: _py3dnacalib.RenameJointCommand_swigregister(RenameJointCommand) - class RenameMeshCommand(Command): + r""" RenameMeshCommand is used to rename a mesh.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RenameMeshCommand @@ -423,6 +646,31 @@ class RenameMeshCommand(Command): _py3dnacalib.RenameMeshCommand_swiginit(self, _py3dnacalib.new_RenameMeshCommand(*args)) def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for mesh with given index. + :type meshIndex: int + :param meshIndex: + The index of the mesh whose name to change. + :type newName: string + :param newName: + The new name for the mesh. + + | + + *Overload 2:* + + Method for setting a new name for mesh with given name. + Notes: + The renaming will not happen if there is no mesh with given current name. + :type oldName: string + :param oldName: + The current name of the mesh whose name to change. + :type newName: string + :param newName: + The new name for the mesh. + """ return _py3dnacalib.RenameMeshCommand_setName(self, *args) def run(self, output): @@ -430,8 +678,15 @@ class RenameMeshCommand(Command): # Register RenameMeshCommand in _py3dnacalib: _py3dnacalib.RenameMeshCommand_swigregister(RenameMeshCommand) - class RotateCommand(Command): + r""" + RotateCommand is used to rotate neutral joints and vertex positions around given origin. + Notes: + Joint rotations are represented in parent space, so it is enough to rotate only root joints, as that rotation will be propagated to the rest of the joints. + + If the origin is not set, the assumed origin is (0, 0, 0). + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_RotateCommand @@ -440,9 +695,21 @@ class RotateCommand(Command): _py3dnacalib.RotateCommand_swiginit(self, _py3dnacalib.new_RotateCommand(*args)) def setRotation(self, degrees): + r""" + Method for setting the rotation angles. + :type degrees: dnac::Vector3 + :param degrees: + Rotation angles in degrees. + """ return _py3dnacalib.RotateCommand_setRotation(self, degrees) def setOrigin(self, origin): + r""" + Method for setting the rotation origin. + :type origin: dnac::Vector3 + :param origin: + Origin coordinates. + """ return _py3dnacalib.RotateCommand_setOrigin(self, origin) def run(self, output): @@ -450,8 +717,13 @@ class RotateCommand(Command): # Register RotateCommand in _py3dnacalib: _py3dnacalib.RotateCommand_swigregister(RotateCommand) - class ScaleCommand(Command): + r""" + ScaleCommand is used to scale neutral joints, vertex positions and joint and blendshape deltas by a factor. + Notes: + Only translation attributes of neutral joints and joint deltas are scaled. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_ScaleCommand @@ -460,9 +732,22 @@ class ScaleCommand(Command): _py3dnacalib.ScaleCommand_swiginit(self, _py3dnacalib.new_ScaleCommand(*args)) def setScale(self, scale): + r""" + Method for setting the scale factor to multiply with. + :type scale: float + :param scale: + Scale factor. + """ return _py3dnacalib.ScaleCommand_setScale(self, scale) def setOrigin(self, origin): + r""" + Method for setting the origin. + Notes: The origin is used to properly scale position values (vertex positions and neutral joint translations). + :type origin: dnac::Vector3 + :param origin: + Origin coordinates. + """ return _py3dnacalib.ScaleCommand_setOrigin(self, origin) def run(self, output): @@ -470,8 +755,9 @@ class ScaleCommand(Command): # Register ScaleCommand in _py3dnacalib: _py3dnacalib.ScaleCommand_swigregister(ScaleCommand) - class SetBlendShapeTargetDeltasCommand(Command): + r""" SetBlendShapeTargetDeltasCommand is used to change blend shape target deltas.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetBlendShapeTargetDeltasCommand @@ -480,21 +766,85 @@ class SetBlendShapeTargetDeltasCommand(Command): _py3dnacalib.SetBlendShapeTargetDeltasCommand_swiginit(self, _py3dnacalib.new_SetBlendShapeTargetDeltasCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh whose blend shape target to change. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setMeshIndex(self, meshIndex) def setBlendShapeTargetIndex(self, blendShapeTargetIndex): + r""" + Method for setting the index of the blend shape target to change. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + The blend shape target index. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setBlendShapeTargetIndex(self, blendShapeTargetIndex) def setDeltas(self, *args): + r""" + *Overload 1:* + + Method for setting the values used to calculate new deltas for blend shape target. + :type deltas: dnac::ConstArrayView< dnac::Vector3 > + :param deltas: + The values used in calculation. + + | + + *Overload 2:* + + Method for setting the values used to calculate new deltas for blend shape target. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X values for each delta. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y values for each delta. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z values for each delta. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setDeltas(self, *args) def setVertexIndices(self, vertexIndices): + r""" + Method for setting the vertex indices that correspond to new deltas. + :type vertexIndices: dnac::ConstArrayView< std::uint32_t > + :param vertexIndices: + The vertexIndices. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setVertexIndices(self, vertexIndices) def setMasks(self, masks): + r""" + Method for setting masks used to calculate new deltas for blend shape target. + Notes: + If no masks are set, default weight value of 1 is used for each delta. + :type masks: dnac::ConstArrayView< float > + :param masks: + The weights for each delta. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setMasks(self, masks) def setOperation(self, operation): + r""" + Method for setting the type of operation used to calculate new deltas for blend shape target. + Notes: + Available operations are: Interpolate, Add, Subtract and Multiply. Each delta is calculated based on the provided operation type in the following way: + + Interpolate: = previousValue * (1 - weight) + setValue * weight:math:`\n Add: \f$newValue = previousValue + (setValue * weight)` + + Subtract: = previousValue - (setValue * weight):math:`\n Multiply: \f$newValue = previousValue * (setValue * weight)` + + + setValue is the value from new deltas that were set, and weight is the value from masks array. + :type operation: int + :param operation: + The operation to use. + """ return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setOperation(self, operation) def run(self, output): @@ -509,6 +859,8 @@ SetBlendShapeTargetDeltasCommand.DeltasVertexIndicesCountMismatch = _py3dnacalib SetBlendShapeTargetDeltasCommand.DeltasMasksCountMismatch = _py3dnacalib.cvar.SetBlendShapeTargetDeltasCommand_DeltasMasksCountMismatch class SetLODsCommand(Command): + r""" SetLODsCommand is used to specify LODs to use. Joints, blend shapes, animated maps and meshes that are not in specified LODs are removed from the DNA.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetLODsCommand @@ -517,6 +869,12 @@ class SetLODsCommand(Command): _py3dnacalib.SetLODsCommand_swiginit(self, _py3dnacalib.new_SetLODsCommand(*args)) def setLODs(self, lods): + r""" + Method for setting the LODs to keep. + :type lods: dnac::ConstArrayView< std::uint16_t > + :param lods: + New LODs to be used. + """ return _py3dnacalib.SetLODsCommand_setLODs(self, lods) def run(self, output): @@ -524,8 +882,9 @@ class SetLODsCommand(Command): # Register SetLODsCommand in _py3dnacalib: _py3dnacalib.SetLODsCommand_swigregister(SetLODsCommand) - class SetNeutralJointRotationsCommand(Command): + r""" SetNeutralJointRotationsCommand is used to set new rotation values to neutral joints.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetNeutralJointRotationsCommand @@ -534,6 +893,29 @@ class SetNeutralJointRotationsCommand(Command): _py3dnacalib.SetNeutralJointRotationsCommand_swiginit(self, _py3dnacalib.new_SetNeutralJointRotationsCommand(*args)) def setRotations(self, *args): + r""" + *Overload 1:* + + Method for setting the neutral joint rotations. + :type rotations: dnac::ConstArrayView< dnac::Vector3 > + :param rotations: + Rotation values for each joint. + + | + + *Overload 2:* + + Method for setting the neutral joint rotations. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X rotation value for each joint. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y rotation value for each joint. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z rotation value for each joint. + """ return _py3dnacalib.SetNeutralJointRotationsCommand_setRotations(self, *args) def run(self, output): @@ -541,8 +923,9 @@ class SetNeutralJointRotationsCommand(Command): # Register SetNeutralJointRotationsCommand in _py3dnacalib: _py3dnacalib.SetNeutralJointRotationsCommand_swigregister(SetNeutralJointRotationsCommand) - class SetNeutralJointTranslationsCommand(Command): + r""" SetNeutralJointTranslationsCommand is used to set new translation values to neutral joints.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetNeutralJointTranslationsCommand @@ -551,6 +934,29 @@ class SetNeutralJointTranslationsCommand(Command): _py3dnacalib.SetNeutralJointTranslationsCommand_swiginit(self, _py3dnacalib.new_SetNeutralJointTranslationsCommand(*args)) def setTranslations(self, *args): + r""" + *Overload 1:* + + Method for setting the neutral joint translations. + :type translations: dnac::ConstArrayView< dnac::Vector3 > + :param translations: + Translation values for each joint. + + | + + *Overload 2:* + + Method for setting the neutral joint translations. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X translation value for each joint. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y translation value for each joint. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z translation value for each joint. + """ return _py3dnacalib.SetNeutralJointTranslationsCommand_setTranslations(self, *args) def run(self, output): @@ -558,8 +964,9 @@ class SetNeutralJointTranslationsCommand(Command): # Register SetNeutralJointTranslationsCommand in _py3dnacalib: _py3dnacalib.SetNeutralJointTranslationsCommand_swigregister(SetNeutralJointTranslationsCommand) - class SetSkinWeightsCommand(Command): + r""" SetSkinWeightsCommand is used to set new skin weights for a vertex in a mesh.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetSkinWeightsCommand @@ -568,15 +975,39 @@ class SetSkinWeightsCommand(Command): _py3dnacalib.SetSkinWeightsCommand_swiginit(self, _py3dnacalib.new_SetSkinWeightsCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the targeted mesh. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ return _py3dnacalib.SetSkinWeightsCommand_setMeshIndex(self, meshIndex) def setVertexIndex(self, vertexIndex): + r""" + Method for setting the index of the vertex to change. + :type vertexIndex: int + :param vertexIndex: + The vertex index. + """ return _py3dnacalib.SetSkinWeightsCommand_setVertexIndex(self, vertexIndex) def setWeights(self, weights): + r""" + Method for setting the weights with which joints influence the vertex in question. + :type weights: dnac::ConstArrayView< float > + :param weights: + Weights for each joint that has an influence on the vertex. + """ return _py3dnacalib.SetSkinWeightsCommand_setWeights(self, weights) def setJointIndices(self, jointIndices): + r""" + Method for setting the joint indices of joints that influence the vertex in question. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + Joint indices of joints that have an influence on the vertex. + """ return _py3dnacalib.SetSkinWeightsCommand_setJointIndices(self, jointIndices) def run(self, output): @@ -584,8 +1015,9 @@ class SetSkinWeightsCommand(Command): # Register SetSkinWeightsCommand in _py3dnacalib: _py3dnacalib.SetSkinWeightsCommand_swigregister(SetSkinWeightsCommand) - class SetVertexPositionsCommand(Command): + r""" SetVertexPositionsCommand is used to change vertex positions values.""" + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_SetVertexPositionsCommand @@ -594,15 +1026,67 @@ class SetVertexPositionsCommand(Command): _py3dnacalib.SetVertexPositionsCommand_swiginit(self, _py3dnacalib.new_SetVertexPositionsCommand(*args)) def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to change. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ return _py3dnacalib.SetVertexPositionsCommand_setMeshIndex(self, meshIndex) def setPositions(self, *args): + r""" + *Overload 1:* + + Method for setting the vertex positions used to calculate new values. + :type positions: dnac::ConstArrayView< dnac::Vector3 > + :param positions: + The vertex positions. + + | + + *Overload 2:* + + Method for setting the vertex positions used to calculate new values. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X coordinates for each vertex. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y coordinates for each vertex. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z coordinates for each vertex. + """ return _py3dnacalib.SetVertexPositionsCommand_setPositions(self, *args) def setMasks(self, masks): + r""" + Method for setting vertex masks used to calculate new vertex position values. + Notes: + If no masks are set, default weight value of 1 is used for each vertex. + :type masks: dnac::ConstArrayView< float > + :param masks: + The weights for each vertex. + """ return _py3dnacalib.SetVertexPositionsCommand_setMasks(self, masks) def setOperation(self, operation): + r""" + Method for setting the type of operation used to calculate new vertex position values. + Notes: + Available operations are: Interpolate, Add, Subtract and Multiply. Each position is calculated based on the provided operation type in the following way: + + Interpolate: = previousValue * (1 - weight) + setValue * weight:math:`\n Add: \f$newValue = previousValue + (setValue * weight)` + + Subtract: = previousValue - (setValue * weight):math:`\n Multiply: \f$newValue = previousValue * (setValue * weight)` + + + setValue is the value from new positions that were set, and weight is the value from masks array. + :type operation: int + :param operation: + The operation to use. + """ return _py3dnacalib.SetVertexPositionsCommand_setOperation(self, operation) def run(self, output): @@ -613,6 +1097,12 @@ _py3dnacalib.SetVertexPositionsCommand_swigregister(SetVertexPositionsCommand) SetVertexPositionsCommand.PositionsMasksCountMismatch = _py3dnacalib.cvar.SetVertexPositionsCommand_PositionsMasksCountMismatch class TranslateCommand(Command): + r""" + TranslateCommand is used to translate neutral joints and vertex positions. + Notes: + Joint translations are represented in parent space, so it is enough to translate only root joints, as that translation will be propagated to the rest of the joints. + """ + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") __repr__ = _swig_repr __swig_destroy__ = _py3dnacalib.delete_TranslateCommand @@ -621,6 +1111,12 @@ class TranslateCommand(Command): _py3dnacalib.TranslateCommand_swiginit(self, _py3dnacalib.new_TranslateCommand(*args)) def setTranslation(self, translation): + r""" + Method for setting the translation vector. + :type translation: dnac::Vector3 + :param translation: + The translation vector. + """ return _py3dnacalib.TranslateCommand_setTranslation(self, translation) def run(self, output): @@ -629,5 +1125,3 @@ class TranslateCommand(Command): # Register TranslateCommand in _py3dnacalib: _py3dnacalib.TranslateCommand_swigregister(TranslateCommand) - - diff --git a/lib/Maya2024/linux/MayaUERBFPlugin.mll b/lib/Maya2024/linux/MayaUERBFPlugin.mll new file mode 100644 index 0000000..d0c9816 Binary files /dev/null and b/lib/Maya2024/linux/MayaUERBFPlugin.mll differ diff --git a/lib/Maya2024/linux/_py3dna.so b/lib/Maya2024/linux/_py3dna.so new file mode 100644 index 0000000..2d781a2 Binary files /dev/null and b/lib/Maya2024/linux/_py3dna.so differ diff --git a/lib/Maya2024/linux/_py3dnacalib.so b/lib/Maya2024/linux/_py3dnacalib.so new file mode 100644 index 0000000..50ec984 Binary files /dev/null and b/lib/Maya2024/linux/_py3dnacalib.so differ diff --git a/lib/Maya2024/linux/dna.py b/lib/Maya2024/linux/dna.py new file mode 100644 index 0000000..ed8fbaa --- /dev/null +++ b/lib/Maya2024/linux/dna.py @@ -0,0 +1,4298 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 4.0.2 +# +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. + + +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass + + + +from sys import version_info as _swig_python_version_info +if _swig_python_version_info < (2, 7, 0): + raise RuntimeError("Python 2.7 or later required") + +# Import the low-level C/C++ module +if __package__ or "." in __name__: + from . import _py3dna +else: + import _py3dna + +try: + import builtins as __builtin__ +except ImportError: + import __builtin__ + +def _swig_repr(self): + try: + strthis = "proxy of " + self.this.__repr__() + except __builtin__.Exception: + strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + + +def _swig_setattr_nondynamic_instance_variable(set): + def set_instance_attr(self, name, value): + if name == "thisown": + self.this.own(value) + elif name == "this": + set(self, name, value) + elif hasattr(self, name) and isinstance(getattr(type(self), name), property): + set(self, name, value) + else: + raise AttributeError("You cannot add instance attributes to %s" % self) + return set_instance_attr + + +def _swig_setattr_nondynamic_class_variable(set): + def set_class_attr(cls, name, value): + if hasattr(cls, name) and not isinstance(getattr(cls, name), property): + set(cls, name, value) + else: + raise AttributeError("You cannot add class attributes to %s" % cls) + return set_class_attr + + +def _swig_add_metaclass(metaclass): + """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" + def wrapper(cls): + return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) + return wrapper + + +class _SwigNonDynamicMeta(type): + """Meta class to enforce nondynamic attributes (no new attributes) for a class""" + __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) + + + +def with_metaclass(meta, *bases): + class metaclass(type): + + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) + +class MemoryResource(object): + r""" + MemoryResource is an abstract class that allows the implementation of polymorphic allocators. + Notes: + It's purpose is to allow passing arbitrary allocators through API boundaries, without requiring changes in the + signatures and types involved. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_MemoryResource + + def allocate(self, size, alignment): + return _py3dna.MemoryResource_allocate(self, size, alignment) + + def deallocate(self, ptr, size, alignment): + return _py3dna.MemoryResource_deallocate(self, ptr, size, alignment) + +# Register MemoryResource in _py3dna: +_py3dna.MemoryResource_swigregister(MemoryResource) + +class AlignedMemoryResource(MemoryResource): + r""" + A MemoryResource that honors alignment requirements. + See also: MemoryResource + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def allocate(self, size, alignment): + return _py3dna.AlignedMemoryResource_allocate(self, size, alignment) + + def deallocate(self, ptr, size, alignment): + return _py3dna.AlignedMemoryResource_deallocate(self, ptr, size, alignment) + + def __init__(self): + _py3dna.AlignedMemoryResource_swiginit(self, _py3dna.new_AlignedMemoryResource()) + __swig_destroy__ = _py3dna.delete_AlignedMemoryResource + +# Register AlignedMemoryResource in _py3dna: +_py3dna.AlignedMemoryResource_swigregister(AlignedMemoryResource) + +class ArenaMemoryResource(MemoryResource): + r""" + Serves allocations from a preallocated memory region. + See also: MemoryResource + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_ArenaMemoryResource + + def __init__(self, *args): + _py3dna.ArenaMemoryResource_swiginit(self, _py3dna.new_ArenaMemoryResource(*args)) + + def allocate(self, size, alignment): + r""" All allocations will be served from the currently active memory region.""" + return _py3dna.ArenaMemoryResource_allocate(self, size, alignment) + + def deallocate(self, ptr, size, alignment): + r""" This is a no-op, and the regions are only freed when the arena itself is destroyed.""" + return _py3dna.ArenaMemoryResource_deallocate(self, ptr, size, alignment) + + def getUpstreamMemoryResource(self): + r""" The upstream memory resource was passed through the constructor and is backing all arena allocations.""" + return _py3dna.ArenaMemoryResource_getUpstreamMemoryResource(self) + +# Register ArenaMemoryResource in _py3dna: +_py3dna.ArenaMemoryResource_swigregister(ArenaMemoryResource) + +class DefaultMemoryResource(MemoryResource): + r""" + A MemoryResource that delegates to malloc / free. + See also: MemoryResource + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def allocate(self, size, alignment): + return _py3dna.DefaultMemoryResource_allocate(self, size, alignment) + + def deallocate(self, ptr, size, alignment): + return _py3dna.DefaultMemoryResource_deallocate(self, ptr, size, alignment) + + def __init__(self): + _py3dna.DefaultMemoryResource_swiginit(self, _py3dna.new_DefaultMemoryResource()) + __swig_destroy__ = _py3dna.delete_DefaultMemoryResource + +# Register DefaultMemoryResource in _py3dna: +_py3dna.DefaultMemoryResource_swigregister(DefaultMemoryResource) + +class StatusCode(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + code = property(_py3dna.StatusCode_code_get, _py3dna.StatusCode_code_set) + message = property(_py3dna.StatusCode_message_get, _py3dna.StatusCode_message_set) + + def __init__(self): + _py3dna.StatusCode_swiginit(self, _py3dna.new_StatusCode()) + __swig_destroy__ = _py3dna.delete_StatusCode + +# Register StatusCode in _py3dna: +_py3dna.StatusCode_swigregister(StatusCode) + +class Status(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + @staticmethod + def isOk(): + return _py3dna.Status_isOk() + + @staticmethod + def get(): + return _py3dna.Status_get() + + def __init__(self): + _py3dna.Status_swiginit(self, _py3dna.new_Status()) + __swig_destroy__ = _py3dna.delete_Status + +# Register Status in _py3dna: +_py3dna.Status_swigregister(Status) + +def Status_isOk(): + return _py3dna.Status_isOk() + +def Status_get(): + return _py3dna.Status_get() + +class Readable(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def read(self, *args): + r""" + *Overload 1:* + + Read bytes from stream into the given buffer. + :type destination: string + :param destination: + Destination buffer into which the data is going to be read from the stream. + :type size: std::size_t + :param size: + Number of bytes to read from stream. + :rtype: std::size_t + :return: + Number of bytes read. + + | + + *Overload 2:* + + Read bytes from this stream into the given stream. + :type destination: :py:class:`Writable` + :param destination: + Destination stream into which the data is going to be read from this stream. + :type size: std::size_t + :param size: + Number of bytes to read from stream. + :rtype: std::size_t + :return: + Number of bytes read. + """ + return _py3dna.Readable_read(self, *args) + +# Register Readable in _py3dna: +_py3dna.Readable_swigregister(Readable) + +class Writable(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def write(self, *args): + r""" + *Overload 1:* + + Writes bytes from the given buffer to the stream. + :type source: string + :param source: + Source buffer from which the data is going to be written to the stream. + :type size: std::size_t + :param size: + Number of bytes to write to the stream. + :rtype: std::size_t + :return: + Number of bytes written. + + | + + *Overload 2:* + + Writes bytes from the given stream to this stream. + :type source: :py:class:`Readable` + :param source: + Source stream from which the data is going to be written into this stream. + :type size: std::size_t + :param size: + Number of bytes to write to the stream. + :rtype: std::size_t + :return: + Number of bytes written. + """ + return _py3dna.Writable_write(self, *args) + +# Register Writable in _py3dna: +_py3dna.Writable_swigregister(Writable) + +class Seekable(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def tell(self): + r""" + Get the current position in the stream. + :rtype: int + :return: + Position in the stream relative to it's start, with 0 denoting the start position. + """ + return _py3dna.Seekable_tell(self) + + def seek(self, position): + r""" + Set the current position in the stream. + :type position: int + :param position: + Position in the stream relative to it's start, with 0 denoting the start position. + """ + return _py3dna.Seekable_seek(self, position) + +# Register Seekable in _py3dna: +_py3dna.Seekable_swigregister(Seekable) + +class Openable(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def open(self): + r""" Open access to the stream.""" + return _py3dna.Openable_open(self) + +# Register Openable in _py3dna: +_py3dna.Openable_swigregister(Openable) + +class Closeable(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def close(self): + r""" Close access to the stream.""" + return _py3dna.Closeable_close(self) + +# Register Closeable in _py3dna: +_py3dna.Closeable_swigregister(Closeable) + +class Controllable(Openable, Closeable): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + +# Register Controllable in _py3dna: +_py3dna.Controllable_swigregister(Controllable) + +class Bounded(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def size(self): + r""" + Obtain size of stream in bytes. + :rtype: int + :return: + Size in bytes. + """ + return _py3dna.Bounded_size(self) + +# Register Bounded in _py3dna: +_py3dna.Bounded_swigregister(Bounded) + +class Buffered(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def flush(self): + r""" Flush the changes to filesystem.""" + return _py3dna.Buffered_flush(self) + +# Register Buffered in _py3dna: +_py3dna.Buffered_swigregister(Buffered) + +class Resizable(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def resize(self, size): + r""" Resize file to the requested size.""" + return _py3dna.Resizable_resize(self, size) + +# Register Resizable in _py3dna: +_py3dna.Resizable_swigregister(Resizable) + +class BoundedIOStream(Controllable, Readable, Writable, Seekable, Bounded): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_BoundedIOStream + +# Register BoundedIOStream in _py3dna: +_py3dna.BoundedIOStream_swigregister(BoundedIOStream) +cvar = _py3dna.cvar +BoundedIOStream.OpenError = _py3dna.cvar.BoundedIOStream_OpenError +BoundedIOStream.ReadError = _py3dna.cvar.BoundedIOStream_ReadError +BoundedIOStream.WriteError = _py3dna.cvar.BoundedIOStream_WriteError +BoundedIOStream.AlreadyOpenError = _py3dna.cvar.BoundedIOStream_AlreadyOpenError +BoundedIOStream.SeekError = _py3dna.cvar.BoundedIOStream_SeekError + +AccessMode_Read = _py3dna.AccessMode_Read +AccessMode_Write = _py3dna.AccessMode_Write +AccessMode_ReadWrite = _py3dna.AccessMode_ReadWrite +OpenMode_Binary = _py3dna.OpenMode_Binary +OpenMode_Text = _py3dna.OpenMode_Text +class FileStream(BoundedIOStream): + r""" Standard file stream.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(path, accessMode, openMode, memRes=None): + r""" + Factory method for creation of a FileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type openMode: int + :param openMode: + Control whether the file is opened in binary or textual mode. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the FileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.FileStream_create(path, accessMode, openMode, memRes) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a FileStream instance. + :type instance: :py:class:`FileStream` + :param instance: + Instance of FileStream to be freed. + See also: create + """ + return _py3dna.FileStream_destroy(instance) + __swig_destroy__ = _py3dna.delete_FileStream + +# Register FileStream in _py3dna: +_py3dna.FileStream_swigregister(FileStream) + +def FileStream_create(path, accessMode, openMode, memRes=None): + r""" + Factory method for creation of a FileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type openMode: int + :param openMode: + Control whether the file is opened in binary or textual mode. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the FileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.FileStream_create(path, accessMode, openMode, memRes) + +def FileStream_destroy(instance): + r""" + Method for freeing a FileStream instance. + :type instance: :py:class:`FileStream` + :param instance: + Instance of FileStream to be freed. + See also: create + """ + return _py3dna.FileStream_destroy(instance) + +class MemoryMappedFileStream(BoundedIOStream, Buffered, Resizable): + r""" Memory mapped file stream.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(path, accessMode, memRes=None): + r""" + Factory method for creation of a MemoryMappedFileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryMappedFileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.MemoryMappedFileStream_create(path, accessMode, memRes) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a MemoryMappedFileStream instance. + :type instance: :py:class:`MemoryMappedFileStream` + :param instance: + Instance of MemoryMappedFileStream to be freed. + See also: create + """ + return _py3dna.MemoryMappedFileStream_destroy(instance) + __swig_destroy__ = _py3dna.delete_MemoryMappedFileStream + +# Register MemoryMappedFileStream in _py3dna: +_py3dna.MemoryMappedFileStream_swigregister(MemoryMappedFileStream) + +def MemoryMappedFileStream_create(path, accessMode, memRes=None): + r""" + Factory method for creation of a MemoryMappedFileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryMappedFileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.MemoryMappedFileStream_create(path, accessMode, memRes) + +def MemoryMappedFileStream_destroy(instance): + r""" + Method for freeing a MemoryMappedFileStream instance. + :type instance: :py:class:`MemoryMappedFileStream` + :param instance: + Instance of MemoryMappedFileStream to be freed. + See also: create + """ + return _py3dna.MemoryMappedFileStream_destroy(instance) + +class MemoryStream(BoundedIOStream): + r""" In-memory stream.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(*args): + r""" + *Overload 1:* + + Factory method for creation of a MemoryStream instance. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.MemoryStream_create(*args) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a MemoryStream instance. + :type instance: :py:class:`MemoryStream` + :param instance: + Instance of MemoryStream to be freed. + See also: create + """ + return _py3dna.MemoryStream_destroy(instance) + __swig_destroy__ = _py3dna.delete_MemoryStream + +# Register MemoryStream in _py3dna: +_py3dna.MemoryStream_swigregister(MemoryStream) + +def MemoryStream_create(*args): + r""" + *Overload 1:* + + Factory method for creation of a MemoryStream instance. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.MemoryStream_create(*args) + +def MemoryStream_destroy(instance): + r""" + Method for freeing a MemoryStream instance. + :type instance: :py:class:`MemoryStream` + :param instance: + Instance of MemoryStream to be freed. + See also: create + """ + return _py3dna.MemoryStream_destroy(instance) + + +FileStreamImpl = FileStream + +class FileStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(FileStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(FileStreamImpl) if name not in ("create","destroy")] + +class FileStream(with_metaclass(FileStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = FileStreamImpl.create(*args, **kwargs) + + def __del__(self): + FileStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + + +MemoryMappedFileStreamImpl = MemoryMappedFileStream + +class MemoryMappedFileStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(MemoryMappedFileStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(MemoryMappedFileStreamImpl) if name not in ("create","destroy")] + +class MemoryMappedFileStream(with_metaclass(MemoryMappedFileStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = MemoryMappedFileStreamImpl.create(*args, **kwargs) + + def __del__(self): + MemoryMappedFileStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + + +MemoryStreamImpl = MemoryStream + +class MemoryStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(MemoryStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(MemoryStreamImpl) if name not in ("create","destroy")] + +class MemoryStream(with_metaclass(MemoryStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = MemoryStreamImpl.create(*args, **kwargs) + + def __del__(self): + MemoryStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + + +FileStream.AccessMode_Read = AccessMode_Read +FileStream.AccessMode_Write = AccessMode_Write +FileStream.AccessMode_ReadWrite = AccessMode_ReadWrite + +FileStream.OpenMode_Binary = OpenMode_Binary +FileStream.OpenMode_Text = OpenMode_Text + +MemoryMappedFileStream.AccessMode_Read = AccessMode_Read +MemoryMappedFileStream.AccessMode_Write = AccessMode_Write +MemoryMappedFileStream.AccessMode_ReadWrite = AccessMode_ReadWrite + +class StringView(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def c_str(self): + return _py3dna.StringView_c_str(self) + + def __ref__(self): + return _py3dna.StringView___ref__(self) + + def __init__(self): + _py3dna.StringView_swiginit(self, _py3dna.new_StringView()) + __swig_destroy__ = _py3dna.delete_StringView + +# Register StringView in _py3dna: +_py3dna.StringView_swigregister(StringView) + + +def __add__(*args): + return _py3dna.__add__(*args) + +def __sub__(*args): + return _py3dna.__sub__(*args) + +def __mul__(*args): + return _py3dna.__mul__(*args) + +def __truediv__(*args): + return _py3dna.__truediv__(*args) + +def __eq__(lhs, rhs): + return _py3dna.__eq__(lhs, rhs) + +def __ne__(lhs, rhs): + return _py3dna.__ne__(lhs, rhs) +DataLayer_Descriptor = _py3dna.DataLayer_Descriptor +DataLayer_Definition = _py3dna.DataLayer_Definition +DataLayer_Behavior = _py3dna.DataLayer_Behavior +DataLayer_Geometry = _py3dna.DataLayer_Geometry +DataLayer_GeometryWithoutBlendShapes = _py3dna.DataLayer_GeometryWithoutBlendShapes +DataLayer_AllWithoutBlendShapes = _py3dna.DataLayer_AllWithoutBlendShapes +DataLayer_All = _py3dna.DataLayer_All +Archetype_asian = _py3dna.Archetype_asian +Archetype_black = _py3dna.Archetype_black +Archetype_caucasian = _py3dna.Archetype_caucasian +Archetype_hispanic = _py3dna.Archetype_hispanic +Archetype_alien = _py3dna.Archetype_alien +Archetype_other = _py3dna.Archetype_other +Gender_male = _py3dna.Gender_male +Gender_female = _py3dna.Gender_female +Gender_other = _py3dna.Gender_other +TranslationUnit_cm = _py3dna.TranslationUnit_cm +TranslationUnit_m = _py3dna.TranslationUnit_m +RotationUnit_degrees = _py3dna.RotationUnit_degrees +RotationUnit_radians = _py3dna.RotationUnit_radians +Direction_left = _py3dna.Direction_left +Direction_right = _py3dna.Direction_right +Direction_up = _py3dna.Direction_up +Direction_down = _py3dna.Direction_down +Direction_front = _py3dna.Direction_front +Direction_back = _py3dna.Direction_back +class CoordinateSystem(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + xAxis = property(_py3dna.CoordinateSystem_xAxis_get, _py3dna.CoordinateSystem_xAxis_set) + yAxis = property(_py3dna.CoordinateSystem_yAxis_get, _py3dna.CoordinateSystem_yAxis_set) + zAxis = property(_py3dna.CoordinateSystem_zAxis_get, _py3dna.CoordinateSystem_zAxis_set) + + def __init__(self): + _py3dna.CoordinateSystem_swiginit(self, _py3dna.new_CoordinateSystem()) + __swig_destroy__ = _py3dna.delete_CoordinateSystem + +# Register CoordinateSystem in _py3dna: +_py3dna.CoordinateSystem_swigregister(CoordinateSystem) + +class DescriptorReader(object): + r""" + Read-only accessors for various metadata about the character and the rig. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def getName(self): + return _py3dna.DescriptorReader_getName(self) + + def getArchetype(self): + return _py3dna.DescriptorReader_getArchetype(self) + + def getGender(self): + return _py3dna.DescriptorReader_getGender(self) + + def getAge(self): + return _py3dna.DescriptorReader_getAge(self) + + def getMetaDataCount(self): + return _py3dna.DescriptorReader_getMetaDataCount(self) + + def getMetaDataKey(self, index): + r""" + :type index: int + :param index: + A position in the zero-indexed array of key-value pairs. + Warning: + The index must be less than the value returned by getMetaDataCount. + :rtype: :py:class:`StringView` + :return: View over the key name string. + """ + return _py3dna.DescriptorReader_getMetaDataKey(self, index) + + def getMetaDataValue(self, key): + r""" + Stored metadata value associated with the given key. + Notes: + If no value is associated with the given key, the returned view + will contain nullptr and will have a size of 0. + :type key: string + :param key: + A unique-known key that has a value associated to it. + Warning: + The key must be null-terminated. + :rtype: :py:class:`StringView` + :return: View over the metadata value string. + """ + return _py3dna.DescriptorReader_getMetaDataValue(self, key) + + def getTranslationUnit(self): + return _py3dna.DescriptorReader_getTranslationUnit(self) + + def getRotationUnit(self): + return _py3dna.DescriptorReader_getRotationUnit(self) + + def getCoordinateSystem(self): + return _py3dna.DescriptorReader_getCoordinateSystem(self) + + def getLODCount(self): + r""" + Available levels of detail (e.g. 6 which means the following levels are available: + [0,1,2,3,4,5], where 0 is the LOD with the highest details, and 5 is the LOD with + lowest details). + """ + return _py3dna.DescriptorReader_getLODCount(self) + + def getDBMaxLOD(self): + r""" + The maximum level of detail stored in the DNA data for this character. + Notes: + The value is relative to LOD-0 from the database. + """ + return _py3dna.DescriptorReader_getDBMaxLOD(self) + + def getDBComplexity(self): + r""" + Name of the input control interface used to drive this character rig. + Notes: + This parameter denotes the character's input control complexity. + """ + return _py3dna.DescriptorReader_getDBComplexity(self) + + def getDBName(self): + r""" + Name of the database from which the character originates. + Notes: + All characters from the same database must have the same Definition, but may + have different complexity or LOD. + """ + return _py3dna.DescriptorReader_getDBName(self) + +# Register DescriptorReader in _py3dna: +_py3dna.DescriptorReader_swigregister(DescriptorReader) + +class MeshBlendShapeChannelMapping(object): + r""" Mapping that associates a blend shape channel to it's mesh.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + meshIndex = property(_py3dna.MeshBlendShapeChannelMapping_meshIndex_get, _py3dna.MeshBlendShapeChannelMapping_meshIndex_set) + blendShapeChannelIndex = property(_py3dna.MeshBlendShapeChannelMapping_blendShapeChannelIndex_get, _py3dna.MeshBlendShapeChannelMapping_blendShapeChannelIndex_set) + + def __init__(self): + _py3dna.MeshBlendShapeChannelMapping_swiginit(self, _py3dna.new_MeshBlendShapeChannelMapping()) + __swig_destroy__ = _py3dna.delete_MeshBlendShapeChannelMapping + +# Register MeshBlendShapeChannelMapping in _py3dna: +_py3dna.MeshBlendShapeChannelMapping_swigregister(MeshBlendShapeChannelMapping) + +class DefinitionReader(DescriptorReader): + r""" + Read-only accessors for DNA attributes that represent the rig's static data. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def getGUIControlCount(self): + return _py3dna.DefinitionReader_getGUIControlCount(self) + + def getGUIControlName(self, index): + r""" + Name of the requested GUI control. + :type index: int + :param index: + A name's position in the zero-indexed array of GUI control names. + Warning: + The index must be less than the value returned by getGUIControlCount. + :rtype: :py:class:`StringView` + :return: View over the GUI control name string. + """ + return _py3dna.DefinitionReader_getGUIControlName(self, index) + + def getRawControlCount(self): + return _py3dna.DefinitionReader_getRawControlCount(self) + + def getRawControlName(self, index): + r""" + Name of the requested raw control. + :type index: int + :param index: + A name's position in the zero-indexed array of raw control names. + Warning: + The index must be less than the value returned by getRawControlCount. + :rtype: :py:class:`StringView` + :return: View over the control name string. + """ + return _py3dna.DefinitionReader_getRawControlName(self, index) + + def getJointCount(self): + return _py3dna.DefinitionReader_getJointCount(self) + + def getJointName(self, index): + r""" + Name of the requested joint. + :type index: int + :param index: + A name's position in the zero-indexed array of joint names. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: :py:class:`StringView` + :return: View over the joint name string. + """ + return _py3dna.DefinitionReader_getJointName(self, index) + + def getJointIndexListCount(self): + r""" + Number of joint index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ + return _py3dna.DefinitionReader_getJointIndexListCount(self) + + def getJointIndicesForLOD(self, lod): + r""" + List of joint indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which joints are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the joint indices. + See also: getLODCount + See also: getJointName + """ + return _py3dna.DefinitionReader_getJointIndicesForLOD(self, lod) + + def getJointParentIndex(self, index): + r""" + Index of the requested joint's parent. + Notes: + The joint hierarchy may be traversed and reconstructed using this function. Example: + Joint names: [A, B, C, D, E, F, G, H, I] + Hierarchy: [0, 0, 0, 1, 1, 4, 2, 6, 2] + Describes the following hierarchy: + A + + B + | + D + | + E + | + F + + C + + G + | + H + + I + + Requesting the parent index of joint 5 (joint name: F) would return 4 (joint name: E). + Requesting the parent index of the root joint: 0 (joint name: A) would return the same index 0. + An out of bounds request (an index greater than the number of joints returns UINT16_MAX). + :type index: int + :param index: + The joint index which parent is being requested. + """ + return _py3dna.DefinitionReader_getJointParentIndex(self, index) + + def getBlendShapeChannelCount(self): + return _py3dna.DefinitionReader_getBlendShapeChannelCount(self) + + def getBlendShapeChannelName(self, index): + r""" + Name of the requested blend shape channel. + :type index: int + :param index: + A name's position in the zero-indexed array of blend shape channel names. + Warning: + The index must be less than the value returned by BlendShapeChannelExtentReader::getBlendShapeChannelCount. + :rtype: :py:class:`StringView` + :return: View over the blend shape channel name string. + """ + return _py3dna.DefinitionReader_getBlendShapeChannelName(self, index) + + def getBlendShapeChannelIndexListCount(self): + r""" + Number of blend shape channel index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ + return _py3dna.DefinitionReader_getBlendShapeChannelIndexListCount(self) + + def getBlendShapeChannelIndicesForLOD(self, lod): + r""" + List of blend shape channel indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which blend shape channels are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the blend shape channel indices. + + These LOD indices are not interchangeable with the LOD values from BehaviorReader::getBlendShapeChannelLODs. + See also: getLODCount + See also: getBlendShapeChannelName + """ + return _py3dna.DefinitionReader_getBlendShapeChannelIndicesForLOD(self, lod) + + def getAnimatedMapCount(self): + return _py3dna.DefinitionReader_getAnimatedMapCount(self) + + def getAnimatedMapName(self, index): + r""" + Name of the requested animated map. + :type index: int + :param index: + A name's position in the zero-indexed array of animated map names. + Warning: + The index must be less than the value returned by getAnimatedMapCount. + :rtype: :py:class:`StringView` + :return: View over the animated map name string. + """ + return _py3dna.DefinitionReader_getAnimatedMapName(self, index) + + def getAnimatedMapIndexListCount(self): + r""" + Number of animated map index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ + return _py3dna.DefinitionReader_getAnimatedMapIndexListCount(self) + + def getAnimatedMapIndicesForLOD(self, lod): + r""" + List of animated map indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which animated maps are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the animated map indices. + See also: getLODCount + See also: getAnimatedMapName + """ + return _py3dna.DefinitionReader_getAnimatedMapIndicesForLOD(self, lod) + + def getMeshCount(self): + return _py3dna.DefinitionReader_getMeshCount(self) + + def getMeshName(self, index): + r""" + Name of the requested mesh. + :type index: int + :param index: + A name's position in the zero-indexed array of mesh names. + Warning: + The index must be less than the value returned by getMeshCount. + :rtype: :py:class:`StringView` + :return: View over the mesh name string. + """ + return _py3dna.DefinitionReader_getMeshName(self, index) + + def getMeshIndexListCount(self): + r""" + Number of mesh index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ + return _py3dna.DefinitionReader_getMeshIndexListCount(self) + + def getMeshIndicesForLOD(self, lod): + r""" + List of mesh indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which meshes are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the mesh indices. + See also: getLODCount + See also: getMeshName + """ + return _py3dna.DefinitionReader_getMeshIndicesForLOD(self, lod) + + def getMeshBlendShapeChannelMappingCount(self): + r""" Number of mesh-blend shape channel mapping items.""" + return _py3dna.DefinitionReader_getMeshBlendShapeChannelMappingCount(self) + + def getMeshBlendShapeChannelMapping(self, index): + r""" + :type index: int + :param index: + A mapping's position in the zero-indexed array of mesh-blend shape channel mappings. + Warning: + The index must be less than the value returned by getMeshBlendShapeChannelMappingCount. + :rtype: :py:class:`MeshBlendShapeChannelMapping` + :return: A structure holding the mesh index and the associated blend shape channel index. + """ + return _py3dna.DefinitionReader_getMeshBlendShapeChannelMapping(self, index) + + def getMeshBlendShapeChannelMappingIndicesForLOD(self, lod): + r""" + List of mesh-blend shape channel mapping indices for the specified LOD. + Notes: + The indices from this list can be used with the getMeshBlendShapeChannelMapping API + to retrieve individual mapping items. + :type lod: int + :param lod: + The level of detail which meshes are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the mesh blend shape channel mapping indices. + See also: getLODCount + See also: getMeshBlendShapeChannelMapping + """ + return _py3dna.DefinitionReader_getMeshBlendShapeChannelMappingIndicesForLOD(self, lod) + + def getNeutralJointTranslation(self, index): + r""" + :type index: int + :param index: + A joint's position in the zero-indexed array of joint translations. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: dna::Vector3 + :return: The joint's translation (x, y, z). + """ + return _py3dna.DefinitionReader_getNeutralJointTranslation(self, index) + + def getNeutralJointTranslationXs(self): + r""" + List of all translation X values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getNeutralJointTranslation + """ + return _py3dna.DefinitionReader_getNeutralJointTranslationXs(self) + + def getNeutralJointTranslationYs(self): + r""" + List of all translation Y values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getNeutralJointTranslation + """ + return _py3dna.DefinitionReader_getNeutralJointTranslationYs(self) + + def getNeutralJointTranslationZs(self): + r""" + List of all translation Z values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getNeutralJointTranslation + """ + return _py3dna.DefinitionReader_getNeutralJointTranslationZs(self) + + def getNeutralJointRotation(self, index): + r""" + :type index: int + :param index: + A joint's position in the zero-indexed array of joint rotations. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: dna::Vector3 + :return: The joint's rotation (x, y, z). + """ + return _py3dna.DefinitionReader_getNeutralJointRotation(self, index) + + def getNeutralJointRotationXs(self): + r""" + List of all rotation X values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getNeutralJointRotation + """ + return _py3dna.DefinitionReader_getNeutralJointRotationXs(self) + + def getNeutralJointRotationYs(self): + r""" + List of all rotation Y values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getNeutralJointRotation + """ + return _py3dna.DefinitionReader_getNeutralJointRotationYs(self) + + def getNeutralJointRotationZs(self): + r""" + List of all rotation Z values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getNeutralJointRotation + """ + return _py3dna.DefinitionReader_getNeutralJointRotationZs(self) + +# Register DefinitionReader in _py3dna: +_py3dna.DefinitionReader_swigregister(DefinitionReader) + +class BehaviorReader(DefinitionReader): + r""" + Read-only accessors for DNA attributes that define the rig's evaluation. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def getGUIToRawInputIndices(self): + r""" + Input indices used for mapping gui to raw controls. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ + return _py3dna.BehaviorReader_getGUIToRawInputIndices(self) + + def getGUIToRawOutputIndices(self): + r""" + Output indices used for mapping gui to raw controls. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ + return _py3dna.BehaviorReader_getGUIToRawOutputIndices(self) + + def getGUIToRawFromValues(self): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ + return _py3dna.BehaviorReader_getGUIToRawFromValues(self) + + def getGUIToRawToValues(self): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ + return _py3dna.BehaviorReader_getGUIToRawToValues(self) + + def getGUIToRawSlopeValues(self): + r""" + Computational values(slope/gradient) used for calculating the + output value during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ + return _py3dna.BehaviorReader_getGUIToRawSlopeValues(self) + + def getGUIToRawCutValues(self): + r""" + Computational values(vertical intercept) used for calculating the + output value during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ + return _py3dna.BehaviorReader_getGUIToRawCutValues(self) + + def getPSDCount(self): + r""" The number of distinct PSD expressions.""" + return _py3dna.BehaviorReader_getPSDCount(self) + + def getPSDRowIndices(self): + r""" + PSD(input) indices. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of PSD indices. + """ + return _py3dna.BehaviorReader_getPSDRowIndices(self) + + def getPSDColumnIndices(self): + r""" + Control(input) indices. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of control indices. + """ + return _py3dna.BehaviorReader_getPSDColumnIndices(self) + + def getPSDValues(self): + r""" + Weights associated with each PSD row and column pair. + :rtype: dna::ConstArrayView< float > + :return: View over the array of weights. + """ + return _py3dna.BehaviorReader_getPSDValues(self) + + def getJointRowCount(self): + r""" Number of rows in the entire, uncompressed joint matrix.""" + return _py3dna.BehaviorReader_getJointRowCount(self) + + def getJointColumnCount(self): + r""" Number of columns in the entire, uncompressed joint matrix.""" + return _py3dna.BehaviorReader_getJointColumnCount(self) + + def getJointVariableAttributeIndices(self, lod): + r""" + Joint attribute indices (output indices) for the requested LOD. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of joint indices. + """ + return _py3dna.BehaviorReader_getJointVariableAttributeIndices(self, lod) + + def getJointGroupCount(self): + r""" Number of joint groups present in the entire joint matrix.""" + return _py3dna.BehaviorReader_getJointGroupCount(self) + + def getJointGroupLODs(self, jointGroupIndex): + r""" + Number of rows per each level of detail for the requested joint group. + Notes: + Each element's position represents the level itself, while the value denotes + the number of rows within the joint group belonging to that level. e.g.: + [12, 9, 3] + | | + LOD-2 contains first 3 rows + | + LOD-1 contains first 9 rows + + LOD-0 contains first 12 rows + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ + return _py3dna.BehaviorReader_getJointGroupLODs(self, jointGroupIndex) + + def getJointGroupInputIndices(self, jointGroupIndex): + r""" + Column indices that the requested joint group contains. + Notes: + The column indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of column indices. + """ + return _py3dna.BehaviorReader_getJointGroupInputIndices(self, jointGroupIndex) + + def getJointGroupOutputIndices(self, jointGroupIndex): + r""" + Row indices that the requested joint group contains. + Notes: + The row indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of row indices. + """ + return _py3dna.BehaviorReader_getJointGroupOutputIndices(self, jointGroupIndex) + + def getJointGroupValues(self, jointGroupIndex): + r""" + Values that the requested joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< float > + :return: View over the array of values. + """ + return _py3dna.BehaviorReader_getJointGroupValues(self, jointGroupIndex) + + def getJointGroupJointIndices(self, jointGroupIndex): + r""" + Joint indices that the requested joint group contains. + Notes: + These joint indices can be used to get the joint names through DefinitionReader::getJointName. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of joint indices. + See also: DefinitionReader + """ + return _py3dna.BehaviorReader_getJointGroupJointIndices(self, jointGroupIndex) + + def getBlendShapeChannelLODs(self): + r""" + Input index count per each level of detail for blend shape channels. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of input indices belonging to that level. + Warning: + These LOD values are not interchangeable with the LOD indices from DefinitionReader::getBlendShapeChannelIndicesForLOD. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ + return _py3dna.BehaviorReader_getBlendShapeChannelLODs(self) + + def getBlendShapeChannelInputIndices(self): + r""" + Input indices used to index into the input vector. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ + return _py3dna.BehaviorReader_getBlendShapeChannelInputIndices(self) + + def getBlendShapeChannelOutputIndices(self): + r""" + Output indices specify the positions of blend shape channel output values. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ + return _py3dna.BehaviorReader_getBlendShapeChannelOutputIndices(self) + + def getAnimatedMapLODs(self): + r""" + Row count per each level of detail for animated maps. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of rows (within the conditional table), + belonging to that level. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ + return _py3dna.BehaviorReader_getAnimatedMapLODs(self) + + def getAnimatedMapInputIndices(self): + r""" + Input indices used to index into the array of input values. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ + return _py3dna.BehaviorReader_getAnimatedMapInputIndices(self) + + def getAnimatedMapOutputIndices(self): + r""" + Output indices that specify the computed output value's position. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ + return _py3dna.BehaviorReader_getAnimatedMapOutputIndices(self) + + def getAnimatedMapFromValues(self): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ + return _py3dna.BehaviorReader_getAnimatedMapFromValues(self) + + def getAnimatedMapToValues(self): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ + return _py3dna.BehaviorReader_getAnimatedMapToValues(self) + + def getAnimatedMapSlopeValues(self): + r""" + Computational values(slope/gradient) used for calculating the output value. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ + return _py3dna.BehaviorReader_getAnimatedMapSlopeValues(self) + + def getAnimatedMapCutValues(self): + r""" + Computational values(vertical intercept) used for calculating the output value. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ + return _py3dna.BehaviorReader_getAnimatedMapCutValues(self) + +# Register BehaviorReader in _py3dna: +_py3dna.BehaviorReader_swigregister(BehaviorReader) + +class GeometryReader(DefinitionReader): + r""" + Read-only accessors to the geometry data associated with a rig. + Warning: + Implementors should inherit from Reader itself and not this class. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def getVertexPositionCount(self, meshIndex): + r""" + Number of vertex positions in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getVertexPositionCount(self, meshIndex) + + def getVertexPosition(self, meshIndex, vertexIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + The index of the vertex position in the zero-indexed array of vertex positions. + + vertexIndex must be less than the value returned by getVertexPositionCount. + Notes: + The vertices are sorted by the vertex ID. + :rtype: dna::Position + :return: The vertex position. + """ + return _py3dna.GeometryReader_getVertexPosition(self, meshIndex, vertexIndex) + + def getVertexPositionXs(self, meshIndex): + r""" + List of all vertex position X values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getVertexPosition + """ + return _py3dna.GeometryReader_getVertexPositionXs(self, meshIndex) + + def getVertexPositionYs(self, meshIndex): + r""" + List of all vertex position Y values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getVertexPosition + """ + return _py3dna.GeometryReader_getVertexPositionYs(self, meshIndex) + + def getVertexPositionZs(self, meshIndex): + r""" + List of all vertex position Z values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getVertexPosition + """ + return _py3dna.GeometryReader_getVertexPositionZs(self, meshIndex) + + def getVertexTextureCoordinateCount(self, meshIndex): + r""" + Number of texture coordinates in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getVertexTextureCoordinateCount(self, meshIndex) + + def getVertexTextureCoordinate(self, meshIndex, textureCoordinateIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type textureCoordinateIndex: int + :param textureCoordinateIndex: + The index of the texture coordinate in the zero-indexed array of texture coordinates. + + textureCoordinateIndex must be less than the value returned by getVertexTextureCoordinateCount. + :rtype: dna::TextureCoordinate + :return: The texture coordinate. + """ + return _py3dna.GeometryReader_getVertexTextureCoordinate(self, meshIndex, textureCoordinateIndex) + + def getVertexTextureCoordinateUs(self, meshIndex): + r""" + List of all texture coordinate U values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexTextureCoordinate. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all U values. + See also: getVertexTextureCoordinate + """ + return _py3dna.GeometryReader_getVertexTextureCoordinateUs(self, meshIndex) + + def getVertexTextureCoordinateVs(self, meshIndex): + r""" + List of all texture coordinate V values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexTextureCoordinate. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all V values. + See also: getVertexTextureCoordinate + """ + return _py3dna.GeometryReader_getVertexTextureCoordinateVs(self, meshIndex) + + def getVertexNormalCount(self, meshIndex): + r""" + Number of vertex normals in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getVertexNormalCount(self, meshIndex) + + def getVertexNormal(self, meshIndex, normalIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type normalIndex: int + :param normalIndex: + The index of the vertex normal in the zero-indexed array of vertex normals. + + normalIndex must be less than the value returned by getVertexNormalCount. + :rtype: dna::Normal + :return: The vertex normal. + """ + return _py3dna.GeometryReader_getVertexNormal(self, meshIndex, normalIndex) + + def getVertexNormalXs(self, meshIndex): + r""" + List of all normal X values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getVertexNormal + """ + return _py3dna.GeometryReader_getVertexNormalXs(self, meshIndex) + + def getVertexNormalYs(self, meshIndex): + r""" + List of all normal Y value for the referenced meshs. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getVertexNormal + """ + return _py3dna.GeometryReader_getVertexNormalYs(self, meshIndex) + + def getVertexNormalZs(self, meshIndex): + r""" + List of all normal Z values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getVertexNormal + """ + return _py3dna.GeometryReader_getVertexNormalZs(self, meshIndex) + + def getVertexLayoutCount(self, meshIndex): + r""" + Number of vertex layouts in the entire mesh. + Notes: + A vertex layout is a collection of vertex attributes. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getVertexLayoutCount(self, meshIndex) + + def getVertexLayout(self, meshIndex, layoutIndex): + r""" + Vertex layouts contain only attribute indices which can be used to query + the actual attributes, such as positions, texture coordinates and normals, + which are associated with the vertex. + Notes: + The indices from a layout are usable with the above defined APIs. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type layoutIndex: int + :param layoutIndex: + The index of the layout in the zero-indexed array of vertex layouts. + + layoutIndex must be less than the value returned by getVertexLayoutCount. + See also: getVertexPosition + See also: getVertexTextureCoordinate + See also: getVertexNormal + """ + return _py3dna.GeometryReader_getVertexLayout(self, meshIndex, layoutIndex) + + def getVertexLayoutPositionIndices(self, meshIndex): + r""" + Position indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex position indices values. + See also: getVertexLayout + """ + return _py3dna.GeometryReader_getVertexLayoutPositionIndices(self, meshIndex) + + def getVertexLayoutTextureCoordinateIndices(self, meshIndex): + r""" + Texture coordinate indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex texture coordinate indices. + See also: getVertexLayout + """ + return _py3dna.GeometryReader_getVertexLayoutTextureCoordinateIndices(self, meshIndex) + + def getVertexLayoutNormalIndices(self, meshIndex): + r""" + Normal indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex normal indices. + See also: getVertexLayout + """ + return _py3dna.GeometryReader_getVertexLayoutNormalIndices(self, meshIndex) + + def getFaceCount(self, meshIndex): + r""" + Number of faces that belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getFaceCount(self, meshIndex) + + def getFaceVertexLayoutIndices(self, meshIndex, faceIndex): + r""" + List of vertex layout indices the belong to a face on the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type faceIndex: int + :param faceIndex: + A face's position in the zero-indexed array of faces that belong to + the above referenced mesh. + + faceIndex must be less than the value returned by getFaceCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over the list of vertex layout indices. + See also: getVertexLayout + """ + return _py3dna.GeometryReader_getFaceVertexLayoutIndices(self, meshIndex, faceIndex) + + def getMaximumInfluencePerVertex(self, meshIndex): + r""" + The maximum number of joints that may influence any single vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getMaximumInfluencePerVertex(self, meshIndex) + + def getSkinWeightsCount(self, meshIndex): + r""" + Number of skin weights associated with the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getSkinWeightsCount(self, meshIndex) + + def getSkinWeightsValues(self, meshIndex, vertexIndex): + r""" + List of skin weights influencing the requested vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertices. + + vertexIndex must be less than the value returned by getVertexPositionCount. + :rtype: dna::ConstArrayView< float > + :return: View over the list of skin weights. + """ + return _py3dna.GeometryReader_getSkinWeightsValues(self, meshIndex, vertexIndex) + + def getSkinWeightsJointIndices(self, meshIndex, vertexIndex): + r""" + List of joint indices associated with each skin weight for the specified vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertices. + + vertexIndex must be less than the value returned by getVertexPositionCount. + Notes: + The joint indices are stored in the same order as the weights they + are associated with. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the list of joint indices. + """ + return _py3dna.GeometryReader_getSkinWeightsJointIndices(self, meshIndex, vertexIndex) + + def getBlendShapeTargetCount(self, meshIndex): + r""" + Number of blend shapes that belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getBlendShapeTargetCount(self, meshIndex) + + def getBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex): + r""" + The matching blend shape channel index of the requested blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + See also: DefinitionReader::getBlendShapeChannelName + """ + return _py3dna.GeometryReader_getBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex) + + def getBlendShapeTargetDeltaCount(self, meshIndex, blendShapeTargetIndex): + r""" + Number of deltas that belong to the specified blend shape. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + """ + return _py3dna.GeometryReader_getBlendShapeTargetDeltaCount(self, meshIndex, blendShapeTargetIndex) + + def getBlendShapeTargetDelta(self, meshIndex, blendShapeTargetIndex, deltaIndex): + r""" + List of deltas for each affected vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :type deltaIndex: int + :param deltaIndex: + A position in the zero-indexed array of blend shapes deltas. + + deltaIndex must be less than the value returned by getBlendShapeTargetDeltaCount. + """ + return _py3dna.GeometryReader_getBlendShapeTargetDelta(self, meshIndex, blendShapeTargetIndex, deltaIndex) + + def getBlendShapeTargetDeltaXs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta X values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getBlendShapeTargetDelta + """ + return _py3dna.GeometryReader_getBlendShapeTargetDeltaXs(self, meshIndex, blendShapeTargetIndex) + + def getBlendShapeTargetDeltaYs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta Y values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getBlendShapeTargetDelta + """ + return _py3dna.GeometryReader_getBlendShapeTargetDeltaYs(self, meshIndex, blendShapeTargetIndex) + + def getBlendShapeTargetDeltaZs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta Z values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getBlendShapeTargetDelta + """ + return _py3dna.GeometryReader_getBlendShapeTargetDeltaZs(self, meshIndex, blendShapeTargetIndex) + + def getBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex): + r""" + Vertex position indices affected by the referenced blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + Notes: + The vertex position indices are stored in the same order as the deltas they + are associated with. + These indices can be used to query the associated vertices themselves through getVertexPosition. + See also: getVertexPosition + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over the list of vertex position indices. + """ + return _py3dna.GeometryReader_getBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex) + +# Register GeometryReader in _py3dna: +_py3dna.GeometryReader_swigregister(GeometryReader) + +class Reader(BehaviorReader, GeometryReader): + r""" + The abstract Reader which its implementations are expected to inherit. + Notes: + This class combines the various different reader interfaces into a single interface. + The artificial separation into multiple interfaces mirrors the DNA file structure that + is separated into matching layers under the same names. As these layers can be + selectively loaded, it might be convenient to slice-off interfaces which layers were + not loaded. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_Reader + + def unload(self, layer): + r""" + Unload all data of the specified layer and all layers dependent on it. + :type layer: int + :param layer: + Layer which data should be unloaded. + """ + return _py3dna.Reader_unload(self, layer) + +# Register Reader in _py3dna: +_py3dna.Reader_swigregister(Reader) + +class StreamReader(Reader): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_StreamReader + + def read(self): + r""" read data from stream into internal structures.""" + return _py3dna.StreamReader_read(self) + +# Register StreamReader in _py3dna: +_py3dna.StreamReader_swigregister(StreamReader) +StreamReader.SignatureMismatchError = _py3dna.cvar.StreamReader_SignatureMismatchError +StreamReader.VersionMismatchError = _py3dna.cvar.StreamReader_VersionMismatchError +StreamReader.InvalidDataError = _py3dna.cvar.StreamReader_InvalidDataError + +class BinaryStreamReader(StreamReader): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(*args): + r""" + *Overload 1:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int, optional + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int, optional + :param maxLOD: + The maximum level of details to be loaded. + + A value of zero indicates to load all LODs. + Warning: + The maxLOD value must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 4:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 5:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.BinaryStreamReader_create(*args) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a BinaryStreamReader instance. + :type instance: :py:class:`BinaryStreamReader` + :param instance: + Instance of BinaryStreamReader to be freed. + See also: create + """ + return _py3dna.BinaryStreamReader_destroy(instance) + __swig_destroy__ = _py3dna.delete_BinaryStreamReader + +# Register BinaryStreamReader in _py3dna: +_py3dna.BinaryStreamReader_swigregister(BinaryStreamReader) + +def BinaryStreamReader_create(*args): + r""" + *Overload 1:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int, optional + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int, optional + :param maxLOD: + The maximum level of details to be loaded. + + A value of zero indicates to load all LODs. + Warning: + The maxLOD value must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 4:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 5:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.BinaryStreamReader_create(*args) + +def BinaryStreamReader_destroy(instance): + r""" + Method for freeing a BinaryStreamReader instance. + :type instance: :py:class:`BinaryStreamReader` + :param instance: + Instance of BinaryStreamReader to be freed. + See also: create + """ + return _py3dna.BinaryStreamReader_destroy(instance) + +class JSONStreamReader(StreamReader): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(stream, memRes=None): + r""" + Factory method for creation of JSONStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.JSONStreamReader_create(stream, memRes) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a JSONStreamReader instance. + :type instance: :py:class:`JSONStreamReader` + :param instance: + Instance of JSONStreamReader to be freed. + See also: create + """ + return _py3dna.JSONStreamReader_destroy(instance) + __swig_destroy__ = _py3dna.delete_JSONStreamReader + +# Register JSONStreamReader in _py3dna: +_py3dna.JSONStreamReader_swigregister(JSONStreamReader) + +def JSONStreamReader_create(stream, memRes=None): + r""" + Factory method for creation of JSONStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.JSONStreamReader_create(stream, memRes) + +def JSONStreamReader_destroy(instance): + r""" + Method for freeing a JSONStreamReader instance. + :type instance: :py:class:`JSONStreamReader` + :param instance: + Instance of JSONStreamReader to be freed. + See also: create + """ + return _py3dna.JSONStreamReader_destroy(instance) + + +BinaryStreamReaderImpl = BinaryStreamReader + +class BinaryStreamReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(BinaryStreamReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(BinaryStreamReaderImpl) if name not in ("create","destroy")] + +class BinaryStreamReader(with_metaclass(BinaryStreamReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = BinaryStreamReaderImpl.create(*args, **kwargs) + + def __del__(self): + BinaryStreamReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + + +JSONStreamReaderImpl = JSONStreamReader + +class JSONStreamReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(JSONStreamReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(JSONStreamReaderImpl) if name not in ("create","destroy")] + +class JSONStreamReader(with_metaclass(JSONStreamReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = JSONStreamReaderImpl.create(*args, **kwargs) + + def __del__(self): + JSONStreamReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + +class DescriptorWriter(object): + r""" + Write-only accessors to various metadata about the character and the rig. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def setName(self, name): + r""" + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an allocation. + """ + return _py3dna.DescriptorWriter_setName(self, name) + + def setArchetype(self, archetype): + return _py3dna.DescriptorWriter_setArchetype(self, archetype) + + def setGender(self, gender): + return _py3dna.DescriptorWriter_setGender(self, gender) + + def setAge(self, age): + return _py3dna.DescriptorWriter_setAge(self, age) + + def clearMetaData(self): + r""" Empties the metadata storage, delete all key-value pairs.""" + return _py3dna.DescriptorWriter_clearMetaData(self) + + def setMetaData(self, key, value): + r""" + Associate the metadata value with the given key. + :type key: string + :param key: + A unique, null-terminated key, to which the given value will be assigned. + :type value: string + :param value: + A null-terminated, metadata value, which is to be assigned to the given key. + Notes: + Consecutive calls using the same key will overwrite any existing data. + + Passing nullptr as the value argument will cause the associated key to be deleted. + """ + return _py3dna.DescriptorWriter_setMetaData(self, key, value) + + def setTranslationUnit(self, unit): + return _py3dna.DescriptorWriter_setTranslationUnit(self, unit) + + def setRotationUnit(self, unit): + return _py3dna.DescriptorWriter_setRotationUnit(self, unit) + + def setCoordinateSystem(self, system): + return _py3dna.DescriptorWriter_setCoordinateSystem(self, system) + + def setLODCount(self, lodCount): + r""" + Available levels of detail (e.g. 6 which means the following levels are available: + [0,1,2,3,4,5], where 0 is the LOD with the highest details, and 5 is the LOD with + lowest details). + :type lodCount: int + :param lodCount: + The number of levels available. + """ + return _py3dna.DescriptorWriter_setLODCount(self, lodCount) + + def setDBMaxLOD(self, lod): + r""" The maximum level of detail stored in the DNA data for this character.""" + return _py3dna.DescriptorWriter_setDBMaxLOD(self, lod) + + def setDBComplexity(self, name): + r""" + Name of the input control interface used to drive this character rig. + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DescriptorWriter_setDBComplexity(self, name) + + def setDBName(self, name): + r""" + Name of the database from which the character originates. + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DescriptorWriter_setDBName(self, name) + +# Register DescriptorWriter in _py3dna: +_py3dna.DescriptorWriter_swigregister(DescriptorWriter) + +class DefinitionWriter(DescriptorWriter): + r""" + Write-only accessors for DNA attributes that represent the rig's static data. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def clearGUIControlNames(self): + r""" Delete all stored GUI control names.""" + return _py3dna.DefinitionWriter_clearGUIControlNames(self) + + def setGUIControlName(self, index, name): + r""" + Name of the specified GUI control. + :type index: int + :param index: + A name's position in the zero-indexed array of GUI control names. + Notes: + The control name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DefinitionWriter_setGUIControlName(self, index, name) + + def clearRawControlNames(self): + r""" Delete all stored raw control names.""" + return _py3dna.DefinitionWriter_clearRawControlNames(self) + + def setRawControlName(self, index, name): + r""" + Name of the specified raw control. + :type index: int + :param index: + A name's position in the zero-indexed array of raw control names. + Notes: + The control name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DefinitionWriter_setRawControlName(self, index, name) + + def clearJointNames(self): + r""" Delete all stored joint names.""" + return _py3dna.DefinitionWriter_clearJointNames(self) + + def setJointName(self, index, name): + r""" + Name of the specified joint. + :type index: int + :param index: + A name's position in the zero-indexed array of joint names. + Notes: + The joint name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DefinitionWriter_setJointName(self, index, name) + + def clearJointIndices(self): + r""" Delete all stored joint indices.""" + return _py3dna.DefinitionWriter_clearJointIndices(self) + + def setJointIndices(self, index, jointIndices): + r""" + Store a list of joint indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where joint indices are stored. + Notes: + The index denotes the position of an entire joint index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of joint indices. + + The joint index storage will be implicitly resized (if needed) to provide + storage for the number of joint indices that is inferred from the specified index. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + + These indices can be used to access joint names through DefinitionReader::getJointName. + :type count: int + :param count: + The number of joint indices to copy. + """ + return _py3dna.DefinitionWriter_setJointIndices(self, index, jointIndices) + + def clearLODJointMappings(self): + r""" Delete all stored LOD to joint list index mapping entries.""" + return _py3dna.DefinitionWriter_clearLODJointMappings(self) + + def setLODJointMapping(self, lod, index): + r""" + Set which joints belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the joints are being associated. + :type index: int + :param index: + The index onto which joints indices were assigned using setJointIndices. + See also: setJointIndices + """ + return _py3dna.DefinitionWriter_setLODJointMapping(self, lod, index) + + def clearBlendShapeChannelNames(self): + r""" Delete all stored blend shape channel names.""" + return _py3dna.DefinitionWriter_clearBlendShapeChannelNames(self) + + def setBlendShapeChannelName(self, index, name): + r""" + Name of the specified blend shape channel. + :type index: int + :param index: + A name's position in the zero-indexed array of blend shape channel names. + Notes: + The blend shape channel name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DefinitionWriter_setBlendShapeChannelName(self, index, name) + + def clearBlendShapeChannelIndices(self): + r""" Delete all stored blend shape channel indices.""" + return _py3dna.DefinitionWriter_clearBlendShapeChannelIndices(self) + + def setBlendShapeChannelIndices(self, index, blendShapeChannelIndices): + r""" + Store a list of blend shape channel name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where blend shape channel name indices are stored. + Notes: + The index denotes the position of an entire blend shape channel index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of blend shape channel indices. + + The blend shape channel index storage will be implicitly resized (if needed) to provide storage + for the number of blend shape channel name indices that is inferred from the specified index. + :type blendShapeChannelIndices: int + :param blendShapeChannelIndices: + The source address from which the blend shape channel name indices are to be copied. + + These indices can be used to access blend shape channel names through DefinitionReader::getBlendShapeChannelName. + :type count: int + :param count: + The number of blend shape channel name indices to copy. + """ + return _py3dna.DefinitionWriter_setBlendShapeChannelIndices(self, index, blendShapeChannelIndices) + + def clearLODBlendShapeChannelMappings(self): + r""" Delete all stored LOD to blend shape channel list index mapping entries.""" + return _py3dna.DefinitionWriter_clearLODBlendShapeChannelMappings(self) + + def setLODBlendShapeChannelMapping(self, lod, index): + r""" + Set which blend shape channels belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the blend shape channels are being associated. + :type index: int + :param index: + The index onto which blend shape channel name indices were assigned using setBlendShapeChannelIndices. + Warning: + The LOD indices set here are not interchangeable with the LOD values set in BehaviorWriter::setBlendShapeChannelLODs. + See also: setBlendShapeChannelIndices + """ + return _py3dna.DefinitionWriter_setLODBlendShapeChannelMapping(self, lod, index) + + def clearAnimatedMapNames(self): + r""" Delete all stored animated map names.""" + return _py3dna.DefinitionWriter_clearAnimatedMapNames(self) + + def setAnimatedMapName(self, index, name): + r""" + Name of the specified animated map. + :type index: int + :param index: + A name's position in the zero-indexed array of animated map names. + Notes: + The animated map name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DefinitionWriter_setAnimatedMapName(self, index, name) + + def clearAnimatedMapIndices(self): + r""" Delete all stored animated map indices.""" + return _py3dna.DefinitionWriter_clearAnimatedMapIndices(self) + + def setAnimatedMapIndices(self, index, animatedMapIndices): + r""" + Store a list of animated map name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where animated map name indices are stored. + Notes: + The index denotes the position of an entire animated map index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of animated map indices. + + The animated map index storage will be implicitly resized (if needed) to provide storage + for the number of animated map name indices that is inferred from the specified index. + :type animatedMapIndices: int + :param animatedMapIndices: + The source address from which the animated map name indices are to be copied. + + These indices can be used to access animated map names through DefinitionReader::getAnimatedMapName. + :type count: int + :param count: + The number of animated map name indices to copy. + """ + return _py3dna.DefinitionWriter_setAnimatedMapIndices(self, index, animatedMapIndices) + + def clearLODAnimatedMapMappings(self): + r""" Delete all stored LOD to animated map list index mapping entries.""" + return _py3dna.DefinitionWriter_clearLODAnimatedMapMappings(self) + + def setLODAnimatedMapMapping(self, lod, index): + r""" + Set which animated maps belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the animated maps are being associated. + :type index: int + :param index: + The index onto which animated map indices were assigned using setAnimatedMapIndices. + See also: setAnimatedMapIndices + """ + return _py3dna.DefinitionWriter_setLODAnimatedMapMapping(self, lod, index) + + def clearMeshNames(self): + r""" Delete all stored mesh names.""" + return _py3dna.DefinitionWriter_clearMeshNames(self) + + def setMeshName(self, index, name): + r""" + Name of the specified mesh. + :type index: int + :param index: + A name's position in the zero-indexed array of mesh names. + Notes: + The mesh name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DefinitionWriter_setMeshName(self, index, name) + + def clearMeshIndices(self): + r""" Delete all stored mesh indices.""" + return _py3dna.DefinitionWriter_clearMeshIndices(self) + + def setMeshIndices(self, index, meshIndices): + r""" + Store a list of mesh name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where mesh name indices are stored. + Notes: + The index denotes the position of an entire mesh index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of mesh indices. + + The mesh index storage will be implicitly resized (if needed) to provide storage + for the number of mesh name indices that is inferred from the specified index. + :type meshIndices: int + :param meshIndices: + The source address from which the mesh name indices are to be copied. + + These indices can be used to access mesh names through DefinitionReader::getMeshName. + :type count: int + :param count: + The number of mesh name indices to copy. + """ + return _py3dna.DefinitionWriter_setMeshIndices(self, index, meshIndices) + + def clearLODMeshMappings(self): + r""" Delete all stored LOD to mesh list index mapping entries.""" + return _py3dna.DefinitionWriter_clearLODMeshMappings(self) + + def setLODMeshMapping(self, lod, index): + r""" + Set which meshes belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the meshes are being associated. + :type index: int + :param index: + The index onto which mesh indices were assigned using setMeshIndices. + See also: setMeshIndices + """ + return _py3dna.DefinitionWriter_setLODMeshMapping(self, lod, index) + + def clearMeshBlendShapeChannelMappings(self): + r""" Delete all stored mesh to blend shape channel mapping entries.""" + return _py3dna.DefinitionWriter_clearMeshBlendShapeChannelMappings(self) + + def setMeshBlendShapeChannelMapping(self, index, meshIndex, blendShapeChannelIndex): + r""" + Associate a blend shape channel with it's mesh. + :type index: int + :param index: + A mapping's position in the zero-indexed array of mesh-blend shape channel mappings. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of mesh names. + :type blendShapeChannelIndex: int + :param blendShapeChannelIndex: + A blend shape channel's position in the zero-indexed array of blend shape channel names. + """ + return _py3dna.DefinitionWriter_setMeshBlendShapeChannelMapping(self, index, meshIndex, blendShapeChannelIndex) + + def setJointHierarchy(self, jointIndices): + r""" + A simple array describing the parent-child relationships between joints. + Notes: + Example: + Joint names: [A, B, C, D, E, F, G, H] + Hierarchy: [0, 0, 0, 1, 1, 4, 2, 2] + Describes the following hierarchy: + A + + B + | + D + | + E + | + F + + C + + G + + H + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + + These indices can be used to access joint names through DefinitionReader::getJointName. + :type count: int + :param count: + The number of joint indices to copy. + """ + return _py3dna.DefinitionWriter_setJointHierarchy(self, jointIndices) + + def setNeutralJointTranslations(self, translations): + r""" + :type translations: dna::Vector3 + :param translations: + The source address from which the translations are to be copied. + :type count: int + :param count: + The number of translation values to copy. + """ + return _py3dna.DefinitionWriter_setNeutralJointTranslations(self, translations) + + def setNeutralJointRotations(self, rotations): + r""" + :type rotations: dna::Vector3 + :param rotations: + The source address from which the rotations are to be copied. + :type count: int + :param count: + The number of rotation values to copy. + """ + return _py3dna.DefinitionWriter_setNeutralJointRotations(self, rotations) + +# Register DefinitionWriter in _py3dna: +_py3dna.DefinitionWriter_swigregister(DefinitionWriter) + +class BehaviorWriter(DefinitionWriter): + r""" + Write-only accessors for DNA attributes that define the rig's evaluation. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def setGUIToRawInputIndices(self, inputIndices): + r""" + Input indices used for mapping gui to raw controls. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ + return _py3dna.BehaviorWriter_setGUIToRawInputIndices(self, inputIndices) + + def setGUIToRawOutputIndices(self, outputIndices): + r""" + Output indices used for mapping gui to raw controls. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ + return _py3dna.BehaviorWriter_setGUIToRawOutputIndices(self, outputIndices) + + def setGUIToRawFromValues(self, fromValues): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :type fromValues: float + :param fromValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ + return _py3dna.BehaviorWriter_setGUIToRawFromValues(self, fromValues) + + def setGUIToRawToValues(self, toValues): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :type toValues: float + :param toValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ + return _py3dna.BehaviorWriter_setGUIToRawToValues(self, toValues) + + def setGUIToRawSlopeValues(self, slopeValues): + r""" + Computational values(slope/gradient) used for calculating the + output value during gui to raw control mapping. + :type slopeValues: float + :param slopeValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ + return _py3dna.BehaviorWriter_setGUIToRawSlopeValues(self, slopeValues) + + def setGUIToRawCutValues(self, cutValues): + r""" + Computational values(vertical intercept) used for calculating the + output value during gui to raw control mapping. + :type cutValues: float + :param cutValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ + return _py3dna.BehaviorWriter_setGUIToRawCutValues(self, cutValues) + + def setPSDCount(self, count): + r""" The number of distinct PSD expressions.""" + return _py3dna.BehaviorWriter_setPSDCount(self, count) + + def setPSDRowIndices(self, rowIndices): + r""" + PSD(input) indices which will become the rows of the PSD matrix. + :type rowIndices: int + :param rowIndices: + The source address from which the PSD indices are to be copied. + :type count: int + :param count: + The number of PSD indices to copy. + """ + return _py3dna.BehaviorWriter_setPSDRowIndices(self, rowIndices) + + def setPSDColumnIndices(self, columnIndices): + r""" + Control(input) indices which will become the columns of the PSD matrix. + :type columnIndices: int + :param columnIndices: + The source address from which the control indices are to be copied. + :type count: int + :param count: + The number of control indices to copy. + """ + return _py3dna.BehaviorWriter_setPSDColumnIndices(self, columnIndices) + + def setPSDValues(self, weights): + r""" + Weights associated with each PSD row and column pair. + :type weights: float + :param weights: + The source address from which the weight values are to be copied. + :type count: int + :param count: + The number of weight values to copy. + """ + return _py3dna.BehaviorWriter_setPSDValues(self, weights) + + def setJointRowCount(self, rowCount): + r""" Number of rows in the entire, uncompressed joint matrix.""" + return _py3dna.BehaviorWriter_setJointRowCount(self, rowCount) + + def setJointColumnCount(self, columnCount): + r""" Number of columns in the entire, uncompressed joint matrix.""" + return _py3dna.BehaviorWriter_setJointColumnCount(self, columnCount) + + def clearJointGroups(self): + r""" Delete all joint groups.""" + return _py3dna.BehaviorWriter_clearJointGroups(self) + + def deleteJointGroup(self, jointGroupIndex): + r""" + Delete the specified joint group. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + """ + return _py3dna.BehaviorWriter_deleteJointGroup(self, jointGroupIndex) + + def setJointGroupLODs(self, jointGroupIndex, lods): + r""" + Number of rows per each level of detail for the specified joint group. + Notes: + Each element's position represents the level itself, while the value denotes + the number of rows within the joint group belonging to that level. e.g.: + [12, 9, 3] + | | + LOD-2 contains first 3 rows + | + LOD-1 contains first 9 rows + + LOD-0 contains first 12 rows + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + """ + return _py3dna.BehaviorWriter_setJointGroupLODs(self, jointGroupIndex, lods) + + def setJointGroupInputIndices(self, jointGroupIndex, inputIndices): + r""" + Column indices that the specified joint group contains. + Notes: + The column indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type inputIndices: int + :param inputIndices: + The source address from which the column indices are to be copied. + :type count: int + :param count: + The number of column indices to copy. + """ + return _py3dna.BehaviorWriter_setJointGroupInputIndices(self, jointGroupIndex, inputIndices) + + def setJointGroupOutputIndices(self, jointGroupIndex, outputIndices): + r""" + Row indices that the specified joint group contains. + Notes: + The row indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type outputIndices: int + :param outputIndices: + The source address from which the row indices are to be copied. + :type count: int + :param count: + The number of row indices to copy. + """ + return _py3dna.BehaviorWriter_setJointGroupOutputIndices(self, jointGroupIndex, outputIndices) + + def setJointGroupValues(self, jointGroupIndex, values): + r""" + Values that the specified joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Notes: + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type values: float + :param values: + The source address from which the values are to be copied. + :type count: int + :param count: + The number of values to copy. + """ + return _py3dna.BehaviorWriter_setJointGroupValues(self, jointGroupIndex, values) + + def setJointGroupJointIndices(self, jointGroupIndex, jointIndices): + r""" + Joint indices that the specified joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Notes: + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + :type count: int + :param count: + The number of joint indices to copy. + """ + return _py3dna.BehaviorWriter_setJointGroupJointIndices(self, jointGroupIndex, jointIndices) + + def setBlendShapeChannelLODs(self, lods): + r""" + Input index count per each level of detail for blend shapes. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of input indices belonging to that level. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + Warning: + The LOD values set here are not interchangeable with the LOD indices set in DefinitionWriter::setBlendShapeNameIndices + and DefinitionWriter::setLODBlendShapeMapping + """ + return _py3dna.BehaviorWriter_setBlendShapeChannelLODs(self, lods) + + def setBlendShapeChannelInputIndices(self, inputIndices): + r""" + Input indices used to index into the input vector. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ + return _py3dna.BehaviorWriter_setBlendShapeChannelInputIndices(self, inputIndices) + + def setBlendShapeChannelOutputIndices(self, outputIndices): + r""" + Output indices specify the positions of blend shape output values. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ + return _py3dna.BehaviorWriter_setBlendShapeChannelOutputIndices(self, outputIndices) + + def setAnimatedMapLODs(self, lods): + r""" + Row count per each level of detail for animated maps. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of rows (within the conditional table), + belonging to that level. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapLODs(self, lods) + + def setAnimatedMapInputIndices(self, inputIndices): + r""" + Input indices used to index into the array of input values. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapInputIndices(self, inputIndices) + + def setAnimatedMapOutputIndices(self, outputIndices): + r""" + Output indices that specify the computed output value's position. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapOutputIndices(self, outputIndices) + + def setAnimatedMapFromValues(self, fromValues): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not. + :type fromValues: float + :param fromValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapFromValues(self, fromValues) + + def setAnimatedMapToValues(self, toValues): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not. + :type toValues: float + :param toValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapToValues(self, toValues) + + def setAnimatedMapSlopeValues(self, slopeValues): + r""" + Computational values(slope/gradient) used for calculating the output value. + :type slopeValues: float + :param slopeValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapSlopeValues(self, slopeValues) + + def setAnimatedMapCutValues(self, cutValues): + r""" + Computational values(vertical intercept) used for calculating the output value. + :type cutValues: float + :param cutValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapCutValues(self, cutValues) + +# Register BehaviorWriter in _py3dna: +_py3dna.BehaviorWriter_swigregister(BehaviorWriter) + +class GeometryWriter(DefinitionWriter): + r""" + Write-only accessors for the geometry data associated with a rig. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def clearMeshes(self): + r""" Delete all meshes.""" + return _py3dna.GeometryWriter_clearMeshes(self) + + def deleteMesh(self, meshIndex): + r""" + Delete the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryWriter_deleteMesh(self, meshIndex) + + def setVertexPositions(self, meshIndex, positions): + r""" + List of vertex positions. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type positions: dna::Position + :param positions: + The source address from which the vertex positions are to be copied. + :type count: int + :param count: + The number of vertex positions to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ + return _py3dna.GeometryWriter_setVertexPositions(self, meshIndex, positions) + + def setVertexTextureCoordinates(self, meshIndex, textureCoordinates): + r""" + List of vertex texture coordinates. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type textureCoordinates: dna::TextureCoordinate + :param textureCoordinates: + The source address from which the texture coordinates are to be copied. + :type count: int + :param count: + The number of texture coordinates to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ + return _py3dna.GeometryWriter_setVertexTextureCoordinates(self, meshIndex, textureCoordinates) + + def setVertexNormals(self, meshIndex, normals): + r""" + List of vertex normals. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type normals: dna::Normal + :param normals: + The source address from which the normals are to be copied. + :type count: int + :param count: + The number of normals to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ + return _py3dna.GeometryWriter_setVertexNormals(self, meshIndex, normals) + + def setVertexLayouts(self, meshIndex, layouts): + r""" + List of vertex layouts the belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type layouts: dna::VertexLayout + :param layouts: + The source address from which the layouts are to be copied. + :type count: int + :param count: + The number of layouts to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ + return _py3dna.GeometryWriter_setVertexLayouts(self, meshIndex, layouts) + + def clearFaceVertexLayoutIndices(self, meshIndex): + r""" + Delete all lists of vertex layout indices for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryWriter_clearFaceVertexLayoutIndices(self, meshIndex) + + def setFaceVertexLayoutIndices(self, meshIndex, faceIndex, layoutIndices): + r""" + Vertex layout indices that belong to the specified face. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type faceIndex: int + :param faceIndex: + A face's position in the zero-indexed array of faces that belong to + the above referenced mesh. + :type layoutIndices: int + :param layoutIndices: + The source address from which the layout indices are to be copied. + Notes: + The layout indices point into the array that is set through setVertexLayouts + :type count: int + :param count: + The number of vertices to copy. + + Both the mesh storage itself and it's face storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + faces that are inferred from the specified indexes. + """ + return _py3dna.GeometryWriter_setFaceVertexLayoutIndices(self, meshIndex, faceIndex, layoutIndices) + + def setMaximumInfluencePerVertex(self, meshIndex, maxInfluenceCount): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type maxInfluenceCount: int + :param maxInfluenceCount: + The maximum number of joints that may influence any single vertex. + """ + return _py3dna.GeometryWriter_setMaximumInfluencePerVertex(self, meshIndex, maxInfluenceCount) + + def clearSkinWeights(self, meshIndex): + r""" + Delete all skin weights for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryWriter_clearSkinWeights(self, meshIndex) + + def setSkinWeightsValues(self, meshIndex, vertexIndex, weights): + r""" + List of skin weights influencing the referenced vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertex positions. + :type weights: float + :param weights: + The source address from which the weights are to be copied. + :type count: int + :param count: + The number of weights to copy. + Notes: + Both the mesh storage itself and it's skin weight storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + skin-weight lists that are inferred from the specified indexes. + Warning: + The sum of weights must add up to 1. + """ + return _py3dna.GeometryWriter_setSkinWeightsValues(self, meshIndex, vertexIndex, weights) + + def setSkinWeightsJointIndices(self, meshIndex, vertexIndex, jointIndices): + r""" + List of joint indices associated with each skin weight for the specified vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertex positions. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + :type count: int + :param count: + The number of joint indices to copy. + Notes: + Both the mesh storage itself and it's joint index list storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + joint index lists that are inferred from the specified indexes. + Warning: + The joint indices must be stored in the same order as the weights they + are associated with. + """ + return _py3dna.GeometryWriter_setSkinWeightsJointIndices(self, meshIndex, vertexIndex, jointIndices) + + def clearBlendShapeTargets(self, meshIndex): + r""" + Delete all blend shape targets for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryWriter_clearBlendShapeTargets(self, meshIndex) + + def setBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex, blendShapeChannelIndex): + r""" + The matching blend shape channel index of the specified blend shape target. + Notes: + Associate the mesh-local blend shape target index with the absolute blend shape channel + index as found in the Definition layer. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type blendShapeChannelIndex: int + :param blendShapeChannelIndex: + The index of the specified blend shape channel in the Definition layer. + + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + """ + return _py3dna.GeometryWriter_setBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex, blendShapeChannelIndex) + + def setBlendShapeTargetDeltas(self, meshIndex, blendShapeTargetIndex, deltas): + r""" + List of deltas for each affected vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type deltas: dna::Delta + :param deltas: + The source address from which the blend shape target deltas are to be copied. + :type count: int + :param count: + The number of blend shape target deltas to copy. + Notes: + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + """ + return _py3dna.GeometryWriter_setBlendShapeTargetDeltas(self, meshIndex, blendShapeTargetIndex, deltas) + + def setBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex, vertexIndices): + r""" + Vertex position indices affected by the specified blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type vertexIndices: int + :param vertexIndices: + The source address from which the vertex position indices are to be copied. + :type count: int + :param count: + The number of vertex position indices to copy. + Notes: + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + Warning: + The vertex position indices must be stored in the same order as the deltas + they are associated with. + """ + return _py3dna.GeometryWriter_setBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex, vertexIndices) + +# Register GeometryWriter in _py3dna: +_py3dna.GeometryWriter_swigregister(GeometryWriter) + +class Writer(BehaviorWriter, GeometryWriter): + r""" + The abstract Writer which its implementations are expected to inherit. + Notes: + This class combines the various different writer interfaces into a single interface. + The artificial separation into multiple interfaces in this case just mirrors the + structure of the Reader hierarchy, as it's not possible to selectively write only + specific layers. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_Writer + + def setFrom(self, *args): + r""" + Initialize the Writer from the given Reader. + Notes: + This function copies all the data from the given Reader into the Writer instance, + by calling each getter function of the Reader, and passing the return values to + the matching setter functions in the Writer. + It is implemented in the abstract class itself to provide the functionality for + all DNA Writers. + :type source: :py:class:`Reader` + :param source: + The source DNA Reader from which the data needs to be copied. + :type layer: int, optional + :param layer: + Limit which layers should be taken over from the given source reader. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Optional memory resource to use for temporary allocations during copying. + """ + return _py3dna.Writer_setFrom(self, *args) + +# Register Writer in _py3dna: +_py3dna.Writer_swigregister(Writer) + +class StreamWriter(Writer): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_StreamWriter + + def write(self): + r""" Write data to stream from internal structures.""" + return _py3dna.StreamWriter_write(self) + +# Register StreamWriter in _py3dna: +_py3dna.StreamWriter_swigregister(StreamWriter) + +class BinaryStreamWriter(StreamWriter): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(stream, memRes=None): + r""" + Factory method for creation of BinaryStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.BinaryStreamWriter_create(stream, memRes) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a BinaryStreamWriter instance. + :type instance: :py:class:`BinaryStreamWriter` + :param instance: + Instance of BinaryStreamWriter to be freed. + See also: create + """ + return _py3dna.BinaryStreamWriter_destroy(instance) + __swig_destroy__ = _py3dna.delete_BinaryStreamWriter + +# Register BinaryStreamWriter in _py3dna: +_py3dna.BinaryStreamWriter_swigregister(BinaryStreamWriter) + +def BinaryStreamWriter_create(stream, memRes=None): + r""" + Factory method for creation of BinaryStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.BinaryStreamWriter_create(stream, memRes) + +def BinaryStreamWriter_destroy(instance): + r""" + Method for freeing a BinaryStreamWriter instance. + :type instance: :py:class:`BinaryStreamWriter` + :param instance: + Instance of BinaryStreamWriter to be freed. + See also: create + """ + return _py3dna.BinaryStreamWriter_destroy(instance) + +class JSONStreamWriter(StreamWriter): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(stream, indentWidth=4, memRes=None): + r""" + Factory method for creation of JSONStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type indentWidth: int, optional + :param indentWidth: + Number of spaces to use for indentation. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.JSONStreamWriter_create(stream, indentWidth, memRes) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a JSONStreamWriter instance. + :type instance: :py:class:`JSONStreamWriter` + :param instance: + Instance of JSONStreamWriter to be freed. + See also: create + """ + return _py3dna.JSONStreamWriter_destroy(instance) + __swig_destroy__ = _py3dna.delete_JSONStreamWriter + +# Register JSONStreamWriter in _py3dna: +_py3dna.JSONStreamWriter_swigregister(JSONStreamWriter) + +def JSONStreamWriter_create(stream, indentWidth=4, memRes=None): + r""" + Factory method for creation of JSONStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type indentWidth: int, optional + :param indentWidth: + Number of spaces to use for indentation. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.JSONStreamWriter_create(stream, indentWidth, memRes) + +def JSONStreamWriter_destroy(instance): + r""" + Method for freeing a JSONStreamWriter instance. + :type instance: :py:class:`JSONStreamWriter` + :param instance: + Instance of JSONStreamWriter to be freed. + See also: create + """ + return _py3dna.JSONStreamWriter_destroy(instance) + + +BinaryStreamWriterImpl = BinaryStreamWriter + +class BinaryStreamWriterImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(BinaryStreamWriterImpl, name) + + def __dir__(cls): + return [name for name in dir(BinaryStreamWriterImpl) if name not in ("create","destroy")] + +class BinaryStreamWriter(with_metaclass(BinaryStreamWriterImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = BinaryStreamWriterImpl.create(*args, **kwargs) + + def __del__(self): + BinaryStreamWriterImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + + +JSONStreamWriterImpl = JSONStreamWriter + +class JSONStreamWriterImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(JSONStreamWriterImpl, name) + + def __dir__(cls): + return [name for name in dir(JSONStreamWriterImpl) if name not in ("create","destroy")] + +class JSONStreamWriter(with_metaclass(JSONStreamWriterImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = JSONStreamWriterImpl.create(*args, **kwargs) + + def __del__(self): + JSONStreamWriterImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + + + diff --git a/lib/Maya2024/linux/dnacalib.py b/lib/Maya2024/linux/dnacalib.py new file mode 100644 index 0000000..ae9d31b --- /dev/null +++ b/lib/Maya2024/linux/dnacalib.py @@ -0,0 +1,1172 @@ +# This file was automatically generated by SWIG (http://www.swig.org). +# Version 4.0.2 +# +# Do not make changes to this file unless you know what you are doing--modify +# the SWIG interface file instead. + + +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass + + + +from sys import version_info as _swig_python_version_info +if _swig_python_version_info < (2, 7, 0): + raise RuntimeError("Python 2.7 or later required") + +# Import the low-level C/C++ module +if __package__ or "." in __name__: + from . import _py3dnacalib +else: + import _py3dnacalib + +try: + import builtins as __builtin__ +except ImportError: + import __builtin__ + +def _swig_repr(self): + try: + strthis = "proxy of " + self.this.__repr__() + except __builtin__.Exception: + strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + + +def _swig_setattr_nondynamic_instance_variable(set): + def set_instance_attr(self, name, value): + if name == "thisown": + self.this.own(value) + elif name == "this": + set(self, name, value) + elif hasattr(self, name) and isinstance(getattr(type(self), name), property): + set(self, name, value) + else: + raise AttributeError("You cannot add instance attributes to %s" % self) + return set_instance_attr + + +def _swig_setattr_nondynamic_class_variable(set): + def set_class_attr(cls, name, value): + if hasattr(cls, name) and not isinstance(getattr(cls, name), property): + set(cls, name, value) + else: + raise AttributeError("You cannot add class attributes to %s" % cls) + return set_class_attr + + +def _swig_add_metaclass(metaclass): + """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" + def wrapper(cls): + return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) + return wrapper + + +class _SwigNonDynamicMeta(type): + """Meta class to enforce nondynamic attributes (no new attributes) for a class""" + __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) + + + +def with_metaclass(meta, *bases): + class metaclass(type): + + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) + +import dna +class VersionInfo(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + @staticmethod + def getMajorVersion(): + return _py3dnacalib.VersionInfo_getMajorVersion() + + @staticmethod + def getMinorVersion(): + return _py3dnacalib.VersionInfo_getMinorVersion() + + @staticmethod + def getPatchVersion(): + return _py3dnacalib.VersionInfo_getPatchVersion() + + @staticmethod + def getVersionString(): + return _py3dnacalib.VersionInfo_getVersionString() + + def __init__(self): + _py3dnacalib.VersionInfo_swiginit(self, _py3dnacalib.new_VersionInfo()) + __swig_destroy__ = _py3dnacalib.delete_VersionInfo + +# Register VersionInfo in _py3dnacalib: +_py3dnacalib.VersionInfo_swigregister(VersionInfo) + +def VersionInfo_getMajorVersion(): + return _py3dnacalib.VersionInfo_getMajorVersion() + +def VersionInfo_getMinorVersion(): + return _py3dnacalib.VersionInfo_getMinorVersion() + +def VersionInfo_getPatchVersion(): + return _py3dnacalib.VersionInfo_getPatchVersion() + +def VersionInfo_getVersionString(): + return _py3dnacalib.VersionInfo_getVersionString() + +class DNACalibDNAReader(dna.Reader): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(*args): + return _py3dnacalib.DNACalibDNAReader_create(*args) + + @staticmethod + def destroy(instance): + return _py3dnacalib.DNACalibDNAReader_destroy(instance) + +# Register DNACalibDNAReader in _py3dnacalib: +_py3dnacalib.DNACalibDNAReader_swigregister(DNACalibDNAReader) + +def DNACalibDNAReader_create(*args): + return _py3dnacalib.DNACalibDNAReader_create(*args) + +def DNACalibDNAReader_destroy(instance): + return _py3dnacalib.DNACalibDNAReader_destroy(instance) + + +DNACalibDNAReaderImpl = DNACalibDNAReader + +class DNACalibDNAReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(DNACalibDNAReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(DNACalibDNAReaderImpl) if name not in ("create","destroy")] + +class DNACalibDNAReader(with_metaclass(DNACalibDNAReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = DNACalibDNAReaderImpl.create(*args, **kwargs) + + def __del__(self): + DNACalibDNAReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + +class Command(object): + r""" Command is an abstract class whose implementations are expected to modify the DNA provided in the run() method in some way.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_Command + + def run(self, output): + return _py3dnacalib.Command_run(self, output) + +# Register Command in _py3dnacalib: +_py3dnacalib.Command_swigregister(Command) + +VectorOperation_Interpolate = _py3dnacalib.VectorOperation_Interpolate +VectorOperation_Add = _py3dnacalib.VectorOperation_Add +VectorOperation_Subtract = _py3dnacalib.VectorOperation_Subtract +VectorOperation_Multiply = _py3dnacalib.VectorOperation_Multiply +class CommandSequence(Command): + r""" + CommandSequence is used to run a sequence of commands on the same DNA. + Notes: + Commands will be run in the order in which they were added to the sequence. + + CommandSequence holds pointers to commands, but does not own them. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_CommandSequence + + def __init__(self, *args): + _py3dnacalib.CommandSequence_swiginit(self, _py3dnacalib.new_CommandSequence(*args)) + + def run(self, output): + return _py3dnacalib.CommandSequence_run(self, output) + + def add(self, command): + r""" + Method for adding a command to a sequence of commands to run. + :type command: :py:class:`Command` + :param command: + The command to add. + """ + return _py3dnacalib.CommandSequence_add(self, command) + + def remove(self, command): + r""" + Method for removing a command from the sequence of commands to run. + :type command: :py:class:`Command` + :param command: + The command to remove. + """ + return _py3dnacalib.CommandSequence_remove(self, command) + + def contains(self, command): + r""" + Method for checking if the provided command is part of the command sequence. + :type command: :py:class:`Command` + :param command: + The command to check. + """ + return _py3dnacalib.CommandSequence_contains(self, command) + + def size(self): + r""" Number of commands in command sequence.""" + return _py3dnacalib.CommandSequence_size(self) + +# Register CommandSequence in _py3dnacalib: +_py3dnacalib.CommandSequence_swigregister(CommandSequence) + + +def command_sequence_init(_init): + def wrapper(self, *args, **kwargs): + self._commands = [] + _init(self, *args, **kwargs) + return wrapper + +def command_sequence_add(_add): + def wrapper(self, command): + self._commands.append(command) + _add(self, command) + return wrapper + +def command_sequence_remove(_remove): + def wrapper(self, command): + self._commands.remove(command) + _remove(self, command) + return wrapper + +CommandSequence.__init__ = command_sequence_init(CommandSequence.__init__) +CommandSequence.add = command_sequence_add(CommandSequence.add) +CommandSequence.remove = command_sequence_remove(CommandSequence.remove) + +class CalculateMeshLowerLODsCommand(Command): + r""" + CalculateMeshLowerLODsCommand is used to recalculate vertex positions for lower LOD meshes of the specified mesh. + Notes: + The calculation is done based on vertex positions of the specified mesh and vertex texture coordinates of its lower LOD meshes. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_CalculateMeshLowerLODsCommand + + def __init__(self, *args): + _py3dnacalib.CalculateMeshLowerLODsCommand_swiginit(self, _py3dnacalib.new_CalculateMeshLowerLODsCommand(*args)) + + def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to calculate lower LOD meshes from. + :type meshIndex: int + :param meshIndex: + The index of the mesh. + """ + return _py3dnacalib.CalculateMeshLowerLODsCommand_setMeshIndex(self, meshIndex) + + def run(self, output): + return _py3dnacalib.CalculateMeshLowerLODsCommand_run(self, output) + +# Register CalculateMeshLowerLODsCommand in _py3dnacalib: +_py3dnacalib.CalculateMeshLowerLODsCommand_swigregister(CalculateMeshLowerLODsCommand) + +class ClearBlendShapesCommand(Command): + r""" + ClearBlendShapesCommand is used to clear all blend shapes data from a DNA. + Notes: This command clears blend shape target deltas and blend shape animation data. By doing so, it transforms the DNA to be "joints only". + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_ClearBlendShapesCommand + + def __init__(self, *args): + _py3dnacalib.ClearBlendShapesCommand_swiginit(self, _py3dnacalib.new_ClearBlendShapesCommand(*args)) + + def run(self, output): + return _py3dnacalib.ClearBlendShapesCommand_run(self, output) + +# Register ClearBlendShapesCommand in _py3dnacalib: +_py3dnacalib.ClearBlendShapesCommand_swigregister(ClearBlendShapesCommand) + +class PruneBlendShapeTargetsCommand(Command): + r""" PruneBlendShapeTargetsCommand is used to prune blend shape target deltas whose absolute magnitude is less than or equal to the specified threshold.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_PruneBlendShapeTargetsCommand + + def __init__(self, *args): + _py3dnacalib.PruneBlendShapeTargetsCommand_swiginit(self, _py3dnacalib.new_PruneBlendShapeTargetsCommand(*args)) + + def setThreshold(self, threshold): + r""" + Method for setting the threshold for pruning blend shape target deltas. + :type threshold: float + :param threshold: + The threshold to use. + """ + return _py3dnacalib.PruneBlendShapeTargetsCommand_setThreshold(self, threshold) + + def run(self, output): + return _py3dnacalib.PruneBlendShapeTargetsCommand_run(self, output) + +# Register PruneBlendShapeTargetsCommand in _py3dnacalib: +_py3dnacalib.PruneBlendShapeTargetsCommand_swigregister(PruneBlendShapeTargetsCommand) + +class RemoveAnimatedMapCommand(Command): + r""" RemoveAnimatedMapCommand is used to remove animated maps.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RemoveAnimatedMapCommand + + def __init__(self, *args): + _py3dnacalib.RemoveAnimatedMapCommand_swiginit(self, _py3dnacalib.new_RemoveAnimatedMapCommand(*args)) + + def setAnimatedMapIndex(self, animatedMapIndex): + r""" + Method for setting the index of the animated map to remove. + :type animatedMapIndex: int + :param animatedMapIndex: + The index of the animated map. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set animated map(s) will be removed. + """ + return _py3dnacalib.RemoveAnimatedMapCommand_setAnimatedMapIndex(self, animatedMapIndex) + + def setAnimatedMapIndices(self, animatedMapIndices): + r""" + Method for setting the indices of animated maps to remove. + :type animatedMapIndices: dnac::ConstArrayView< std::uint16_t > + :param animatedMapIndices: + The animated map indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set animated map(s) will be removed. + """ + return _py3dnacalib.RemoveAnimatedMapCommand_setAnimatedMapIndices(self, animatedMapIndices) + + def run(self, output): + return _py3dnacalib.RemoveAnimatedMapCommand_run(self, output) + +# Register RemoveAnimatedMapCommand in _py3dnacalib: +_py3dnacalib.RemoveAnimatedMapCommand_swigregister(RemoveAnimatedMapCommand) + +class RemoveBlendShapeCommand(Command): + r""" RemoveBlendShapeCommand is used to remove blend shapes.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RemoveBlendShapeCommand + + def __init__(self, *args): + _py3dnacalib.RemoveBlendShapeCommand_swiginit(self, _py3dnacalib.new_RemoveBlendShapeCommand(*args)) + + def setBlendShapeIndex(self, blendShapeIndex): + r""" + Method for setting the index of the blend shape to remove. + :type blendShapeIndex: int + :param blendShapeIndex: + The index of the blend shape. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set blend shape(s) will be removed. + """ + return _py3dnacalib.RemoveBlendShapeCommand_setBlendShapeIndex(self, blendShapeIndex) + + def setBlendShapeIndices(self, blendShapeIndices): + r""" + Method for setting the indices of blend shapes to remove. + :type blendShapeIndices: dnac::ConstArrayView< std::uint16_t > + :param blendShapeIndices: + The blend shape indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set blend shape(s) will be removed. + """ + return _py3dnacalib.RemoveBlendShapeCommand_setBlendShapeIndices(self, blendShapeIndices) + + def run(self, output): + return _py3dnacalib.RemoveBlendShapeCommand_run(self, output) + +# Register RemoveBlendShapeCommand in _py3dnacalib: +_py3dnacalib.RemoveBlendShapeCommand_swigregister(RemoveBlendShapeCommand) + +class RemoveJointAnimationCommand(Command): + r""" RemoveJointAnimationCommand is used to remove joint animation data.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RemoveJointAnimationCommand + + def __init__(self, *args): + _py3dnacalib.RemoveJointAnimationCommand_swiginit(self, _py3dnacalib.new_RemoveJointAnimationCommand(*args)) + + def setJointIndex(self, jointIndex): + r""" + Method for setting the index of a joint whose animation data to remove. + :type jointIndex: int + :param jointIndex: + The index of the joint. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint animation(s) will be removed. + """ + return _py3dnacalib.RemoveJointAnimationCommand_setJointIndex(self, jointIndex) + + def setJointIndices(self, jointIndices): + r""" + Method for setting the indices of joints whose animation data to remove. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + The joint indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint animation(s) will be removed. + """ + return _py3dnacalib.RemoveJointAnimationCommand_setJointIndices(self, jointIndices) + + def run(self, output): + return _py3dnacalib.RemoveJointAnimationCommand_run(self, output) + +# Register RemoveJointAnimationCommand in _py3dnacalib: +_py3dnacalib.RemoveJointAnimationCommand_swigregister(RemoveJointAnimationCommand) + +class RemoveJointCommand(Command): + r""" RemoveJointCommand is used to remove joints.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RemoveJointCommand + + def __init__(self, *args): + _py3dnacalib.RemoveJointCommand_swiginit(self, _py3dnacalib.new_RemoveJointCommand(*args)) + + def setJointIndex(self, jointIndex): + r""" + Method for setting the index of the joint to remove. + :type jointIndex: int + :param jointIndex: + The index of the joint. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint(s) will be removed. + """ + return _py3dnacalib.RemoveJointCommand_setJointIndex(self, jointIndex) + + def setJointIndices(self, jointIndices): + r""" + Method for setting the indices of joints to remove. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + The joint indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint(s) will be removed. + """ + return _py3dnacalib.RemoveJointCommand_setJointIndices(self, jointIndices) + + def run(self, output): + return _py3dnacalib.RemoveJointCommand_run(self, output) + +# Register RemoveJointCommand in _py3dnacalib: +_py3dnacalib.RemoveJointCommand_swigregister(RemoveJointCommand) + +class RemoveMeshCommand(Command): + r""" RemoveMeshCommand is used to remove meshes.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RemoveMeshCommand + + def __init__(self, *args): + _py3dnacalib.RemoveMeshCommand_swiginit(self, _py3dnacalib.new_RemoveMeshCommand(*args)) + + def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to remove. + :type meshIndex: int + :param meshIndex: + The index of the mesh. + """ + return _py3dnacalib.RemoveMeshCommand_setMeshIndex(self, meshIndex) + + def setMeshIndices(self, meshIndices): + r""" + Method for setting the indices of meshes to remove. + :type meshIndices: dnac::ConstArrayView< std::uint16_t > + :param meshIndices: + The mesh indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set mesh(es) will be removed. + """ + return _py3dnacalib.RemoveMeshCommand_setMeshIndices(self, meshIndices) + + def run(self, output): + return _py3dnacalib.RemoveMeshCommand_run(self, output) + +# Register RemoveMeshCommand in _py3dnacalib: +_py3dnacalib.RemoveMeshCommand_swigregister(RemoveMeshCommand) + +class RenameAnimatedMapCommand(Command): + r""" RenameAnimatedMapCommand is used to rename an animated map.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RenameAnimatedMapCommand + + def __init__(self, *args): + _py3dnacalib.RenameAnimatedMapCommand_swiginit(self, _py3dnacalib.new_RenameAnimatedMapCommand(*args)) + + def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for animated map with given index. + :type animatedMapIndex: int + :param animatedMapIndex: + The index of the animated map whose name to change. + :type newName: string + :param newName: + The new name for the animated map. + + | + + *Overload 2:* + + Method for setting a new name for animated map with given name. + Notes: + The renaming will not happen if there is no animated map with given current name. + :type oldName: string + :param oldName: + The current name of the animated map whose name to change. + :type newName: string + :param newName: + The new name for the animated map. + """ + return _py3dnacalib.RenameAnimatedMapCommand_setName(self, *args) + + def run(self, output): + return _py3dnacalib.RenameAnimatedMapCommand_run(self, output) + +# Register RenameAnimatedMapCommand in _py3dnacalib: +_py3dnacalib.RenameAnimatedMapCommand_swigregister(RenameAnimatedMapCommand) + +class RenameBlendShapeCommand(Command): + r""" RenameBlendShapeCommand is used to rename a blend shape channel.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RenameBlendShapeCommand + + def __init__(self, *args): + _py3dnacalib.RenameBlendShapeCommand_swiginit(self, _py3dnacalib.new_RenameBlendShapeCommand(*args)) + + def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for blend shape channel with given index. + :type blendShapeIndex: int + :param blendShapeIndex: + The index of the blend shape channel whose name to change. + :type newName: string + :param newName: + The new name for the blend shape channel. + + | + + *Overload 2:* + + Method for setting a new name for blend shape channel with given name. + Notes: + The renaming will not happen if there is no blend shape channel with given current name. + :type oldName: string + :param oldName: + The current name of the blend shape channel whose name to change. + :type newName: string + :param newName: + The new name for the blend shape channel. + """ + return _py3dnacalib.RenameBlendShapeCommand_setName(self, *args) + + def run(self, output): + return _py3dnacalib.RenameBlendShapeCommand_run(self, output) + +# Register RenameBlendShapeCommand in _py3dnacalib: +_py3dnacalib.RenameBlendShapeCommand_swigregister(RenameBlendShapeCommand) + +class RenameJointCommand(Command): + r""" RenameJointCommand is used to rename a joint.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RenameJointCommand + + def __init__(self, *args): + _py3dnacalib.RenameJointCommand_swiginit(self, _py3dnacalib.new_RenameJointCommand(*args)) + + def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for joint with given index. + :type jointIndex: int + :param jointIndex: + The index of the joint whose name to change. + :type newName: string + :param newName: + The new name for the joint. + + | + + *Overload 2:* + + Method for setting a new name for joint with given name. + Notes: + The renaming will not happen if there is no joint with given current name. + :type oldName: string + :param oldName: + The current name of the joint whose name to change. + :type newName: string + :param newName: + The new name for the joint. + """ + return _py3dnacalib.RenameJointCommand_setName(self, *args) + + def run(self, output): + return _py3dnacalib.RenameJointCommand_run(self, output) + +# Register RenameJointCommand in _py3dnacalib: +_py3dnacalib.RenameJointCommand_swigregister(RenameJointCommand) + +class RenameMeshCommand(Command): + r""" RenameMeshCommand is used to rename a mesh.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RenameMeshCommand + + def __init__(self, *args): + _py3dnacalib.RenameMeshCommand_swiginit(self, _py3dnacalib.new_RenameMeshCommand(*args)) + + def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for mesh with given index. + :type meshIndex: int + :param meshIndex: + The index of the mesh whose name to change. + :type newName: string + :param newName: + The new name for the mesh. + + | + + *Overload 2:* + + Method for setting a new name for mesh with given name. + Notes: + The renaming will not happen if there is no mesh with given current name. + :type oldName: string + :param oldName: + The current name of the mesh whose name to change. + :type newName: string + :param newName: + The new name for the mesh. + """ + return _py3dnacalib.RenameMeshCommand_setName(self, *args) + + def run(self, output): + return _py3dnacalib.RenameMeshCommand_run(self, output) + +# Register RenameMeshCommand in _py3dnacalib: +_py3dnacalib.RenameMeshCommand_swigregister(RenameMeshCommand) + +class RotateCommand(Command): + r""" + RotateCommand is used to rotate neutral joints and vertex positions around given origin. + Notes: + Joint rotations are represented in parent space, so it is enough to rotate only root joints, as that rotation will be propagated to the rest of the joints. + + If the origin is not set, the assumed origin is (0, 0, 0). + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RotateCommand + + def __init__(self, *args): + _py3dnacalib.RotateCommand_swiginit(self, _py3dnacalib.new_RotateCommand(*args)) + + def setRotation(self, degrees): + r""" + Method for setting the rotation angles. + :type degrees: dnac::Vector3 + :param degrees: + Rotation angles in degrees. + """ + return _py3dnacalib.RotateCommand_setRotation(self, degrees) + + def setOrigin(self, origin): + r""" + Method for setting the rotation origin. + :type origin: dnac::Vector3 + :param origin: + Origin coordinates. + """ + return _py3dnacalib.RotateCommand_setOrigin(self, origin) + + def run(self, output): + return _py3dnacalib.RotateCommand_run(self, output) + +# Register RotateCommand in _py3dnacalib: +_py3dnacalib.RotateCommand_swigregister(RotateCommand) + +class ScaleCommand(Command): + r""" + ScaleCommand is used to scale neutral joints, vertex positions and joint and blendshape deltas by a factor. + Notes: + Only translation attributes of neutral joints and joint deltas are scaled. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_ScaleCommand + + def __init__(self, *args): + _py3dnacalib.ScaleCommand_swiginit(self, _py3dnacalib.new_ScaleCommand(*args)) + + def setScale(self, scale): + r""" + Method for setting the scale factor to multiply with. + :type scale: float + :param scale: + Scale factor. + """ + return _py3dnacalib.ScaleCommand_setScale(self, scale) + + def setOrigin(self, origin): + r""" + Method for setting the origin. + Notes: The origin is used to properly scale position values (vertex positions and neutral joint translations). + :type origin: dnac::Vector3 + :param origin: + Origin coordinates. + """ + return _py3dnacalib.ScaleCommand_setOrigin(self, origin) + + def run(self, output): + return _py3dnacalib.ScaleCommand_run(self, output) + +# Register ScaleCommand in _py3dnacalib: +_py3dnacalib.ScaleCommand_swigregister(ScaleCommand) + +class SetBlendShapeTargetDeltasCommand(Command): + r""" SetBlendShapeTargetDeltasCommand is used to change blend shape target deltas.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_SetBlendShapeTargetDeltasCommand + + def __init__(self, *args): + _py3dnacalib.SetBlendShapeTargetDeltasCommand_swiginit(self, _py3dnacalib.new_SetBlendShapeTargetDeltasCommand(*args)) + + def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh whose blend shape target to change. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setMeshIndex(self, meshIndex) + + def setBlendShapeTargetIndex(self, blendShapeTargetIndex): + r""" + Method for setting the index of the blend shape target to change. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + The blend shape target index. + """ + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setBlendShapeTargetIndex(self, blendShapeTargetIndex) + + def setDeltas(self, *args): + r""" + *Overload 1:* + + Method for setting the values used to calculate new deltas for blend shape target. + :type deltas: dnac::ConstArrayView< dnac::Vector3 > + :param deltas: + The values used in calculation. + + | + + *Overload 2:* + + Method for setting the values used to calculate new deltas for blend shape target. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X values for each delta. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y values for each delta. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z values for each delta. + """ + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setDeltas(self, *args) + + def setVertexIndices(self, vertexIndices): + r""" + Method for setting the vertex indices that correspond to new deltas. + :type vertexIndices: dnac::ConstArrayView< std::uint32_t > + :param vertexIndices: + The vertexIndices. + """ + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setVertexIndices(self, vertexIndices) + + def setMasks(self, masks): + r""" + Method for setting masks used to calculate new deltas for blend shape target. + Notes: + If no masks are set, default weight value of 1 is used for each delta. + :type masks: dnac::ConstArrayView< float > + :param masks: + The weights for each delta. + """ + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setMasks(self, masks) + + def setOperation(self, operation): + r""" + Method for setting the type of operation used to calculate new deltas for blend shape target. + Notes: + Available operations are: Interpolate, Add, Subtract and Multiply. Each delta is calculated based on the provided operation type in the following way: + + Interpolate: = previousValue * (1 - weight) + setValue * weight:math:`\n Add: \f$newValue = previousValue + (setValue * weight)` + + Subtract: = previousValue - (setValue * weight):math:`\n Multiply: \f$newValue = previousValue * (setValue * weight)` + + + setValue is the value from new deltas that were set, and weight is the value from masks array. + :type operation: int + :param operation: + The operation to use. + """ + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setOperation(self, operation) + + def run(self, output): + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_run(self, output) + +# Register SetBlendShapeTargetDeltasCommand in _py3dnacalib: +_py3dnacalib.SetBlendShapeTargetDeltasCommand_swigregister(SetBlendShapeTargetDeltasCommand) +cvar = _py3dnacalib.cvar +SetBlendShapeTargetDeltasCommand.VertexIndicesOutOfBoundsError = _py3dnacalib.cvar.SetBlendShapeTargetDeltasCommand_VertexIndicesOutOfBoundsError +SetBlendShapeTargetDeltasCommand.NoVertexIndicesSetError = _py3dnacalib.cvar.SetBlendShapeTargetDeltasCommand_NoVertexIndicesSetError +SetBlendShapeTargetDeltasCommand.DeltasVertexIndicesCountMismatch = _py3dnacalib.cvar.SetBlendShapeTargetDeltasCommand_DeltasVertexIndicesCountMismatch +SetBlendShapeTargetDeltasCommand.DeltasMasksCountMismatch = _py3dnacalib.cvar.SetBlendShapeTargetDeltasCommand_DeltasMasksCountMismatch + +class SetLODsCommand(Command): + r""" SetLODsCommand is used to specify LODs to use. Joints, blend shapes, animated maps and meshes that are not in specified LODs are removed from the DNA.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_SetLODsCommand + + def __init__(self, *args): + _py3dnacalib.SetLODsCommand_swiginit(self, _py3dnacalib.new_SetLODsCommand(*args)) + + def setLODs(self, lods): + r""" + Method for setting the LODs to keep. + :type lods: dnac::ConstArrayView< std::uint16_t > + :param lods: + New LODs to be used. + """ + return _py3dnacalib.SetLODsCommand_setLODs(self, lods) + + def run(self, output): + return _py3dnacalib.SetLODsCommand_run(self, output) + +# Register SetLODsCommand in _py3dnacalib: +_py3dnacalib.SetLODsCommand_swigregister(SetLODsCommand) + +class SetNeutralJointRotationsCommand(Command): + r""" SetNeutralJointRotationsCommand is used to set new rotation values to neutral joints.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_SetNeutralJointRotationsCommand + + def __init__(self, *args): + _py3dnacalib.SetNeutralJointRotationsCommand_swiginit(self, _py3dnacalib.new_SetNeutralJointRotationsCommand(*args)) + + def setRotations(self, *args): + r""" + *Overload 1:* + + Method for setting the neutral joint rotations. + :type rotations: dnac::ConstArrayView< dnac::Vector3 > + :param rotations: + Rotation values for each joint. + + | + + *Overload 2:* + + Method for setting the neutral joint rotations. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X rotation value for each joint. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y rotation value for each joint. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z rotation value for each joint. + """ + return _py3dnacalib.SetNeutralJointRotationsCommand_setRotations(self, *args) + + def run(self, output): + return _py3dnacalib.SetNeutralJointRotationsCommand_run(self, output) + +# Register SetNeutralJointRotationsCommand in _py3dnacalib: +_py3dnacalib.SetNeutralJointRotationsCommand_swigregister(SetNeutralJointRotationsCommand) + +class SetNeutralJointTranslationsCommand(Command): + r""" SetNeutralJointTranslationsCommand is used to set new translation values to neutral joints.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_SetNeutralJointTranslationsCommand + + def __init__(self, *args): + _py3dnacalib.SetNeutralJointTranslationsCommand_swiginit(self, _py3dnacalib.new_SetNeutralJointTranslationsCommand(*args)) + + def setTranslations(self, *args): + r""" + *Overload 1:* + + Method for setting the neutral joint translations. + :type translations: dnac::ConstArrayView< dnac::Vector3 > + :param translations: + Translation values for each joint. + + | + + *Overload 2:* + + Method for setting the neutral joint translations. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X translation value for each joint. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y translation value for each joint. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z translation value for each joint. + """ + return _py3dnacalib.SetNeutralJointTranslationsCommand_setTranslations(self, *args) + + def run(self, output): + return _py3dnacalib.SetNeutralJointTranslationsCommand_run(self, output) + +# Register SetNeutralJointTranslationsCommand in _py3dnacalib: +_py3dnacalib.SetNeutralJointTranslationsCommand_swigregister(SetNeutralJointTranslationsCommand) + +class SetSkinWeightsCommand(Command): + r""" SetSkinWeightsCommand is used to set new skin weights for a vertex in a mesh.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_SetSkinWeightsCommand + + def __init__(self, *args): + _py3dnacalib.SetSkinWeightsCommand_swiginit(self, _py3dnacalib.new_SetSkinWeightsCommand(*args)) + + def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the targeted mesh. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ + return _py3dnacalib.SetSkinWeightsCommand_setMeshIndex(self, meshIndex) + + def setVertexIndex(self, vertexIndex): + r""" + Method for setting the index of the vertex to change. + :type vertexIndex: int + :param vertexIndex: + The vertex index. + """ + return _py3dnacalib.SetSkinWeightsCommand_setVertexIndex(self, vertexIndex) + + def setWeights(self, weights): + r""" + Method for setting the weights with which joints influence the vertex in question. + :type weights: dnac::ConstArrayView< float > + :param weights: + Weights for each joint that has an influence on the vertex. + """ + return _py3dnacalib.SetSkinWeightsCommand_setWeights(self, weights) + + def setJointIndices(self, jointIndices): + r""" + Method for setting the joint indices of joints that influence the vertex in question. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + Joint indices of joints that have an influence on the vertex. + """ + return _py3dnacalib.SetSkinWeightsCommand_setJointIndices(self, jointIndices) + + def run(self, output): + return _py3dnacalib.SetSkinWeightsCommand_run(self, output) + +# Register SetSkinWeightsCommand in _py3dnacalib: +_py3dnacalib.SetSkinWeightsCommand_swigregister(SetSkinWeightsCommand) + +class SetVertexPositionsCommand(Command): + r""" SetVertexPositionsCommand is used to change vertex positions values.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_SetVertexPositionsCommand + + def __init__(self, *args): + _py3dnacalib.SetVertexPositionsCommand_swiginit(self, _py3dnacalib.new_SetVertexPositionsCommand(*args)) + + def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to change. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ + return _py3dnacalib.SetVertexPositionsCommand_setMeshIndex(self, meshIndex) + + def setPositions(self, *args): + r""" + *Overload 1:* + + Method for setting the vertex positions used to calculate new values. + :type positions: dnac::ConstArrayView< dnac::Vector3 > + :param positions: + The vertex positions. + + | + + *Overload 2:* + + Method for setting the vertex positions used to calculate new values. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X coordinates for each vertex. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y coordinates for each vertex. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z coordinates for each vertex. + """ + return _py3dnacalib.SetVertexPositionsCommand_setPositions(self, *args) + + def setMasks(self, masks): + r""" + Method for setting vertex masks used to calculate new vertex position values. + Notes: + If no masks are set, default weight value of 1 is used for each vertex. + :type masks: dnac::ConstArrayView< float > + :param masks: + The weights for each vertex. + """ + return _py3dnacalib.SetVertexPositionsCommand_setMasks(self, masks) + + def setOperation(self, operation): + r""" + Method for setting the type of operation used to calculate new vertex position values. + Notes: + Available operations are: Interpolate, Add, Subtract and Multiply. Each position is calculated based on the provided operation type in the following way: + + Interpolate: = previousValue * (1 - weight) + setValue * weight:math:`\n Add: \f$newValue = previousValue + (setValue * weight)` + + Subtract: = previousValue - (setValue * weight):math:`\n Multiply: \f$newValue = previousValue * (setValue * weight)` + + + setValue is the value from new positions that were set, and weight is the value from masks array. + :type operation: int + :param operation: + The operation to use. + """ + return _py3dnacalib.SetVertexPositionsCommand_setOperation(self, operation) + + def run(self, output): + return _py3dnacalib.SetVertexPositionsCommand_run(self, output) + +# Register SetVertexPositionsCommand in _py3dnacalib: +_py3dnacalib.SetVertexPositionsCommand_swigregister(SetVertexPositionsCommand) +SetVertexPositionsCommand.PositionsMasksCountMismatch = _py3dnacalib.cvar.SetVertexPositionsCommand_PositionsMasksCountMismatch + +class TranslateCommand(Command): + r""" + TranslateCommand is used to translate neutral joints and vertex positions. + Notes: + Joint translations are represented in parent space, so it is enough to translate only root joints, as that translation will be propagated to the rest of the joints. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_TranslateCommand + + def __init__(self, *args): + _py3dnacalib.TranslateCommand_swiginit(self, _py3dnacalib.new_TranslateCommand(*args)) + + def setTranslation(self, translation): + r""" + Method for setting the translation vector. + :type translation: dnac::Vector3 + :param translation: + The translation vector. + """ + return _py3dnacalib.TranslateCommand_setTranslation(self, translation) + + def run(self, output): + return _py3dnacalib.TranslateCommand_run(self, output) + +# Register TranslateCommand in _py3dnacalib: +_py3dnacalib.TranslateCommand_swigregister(TranslateCommand) + + + diff --git a/lib/Maya2024/linux/libdnacalib.so.6 b/lib/Maya2024/linux/libdnacalib.so.6 new file mode 100644 index 0000000..4c8d877 Binary files /dev/null and b/lib/Maya2024/linux/libdnacalib.so.6 differ diff --git a/lib/Maya2024/linux/libembeddedRL4.so b/lib/Maya2024/linux/libembeddedRL4.so new file mode 100644 index 0000000..dd37454 Binary files /dev/null and b/lib/Maya2024/linux/libembeddedRL4.so differ diff --git a/lib/Maya2024/windows/MayaUERBFPlugin.mll b/lib/Maya2024/windows/MayaUERBFPlugin.mll new file mode 100644 index 0000000..d8e253d Binary files /dev/null and b/lib/Maya2024/windows/MayaUERBFPlugin.mll differ diff --git a/lib/Maya2024/windows/_py3dna.pyd b/lib/Maya2024/windows/_py3dna.pyd new file mode 100644 index 0000000..e0907ea Binary files /dev/null and b/lib/Maya2024/windows/_py3dna.pyd differ diff --git a/lib/Maya2024/windows/_py3dnacalib.pyd b/lib/Maya2024/windows/_py3dnacalib.pyd new file mode 100644 index 0000000..930f396 Binary files /dev/null and b/lib/Maya2024/windows/_py3dnacalib.pyd differ diff --git a/lib/Maya2024/windows/dna.py b/lib/Maya2024/windows/dna.py new file mode 100644 index 0000000..a25f827 --- /dev/null +++ b/lib/Maya2024/windows/dna.py @@ -0,0 +1,3862 @@ +# This file was automatically generated by SWIG (https://www.swig.org). +# Version 4.1.1 +# +# Do not make changes to this file unless you know what you are doing - modify +# the SWIG interface file instead. + + +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass + + + +from sys import version_info as _swig_python_version_info +# Import the low-level C/C++ module +if __package__ or "." in __name__: + from . import _py3dna +else: + import _py3dna + +try: + import builtins as __builtin__ +except ImportError: + import __builtin__ + +def _swig_repr(self): + try: + strthis = "proxy of " + self.this.__repr__() + except __builtin__.Exception: + strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + + +def _swig_setattr_nondynamic_instance_variable(set): + def set_instance_attr(self, name, value): + if name == "this": + set(self, name, value) + elif name == "thisown": + self.this.own(value) + elif hasattr(self, name) and isinstance(getattr(type(self), name), property): + set(self, name, value) + else: + raise AttributeError("You cannot add instance attributes to %s" % self) + return set_instance_attr + + +def _swig_setattr_nondynamic_class_variable(set): + def set_class_attr(cls, name, value): + if hasattr(cls, name) and not isinstance(getattr(cls, name), property): + set(cls, name, value) + else: + raise AttributeError("You cannot add class attributes to %s" % cls) + return set_class_attr + + +def _swig_add_metaclass(metaclass): + """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" + def wrapper(cls): + return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) + return wrapper + + +class _SwigNonDynamicMeta(type): + """Meta class to enforce nondynamic attributes (no new attributes) for a class""" + __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) + + + +def with_metaclass(meta, *bases): + class metaclass(type): + + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) + +class MemoryResource(object): + r""" + MemoryResource is an abstract class that allows the implementation of polymorphic allocators. + Notes: + It's purpose is to allow passing arbitrary allocators through API boundaries, without requiring changes in the + signatures and types involved. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_MemoryResource + + def allocate(self, size, alignment): + return _py3dna.MemoryResource_allocate(self, size, alignment) + + def deallocate(self, ptr, size, alignment): + return _py3dna.MemoryResource_deallocate(self, ptr, size, alignment) + +# Register MemoryResource in _py3dna: +_py3dna.MemoryResource_swigregister(MemoryResource) +class AlignedMemoryResource(MemoryResource): + r""" + A MemoryResource that honors alignment requirements. + See also: MemoryResource + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def allocate(self, size, alignment): + return _py3dna.AlignedMemoryResource_allocate(self, size, alignment) + + def deallocate(self, ptr, size, alignment): + return _py3dna.AlignedMemoryResource_deallocate(self, ptr, size, alignment) + + def __init__(self): + _py3dna.AlignedMemoryResource_swiginit(self, _py3dna.new_AlignedMemoryResource()) + __swig_destroy__ = _py3dna.delete_AlignedMemoryResource + +# Register AlignedMemoryResource in _py3dna: +_py3dna.AlignedMemoryResource_swigregister(AlignedMemoryResource) +class ArenaMemoryResource(MemoryResource): + r""" + Serves allocations from a preallocated memory region. + See also: MemoryResource + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_ArenaMemoryResource + + def __init__(self, *args): + _py3dna.ArenaMemoryResource_swiginit(self, _py3dna.new_ArenaMemoryResource(*args)) + + def allocate(self, size, alignment): + r""" All allocations will be served from the currently active memory region.""" + return _py3dna.ArenaMemoryResource_allocate(self, size, alignment) + + def deallocate(self, ptr, size, alignment): + r""" This is a no-op, and the regions are only freed when the arena itself is destroyed.""" + return _py3dna.ArenaMemoryResource_deallocate(self, ptr, size, alignment) + + def getUpstreamMemoryResource(self): + r""" The upstream memory resource was passed through the constructor and is backing all arena allocations.""" + return _py3dna.ArenaMemoryResource_getUpstreamMemoryResource(self) + +# Register ArenaMemoryResource in _py3dna: +_py3dna.ArenaMemoryResource_swigregister(ArenaMemoryResource) +class DefaultMemoryResource(MemoryResource): + r""" + A MemoryResource that delegates to malloc / free. + See also: MemoryResource + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def allocate(self, size, alignment): + return _py3dna.DefaultMemoryResource_allocate(self, size, alignment) + + def deallocate(self, ptr, size, alignment): + return _py3dna.DefaultMemoryResource_deallocate(self, ptr, size, alignment) + + def __init__(self): + _py3dna.DefaultMemoryResource_swiginit(self, _py3dna.new_DefaultMemoryResource()) + __swig_destroy__ = _py3dna.delete_DefaultMemoryResource + +# Register DefaultMemoryResource in _py3dna: +_py3dna.DefaultMemoryResource_swigregister(DefaultMemoryResource) +class StatusCode(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + code = property(_py3dna.StatusCode_code_get, _py3dna.StatusCode_code_set) + message = property(_py3dna.StatusCode_message_get, _py3dna.StatusCode_message_set) + + def __init__(self): + _py3dna.StatusCode_swiginit(self, _py3dna.new_StatusCode()) + __swig_destroy__ = _py3dna.delete_StatusCode + +# Register StatusCode in _py3dna: +_py3dna.StatusCode_swigregister(StatusCode) +class Status(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + @staticmethod + def isOk(): + return _py3dna.Status_isOk() + + @staticmethod + def get(): + return _py3dna.Status_get() + + def __init__(self): + _py3dna.Status_swiginit(self, _py3dna.new_Status()) + __swig_destroy__ = _py3dna.delete_Status + +# Register Status in _py3dna: +_py3dna.Status_swigregister(Status) +class Readable(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def read(self, *args): + r""" + *Overload 1:* + + Read bytes from stream into the given buffer. + :type destination: string + :param destination: + Destination buffer into which the data is going to be read from the stream. + :type size: std::size_t + :param size: + Number of bytes to read from stream. + :rtype: std::size_t + :return: + Number of bytes read. + + | + + *Overload 2:* + + Read bytes from this stream into the given stream. + :type destination: :py:class:`Writable` + :param destination: + Destination stream into which the data is going to be read from this stream. + :type size: std::size_t + :param size: + Number of bytes to read from stream. + :rtype: std::size_t + :return: + Number of bytes read. + """ + return _py3dna.Readable_read(self, *args) + +# Register Readable in _py3dna: +_py3dna.Readable_swigregister(Readable) +class Writable(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def write(self, *args): + r""" + *Overload 1:* + + Writes bytes from the given buffer to the stream. + :type source: string + :param source: + Source buffer from which the data is going to be written to the stream. + :type size: std::size_t + :param size: + Number of bytes to write to the stream. + :rtype: std::size_t + :return: + Number of bytes written. + + | + + *Overload 2:* + + Writes bytes from the given stream to this stream. + :type source: :py:class:`Readable` + :param source: + Source stream from which the data is going to be written into this stream. + :type size: std::size_t + :param size: + Number of bytes to write to the stream. + :rtype: std::size_t + :return: + Number of bytes written. + """ + return _py3dna.Writable_write(self, *args) + +# Register Writable in _py3dna: +_py3dna.Writable_swigregister(Writable) +class Seekable(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def tell(self): + r""" + Get the current position in the stream. + :rtype: int + :return: + Position in the stream relative to it's start, with 0 denoting the start position. + """ + return _py3dna.Seekable_tell(self) + + def seek(self, position): + r""" + Set the current position in the stream. + :type position: int + :param position: + Position in the stream relative to it's start, with 0 denoting the start position. + """ + return _py3dna.Seekable_seek(self, position) + +# Register Seekable in _py3dna: +_py3dna.Seekable_swigregister(Seekable) +class Openable(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def open(self): + r""" Open access to the stream.""" + return _py3dna.Openable_open(self) + +# Register Openable in _py3dna: +_py3dna.Openable_swigregister(Openable) +class Closeable(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def close(self): + r""" Close access to the stream.""" + return _py3dna.Closeable_close(self) + +# Register Closeable in _py3dna: +_py3dna.Closeable_swigregister(Closeable) +class Controllable(Openable, Closeable): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + +# Register Controllable in _py3dna: +_py3dna.Controllable_swigregister(Controllable) +class Bounded(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def size(self): + r""" + Obtain size of stream in bytes. + :rtype: int + :return: + Size in bytes. + """ + return _py3dna.Bounded_size(self) + +# Register Bounded in _py3dna: +_py3dna.Bounded_swigregister(Bounded) +class Buffered(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def flush(self): + r""" Flush the changes to filesystem.""" + return _py3dna.Buffered_flush(self) + +# Register Buffered in _py3dna: +_py3dna.Buffered_swigregister(Buffered) +class Resizable(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def resize(self, size): + r""" Resize file to the requested size.""" + return _py3dna.Resizable_resize(self, size) + +# Register Resizable in _py3dna: +_py3dna.Resizable_swigregister(Resizable) +class BoundedIOStream(Controllable, Readable, Writable, Seekable, Bounded): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_BoundedIOStream + +# Register BoundedIOStream in _py3dna: +_py3dna.BoundedIOStream_swigregister(BoundedIOStream) +cvar = _py3dna.cvar +BoundedIOStream.OpenError = _py3dna.cvar.BoundedIOStream_OpenError +BoundedIOStream.ReadError = _py3dna.cvar.BoundedIOStream_ReadError +BoundedIOStream.WriteError = _py3dna.cvar.BoundedIOStream_WriteError +BoundedIOStream.AlreadyOpenError = _py3dna.cvar.BoundedIOStream_AlreadyOpenError +BoundedIOStream.SeekError = _py3dna.cvar.BoundedIOStream_SeekError + +AccessMode_Read = _py3dna.AccessMode_Read +AccessMode_Write = _py3dna.AccessMode_Write +AccessMode_ReadWrite = _py3dna.AccessMode_ReadWrite +OpenMode_Binary = _py3dna.OpenMode_Binary +OpenMode_Text = _py3dna.OpenMode_Text +class FileStream(BoundedIOStream): + r""" Standard file stream.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(path, accessMode, openMode, memRes=None): + r""" + Factory method for creation of a FileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type openMode: int + :param openMode: + Control whether the file is opened in binary or textual mode. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the FileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.FileStream_create(path, accessMode, openMode, memRes) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a FileStream instance. + :type instance: :py:class:`FileStream` + :param instance: + Instance of FileStream to be freed. + See also: create + """ + return _py3dna.FileStream_destroy(instance) + __swig_destroy__ = _py3dna.delete_FileStream + +# Register FileStream in _py3dna: +_py3dna.FileStream_swigregister(FileStream) +class MemoryMappedFileStream(BoundedIOStream, Buffered, Resizable): + r""" Memory mapped file stream.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(path, accessMode, memRes=None): + r""" + Factory method for creation of a MemoryMappedFileStream instance. + :type path: string + :param path: + UTF-8 encoded path to file to be opened. + :type accessMode: int + :param accessMode: + Control whether the file is opened for reading or writing. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryMappedFileStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.MemoryMappedFileStream_create(path, accessMode, memRes) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a MemoryMappedFileStream instance. + :type instance: :py:class:`MemoryMappedFileStream` + :param instance: + Instance of MemoryMappedFileStream to be freed. + See also: create + """ + return _py3dna.MemoryMappedFileStream_destroy(instance) + __swig_destroy__ = _py3dna.delete_MemoryMappedFileStream + +# Register MemoryMappedFileStream in _py3dna: +_py3dna.MemoryMappedFileStream_swigregister(MemoryMappedFileStream) +class MemoryStream(BoundedIOStream): + r""" In-memory stream.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(*args): + r""" + *Overload 1:* + + Factory method for creation of a MemoryStream instance. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of a MemoryStream instance. + :type initialSize: std::size_t + :param initialSize: + Initial size of the memory stream. + :param memRes: + The memory resource to be used for the allocation of the MemoryStream instance. + Notes: + If a custom memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.MemoryStream_create(*args) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a MemoryStream instance. + :type instance: :py:class:`MemoryStream` + :param instance: + Instance of MemoryStream to be freed. + See also: create + """ + return _py3dna.MemoryStream_destroy(instance) + __swig_destroy__ = _py3dna.delete_MemoryStream + +# Register MemoryStream in _py3dna: +_py3dna.MemoryStream_swigregister(MemoryStream) + +FileStreamImpl = FileStream + +class FileStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(FileStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(FileStreamImpl) if name not in ("create","destroy")] + +class FileStream(with_metaclass(FileStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = FileStreamImpl.create(*args, **kwargs) + + def __del__(self): + FileStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + + +MemoryMappedFileStreamImpl = MemoryMappedFileStream + +class MemoryMappedFileStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(MemoryMappedFileStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(MemoryMappedFileStreamImpl) if name not in ("create","destroy")] + +class MemoryMappedFileStream(with_metaclass(MemoryMappedFileStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = MemoryMappedFileStreamImpl.create(*args, **kwargs) + + def __del__(self): + MemoryMappedFileStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + + +MemoryStreamImpl = MemoryStream + +class MemoryStreamImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(MemoryStreamImpl, name) + + def __dir__(cls): + return [name for name in dir(MemoryStreamImpl) if name not in ("create","destroy")] + +class MemoryStream(with_metaclass(MemoryStreamImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = MemoryStreamImpl.create(*args, **kwargs) + + def __del__(self): + MemoryStreamImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + + +FileStream.AccessMode_Read = AccessMode_Read +FileStream.AccessMode_Write = AccessMode_Write +FileStream.AccessMode_ReadWrite = AccessMode_ReadWrite + +FileStream.OpenMode_Binary = OpenMode_Binary +FileStream.OpenMode_Text = OpenMode_Text + +MemoryMappedFileStream.AccessMode_Read = AccessMode_Read +MemoryMappedFileStream.AccessMode_Write = AccessMode_Write +MemoryMappedFileStream.AccessMode_ReadWrite = AccessMode_ReadWrite + +class StringView(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + def c_str(self): + return _py3dna.StringView_c_str(self) + + def __ref__(self): + return _py3dna.StringView___ref__(self) + + def __init__(self): + _py3dna.StringView_swiginit(self, _py3dna.new_StringView()) + __swig_destroy__ = _py3dna.delete_StringView + +# Register StringView in _py3dna: +_py3dna.StringView_swigregister(StringView) + +def __add__(*args): + return _py3dna.__add__(*args) + +def __sub__(*args): + return _py3dna.__sub__(*args) + +def __mul__(*args): + return _py3dna.__mul__(*args) + +def __truediv__(*args): + return _py3dna.__truediv__(*args) + +def __eq__(lhs, rhs): + return _py3dna.__eq__(lhs, rhs) + +def __ne__(lhs, rhs): + return _py3dna.__ne__(lhs, rhs) +DataLayer_Descriptor = _py3dna.DataLayer_Descriptor +DataLayer_Definition = _py3dna.DataLayer_Definition +DataLayer_Behavior = _py3dna.DataLayer_Behavior +DataLayer_Geometry = _py3dna.DataLayer_Geometry +DataLayer_GeometryWithoutBlendShapes = _py3dna.DataLayer_GeometryWithoutBlendShapes +DataLayer_AllWithoutBlendShapes = _py3dna.DataLayer_AllWithoutBlendShapes +DataLayer_All = _py3dna.DataLayer_All +Archetype_asian = _py3dna.Archetype_asian +Archetype_black = _py3dna.Archetype_black +Archetype_caucasian = _py3dna.Archetype_caucasian +Archetype_hispanic = _py3dna.Archetype_hispanic +Archetype_alien = _py3dna.Archetype_alien +Archetype_other = _py3dna.Archetype_other +Gender_male = _py3dna.Gender_male +Gender_female = _py3dna.Gender_female +Gender_other = _py3dna.Gender_other +TranslationUnit_cm = _py3dna.TranslationUnit_cm +TranslationUnit_m = _py3dna.TranslationUnit_m +RotationUnit_degrees = _py3dna.RotationUnit_degrees +RotationUnit_radians = _py3dna.RotationUnit_radians +Direction_left = _py3dna.Direction_left +Direction_right = _py3dna.Direction_right +Direction_up = _py3dna.Direction_up +Direction_down = _py3dna.Direction_down +Direction_front = _py3dna.Direction_front +Direction_back = _py3dna.Direction_back +class CoordinateSystem(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + xAxis = property(_py3dna.CoordinateSystem_xAxis_get, _py3dna.CoordinateSystem_xAxis_set) + yAxis = property(_py3dna.CoordinateSystem_yAxis_get, _py3dna.CoordinateSystem_yAxis_set) + zAxis = property(_py3dna.CoordinateSystem_zAxis_get, _py3dna.CoordinateSystem_zAxis_set) + + def __init__(self): + _py3dna.CoordinateSystem_swiginit(self, _py3dna.new_CoordinateSystem()) + __swig_destroy__ = _py3dna.delete_CoordinateSystem + +# Register CoordinateSystem in _py3dna: +_py3dna.CoordinateSystem_swigregister(CoordinateSystem) +class DescriptorReader(object): + r""" + Read-only accessors for various metadata about the character and the rig. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def getName(self): + return _py3dna.DescriptorReader_getName(self) + + def getArchetype(self): + return _py3dna.DescriptorReader_getArchetype(self) + + def getGender(self): + return _py3dna.DescriptorReader_getGender(self) + + def getAge(self): + return _py3dna.DescriptorReader_getAge(self) + + def getMetaDataCount(self): + return _py3dna.DescriptorReader_getMetaDataCount(self) + + def getMetaDataKey(self, index): + r""" + :type index: int + :param index: + A position in the zero-indexed array of key-value pairs. + Warning: + The index must be less than the value returned by getMetaDataCount. + :rtype: :py:class:`StringView` + :return: View over the key name string. + """ + return _py3dna.DescriptorReader_getMetaDataKey(self, index) + + def getMetaDataValue(self, key): + r""" + Stored metadata value associated with the given key. + Notes: + If no value is associated with the given key, the returned view + will contain nullptr and will have a size of 0. + :type key: string + :param key: + A unique-known key that has a value associated to it. + Warning: + The key must be null-terminated. + :rtype: :py:class:`StringView` + :return: View over the metadata value string. + """ + return _py3dna.DescriptorReader_getMetaDataValue(self, key) + + def getTranslationUnit(self): + return _py3dna.DescriptorReader_getTranslationUnit(self) + + def getRotationUnit(self): + return _py3dna.DescriptorReader_getRotationUnit(self) + + def getCoordinateSystem(self): + return _py3dna.DescriptorReader_getCoordinateSystem(self) + + def getLODCount(self): + r""" + Available levels of detail (e.g. 6 which means the following levels are available: + [0,1,2,3,4,5], where 0 is the LOD with the highest details, and 5 is the LOD with + lowest details). + """ + return _py3dna.DescriptorReader_getLODCount(self) + + def getDBMaxLOD(self): + r""" + The maximum level of detail stored in the DNA data for this character. + Notes: + The value is relative to LOD-0 from the database. + """ + return _py3dna.DescriptorReader_getDBMaxLOD(self) + + def getDBComplexity(self): + r""" + Name of the input control interface used to drive this character rig. + Notes: + This parameter denotes the character's input control complexity. + """ + return _py3dna.DescriptorReader_getDBComplexity(self) + + def getDBName(self): + r""" + Name of the database from which the character originates. + Notes: + All characters from the same database must have the same Definition, but may + have different complexity or LOD. + """ + return _py3dna.DescriptorReader_getDBName(self) + +# Register DescriptorReader in _py3dna: +_py3dna.DescriptorReader_swigregister(DescriptorReader) +class MeshBlendShapeChannelMapping(object): + r""" Mapping that associates a blend shape channel to it's mesh.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + meshIndex = property(_py3dna.MeshBlendShapeChannelMapping_meshIndex_get, _py3dna.MeshBlendShapeChannelMapping_meshIndex_set) + blendShapeChannelIndex = property(_py3dna.MeshBlendShapeChannelMapping_blendShapeChannelIndex_get, _py3dna.MeshBlendShapeChannelMapping_blendShapeChannelIndex_set) + + def __init__(self): + _py3dna.MeshBlendShapeChannelMapping_swiginit(self, _py3dna.new_MeshBlendShapeChannelMapping()) + __swig_destroy__ = _py3dna.delete_MeshBlendShapeChannelMapping + +# Register MeshBlendShapeChannelMapping in _py3dna: +_py3dna.MeshBlendShapeChannelMapping_swigregister(MeshBlendShapeChannelMapping) +class DefinitionReader(DescriptorReader): + r""" + Read-only accessors for DNA attributes that represent the rig's static data. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def getGUIControlCount(self): + return _py3dna.DefinitionReader_getGUIControlCount(self) + + def getGUIControlName(self, index): + r""" + Name of the requested GUI control. + :type index: int + :param index: + A name's position in the zero-indexed array of GUI control names. + Warning: + The index must be less than the value returned by getGUIControlCount. + :rtype: :py:class:`StringView` + :return: View over the GUI control name string. + """ + return _py3dna.DefinitionReader_getGUIControlName(self, index) + + def getRawControlCount(self): + return _py3dna.DefinitionReader_getRawControlCount(self) + + def getRawControlName(self, index): + r""" + Name of the requested raw control. + :type index: int + :param index: + A name's position in the zero-indexed array of raw control names. + Warning: + The index must be less than the value returned by getRawControlCount. + :rtype: :py:class:`StringView` + :return: View over the control name string. + """ + return _py3dna.DefinitionReader_getRawControlName(self, index) + + def getJointCount(self): + return _py3dna.DefinitionReader_getJointCount(self) + + def getJointName(self, index): + r""" + Name of the requested joint. + :type index: int + :param index: + A name's position in the zero-indexed array of joint names. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: :py:class:`StringView` + :return: View over the joint name string. + """ + return _py3dna.DefinitionReader_getJointName(self, index) + + def getJointIndexListCount(self): + r""" + Number of joint index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ + return _py3dna.DefinitionReader_getJointIndexListCount(self) + + def getJointIndicesForLOD(self, lod): + r""" + List of joint indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which joints are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the joint indices. + See also: getLODCount + See also: getJointName + """ + return _py3dna.DefinitionReader_getJointIndicesForLOD(self, lod) + + def getJointParentIndex(self, index): + r""" + Index of the requested joint's parent. + Notes: + The joint hierarchy may be traversed and reconstructed using this function. Example: + Joint names: [A, B, C, D, E, F, G, H, I] + Hierarchy: [0, 0, 0, 1, 1, 4, 2, 6, 2] + Describes the following hierarchy: + A + + B + | + D + | + E + | + F + + C + + G + | + H + + I + + Requesting the parent index of joint 5 (joint name: F) would return 4 (joint name: E). + Requesting the parent index of the root joint: 0 (joint name: A) would return the same index 0. + An out of bounds request (an index greater than the number of joints returns UINT16_MAX). + :type index: int + :param index: + The joint index which parent is being requested. + """ + return _py3dna.DefinitionReader_getJointParentIndex(self, index) + + def getBlendShapeChannelCount(self): + return _py3dna.DefinitionReader_getBlendShapeChannelCount(self) + + def getBlendShapeChannelName(self, index): + r""" + Name of the requested blend shape channel. + :type index: int + :param index: + A name's position in the zero-indexed array of blend shape channel names. + Warning: + The index must be less than the value returned by BlendShapeChannelExtentReader::getBlendShapeChannelCount. + :rtype: :py:class:`StringView` + :return: View over the blend shape channel name string. + """ + return _py3dna.DefinitionReader_getBlendShapeChannelName(self, index) + + def getBlendShapeChannelIndexListCount(self): + r""" + Number of blend shape channel index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ + return _py3dna.DefinitionReader_getBlendShapeChannelIndexListCount(self) + + def getBlendShapeChannelIndicesForLOD(self, lod): + r""" + List of blend shape channel indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which blend shape channels are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the blend shape channel indices. + + These LOD indices are not interchangeable with the LOD values from BehaviorReader::getBlendShapeChannelLODs. + See also: getLODCount + See also: getBlendShapeChannelName + """ + return _py3dna.DefinitionReader_getBlendShapeChannelIndicesForLOD(self, lod) + + def getAnimatedMapCount(self): + return _py3dna.DefinitionReader_getAnimatedMapCount(self) + + def getAnimatedMapName(self, index): + r""" + Name of the requested animated map. + :type index: int + :param index: + A name's position in the zero-indexed array of animated map names. + Warning: + The index must be less than the value returned by getAnimatedMapCount. + :rtype: :py:class:`StringView` + :return: View over the animated map name string. + """ + return _py3dna.DefinitionReader_getAnimatedMapName(self, index) + + def getAnimatedMapIndexListCount(self): + r""" + Number of animated map index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ + return _py3dna.DefinitionReader_getAnimatedMapIndexListCount(self) + + def getAnimatedMapIndicesForLOD(self, lod): + r""" + List of animated map indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which animated maps are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the animated map indices. + See also: getLODCount + See also: getAnimatedMapName + """ + return _py3dna.DefinitionReader_getAnimatedMapIndicesForLOD(self, lod) + + def getMeshCount(self): + return _py3dna.DefinitionReader_getMeshCount(self) + + def getMeshName(self, index): + r""" + Name of the requested mesh. + :type index: int + :param index: + A name's position in the zero-indexed array of mesh names. + Warning: + The index must be less than the value returned by getMeshCount. + :rtype: :py:class:`StringView` + :return: View over the mesh name string. + """ + return _py3dna.DefinitionReader_getMeshName(self, index) + + def getMeshIndexListCount(self): + r""" + Number of mesh index lists. + Notes: + This value is useful only in the context of DefinitionWriter. + """ + return _py3dna.DefinitionReader_getMeshIndexListCount(self) + + def getMeshIndicesForLOD(self, lod): + r""" + List of mesh indices for the specified LOD. + :type lod: int + :param lod: + The level of detail which meshes are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the mesh indices. + See also: getLODCount + See also: getMeshName + """ + return _py3dna.DefinitionReader_getMeshIndicesForLOD(self, lod) + + def getMeshBlendShapeChannelMappingCount(self): + r""" Number of mesh-blend shape channel mapping items.""" + return _py3dna.DefinitionReader_getMeshBlendShapeChannelMappingCount(self) + + def getMeshBlendShapeChannelMapping(self, index): + r""" + :type index: int + :param index: + A mapping's position in the zero-indexed array of mesh-blend shape channel mappings. + Warning: + The index must be less than the value returned by getMeshBlendShapeChannelMappingCount. + :rtype: :py:class:`MeshBlendShapeChannelMapping` + :return: A structure holding the mesh index and the associated blend shape channel index. + """ + return _py3dna.DefinitionReader_getMeshBlendShapeChannelMapping(self, index) + + def getMeshBlendShapeChannelMappingIndicesForLOD(self, lod): + r""" + List of mesh-blend shape channel mapping indices for the specified LOD. + Notes: + The indices from this list can be used with the getMeshBlendShapeChannelMapping API + to retrieve individual mapping items. + :type lod: int + :param lod: + The level of detail which meshes are being requested. + Warning: + The lod index must be less than the value returned by getLODCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the mesh blend shape channel mapping indices. + See also: getLODCount + See also: getMeshBlendShapeChannelMapping + """ + return _py3dna.DefinitionReader_getMeshBlendShapeChannelMappingIndicesForLOD(self, lod) + + def getNeutralJointTranslation(self, index): + r""" + :type index: int + :param index: + A joint's position in the zero-indexed array of joint translations. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: dna::Vector3 + :return: The joint's translation (x, y, z). + """ + return _py3dna.DefinitionReader_getNeutralJointTranslation(self, index) + + def getNeutralJointTranslationXs(self): + r""" + List of all translation X values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getNeutralJointTranslation + """ + return _py3dna.DefinitionReader_getNeutralJointTranslationXs(self) + + def getNeutralJointTranslationYs(self): + r""" + List of all translation Y values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getNeutralJointTranslation + """ + return _py3dna.DefinitionReader_getNeutralJointTranslationYs(self) + + def getNeutralJointTranslationZs(self): + r""" + List of all translation Z values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointTranslation. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getNeutralJointTranslation + """ + return _py3dna.DefinitionReader_getNeutralJointTranslationZs(self) + + def getNeutralJointRotation(self, index): + r""" + :type index: int + :param index: + A joint's position in the zero-indexed array of joint rotations. + Warning: + The index must be less than the value returned by getJointCount. + :rtype: dna::Vector3 + :return: The joint's rotation (x, y, z). + """ + return _py3dna.DefinitionReader_getNeutralJointRotation(self, index) + + def getNeutralJointRotationXs(self): + r""" + List of all rotation X values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getNeutralJointRotation + """ + return _py3dna.DefinitionReader_getNeutralJointRotationXs(self) + + def getNeutralJointRotationYs(self): + r""" + List of all rotation Y values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getNeutralJointRotation + """ + return _py3dna.DefinitionReader_getNeutralJointRotationYs(self) + + def getNeutralJointRotationZs(self): + r""" + List of all rotation Z values. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getNeutralJointRotation. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getNeutralJointRotation + """ + return _py3dna.DefinitionReader_getNeutralJointRotationZs(self) + +# Register DefinitionReader in _py3dna: +_py3dna.DefinitionReader_swigregister(DefinitionReader) +class BehaviorReader(DefinitionReader): + r""" + Read-only accessors for DNA attributes that define the rig's evaluation. + Warning: + Implementors should inherit from Reader itself and not this class. + See also: Reader + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def getGUIToRawInputIndices(self): + r""" + Input indices used for mapping gui to raw controls. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ + return _py3dna.BehaviorReader_getGUIToRawInputIndices(self) + + def getGUIToRawOutputIndices(self): + r""" + Output indices used for mapping gui to raw controls. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ + return _py3dna.BehaviorReader_getGUIToRawOutputIndices(self) + + def getGUIToRawFromValues(self): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ + return _py3dna.BehaviorReader_getGUIToRawFromValues(self) + + def getGUIToRawToValues(self): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ + return _py3dna.BehaviorReader_getGUIToRawToValues(self) + + def getGUIToRawSlopeValues(self): + r""" + Computational values(slope/gradient) used for calculating the + output value during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ + return _py3dna.BehaviorReader_getGUIToRawSlopeValues(self) + + def getGUIToRawCutValues(self): + r""" + Computational values(vertical intercept) used for calculating the + output value during gui to raw control mapping. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ + return _py3dna.BehaviorReader_getGUIToRawCutValues(self) + + def getPSDCount(self): + r""" The number of distinct PSD expressions.""" + return _py3dna.BehaviorReader_getPSDCount(self) + + def getPSDRowIndices(self): + r""" + PSD(input) indices. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of PSD indices. + """ + return _py3dna.BehaviorReader_getPSDRowIndices(self) + + def getPSDColumnIndices(self): + r""" + Control(input) indices. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of control indices. + """ + return _py3dna.BehaviorReader_getPSDColumnIndices(self) + + def getPSDValues(self): + r""" + Weights associated with each PSD row and column pair. + :rtype: dna::ConstArrayView< float > + :return: View over the array of weights. + """ + return _py3dna.BehaviorReader_getPSDValues(self) + + def getJointRowCount(self): + r""" Number of rows in the entire, uncompressed joint matrix.""" + return _py3dna.BehaviorReader_getJointRowCount(self) + + def getJointColumnCount(self): + r""" Number of columns in the entire, uncompressed joint matrix.""" + return _py3dna.BehaviorReader_getJointColumnCount(self) + + def getJointVariableAttributeIndices(self, lod): + r""" + Joint attribute indices (output indices) for the requested LOD. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of joint indices. + """ + return _py3dna.BehaviorReader_getJointVariableAttributeIndices(self, lod) + + def getJointGroupCount(self): + r""" Number of joint groups present in the entire joint matrix.""" + return _py3dna.BehaviorReader_getJointGroupCount(self) + + def getJointGroupLODs(self, jointGroupIndex): + r""" + Number of rows per each level of detail for the requested joint group. + Notes: + Each element's position represents the level itself, while the value denotes + the number of rows within the joint group belonging to that level. e.g.: + [12, 9, 3] + | | + LOD-2 contains first 3 rows + | + LOD-1 contains first 9 rows + + LOD-0 contains first 12 rows + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ + return _py3dna.BehaviorReader_getJointGroupLODs(self, jointGroupIndex) + + def getJointGroupInputIndices(self, jointGroupIndex): + r""" + Column indices that the requested joint group contains. + Notes: + The column indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of column indices. + """ + return _py3dna.BehaviorReader_getJointGroupInputIndices(self, jointGroupIndex) + + def getJointGroupOutputIndices(self, jointGroupIndex): + r""" + Row indices that the requested joint group contains. + Notes: + The row indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of row indices. + """ + return _py3dna.BehaviorReader_getJointGroupOutputIndices(self, jointGroupIndex) + + def getJointGroupValues(self, jointGroupIndex): + r""" + Values that the requested joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< float > + :return: View over the array of values. + """ + return _py3dna.BehaviorReader_getJointGroupValues(self, jointGroupIndex) + + def getJointGroupJointIndices(self, jointGroupIndex): + r""" + Joint indices that the requested joint group contains. + Notes: + These joint indices can be used to get the joint names through DefinitionReader::getJointName. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of joint indices. + See also: DefinitionReader + """ + return _py3dna.BehaviorReader_getJointGroupJointIndices(self, jointGroupIndex) + + def getBlendShapeChannelLODs(self): + r""" + Input index count per each level of detail for blend shape channels. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of input indices belonging to that level. + Warning: + These LOD values are not interchangeable with the LOD indices from DefinitionReader::getBlendShapeChannelIndicesForLOD. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ + return _py3dna.BehaviorReader_getBlendShapeChannelLODs(self) + + def getBlendShapeChannelInputIndices(self): + r""" + Input indices used to index into the input vector. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ + return _py3dna.BehaviorReader_getBlendShapeChannelInputIndices(self) + + def getBlendShapeChannelOutputIndices(self): + r""" + Output indices specify the positions of blend shape channel output values. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ + return _py3dna.BehaviorReader_getBlendShapeChannelOutputIndices(self) + + def getAnimatedMapLODs(self): + r""" + Row count per each level of detail for animated maps. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of rows (within the conditional table), + belonging to that level. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of LOD bounds. + """ + return _py3dna.BehaviorReader_getAnimatedMapLODs(self) + + def getAnimatedMapInputIndices(self): + r""" + Input indices used to index into the array of input values. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of input indices. + """ + return _py3dna.BehaviorReader_getAnimatedMapInputIndices(self) + + def getAnimatedMapOutputIndices(self): + r""" + Output indices that specify the computed output value's position. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the array of output indices. + """ + return _py3dna.BehaviorReader_getAnimatedMapOutputIndices(self) + + def getAnimatedMapFromValues(self): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ + return _py3dna.BehaviorReader_getAnimatedMapFromValues(self) + + def getAnimatedMapToValues(self): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not. + :rtype: dna::ConstArrayView< float > + :return: View over the array of filter values. + """ + return _py3dna.BehaviorReader_getAnimatedMapToValues(self) + + def getAnimatedMapSlopeValues(self): + r""" + Computational values(slope/gradient) used for calculating the output value. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ + return _py3dna.BehaviorReader_getAnimatedMapSlopeValues(self) + + def getAnimatedMapCutValues(self): + r""" + Computational values(vertical intercept) used for calculating the output value. + :rtype: dna::ConstArrayView< float > + :return: View over the array of computational values. + """ + return _py3dna.BehaviorReader_getAnimatedMapCutValues(self) + +# Register BehaviorReader in _py3dna: +_py3dna.BehaviorReader_swigregister(BehaviorReader) +class GeometryReader(DefinitionReader): + r""" + Read-only accessors to the geometry data associated with a rig. + Warning: + Implementors should inherit from Reader itself and not this class. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def getVertexPositionCount(self, meshIndex): + r""" + Number of vertex positions in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getVertexPositionCount(self, meshIndex) + + def getVertexPosition(self, meshIndex, vertexIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + The index of the vertex position in the zero-indexed array of vertex positions. + + vertexIndex must be less than the value returned by getVertexPositionCount. + Notes: + The vertices are sorted by the vertex ID. + :rtype: dna::Position + :return: The vertex position. + """ + return _py3dna.GeometryReader_getVertexPosition(self, meshIndex, vertexIndex) + + def getVertexPositionXs(self, meshIndex): + r""" + List of all vertex position X values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getVertexPosition + """ + return _py3dna.GeometryReader_getVertexPositionXs(self, meshIndex) + + def getVertexPositionYs(self, meshIndex): + r""" + List of all vertex position Y values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getVertexPosition + """ + return _py3dna.GeometryReader_getVertexPositionYs(self, meshIndex) + + def getVertexPositionZs(self, meshIndex): + r""" + List of all vertex position Z values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexPosition. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getVertexPosition + """ + return _py3dna.GeometryReader_getVertexPositionZs(self, meshIndex) + + def getVertexTextureCoordinateCount(self, meshIndex): + r""" + Number of texture coordinates in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getVertexTextureCoordinateCount(self, meshIndex) + + def getVertexTextureCoordinate(self, meshIndex, textureCoordinateIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type textureCoordinateIndex: int + :param textureCoordinateIndex: + The index of the texture coordinate in the zero-indexed array of texture coordinates. + + textureCoordinateIndex must be less than the value returned by getVertexTextureCoordinateCount. + :rtype: dna::TextureCoordinate + :return: The texture coordinate. + """ + return _py3dna.GeometryReader_getVertexTextureCoordinate(self, meshIndex, textureCoordinateIndex) + + def getVertexTextureCoordinateUs(self, meshIndex): + r""" + List of all texture coordinate U values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexTextureCoordinate. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all U values. + See also: getVertexTextureCoordinate + """ + return _py3dna.GeometryReader_getVertexTextureCoordinateUs(self, meshIndex) + + def getVertexTextureCoordinateVs(self, meshIndex): + r""" + List of all texture coordinate V values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexTextureCoordinate. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all V values. + See also: getVertexTextureCoordinate + """ + return _py3dna.GeometryReader_getVertexTextureCoordinateVs(self, meshIndex) + + def getVertexNormalCount(self, meshIndex): + r""" + Number of vertex normals in the entire mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getVertexNormalCount(self, meshIndex) + + def getVertexNormal(self, meshIndex, normalIndex): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type normalIndex: int + :param normalIndex: + The index of the vertex normal in the zero-indexed array of vertex normals. + + normalIndex must be less than the value returned by getVertexNormalCount. + :rtype: dna::Normal + :return: The vertex normal. + """ + return _py3dna.GeometryReader_getVertexNormal(self, meshIndex, normalIndex) + + def getVertexNormalXs(self, meshIndex): + r""" + List of all normal X values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getVertexNormal + """ + return _py3dna.GeometryReader_getVertexNormalXs(self, meshIndex) + + def getVertexNormalYs(self, meshIndex): + r""" + List of all normal Y value for the referenced meshs. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getVertexNormal + """ + return _py3dna.GeometryReader_getVertexNormalYs(self, meshIndex) + + def getVertexNormalZs(self, meshIndex): + r""" + List of all normal Z values for the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexNormal. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getVertexNormal + """ + return _py3dna.GeometryReader_getVertexNormalZs(self, meshIndex) + + def getVertexLayoutCount(self, meshIndex): + r""" + Number of vertex layouts in the entire mesh. + Notes: + A vertex layout is a collection of vertex attributes. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getVertexLayoutCount(self, meshIndex) + + def getVertexLayout(self, meshIndex, layoutIndex): + r""" + Vertex layouts contain only attribute indices which can be used to query + the actual attributes, such as positions, texture coordinates and normals, + which are associated with the vertex. + Notes: + The indices from a layout are usable with the above defined APIs. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type layoutIndex: int + :param layoutIndex: + The index of the layout in the zero-indexed array of vertex layouts. + + layoutIndex must be less than the value returned by getVertexLayoutCount. + See also: getVertexPosition + See also: getVertexTextureCoordinate + See also: getVertexNormal + """ + return _py3dna.GeometryReader_getVertexLayout(self, meshIndex, layoutIndex) + + def getVertexLayoutPositionIndices(self, meshIndex): + r""" + Position indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex position indices values. + See also: getVertexLayout + """ + return _py3dna.GeometryReader_getVertexLayoutPositionIndices(self, meshIndex) + + def getVertexLayoutTextureCoordinateIndices(self, meshIndex): + r""" + Texture coordinate indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex texture coordinate indices. + See also: getVertexLayout + """ + return _py3dna.GeometryReader_getVertexLayoutTextureCoordinateIndices(self, meshIndex) + + def getVertexLayoutNormalIndices(self, meshIndex): + r""" + Normal indices for each vertex of the referenced mesh. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getVertexLayout. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over all vertex normal indices. + See also: getVertexLayout + """ + return _py3dna.GeometryReader_getVertexLayoutNormalIndices(self, meshIndex) + + def getFaceCount(self, meshIndex): + r""" + Number of faces that belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getFaceCount(self, meshIndex) + + def getFaceVertexLayoutIndices(self, meshIndex, faceIndex): + r""" + List of vertex layout indices the belong to a face on the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type faceIndex: int + :param faceIndex: + A face's position in the zero-indexed array of faces that belong to + the above referenced mesh. + + faceIndex must be less than the value returned by getFaceCount. + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over the list of vertex layout indices. + See also: getVertexLayout + """ + return _py3dna.GeometryReader_getFaceVertexLayoutIndices(self, meshIndex, faceIndex) + + def getMaximumInfluencePerVertex(self, meshIndex): + r""" + The maximum number of joints that may influence any single vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getMaximumInfluencePerVertex(self, meshIndex) + + def getSkinWeightsCount(self, meshIndex): + r""" + Number of skin weights associated with the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getSkinWeightsCount(self, meshIndex) + + def getSkinWeightsValues(self, meshIndex, vertexIndex): + r""" + List of skin weights influencing the requested vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertices. + + vertexIndex must be less than the value returned by getVertexPositionCount. + :rtype: dna::ConstArrayView< float > + :return: View over the list of skin weights. + """ + return _py3dna.GeometryReader_getSkinWeightsValues(self, meshIndex, vertexIndex) + + def getSkinWeightsJointIndices(self, meshIndex, vertexIndex): + r""" + List of joint indices associated with each skin weight for the specified vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertices. + + vertexIndex must be less than the value returned by getVertexPositionCount. + Notes: + The joint indices are stored in the same order as the weights they + are associated with. + :rtype: dna::ConstArrayView< std::uint16_t > + :return: View over the list of joint indices. + """ + return _py3dna.GeometryReader_getSkinWeightsJointIndices(self, meshIndex, vertexIndex) + + def getBlendShapeTargetCount(self, meshIndex): + r""" + Number of blend shapes that belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryReader_getBlendShapeTargetCount(self, meshIndex) + + def getBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex): + r""" + The matching blend shape channel index of the requested blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + See also: DefinitionReader::getBlendShapeChannelName + """ + return _py3dna.GeometryReader_getBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex) + + def getBlendShapeTargetDeltaCount(self, meshIndex, blendShapeTargetIndex): + r""" + Number of deltas that belong to the specified blend shape. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + """ + return _py3dna.GeometryReader_getBlendShapeTargetDeltaCount(self, meshIndex, blendShapeTargetIndex) + + def getBlendShapeTargetDelta(self, meshIndex, blendShapeTargetIndex, deltaIndex): + r""" + List of deltas for each affected vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :type deltaIndex: int + :param deltaIndex: + A position in the zero-indexed array of blend shapes deltas. + + deltaIndex must be less than the value returned by getBlendShapeTargetDeltaCount. + """ + return _py3dna.GeometryReader_getBlendShapeTargetDelta(self, meshIndex, blendShapeTargetIndex, deltaIndex) + + def getBlendShapeTargetDeltaXs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta X values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all X values. + See also: getBlendShapeTargetDelta + """ + return _py3dna.GeometryReader_getBlendShapeTargetDeltaXs(self, meshIndex, blendShapeTargetIndex) + + def getBlendShapeTargetDeltaYs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta Y values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Y values. + See also: getBlendShapeTargetDelta + """ + return _py3dna.GeometryReader_getBlendShapeTargetDeltaYs(self, meshIndex, blendShapeTargetIndex) + + def getBlendShapeTargetDeltaZs(self, meshIndex, blendShapeTargetIndex): + r""" + List of all delta Z values for the referenced blend shape target. + Notes: + This is an advanced API for performance critical access, for more convenient usage see getBlendShapeTargetDelta. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + :rtype: dna::ConstArrayView< float > + :return: View over all Z values. + See also: getBlendShapeTargetDelta + """ + return _py3dna.GeometryReader_getBlendShapeTargetDeltaZs(self, meshIndex, blendShapeTargetIndex) + + def getBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex): + r""" + Vertex position indices affected by the referenced blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + + blendShapeTargetIndex must be less than the value returned by getBlendShapeTargetCount. + Notes: + The vertex position indices are stored in the same order as the deltas they + are associated with. + These indices can be used to query the associated vertices themselves through getVertexPosition. + See also: getVertexPosition + :rtype: dna::ConstArrayView< std::uint32_t > + :return: View over the list of vertex position indices. + """ + return _py3dna.GeometryReader_getBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex) + +# Register GeometryReader in _py3dna: +_py3dna.GeometryReader_swigregister(GeometryReader) +class Reader(BehaviorReader, GeometryReader): + r""" + The abstract Reader which its implementations are expected to inherit. + Notes: + This class combines the various different reader interfaces into a single interface. + The artificial separation into multiple interfaces mirrors the DNA file structure that + is separated into matching layers under the same names. As these layers can be + selectively loaded, it might be convenient to slice-off interfaces which layers were + not loaded. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_Reader + + def unload(self, layer): + r""" + Unload all data of the specified layer and all layers dependent on it. + :type layer: int + :param layer: + Layer which data should be unloaded. + """ + return _py3dna.Reader_unload(self, layer) + +# Register Reader in _py3dna: +_py3dna.Reader_swigregister(Reader) +class StreamReader(Reader): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_StreamReader + + def read(self): + r""" read data from stream into internal structures.""" + return _py3dna.StreamReader_read(self) + +# Register StreamReader in _py3dna: +_py3dna.StreamReader_swigregister(StreamReader) +StreamReader.SignatureMismatchError = _py3dna.cvar.StreamReader_SignatureMismatchError +StreamReader.VersionMismatchError = _py3dna.cvar.StreamReader_VersionMismatchError +StreamReader.InvalidDataError = _py3dna.cvar.StreamReader_InvalidDataError + +class BinaryStreamReader(StreamReader): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(*args): + r""" + *Overload 1:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int, optional + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int, optional + :param maxLOD: + The maximum level of details to be loaded. + + A value of zero indicates to load all LODs. + Warning: + The maxLOD value must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 2:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 3:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type maxLOD: int + :param maxLOD: + The maximum level of details to be loaded. + :type minLOD: int + :param minLOD: + The minimum level of details to be loaded. + + A range of [0, LOD count - 1] for maxLOD / minLOD respectively indicates to load all LODs. + Warning: + Both maxLOD and minLOD values must be less than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 4:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + + | + + *Overload 5:* + + Factory method for creation of BinaryStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type layer: int + :param layer: + Specify the layer up to which the data needs to be loaded. + Notes: + The Definition data layer depends on and thus implicitly loads the Descriptor layer. + The Behavior data layer depends on and thus implicitly loads the Definition layer. + The Geometry data layer depends on and thus also implicitly loads the Definition layer. + :type lods: int + :param lods: + An array specifying which exact lods to load. + Warning: + All values in the array must be less than the value returned by getLODCount. + See also: getLODCount + :type lodCount: int + :param lodCount: + The number of elements in the lods array. + + There cannot be more elements in the array than the value returned by getLODCount. + See also: getLODCount + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.BinaryStreamReader_create(*args) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a BinaryStreamReader instance. + :type instance: :py:class:`BinaryStreamReader` + :param instance: + Instance of BinaryStreamReader to be freed. + See also: create + """ + return _py3dna.BinaryStreamReader_destroy(instance) + __swig_destroy__ = _py3dna.delete_BinaryStreamReader + +# Register BinaryStreamReader in _py3dna: +_py3dna.BinaryStreamReader_swigregister(BinaryStreamReader) +class JSONStreamReader(StreamReader): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(stream, memRes=None): + r""" + Factory method for creation of JSONStreamReader + :type stream: :py:class:`BoundedIOStream` + :param stream: + Source stream from which data is going to be read. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.JSONStreamReader_create(stream, memRes) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a JSONStreamReader instance. + :type instance: :py:class:`JSONStreamReader` + :param instance: + Instance of JSONStreamReader to be freed. + See also: create + """ + return _py3dna.JSONStreamReader_destroy(instance) + __swig_destroy__ = _py3dna.delete_JSONStreamReader + +# Register JSONStreamReader in _py3dna: +_py3dna.JSONStreamReader_swigregister(JSONStreamReader) + +BinaryStreamReaderImpl = BinaryStreamReader + +class BinaryStreamReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(BinaryStreamReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(BinaryStreamReaderImpl) if name not in ("create","destroy")] + +class BinaryStreamReader(with_metaclass(BinaryStreamReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = BinaryStreamReaderImpl.create(*args, **kwargs) + + def __del__(self): + BinaryStreamReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + + +JSONStreamReaderImpl = JSONStreamReader + +class JSONStreamReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(JSONStreamReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(JSONStreamReaderImpl) if name not in ("create","destroy")] + +class JSONStreamReader(with_metaclass(JSONStreamReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = JSONStreamReaderImpl.create(*args, **kwargs) + + def __del__(self): + JSONStreamReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + +class DescriptorWriter(object): + r""" + Write-only accessors to various metadata about the character and the rig. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def setName(self, name): + r""" + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an allocation. + """ + return _py3dna.DescriptorWriter_setName(self, name) + + def setArchetype(self, archetype): + return _py3dna.DescriptorWriter_setArchetype(self, archetype) + + def setGender(self, gender): + return _py3dna.DescriptorWriter_setGender(self, gender) + + def setAge(self, age): + return _py3dna.DescriptorWriter_setAge(self, age) + + def clearMetaData(self): + r""" Empties the metadata storage, delete all key-value pairs.""" + return _py3dna.DescriptorWriter_clearMetaData(self) + + def setMetaData(self, key, value): + r""" + Associate the metadata value with the given key. + :type key: string + :param key: + A unique, null-terminated key, to which the given value will be assigned. + :type value: string + :param value: + A null-terminated, metadata value, which is to be assigned to the given key. + Notes: + Consecutive calls using the same key will overwrite any existing data. + + Passing nullptr as the value argument will cause the associated key to be deleted. + """ + return _py3dna.DescriptorWriter_setMetaData(self, key, value) + + def setTranslationUnit(self, unit): + return _py3dna.DescriptorWriter_setTranslationUnit(self, unit) + + def setRotationUnit(self, unit): + return _py3dna.DescriptorWriter_setRotationUnit(self, unit) + + def setCoordinateSystem(self, system): + return _py3dna.DescriptorWriter_setCoordinateSystem(self, system) + + def setLODCount(self, lodCount): + r""" + Available levels of detail (e.g. 6 which means the following levels are available: + [0,1,2,3,4,5], where 0 is the LOD with the highest details, and 5 is the LOD with + lowest details). + :type lodCount: int + :param lodCount: + The number of levels available. + """ + return _py3dna.DescriptorWriter_setLODCount(self, lodCount) + + def setDBMaxLOD(self, lod): + r""" The maximum level of detail stored in the DNA data for this character.""" + return _py3dna.DescriptorWriter_setDBMaxLOD(self, lod) + + def setDBComplexity(self, name): + r""" + Name of the input control interface used to drive this character rig. + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DescriptorWriter_setDBComplexity(self, name) + + def setDBName(self, name): + r""" + Name of the database from which the character originates. + :type name: string + :param name: + A null-terminated string. + Notes: + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DescriptorWriter_setDBName(self, name) + +# Register DescriptorWriter in _py3dna: +_py3dna.DescriptorWriter_swigregister(DescriptorWriter) +class DefinitionWriter(DescriptorWriter): + r""" + Write-only accessors for DNA attributes that represent the rig's static data. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def clearGUIControlNames(self): + r""" Delete all stored GUI control names.""" + return _py3dna.DefinitionWriter_clearGUIControlNames(self) + + def setGUIControlName(self, index, name): + r""" + Name of the specified GUI control. + :type index: int + :param index: + A name's position in the zero-indexed array of GUI control names. + Notes: + The control name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DefinitionWriter_setGUIControlName(self, index, name) + + def clearRawControlNames(self): + r""" Delete all stored raw control names.""" + return _py3dna.DefinitionWriter_clearRawControlNames(self) + + def setRawControlName(self, index, name): + r""" + Name of the specified raw control. + :type index: int + :param index: + A name's position in the zero-indexed array of raw control names. + Notes: + The control name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DefinitionWriter_setRawControlName(self, index, name) + + def clearJointNames(self): + r""" Delete all stored joint names.""" + return _py3dna.DefinitionWriter_clearJointNames(self) + + def setJointName(self, index, name): + r""" + Name of the specified joint. + :type index: int + :param index: + A name's position in the zero-indexed array of joint names. + Notes: + The joint name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DefinitionWriter_setJointName(self, index, name) + + def clearJointIndices(self): + r""" Delete all stored joint indices.""" + return _py3dna.DefinitionWriter_clearJointIndices(self) + + def setJointIndices(self, index, jointIndices): + r""" + Store a list of joint indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where joint indices are stored. + Notes: + The index denotes the position of an entire joint index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of joint indices. + + The joint index storage will be implicitly resized (if needed) to provide + storage for the number of joint indices that is inferred from the specified index. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + + These indices can be used to access joint names through DefinitionReader::getJointName. + :type count: int + :param count: + The number of joint indices to copy. + """ + return _py3dna.DefinitionWriter_setJointIndices(self, index, jointIndices) + + def clearLODJointMappings(self): + r""" Delete all stored LOD to joint list index mapping entries.""" + return _py3dna.DefinitionWriter_clearLODJointMappings(self) + + def setLODJointMapping(self, lod, index): + r""" + Set which joints belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the joints are being associated. + :type index: int + :param index: + The index onto which joints indices were assigned using setJointIndices. + See also: setJointIndices + """ + return _py3dna.DefinitionWriter_setLODJointMapping(self, lod, index) + + def clearBlendShapeChannelNames(self): + r""" Delete all stored blend shape channel names.""" + return _py3dna.DefinitionWriter_clearBlendShapeChannelNames(self) + + def setBlendShapeChannelName(self, index, name): + r""" + Name of the specified blend shape channel. + :type index: int + :param index: + A name's position in the zero-indexed array of blend shape channel names. + Notes: + The blend shape channel name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DefinitionWriter_setBlendShapeChannelName(self, index, name) + + def clearBlendShapeChannelIndices(self): + r""" Delete all stored blend shape channel indices.""" + return _py3dna.DefinitionWriter_clearBlendShapeChannelIndices(self) + + def setBlendShapeChannelIndices(self, index, blendShapeChannelIndices): + r""" + Store a list of blend shape channel name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where blend shape channel name indices are stored. + Notes: + The index denotes the position of an entire blend shape channel index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of blend shape channel indices. + + The blend shape channel index storage will be implicitly resized (if needed) to provide storage + for the number of blend shape channel name indices that is inferred from the specified index. + :type blendShapeChannelIndices: int + :param blendShapeChannelIndices: + The source address from which the blend shape channel name indices are to be copied. + + These indices can be used to access blend shape channel names through DefinitionReader::getBlendShapeChannelName. + :type count: int + :param count: + The number of blend shape channel name indices to copy. + """ + return _py3dna.DefinitionWriter_setBlendShapeChannelIndices(self, index, blendShapeChannelIndices) + + def clearLODBlendShapeChannelMappings(self): + r""" Delete all stored LOD to blend shape channel list index mapping entries.""" + return _py3dna.DefinitionWriter_clearLODBlendShapeChannelMappings(self) + + def setLODBlendShapeChannelMapping(self, lod, index): + r""" + Set which blend shape channels belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the blend shape channels are being associated. + :type index: int + :param index: + The index onto which blend shape channel name indices were assigned using setBlendShapeChannelIndices. + Warning: + The LOD indices set here are not interchangeable with the LOD values set in BehaviorWriter::setBlendShapeChannelLODs. + See also: setBlendShapeChannelIndices + """ + return _py3dna.DefinitionWriter_setLODBlendShapeChannelMapping(self, lod, index) + + def clearAnimatedMapNames(self): + r""" Delete all stored animated map names.""" + return _py3dna.DefinitionWriter_clearAnimatedMapNames(self) + + def setAnimatedMapName(self, index, name): + r""" + Name of the specified animated map. + :type index: int + :param index: + A name's position in the zero-indexed array of animated map names. + Notes: + The animated map name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DefinitionWriter_setAnimatedMapName(self, index, name) + + def clearAnimatedMapIndices(self): + r""" Delete all stored animated map indices.""" + return _py3dna.DefinitionWriter_clearAnimatedMapIndices(self) + + def setAnimatedMapIndices(self, index, animatedMapIndices): + r""" + Store a list of animated map name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where animated map name indices are stored. + Notes: + The index denotes the position of an entire animated map index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of animated map indices. + + The animated map index storage will be implicitly resized (if needed) to provide storage + for the number of animated map name indices that is inferred from the specified index. + :type animatedMapIndices: int + :param animatedMapIndices: + The source address from which the animated map name indices are to be copied. + + These indices can be used to access animated map names through DefinitionReader::getAnimatedMapName. + :type count: int + :param count: + The number of animated map name indices to copy. + """ + return _py3dna.DefinitionWriter_setAnimatedMapIndices(self, index, animatedMapIndices) + + def clearLODAnimatedMapMappings(self): + r""" Delete all stored LOD to animated map list index mapping entries.""" + return _py3dna.DefinitionWriter_clearLODAnimatedMapMappings(self) + + def setLODAnimatedMapMapping(self, lod, index): + r""" + Set which animated maps belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the animated maps are being associated. + :type index: int + :param index: + The index onto which animated map indices were assigned using setAnimatedMapIndices. + See also: setAnimatedMapIndices + """ + return _py3dna.DefinitionWriter_setLODAnimatedMapMapping(self, lod, index) + + def clearMeshNames(self): + r""" Delete all stored mesh names.""" + return _py3dna.DefinitionWriter_clearMeshNames(self) + + def setMeshName(self, index, name): + r""" + Name of the specified mesh. + :type index: int + :param index: + A name's position in the zero-indexed array of mesh names. + Notes: + The mesh name storage will be implicitly resized (if needed) to provide + storage for the number of names that is inferred from the specified index. + :type name: string + :param name: + A null-terminated string. + + The passed in name is copied, which will involve an additional allocation. + """ + return _py3dna.DefinitionWriter_setMeshName(self, index, name) + + def clearMeshIndices(self): + r""" Delete all stored mesh indices.""" + return _py3dna.DefinitionWriter_clearMeshIndices(self) + + def setMeshIndices(self, index, meshIndices): + r""" + Store a list of mesh name indices onto a specified index. + :type index: int + :param index: + A position in a zero-indexed array where mesh name indices are stored. + Notes: + The index denotes the position of an entire mesh index list, + not the position of it's individual elements, i.e. the row index in a 2D + matrix of mesh indices. + + The mesh index storage will be implicitly resized (if needed) to provide storage + for the number of mesh name indices that is inferred from the specified index. + :type meshIndices: int + :param meshIndices: + The source address from which the mesh name indices are to be copied. + + These indices can be used to access mesh names through DefinitionReader::getMeshName. + :type count: int + :param count: + The number of mesh name indices to copy. + """ + return _py3dna.DefinitionWriter_setMeshIndices(self, index, meshIndices) + + def clearLODMeshMappings(self): + r""" Delete all stored LOD to mesh list index mapping entries.""" + return _py3dna.DefinitionWriter_clearLODMeshMappings(self) + + def setLODMeshMapping(self, lod, index): + r""" + Set which meshes belong to which level of detail. + :type lod: int + :param lod: + The actual level of detail to which the meshes are being associated. + :type index: int + :param index: + The index onto which mesh indices were assigned using setMeshIndices. + See also: setMeshIndices + """ + return _py3dna.DefinitionWriter_setLODMeshMapping(self, lod, index) + + def clearMeshBlendShapeChannelMappings(self): + r""" Delete all stored mesh to blend shape channel mapping entries.""" + return _py3dna.DefinitionWriter_clearMeshBlendShapeChannelMappings(self) + + def setMeshBlendShapeChannelMapping(self, index, meshIndex, blendShapeChannelIndex): + r""" + Associate a blend shape channel with it's mesh. + :type index: int + :param index: + A mapping's position in the zero-indexed array of mesh-blend shape channel mappings. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of mesh names. + :type blendShapeChannelIndex: int + :param blendShapeChannelIndex: + A blend shape channel's position in the zero-indexed array of blend shape channel names. + """ + return _py3dna.DefinitionWriter_setMeshBlendShapeChannelMapping(self, index, meshIndex, blendShapeChannelIndex) + + def setJointHierarchy(self, jointIndices): + r""" + A simple array describing the parent-child relationships between joints. + Notes: + Example: + Joint names: [A, B, C, D, E, F, G, H] + Hierarchy: [0, 0, 0, 1, 1, 4, 2, 2] + Describes the following hierarchy: + A + + B + | + D + | + E + | + F + + C + + G + + H + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + + These indices can be used to access joint names through DefinitionReader::getJointName. + :type count: int + :param count: + The number of joint indices to copy. + """ + return _py3dna.DefinitionWriter_setJointHierarchy(self, jointIndices) + + def setNeutralJointTranslations(self, translations): + r""" + :type translations: dna::Vector3 + :param translations: + The source address from which the translations are to be copied. + :type count: int + :param count: + The number of translation values to copy. + """ + return _py3dna.DefinitionWriter_setNeutralJointTranslations(self, translations) + + def setNeutralJointRotations(self, rotations): + r""" + :type rotations: dna::Vector3 + :param rotations: + The source address from which the rotations are to be copied. + :type count: int + :param count: + The number of rotation values to copy. + """ + return _py3dna.DefinitionWriter_setNeutralJointRotations(self, rotations) + +# Register DefinitionWriter in _py3dna: +_py3dna.DefinitionWriter_swigregister(DefinitionWriter) +class BehaviorWriter(DefinitionWriter): + r""" + Write-only accessors for DNA attributes that define the rig's evaluation. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def setGUIToRawInputIndices(self, inputIndices): + r""" + Input indices used for mapping gui to raw controls. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ + return _py3dna.BehaviorWriter_setGUIToRawInputIndices(self, inputIndices) + + def setGUIToRawOutputIndices(self, outputIndices): + r""" + Output indices used for mapping gui to raw controls. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ + return _py3dna.BehaviorWriter_setGUIToRawOutputIndices(self, outputIndices) + + def setGUIToRawFromValues(self, fromValues): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :type fromValues: float + :param fromValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ + return _py3dna.BehaviorWriter_setGUIToRawFromValues(self, fromValues) + + def setGUIToRawToValues(self, toValues): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not during gui to raw control mapping. + :type toValues: float + :param toValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ + return _py3dna.BehaviorWriter_setGUIToRawToValues(self, toValues) + + def setGUIToRawSlopeValues(self, slopeValues): + r""" + Computational values(slope/gradient) used for calculating the + output value during gui to raw control mapping. + :type slopeValues: float + :param slopeValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ + return _py3dna.BehaviorWriter_setGUIToRawSlopeValues(self, slopeValues) + + def setGUIToRawCutValues(self, cutValues): + r""" + Computational values(vertical intercept) used for calculating the + output value during gui to raw control mapping. + :type cutValues: float + :param cutValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ + return _py3dna.BehaviorWriter_setGUIToRawCutValues(self, cutValues) + + def setPSDCount(self, count): + r""" The number of distinct PSD expressions.""" + return _py3dna.BehaviorWriter_setPSDCount(self, count) + + def setPSDRowIndices(self, rowIndices): + r""" + PSD(input) indices which will become the rows of the PSD matrix. + :type rowIndices: int + :param rowIndices: + The source address from which the PSD indices are to be copied. + :type count: int + :param count: + The number of PSD indices to copy. + """ + return _py3dna.BehaviorWriter_setPSDRowIndices(self, rowIndices) + + def setPSDColumnIndices(self, columnIndices): + r""" + Control(input) indices which will become the columns of the PSD matrix. + :type columnIndices: int + :param columnIndices: + The source address from which the control indices are to be copied. + :type count: int + :param count: + The number of control indices to copy. + """ + return _py3dna.BehaviorWriter_setPSDColumnIndices(self, columnIndices) + + def setPSDValues(self, weights): + r""" + Weights associated with each PSD row and column pair. + :type weights: float + :param weights: + The source address from which the weight values are to be copied. + :type count: int + :param count: + The number of weight values to copy. + """ + return _py3dna.BehaviorWriter_setPSDValues(self, weights) + + def setJointRowCount(self, rowCount): + r""" Number of rows in the entire, uncompressed joint matrix.""" + return _py3dna.BehaviorWriter_setJointRowCount(self, rowCount) + + def setJointColumnCount(self, columnCount): + r""" Number of columns in the entire, uncompressed joint matrix.""" + return _py3dna.BehaviorWriter_setJointColumnCount(self, columnCount) + + def clearJointGroups(self): + r""" Delete all joint groups.""" + return _py3dna.BehaviorWriter_clearJointGroups(self) + + def deleteJointGroup(self, jointGroupIndex): + r""" + Delete the specified joint group. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Warning: + jointGroupIndex must be less than the value returned by getJointGroupCount. + """ + return _py3dna.BehaviorWriter_deleteJointGroup(self, jointGroupIndex) + + def setJointGroupLODs(self, jointGroupIndex, lods): + r""" + Number of rows per each level of detail for the specified joint group. + Notes: + Each element's position represents the level itself, while the value denotes + the number of rows within the joint group belonging to that level. e.g.: + [12, 9, 3] + | | + LOD-2 contains first 3 rows + | + LOD-1 contains first 9 rows + + LOD-0 contains first 12 rows + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + """ + return _py3dna.BehaviorWriter_setJointGroupLODs(self, jointGroupIndex, lods) + + def setJointGroupInputIndices(self, jointGroupIndex, inputIndices): + r""" + Column indices that the specified joint group contains. + Notes: + The column indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type inputIndices: int + :param inputIndices: + The source address from which the column indices are to be copied. + :type count: int + :param count: + The number of column indices to copy. + """ + return _py3dna.BehaviorWriter_setJointGroupInputIndices(self, jointGroupIndex, inputIndices) + + def setJointGroupOutputIndices(self, jointGroupIndex, outputIndices): + r""" + Row indices that the specified joint group contains. + Notes: + The row indices point into the entire, uncompressed joint matrix. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type outputIndices: int + :param outputIndices: + The source address from which the row indices are to be copied. + :type count: int + :param count: + The number of row indices to copy. + """ + return _py3dna.BehaviorWriter_setJointGroupOutputIndices(self, jointGroupIndex, outputIndices) + + def setJointGroupValues(self, jointGroupIndex, values): + r""" + Values that the specified joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Notes: + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type values: float + :param values: + The source address from which the values are to be copied. + :type count: int + :param count: + The number of values to copy. + """ + return _py3dna.BehaviorWriter_setJointGroupValues(self, jointGroupIndex, values) + + def setJointGroupJointIndices(self, jointGroupIndex, jointIndices): + r""" + Joint indices that the specified joint group contains. + :type jointGroupIndex: int + :param jointGroupIndex: + A joint group's position in the zero-indexed array of joint groups. + Notes: + The joint group storage will be implicitly resized (if needed) to provide + storage for the number of joint groups that is inferred from the specified index. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + :type count: int + :param count: + The number of joint indices to copy. + """ + return _py3dna.BehaviorWriter_setJointGroupJointIndices(self, jointGroupIndex, jointIndices) + + def setBlendShapeChannelLODs(self, lods): + r""" + Input index count per each level of detail for blend shapes. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of input indices belonging to that level. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + Warning: + The LOD values set here are not interchangeable with the LOD indices set in DefinitionWriter::setBlendShapeNameIndices + and DefinitionWriter::setLODBlendShapeMapping + """ + return _py3dna.BehaviorWriter_setBlendShapeChannelLODs(self, lods) + + def setBlendShapeChannelInputIndices(self, inputIndices): + r""" + Input indices used to index into the input vector. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ + return _py3dna.BehaviorWriter_setBlendShapeChannelInputIndices(self, inputIndices) + + def setBlendShapeChannelOutputIndices(self, outputIndices): + r""" + Output indices specify the positions of blend shape output values. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ + return _py3dna.BehaviorWriter_setBlendShapeChannelOutputIndices(self, outputIndices) + + def setAnimatedMapLODs(self, lods): + r""" + Row count per each level of detail for animated maps. + Notes: + Each element's position represents the level itself (e.g. [0,1,2,3,4,5] Value 0 is LOD with highest of details, + value 5 is LOD with lowest details), while the value denotes the number of rows (within the conditional table), + belonging to that level. + :type lods: int + :param lods: + The source address from which the lod bounds are to be copied. + :type count: int + :param count: + The number of lod bounds to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapLODs(self, lods) + + def setAnimatedMapInputIndices(self, inputIndices): + r""" + Input indices used to index into the array of input values. + :type inputIndices: int + :param inputIndices: + The source address from which the input indices are to be copied. + :type count: int + :param count: + The number of input indices to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapInputIndices(self, inputIndices) + + def setAnimatedMapOutputIndices(self, outputIndices): + r""" + Output indices that specify the computed output value's position. + :type outputIndices: int + :param outputIndices: + The source address from which the output indices are to be copied. + :type count: int + :param count: + The number of output indices to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapOutputIndices(self, outputIndices) + + def setAnimatedMapFromValues(self, fromValues): + r""" + Filter values(lower-bounds) used to decide whether a particular + entry should be evaluated or not. + :type fromValues: float + :param fromValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapFromValues(self, fromValues) + + def setAnimatedMapToValues(self, toValues): + r""" + Filter values(upper-bounds) used to decide whether a particular + entry should be evaluated or not. + :type toValues: float + :param toValues: + The source address from which the filter values are to be copied. + :type count: int + :param count: + The number of filter values to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapToValues(self, toValues) + + def setAnimatedMapSlopeValues(self, slopeValues): + r""" + Computational values(slope/gradient) used for calculating the output value. + :type slopeValues: float + :param slopeValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapSlopeValues(self, slopeValues) + + def setAnimatedMapCutValues(self, cutValues): + r""" + Computational values(vertical intercept) used for calculating the output value. + :type cutValues: float + :param cutValues: + The source address from which the computational values are to be copied. + :type count: int + :param count: + The number of computational values to copy. + """ + return _py3dna.BehaviorWriter_setAnimatedMapCutValues(self, cutValues) + +# Register BehaviorWriter in _py3dna: +_py3dna.BehaviorWriter_swigregister(BehaviorWriter) +class GeometryWriter(DefinitionWriter): + r""" + Write-only accessors for the geometry data associated with a rig. + Warning: + Implementors should inherit from Writer itself and not this class. + See also: Writer + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + def clearMeshes(self): + r""" Delete all meshes.""" + return _py3dna.GeometryWriter_clearMeshes(self) + + def deleteMesh(self, meshIndex): + r""" + Delete the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryWriter_deleteMesh(self, meshIndex) + + def setVertexPositions(self, meshIndex, positions): + r""" + List of vertex positions. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type positions: dna::Position + :param positions: + The source address from which the vertex positions are to be copied. + :type count: int + :param count: + The number of vertex positions to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ + return _py3dna.GeometryWriter_setVertexPositions(self, meshIndex, positions) + + def setVertexTextureCoordinates(self, meshIndex, textureCoordinates): + r""" + List of vertex texture coordinates. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type textureCoordinates: dna::TextureCoordinate + :param textureCoordinates: + The source address from which the texture coordinates are to be copied. + :type count: int + :param count: + The number of texture coordinates to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ + return _py3dna.GeometryWriter_setVertexTextureCoordinates(self, meshIndex, textureCoordinates) + + def setVertexNormals(self, meshIndex, normals): + r""" + List of vertex normals. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type normals: dna::Normal + :param normals: + The source address from which the normals are to be copied. + :type count: int + :param count: + The number of normals to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ + return _py3dna.GeometryWriter_setVertexNormals(self, meshIndex, normals) + + def setVertexLayouts(self, meshIndex, layouts): + r""" + List of vertex layouts the belong to the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type layouts: dna::VertexLayout + :param layouts: + The source address from which the layouts are to be copied. + :type count: int + :param count: + The number of layouts to copy. + Notes: + The mesh storage will be implicitly resized (if needed) to provide + storage for the number of meshes that is inferred from the specified index. + """ + return _py3dna.GeometryWriter_setVertexLayouts(self, meshIndex, layouts) + + def clearFaceVertexLayoutIndices(self, meshIndex): + r""" + Delete all lists of vertex layout indices for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryWriter_clearFaceVertexLayoutIndices(self, meshIndex) + + def setFaceVertexLayoutIndices(self, meshIndex, faceIndex, layoutIndices): + r""" + Vertex layout indices that belong to the specified face. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type faceIndex: int + :param faceIndex: + A face's position in the zero-indexed array of faces that belong to + the above referenced mesh. + :type layoutIndices: int + :param layoutIndices: + The source address from which the layout indices are to be copied. + Notes: + The layout indices point into the array that is set through setVertexLayouts + :type count: int + :param count: + The number of vertices to copy. + + Both the mesh storage itself and it's face storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + faces that are inferred from the specified indexes. + """ + return _py3dna.GeometryWriter_setFaceVertexLayoutIndices(self, meshIndex, faceIndex, layoutIndices) + + def setMaximumInfluencePerVertex(self, meshIndex, maxInfluenceCount): + r""" + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type maxInfluenceCount: int + :param maxInfluenceCount: + The maximum number of joints that may influence any single vertex. + """ + return _py3dna.GeometryWriter_setMaximumInfluencePerVertex(self, meshIndex, maxInfluenceCount) + + def clearSkinWeights(self, meshIndex): + r""" + Delete all skin weights for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryWriter_clearSkinWeights(self, meshIndex) + + def setSkinWeightsValues(self, meshIndex, vertexIndex, weights): + r""" + List of skin weights influencing the referenced vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertex positions. + :type weights: float + :param weights: + The source address from which the weights are to be copied. + :type count: int + :param count: + The number of weights to copy. + Notes: + Both the mesh storage itself and it's skin weight storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + skin-weight lists that are inferred from the specified indexes. + Warning: + The sum of weights must add up to 1. + """ + return _py3dna.GeometryWriter_setSkinWeightsValues(self, meshIndex, vertexIndex, weights) + + def setSkinWeightsJointIndices(self, meshIndex, vertexIndex, jointIndices): + r""" + List of joint indices associated with each skin weight for the specified vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type vertexIndex: int + :param vertexIndex: + A position in the zero-indexed array of vertex positions. + :type jointIndices: int + :param jointIndices: + The source address from which the joint indices are to be copied. + :type count: int + :param count: + The number of joint indices to copy. + Notes: + Both the mesh storage itself and it's joint index list storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + joint index lists that are inferred from the specified indexes. + Warning: + The joint indices must be stored in the same order as the weights they + are associated with. + """ + return _py3dna.GeometryWriter_setSkinWeightsJointIndices(self, meshIndex, vertexIndex, jointIndices) + + def clearBlendShapeTargets(self, meshIndex): + r""" + Delete all blend shape targets for the specified mesh. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + Warning: + meshIndex must be less than the value returned by getMeshCount. + """ + return _py3dna.GeometryWriter_clearBlendShapeTargets(self, meshIndex) + + def setBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex, blendShapeChannelIndex): + r""" + The matching blend shape channel index of the specified blend shape target. + Notes: + Associate the mesh-local blend shape target index with the absolute blend shape channel + index as found in the Definition layer. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type blendShapeChannelIndex: int + :param blendShapeChannelIndex: + The index of the specified blend shape channel in the Definition layer. + + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + """ + return _py3dna.GeometryWriter_setBlendShapeChannelIndex(self, meshIndex, blendShapeTargetIndex, blendShapeChannelIndex) + + def setBlendShapeTargetDeltas(self, meshIndex, blendShapeTargetIndex, deltas): + r""" + List of deltas for each affected vertex. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type deltas: dna::Delta + :param deltas: + The source address from which the blend shape target deltas are to be copied. + :type count: int + :param count: + The number of blend shape target deltas to copy. + Notes: + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + """ + return _py3dna.GeometryWriter_setBlendShapeTargetDeltas(self, meshIndex, blendShapeTargetIndex, deltas) + + def setBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex, vertexIndices): + r""" + Vertex position indices affected by the specified blend shape target. + :type meshIndex: int + :param meshIndex: + A mesh's position in the zero-indexed array of meshes. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + A position in the zero-indexed array of blend shape targets within the specified mesh. + :type vertexIndices: int + :param vertexIndices: + The source address from which the vertex position indices are to be copied. + :type count: int + :param count: + The number of vertex position indices to copy. + Notes: + Both the mesh storage itself and it's blend shape target storage will be implicitly + resized (if needed) to provide storage for the number of meshes and/or + blend shape targets that are inferred from the specified indexes. + Warning: + The vertex position indices must be stored in the same order as the deltas + they are associated with. + """ + return _py3dna.GeometryWriter_setBlendShapeTargetVertexIndices(self, meshIndex, blendShapeTargetIndex, vertexIndices) + +# Register GeometryWriter in _py3dna: +_py3dna.GeometryWriter_swigregister(GeometryWriter) +class Writer(BehaviorWriter, GeometryWriter): + r""" + The abstract Writer which its implementations are expected to inherit. + Notes: + This class combines the various different writer interfaces into a single interface. + The artificial separation into multiple interfaces in this case just mirrors the + structure of the Reader hierarchy, as it's not possible to selectively write only + specific layers. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_Writer + + def setFrom(self, *args): + r""" + Initialize the Writer from the given Reader. + Notes: + This function copies all the data from the given Reader into the Writer instance, + by calling each getter function of the Reader, and passing the return values to + the matching setter functions in the Writer. + It is implemented in the abstract class itself to provide the functionality for + all DNA Writers. + :type source: :py:class:`Reader` + :param source: + The source DNA Reader from which the data needs to be copied. + :type layer: int, optional + :param layer: + Limit which layers should be taken over from the given source reader. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Optional memory resource to use for temporary allocations during copying. + """ + return _py3dna.Writer_setFrom(self, *args) + +# Register Writer in _py3dna: +_py3dna.Writer_swigregister(Writer) +class StreamWriter(Writer): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dna.delete_StreamWriter + + def write(self): + r""" Write data to stream from internal structures.""" + return _py3dna.StreamWriter_write(self) + +# Register StreamWriter in _py3dna: +_py3dna.StreamWriter_swigregister(StreamWriter) +class BinaryStreamWriter(StreamWriter): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(stream, memRes=None): + r""" + Factory method for creation of BinaryStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.BinaryStreamWriter_create(stream, memRes) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a BinaryStreamWriter instance. + :type instance: :py:class:`BinaryStreamWriter` + :param instance: + Instance of BinaryStreamWriter to be freed. + See also: create + """ + return _py3dna.BinaryStreamWriter_destroy(instance) + __swig_destroy__ = _py3dna.delete_BinaryStreamWriter + +# Register BinaryStreamWriter in _py3dna: +_py3dna.BinaryStreamWriter_swigregister(BinaryStreamWriter) +class JSONStreamWriter(StreamWriter): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(stream, indentWidth=4, memRes=None): + r""" + Factory method for creation of JSONStreamWriter + :type stream: :py:class:`BoundedIOStream` + :param stream: + Stream into which the data is going to be written. + :type indentWidth: int, optional + :param indentWidth: + Number of spaces to use for indentation. + :type memRes: :py:class:`MemoryResource`, optional + :param memRes: + Memory resource to be used for allocations. + Notes: + If a memory resource is not given, a default allocation mechanism will be used. + Warning: + User is responsible for releasing the returned pointer by calling destroy. + See also: destroy + """ + return _py3dna.JSONStreamWriter_create(stream, indentWidth, memRes) + + @staticmethod + def destroy(instance): + r""" + Method for freeing a JSONStreamWriter instance. + :type instance: :py:class:`JSONStreamWriter` + :param instance: + Instance of JSONStreamWriter to be freed. + See also: create + """ + return _py3dna.JSONStreamWriter_destroy(instance) + __swig_destroy__ = _py3dna.delete_JSONStreamWriter + +# Register JSONStreamWriter in _py3dna: +_py3dna.JSONStreamWriter_swigregister(JSONStreamWriter) + +BinaryStreamWriterImpl = BinaryStreamWriter + +class BinaryStreamWriterImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(BinaryStreamWriterImpl, name) + + def __dir__(cls): + return [name for name in dir(BinaryStreamWriterImpl) if name not in ("create","destroy")] + +class BinaryStreamWriter(with_metaclass(BinaryStreamWriterImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = BinaryStreamWriterImpl.create(*args, **kwargs) + + def __del__(self): + BinaryStreamWriterImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + + +JSONStreamWriterImpl = JSONStreamWriter + +class JSONStreamWriterImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(JSONStreamWriterImpl, name) + + def __dir__(cls): + return [name for name in dir(JSONStreamWriterImpl) if name not in ("create","destroy")] + +class JSONStreamWriter(with_metaclass(JSONStreamWriterImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = JSONStreamWriterImpl.create(*args, **kwargs) + + def __del__(self): + JSONStreamWriterImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + + diff --git a/lib/Maya2024/windows/dnacalib.dll b/lib/Maya2024/windows/dnacalib.dll new file mode 100644 index 0000000..ed49237 Binary files /dev/null and b/lib/Maya2024/windows/dnacalib.dll differ diff --git a/lib/Maya2024/windows/dnacalib.py b/lib/Maya2024/windows/dnacalib.py new file mode 100644 index 0000000..49cf7ee --- /dev/null +++ b/lib/Maya2024/windows/dnacalib.py @@ -0,0 +1,1127 @@ +# This file was automatically generated by SWIG (https://www.swig.org). +# Version 4.1.1 +# +# Do not make changes to this file unless you know what you are doing - modify +# the SWIG interface file instead. + + +import os +if hasattr(os, 'add_dll_directory'): + for path in os.environ.get('PATH', '').split(';'): + try: + if path: + os.add_dll_directory(path) + except Exception: + pass + + + +from sys import version_info as _swig_python_version_info +# Import the low-level C/C++ module +if __package__ or "." in __name__: + from . import _py3dnacalib +else: + import _py3dnacalib + +try: + import builtins as __builtin__ +except ImportError: + import __builtin__ + +def _swig_repr(self): + try: + strthis = "proxy of " + self.this.__repr__() + except __builtin__.Exception: + strthis = "" + return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) + + +def _swig_setattr_nondynamic_instance_variable(set): + def set_instance_attr(self, name, value): + if name == "this": + set(self, name, value) + elif name == "thisown": + self.this.own(value) + elif hasattr(self, name) and isinstance(getattr(type(self), name), property): + set(self, name, value) + else: + raise AttributeError("You cannot add instance attributes to %s" % self) + return set_instance_attr + + +def _swig_setattr_nondynamic_class_variable(set): + def set_class_attr(cls, name, value): + if hasattr(cls, name) and not isinstance(getattr(cls, name), property): + set(cls, name, value) + else: + raise AttributeError("You cannot add class attributes to %s" % cls) + return set_class_attr + + +def _swig_add_metaclass(metaclass): + """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" + def wrapper(cls): + return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) + return wrapper + + +class _SwigNonDynamicMeta(type): + """Meta class to enforce nondynamic attributes (no new attributes) for a class""" + __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) + + + +def with_metaclass(meta, *bases): + class metaclass(type): + + def __new__(cls, name, this_bases, d): + return meta(name, bases, d) + + @classmethod + def __prepare__(cls, name, this_bases): + return meta.__prepare__(name, bases) + return type.__new__(metaclass, 'temporary_class', (), {}) + +import dna +class VersionInfo(object): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + + @staticmethod + def getMajorVersion(): + return _py3dnacalib.VersionInfo_getMajorVersion() + + @staticmethod + def getMinorVersion(): + return _py3dnacalib.VersionInfo_getMinorVersion() + + @staticmethod + def getPatchVersion(): + return _py3dnacalib.VersionInfo_getPatchVersion() + + @staticmethod + def getVersionString(): + return _py3dnacalib.VersionInfo_getVersionString() + + def __init__(self): + _py3dnacalib.VersionInfo_swiginit(self, _py3dnacalib.new_VersionInfo()) + __swig_destroy__ = _py3dnacalib.delete_VersionInfo + +# Register VersionInfo in _py3dnacalib: +_py3dnacalib.VersionInfo_swigregister(VersionInfo) +class DNACalibDNAReader(dna.Reader): + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + + @staticmethod + def create(*args): + return _py3dnacalib.DNACalibDNAReader_create(*args) + + @staticmethod + def destroy(instance): + return _py3dnacalib.DNACalibDNAReader_destroy(instance) + +# Register DNACalibDNAReader in _py3dnacalib: +_py3dnacalib.DNACalibDNAReader_swigregister(DNACalibDNAReader) + +DNACalibDNAReaderImpl = DNACalibDNAReader + +class DNACalibDNAReaderImplReflectionMixin(type): + + def __getattr__(cls, name): + return getattr(DNACalibDNAReaderImpl, name) + + def __dir__(cls): + return [name for name in dir(DNACalibDNAReaderImpl) if name not in ("create","destroy")] + +class DNACalibDNAReader(with_metaclass(DNACalibDNAReaderImplReflectionMixin, object)): + __slots__ = ('_args', '_kwargs', '_instance') + + def __init__(self, *args, **kwargs): + self._args = args + self._kwargs = kwargs + self._instance = DNACalibDNAReaderImpl.create(*args, **kwargs) + + def __del__(self): + DNACalibDNAReaderImpl.destroy(self._instance) + + def _in_slots(self, attr): + for cls in type(self).__mro__: + if attr in getattr(cls, '__slots__', []): + return True + return False + + def __getattr__(self, attr): + if self._in_slots(attr): + return object.__getattr__(self, attr) + return getattr(self._instance, attr) + + def __setattr__(self, attr, value): + if self._in_slots(attr): + object.__setattr__(self, attr, value) + else: + setattr(self._instance, attr, value) + + def __dir__(self): + return [name for name in self._instance.__dir__() if name not in ("create","destroy")] + +class Command(object): + r""" Command is an abstract class whose implementations are expected to modify the DNA provided in the run() method in some way.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + + def __init__(self, *args, **kwargs): + raise AttributeError("No constructor defined - class is abstract") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_Command + + def run(self, output): + return _py3dnacalib.Command_run(self, output) + +# Register Command in _py3dnacalib: +_py3dnacalib.Command_swigregister(Command) +VectorOperation_Interpolate = _py3dnacalib.VectorOperation_Interpolate +VectorOperation_Add = _py3dnacalib.VectorOperation_Add +VectorOperation_Subtract = _py3dnacalib.VectorOperation_Subtract +VectorOperation_Multiply = _py3dnacalib.VectorOperation_Multiply +class CommandSequence(Command): + r""" + CommandSequence is used to run a sequence of commands on the same DNA. + Notes: + Commands will be run in the order in which they were added to the sequence. + + CommandSequence holds pointers to commands, but does not own them. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_CommandSequence + + def __init__(self, *args): + _py3dnacalib.CommandSequence_swiginit(self, _py3dnacalib.new_CommandSequence(*args)) + + def run(self, output): + return _py3dnacalib.CommandSequence_run(self, output) + + def add(self, command): + r""" + Method for adding a command to a sequence of commands to run. + :type command: :py:class:`Command` + :param command: + The command to add. + """ + return _py3dnacalib.CommandSequence_add(self, command) + + def remove(self, command): + r""" + Method for removing a command from the sequence of commands to run. + :type command: :py:class:`Command` + :param command: + The command to remove. + """ + return _py3dnacalib.CommandSequence_remove(self, command) + + def contains(self, command): + r""" + Method for checking if the provided command is part of the command sequence. + :type command: :py:class:`Command` + :param command: + The command to check. + """ + return _py3dnacalib.CommandSequence_contains(self, command) + + def size(self): + r""" Number of commands in command sequence.""" + return _py3dnacalib.CommandSequence_size(self) + +# Register CommandSequence in _py3dnacalib: +_py3dnacalib.CommandSequence_swigregister(CommandSequence) + +def command_sequence_init(_init): + def wrapper(self, *args, **kwargs): + self._commands = [] + _init(self, *args, **kwargs) + return wrapper + +def command_sequence_add(_add): + def wrapper(self, command): + self._commands.append(command) + _add(self, command) + return wrapper + +def command_sequence_remove(_remove): + def wrapper(self, command): + self._commands.remove(command) + _remove(self, command) + return wrapper + +CommandSequence.__init__ = command_sequence_init(CommandSequence.__init__) +CommandSequence.add = command_sequence_add(CommandSequence.add) +CommandSequence.remove = command_sequence_remove(CommandSequence.remove) + +class CalculateMeshLowerLODsCommand(Command): + r""" + CalculateMeshLowerLODsCommand is used to recalculate vertex positions for lower LOD meshes of the specified mesh. + Notes: + The calculation is done based on vertex positions of the specified mesh and vertex texture coordinates of its lower LOD meshes. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_CalculateMeshLowerLODsCommand + + def __init__(self, *args): + _py3dnacalib.CalculateMeshLowerLODsCommand_swiginit(self, _py3dnacalib.new_CalculateMeshLowerLODsCommand(*args)) + + def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to calculate lower LOD meshes from. + :type meshIndex: int + :param meshIndex: + The index of the mesh. + """ + return _py3dnacalib.CalculateMeshLowerLODsCommand_setMeshIndex(self, meshIndex) + + def run(self, output): + return _py3dnacalib.CalculateMeshLowerLODsCommand_run(self, output) + +# Register CalculateMeshLowerLODsCommand in _py3dnacalib: +_py3dnacalib.CalculateMeshLowerLODsCommand_swigregister(CalculateMeshLowerLODsCommand) +class ClearBlendShapesCommand(Command): + r""" + ClearBlendShapesCommand is used to clear all blend shapes data from a DNA. + Notes: This command clears blend shape target deltas and blend shape animation data. By doing so, it transforms the DNA to be "joints only". + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_ClearBlendShapesCommand + + def __init__(self, *args): + _py3dnacalib.ClearBlendShapesCommand_swiginit(self, _py3dnacalib.new_ClearBlendShapesCommand(*args)) + + def run(self, output): + return _py3dnacalib.ClearBlendShapesCommand_run(self, output) + +# Register ClearBlendShapesCommand in _py3dnacalib: +_py3dnacalib.ClearBlendShapesCommand_swigregister(ClearBlendShapesCommand) +class PruneBlendShapeTargetsCommand(Command): + r""" PruneBlendShapeTargetsCommand is used to prune blend shape target deltas whose absolute magnitude is less than or equal to the specified threshold.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_PruneBlendShapeTargetsCommand + + def __init__(self, *args): + _py3dnacalib.PruneBlendShapeTargetsCommand_swiginit(self, _py3dnacalib.new_PruneBlendShapeTargetsCommand(*args)) + + def setThreshold(self, threshold): + r""" + Method for setting the threshold for pruning blend shape target deltas. + :type threshold: float + :param threshold: + The threshold to use. + """ + return _py3dnacalib.PruneBlendShapeTargetsCommand_setThreshold(self, threshold) + + def run(self, output): + return _py3dnacalib.PruneBlendShapeTargetsCommand_run(self, output) + +# Register PruneBlendShapeTargetsCommand in _py3dnacalib: +_py3dnacalib.PruneBlendShapeTargetsCommand_swigregister(PruneBlendShapeTargetsCommand) +class RemoveAnimatedMapCommand(Command): + r""" RemoveAnimatedMapCommand is used to remove animated maps.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RemoveAnimatedMapCommand + + def __init__(self, *args): + _py3dnacalib.RemoveAnimatedMapCommand_swiginit(self, _py3dnacalib.new_RemoveAnimatedMapCommand(*args)) + + def setAnimatedMapIndex(self, animatedMapIndex): + r""" + Method for setting the index of the animated map to remove. + :type animatedMapIndex: int + :param animatedMapIndex: + The index of the animated map. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set animated map(s) will be removed. + """ + return _py3dnacalib.RemoveAnimatedMapCommand_setAnimatedMapIndex(self, animatedMapIndex) + + def setAnimatedMapIndices(self, animatedMapIndices): + r""" + Method for setting the indices of animated maps to remove. + :type animatedMapIndices: dnac::ConstArrayView< std::uint16_t > + :param animatedMapIndices: + The animated map indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set animated map(s) will be removed. + """ + return _py3dnacalib.RemoveAnimatedMapCommand_setAnimatedMapIndices(self, animatedMapIndices) + + def run(self, output): + return _py3dnacalib.RemoveAnimatedMapCommand_run(self, output) + +# Register RemoveAnimatedMapCommand in _py3dnacalib: +_py3dnacalib.RemoveAnimatedMapCommand_swigregister(RemoveAnimatedMapCommand) +class RemoveBlendShapeCommand(Command): + r""" RemoveBlendShapeCommand is used to remove blend shapes.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RemoveBlendShapeCommand + + def __init__(self, *args): + _py3dnacalib.RemoveBlendShapeCommand_swiginit(self, _py3dnacalib.new_RemoveBlendShapeCommand(*args)) + + def setBlendShapeIndex(self, blendShapeIndex): + r""" + Method for setting the index of the blend shape to remove. + :type blendShapeIndex: int + :param blendShapeIndex: + The index of the blend shape. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set blend shape(s) will be removed. + """ + return _py3dnacalib.RemoveBlendShapeCommand_setBlendShapeIndex(self, blendShapeIndex) + + def setBlendShapeIndices(self, blendShapeIndices): + r""" + Method for setting the indices of blend shapes to remove. + :type blendShapeIndices: dnac::ConstArrayView< std::uint16_t > + :param blendShapeIndices: + The blend shape indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set blend shape(s) will be removed. + """ + return _py3dnacalib.RemoveBlendShapeCommand_setBlendShapeIndices(self, blendShapeIndices) + + def run(self, output): + return _py3dnacalib.RemoveBlendShapeCommand_run(self, output) + +# Register RemoveBlendShapeCommand in _py3dnacalib: +_py3dnacalib.RemoveBlendShapeCommand_swigregister(RemoveBlendShapeCommand) +class RemoveJointAnimationCommand(Command): + r""" RemoveJointAnimationCommand is used to remove joint animation data.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RemoveJointAnimationCommand + + def __init__(self, *args): + _py3dnacalib.RemoveJointAnimationCommand_swiginit(self, _py3dnacalib.new_RemoveJointAnimationCommand(*args)) + + def setJointIndex(self, jointIndex): + r""" + Method for setting the index of a joint whose animation data to remove. + :type jointIndex: int + :param jointIndex: + The index of the joint. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint animation(s) will be removed. + """ + return _py3dnacalib.RemoveJointAnimationCommand_setJointIndex(self, jointIndex) + + def setJointIndices(self, jointIndices): + r""" + Method for setting the indices of joints whose animation data to remove. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + The joint indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint animation(s) will be removed. + """ + return _py3dnacalib.RemoveJointAnimationCommand_setJointIndices(self, jointIndices) + + def run(self, output): + return _py3dnacalib.RemoveJointAnimationCommand_run(self, output) + +# Register RemoveJointAnimationCommand in _py3dnacalib: +_py3dnacalib.RemoveJointAnimationCommand_swigregister(RemoveJointAnimationCommand) +class RemoveJointCommand(Command): + r""" RemoveJointCommand is used to remove joints.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RemoveJointCommand + + def __init__(self, *args): + _py3dnacalib.RemoveJointCommand_swiginit(self, _py3dnacalib.new_RemoveJointCommand(*args)) + + def setJointIndex(self, jointIndex): + r""" + Method for setting the index of the joint to remove. + :type jointIndex: int + :param jointIndex: + The index of the joint. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint(s) will be removed. + """ + return _py3dnacalib.RemoveJointCommand_setJointIndex(self, jointIndex) + + def setJointIndices(self, jointIndices): + r""" + Method for setting the indices of joints to remove. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + The joint indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set joint(s) will be removed. + """ + return _py3dnacalib.RemoveJointCommand_setJointIndices(self, jointIndices) + + def run(self, output): + return _py3dnacalib.RemoveJointCommand_run(self, output) + +# Register RemoveJointCommand in _py3dnacalib: +_py3dnacalib.RemoveJointCommand_swigregister(RemoveJointCommand) +class RemoveMeshCommand(Command): + r""" RemoveMeshCommand is used to remove meshes.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RemoveMeshCommand + + def __init__(self, *args): + _py3dnacalib.RemoveMeshCommand_swiginit(self, _py3dnacalib.new_RemoveMeshCommand(*args)) + + def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to remove. + :type meshIndex: int + :param meshIndex: + The index of the mesh. + """ + return _py3dnacalib.RemoveMeshCommand_setMeshIndex(self, meshIndex) + + def setMeshIndices(self, meshIndices): + r""" + Method for setting the indices of meshes to remove. + :type meshIndices: dnac::ConstArrayView< std::uint16_t > + :param meshIndices: + The mesh indices. + Notes: Call to either setter overwrites previous setter calls. When running the command, the last set mesh(es) will be removed. + """ + return _py3dnacalib.RemoveMeshCommand_setMeshIndices(self, meshIndices) + + def run(self, output): + return _py3dnacalib.RemoveMeshCommand_run(self, output) + +# Register RemoveMeshCommand in _py3dnacalib: +_py3dnacalib.RemoveMeshCommand_swigregister(RemoveMeshCommand) +class RenameAnimatedMapCommand(Command): + r""" RenameAnimatedMapCommand is used to rename an animated map.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RenameAnimatedMapCommand + + def __init__(self, *args): + _py3dnacalib.RenameAnimatedMapCommand_swiginit(self, _py3dnacalib.new_RenameAnimatedMapCommand(*args)) + + def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for animated map with given index. + :type animatedMapIndex: int + :param animatedMapIndex: + The index of the animated map whose name to change. + :type newName: string + :param newName: + The new name for the animated map. + + | + + *Overload 2:* + + Method for setting a new name for animated map with given name. + Notes: + The renaming will not happen if there is no animated map with given current name. + :type oldName: string + :param oldName: + The current name of the animated map whose name to change. + :type newName: string + :param newName: + The new name for the animated map. + """ + return _py3dnacalib.RenameAnimatedMapCommand_setName(self, *args) + + def run(self, output): + return _py3dnacalib.RenameAnimatedMapCommand_run(self, output) + +# Register RenameAnimatedMapCommand in _py3dnacalib: +_py3dnacalib.RenameAnimatedMapCommand_swigregister(RenameAnimatedMapCommand) +class RenameBlendShapeCommand(Command): + r""" RenameBlendShapeCommand is used to rename a blend shape channel.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RenameBlendShapeCommand + + def __init__(self, *args): + _py3dnacalib.RenameBlendShapeCommand_swiginit(self, _py3dnacalib.new_RenameBlendShapeCommand(*args)) + + def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for blend shape channel with given index. + :type blendShapeIndex: int + :param blendShapeIndex: + The index of the blend shape channel whose name to change. + :type newName: string + :param newName: + The new name for the blend shape channel. + + | + + *Overload 2:* + + Method for setting a new name for blend shape channel with given name. + Notes: + The renaming will not happen if there is no blend shape channel with given current name. + :type oldName: string + :param oldName: + The current name of the blend shape channel whose name to change. + :type newName: string + :param newName: + The new name for the blend shape channel. + """ + return _py3dnacalib.RenameBlendShapeCommand_setName(self, *args) + + def run(self, output): + return _py3dnacalib.RenameBlendShapeCommand_run(self, output) + +# Register RenameBlendShapeCommand in _py3dnacalib: +_py3dnacalib.RenameBlendShapeCommand_swigregister(RenameBlendShapeCommand) +class RenameJointCommand(Command): + r""" RenameJointCommand is used to rename a joint.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RenameJointCommand + + def __init__(self, *args): + _py3dnacalib.RenameJointCommand_swiginit(self, _py3dnacalib.new_RenameJointCommand(*args)) + + def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for joint with given index. + :type jointIndex: int + :param jointIndex: + The index of the joint whose name to change. + :type newName: string + :param newName: + The new name for the joint. + + | + + *Overload 2:* + + Method for setting a new name for joint with given name. + Notes: + The renaming will not happen if there is no joint with given current name. + :type oldName: string + :param oldName: + The current name of the joint whose name to change. + :type newName: string + :param newName: + The new name for the joint. + """ + return _py3dnacalib.RenameJointCommand_setName(self, *args) + + def run(self, output): + return _py3dnacalib.RenameJointCommand_run(self, output) + +# Register RenameJointCommand in _py3dnacalib: +_py3dnacalib.RenameJointCommand_swigregister(RenameJointCommand) +class RenameMeshCommand(Command): + r""" RenameMeshCommand is used to rename a mesh.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RenameMeshCommand + + def __init__(self, *args): + _py3dnacalib.RenameMeshCommand_swiginit(self, _py3dnacalib.new_RenameMeshCommand(*args)) + + def setName(self, *args): + r""" + *Overload 1:* + + Method for setting a new name for mesh with given index. + :type meshIndex: int + :param meshIndex: + The index of the mesh whose name to change. + :type newName: string + :param newName: + The new name for the mesh. + + | + + *Overload 2:* + + Method for setting a new name for mesh with given name. + Notes: + The renaming will not happen if there is no mesh with given current name. + :type oldName: string + :param oldName: + The current name of the mesh whose name to change. + :type newName: string + :param newName: + The new name for the mesh. + """ + return _py3dnacalib.RenameMeshCommand_setName(self, *args) + + def run(self, output): + return _py3dnacalib.RenameMeshCommand_run(self, output) + +# Register RenameMeshCommand in _py3dnacalib: +_py3dnacalib.RenameMeshCommand_swigregister(RenameMeshCommand) +class RotateCommand(Command): + r""" + RotateCommand is used to rotate neutral joints and vertex positions around given origin. + Notes: + Joint rotations are represented in parent space, so it is enough to rotate only root joints, as that rotation will be propagated to the rest of the joints. + + If the origin is not set, the assumed origin is (0, 0, 0). + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_RotateCommand + + def __init__(self, *args): + _py3dnacalib.RotateCommand_swiginit(self, _py3dnacalib.new_RotateCommand(*args)) + + def setRotation(self, degrees): + r""" + Method for setting the rotation angles. + :type degrees: dnac::Vector3 + :param degrees: + Rotation angles in degrees. + """ + return _py3dnacalib.RotateCommand_setRotation(self, degrees) + + def setOrigin(self, origin): + r""" + Method for setting the rotation origin. + :type origin: dnac::Vector3 + :param origin: + Origin coordinates. + """ + return _py3dnacalib.RotateCommand_setOrigin(self, origin) + + def run(self, output): + return _py3dnacalib.RotateCommand_run(self, output) + +# Register RotateCommand in _py3dnacalib: +_py3dnacalib.RotateCommand_swigregister(RotateCommand) +class ScaleCommand(Command): + r""" + ScaleCommand is used to scale neutral joints, vertex positions and joint and blendshape deltas by a factor. + Notes: + Only translation attributes of neutral joints and joint deltas are scaled. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_ScaleCommand + + def __init__(self, *args): + _py3dnacalib.ScaleCommand_swiginit(self, _py3dnacalib.new_ScaleCommand(*args)) + + def setScale(self, scale): + r""" + Method for setting the scale factor to multiply with. + :type scale: float + :param scale: + Scale factor. + """ + return _py3dnacalib.ScaleCommand_setScale(self, scale) + + def setOrigin(self, origin): + r""" + Method for setting the origin. + Notes: The origin is used to properly scale position values (vertex positions and neutral joint translations). + :type origin: dnac::Vector3 + :param origin: + Origin coordinates. + """ + return _py3dnacalib.ScaleCommand_setOrigin(self, origin) + + def run(self, output): + return _py3dnacalib.ScaleCommand_run(self, output) + +# Register ScaleCommand in _py3dnacalib: +_py3dnacalib.ScaleCommand_swigregister(ScaleCommand) +class SetBlendShapeTargetDeltasCommand(Command): + r""" SetBlendShapeTargetDeltasCommand is used to change blend shape target deltas.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_SetBlendShapeTargetDeltasCommand + + def __init__(self, *args): + _py3dnacalib.SetBlendShapeTargetDeltasCommand_swiginit(self, _py3dnacalib.new_SetBlendShapeTargetDeltasCommand(*args)) + + def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh whose blend shape target to change. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setMeshIndex(self, meshIndex) + + def setBlendShapeTargetIndex(self, blendShapeTargetIndex): + r""" + Method for setting the index of the blend shape target to change. + :type blendShapeTargetIndex: int + :param blendShapeTargetIndex: + The blend shape target index. + """ + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setBlendShapeTargetIndex(self, blendShapeTargetIndex) + + def setDeltas(self, *args): + r""" + *Overload 1:* + + Method for setting the values used to calculate new deltas for blend shape target. + :type deltas: dnac::ConstArrayView< dnac::Vector3 > + :param deltas: + The values used in calculation. + + | + + *Overload 2:* + + Method for setting the values used to calculate new deltas for blend shape target. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X values for each delta. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y values for each delta. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z values for each delta. + """ + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setDeltas(self, *args) + + def setVertexIndices(self, vertexIndices): + r""" + Method for setting the vertex indices that correspond to new deltas. + :type vertexIndices: dnac::ConstArrayView< std::uint32_t > + :param vertexIndices: + The vertexIndices. + """ + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setVertexIndices(self, vertexIndices) + + def setMasks(self, masks): + r""" + Method for setting masks used to calculate new deltas for blend shape target. + Notes: + If no masks are set, default weight value of 1 is used for each delta. + :type masks: dnac::ConstArrayView< float > + :param masks: + The weights for each delta. + """ + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setMasks(self, masks) + + def setOperation(self, operation): + r""" + Method for setting the type of operation used to calculate new deltas for blend shape target. + Notes: + Available operations are: Interpolate, Add, Subtract and Multiply. Each delta is calculated based on the provided operation type in the following way: + + Interpolate: = previousValue * (1 - weight) + setValue * weight:math:`\n Add: \f$newValue = previousValue + (setValue * weight)` + + Subtract: = previousValue - (setValue * weight):math:`\n Multiply: \f$newValue = previousValue * (setValue * weight)` + + + setValue is the value from new deltas that were set, and weight is the value from masks array. + :type operation: int + :param operation: + The operation to use. + """ + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_setOperation(self, operation) + + def run(self, output): + return _py3dnacalib.SetBlendShapeTargetDeltasCommand_run(self, output) + +# Register SetBlendShapeTargetDeltasCommand in _py3dnacalib: +_py3dnacalib.SetBlendShapeTargetDeltasCommand_swigregister(SetBlendShapeTargetDeltasCommand) +cvar = _py3dnacalib.cvar +SetBlendShapeTargetDeltasCommand.VertexIndicesOutOfBoundsError = _py3dnacalib.cvar.SetBlendShapeTargetDeltasCommand_VertexIndicesOutOfBoundsError +SetBlendShapeTargetDeltasCommand.NoVertexIndicesSetError = _py3dnacalib.cvar.SetBlendShapeTargetDeltasCommand_NoVertexIndicesSetError +SetBlendShapeTargetDeltasCommand.DeltasVertexIndicesCountMismatch = _py3dnacalib.cvar.SetBlendShapeTargetDeltasCommand_DeltasVertexIndicesCountMismatch +SetBlendShapeTargetDeltasCommand.DeltasMasksCountMismatch = _py3dnacalib.cvar.SetBlendShapeTargetDeltasCommand_DeltasMasksCountMismatch + +class SetLODsCommand(Command): + r""" SetLODsCommand is used to specify LODs to use. Joints, blend shapes, animated maps and meshes that are not in specified LODs are removed from the DNA.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_SetLODsCommand + + def __init__(self, *args): + _py3dnacalib.SetLODsCommand_swiginit(self, _py3dnacalib.new_SetLODsCommand(*args)) + + def setLODs(self, lods): + r""" + Method for setting the LODs to keep. + :type lods: dnac::ConstArrayView< std::uint16_t > + :param lods: + New LODs to be used. + """ + return _py3dnacalib.SetLODsCommand_setLODs(self, lods) + + def run(self, output): + return _py3dnacalib.SetLODsCommand_run(self, output) + +# Register SetLODsCommand in _py3dnacalib: +_py3dnacalib.SetLODsCommand_swigregister(SetLODsCommand) +class SetNeutralJointRotationsCommand(Command): + r""" SetNeutralJointRotationsCommand is used to set new rotation values to neutral joints.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_SetNeutralJointRotationsCommand + + def __init__(self, *args): + _py3dnacalib.SetNeutralJointRotationsCommand_swiginit(self, _py3dnacalib.new_SetNeutralJointRotationsCommand(*args)) + + def setRotations(self, *args): + r""" + *Overload 1:* + + Method for setting the neutral joint rotations. + :type rotations: dnac::ConstArrayView< dnac::Vector3 > + :param rotations: + Rotation values for each joint. + + | + + *Overload 2:* + + Method for setting the neutral joint rotations. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X rotation value for each joint. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y rotation value for each joint. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z rotation value for each joint. + """ + return _py3dnacalib.SetNeutralJointRotationsCommand_setRotations(self, *args) + + def run(self, output): + return _py3dnacalib.SetNeutralJointRotationsCommand_run(self, output) + +# Register SetNeutralJointRotationsCommand in _py3dnacalib: +_py3dnacalib.SetNeutralJointRotationsCommand_swigregister(SetNeutralJointRotationsCommand) +class SetNeutralJointTranslationsCommand(Command): + r""" SetNeutralJointTranslationsCommand is used to set new translation values to neutral joints.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_SetNeutralJointTranslationsCommand + + def __init__(self, *args): + _py3dnacalib.SetNeutralJointTranslationsCommand_swiginit(self, _py3dnacalib.new_SetNeutralJointTranslationsCommand(*args)) + + def setTranslations(self, *args): + r""" + *Overload 1:* + + Method for setting the neutral joint translations. + :type translations: dnac::ConstArrayView< dnac::Vector3 > + :param translations: + Translation values for each joint. + + | + + *Overload 2:* + + Method for setting the neutral joint translations. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X translation value for each joint. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y translation value for each joint. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z translation value for each joint. + """ + return _py3dnacalib.SetNeutralJointTranslationsCommand_setTranslations(self, *args) + + def run(self, output): + return _py3dnacalib.SetNeutralJointTranslationsCommand_run(self, output) + +# Register SetNeutralJointTranslationsCommand in _py3dnacalib: +_py3dnacalib.SetNeutralJointTranslationsCommand_swigregister(SetNeutralJointTranslationsCommand) +class SetSkinWeightsCommand(Command): + r""" SetSkinWeightsCommand is used to set new skin weights for a vertex in a mesh.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_SetSkinWeightsCommand + + def __init__(self, *args): + _py3dnacalib.SetSkinWeightsCommand_swiginit(self, _py3dnacalib.new_SetSkinWeightsCommand(*args)) + + def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the targeted mesh. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ + return _py3dnacalib.SetSkinWeightsCommand_setMeshIndex(self, meshIndex) + + def setVertexIndex(self, vertexIndex): + r""" + Method for setting the index of the vertex to change. + :type vertexIndex: int + :param vertexIndex: + The vertex index. + """ + return _py3dnacalib.SetSkinWeightsCommand_setVertexIndex(self, vertexIndex) + + def setWeights(self, weights): + r""" + Method for setting the weights with which joints influence the vertex in question. + :type weights: dnac::ConstArrayView< float > + :param weights: + Weights for each joint that has an influence on the vertex. + """ + return _py3dnacalib.SetSkinWeightsCommand_setWeights(self, weights) + + def setJointIndices(self, jointIndices): + r""" + Method for setting the joint indices of joints that influence the vertex in question. + :type jointIndices: dnac::ConstArrayView< std::uint16_t > + :param jointIndices: + Joint indices of joints that have an influence on the vertex. + """ + return _py3dnacalib.SetSkinWeightsCommand_setJointIndices(self, jointIndices) + + def run(self, output): + return _py3dnacalib.SetSkinWeightsCommand_run(self, output) + +# Register SetSkinWeightsCommand in _py3dnacalib: +_py3dnacalib.SetSkinWeightsCommand_swigregister(SetSkinWeightsCommand) +class SetVertexPositionsCommand(Command): + r""" SetVertexPositionsCommand is used to change vertex positions values.""" + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_SetVertexPositionsCommand + + def __init__(self, *args): + _py3dnacalib.SetVertexPositionsCommand_swiginit(self, _py3dnacalib.new_SetVertexPositionsCommand(*args)) + + def setMeshIndex(self, meshIndex): + r""" + Method for setting the index of the mesh to change. + :type meshIndex: int + :param meshIndex: + The mesh index. + """ + return _py3dnacalib.SetVertexPositionsCommand_setMeshIndex(self, meshIndex) + + def setPositions(self, *args): + r""" + *Overload 1:* + + Method for setting the vertex positions used to calculate new values. + :type positions: dnac::ConstArrayView< dnac::Vector3 > + :param positions: + The vertex positions. + + | + + *Overload 2:* + + Method for setting the vertex positions used to calculate new values. + :type xs: dnac::ConstArrayView< float > + :param xs: + The X coordinates for each vertex. + :type ys: dnac::ConstArrayView< float > + :param ys: + The Y coordinates for each vertex. + :type zs: dnac::ConstArrayView< float > + :param zs: + The Z coordinates for each vertex. + """ + return _py3dnacalib.SetVertexPositionsCommand_setPositions(self, *args) + + def setMasks(self, masks): + r""" + Method for setting vertex masks used to calculate new vertex position values. + Notes: + If no masks are set, default weight value of 1 is used for each vertex. + :type masks: dnac::ConstArrayView< float > + :param masks: + The weights for each vertex. + """ + return _py3dnacalib.SetVertexPositionsCommand_setMasks(self, masks) + + def setOperation(self, operation): + r""" + Method for setting the type of operation used to calculate new vertex position values. + Notes: + Available operations are: Interpolate, Add, Subtract and Multiply. Each position is calculated based on the provided operation type in the following way: + + Interpolate: = previousValue * (1 - weight) + setValue * weight:math:`\n Add: \f$newValue = previousValue + (setValue * weight)` + + Subtract: = previousValue - (setValue * weight):math:`\n Multiply: \f$newValue = previousValue * (setValue * weight)` + + + setValue is the value from new positions that were set, and weight is the value from masks array. + :type operation: int + :param operation: + The operation to use. + """ + return _py3dnacalib.SetVertexPositionsCommand_setOperation(self, operation) + + def run(self, output): + return _py3dnacalib.SetVertexPositionsCommand_run(self, output) + +# Register SetVertexPositionsCommand in _py3dnacalib: +_py3dnacalib.SetVertexPositionsCommand_swigregister(SetVertexPositionsCommand) +SetVertexPositionsCommand.PositionsMasksCountMismatch = _py3dnacalib.cvar.SetVertexPositionsCommand_PositionsMasksCountMismatch + +class TranslateCommand(Command): + r""" + TranslateCommand is used to translate neutral joints and vertex positions. + Notes: + Joint translations are represented in parent space, so it is enough to translate only root joints, as that translation will be propagated to the rest of the joints. + """ + + thisown = property(lambda x: x.this.own(), lambda x, v: x.this.own(v), doc="The membership flag") + __repr__ = _swig_repr + __swig_destroy__ = _py3dnacalib.delete_TranslateCommand + + def __init__(self, *args): + _py3dnacalib.TranslateCommand_swiginit(self, _py3dnacalib.new_TranslateCommand(*args)) + + def setTranslation(self, translation): + r""" + Method for setting the translation vector. + :type translation: dnac::Vector3 + :param translation: + The translation vector. + """ + return _py3dnacalib.TranslateCommand_setTranslation(self, translation) + + def run(self, output): + return _py3dnacalib.TranslateCommand_run(self, output) + +# Register TranslateCommand in _py3dnacalib: +_py3dnacalib.TranslateCommand_swigregister(TranslateCommand) + diff --git a/lib/Maya2024/windows/embeddedRL4.mll b/lib/Maya2024/windows/embeddedRL4.mll new file mode 100644 index 0000000..9e1c849 Binary files /dev/null and b/lib/Maya2024/windows/embeddedRL4.mll differ