Skip to content

Commit

Permalink
Merge pull request #165 from Esri/develop
Browse files Browse the repository at this point in the history
Release 2.2.0
  • Loading branch information
mistafunk authored Jun 29, 2023
2 parents ab8f5e6 + b8b4379 commit ced4954
Show file tree
Hide file tree
Showing 10 changed files with 115 additions and 70 deletions.
10 changes: 5 additions & 5 deletions Jenkinsfile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
30 changes: 22 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -144,22 +144,22 @@ 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`.

#### Linux
1. Open a terminal (e.g. bash).
1. Change into the example directory: `cd <your path to>/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 `<home directory>\Documents\maya\2020`.
1. Locate the Maya.env file in your home, usually its in `<home directory>\Documents\maya\2023`.
1. Edit Maya.env as follows:
```
:: replace <PLUGINDIR> with the actual path
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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").
Expand Down
18 changes: 9 additions & 9 deletions deploy/PackageContents.xml.in
Original file line number Diff line number Diff line change
Expand Up @@ -21,15 +21,6 @@
Email="" />

<!-- OS: Valid values seem to be win64|macOS|linux -->
<Components>
<RuntimeRequirements SupportPath="./2019/doc" OS="@SRL_INST_OS@" Platform="Maya" SeriesMin="2019" SeriesMax="2019" />
<MayaEnv expr="PATH+:=2019/plug-ins/" />
<MayaEnv expr="MAYA_PLUG_IN_PATH+:=2019/plug-ins/" />
<MayaEnv expr="MAYA_SCRIPT_PATH+:=2019/scripts/" />
<MayaEnv expr="XBMLANGPATH+:=2019/icons/" />
<ComponentEntry ModuleName="@MLL_NAME@.mll" AutoLoad="True" />
</Components>

<Components>
<RuntimeRequirements SupportPath="./2020/doc" OS="@SRL_INST_OS@" Platform="Maya" SeriesMin="2020" SeriesMax="2020" />
<MayaEnv expr="PATH+:=2020/plug-ins/" />
Expand All @@ -47,4 +38,13 @@
<MayaEnv expr="XBMLANGPATH+:=2022/icons/" />
<ComponentEntry ModuleName="@MLL_NAME@.mll" AutoLoad="True" />
</Components>

<Components>
<RuntimeRequirements SupportPath="./2023/doc" OS="@SRL_INST_OS@" Platform="Maya" SeriesMin="2023" SeriesMax="2023" />
<MayaEnv expr="PATH+:=2023/plug-ins/" />
<MayaEnv expr="MAYA_PLUG_IN_PATH+:=2023/plug-ins/" />
<MayaEnv expr="MAYA_SCRIPT_PATH+:=2023/scripts/" />
<MayaEnv expr="XBMLANGPATH+:=2023/icons/" />
<ComponentEntry ModuleName="@MLL_NAME@.mll" AutoLoad="True" />
</Components>
</ApplicationPackage>
20 changes: 10 additions & 10 deletions deploy/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

<property name="serlio.vendor" value="Esri R&amp;amp;D Center Zurich" />
<property name="serlio.version.major" value="2" />
<property name="serlio.version.minor" value="1" />
<property name="serlio.version.minor" value="2" />
<property name="serlio.version.patch" value="0" />
<property name="serlio.version.mmp" value="${serlio.version.major}.${serlio.version.minor}.${serlio.version.patch}" />
<property name="serlio.version.preRelease" value="" />
Expand All @@ -40,9 +40,9 @@
<condition>
<not>
<or>
<isset property="maya2019.dir" />
<isset property="maya2020.dir" />
<isset property="maya2022.dir" />
<isset property="maya2023.dir" />
</or>
</not>
</condition>
Expand Down Expand Up @@ -88,13 +88,6 @@
</copy>
</target>

<target name="copy2019" depends="prepare" if="maya2019.dir">
<mkdir dir="${install.dir}\2019" />
<copy todir="${install.dir}\2019" >
<fileset dir="${maya2019.dir}" />
</copy>
</target>

<target name="copy2020" depends="prepare" if="maya2020.dir">
<mkdir dir="${install.dir}\2020" />
<copy todir="${install.dir}\2020" >
Expand All @@ -109,7 +102,14 @@
</copy>
</target>

<target name="harvest" depends="copy2019,copy2020,copy2022">
<target name="copy2023" depends="prepare" if="maya2023.dir">
<mkdir dir="${install.dir}\2023" />
<copy todir="${install.dir}\2023" >
<fileset dir="${maya2023.dir}" />
</copy>
</target>

<target name="harvest" depends="copy2020,copy2022,copy2023">
<exec executable="heat">
<arg line="dir ${install.dir}" />
<arg line="-dr SerlioInstallComponentDir" />
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
6 changes: 4 additions & 2 deletions src/codec/encoder/MayaEncoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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]);
}
}

Expand Down
18 changes: 9 additions & 9 deletions src/common.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/serlio/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
68 changes: 44 additions & 24 deletions src/serlio/modifiers/RuleAttributes.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,12 @@ std::wstring getBriefName(const std::wstring& fqAttrName, std::map<std::wstring,
return briefName + prtu::getDuplicateCountSuffix(briefName, mayaNameDuplicateCountMap);
}

std::wstring getAttrBaseName(const std::wstring& fqAttrName) {
return prtu::removeImport(prtu::removeStyle(fqAttrName));
}

std::wstring getNiceName(const std::wstring& fqAttrName) {
return prtu::cleanNameForMaya(prtu::removeImport(prtu::removeStyle(fqAttrName)));
return prtu::cleanNameForMaya(getAttrBaseName(fqAttrName));
}

} // namespace
Expand Down Expand Up @@ -178,13 +182,7 @@ RuleAttributeSet getRuleAttributes(const std::wstring& ruleFile, const prt::Rule
}

bool RuleAttributeCmp::operator()(const RuleAttribute& lhs, const RuleAttribute& rhs) const {
auto lowerCaseOrdering = [](std::wstring a, std::wstring b) {
std::transform(a.begin(), a.end(), a.begin(), ::tolower);
std::transform(b.begin(), b.end(), b.begin(), ::tolower);
return a < b;
};

auto compareRuleFile = [&](const RuleAttribute& a, const RuleAttribute& b) {
auto compareRuleFile = [](const RuleAttribute& a, const RuleAttribute& b) {
// sort main rule attributes before the rest
if (a.memberOfStartRuleFile && !b.memberOfStartRuleFile)
return true;
Expand All @@ -194,7 +192,7 @@ bool RuleAttributeCmp::operator()(const RuleAttribute& lhs, const RuleAttribute&
if (a.ruleOrder != b.ruleOrder)
return a.ruleOrder < b.ruleOrder;

return lowerCaseOrdering(a.ruleFile, b.ruleFile);
return a.ruleFile < b.ruleFile;
};

auto isChildOf = [](const RuleAttribute& child, const RuleAttribute& parent) {
Expand All @@ -214,16 +212,42 @@ bool RuleAttributeCmp::operator()(const RuleAttribute& lhs, const RuleAttribute&
return true;
};

auto firstDifferentGroupInA = [](const RuleAttribute& a, const RuleAttribute& b) {
assert(a.groups.size() == b.groups.size());
size_t i = 0;
while ((i < a.groups.size()) && (a.groups[i] == b.groups[i])) {
i++;
auto compareGroups = [](const RuleAttribute& a, const RuleAttribute& b) {
const size_t GroupSizeA = a.groups.size();
const size_t GroupSizeB = b.groups.size();

for (size_t groupIdx = 0; groupIdx < std::max(GroupSizeA, GroupSizeB); ++groupIdx) {
// a descendant of b
if (groupIdx >= 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

Expand All @@ -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;
};
Expand All @@ -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);
};
Expand Down
Loading

0 comments on commit ced4954

Please sign in to comment.