-
Notifications
You must be signed in to change notification settings - Fork 202
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #206 from Autodesk/donnels/MAYA-101325/new_import_…
…ui_feature_wip New Import UI feature - WIP
- Loading branch information
Showing
37 changed files
with
2,597 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,160 @@ | ||
// | ||
// Copyright 2019 Autodesk | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
#include "importData.h" | ||
|
||
#include <type_traits> | ||
|
||
MAYAUSD_NS_DEF { | ||
|
||
//------------------------------------------------------------------------------ | ||
// ImportData: | ||
//------------------------------------------------------------------------------ | ||
|
||
constexpr const char* kRootPrimPath = "/"; | ||
|
||
ImportData::ImportData() | ||
: fLoadSet(UsdStage::InitialLoadSet::LoadAll) | ||
, fRootPrimPath(kRootPrimPath) | ||
{ | ||
} | ||
|
||
ImportData::ImportData(const std::string& f) | ||
: fLoadSet(UsdStage::InitialLoadSet::LoadAll) | ||
, fRootPrimPath(kRootPrimPath) | ||
, fFilename(f) | ||
{ | ||
} | ||
|
||
/*static*/ | ||
ImportData& ImportData::instance() | ||
{ | ||
static ImportData sImportData; | ||
return sImportData; | ||
} | ||
|
||
/*static*/ | ||
const ImportData& ImportData::cinstance() | ||
{ | ||
return instance(); | ||
} | ||
|
||
void ImportData::clearData() | ||
{ | ||
fLoadSet = UsdStage::InitialLoadSet::LoadAll; | ||
UsdStagePopulationMask tmpPopMask; | ||
fPopMask.swap(tmpPopMask); | ||
fRootVariants.clear(); | ||
fPrimVariants.clear(); | ||
fFilename.clear(); | ||
fRootPrimPath = kRootPrimPath; | ||
} | ||
|
||
bool ImportData::empty() const | ||
{ | ||
// If we don't have a filename set then we are empty. | ||
return fFilename.empty(); | ||
} | ||
|
||
const std::string& ImportData::filename() const | ||
{ | ||
return fFilename; | ||
} | ||
|
||
void ImportData::setFilename(const std::string& f) | ||
{ | ||
// If the input filename doesn't match what we have stored (empty or not) we | ||
// clear the data because it doesn't belong to the new file. | ||
if (fFilename != f) | ||
clearData(); | ||
fFilename = f; | ||
} | ||
|
||
const std::string& ImportData::rootPrimPath() const | ||
{ | ||
return fRootPrimPath; | ||
} | ||
|
||
void ImportData::setRootPrimPath(const std::string& primPath) | ||
{ | ||
fRootPrimPath = primPath; | ||
} | ||
|
||
bool ImportData::hasPopulationMask() const | ||
{ | ||
return !fPopMask.IsEmpty(); | ||
} | ||
|
||
const UsdStagePopulationMask& ImportData::stagePopulationMask() const | ||
{ | ||
return fPopMask; | ||
} | ||
|
||
void ImportData::setStagePopulationMask(const UsdStagePopulationMask& mask) | ||
{ | ||
fPopMask = mask; | ||
} | ||
|
||
void ImportData::setStagePopulationMask(UsdStagePopulationMask&& mask) | ||
{ | ||
fPopMask = std::move(mask); | ||
} | ||
|
||
UsdStage::InitialLoadSet ImportData::stageInitialLoadSet() const | ||
{ | ||
return fLoadSet; | ||
} | ||
|
||
void ImportData::setStageInitialLoadSet(UsdStage::InitialLoadSet loadSet) | ||
{ | ||
fLoadSet = loadSet; | ||
} | ||
|
||
bool ImportData::hasVariantSelections() const | ||
{ | ||
return !(fRootVariants.empty() || fPrimVariants.empty()); | ||
} | ||
|
||
const SdfVariantSelectionMap& ImportData::rootVariantSelections() const | ||
{ | ||
return fRootVariants; | ||
} | ||
|
||
const ImportData::PrimVariantSelections& ImportData::primVariantSelections() const | ||
{ | ||
return fPrimVariants; | ||
} | ||
|
||
void ImportData::setRootVariantSelections(const SdfVariantSelectionMap& vars) | ||
{ | ||
fRootVariants = vars; | ||
} | ||
|
||
void ImportData::setRootVariantSelections(SdfVariantSelectionMap&& vars) | ||
{ | ||
fRootVariants = std::move(vars); | ||
} | ||
|
||
void ImportData::setPrimVariantSelections(const PrimVariantSelections& vars) | ||
{ | ||
fPrimVariants = vars; | ||
} | ||
|
||
void ImportData::setPrimVariantSelections(PrimVariantSelections&& vars) | ||
{ | ||
fPrimVariants = std::move(vars); | ||
} | ||
|
||
} // namespace MayaUsd |
Oops, something went wrong.