diff --git a/Jenkinsfile b/Jenkinsfile index 690ad963..1a6e3d8a 100644 --- a/Jenkinsfile +++ b/Jenkinsfile @@ -35,21 +35,21 @@ properties([ disableConcurrentBuilds() ]) @Field final List CHECKOUT_CONFIG = [ [ ba: psl.BA_CHECKOUT ] ] // TODO: abusing grp field to distinguish maya versions per task @Field final List CONFIGS = [ - [ os: cepl.CFG_OS_RHEL7, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_GCC93, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, grp: 'maya2019', maya: PrtAppPipelineLibrary.Dependencies.MAYA2019 ], [ os: cepl.CFG_OS_RHEL7, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_GCC93, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, grp: 'maya2020', maya: PrtAppPipelineLibrary.Dependencies.MAYA2020 ], [ os: cepl.CFG_OS_RHEL7, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_GCC93, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, grp: 'maya2022', maya: PrtAppPipelineLibrary.Dependencies.MAYA2022 ], - [ os: cepl.CFG_OS_WIN10, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_VC1427, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, grp: 'maya2019', maya: PrtAppPipelineLibrary.Dependencies.MAYA2019 ], + [ os: cepl.CFG_OS_RHEL7, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_GCC93, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, grp: 'maya2023', maya: PrtAppPipelineLibrary.Dependencies.MAYA2023 ], [ os: cepl.CFG_OS_WIN10, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_VC1427, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, grp: 'maya2020', maya: PrtAppPipelineLibrary.Dependencies.MAYA2020 ], [ os: cepl.CFG_OS_WIN10, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_VC1427, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, grp: 'maya2022', maya: PrtAppPipelineLibrary.Dependencies.MAYA2022 ], + [ os: cepl.CFG_OS_WIN10, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_VC1427, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, grp: 'maya2023', maya: PrtAppPipelineLibrary.Dependencies.MAYA2023 ], ] @Field final List TEST_CONFIGS = [ - [ os: cepl.CFG_OS_RHEL7, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_GCC93, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, maya: PrtAppPipelineLibrary.Dependencies.MAYA2022 ], - [ os: cepl.CFG_OS_WIN10, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_VC1427, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, maya: PrtAppPipelineLibrary.Dependencies.MAYA2022 ], + [ os: cepl.CFG_OS_RHEL7, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_GCC93, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, maya: PrtAppPipelineLibrary.Dependencies.MAYA2023 ], + [ os: cepl.CFG_OS_WIN10, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_VC1427, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64, maya: PrtAppPipelineLibrary.Dependencies.MAYA2023 ], ] @Field final List INSTALLER_CONFIG = [ [ os: cepl.CFG_OS_WIN10, bc: cepl.CFG_BC_REL, tc: cepl.CFG_TC_VC1427, cc: cepl.CFG_CC_OPT, arch: cepl.CFG_ARCH_X86_64 ] ] -@Field final List INSTALLER_MAYA_VERS = [ 'maya2019', 'maya2020', 'maya2022' ] +@Field final List INSTALLER_MAYA_VERS = [ 'maya2020', 'maya2022', 'maya2023' ] // -- PIPELINE diff --git a/README.md b/README.md index 9b7ea79a..bb5c7eb3 100644 --- a/README.md +++ b/README.md @@ -35,10 +35,10 @@ Please refer to the [release notes](#release-notes) for the supported CityEngine ### Installation #### Software Requirements (Latest Release) -- Windows 10 or 11 (64bit) -- RedHat Enterprise Linux 7 or 8 and compatible (CentOS, Alma Linux, Rocky Linux, ...) -- CityEngine 2022.0 or older -- Autodesk Maya 2019, 2020 or 2022 +- Windows 10 and 11 (64bit) +- RedHat Enterprise Linux 7, 8, 9 and compatible (CentOS, Alma Linux, Rocky Linux, ...) +- CityEngine 2022.1 or older +- Autodesk Maya 2020, 2022 or 2023 #### Windows: Provided Installer 1. Download the MSI installer for the latest [release](https://github.com/Esri/serlio/releases/latest). @@ -96,7 +96,7 @@ Currently we only support one material type per mesh (see [known limitations](#k #### All Platforms * License for CityEngine (2019.0 or later), e.g. to author Rule Packages. * CMake 3.13 or later (http://www.cmake.org) -* Autodesk Maya 2019, 2020 or 2022 or the corresponding development kit +* Autodesk Maya 2020, 2022 or 2023 or the corresponding development kit #### Windows * Windows 7, 8.1 or 10 (64bit) @@ -144,7 +144,7 @@ Currently we only support one material type per mesh (see [known limitations](#k 3. Open a Command Shell in the `serlio\deploy` directory. 4. Run `ant` in the current directioy. Make sure to set at least one valid install path: ``` - ant -D"maya2022.dir"=../install + ant -D"maya2023.dir"=../install ``` 5. The installer will appear in `serlio\build\build_msi`. @@ -152,14 +152,14 @@ Currently we only support one material type per mesh (see [known limitations](#k 1. Open a terminal (e.g. bash). 1. Change into the example directory: `cd /esri-cityengine-sdk/examples/serlio` 1. Create a build directory and change into it: `mkdir build && cd build` -1. Run cmake (adjust the Maya path if necessary): `cmake -Dmaya_DIR=/usr/autodesk/maya2022 ../src` +1. Run cmake (adjust the Maya path if necessary): `cmake -Dmaya_DIR=/usr/autodesk/maya2023 ../src` 1. Compile: `make install` 1. The build result will appear in the `install` directory in parallel to the `build` directory. We will use this as the plugin directory below. ### Install local build #### Windows 1. Locate the `install` directory where you [built](build.md) the plugin, let's call it `PLUGINDIR`. -1. Locate the Maya.env file in your home, usually its in `\Documents\maya\2020`. +1. Locate the Maya.env file in your home, usually its in `\Documents\maya\2023`. 1. Edit Maya.env as follows: ``` :: replace with the actual path @@ -190,6 +190,19 @@ Currently we only support one material type per mesh (see [known limitations](#k ## Release Notes +### v2.2.0 (2023-06-15) +Required Cityengine version: 2023.0 or older. + +#### Added: +* Support for Maya 2023. + +#### Changed: +* Updated Procedural Runtime (PRT) to 3.0 (corresponds to CityEngine 2023.0). +* Fixed sorting of rule attributes in the Attribute Editor to get same behavior as in the CityEngine Inspector. + +#### Removed: +* Support for Maya 2019. + ### v2.1.0 (2022-07-06) Required CityEngine version: 2022.0 or older. #### Added: @@ -289,6 +302,7 @@ Required CityEngine version: 2021.1 or older. ## Known Limitations +* Serlio 2.2 and Maya 2023 **on Linux**: Serlio does not work if the Maya 2023 USD plugin is active at the same time (USD library clash). * Serlio 2.0: In Maya 2019 on Windows, Serlio does not support reading USD assets from RPKs. * Modifying the input shape after a Serlio node is attached is not supported. * Scaling transformations on the initial shape mesh will scale the entire generated model. Make sure that all scaling transformations on the initial shape mesh are frozen before applying a rule ("Modify" > "Freeze Transformations"). diff --git a/deploy/PackageContents.xml.in b/deploy/PackageContents.xml.in index 0f99d84b..9abc544d 100644 --- a/deploy/PackageContents.xml.in +++ b/deploy/PackageContents.xml.in @@ -21,15 +21,6 @@ Email="" /> - - - - - - - - - @@ -47,4 +38,13 @@ + + + + + + + + + diff --git a/deploy/build.xml b/deploy/build.xml index cf82e022..d5646f86 100644 --- a/deploy/build.xml +++ b/deploy/build.xml @@ -16,7 +16,7 @@ - + @@ -40,9 +40,9 @@ - + @@ -88,13 +88,6 @@ - - - - - - - @@ -109,7 +102,14 @@ - + + + + + + + + diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 82e08755..fbb286b1 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -8,10 +8,10 @@ set(SRL_DESCRIPTION "Esri CityEngine Plugin for Autodesk Maya") include(common.cmake) -### version +### version (keep in sync with deploy/build.xml) set(SRL_VERSION_MAJOR 2) -set(SRL_VERSION_MINOR 1) +set(SRL_VERSION_MINOR 2) set(SRL_VERSION_PATCH 0) if (NOT SRL_VERSION_BUILD) diff --git a/src/codec/encoder/MayaEncoder.cpp b/src/codec/encoder/MayaEncoder.cpp index c769ce29..4569f02e 100644 --- a/src/codec/encoder/MayaEncoder.cpp +++ b/src/codec/encoder/MayaEncoder.cpp @@ -75,7 +75,7 @@ constexpr const wchar_t* ENC_DESCRIPTION = L"Encodes geometry into the Maya form const prtx::EncodePreparator::PreparationFlags PREP_FLAGS = prtx::EncodePreparator::PreparationFlags() .instancing(false) - .mergeByMaterial(true) + .meshMerging(prtx::MeshMerging::ALL_OF_SAME_MATERIAL_AND_TYPE) .triangulate(false) .processHoles(prtx::HoleProcessor::TRIANGULATE_FACES_WITH_HOLES) .mergeVertices(true) @@ -554,9 +554,11 @@ class SerializedGeometry { mCounts.push_back(vtxCnt); const uint32_t* vtxIdx = mesh->getFaceVertexIndices(fi); const uint32_t* nrmIdx = mesh->getFaceVertexNormalIndices(fi); + const size_t nrmCnt = mesh->getFaceVertexNormalCount(fi); for (uint32_t vi = 0; vi < vtxCnt; vi++) { mVertexIndices.push_back(vertexIndexBase + vtxIdx[vi]); - mNormalIndices.push_back(normalIndexBase + nrmIdx[vi]); + if (nrmCnt > vi && nrmIdx != nullptr) + mNormalIndices.push_back(normalIndexBase + nrmIdx[vi]); } } diff --git a/src/common.cmake b/src/common.cmake index bb2b0752..b457df11 100644 --- a/src/common.cmake +++ b/src/common.cmake @@ -45,7 +45,7 @@ if (NOT prt_DIR) set(PRT_TC "gcc93") endif () - set(PRT_VERSION "2.6.8300") + set(PRT_VERSION "3.0.8905") set(PRT_CLS "${PRT_OS}-${PRT_TC}-x86_64-rel-opt") set(PRT_URL "https://github.com/esri/cityengine-sdk/releases/download/${PRT_VERSION}/esri_ce_sdk-${PRT_VERSION}-${PRT_CLS}.zip") @@ -79,23 +79,23 @@ if (NOT maya_DIR) else () set(AUTODESK_INSTALL_LOCATION "/usr/autodesk") set(MAYA_BASE_NAME maya) - endif () - if (EXISTS "${AUTODESK_INSTALL_LOCATION}/${MAYA_BASE_NAME}2022") + endif() + if(EXISTS "${AUTODESK_INSTALL_LOCATION}/${MAYA_BASE_NAME}2023") + set(maya_DIR "${AUTODESK_INSTALL_LOCATION}/${MAYA_BASE_NAME}2023") + elseif(EXISTS "${AUTODESK_INSTALL_LOCATION}/${MAYA_BASE_NAME}2022") set(maya_DIR "${AUTODESK_INSTALL_LOCATION}/${MAYA_BASE_NAME}2022") - elseif (EXISTS "${AUTODESK_INSTALL_LOCATION}/${MAYA_BASE_NAME}2020") + elseif(EXISTS "${AUTODESK_INSTALL_LOCATION}/${MAYA_BASE_NAME}2020") set(maya_DIR "${AUTODESK_INSTALL_LOCATION}/${MAYA_BASE_NAME}2020") - elseif (EXISTS "${AUTODESK_INSTALL_LOCATION}/${MAYA_BASE_NAME}2019") - set(maya_DIR "${AUTODESK_INSTALL_LOCATION}/${MAYA_BASE_NAME}2019") endif () endif () # temporary heuristic to detect maya version number -if (maya_DIR MATCHES "[Mm]aya2019") - set(maya_VERSION_MAJOR "2019") -elseif (maya_DIR MATCHES "[Mm]aya2020") +if (maya_DIR MATCHES "[Mm]aya2020") set(maya_VERSION_MAJOR "2020") elseif (maya_DIR MATCHES "[Mm]aya2022") set(maya_VERSION_MAJOR "2022") +elseif (maya_DIR MATCHES "[Mm]aya2023") + set(maya_VERSION_MAJOR "2023") endif () function(srl_add_dependency_maya TGT) diff --git a/src/serlio/CMakeLists.txt b/src/serlio/CMakeLists.txt index cf1c0275..b836449f 100644 --- a/src/serlio/CMakeLists.txt +++ b/src/serlio/CMakeLists.txt @@ -146,7 +146,7 @@ install(FILES ${SRL_PRT_LIBRARIES} DESTINATION ${INSTALL_FOLDER_PREFIX}/plug-ins # PRT: whitelist required extension libraries set(SRL_PRT_EXT_LIBRARIES ${PRT_EXT_LIBRARIES}) -list(FILTER SRL_PRT_EXT_LIBRARIES INCLUDE REGEX "com\\.esri\\.prt\\.(codecs|adaptors|oda|usd)|tbb|usd_ms") +list(FILTER SRL_PRT_EXT_LIBRARIES INCLUDE REGEX "com\\.esri\\.prt\\.(codecs|adaptors|oda|usd)|prt_tbb|prt_usd_ms|libcrypto") install(FILES ${SRL_PRT_EXT_LIBRARIES} DESTINATION ${INSTALL_FOLDER_PREFIX}/plug-ins/ext) install(DIRECTORY "${PRT_EXTENSION_PATH}/usd" DESTINATION ${INSTALL_FOLDER_PREFIX}/plug-ins/ext) # USD resource files diff --git a/src/serlio/modifiers/RuleAttributes.cpp b/src/serlio/modifiers/RuleAttributes.cpp index 557b73df..d2975cd6 100644 --- a/src/serlio/modifiers/RuleAttributes.cpp +++ b/src/serlio/modifiers/RuleAttributes.cpp @@ -49,8 +49,12 @@ std::wstring getBriefName(const std::wstring& fqAttrName, std::map= GroupSizeA) + return false; + + // b descendant of a + if (groupIdx >= GroupSizeB) + return true; + + // difference in groups + if (a.groups[groupIdx] != b.groups[groupIdx]) + return a.groups[groupIdx] < b.groups[groupIdx]; } - return a.groups[i]; + return false; + }; + + auto compareOrderToGroupOrder = [](const RuleAttribute& ruleAttrWithGroups, + const RuleAttribute& ruleAttrWithoutGroups) { + if ((ruleAttrWithGroups.groups.size() > 0) && + (ruleAttrWithGroups.globalGroupOrder == ruleAttrWithoutGroups.order)) + return ruleAttrWithGroups.groups[0] <= getAttrBaseName(ruleAttrWithoutGroups.fqName); + + return ruleAttrWithGroups.globalGroupOrder < ruleAttrWithoutGroups.order; }; - auto compareGroups = [&](const RuleAttribute& a, const RuleAttribute& b) { + auto compareGroupOrder = [&](const RuleAttribute& a, const RuleAttribute& b) { + if (b.groups.empty()) + return compareOrderToGroupOrder(a, b); + + if (a.groups.empty()) + return !compareOrderToGroupOrder(b, a); + if (isChildOf(a, b)) return false; // child a should be sorted after parent b @@ -235,16 +259,12 @@ bool RuleAttributeCmp::operator()(const RuleAttribute& lhs, const RuleAttribute& if (globalOrderA != globalOrderB) return (globalOrderA < globalOrderB); - // sort higher level before lower level - if (a.groups.size() != b.groups.size()) - return (a.groups.size() < b.groups.size()); - - return lowerCaseOrdering(firstDifferentGroupInA(a, b), firstDifferentGroupInA(b, a)); + return compareGroups(a, b); }; - auto compareAttributeOrder = [&](const RuleAttribute& a, const RuleAttribute& b) { + auto compareAttributeOrder = [](const RuleAttribute& a, const RuleAttribute& b) { if (a.order == b.order) - return lowerCaseOrdering(a.fqName, b.fqName); + return getAttrBaseName(a.fqName) < getAttrBaseName(b.fqName); return a.order < b.order; }; @@ -254,7 +274,7 @@ bool RuleAttributeCmp::operator()(const RuleAttribute& lhs, const RuleAttribute& return compareRuleFile(a, b); if (a.groups != b.groups) - return compareGroups(a, b); + return compareGroupOrder(a, b); return compareAttributeOrder(a, b); }; diff --git a/src/serlio/utils/Utilities.h b/src/serlio/utils/Utilities.h index 6cf17b6b..566fc39b 100644 --- a/src/serlio/utils/Utilities.h +++ b/src/serlio/utils/Utilities.h @@ -151,6 +151,7 @@ std::string objectToXML(std::unique_ptr& ptr) { AttributeMapUPtr createValidatedOptions(const wchar_t* encID, const prt::AttributeMap* unvalidatedOptions = nullptr); inline std::wstring getRuleFileEntry(ResolveMapSPtr resolveMap) { +#if PRT_VERSION_MAJOR < 3 const std::wstring sCGB(L".cgb"); size_t nKeys; @@ -162,6 +163,14 @@ inline std::wstring getRuleFileEntry(ResolveMapSPtr resolveMap) { } return {}; +#else + prt::Status status = prt::STATUS_UNSPECIFIED_ERROR; + const wchar_t* cgbKey = resolveMap->findCGBKey(&status); + if (cgbKey == nullptr || (status != prt::STATUS_OK)) + return {}; + + return std::wstring(cgbKey); +#endif } constexpr const wchar_t* ANNOT_START_RULE = L"@StartRule";