Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 2 additions & 10 deletions lib/lookdevXUsd/UsdLookdevHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,9 @@

#include <usdUfe/ufe/Global.h>
#include <usdUfe/ufe/UsdUndoAddNewPrimCommand.h>
#include <usdUfe/ufe/UsdUndoMaterialCommands.h>
#include <usdUfe/ufe/Utils.h>

#ifdef LDX_USD_USE_MAYAUSDAPI
#include <mayaUsdAPI/utils.h>
#endif

namespace
{

Expand Down Expand Up @@ -107,7 +104,6 @@ Ufe::SceneItemResultUndoableCommand::Ptr UsdLookdevHandler::createLookdevContain
Ufe::SceneItemResultUndoableCommand::Ptr UsdLookdevHandler::createLookdevContainerCmdImpl(
const Ufe::SceneItem::Ptr& parent, const Ufe::NodeDef::Ptr& nodeDef) const
{
#ifdef LDX_USD_USE_MAYAUSDAPI
auto usdParent = UsdUfe::downcast(parent);
auto prim = usdParent ? usdParent->prim() : PXR_NS::UsdPrim();
if (!prim.IsValid())
Expand All @@ -120,16 +116,12 @@ Ufe::SceneItemResultUndoableCommand::Ptr UsdLookdevHandler::createLookdevContain
return nullptr;
}

auto cmd =
std::dynamic_pointer_cast<Ufe::InsertChildCommand>(MayaUsdAPI::addNewMaterialCommand(parent, nodeDef->type()));
Comment thread
seando-adsk marked this conversation as resolved.
auto cmd = UsdUfe::UsdUndoAddNewMaterialCommand::create(usdParent, nodeDef->type());
if (!cmd)
{
return nullptr;
}
return WrapInsertChildCommand::create(cmd);
#else
return nullptr;
#endif
}

Ufe::SceneItemResultUndoableCommand::Ptr UsdLookdevHandler::createLookdevEnvironmentCmdImpl(
Expand Down
10 changes: 2 additions & 8 deletions lib/lookdevXUsd/UsdMaterialCommands.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,9 @@
//*****************************************************************************
#include "UsdMaterialCommands.h"

#include <usdUfe/ufe/UsdUndoMaterialCommands.h>
#include <usdUfe/ufe/Utils.h>

#ifdef LDX_USD_USE_MAYAUSDAPI
#include <mayaUsdAPI/utils.h>
#endif

namespace LookdevXUsd
{

Expand Down Expand Up @@ -55,11 +52,8 @@ void UsdCreateMaterialParentCommand::execute()
return;
}

#ifdef LDX_USD_USE_MAYAUSDAPI
// Create a materials scope.
m_cmd = std::dynamic_pointer_cast<Ufe::SceneItemResultUndoableCommand>(
MayaUsdAPI::createMaterialsScopeCommand(m_ancestor));
Comment thread
seando-adsk marked this conversation as resolved.
#endif
m_cmd = UsdUfe::UsdUndoCreateMaterialsScopeCommand::create(usdItem);
if (!m_cmd)
{
return;
Expand Down
Loading